From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 00:13:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C1CA784E; Sun, 27 Oct 2013 00:13:30 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA9032B34; Sun, 27 Oct 2013 00:13:29 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id hp15so4159364lab.18 for ; Sat, 26 Oct 2013 17:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=mEPFD/eEc/lhooOEr9GT2KJkdn5FiH8s/qSJ0Wf2/KQ=; b=ECjtUVDZJTPkIolI66oF8h93kYg5Dukb99FVkgrQBexk9vgXbVa8csGuwS5lUfLxUG FTNi8Af6eeal6KMPoC4Jp0Z7u9JjRQo97pN+IT7N0g1Atx0sAcoW9NpeJprAP3ZSdIgX 1G3jxmJxKRg1P+2ZYDFH2ge/2KaZhLBA+CLRYmSkR7kCJeERdsk0r9EpITqceXfK0/lo VHT/mCGhkvYbdUeqkovumnEzI5xeFZR9AqCg6CRiHJBBDuZ72xESAH5PhGVNy6J4Baaf IKL9Hjlh34Ob0N+91vtbG5PZbinGBuYOuuz4noFDQSyg0lJHBeQCE/4tC5doa70jUuQ2 OBEQ== X-Received: by 10.152.29.103 with SMTP id j7mr9418564lah.7.1382832807697; Sat, 26 Oct 2013 17:13:27 -0700 (PDT) Received: from orwell.Elisa.gmail.com (a91-154-115-217.elisa-laajakaista.fi. [91.154.115.217]) by mx.google.com with ESMTPSA id e4sm7579296lba.15.2013.10.26.17.13.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 26 Oct 2013 17:13:26 -0700 (PDT) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: David Chisnall Subject: Re: svn commit: r253260 - head/lib/msun/src References: <201307121103.r6CB3qrh068782@svn.freebsd.org> Date: Sun, 27 Oct 2013 03:13:18 +0300 In-Reply-To: <201307121103.r6CB3qrh068782@svn.freebsd.org> (David Chisnall's message of "Fri, 12 Jul 2013 11:03:52 +0000 (UTC)") Message-ID: <86d2mrd10h.fsf@orwell.Elisa> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 00:13:30 -0000 David Chisnall writes: > Author: theraven > Date: Fri Jul 12 11:03:51 2013 > New Revision: 253260 > URL: http://svnweb.freebsd.org/changeset/base/253260 > > Log: > Fix the build with C++ where __builtin_types_compatible_p is not allowed. > > Modified: > head/lib/msun/src/math.h > > Modified: head/lib/msun/src/math.h > ============================================================================== > --- head/lib/msun/src/math.h Fri Jul 12 10:07:48 2013 (r253259) > +++ head/lib/msun/src/math.h Fri Jul 12 11:03:51 2013 (r253260) > @@ -81,12 +81,13 @@ extern const union __nan_un { > #define FP_SUBNORMAL 0x08 > #define FP_ZERO 0x10 > > -#if __STDC_VERSION__ >= 201112L && defined(__clang__) > +#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ > + __has_extension(c_generic_selections) > #define __fp_type_select(x, f, d, ld) _Generic((x), \ > float: f(x), \ > double: d(x), \ > long double: ld(x)) One of the things that's making cad/brlcad fail with clang is some C code that calls isnan() and isinf() with -std=gnu89, -Werror and -Wc11-extensions: /s/brlcad/src/libbn/ulp.c:170:9: error: generic selections are a C11-specific feature [-Werror,-Wc11-extensions] if (isnan(val) || isinf(val)) ^ /usr/include/math.h:118:2: note: expanded from macro 'isnan' __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl) ^ /usr/include/math.h:86:39: note: expanded from macro '__fp_type_select' #define __fp_type_select(x, f, d, ld) _Generic((x), \ ^ Can the check there be improved somehow to avoid this kind of error? From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 00:18:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 83D0699D; Sun, 27 Oct 2013 00:18:38 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79CD22B46; Sun, 27 Oct 2013 00:18:37 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id eh20so4128543lab.39 for ; Sat, 26 Oct 2013 17:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=tVVCAVvKK360SiFydl//j7SKqe7CS7/i0lj9kHiAyvI=; b=mPQ5afvs2YK7pPKFhmW/iFVEp9DrPcl0VxcZCBgZ12cKsBHvolYsNePbPixFijUXwz tgH5l2MNSjqbVmVfcmhTXW6uo/He4k24zODnPqK8WLtpglkv/QB1rEri8p2dbTR+YTYJ +B81HCpx+/2geHYZHwuvmcbG5ebM+9xYXLDShDqbC/BOIl1pN0RU0dH+UvI3RA+pnaq6 gkqAHEN9HRHlhjxNHj3MTmZPjqKZN7Tp5qZ6x7L/NQavcO2FEEBJlhg2fv77diqqdqd1 y+oGY6T88G6ZrFojEKlS+pia3ZN5pOQu7Sb5oiM5mQQg4Eai2b1hg8ab9bI8Eafgt1bV HcbA== X-Received: by 10.152.23.137 with SMTP id m9mr9628639laf.17.1382833115481; Sat, 26 Oct 2013 17:18:35 -0700 (PDT) Received: from orwell.Elisa.gmail.com (a91-154-115-217.elisa-laajakaista.fi. [91.154.115.217]) by mx.google.com with ESMTPSA id qj3sm3890151lbb.6.2013.10.26.17.18.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 26 Oct 2013 17:18:34 -0700 (PDT) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: David Chisnall Subject: Re: svn commit: r253260 - head/lib/msun/src References: <201307121103.r6CB3qrh068782@svn.freebsd.org> <86d2mrd10h.fsf__46266.7496213273$1382832829$gmane$org@orwell.Elisa> Date: Sun, 27 Oct 2013 03:18:30 +0300 In-Reply-To: <86d2mrd10h.fsf__46266.7496213273$1382832829$gmane$org@orwell.Elisa> (Raphael Kubo da Costa's message of "Sun, 27 Oct 2013 03:13:18 +0300") Message-ID: <868uxfd0rt.fsf@orwell.Elisa> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 00:18:38 -0000 Raphael Kubo da Costa writes: > David Chisnall writes: > >> Author: theraven >> Date: Fri Jul 12 11:03:51 2013 >> New Revision: 253260 >> URL: http://svnweb.freebsd.org/changeset/base/253260 >> >> Log: >> Fix the build with C++ where __builtin_types_compatible_p is not allowed. >> >> Modified: >> head/lib/msun/src/math.h >> >> Modified: head/lib/msun/src/math.h >> ============================================================================== >> --- head/lib/msun/src/math.h Fri Jul 12 10:07:48 2013 (r253259) >> +++ head/lib/msun/src/math.h Fri Jul 12 11:03:51 2013 (r253260) >> @@ -81,12 +81,13 @@ extern const union __nan_un { >> #define FP_SUBNORMAL 0x08 >> #define FP_ZERO 0x10 >> >> -#if __STDC_VERSION__ >= 201112L && defined(__clang__) >> +#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ >> + __has_extension(c_generic_selections) >> #define __fp_type_select(x, f, d, ld) _Generic((x), \ >> float: f(x), \ >> double: d(x), \ >> long double: ld(x)) > > One of the things that's making cad/brlcad fail with clang is some C > code that calls isnan() and isinf() with -std=gnu89, -Werror and > -Wc11-extensions: (To be fair, it's -pedantic that brings in -Wc11-extensions) From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 00:51:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1AE3DE38; Sun, 27 Oct 2013 00:51:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0540C2CE1; Sun, 27 Oct 2013 00:51:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R0ppg8024054; Sun, 27 Oct 2013 00:51:51 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R0pl3j024025; Sun, 27 Oct 2013 00:51:47 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310270051.r9R0pl3j024025@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Oct 2013 00:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i8032... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 00:51:52 -0000 Author: ian Date: Sun Oct 27 00:51:46 2013 New Revision: 257199 URL: http://svnweb.freebsd.org/changeset/base/257199 Log: Remove all #include from arm code. It's already included by vm/pmap.h, which is a prerequisite for arm/machine/pmap.h so there's no reason to ever include it directly. Thanks to alc@ for pointing this out. Modified: head/sys/arm/allwinner/a10_machdep.c head/sys/arm/arm/machdep.c head/sys/arm/arm/minidump_machdep.c head/sys/arm/arm/nexus.c head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/freescale/imx/imx_machdep.c head/sys/arm/include/fdt.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mvvar.h head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/sa11x0/sa11x0_io.c head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/omap4/pandaboard/pandaboard.c head/sys/arm/ti/ti_machdep.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xscale/i80321/i80321_pci.c head/sys/arm/xscale/i8134x/i81342_pci.c head/sys/arm/xscale/ixp425/ixp425_pci.c Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/arm/machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/arm/minidump_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include #include #include #include Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/arm/nexus.c Sun Oct 27 00:51:46 2013 (r257199) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Sun Oct 27 00:51:46 2013 (r257199) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bcm2835_dma.h" #include "bcm2835_vcbus.h" Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/freescale/imx/imx_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include #include Modified: head/sys/arm/include/fdt.h ============================================================================== --- head/sys/arm/include/fdt.h Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/include/fdt.h Sun Oct 27 00:51:46 2013 (r257199) @@ -38,7 +38,6 @@ #include #include -#include #include /* Max interrupt number */ Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/lpc/lpc_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include #include Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/mv/mv_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include /* XXX */ #include /* XXX eventually this should be eliminated */ Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/mv/mvvar.h Sun Oct 27 00:51:46 2013 (r257199) @@ -44,7 +44,6 @@ #include #include #include -#include #include #define MV_TYPE_PCI 0 Modified: head/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- head/sys/arm/mv/orion/db88f5xxx.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/mv/orion/db88f5xxx.c Sun Oct 27 00:51:46 2013 (r257199) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/rockchip/rk30xx_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/sa11x0/sa11x0_io.c ============================================================================== --- head/sys/arm/sa11x0/sa11x0_io.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/sa11x0/sa11x0_io.c Sun Oct 27 00:51:46 2013 (r257199) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* Proto types for all the bus_space structure functions */ Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/tegra/tegra2_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/ti/omap4/pandaboard/pandaboard.c ============================================================================== --- head/sys/arm/ti/omap4/pandaboard/pandaboard.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/ti/omap4/pandaboard/pandaboard.c Sun Oct 27 00:51:46 2013 (r257199) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/ti/ti_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/versatile/versatile_machdep.c ============================================================================== --- head/sys/arm/versatile/versatile_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/versatile/versatile_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/xilinx/zy7_machdep.c Sun Oct 27 00:51:46 2013 (r257199) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/xscale/i80321/i80321_pci.c ============================================================================== --- head/sys/arm/xscale/i80321/i80321_pci.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/xscale/i80321/i80321_pci.c Sun Oct 27 00:51:46 2013 (r257199) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/xscale/i8134x/i81342_pci.c ============================================================================== --- head/sys/arm/xscale/i8134x/i81342_pci.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/xscale/i8134x/i81342_pci.c Sun Oct 27 00:51:46 2013 (r257199) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci.c Sat Oct 26 23:41:11 2013 (r257198) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Sun Oct 27 00:51:46 2013 (r257199) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 01:34:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E21EE631; Sun, 27 Oct 2013 01:34:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB0B92E89; Sun, 27 Oct 2013 01:34:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R1YOgZ037844; Sun, 27 Oct 2013 01:34:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R1YBbI037760; Sun, 27 Oct 2013 01:34:11 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310270134.r9R1YBbI037760@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Oct 2013 01:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257200 - in head/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx include lpc mv rockchip samsung/exynos tegra ti ti/am335x ti/omap4 ti/twl versatile xili... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 01:34:25 -0000 Author: ian Date: Sun Oct 27 01:34:10 2013 New Revision: 257200 URL: http://svnweb.freebsd.org/changeset/base/257200 Log: Remove #include from all the arm code that doesn't really need it. That would be almost everywhere it was included. Add it in a couple files that really do need it and were previously getting it by accident via another header. Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_machdep.c head/sys/arm/allwinner/a20/a20_cpu_cfg.c head/sys/arm/allwinner/timer.c head/sys/arm/arm/genassym.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/arm/mpcore_timer.c head/sys/arm/arm/vfp.c head/sys/arm/arm/vm_machdep.c head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_pmc.c head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/broadcom/bcm2835/bcm2835_spi.c head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c head/sys/arm/econa/timer.c head/sys/arm/freescale/imx/imx51_ipuv3.c head/sys/arm/freescale/imx/imx_gpt.c head/sys/arm/freescale/imx/imx_machdep.c head/sys/arm/include/cpu.h head/sys/arm/include/pcb.h head/sys/arm/include/pcpu.h head/sys/arm/include/undefined.h head/sys/arm/lpc/lpc_fb.c head/sys/arm/lpc/lpc_gpio.c head/sys/arm/lpc/lpc_machdep.c head/sys/arm/lpc/lpc_mmc.c head/sys/arm/lpc/lpc_spi.c head/sys/arm/lpc/lpc_timer.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/timer.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/rockchip/rk30xx_grf.c head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/rockchip/rk30xx_pmu.c head/sys/arm/samsung/exynos/arch_timer.c head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/am335x/am335x_dmtimer.c head/sys/arm/ti/am335x/am335x_lcd_syscons.c head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/am335x/am335x_scm_padconf.c head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/arm/ti/omap4/omap4_scm_padconf.c head/sys/arm/ti/ti_cpuid.c head/sys/arm/ti/ti_machdep.c head/sys/arm/ti/ti_mmchs.c head/sys/arm/ti/ti_prcm.c head/sys/arm/ti/ti_scm.c head/sys/arm/ti/twl/twl.c head/sys/arm/ti/twl/twl_clks.c head/sys/arm/ti/twl/twl_vreg.c head/sys/arm/versatile/pl050.c head/sys/arm/versatile/sp804.c head/sys/arm/versatile/versatile_clcd.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/versatile/versatile_pci.c head/sys/arm/versatile/versatile_timer.c head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xscale/ixp425/ixp425_wdog.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/allwinner/a10_clk.c Sun Oct 27 01:34:10 2013 (r257200) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/allwinner/a10_gpio.c Sun Oct 27 01:34:10 2013 (r257200) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_cpu_cfg.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/allwinner/a20/a20_cpu_cfg.c Sun Oct 27 01:34:10 2013 (r257200) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/allwinner/timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/arm/genassym.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/arm/generic_timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/arm/machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/arm/mpcore_timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/arm/vfp.c Sun Oct 27 01:34:10 2013 (r257200) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/arm/vm_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/at91/at91_mci.c Sun Oct 27 01:34:10 2013 (r257200) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/at91/at91_pmc.c Sun Oct 27 01:34:10 2013 (r257200) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Oct 27 01:34:10 2013 (r257200) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Oct 27 01:34:10 2013 (r257200) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Oct 27 01:34:10 2013 (r257200) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Oct 27 01:34:10 2013 (r257200) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/econa/timer.c ============================================================================== --- head/sys/arm/econa/timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/econa/timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "econa_reg.h" Modified: head/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/freescale/imx/imx51_ipuv3.c Sun Oct 27 01:34:10 2013 (r257200) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/freescale/imx/imx_gpt.c Sun Oct 27 01:34:10 2013 (r257200) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/freescale/imx/imx_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/include/cpu.h Sun Oct 27 01:34:10 2013 (r257200) @@ -5,6 +5,7 @@ #define MACHINE_CPU_H #include +#include void cpu_halt(void); void swi_vm(void *); Modified: head/sys/arm/include/pcb.h ============================================================================== --- head/sys/arm/include/pcb.h Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/include/pcb.h Sun Oct 27 01:34:10 2013 (r257200) @@ -38,7 +38,6 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ -#include #include Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/include/pcpu.h Sun Oct 27 01:34:10 2013 (r257200) @@ -33,7 +33,6 @@ #ifdef _KERNEL #include -#include #define ALT_STACK_SIZE 128 Modified: head/sys/arm/include/undefined.h ============================================================================== --- head/sys/arm/include/undefined.h Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/include/undefined.h Sun Oct 27 01:34:10 2013 (r257200) @@ -52,7 +52,9 @@ #include -typedef int (*undef_handler_t) (unsigned int, unsigned int, trapframe_t *, int); +struct trapframe; + +typedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe *, int); #define FP_COPROC 1 #define FP_COPROC2 2 Modified: head/sys/arm/lpc/lpc_fb.c ============================================================================== --- head/sys/arm/lpc/lpc_fb.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/lpc/lpc_fb.c Sun Oct 27 01:34:10 2013 (r257200) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/lpc/lpc_gpio.c Sun Oct 27 01:34:10 2013 (r257200) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/lpc/lpc_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/lpc/lpc_mmc.c Sun Oct 27 01:34:10 2013 (r257200) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/lpc/lpc_spi.c ============================================================================== --- head/sys/arm/lpc/lpc_spi.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/lpc/lpc_spi.c Sun Oct 27 01:34:10 2013 (r257200) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/lpc/lpc_timer.c ============================================================================== --- head/sys/arm/lpc/lpc_timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/lpc/lpc_timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/mv/mv_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include /* XXX */ Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/mv/timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/rockchip/rk30xx_gpio.c Sun Oct 27 01:34:10 2013 (r257200) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_grf.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/rockchip/rk30xx_grf.c Sun Oct 27 01:34:10 2013 (r257200) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/rockchip/rk30xx_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/rockchip/rk30xx_pmu.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_pmu.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/rockchip/rk30xx_pmu.c Sun Oct 27 01:34:10 2013 (r257200) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/arch_timer.c ============================================================================== --- head/sys/arm/samsung/exynos/arch_timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/samsung/exynos/arch_timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/tegra/tegra2_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd_syscons.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/am335x/am335x_lcd_syscons.c Sun Oct 27 01:34:10 2013 (r257200) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/am335x/am335x_prcm.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.c Sun Oct 27 01:34:10 2013 (r257200) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun Oct 27 01:34:10 2013 (r257200) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/omap4/omap4_scm_padconf.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_scm_padconf.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/omap4/omap4_scm_padconf.c Sun Oct 27 01:34:10 2013 (r257200) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/ti_cpuid.c Sun Oct 27 01:34:10 2013 (r257200) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/ti_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/ti/ti_mmchs.c ============================================================================== --- head/sys/arm/ti/ti_mmchs.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/ti_mmchs.c Sun Oct 27 01:34:10 2013 (r257200) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/ti_prcm.c ============================================================================== --- head/sys/arm/ti/ti_prcm.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/ti_prcm.c Sun Oct 27 01:34:10 2013 (r257200) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/ti_scm.c ============================================================================== --- head/sys/arm/ti/ti_scm.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/ti_scm.c Sun Oct 27 01:34:10 2013 (r257200) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/twl/twl.c ============================================================================== --- head/sys/arm/ti/twl/twl.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/twl/twl.c Sun Oct 27 01:34:10 2013 (r257200) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/twl/twl_clks.c ============================================================================== --- head/sys/arm/ti/twl/twl_clks.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/twl/twl_clks.c Sun Oct 27 01:34:10 2013 (r257200) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/ti/twl/twl_vreg.c ============================================================================== --- head/sys/arm/ti/twl/twl_vreg.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/ti/twl/twl_vreg.c Sun Oct 27 01:34:10 2013 (r257200) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/versatile/pl050.c ============================================================================== --- head/sys/arm/versatile/pl050.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/versatile/pl050.c Sun Oct 27 01:34:10 2013 (r257200) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/versatile/sp804.c ============================================================================== --- head/sys/arm/versatile/sp804.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/versatile/sp804.c Sun Oct 27 01:34:10 2013 (r257200) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/versatile/versatile_clcd.c ============================================================================== --- head/sys/arm/versatile/versatile_clcd.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/versatile/versatile_clcd.c Sun Oct 27 01:34:10 2013 (r257200) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/versatile/versatile_machdep.c ============================================================================== --- head/sys/arm/versatile/versatile_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/versatile/versatile_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include #include Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/versatile/versatile_pci.c Sun Oct 27 01:34:10 2013 (r257200) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/versatile/versatile_timer.c ============================================================================== --- head/sys/arm/versatile/versatile_timer.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/versatile/versatile_timer.c Sun Oct 27 01:34:10 2013 (r257200) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/xilinx/zy7_machdep.c Sun Oct 27 01:34:10 2013 (r257200) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/arm/xscale/ixp425/ixp425_wdog.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_wdog.c Sun Oct 27 00:51:46 2013 (r257199) +++ head/sys/arm/xscale/ixp425/ixp425_wdog.c Sun Oct 27 01:34:10 2013 (r257200) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 01:57:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B87757F6; Sun, 27 Oct 2013 01:57:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x235.google.com (mail-qe0-x235.google.com [IPv6:2607:f8b0:400d:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 381572F15; Sun, 27 Oct 2013 01:57:05 +0000 (UTC) Received: by mail-qe0-f53.google.com with SMTP id cy11so3247578qeb.12 for ; Sat, 26 Oct 2013 18:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=4OgUa4sSGqpo6EpblByfmi1rCVcv5IkT+pYMTO8F+vU=; b=I3jdZJdssqxatWYMChMdYUhtQzz4QWnFXowBw73hAFKsQQNCHZnBZeAuoUiPl5ZN/7 Ja1pr0x3wFE30n1MerXvM+BlynE7MlX/+hxqXgavwQ8DU4x0ksJNh0Mn7JTsaxK9oi6s K8dGh0A0jls4i7WzvYHeh53Stc36aDuIClGmbx92UcLWO3aJUzw7WQ4reMVzIX+vmvln AbipHPWIx49sdCh7TDFYtnZT/8v6uiUkRnHCBn1G/z+vbTz/9E5lGsxNDCrwV9RCTlpi cnIhbPx6WWnis9Cfj3C/fe6/LDPIxmaH+250uM4UvkzNQAGWWcZyRmu3d0QCa+I3BMrp 4bNg== MIME-Version: 1.0 X-Received: by 10.49.26.6 with SMTP id h6mr20604724qeg.75.1382839024378; Sat, 26 Oct 2013 18:57:04 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 26 Oct 2013 18:57:04 -0700 (PDT) In-Reply-To: <201310261840.r9QIeH89083767@svn.freebsd.org> References: <201310261840.r9QIeH89083767@svn.freebsd.org> Date: Sat, 26 Oct 2013 18:57:04 -0700 X-Google-Sender-Auth: qncDNLl8o_61yvrB33HNVonfP1c Message-ID: Subject: Re: svn commit: r257184 - in head/sys/dev: mii usb/net xl From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 01:57:05 -0000 hm, so none of the modified PHYs nor their consumers will get upset? Eg, if the NIC is down, is touching the PHY registers going to be a problem? -adrian On 26 October 2013 11:40, Gleb Smirnoff wrote: > Author: glebius > Date: Sat Oct 26 18:40:17 2013 > New Revision: 257184 > URL: http://svnweb.freebsd.org/changeset/base/257184 > > Log: > The MII layer shouldn't care about administrative status of an > interface. Make MII drivers forget about 'struct ifnet'. > > Later plan is to provide an administrative downcall from ifnet > layer into drivers, to inform them about administrative status > change. If someone thinks that processing MII events for an > administratively down interface is a big problem, then drivers > would turn MII processing off. > > The following MII drivers do evil things, like strcmp() on > driver name, so they still need knowledge of ifnet and thus > include if_var.h. They all need to be fixed: > > sys/dev/mii/brgphy.c > sys/dev/mii/e1000phy.c > sys/dev/mii/ip1000phy.c > sys/dev/mii/jmphy.c > sys/dev/mii/nsphy.c > sys/dev/mii/rgephy.c > sys/dev/mii/truephy.c > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Modified: > head/sys/dev/mii/acphy.c > head/sys/dev/mii/amphy.c > head/sys/dev/mii/atphy.c > head/sys/dev/mii/axphy.c > head/sys/dev/mii/bmtphy.c > head/sys/dev/mii/brgphy.c > head/sys/dev/mii/ciphy.c > head/sys/dev/mii/e1000phy.c > head/sys/dev/mii/gentbi.c > head/sys/dev/mii/icsphy.c > head/sys/dev/mii/ip1000phy.c > head/sys/dev/mii/jmphy.c > head/sys/dev/mii/lxtphy.c > head/sys/dev/mii/mii_physubr.c > head/sys/dev/mii/mlphy.c > head/sys/dev/mii/nsgphy.c > head/sys/dev/mii/nsphy.c > head/sys/dev/mii/nsphyter.c > head/sys/dev/mii/pnaphy.c > head/sys/dev/mii/qsphy.c > head/sys/dev/mii/rdcphy.c > head/sys/dev/mii/rgephy.c > head/sys/dev/mii/rlphy.c > head/sys/dev/mii/rlswitch.c > head/sys/dev/mii/smcphy.c > head/sys/dev/mii/smscphy.c > head/sys/dev/mii/tdkphy.c > head/sys/dev/mii/tlphy.c > head/sys/dev/mii/truephy.c > head/sys/dev/mii/ukphy.c > head/sys/dev/mii/xmphy.c > head/sys/dev/usb/net/ruephy.c > head/sys/dev/xl/xlphy.c > > Modified: head/sys/dev/mii/acphy.c > ============================================================================== > --- head/sys/dev/mii/acphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/acphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -168,12 +168,6 @@ acphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > /* Wake & deisolate up if necessary */ > reg = PHY_READ(sc, MII_BMCR); > if (reg & (BMCR_ISO | BMCR_PDOWN)) > @@ -184,12 +178,6 @@ acphy_service(struct mii_softc *sc, stru > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * This PHY's autonegotiation doesn't need to be kicked. > */ > break; > > Modified: head/sys/dev/mii/amphy.c > ============================================================================== > --- head/sys/dev/mii/amphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/amphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -119,12 +119,6 @@ amphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/atphy.c > ============================================================================== > --- head/sys/dev/mii/atphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/atphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -116,12 +116,6 @@ atphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || > IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { > atphy_setmedia(sc, ife->ifm_media); > @@ -175,12 +169,6 @@ done: > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > > Modified: head/sys/dev/mii/axphy.c > ============================================================================== > --- head/sys/dev/mii/axphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/axphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -113,12 +113,6 @@ axphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/bmtphy.c > ============================================================================== > --- head/sys/dev/mii/bmtphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/bmtphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -159,12 +159,6 @@ bmtphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/brgphy.c > ============================================================================== > --- head/sys/dev/mii/brgphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/brgphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > #include > > @@ -314,10 +315,6 @@ brgphy_service(struct mii_softc *sc, str > case MII_POLLSTAT: > break; > case MII_MEDIACHG: > - /* If the interface is not up, don't do anything. */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > /* Todo: Why is this here? Is it really needed? */ > PHY_RESET(sc); /* XXX hardware bug work-around */ > > @@ -337,11 +334,6 @@ brgphy_service(struct mii_softc *sc, str > } > break; > case MII_TICK: > - /* Bail if the interface isn't up. */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - > /* Bail if autoneg isn't in process. */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > sc->mii_ticks = 0; > > Modified: head/sys/dev/mii/ciphy.c > ============================================================================== > --- head/sys/dev/mii/ciphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/ciphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -131,12 +131,6 @@ ciphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > ciphy_fixup(sc); /* XXX hardware bug work-around */ > > switch (IFM_SUBTYPE(ife->ifm_media)) { > @@ -187,12 +181,6 @@ setit: > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) > > Modified: head/sys/dev/mii/e1000phy.c > ============================================================================== > --- head/sys/dev/mii/e1000phy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/e1000phy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > - > #include > +#include > #include > > #include > @@ -311,12 +311,6 @@ e1000phy_service(struct mii_softc *sc, s > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { > e1000phy_mii_phy_auto(sc, ife->ifm_media); > break; > @@ -375,12 +369,6 @@ done: > break; > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > > Modified: head/sys/dev/mii/gentbi.c > ============================================================================== > --- head/sys/dev/mii/gentbi.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/gentbi.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -191,12 +191,6 @@ gentbi_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/icsphy.c > ============================================================================== > --- head/sys/dev/mii/icsphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/icsphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -145,12 +145,6 @@ icsphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/ip1000phy.c > ============================================================================== > --- head/sys/dev/mii/ip1000phy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/ip1000phy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > > #include > @@ -126,13 +127,6 @@ ip1000phy_service(struct mii_softc *sc, > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { > - break; > - } > - > PHY_RESET(sc); > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_AUTO: > @@ -180,12 +174,6 @@ done: > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > > Modified: head/sys/dev/mii/jmphy.c > ============================================================================== > --- head/sys/dev/mii/jmphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/jmphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > > #include > @@ -121,24 +122,12 @@ jmphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > if (jmphy_setmedia(sc, ife) != EJUSTRETURN) > return (EINVAL); > break; > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > > Modified: head/sys/dev/mii/lxtphy.c > ============================================================================== > --- head/sys/dev/mii/lxtphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/lxtphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -168,12 +168,6 @@ lxtphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > if (IFM_SUBTYPE(ife->ifm_media) == IFM_100_FX) > lxtphy_set_fx(sc); > else > > Modified: head/sys/dev/mii/mii_physubr.c > ============================================================================== > --- head/sys/dev/mii/mii_physubr.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/mii_physubr.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -209,13 +209,8 @@ int > mii_phy_tick(struct mii_softc *sc) > { > struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; > - struct ifnet *ifp = sc->mii_pdata->mii_ifp; > int reg; > > - /* Just bail now if the interface is down. */ > - if ((ifp->if_flags & IFF_UP) == 0) > - return (EJUSTRETURN); > - > /* > * If we're not doing autonegotiation, we don't need to do > * any extra work here. However, we need to check the link > > Modified: head/sys/dev/mii/mlphy.c > ============================================================================== > --- head/sys/dev/mii/mlphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/mlphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -205,12 +205,6 @@ mlphy_service(xsc, mii, cmd) > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_AUTO: > /* > @@ -266,12 +260,6 @@ mlphy_service(xsc, mii, cmd) > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) > > Modified: head/sys/dev/mii/nsgphy.c > ============================================================================== > --- head/sys/dev/mii/nsgphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/nsgphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -159,12 +159,6 @@ nsgphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/nsphy.c > ============================================================================== > --- head/sys/dev/mii/nsphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/nsphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > > #include > @@ -152,12 +153,6 @@ nsphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > reg = PHY_READ(sc, MII_NSPHY_PCR); > > /* > > Modified: head/sys/dev/mii/nsphyter.c > ============================================================================== > --- head/sys/dev/mii/nsphyter.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/nsphyter.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -149,12 +149,6 @@ nsphyter_service(struct mii_softc *sc, s > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/pnaphy.c > ============================================================================== > --- head/sys/dev/mii/pnaphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/pnaphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -121,12 +121,6 @@ pnaphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_HPNA_1: > mii_phy_setmedia(sc); > > Modified: head/sys/dev/mii/qsphy.c > ============================================================================== > --- head/sys/dev/mii/qsphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/qsphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -143,23 +143,11 @@ qsphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * This PHY's autonegotiation doesn't need to be kicked. > */ > break; > > Modified: head/sys/dev/mii/rdcphy.c > ============================================================================== > --- head/sys/dev/mii/rdcphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/rdcphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -121,12 +121,6 @@ rdcphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_100_TX: > > Modified: head/sys/dev/mii/rgephy.c > ============================================================================== > --- head/sys/dev/mii/rgephy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/rgephy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > #include > > @@ -153,12 +154,6 @@ rgephy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > PHY_RESET(sc); /* XXX hardware bug work-around */ > > anar = PHY_READ(sc, RGEPHY_MII_ANAR); > @@ -231,12 +226,6 @@ setit: > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > > Modified: head/sys/dev/mii/rlphy.c > ============================================================================== > --- head/sys/dev/mii/rlphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/rlphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include /* XXXGL: if_rlreg.h contamination */ > > #include > #include > @@ -141,23 +142,11 @@ rlphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * The RealTek PHY's autonegotiation doesn't need to be > * kicked; it continues in the background. > */ > > Modified: head/sys/dev/mii/rlswitch.c > ============================================================================== > --- head/sys/dev/mii/rlswitch.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/rlswitch.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include /* XXXGL: if_rlreg.h contamination */ > > #include > #include > @@ -353,11 +354,6 @@ rlswitch_service(struct mii_softc *sc, s > break; > > case MII_TICK: > - /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > break; > } > > > Modified: head/sys/dev/mii/smcphy.c > ============================================================================== > --- head/sys/dev/mii/smcphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/smcphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -134,12 +134,6 @@ smcphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_AUTO: > smcphy_auto(sc, ife->ifm_media); > @@ -153,10 +147,6 @@ smcphy_service(struct mii_softc *sc, str > break; > > case MII_TICK: > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { > - return (0); > - } > - > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > break; > } > > Modified: head/sys/dev/mii/smscphy.c > ============================================================================== > --- head/sys/dev/mii/smscphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/smscphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -120,12 +120,6 @@ smscphy_service(struct mii_softc *sc, st > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_AUTO: > smscphy_auto(sc, ife->ifm_media); > @@ -139,10 +133,6 @@ smscphy_service(struct mii_softc *sc, st > break; > > case MII_TICK: > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) { > - return (0); > - } > - > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > break; > } > > Modified: head/sys/dev/mii/tdkphy.c > ============================================================================== > --- head/sys/dev/mii/tdkphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/tdkphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -122,12 +122,6 @@ tdkphy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/tlphy.c > ============================================================================== > --- head/sys/dev/mii/tlphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/tlphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -217,12 +217,6 @@ tlphy_service(struct mii_softc *self, st > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_AUTO: > /* > @@ -247,12 +241,6 @@ tlphy_service(struct mii_softc *self, st > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) > > Modified: head/sys/dev/mii/truephy.c > ============================================================================== > --- head/sys/dev/mii/truephy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/truephy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -44,6 +44,7 @@ > #include > > #include > +#include > #include > #include > #include > @@ -180,12 +181,6 @@ truephy_service(struct mii_softc *sc, st > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { > bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_AUTOEN; > PHY_WRITE(sc, MII_BMCR, bmcr); > > Modified: head/sys/dev/mii/ukphy.c > ============================================================================== > --- head/sys/dev/mii/ukphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/ukphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -140,12 +140,6 @@ ukphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > > Modified: head/sys/dev/mii/xmphy.c > ============================================================================== > --- head/sys/dev/mii/xmphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/mii/xmphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -148,12 +148,6 @@ xmphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > switch (IFM_SUBTYPE(ife->ifm_media)) { > case IFM_AUTO: > #ifdef foo > @@ -182,12 +176,6 @@ xmphy_service(struct mii_softc *sc, stru > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) > > Modified: head/sys/dev/usb/net/ruephy.c > ============================================================================== > --- head/sys/dev/usb/net/ruephy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/usb/net/ruephy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -123,23 +123,11 @@ ruephy_service(struct mii_softc *sc, str > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * Only used for autonegotiation. > */ > if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) > > Modified: head/sys/dev/xl/xlphy.c > ============================================================================== > --- head/sys/dev/xl/xlphy.c Sat Oct 26 18:25:55 2013 (r257183) > +++ head/sys/dev/xl/xlphy.c Sat Oct 26 18:40:17 2013 (r257184) > @@ -152,23 +152,11 @@ xlphy_service(struct mii_softc *sc, stru > break; > > case MII_MEDIACHG: > - /* > - * If the interface is not up, don't do anything. > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - break; > - > mii_phy_setmedia(sc); > break; > > case MII_TICK: > /* > - * Is the interface even up? > - */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > - return (0); > - > - /* > * The 3Com PHY's autonegotiation doesn't need to be > * kicked; it continues in the background. > */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 02:46:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E7561DB3; Sun, 27 Oct 2013 02:46:31 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AF8520F3; Sun, 27 Oct 2013 02:46:31 +0000 (UTC) Received: from [10.71.4.139] (64-197-173-10.ip.mcleodusa.net [64.197.173.10] (may be forged)) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r9R2kNDg073736 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 27 Oct 2013 02:46:24 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253260 - head/lib/msun/src From: David Chisnall In-Reply-To: <868uxfd0rt.fsf@orwell.Elisa> Date: Sat, 26 Oct 2013 22:46:21 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <6EA02AB7-4DE5-4B67-BD7C-78E8F8975E4B@FreeBSD.org> References: <201307121103.r6CB3qrh068782@svn.freebsd.org> <86d2mrd10h.fsf__46266.7496213273$1382832829$gmane$org@orwell.Elisa> <868uxfd0rt.fsf@orwell.Elisa> To: Raphael Kubo da Costa X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 02:46:32 -0000 On 26 Oct 2013, at 20:18, Raphael Kubo da Costa = wrote: > Raphael Kubo da Costa writes: >=20 >> David Chisnall writes: >>=20 >>> Author: theraven >>> Date: Fri Jul 12 11:03:51 2013 >>> New Revision: 253260 >>> URL: http://svnweb.freebsd.org/changeset/base/253260 >>>=20 >>> Log: >>> Fix the build with C++ where __builtin_types_compatible_p is not = allowed. >>>=20 >>> Modified: >>> head/lib/msun/src/math.h >>>=20 >>> Modified: head/lib/msun/src/math.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/lib/msun/src/math.h Fri Jul 12 10:07:48 2013 = (r253259) >>> +++ head/lib/msun/src/math.h Fri Jul 12 11:03:51 2013 = (r253260) >>> @@ -81,12 +81,13 @@ extern const union __nan_un { >>> #define FP_SUBNORMAL 0x08 >>> #define FP_ZERO 0x10 >>>=20 >>> -#if __STDC_VERSION__ >=3D 201112L && defined(__clang__) >>> +#if (__STDC_VERSION__ >=3D 201112L && defined(__clang__)) || \ >>> + __has_extension(c_generic_selections) >>> #define __fp_type_select(x, f, d, ld) _Generic((x), \ >>> float: f(x), \ >>> double: d(x), \ >>> long double: ld(x)) >>=20 >> One of the things that's making cad/brlcad fail with clang is some C >> code that calls isnan() and isinf() with -std=3Dgnu89, -Werror and >> -Wc11-extensions: >=20 > (To be fair, it's -pedantic that brings in -Wc11-extensions) The issue is probably a clang bug. The use of _Generic() is in a system = header and so ought to be immune to warnings, but apparently the fact = that it's instantiated outside of the system header. If you can file a = clang bug (http://llvm.org/bugs/enter_bug.cgi?product=3Dclang) I'll take = a look (I'm at vBSDCon now, so I'll lose it otherwise). Ports definitely shouldn't be using -Werror though. I've heard -Werror = described as the flag meaning 'fail to compile with any newer compiler = than the one I'm using' - it's a great idea for trunk, but it should be = turned off for releases. Sticking -Wno-error on the end will fix it. David From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 03:13:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D363D389; Sun, 27 Oct 2013 03:13:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD5A72287; Sun, 27 Oct 2013 03:13:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R3DTcE072609; Sun, 27 Oct 2013 03:13:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R3DQaD072589; Sun, 27 Oct 2013 03:13:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310270313.r9R3DQaD072589@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Oct 2013 03:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257201 - in head/sys/arm: allwinner arm broadcom/bcm2835 include lpc mv samsung/exynos tegra ti versatile xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 03:13:30 -0000 Author: ian Date: Sun Oct 27 03:13:26 2013 New Revision: 257201 URL: http://svnweb.freebsd.org/changeset/base/257201 Log: Retire arm_remap_nocache() and the data and constants associated with it. The only remaining user was the code that allocates bounce pages for armv4 busdma. It's not clear why bounce pages would need uncached memory, but if that ever changes, kmem_alloc_attr() would be the way to get it. Modified: head/sys/arm/allwinner/a10_machdep.c head/sys/arm/arm/busdma_machdep.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/arm/vm_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/include/pmap.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/xilinx/zy7_machdep.c Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -57,7 +57,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/arm/busdma_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -122,7 +122,6 @@ struct bus_dma_tag { struct bounce_page { vm_offset_t vaddr; /* kva of bounce buffer */ - vm_offset_t vaddr_nocache; /* kva of bounce buffer uncached */ bus_addr_t busaddr; /* Physical address */ vm_offset_t datavaddr; /* kva of client data */ bus_addr_t dataaddr; /* client physical address */ @@ -1196,39 +1195,23 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, STAILQ_FOREACH(bpage, &map->bpages, links) { if (op & BUS_DMASYNC_PREWRITE) { if (bpage->datavaddr != 0) - bcopy((void *)bpage->datavaddr, - (void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : - bpage->vaddr), - bpage->datacount); + bcopy((void *)bpage->datavaddr, + (void *)bpage->vaddr, bpage->datacount); else physcopyout(bpage->dataaddr, - (void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : - bpage->vaddr), - bpage->datacount); - if (bpage->vaddr_nocache == 0) { - cpu_dcache_wb_range(bpage->vaddr, - bpage->datacount); - cpu_l2cache_wb_range(bpage->vaddr, - bpage->datacount); - } + (void *)bpage->vaddr,bpage->datacount); + cpu_dcache_wb_range(bpage->vaddr, bpage->datacount); + cpu_l2cache_wb_range(bpage->vaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; } if (op & BUS_DMASYNC_POSTREAD) { - if (bpage->vaddr_nocache == 0) { - cpu_dcache_inv_range(bpage->vaddr, - bpage->datacount); - cpu_l2cache_inv_range(bpage->vaddr, - bpage->datacount); - } + cpu_dcache_inv_range(bpage->vaddr, bpage->datacount); + cpu_l2cache_inv_range(bpage->vaddr, bpage->datacount); if (bpage->datavaddr != 0) - bcopy((void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : bpage->vaddr), + bcopy((void *)bpage->vaddr, (void *)bpage->datavaddr, bpage->datacount); else - physcopyin((void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : bpage->vaddr), + physcopyin((void *)bpage->vaddr, bpage->dataaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; } @@ -1385,8 +1368,6 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u break; } bpage->busaddr = pmap_kextract(bpage->vaddr); - bpage->vaddr_nocache = (vm_offset_t)arm_remap_nocache( - (void *)bpage->vaddr, PAGE_SIZE); mtx_lock(&bounce_lock); STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links); total_bpages++; Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/arm/pmap-v6.c Sun Oct 27 03:13:26 2013 (r257201) @@ -1951,7 +1951,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - arm_nocache_startaddr = vm_max_kernel_address; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/arm/pmap.c Sun Oct 27 03:13:26 2013 (r257201) @@ -2423,7 +2423,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - arm_nocache_startaddr = vm_max_kernel_address; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); #ifdef ARM_USE_SMALL_ALLOC Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/arm/vm_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -482,80 +482,6 @@ cpu_exit(struct thread *td) { } -#define BITS_PER_INT (8 * sizeof(int)) -vm_offset_t arm_nocache_startaddr; -static int arm_nocache_allocated[ARM_NOCACHE_KVA_SIZE / (PAGE_SIZE * - BITS_PER_INT)]; - -/* - * Functions to map and unmap memory non-cached into KVA the kernel won't try - * to allocate. The goal is to provide uncached memory to busdma, to honor - * BUS_DMA_COHERENT. - * We can allocate at most ARM_NOCACHE_KVA_SIZE bytes. - * The allocator is rather dummy, each page is represented by a bit in - * a bitfield, 0 meaning the page is not allocated, 1 meaning it is. - * As soon as it finds enough contiguous pages to satisfy the request, - * it returns the address. - */ -void * -arm_remap_nocache(void *addr, vm_size_t size) -{ - int i, j; - - size = round_page(size); - for (i = 0; i < ARM_NOCACHE_KVA_SIZE / PAGE_SIZE; i++) { - if (!(arm_nocache_allocated[i / BITS_PER_INT] & (1 << (i % - BITS_PER_INT)))) { - for (j = i; j < i + (size / (PAGE_SIZE)); j++) - if (arm_nocache_allocated[j / BITS_PER_INT] & - (1 << (j % BITS_PER_INT))) - break; - if (j == i + (size / (PAGE_SIZE))) - break; - } - } - if (i < ARM_NOCACHE_KVA_SIZE / PAGE_SIZE) { - vm_offset_t tomap = arm_nocache_startaddr + i * PAGE_SIZE; - void *ret = (void *)tomap; - vm_paddr_t physaddr = vtophys((vm_offset_t)addr); - vm_offset_t vaddr = (vm_offset_t) addr; - - vaddr = vaddr & ~PAGE_MASK; - for (; tomap < (vm_offset_t)ret + size; tomap += PAGE_SIZE, - vaddr += PAGE_SIZE, physaddr += PAGE_SIZE, i++) { - cpu_idcache_wbinv_range(vaddr, PAGE_SIZE); -#ifdef ARM_L2_PIPT - cpu_l2cache_wbinv_range(physaddr, PAGE_SIZE); -#else - cpu_l2cache_wbinv_range(vaddr, PAGE_SIZE); -#endif - pmap_kenter_nocache(tomap, physaddr); - cpu_tlb_flushID_SE(vaddr); - arm_nocache_allocated[i / BITS_PER_INT] |= 1 << (i % - BITS_PER_INT); - } - return (ret); - } - - return (NULL); -} - -void -arm_unmap_nocache(void *addr, vm_size_t size) -{ - vm_offset_t raddr = (vm_offset_t)addr; - int i; - - size = round_page(size); - i = (raddr - arm_nocache_startaddr) / (PAGE_SIZE); - for (; size > 0; size -= PAGE_SIZE, i++) { - arm_nocache_allocated[i / BITS_PER_INT] &= ~(1 << (i % - BITS_PER_INT)); - pmap_kremove(raddr); - raddr += PAGE_SIZE; - } -} - #ifdef ARM_USE_SMALL_ALLOC static TAILQ_HEAD(,arm_small_page) pages_normal = Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -65,7 +65,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/include/pmap.h Sun Oct 27 03:13:26 2013 (r257201) @@ -735,11 +735,6 @@ struct arm_small_page { #endif -#define ARM_NOCACHE_KVA_SIZE 0x1000000 -extern vm_offset_t arm_nocache_startaddr; -void *arm_remap_nocache(void *, vm_size_t); -void arm_unmap_nocache(void *, vm_size_t); - extern vm_paddr_t dump_avail[]; #endif /* _KERNEL */ Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/lpc/lpc_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -66,7 +66,7 @@ initarm_lastaddr(void) while (1); /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); + return (fdt_immr_va); } void Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/mv/mv_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -206,7 +206,7 @@ initarm_lastaddr(void) while (1); /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); + return (fdt_immr_va); } void Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -49,7 +49,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/tegra/tegra2_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -109,7 +109,7 @@ initarm_lastaddr(void) if (fdt_immr_addr(TEGRA2_BASE) != 0) /* FIXME ???? */ while (1); - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); + return (fdt_immr_va); } void Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/ti/ti_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -63,7 +63,7 @@ initarm_lastaddr(void) { ti_cpu_reset = NULL; - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: head/sys/arm/versatile/versatile_machdep.c ============================================================================== --- head/sys/arm/versatile/versatile_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/versatile/versatile_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -60,7 +60,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sun Oct 27 01:34:10 2013 (r257200) +++ head/sys/arm/xilinx/zy7_machdep.c Sun Oct 27 03:13:26 2013 (r257201) @@ -59,7 +59,7 @@ vm_offset_t initarm_lastaddr(void) { - return (ZYNQ7_PSIO_VBASE - ARM_NOCACHE_KVA_SIZE); + return (ZYNQ7_PSIO_VBASE); } void From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 03:24:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE3AA75D; Sun, 27 Oct 2013 03:24:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAA83231A; Sun, 27 Oct 2013 03:24:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R3Ok1G076258; Sun, 27 Oct 2013 03:24:46 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R3Oknx076257; Sun, 27 Oct 2013 03:24:46 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310270324.r9R3Oknx076257@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Oct 2013 03:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257202 - head/sys/arm/rockchip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 03:24:46 -0000 Author: ian Date: Sun Oct 27 03:24:46 2013 New Revision: 257202 URL: http://svnweb.freebsd.org/changeset/base/257202 Log: Oops, one more instance of ARM_NOCACHE_KVA_SIZE was hiding under the couch. This should have been cleaned up along with r257201. Modified: head/sys/arm/rockchip/rk30xx_machdep.c Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Sun Oct 27 03:13:26 2013 (r257201) +++ head/sys/arm/rockchip/rk30xx_machdep.c Sun Oct 27 03:24:46 2013 (r257202) @@ -55,7 +55,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 03:29:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A83708D6; Sun, 27 Oct 2013 03:29:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 912442334; Sun, 27 Oct 2013 03:29:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R3Tcvv076810; Sun, 27 Oct 2013 03:29:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R3Tcoi076809; Sun, 27 Oct 2013 03:29:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310270329.r9R3Tcoi076809@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Oct 2013 03:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257203 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 03:29:38 -0000 Author: ian Date: Sun Oct 27 03:29:38 2013 New Revision: 257203 URL: http://svnweb.freebsd.org/changeset/base/257203 Log: Eliminate a compiler warning about extraneous parens. Modified: head/sys/arm/arm/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Sun Oct 27 03:24:46 2013 (r257202) +++ head/sys/arm/arm/busdma_machdep.c Sun Oct 27 03:29:38 2013 (r257203) @@ -807,7 +807,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma bus_addr_t curaddr; bus_size_t sgsize; - if ((map->pagesneeded == 0)) { + if (map->pagesneeded == 0) { CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", @@ -838,7 +838,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vm_offset_t vendaddr; bus_addr_t paddr; - if ((map->pagesneeded == 0)) { + if (map->pagesneeded == 0) { CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 04:49:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8BB572A0; Sun, 27 Oct 2013 04:49:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72D2325BE; Sun, 27 Oct 2013 04:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R4nfnZ003449; Sun, 27 Oct 2013 04:49:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R4nfwn003448; Sun, 27 Oct 2013 04:49:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310270449.r9R4nfwn003448@svn.freebsd.org> From: Eitan Adler Date: Sun, 27 Oct 2013 04:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257204 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 04:49:41 -0000 Author: eadler Date: Sun Oct 27 04:49:40 2013 New Revision: 257204 URL: http://svnweb.freebsd.org/changeset/base/257204 Log: All man pages refer to FreeBSD so there is no need to mention "In .Fx" Modified: head/lib/libutil/login.conf.5 Modified: head/lib/libutil/login.conf.5 ============================================================================== --- head/lib/libutil/login.conf.5 Sun Oct 27 03:29:38 2013 (r257203) +++ head/lib/libutil/login.conf.5 Sun Oct 27 04:49:40 2013 (r257204) @@ -50,9 +50,7 @@ non-root user without a valid login clas A user with a uid of 0 without a valid login class will use the record "root" if it exists, or "default" if not. .Pp -In -.Fx , -users may individually create a file called +Users may individually create a file called .Pa .login_conf in their home directory using the same format, consisting of a single entry with a record id of "me". From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 04:59:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EB4F940F; Sun, 27 Oct 2013 04:59:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D78112600; Sun, 27 Oct 2013 04:59:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9R4xI4u006590; Sun, 27 Oct 2013 04:59:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9R4xIQF006589; Sun, 27 Oct 2013 04:59:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201310270459.r9R4xIQF006589@svn.freebsd.org> From: Eitan Adler Date: Sun, 27 Oct 2013 04:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257205 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 04:59:19 -0000 Author: eadler Date: Sun Oct 27 04:59:18 2013 New Revision: 257205 URL: http://svnweb.freebsd.org/changeset/base/257205 Log: Mention in login.conf.5 which fields may be infinite and how to specifify infinity. The number of ways to indicate this confuses people. PR: docs/100196 Reported by: "Dr. Markus Waldeck" Reported by: Jamie Landeg Jones Modified: head/lib/libutil/login.conf.5 Modified: head/lib/libutil/login.conf.5 ============================================================================== --- head/lib/libutil/login.conf.5 Sun Oct 27 04:49:40 2013 (r257204) +++ head/lib/libutil/login.conf.5 Sun Oct 27 04:59:18 2013 (r257205) @@ -130,6 +130,7 @@ tag being delimited from the value by '= Whichever method is used, then all records in the database must use the same method to allow values to be correctly overridden in interpolated records. +A numeric value may be infinite. .It size A number which expresses a size. The default interpretation of a value is the number of bytes, but a @@ -148,6 +149,7 @@ represents terabytes. .El A size value is a numeric quantity and case of the suffix is not significant. Concatenated values are added together. +A size value may be infinite. .It time A period of time, by default in seconds. A prefix may specify a different unit: @@ -168,8 +170,16 @@ the number of seconds. Concatenated values are added together. For example, 2 hours and 40 minutes may be written either as 9600s, 160m or 2h40m. +A time value may be infinite. .El .Pp +.Dq infinity , +.Dq inf , +.Dq unlimited , +.Dq unlimit, +and -1 +are considered infinite values. +.Pp The usual convention to interpolate capability entries using the special .Em tc=value notation may be used. From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 07:19:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1894E406; Sun, 27 Oct 2013 07:19:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93BDA2AC6; Sun, 27 Oct 2013 07:19:10 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r9R7J9Li045423; Sun, 27 Oct 2013 11:19:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r9R7J96c045422; Sun, 27 Oct 2013 11:19:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 27 Oct 2013 11:19:09 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r257184 - in head/sys/dev: mii usb/net xl Message-ID: <20131027071909.GH52889@FreeBSD.org> References: <201310261840.r9QIeH89083767@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 07:19:12 -0000 On Sat, Oct 26, 2013 at 06:57:04PM -0700, Adrian Chadd wrote: A> hm, so none of the modified PHYs nor their consumers will get upset? A> Eg, if the NIC is down, is touching the PHY registers going to be a A> problem? The IFF_UP was always an administrative flag. I believe drivers initialize all their resources before being set an address with SIOCSIFADDR. If a driver doesn't, then the previous code still was racy. Anyway, I am going to handle any fallouts. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 10:09:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 075C3D8F; Sun, 27 Oct 2013 10:09:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9D3F2102; Sun, 27 Oct 2013 10:09:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RA9s34009404; Sun, 27 Oct 2013 10:09:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RA9sFJ009400; Sun, 27 Oct 2013 10:09:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310271009.r9RA9sFJ009400@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 27 Oct 2013 10:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257206 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 10:09:55 -0000 Author: hselasky Date: Sun Oct 27 10:09:53 2013 New Revision: 257206 URL: http://svnweb.freebsd.org/changeset/base/257206 Log: Fix a deadlock when trying to power off a USB device. The deadlock happens because the code in question is trying to modify the parent USB port registers outside the USB explore thread. MFC after: 3 days Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Oct 27 04:59:18 2013 (r257205) +++ head/sys/dev/usb/usb_dev.c Sun Oct 27 10:09:53 2013 (r257206) @@ -1099,7 +1099,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, /* Wait for re-enumeration, if any */ - while (f->udev->re_enumerate_wait != 0) { + while (f->udev->re_enumerate_wait != USB_RE_ENUM_DONE) { usb_unref_device(cpd, &refs); Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Sun Oct 27 04:59:18 2013 (r257205) +++ head/sys/dev/usb/usb_device.h Sun Oct 27 10:09:53 2013 (r257206) @@ -238,6 +238,9 @@ struct usb_device { uint8_t driver_added_refcount; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ uint8_t re_enumerate_wait; /* set if re-enum. is in progress */ +#define USB_RE_ENUM_DONE 0 +#define USB_RE_ENUM_START 1 +#define USB_RE_ENUM_PWR_OFF 2 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Sun Oct 27 04:59:18 2013 (r257205) +++ head/sys/dev/usb/usb_generic.c Sun Oct 27 10:09:53 2013 (r257206) @@ -1762,16 +1762,11 @@ ugen_set_power_mode(struct usb_fifo *f, switch (mode) { case USB_POWER_MODE_OFF: - /* get the device unconfigured */ - err = ugen_set_config(f, USB_UNCONFIG_INDEX); - if (err) { - DPRINTFN(0, "Could not unconfigure " - "device (ignored)\n"); + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_PWR_OFF; } - - /* clear port enable */ - err = usbd_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_ENABLE); + /* set power mode will wake up the explore thread */ break; case USB_POWER_MODE_ON: @@ -1819,9 +1814,9 @@ ugen_set_power_mode(struct usb_fifo *f, /* if we are powered off we need to re-enumerate first */ if (old_mode == USB_POWER_MODE_OFF) { - if (udev->flags.usb_mode == USB_MODE_HOST) { - if (udev->re_enumerate_wait == 0) - udev->re_enumerate_wait = 1; + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; } /* set power mode will wake up the explore thread */ } Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Oct 27 04:59:18 2013 (r257205) +++ head/sys/dev/usb/usb_hub.c Sun Oct 27 10:09:53 2013 (r257206) @@ -248,7 +248,8 @@ uhub_explore_sub(struct uhub_softc *sc, uint8_t do_unlock; do_unlock = usbd_enum_lock(child); - if (child->re_enumerate_wait) { + switch (child->re_enumerate_wait) { + case USB_RE_ENUM_START: err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); if (err != 0) { @@ -263,8 +264,33 @@ uhub_explore_sub(struct uhub_softc *sc, err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); } - child->re_enumerate_wait = 0; + child->re_enumerate_wait = USB_RE_ENUM_DONE; err = 0; + break; + + case USB_RE_ENUM_PWR_OFF: + /* get the device unconfigured */ + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } + + /* clear port enable */ + err = usbd_req_clear_port_feature(child->parent_hub, + NULL, child->port_no, UHF_PORT_ENABLE); + if (err) { + DPRINTFN(0, "Could not disable port " + "(ignored)\n"); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + err = 0; + break; + + default: + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; } if (do_unlock) usbd_enum_unlock(child); @@ -2086,7 +2112,7 @@ usb_peer_should_wakeup(struct usb_device return (((udev->power_mode == USB_POWER_MODE_ON) && (udev->flags.usb_mode == USB_MODE_HOST)) || (udev->driver_added_refcount != udev->bus->driver_added_refcount) || - (udev->re_enumerate_wait != 0) || + (udev->re_enumerate_wait != USB_RE_ENUM_DONE) || (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) || (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -2502,6 +2528,8 @@ usbd_set_power_mode(struct usb_device *u #if USB_HAVE_POWERD usb_bus_power_update(udev->bus); +#else + usb_needs_explore(udev->bus, 0 /* no probe */ ); #endif } @@ -2540,8 +2568,8 @@ usbd_filter_power_mode(struct usb_device void usbd_start_re_enumerate(struct usb_device *udev) { - if (udev->re_enumerate_wait == 0) { - udev->re_enumerate_wait = 1; + if (udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; usb_needs_explore(udev->bus, 0); } } From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 10:11:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 97438ED4; Sun, 27 Oct 2013 10:11:16 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep20.mx.upcmail.net (fep20.mx.upcmail.net [62.179.121.40]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8FE2133; Sun, 27 Oct 2013 10:11:15 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep20-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131027101108.BVV1967.viefep20-int.chello.at@edge01.upcmail.net>; Sun, 27 Oct 2013 11:11:08 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge01.upcmail.net with edge id iAB71m01f2xdvHc01AB7bl; Sun, 27 Oct 2013 11:11:08 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 86E616D47B; Sun, 27 Oct 2013 11:11:07 +0100 (CET) Date: Sun, 27 Oct 2013 11:11:07 +0100 From: Stefan Farfeleder To: Adrian Chadd Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131027101106.GA2843@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310251944.r9PJis6q004419@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 10:11:16 -0000 On Fri, Oct 25, 2013 at 07:44:54PM +0000, Adrian Chadd wrote: > Author: adrian > Date: Fri Oct 25 19:44:53 2013 > New Revision: 257133 > URL: http://svnweb.freebsd.org/changeset/base/257133 > > Log: > Temporarily disable multi-rate retry (link quality) and eliminate rate > index lookups. > > * My recent(ish) change to iwn(4) and the net80211 rate control API to > support 11n rates broke the link quality table use. So, until I or > someone else decides to fix it, let's just disable it for now. > > * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. > > * Eliminate two uses of the net80211 rate index lookup functions - they > are only for legacy rates and they're not needed here. > > This fixes some invalid looking rate control TX issues that showed up > on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look > like DMA related issues. > > Tested: > > * 4965, STA mode > * 5100, STA mode Hi Adrian, this change completely broke iwn for me. It's a iwn0: mem 0xf1ffe000-0xf1ffffff irq 17 at device 0.0 on pci12 built-in device in a Dell Precision m4400. With this change, wpa_supplicant cannot associate any longer. In the logs I see every few seconds Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz) Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with xx:xx:xx:xx:xx:xx timed out. Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1 If I revert just this revision based on a r257155 checkout, it works again. Stefan From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 10:44:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 10BBF2B8; Sun, 27 Oct 2013 10:44:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1DBA222E; Sun, 27 Oct 2013 10:44:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RAiMQd021897; Sun, 27 Oct 2013 10:44:22 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RAiM9p021896; Sun, 27 Oct 2013 10:44:22 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201310271044.r9RAiM9p021896@svn.freebsd.org> From: Andrew Turner Date: Sun, 27 Oct 2013 10:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257207 - head/lib/msun/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 10:44:23 -0000 Author: andrew Date: Sun Oct 27 10:44:22 2013 New Revision: 257207 URL: http://svnweb.freebsd.org/changeset/base/257207 Log: Update the hard-float version of the fenv functions to use the VFP unit. Any other floating-point unit is unsupported on ARM. Modified: head/lib/msun/arm/fenv.h Modified: head/lib/msun/arm/fenv.h ============================================================================== --- head/lib/msun/arm/fenv.h Sun Oct 27 10:09:53 2013 (r257206) +++ head/lib/msun/arm/fenv.h Sun Oct 27 10:44:22 2013 (r257207) @@ -44,14 +44,27 @@ typedef __uint32_t fexcept_t; #define FE_OVERFLOW 0x0004 #define FE_UNDERFLOW 0x0008 #define FE_INEXACT 0x0010 +#ifdef __ARM_PCS_VFP +#define FE_DENORMAL 0x0080 +#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \ + FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW | FE_DENORMAL) +#else #define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \ FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) +#endif /* Rounding modes */ +#ifdef __ARM_PCS_VFP +#define FE_TONEAREST 0x00000000 +#define FE_UPWARD 0x00400000 +#define FE_DOWNWARD 0x00800000 +#define FE_TOWARDZERO 0x00c00000 +#else #define FE_TONEAREST 0x0000 #define FE_TOWARDZERO 0x0001 #define FE_UPWARD 0x0002 #define FE_DOWNWARD 0x0003 +#endif #define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \ FE_UPWARD | FE_TOWARDZERO) __BEGIN_DECLS @@ -61,10 +74,12 @@ extern const fenv_t __fe_dfl_env; #define FE_DFL_ENV (&__fe_dfl_env) /* We need to be able to map status flag positions to mask flag positions */ -#define _FPUSW_SHIFT 16 +#ifndef __ARM_PCS_VFP +#define _FPUSW_SHIFT 16 #define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT) +#endif -#ifndef ARM_HARD_FLOAT +#ifndef __ARM_PCS_VFP int feclearexcept(int __excepts); int fegetexceptflag(fexcept_t *__flagp, int __excepts); @@ -78,19 +93,19 @@ int feholdexcept(fenv_t *__envp); int fesetenv(const fenv_t *__envp); int feupdateenv(const fenv_t *__envp); -#else /* ARM_HARD_FLOAT */ +#else /* __ARM_PCS_VFP */ -#define __rfs(__fpsr) __asm __volatile("rfs %0" : "=r" (*(__fpsr))) -#define __wfs(__fpsr) __asm __volatile("wfs %0" : : "r" (__fpsr)) +#define vmrs_fpscr(__r) __asm __volatile("vmrs %0, fpscr" : "=&r"(__r)) +#define vmsr_fpscr(__r) __asm __volatile("vmsr fpscr, %0" : : "r"(__r)) __fenv_static inline int feclearexcept(int __excepts) { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); __fpsr &= ~__excepts; - __wfs(__fpsr); + vmsr_fpscr(__fpsr); return (0); } @@ -99,7 +114,7 @@ fegetexceptflag(fexcept_t *__flagp, int { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); *__flagp = __fpsr & __excepts; return (0); } @@ -109,10 +124,10 @@ fesetexceptflag(const fexcept_t *__flagp { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); __fpsr &= ~__excepts; __fpsr |= *__flagp & __excepts; - __wfs(__fpsr); + vmsr_fpscr(__fpsr); return (0); } @@ -130,34 +145,36 @@ fetestexcept(int __excepts) { fexcept_t __fpsr; - __rfs(&__fpsr); + vmrs_fpscr(__fpsr); return (__fpsr & __excepts); } __fenv_static inline int fegetround(void) { + fenv_t __fpsr; - /* - * Apparently, the rounding mode is specified as part of the - * instruction format on ARM, so the dynamic rounding mode is - * indeterminate. Some FPUs may differ. - */ - return (-1); + vmrs_fpscr(__fpsr); + return (__fpsr & _ROUND_MASK); } __fenv_static inline int fesetround(int __round) { + fenv_t __fpsr; - return (-1); + vmrs_fpscr(__fpsr); + __fpsr &= ~(_ROUND_MASK); + __fpsr |= __round; + vmsr_fpscr(__fpsr); + return (0); } __fenv_static inline int fegetenv(fenv_t *__envp) { - __rfs(__envp); + vmrs_fpscr(*__envp); return (0); } @@ -166,10 +183,10 @@ feholdexcept(fenv_t *__envp) { fenv_t __env; - __rfs(&__env); + vmrs_fpscr(__env); *__envp = __env; - __env &= ~(FE_ALL_EXCEPT | _ENABLE_MASK); - __wfs(__env); + __env &= ~(FE_ALL_EXCEPT); + vmsr_fpscr(__env); return (0); } @@ -177,7 +194,7 @@ __fenv_static inline int fesetenv(const fenv_t *__envp) { - __wfs(*__envp); + vmsr_fpscr(*__envp); return (0); } @@ -186,8 +203,8 @@ feupdateenv(const fenv_t *__envp) { fexcept_t __fpsr; - __rfs(&__fpsr); - __wfs(*__envp); + vmrs_fpscr(__fpsr); + vmsr_fpscr(*__envp); feraiseexcept(__fpsr & FE_ALL_EXCEPT); return (0); } @@ -201,10 +218,10 @@ feenableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; - __rfs(&__old_fpsr); - __new_fpsr = __old_fpsr | (__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT; - __wfs(__new_fpsr); - return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); + vmrs_fpscr(__old_fpsr); + __new_fpsr = __old_fpsr | (__mask & FE_ALL_EXCEPT); + vmsr_fpscr(__new_fpsr); + return (__old_fpsr & FE_ALL_EXCEPT); } static inline int @@ -212,10 +229,10 @@ fedisableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; - __rfs(&__old_fpsr); - __new_fpsr = __old_fpsr & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT); - __wfs(__new_fpsr); - return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); + vmrs_fpscr(__old_fpsr); + __new_fpsr = __old_fpsr & ~(__mask & FE_ALL_EXCEPT); + vmsr_fpscr(__new_fpsr); + return (__old_fpsr & FE_ALL_EXCEPT); } static inline int @@ -223,13 +240,13 @@ fegetexcept(void) { fenv_t __fpsr; - __rfs(&__fpsr); - return ((__fpsr & _ENABLE_MASK) >> _FPUSW_SHIFT); + vmrs_fpscr(__fpsr); + return (__fpsr & FE_ALL_EXCEPT); } #endif /* __BSD_VISIBLE */ -#endif /* ARM_HARD_FLOAT */ +#endif /* __ARM_PCS_VFP */ __END_DECLS From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 11:58:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4CAB2914 for ; Sun, 27 Oct 2013 11:58:19 +0000 (UTC) (envelope-from symbolics@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C17F9249C for ; Sun, 27 Oct 2013 11:58:18 +0000 (UTC) Received: from lemon ([80.7.17.14]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LwIuc-1VkZsi46CU-0184vu for ; Sun, 27 Oct 2013 12:58:11 +0100 Received: by lemon (Postfix, from userid 1001) id 576FDEB372; Sun, 27 Oct 2013 11:58:10 +0000 (GMT) Date: Sun, 27 Oct 2013 11:58:10 +0000 From: symbolics@gmx.com To: svn-src-all@freebsd.org Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131027115810.GA898@lemon> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131027101106.GA2843@mole.fafoe.narf.at> X-Provags-ID: V03:K0:TrRXKdhpsEGp+FskgZx74YGHscwQorYfSbzTgjiFvXtATDU1MvN +yaNE8mHLIxu/eH5l9g0u8k1Hya9KeqazpQ7PV5nbJPSM5NRHweD6r87brgAPy2TKCK6Xbh P2BZwNAxelgh0hUp/JeQFd3zelBjyb3ZvJY2j2+S+Bla7u5qEpSQxKv8fAcaJ91PITSN7bX cTiS8tGCsOLb2OtkB3hfQ== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 11:58:19 -0000 On Sun, Oct 27, 2013 at 11:11:07AM +0100, Stefan Farfeleder wrote: > On Fri, Oct 25, 2013 at 07:44:54PM +0000, Adrian Chadd wrote: > > Author: adrian > > Date: Fri Oct 25 19:44:53 2013 > > New Revision: 257133 > > URL: http://svnweb.freebsd.org/changeset/base/257133 > > > > Log: > > Temporarily disable multi-rate retry (link quality) and eliminate rate > > index lookups. > > > > * My recent(ish) change to iwn(4) and the net80211 rate control API to > > support 11n rates broke the link quality table use. So, until I or > > someone else decides to fix it, let's just disable it for now. > > > > * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. > > > > * Eliminate two uses of the net80211 rate index lookup functions - they > > are only for legacy rates and they're not needed here. > > > > This fixes some invalid looking rate control TX issues that showed up > > on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look > > like DMA related issues. > > > > Tested: > > > > * 4965, STA mode > > * 5100, STA mode > > Hi Adrian, > > this change completely broke iwn for me. It's a > > iwn0: mem 0xf1ffe000-0xf1ffffff irq 17 at device 0.0 on pci12 > > built-in device in a Dell Precision m4400. > > With this change, wpa_supplicant cannot associate any longer. In the > logs I see every few seconds > > Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz) > Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with xx:xx:xx:xx:xx:xx timed out. > Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1 > > If I revert just this revision based on a r257155 checkout, it works > again. Hi, I've also had similar or identical problems. iwn0: mem 0xd4400000-0xd4401fff <...> If I `ifconfig wlan0` often I see the interface associate and get an IP address and then immediately disconnect. --sym From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 14:03:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0F6A12E2; Sun, 27 Oct 2013 14:03:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F138F2997; Sun, 27 Oct 2013 14:03:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RE3ppc089087; Sun, 27 Oct 2013 14:03:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RE3p0J089086; Sun, 27 Oct 2013 14:03:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310271403.r9RE3p0J089086@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Oct 2013 14:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257209 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 14:03:52 -0000 Author: nwhitehorn Date: Sun Oct 27 14:03:51 2013 New Revision: 257209 URL: http://svnweb.freebsd.org/changeset/base/257209 Log: Turn on VM_KMEM_SIZE_SCALE on 32-bit as well as 64-bit PowerPC. Requested by: alc MFC after: 1 month Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sun Oct 27 10:51:34 2013 (r257208) +++ head/sys/powerpc/include/vmparam.h Sun Oct 27 14:03:51 2013 (r257209) @@ -112,6 +112,7 @@ #define VM_MIN_KERNEL_ADDRESS KERNBASE #define VM_MAX_KERNEL_ADDRESS 0xf8000000 +#define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif /* AIM/E500 */ @@ -175,14 +176,21 @@ struct pmap_physseg { #define VM_KMEM_SIZE (12 * 1024 * 1024) #endif -#ifdef __powerpc64__ +/* + * How many physical pages per KVA page allocated. + * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) + * is the total KVA space allocated for kmem_map. + */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (3) #endif +/* + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. + */ #ifndef VM_KMEM_SIZE_MAX -#define VM_KMEM_SIZE_MAX 0x1c0000000 /* 7 GB */ -#endif +#define VM_KMEM_SIZE_MAX ((VM_MAX_SAFE_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 14:27:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 413AB9BF; Sun, 27 Oct 2013 14:27:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3402A6C; Sun, 27 Oct 2013 14:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RERCQF096641; Sun, 27 Oct 2013 14:27:12 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RERCpt096640; Sun, 27 Oct 2013 14:27:12 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201310271427.r9RERCpt096640@svn.freebsd.org> From: Andrew Turner Date: Sun, 27 Oct 2013 14:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257210 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 14:27:12 -0000 Author: andrew Date: Sun Oct 27 14:27:11 2013 New Revision: 257210 URL: http://svnweb.freebsd.org/changeset/base/257210 Log: Always build ubldr as a soft-float binary as there is no support for VFP this early on in the boot process. Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sun Oct 27 14:03:51 2013 (r257209) +++ head/sys/boot/arm/uboot/Makefile Sun Oct 27 14:27:11 2013 (r257210) @@ -90,7 +90,7 @@ CFLAGS+= -I. CLEANFILES+= vers.c loader.help -CFLAGS+= -ffreestanding +CFLAGS+= -ffreestanding -msoft-float LDFLAGS= -nostdlib -static LDFLAGS+= -T ldscript.generated From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:01:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7580F204; Sun, 27 Oct 2013 16:01:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 614712E80; Sun, 27 Oct 2013 16:01:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RG1CCq030292; Sun, 27 Oct 2013 16:01:12 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RG1CJY030289; Sun, 27 Oct 2013 16:01:12 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310271601.r9RG1CJY030289@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Oct 2013 16:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257212 - in head/cddl: contrib/opensolaris/cmd/lockstat usr.sbin/lockstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:01:12 -0000 Author: markj Date: Sun Oct 27 16:01:11 2013 New Revision: 257212 URL: http://svnweb.freebsd.org/changeset/base/257212 Log: Convert the lockstat(1) man page to mdoc and make sure that it gets installed. Additionally, remove Solaris-specific sections and references, and replace example outputs with output from lockstat on FreeBSD, since lockstat's output contains stack traces. This change also removes some examples that don't seem to work properly on FreeBSD. The examples should be re-added when lockstat is fixed. Reported by: avg MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 head/cddl/usr.sbin/lockstat/Makefile Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Oct 27 15:14:27 2013 (r257211) +++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.1 Sun Oct 27 16:01:11 2013 (r257212) @@ -2,7 +2,7 @@ .\" CDDL HEADER START .\" .\" The contents of this file are subject to the terms of the -.\" Common Development and Distribution License (the "License"). +.\" Common Development and Distribution License (the "License"). .\" You may not use this file except in compliance with the License. .\" .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE @@ -18,858 +18,382 @@ .\" .\" CDDL HEADER END .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. -.TH lockstat 1M "28 Feb 2008" "SunOS 5.11" "System Administration Commands" -.SH NAME -lockstat \- report kernel lock and profiling statistics -.SH SYNOPSIS -.LP -.nf -\fBlockstat\fR [\fB-ACEHI\fR] [\fB-e\fR \fIevent_list\fR] [\fB-i\fR \fIrate\fR] - [\fB-b\fR | \fB-t\fR | \fB-h\fR | \fB-s\fR \fIdepth\fR] [\fB-n\fR \fInrecords\fR] - [\fB-l\fR \fIlock\fR [, \fIsize\fR]] [\fB-d\fR \fIduration\fR] - [\fB-f\fR \fIfunction\fR [, \fIsize\fR]] [\fB-T\fR] [\fB-ckgwWRpP\fR] [\fB-D\fR \fIcount\fR] - [\fB-o\fR \fIfilename\fR] [\fB-x\fR \fIopt\fR [=val]] \fIcommand\fR [\fIargs\fR] -.fi - -.SH DESCRIPTION -.sp -.LP -The \fBlockstat\fR utility gathers and displays kernel locking and profiling statistics. \fBlockstat\fR allows you to specify which events to watch (for example, spin on adaptive mutex, block on read access to rwlock due to waiting writers, and so forth) how much -data to gather for each event, and how to display the data. By default, \fBlockstat\fR monitors all lock contention events, gathers frequency and timing data about those events, and displays the data in decreasing frequency order, so that the most common events appear first. -.sp -.LP -\fBlockstat\fR gathers data until the specified command completes. For example, to gather statistics for a fixed-time interval, use \fBsleep\fR(1) as -the command, as follows: -.sp -.LP -\fBexample#\fR \fBlockstat\fR \fBsleep\fR \fB5\fR -.sp -.LP -When the \fB-I\fR option is specified, \fBlockstat\fR establishes a per-processor high-level periodic interrupt source to gather profiling data. The interrupt handler simply generates a \fBlockstat\fR event whose caller is the interrupted PC (program counter). -The profiling event is just like any other \fBlockstat\fR event, so all of the normal \fBlockstat\fR options are applicable. -.sp -.LP -\fBlockstat\fR relies on DTrace to modify the running kernel's text to intercept events of interest. This imposes a small but measurable overhead on all system activity, so access to \fBlockstat\fR is restricted to super-user by default. The system administrator -can permit other users to use \fBlockstat\fR by granting them additional DTrace privileges. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace security features. -.SH OPTIONS -.sp -.LP -The following options are supported: -.SS "Event Selection" -.sp -.LP -If no event selection options are specified, the default is \fB-C\fR. -.sp -.ne 2 -.mk -.na -\fB\fB-A\fR\fR -.ad -.sp .6 -.RS 4n -Watch all lock events. \fB-A\fR is equivalent to \fB-CH\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-C\fR\fR -.ad -.sp .6 -.RS 4n -Watch contention events. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-E\fR\fR -.ad -.sp .6 -.RS 4n +.\" +.\" $FreeBSD$ +.\" +.Dd October 24, 2013 +.Dt LOCKSTAT 1 +.Os +.Sh NAME +.Nm lockstat +.Nd report kernel lock and profiling statistics +.Sh SYNOPSIS +.Nm +.Op Fl ACEHI +.Op Fl e Ar event-list +.Op Fl i Ar rate +.Op Fl b | t | h | s Ar depth +.Op Fl n Ar num-records +.Op Fl l Ar lock Oo Ns , Ns Ar size Oc +.Op Fl d Ar duration +.Op Fl f Ar function Oo Ns , Ns Ar size Oc +.Op Fl T +.Op Fl ckgwWRpP +.Op Fl D Ar count +.Op Fl o filename +.Op Fl x Ar opt Oo Ns = Ns Ar val Oc +.Ar command +.Op Oo Ar args Oc +.Sh DESCRIPTION +The +.Nm +utility gathers and displays kernel locking and profiling statistics. +.Nm +allows you to specify which events to watch (for example, spin on adaptive +mutex, block on read access to rwlock due to waiting writers, and so forth), how +much data to gather for each event, and how to display the data. +By default, +.Nm +monitors all lock contention events, gathers frequency and timing data about +those events, and displays the data in decreasing frequency order, so that the +most common events appear first. +.Pp +.Nm +gathers data until the specified command completes. +For example, to gather statistics for a fixed-time interval, use +.Xr sleep 1 +as the command, as follows: +.Pp +.Dl # lockstat sleep 5 +.Pp +When the +.Fl I +option is specified, +.Nm lockstat +establishes a per-processor high-level periodic interrupt source to gather +profiling data. +The interrupt handler simply generates a +.Nm +event whose caller is the interrupted PC (program counter). +The profiling event is just like any other +.Nm lockstat +event, so all of the normal +.Nm lockstat +options are applicable. +.Pp +.Nm +relies on DTrace to modify the running kernel's text to intercept events of +interest. +This imposes a small but measurable overhead on all system activity, so access +to +.Nm +is restricted to super-user by default. +.Sh OPTIONS +The following options are supported: +.Ss Event Selection +If no event selection options are specified, the default is +.Fl C . +.Bl -tag -width indent +.It Fl A +Watch all lock events. +.Fl A +is equivalent to +.Fl CH . +.It Fl C +Watch contention events. +.It Fl E Watch error events. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-e\fR \fIevent_list\fR\fR -.ad -.sp .6 -.RS 4n -Only watch the specified events. \fIevent\fR \fIlist\fR is a comma-separated list of events or ranges of events such as 1,4-7,35. Run \fBlockstat\fR with no arguments to get a brief description of all events. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-H\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl e Ar event-list +Only watch the specified events. +.Ar event-list +is a comma-separated list of events or ranges of events such as 1,4-7,35. +Run +.Nm +with no arguments to get a brief description of all events. +.It Fl H Watch hold events. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-I\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl I Watch profiling interrupt events. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-i\fR \fIrate\fR\fR -.ad -.sp .6 -.RS 4n -Interrupt rate (per second) for \fB-I\fR. The default is 97 Hz, so that profiling doesn't run in lockstep with the clock interrupt (which runs at 100 Hz). -.RE - -.SS "Data Gathering" -.sp -.ne 2 -.mk -.na -\fB\fB-x\fR \fIarg\fR[=\fIval\fR]\fR -.ad -.sp .6 -.RS 4n -Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fI\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and -value with an equals sign (=). -.RE - -.SS "Data Gathering (Mutually Exclusive)" -.sp -.ne 2 -.mk -.na -\fB\fB-b\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl i Ar rate +Interrupt rate (per second) for +.Fl I . +The default is 97 Hz, so that profiling doesn't run in lockstep with the clock +interrupt (which runs at 100 Hz). +.El +.Ss Data Gathering +.Bl -tag -width indent +.It Fl x Ar arg Oo Ns = Ns Ar val Oc +Enable or modify a +.Xr dtrace 1 +runtime option or D compiler option. +Boolean options are enabled by specifying their name. +Options with values are set by separating the option name and value with an +equals sign. +.El +.Ss "Data Gathering (Mutually Exclusive)" +.Bl -tag -width indent +.It Fl b Basic statistics: lock, caller, number of events. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-h\fR\fR -.ad -.sp .6 -.RS 4n -Histogram: Timing plus time-distribution histograms. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-s\fR \fIdepth\fR\fR -.ad -.sp .6 -.RS 4n -Stack trace: Histogram plus stack traces up to \fIdepth\fR frames deep. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-t\fR\fR -.ad -.sp .6 -.RS 4n -Timing: Basic plus timing for all events [default]. -.RE - -.SS "Data Filtering" -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-d\fR \fIduration\fR\fR -.ad -.sp .6 -.RS 4n -Only watch events longer than \fIduration\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-f\fR \fIfunc[,size]\fR\fR -.ad -.sp .6 -.RS 4n -Only watch events generated by \fIfunc\fR, which can be specified as a symbolic name or hex address. \fIsize\fR defaults to the \fBELF\fR symbol size if available, or \fB1\fR if not. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-l\fR \fIlock[,size]\fR\fR -.ad -.sp .6 -.RS 4n -Only watch \fIlock\fR, which can be specified as a symbolic name or hex address. \fBsize\fR defaults to the \fBELF\fR symbol size or \fB1\fR if the symbol size is not available. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-n\fR \fInrecords\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl h +Histogram: timing plus time-distribution histograms. +.It Fl s Ar depth +Stack trace: histogram plus stack traces up to +.Ar depth +frames deep. +.It Fl t +Timing: Basic plus timing for all events (default). +.El +.Ss "Data Filtering" +.Bl -tag -width indent +.It Fl d Ar duration +Only watch events longer than +.Ar duration . +.It Fl f Ar func Ns Oo Ns , Ns Ar size Oc Ns +Only watch events generated by +.Ar func , +which can be specified as a symbolic name or hex address. +.Ar size +defaults to the ELF symbol size if available, or 1 if not. +.It Fl l Ar lock Ns Oo Ns , Ns Ar size Oc Ns +Only watch +.Ar lock , +which can be specified as a symbolic name or hex address. +.Ar size +defaults to the ELF symbol size or 1 if the symbol size is not available. +.It Fl n Ar num-records Maximum number of data records. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-T\fR\fR -.ad -.sp .6 -.RS 4n -Trace (rather than sample) events [off by default]. -.RE - -.SS "Data Reporting" -.sp -.ne 2 -.mk -.na -\fB\fB-c\fR\fR -.ad -.sp .6 -.RS 4n -Coalesce lock data for lock arrays (for example, \fBpse_mutex[]\fR). -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-D\fR \fIcount\fR\fR -.ad -.sp .6 -.RS 4n -Only display the top \fIcount\fR events of each type. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-g\fR\fR -.ad -.sp .6 -.RS 4n -Show total events generated by function. For example, if \fBfoo()\fR calls \fBbar()\fR in a loop, the work done by \fBbar()\fR counts as work generated by \fBfoo()\fR (along with any work done by \fBfoo()\fR itself). -The \fB-g\fR option works by counting the total number of stack frames in which each function appears. This implies two things: (1) the data reported by \fB-g\fR can be misleading if the stack traces are not deep enough, and (2) functions that are called recursively might show -greater than 100% activity. In light of issue (1), the default data gathering mode when using \fB-g\fR is \fB-s\fR \fB50\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-k\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl T +Trace (rather than sample) events. +This is off by default. +.El +.Ss Data Reporting +.Bl -tag -width indent +.It Fl c +Coalesce lock data for lock arrays. +.It Fl D Ar count +Only display the top +.Ar count +events of each type. +.It Fl g +Show total events generated by function. +For example, if +.Fn foo +calls +.Fn bar +in a loop, the work done by +.Fn bar +counts as work generated by +.Fn foo +(along with any work done by +.Fn foo +itself). +The +.Fl g +option works by counting the total number of stack frames in which each function +appears. +This implies two things: (1) the data reported by +.Fl g +can be misleading if the stack traces are not deep enough, and (2) functions +that are called recursively might show greater than 100% activity. +In light of issue (1), the default data gathering mode when using +.Fl g +is +.Fl s 50 . +.It Fl k Coalesce PCs within functions. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB\fR\fB-o\fR \fIfilename\fR\fR -.ad -.sp .6 -.RS 4n -Direct output to \fIfilename\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-P\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl o Ar filename +Direct output to +.Ar filename . +.It Fl P Sort data by (\fIcount * time\fR) product. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-p\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl p Parsable output format. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-R\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl R Display rates (events per second) rather than counts. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-W\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl W Whichever: distinguish events only by caller, not by lock. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fB-w\fR\fR -.ad -.sp .6 -.RS 4n +.It Fl w Wherever: distinguish events only by lock, not by caller. -.RE - -.SH DISPLAY FORMATS -.sp -.LP +.El +.Sh DISPLAY FORMATS The following headers appear over various columns of data. -.sp -.ne 2 -.mk -.na -\fB\fBCount\fR or \fBops/s\fR\fR -.ad -.sp .6 -.RS 4n -Number of times this event occurred, or the rate (times per second) if \fB-R\fR was specified. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBindv\fR\fR -.ad -.sp .6 -.RS 4n +.Bl -tag -width indent +.It Count or ops/s +Number of times this event occurred, or the rate (times per second) if +.Fl R +was specified. +.It indv Percentage of all events represented by this individual event. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBgenr\fR\fR -.ad -.sp .6 -.RS 4n +.It genr Percentage of all events generated by this function. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBcuml\fR\fR -.ad -.sp .6 -.RS 4n +.It cuml Cumulative percentage; a running total of the individuals. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBrcnt\fR\fR -.ad -.sp .6 -.RS 4n -Average reference count. This will always be \fB1\fR for exclusive locks (mutexes, spin locks, rwlocks held as writer) but can be greater than \fB1\fR for shared locks (rwlocks held as reader). -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBnsec\fR\fR -.ad -.sp .6 -.RS 4n -Average duration of the events in nanoseconds, as appropriate for the event. For the profiling event, duration means interrupt latency. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBLock\fR\fR -.ad -.sp .6 -.RS 4n +.It rcnt +Average reference count. +This will always be 1 for exclusive locks (mutexes, +spin locks, rwlocks held as writer) but can be greater than 1 for shared locks +(rwlocks held as reader). +.It nsec +Average duration of the events in nanoseconds, as appropriate for the event. +For the profiling event, duration means interrupt latency. +.It Lock Address of the lock; displayed symbolically if possible. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBCPU+PIL\fR\fR -.ad -.sp .6 -.RS 4n -\fBCPU\fR plus processor interrupt level (\fBPIL\fR). For example, if \fBCPU\fR 4 is interrupted while at \fBPIL\fR 6, this will be reported as \fBcpu[4]+6\fR. -.RE - -.sp -.ne 2 -.mk -.na -\fB\fBCaller\fR\fR -.ad -.sp .6 -.RS 4n +.It CPU+PIL +CPU plus processor interrupt level (PIL). +For example, if CPU 4 is interrupted while at PIL 6, this will be reported as +cpu[4]+6. +.It Caller Address of the caller; displayed symbolically if possible. -.RE - -.SH EXAMPLES -.LP -\fBExample 1 \fRMeasuring Kernel Lock Contention -.sp -.in +2 -.nf -example# \fBlockstat sleep 5\fR -Adaptive mutex spin: 2210 events in 5.055 seconds (437 events/sec) -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -Count indv cuml rcnt nsec Lock Caller ------------------------------------------------------------------------- - 269 12% 12% 1.00 2160 service_queue background+0xdc - 249 11% 23% 1.00 86 service_queue qenable_locked+0x64 - 228 10% 34% 1.00 131 service_queue background+0x15c - 68 3% 37% 1.00 79 0x30000024070 untimeout+0x1c - 59 3% 40% 1.00 384 0x300066fa8e0 background+0xb0 - 43 2% 41% 1.00 30 rqcred_lock svc_getreq+0x3c - 42 2% 43% 1.00 341 0x30006834eb8 background+0xb0 - 41 2% 45% 1.00 135 0x30000021058 untimeout+0x1c - 40 2% 47% 1.00 39 rqcred_lock svc_getreq+0x260 - 37 2% 49% 1.00 2372 0x300068e83d0 hmestart+0x1c4 - 36 2% 50% 1.00 77 0x30000021058 timeout_common+0x4 - 36 2% 52% 1.00 354 0x300066fa120 background+0xb0 - 32 1% 53% 1.00 97 0x30000024070 timeout_common+0x4 - 31 1% 55% 1.00 2923 0x300069883d0 hmestart+0x1c4 - 29 1% 56% 1.00 366 0x300066fb290 background+0xb0 - 28 1% 57% 1.00 117 0x3000001e040 untimeout+0x1c - 25 1% 59% 1.00 93 0x3000001e040 timeout_common+0x4 - 22 1% 60% 1.00 25 0x30005161110 sync_stream_buf+0xdc - 21 1% 60% 1.00 291 0x30006834eb8 putq+0xa4 - 19 1% 61% 1.00 43 0x3000515dcb0 mdf_alloc+0xc - 18 1% 62% 1.00 456 0x30006834eb8 qenable+0x8 - 18 1% 63% 1.00 61 service_queue queuerun+0x168 - 17 1% 64% 1.00 268 0x30005418ee8 vmem_free+0x3c -[...] +.El +.Sh EXAMPLES +.Bl -tag -width 0n +.It Example 1 Measuring Kernel Lock Contention +.Pp +.Li # lockstat sleep 5 +.Bd -literal +Adaptive mutex spin: 41411 events in 5.011 seconds (8263 events/sec) -R/W reader blocked by writer: 76 events in 5.055 seconds (15 events/sec) - -Count indv cuml rcnt nsec Lock Caller ------------------------------------------------------------------------- - 23 30% 30% 1.00 22590137 0x300098ba358 ufs_dirlook+0xd0 - 17 22% 53% 1.00 5820995 0x3000ad815e8 find_bp+0x10 - 13 17% 70% 1.00 2639918 0x300098ba360 ufs_iget+0x198 - 4 5% 75% 1.00 3193015 0x300098ba360 ufs_getattr+0x54 - 3 4% 79% 1.00 7953418 0x3000ad817c0 find_bp+0x10 - 3 4% 83% 1.00 935211 0x3000ad815e8 find_read_lof+0x14 - 2 3% 86% 1.00 16357310 0x300073a4720 find_bp+0x10 - 2 3% 88% 1.00 2072433 0x300073a4720 find_read_lof+0x14 - 2 3% 91% 1.00 1606153 0x300073a4370 find_bp+0x10 - 1 1% 92% 1.00 2656909 0x300107e7400 ufs_iget+0x198 -[...] -.fi -.in -2 -.sp - -.LP -\fBExample 2 \fRMeasuring Hold Times -.sp -.in +2 -.nf -example# \fBlockstat -H -D 10 sleep 1\fR -Adaptive mutex spin: 513 events -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -Count indv cuml rcnt nsec Lock Caller -------------------------------------------------------------------------- - 480 5% 5% 1.00 1136 0x300007718e8 putnext+0x40 - 286 3% 9% 1.00 666 0x3000077b430 getf+0xd8 - 271 3% 12% 1.00 537 0x3000077b430 msgio32+0x2fc - 270 3% 15% 1.00 3670 0x300007718e8 strgetmsg+0x3d4 - 270 3% 18% 1.00 1016 0x300007c38b0 getq_noenab+0x200 - 264 3% 20% 1.00 1649 0x300007718e8 strgetmsg+0xa70 - 216 2% 23% 1.00 6251 tcp_mi_lock tcp_snmp_get+0xfc - 206 2% 25% 1.00 602 thread_free_lock clock+0x250 - 138 2% 27% 1.00 485 0x300007c3998 putnext+0xb8 - 138 2% 28% 1.00 3706 0x300007718e8 strrput+0x5b8 -------------------------------------------------------------------------- +Count indv cuml rcnt nsec Lock Caller +------------------------------------------------------------------------------- +13750 33% 33% 0.00 72 vm_page_queue_free_mtx vm_page_free_toq+0x12e +13648 33% 66% 0.00 66 vm_page_queue_free_mtx vm_page_alloc+0x138 + 4023 10% 76% 0.00 51 vm_dom+0x80 vm_page_dequeue+0x68 + 2672 6% 82% 0.00 186 vm_dom+0x80 vm_page_enqueue+0x63 + 618 1% 84% 0.00 31 0xfffff8000cd83a88 qsyncvp+0x37 + 506 1% 85% 0.00 164 0xfffff8000cb3f098 vputx+0x5a + 477 1% 86% 0.00 69 0xfffff8000c7eb180 uma_dbg_getslab+0x5b + 288 1% 87% 0.00 77 0xfffff8000cd8b000 vn_finished_write+0x29 + 263 1% 88% 0.00 103 0xfffff8000cbad448 vinactive+0xdc + 259 1% 88% 0.00 53 0xfffff8000cd8b000 vfs_ref+0x24 + 237 1% 89% 0.00 20 0xfffff8000cbad448 vfs_hash_get+0xcc + 233 1% 89% 0.00 22 0xfffff8000bfd9480 uma_dbg_getslab+0x5b + 223 1% 90% 0.00 20 0xfffff8000cb3f098 cache_lookup+0x561 + 193 0% 90% 0.00 16 0xfffff8000cb40ba8 vref+0x27 + 175 0% 91% 0.00 34 0xfffff8000cbad448 vputx+0x5a + 169 0% 91% 0.00 51 0xfffff8000cd8b000 vfs_unbusy+0x27 + 164 0% 92% 0.00 31 0xfffff8000cb40ba8 vputx+0x5a [...] -.fi -.in -2 -.sp -.LP -\fBExample 3 \fRMeasuring Hold Times for Stack Traces Containing a Specific Function -.sp -.in +2 -.nf -example# \fBlockstat -H -f tcp_rput_data -s 50 -D 10 sleep 1\fR -Adaptive mutex spin: 11 events in 1.023 seconds (11 -events/sec) -.fi -.in -2 -.sp +Adaptive mutex block: 10 events in 5.011 seconds (2 events/sec) -.sp -.in +2 -.nf -------------------------------------------------------------------------- Count indv cuml rcnt nsec Lock Caller - 9 82% 82% 1.00 2540 0x30000031380 tcp_rput_data+0x2b90 - - nsec ------ Time Distribution ------ count Stack - 256 |@@@@@@@@@@@@@@@@ 5 tcp_rput_data+0x2b90 - 512 |@@@@@@ 2 putnext+0x78 - 1024 |@@@ 1 ip_rput+0xec4 - 2048 | 0 _c_putnext+0x148 - 4096 | 0 hmeread+0x31c - 8192 | 0 hmeintr+0x36c - 16384 |@@@ 1 -sbus_intr_wrapper+0x30 -[...] +------------------------------------------------------------------------------- + 3 30% 30% 0.00 17592 vm_page_queue_free_mtx vm_page_alloc+0x138 + 2 20% 50% 0.00 20528 vm_dom+0x80 vm_page_enqueue+0x63 + 2 20% 70% 0.00 55502 0xfffff8000cb40ba8 vputx+0x5a + 1 10% 80% 0.00 12007 vm_page_queue_free_mtx vm_page_free_toq+0x12e + 1 10% 90% 0.00 9125 0xfffff8000cbad448 vfs_hash_get+0xcc + 1 10% 100% 0.00 7864 0xfffff8000cd83a88 qsyncvp+0x37 +------------------------------------------------------------------------------- +[...] +.Ed +.It Example 2 Measuring Hold Times +.Pp +.Li # lockstat -H -D 10 sleep 1 +.Bd -literal +Adaptive mutex hold: 109589 events in 1.039 seconds (105526 events/sec) Count indv cuml rcnt nsec Lock Caller - 1 9% 91% 1.00 1036 0x30000055380 freemsg+0x44 - - nsec ------ Time Distribution ------ count Stack - 1024 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1 freemsg+0x44 - tcp_rput_data+0x2fd0 - putnext+0x78 - ip_rput+0xec4 - _c_putnext+0x148 - hmeread+0x31c - hmeintr+0x36c - -sbus_intr_wrapper+0x30 -------------------------------------------------------------------------- +------------------------------------------------------------------------------- + 8998 8% 8% 0.00 617 0xfffff8000c7eb180 uma_dbg_getslab+0xd4 + 5901 5% 14% 0.00 917 vm_page_queue_free_mtx vm_object_terminate+0x16a + 5040 5% 18% 0.00 902 vm_dom+0x80 vm_page_free_toq+0x88 + 4884 4% 23% 0.00 1056 vm_page_queue_free_mtx vm_page_alloc+0x44e + 4664 4% 27% 0.00 759 vm_dom+0x80 vm_fault_hold+0x1a13 + 4011 4% 31% 0.00 888 vm_dom vm_page_advise+0x11b + 4010 4% 34% 0.00 957 vm_dom+0x80 _vm_page_deactivate+0x5c + 3743 3% 38% 0.00 582 0xfffff8000cf04838 pmap_is_prefaultable+0x158 + 2254 2% 40% 0.00 952 vm_dom vm_page_free_toq+0x88 + 1639 1% 41% 0.00 591 0xfffff800d60065b8 trap_pfault+0x1f7 +------------------------------------------------------------------------------- [...] -.fi -.in -2 -.sp -.LP -\fBExample 4 \fRBasic Kernel Profiling -.sp -.LP -For basic profiling, we don't care whether the profiling interrupt sampled \fBfoo()\fR\fB+0x4c\fR or \fBfoo()\fR\fB+0x78\fR; we care only that it sampled somewhere in \fBfoo()\fR, so we use \fB-k\fR. The \fBCPU\fR and \fBPIL\fR aren't relevant to basic profiling because we are measuring the system as a whole, not a particular \fBCPU\fR or interrupt level, so we use \fB-W\fR. +R/W writer hold: 64314 events in 1.039 seconds (61929 events/sec) -.sp -.in +2 -.nf -example# \fBlockstat -kIW -D 20 ./polltest\fR -Profiling interrupt: 82 events in 0.424 seconds (194 -events/sec) -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -Count indv cuml rcnt nsec Hottest CPU+PIL Caller ------------------------------------------------------------------------ - 8 10% 10% 1.00 698 cpu[1] utl0 - 6 7% 17% 1.00 299 cpu[0] read - 5 6% 23% 1.00 124 cpu[1] getf - 4 5% 28% 1.00 327 cpu[0] fifo_read - 4 5% 33% 1.00 112 cpu[1] poll - 4 5% 38% 1.00 212 cpu[1] uiomove - 4 5% 43% 1.00 361 cpu[1] mutex_tryenter - 3 4% 46% 1.00 682 cpu[0] write - 3 4% 50% 1.00 89 cpu[0] pcache_poll - 3 4% 54% 1.00 118 cpu[1] set_active_fd - 3 4% 57% 1.00 105 cpu[0] syscall_trap32 - 3 4% 61% 1.00 640 cpu[1] (usermode) - 2 2% 63% 1.00 127 cpu[1] fifo_poll - 2 2% 66% 1.00 300 cpu[1] fifo_write - 2 2% 68% 1.00 669 cpu[0] releasef - 2 2% 71% 1.00 112 cpu[1] bt_getlowbit - 2 2% 73% 1.00 247 cpu[1] splx - 2 2% 76% 1.00 503 cpu[0] mutex_enter - 2 2% 78% 1.00 467 cpu[0]+10 disp_lock_enter - 2 2% 80% 1.00 139 cpu[1] default_copyin ------------------------------------------------------------------------ -[...] -.fi -.in -2 -.sp - -.LP -\fBExample 5 \fRGenerated-load Profiling -.sp -.LP -In the example above, 5% of the samples were in \fBpoll()\fR. This tells us how much time was spent inside \fBpoll()\fR itself, but tells us nothing about how much work was \fBgenerated\fR by \fBpoll()\fR; that is, how much time we spent -in functions called by \fBpoll()\fR. To determine that, we use the \fB-g\fR option. The example below shows that although \fBpolltest\fR spends only 5% of its time in \fBpoll()\fR itself, \fBpoll()\fR-induced work accounts for 34% of -the load. - -.sp -.LP -Note that the functions that generate the profiling interrupt (\fBlockstat_intr()\fR, \fBcyclic_fire()\fR, and so forth) appear in every stack trace, and therefore are considered to have generated 100% of the load. This illustrates an important point: the generated -load percentages do \fBnot\fR add up to 100% because they are not independent. If 72% of all stack traces contain both \fBfoo()\fR and \fBbar()\fR, then both \fBfoo()\fR and \fBbar()\fR are 72% load generators. - -.sp -.in +2 -.nf -example# \fBlockstat -kgIW -D 20 ./polltest\fR -Profiling interrupt: 80 events in 0.412 seconds (194 events/sec) -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -Count genr cuml rcnt nsec Hottest CPU+PIL Caller -------------------------------------------------------------------------- - 80 100% ---- 1.00 310 cpu[1] lockstat_intr - 80 100% ---- 1.00 310 cpu[1] cyclic_fire - 80 100% ---- 1.00 310 cpu[1] cbe_level14 - 80 100% ---- 1.00 310 cpu[1] current_thread - 27 34% ---- 1.00 176 cpu[1] poll - 20 25% ---- 1.00 221 cpu[0] write - 19 24% ---- 1.00 249 cpu[1] read - 17 21% ---- 1.00 232 cpu[0] write32 - 17 21% ---- 1.00 207 cpu[1] pcache_poll - 14 18% ---- 1.00 319 cpu[0] fifo_write - 13 16% ---- 1.00 214 cpu[1] read32 - 10 12% ---- 1.00 208 cpu[1] fifo_read - 10 12% ---- 1.00 787 cpu[1] utl0 - 9 11% ---- 1.00 178 cpu[0] pcacheset_resolve - 9 11% ---- 1.00 262 cpu[0] uiomove - 7 9% ---- 1.00 506 cpu[1] (usermode) - 5 6% ---- 1.00 195 cpu[1] fifo_poll - 5 6% ---- 1.00 136 cpu[1] syscall_trap32 - 4 5% ---- 1.00 139 cpu[0] releasef - 3 4% ---- 1.00 277 cpu[1] polllock -------------------------------------------------------------------------- -[...] -.fi -.in -2 -.sp - -.LP -\fBExample 6 \fRGathering Lock Contention and Profiling Data for a Specific Module -.sp -.LP -In this example we use the \fB-f\fR option not to specify a single function, but rather to specify the entire text space of the \fBsbus\fR module. We gather both lock contention and profiling statistics so that contention can be correlated with overall load on the -module. - -.sp -.in +2 -.nf -example# \fBmodinfo | grep sbus\fR -24 102a8b6f b8b4 59 1 sbus (SBus (sysio) nexus driver) -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -example# \fBlockstat -kICE -f 0x102a8b6f,0xb8b4 sleep 10\fR -Adaptive mutex spin: 39 events in 10.042 seconds (4 events/sec) -.fi -.in -2 -.sp - -.sp -.in +2 -.nf -Count indv cuml rcnt nsec Lock Caller -------------------------------------------------------------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:02:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A523348; Sun, 27 Oct 2013 16:02:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 086532E8D; Sun, 27 Oct 2013 16:02:06 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id i7so3339726qcq.30 for ; Sun, 27 Oct 2013 09:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=60xqyYTbP1ocjaoWXNhtnJjRc0gmb9ygJg1NZNPkee8=; b=b+Wr97g7WJ9Do01QApp1hklGDJDyPwW9ZJuMRRa93LSv6OgP/wdYjrgt0jnVtFQo/h y/7eiPd+qcKCejk05BaS8kWck+GuIApXP92cmy8XPvz5Ulj7G7e6LC7auk9FrYv0D80Z 0KAqGTWGEUkTRjpoEf0ec+lv8FtsF6GkANEreJMV7SegQq12VGdbfadNYrIQgZHMiKBU Q18HV7iMkBuioybCeolqOAppy5WHi415zMVB7jFDZ3lJkmuITq6ipRT+mq/cNLnfyDDN cmugf5sk0s054Jc1ZTbaA+tQMZ98tKJHC9dlFFyBfeRjNSghKPKROp1ur6dHjX3CjBV5 7MTQ== MIME-Version: 1.0 X-Received: by 10.224.51.131 with SMTP id d3mr24815239qag.0.1382889726171; Sun, 27 Oct 2013 09:02:06 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sun, 27 Oct 2013 09:02:06 -0700 (PDT) In-Reply-To: <20131027071909.GH52889@FreeBSD.org> References: <201310261840.r9QIeH89083767@svn.freebsd.org> <20131027071909.GH52889@FreeBSD.org> Date: Sun, 27 Oct 2013 09:02:06 -0700 X-Google-Sender-Auth: Il8p9HgCqMLJsGkrJgJVWRSHWSQ Message-ID: Subject: Re: svn commit: r257184 - in head/sys/dev: mii usb/net xl From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:02:07 -0000 Cool. Just make sure you check the odd ones like USB, where ejecting may occur during or just before the callout runs, and the callout tries accessing registers that aren't there. Sure the previous was racy, but it may have been "not racy enough" to cause most people to never see a panic. -adrian On 27 October 2013 00:19, Gleb Smirnoff wrote: > On Sat, Oct 26, 2013 at 06:57:04PM -0700, Adrian Chadd wrote: > A> hm, so none of the modified PHYs nor their consumers will get upset? > A> Eg, if the NIC is down, is touching the PHY registers going to be a > A> problem? > > The IFF_UP was always an administrative flag. I believe drivers initialize > all their resources before being set an address with SIOCSIFADDR. > > If a driver doesn't, then the previous code still was racy. > > Anyway, I am going to handle any fallouts. > > > -- > Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:04:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 299E54CE; Sun, 27 Oct 2013 16:04:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABF592EA0; Sun, 27 Oct 2013 16:04:10 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id j15so1602873qaq.20 for ; Sun, 27 Oct 2013 09:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=fDRFm/woMIfgeFpF1qZFevPUosxgCEd4oYCIAiH+ONg=; b=OVX6qa0uIsmucdQGFaSCZvu8Hv1m2wBrfCtGGo7HOemOg5124NNLKSoFR3u05vL+yU /fjoHMuEhvU0n2C9I0I48ExvDobtfItpSe513SFTIHauwX3zznsat3xUBJNQsvU70lQk Ea01nwBpGwdi3B/VkezEhCOH0CmrSE74usbZWMKEssb0s1H0nH/oGt0KE5oPiScD1Ewq mW/t6JW4mfOkrMYtYrsCUOwKoNz6qhPYhoADV2aZ+Ve5Gkssvo810NA2/9K2m95bP7F1 g46JKSwK4DWgrROriPMoUJuScdsvdWU4nf2s3XCsrE2bV+JPz7lGLx3zemgD+kZk1K6b 6Xhw== MIME-Version: 1.0 X-Received: by 10.49.127.179 with SMTP id nh19mr23421308qeb.1.1382889849951; Sun, 27 Oct 2013 09:04:09 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sun, 27 Oct 2013 09:04:09 -0700 (PDT) In-Reply-To: <20131027101106.GA2843@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> Date: Sun, 27 Oct 2013 09:04:09 -0700 X-Google-Sender-Auth: RPSwdG0w2bo64XXXyJnDsFYe7uY Message-ID: Subject: Re: svn commit: r257133 - head/sys/dev/iwn From: Adrian Chadd To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:04:11 -0000 Hm, ok. Can you compile it with IWN_DEBUG and IEEE80211_DEBUG, then do this: sysctl dev.iwn.0.debug=0x1 wlandebug +rate I'd like to see what the selected rate is and what the logged reason for failing to transmit is. I have a 5100 and it works totally fine for me. Thanks! -adrian On 27 October 2013 03:11, Stefan Farfeleder wrote: > On Fri, Oct 25, 2013 at 07:44:54PM +0000, Adrian Chadd wrote: >> Author: adrian >> Date: Fri Oct 25 19:44:53 2013 >> New Revision: 257133 >> URL: http://svnweb.freebsd.org/changeset/base/257133 >> >> Log: >> Temporarily disable multi-rate retry (link quality) and eliminate rate >> index lookups. >> >> * My recent(ish) change to iwn(4) and the net80211 rate control API to >> support 11n rates broke the link quality table use. So, until I or >> someone else decides to fix it, let's just disable it for now. >> >> * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. >> >> * Eliminate two uses of the net80211 rate index lookup functions - they >> are only for legacy rates and they're not needed here. >> >> This fixes some invalid looking rate control TX issues that showed up >> on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look >> like DMA related issues. >> >> Tested: >> >> * 4965, STA mode >> * 5100, STA mode > > Hi Adrian, > > this change completely broke iwn for me. It's a > > iwn0: mem 0xf1ffe000-0xf1ffffff irq 17 at device 0.0 on pci12 > > built-in device in a Dell Precision m4400. > > With this change, wpa_supplicant cannot associate any longer. In the > logs I see every few seconds > > Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz) > Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with xx:xx:xx:xx:xx:xx timed out. > Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1 > > If I revert just this revision based on a r257155 checkout, it works > again. > > Stefan From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:18:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1B052770; Sun, 27 Oct 2013 16:18:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0996C2F35; Sun, 27 Oct 2013 16:18:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RGImlU034935; Sun, 27 Oct 2013 16:18:48 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RGImt7034934; Sun, 27 Oct 2013 16:18:48 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310271618.r9RGImt7034934@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Oct 2013 16:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257213 - head/cddl/contrib/opensolaris/cmd/lockstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:18:49 -0000 Author: markj Date: Sun Oct 27 16:18:48 2013 New Revision: 257213 URL: http://svnweb.freebsd.org/changeset/base/257213 Log: If the initial attempt to open /dev/ksyms fails, kldload the ksyms module and retry. Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Sun Oct 27 16:01:11 2013 (r257212) +++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Sun Oct 27 16:18:48 2013 (r257213) @@ -179,8 +179,19 @@ symtab_init(void) size_t sz; #endif +#if defined(__FreeBSD__) + if ((fd = open("/dev/ksyms", O_RDONLY)) == -1) { + if (errno == ENOENT && modfind("ksyms") == -1) { + kldload("ksyms"); + fd = open("/dev/ksyms", O_RDONLY); + } + if (fd == -1) + return (-1); + } +#else if ((fd = open("/dev/ksyms", O_RDONLY)) == -1) return (-1); +#endif #if defined(sun) (void) elf_version(EV_CURRENT); From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:20:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A74BA8B5; Sun, 27 Oct 2013 16:20:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 964C02F64; Sun, 27 Oct 2013 16:20:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RGKqwv037352; Sun, 27 Oct 2013 16:20:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RGKqfb037351; Sun, 27 Oct 2013 16:20:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310271620.r9RGKqfb037351@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Oct 2013 16:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257214 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:20:52 -0000 Author: kib Date: Sun Oct 27 16:20:52 2013 New Revision: 257214 URL: http://svnweb.freebsd.org/changeset/base/257214 Log: When reentering kdb, typically due to a bug causing trap or assert in the code executed in the context of debugger, do not be ashamed to inform loudly about the re-entry. Also, print the backtrace before obliterating current stack with longjmp, allowing the operator to see a place which caused the bug. The change should make it less mysterious debugging the ddb itself. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Sun Oct 27 16:18:48 2013 (r257213) +++ head/sys/kern/subr_kdb.c Sun Oct 27 16:20:52 2013 (r257214) @@ -503,6 +503,8 @@ kdb_reenter(void) if (!kdb_active || kdb_jmpbufp == NULL) return; + printf("KDB: reentering\n"); + kdb_backtrace(); longjmp(kdb_jmpbufp, 1); /* NOTREACHED */ } From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:26:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9BF3BA10; Sun, 27 Oct 2013 16:26:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86D602F7A; Sun, 27 Oct 2013 16:26:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RGQ19u038063; Sun, 27 Oct 2013 16:26:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RGPvGD038021; Sun, 27 Oct 2013 16:25:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310271625.r9RGPvGD038021@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 27 Oct 2013 16:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257215 - in head: contrib/libpcap etc/mtree include sys/contrib/altq/altq sys/net sys/netpfil/ipfw sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:26:01 -0000 Author: glebius Date: Sun Oct 27 16:25:57 2013 New Revision: 257215 URL: http://svnweb.freebsd.org/changeset/base/257215 Log: Move new pf includes to the pf directory. The pfvar.h remain in net, to avoid compatibility breakage for no sake. The future plan is to split most of non-kernel parts of pfvar.h into pf.h, and then make pfvar.h a kernel only include breaking compatibility. Discussed with: bz Added: head/sys/netpfil/pf/pf.h - copied unchanged from r257214, head/sys/net/pf.h head/sys/netpfil/pf/pf_altq.h - copied unchanged from r257189, head/sys/net/pf_altq.h head/sys/netpfil/pf/pf_mtag.h - copied unchanged from r257189, head/sys/net/pf_mtag.h Deleted: head/sys/net/pf.h head/sys/net/pf_altq.h head/sys/net/pf_mtag.h Modified: head/contrib/libpcap/grammar.y head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/contrib/altq/altq/altq_cbq.c head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_red.c head/sys/contrib/altq/altq/altq_rio.c head/sys/contrib/altq/altq/altq_subr.c head/sys/net/if_ethersubr.c head/sys/net/pfvar.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_lb.c head/sys/netpfil/pf/pf_norm.c Modified: head/contrib/libpcap/grammar.y ============================================================================== --- head/contrib/libpcap/grammar.y Sun Oct 27 16:20:52 2013 (r257214) +++ head/contrib/libpcap/grammar.y Sun Oct 27 16:25:57 2013 (r257215) @@ -56,7 +56,7 @@ struct rtentry; #include "gencode.h" #ifdef HAVE_NET_PFVAR_H #include -#include +#include #include #endif #include "ieee80211.h" Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Oct 27 16:20:52 2013 (r257214) +++ head/etc/mtree/BSD.include.dist Sun Oct 27 16:25:57 2013 (r257215) @@ -289,6 +289,10 @@ sig .. .. + netpfil + pf + .. + .. netsmb .. nfs Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Oct 27 16:20:52 2013 (r257214) +++ head/include/Makefile Sun Oct 27 16:25:57 2013 (r257215) @@ -288,6 +288,13 @@ symlinks: ${DESTDIR}${INCLUDEDIR}/netinet; \ done .endif +.if ${MK_PF} != "no" + cd ${.CURDIR}/../sys/netpfil/pf; \ + for h in *.h; do \ + ln -fs ../../../../sys/netpfil/pf/$$h \ + ${DESTDIR}${INCLUDEDIR}/netpfil/pf; \ + done +.endif cd ${.CURDIR}/../sys/crypto; \ for h in rijndael/rijndael.h; do \ ln -fs ../../../sys/crypto/$$h \ Modified: head/sys/contrib/altq/altq/altq_cbq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cbq.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/contrib/altq/altq/altq_cbq.c Sun Oct 27 16:25:57 2013 (r257215) @@ -57,9 +57,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/contrib/altq/altq/altq_hfsc.c Sun Oct 27 16:25:57 2013 (r257215) @@ -69,9 +69,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/contrib/altq/altq/altq_priq.c Sun Oct 27 16:25:57 2013 (r257215) @@ -54,9 +54,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #ifdef ALTQ3_COMPAT #include Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/contrib/altq/altq/altq_red.c Sun Oct 27 16:25:57 2013 (r257215) @@ -95,9 +95,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #include #include #ifdef ALTQ3_COMPAT Modified: head/sys/contrib/altq/altq/altq_rio.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/contrib/altq/altq/altq_rio.c Sun Oct 27 16:25:57 2013 (r257215) @@ -90,8 +90,8 @@ #include #endif -#include -#include +#include +#include #include #include #include Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/contrib/altq/altq/altq_subr.c Sun Oct 27 16:25:57 2013 (r257215) @@ -65,8 +65,8 @@ #include #include -#include -#include +#include +#include #include #ifdef ALTQ3_COMPAT #include Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/net/if_ethersubr.c Sun Oct 27 16:25:57 2013 (r257215) @@ -63,10 +63,11 @@ #include #include #include -#include #include #include +#include + #if defined(INET) || defined(INET6) #include #include Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/net/pfvar.h Sun Oct 27 16:25:57 2013 (r257215) @@ -41,9 +41,9 @@ #include #include -#include -#include -#include +#include +#include +#include struct pf_addr { union { Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/netpfil/ipfw/ip_fw2.c Sun Oct 27 16:25:57 2013 (r257215) @@ -61,10 +61,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include + #include #include #include Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/netpfil/pf/pf.c Sun Oct 27 16:25:57 2013 (r257215) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Copied: head/sys/netpfil/pf/pf.h (from r257214, head/sys/net/pf.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netpfil/pf/pf.h Sun Oct 27 16:25:57 2013 (r257215, copy of r257214, head/sys/net/pf.h) @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2001 Daniel Hartmeier + * 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. + * + * 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 HOLDERS 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. + * + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ + * $FreeBSD$ + */ + +#ifndef _NET_PF_H_ +#define _NET_PFAR_H_ + +#define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0) +#define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1) + +#define PF_MD5_DIGEST_LENGTH 16 +#ifdef MD5_DIGEST_LENGTH +#if PF_MD5_DIGEST_LENGTH != MD5_DIGEST_LENGTH +#error +#endif +#endif + +enum { PF_INOUT, PF_IN, PF_OUT }; +enum { PF_PASS, PF_DROP, PF_SCRUB, PF_NOSCRUB, PF_NAT, PF_NONAT, + PF_BINAT, PF_NOBINAT, PF_RDR, PF_NORDR, PF_SYNPROXY_DROP, PF_DEFER }; +enum { PF_RULESET_SCRUB, PF_RULESET_FILTER, PF_RULESET_NAT, + PF_RULESET_BINAT, PF_RULESET_RDR, PF_RULESET_MAX }; +enum { PF_OP_NONE, PF_OP_IRG, PF_OP_EQ, PF_OP_NE, PF_OP_LT, + PF_OP_LE, PF_OP_GT, PF_OP_GE, PF_OP_XRG, PF_OP_RRG }; +enum { PF_DEBUG_NONE, PF_DEBUG_URGENT, PF_DEBUG_MISC, PF_DEBUG_NOISY }; +enum { PF_CHANGE_NONE, PF_CHANGE_ADD_HEAD, PF_CHANGE_ADD_TAIL, + PF_CHANGE_ADD_BEFORE, PF_CHANGE_ADD_AFTER, + PF_CHANGE_REMOVE, PF_CHANGE_GET_TICKET }; +enum { PF_GET_NONE, PF_GET_CLR_CNTR }; +enum { PF_SK_WIRE, PF_SK_STACK, PF_SK_BOTH }; + +/* + * Note about PFTM_*: real indices into pf_rule.timeout[] come before + * PFTM_MAX, special cases afterwards. See pf_state_expires(). + */ +enum { PFTM_TCP_FIRST_PACKET, PFTM_TCP_OPENING, PFTM_TCP_ESTABLISHED, + PFTM_TCP_CLOSING, PFTM_TCP_FIN_WAIT, PFTM_TCP_CLOSED, + PFTM_UDP_FIRST_PACKET, PFTM_UDP_SINGLE, PFTM_UDP_MULTIPLE, + PFTM_ICMP_FIRST_PACKET, PFTM_ICMP_ERROR_REPLY, + PFTM_OTHER_FIRST_PACKET, PFTM_OTHER_SINGLE, + PFTM_OTHER_MULTIPLE, PFTM_FRAG, PFTM_INTERVAL, + PFTM_ADAPTIVE_START, PFTM_ADAPTIVE_END, PFTM_SRC_NODE, + PFTM_TS_DIFF, PFTM_MAX, PFTM_PURGE, PFTM_UNLINKED, + PFTM_UNTIL_PACKET }; + +/* PFTM default values */ +#define PFTM_TCP_FIRST_PACKET_VAL 120 /* First TCP packet */ +#define PFTM_TCP_OPENING_VAL 30 /* No response yet */ +#define PFTM_TCP_ESTABLISHED_VAL 24*60*60/* Established */ +#define PFTM_TCP_CLOSING_VAL 15 * 60 /* Half closed */ +#define PFTM_TCP_FIN_WAIT_VAL 45 /* Got both FINs */ +#define PFTM_TCP_CLOSED_VAL 90 /* Got a RST */ +#define PFTM_UDP_FIRST_PACKET_VAL 60 /* First UDP packet */ +#define PFTM_UDP_SINGLE_VAL 30 /* Unidirectional */ +#define PFTM_UDP_MULTIPLE_VAL 60 /* Bidirectional */ +#define PFTM_ICMP_FIRST_PACKET_VAL 20 /* First ICMP packet */ +#define PFTM_ICMP_ERROR_REPLY_VAL 10 /* Got error response */ +#define PFTM_OTHER_FIRST_PACKET_VAL 60 /* First packet */ +#define PFTM_OTHER_SINGLE_VAL 30 /* Unidirectional */ +#define PFTM_OTHER_MULTIPLE_VAL 60 /* Bidirectional */ +#define PFTM_FRAG_VAL 30 /* Fragment expire */ +#define PFTM_INTERVAL_VAL 10 /* Expire interval */ +#define PFTM_SRC_NODE_VAL 0 /* Source tracking */ +#define PFTM_TS_DIFF_VAL 30 /* Allowed TS diff */ + +enum { PF_NOPFROUTE, PF_FASTROUTE, PF_ROUTETO, PF_DUPTO, PF_REPLYTO }; +enum { PF_LIMIT_STATES, PF_LIMIT_SRC_NODES, PF_LIMIT_FRAGS, + PF_LIMIT_TABLE_ENTRIES, PF_LIMIT_MAX }; +#define PF_POOL_IDMASK 0x0f +enum { PF_POOL_NONE, PF_POOL_BITMASK, PF_POOL_RANDOM, + PF_POOL_SRCHASH, PF_POOL_ROUNDROBIN }; +enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, + PF_ADDR_TABLE, PF_ADDR_URPFFAILED, + PF_ADDR_RANGE }; +#define PF_POOL_TYPEMASK 0x0f +#define PF_POOL_STICKYADDR 0x20 +#define PF_WSCALE_FLAG 0x80 +#define PF_WSCALE_MASK 0x0f + +#define PF_LOG 0x01 +#define PF_LOG_ALL 0x02 +#define PF_LOG_SOCKET_LOOKUP 0x04 + +/* Reasons code for passing/dropping a packet */ +#define PFRES_MATCH 0 /* Explicit match of a rule */ +#define PFRES_BADOFF 1 /* Bad offset for pull_hdr */ +#define PFRES_FRAG 2 /* Dropping following fragment */ +#define PFRES_SHORT 3 /* Dropping short packet */ +#define PFRES_NORM 4 /* Dropping by normalizer */ +#define PFRES_MEMORY 5 /* Dropped due to lacking mem */ +#define PFRES_TS 6 /* Bad TCP Timestamp (RFC1323) */ +#define PFRES_CONGEST 7 /* Congestion (of ipintrq) */ +#define PFRES_IPOPTIONS 8 /* IP option */ +#define PFRES_PROTCKSUM 9 /* Protocol checksum invalid */ +#define PFRES_BADSTATE 10 /* State mismatch */ +#define PFRES_STATEINS 11 /* State insertion failure */ +#define PFRES_MAXSTATES 12 /* State limit */ +#define PFRES_SRCLIMIT 13 /* Source node/conn limit */ +#define PFRES_SYNPROXY 14 /* SYN proxy */ +#define PFRES_MAX 15 /* total+1 */ + +#define PFRES_NAMES { \ + "match", \ + "bad-offset", \ + "fragment", \ + "short", \ + "normalize", \ + "memory", \ + "bad-timestamp", \ + "congestion", \ + "ip-option", \ + "proto-cksum", \ + "state-mismatch", \ + "state-insert", \ + "state-limit", \ + "src-limit", \ + "synproxy", \ + NULL \ +} + +#define PF_TABLE_NAME_SIZE 32 +#define PF_QNAME_SIZE 64 + +#endif /* _NET_PF_H_ */ Copied: head/sys/netpfil/pf/pf_altq.h (from r257189, head/sys/net/pf_altq.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netpfil/pf/pf_altq.h Sun Oct 27 16:25:57 2013 (r257215, copy of r257189, head/sys/net/pf_altq.h) @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2001 Daniel Hartmeier + * 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. + * + * 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 HOLDERS 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. + * + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ + * $FreeBSD$ + */ + +#ifndef _NET_PF_ALTQ_H_ +#define _NET_PF_ALTQ_H_ + +struct cbq_opts { + u_int minburst; + u_int maxburst; + u_int pktsize; + u_int maxpktsize; + u_int ns_per_byte; + u_int maxidle; + int minidle; + u_int offtime; + int flags; +}; + +struct priq_opts { + int flags; +}; + +struct hfsc_opts { + /* real-time service curve */ + u_int rtsc_m1; /* slope of the 1st segment in bps */ + u_int rtsc_d; /* the x-projection of m1 in msec */ + u_int rtsc_m2; /* slope of the 2nd segment in bps */ + /* link-sharing service curve */ + u_int lssc_m1; + u_int lssc_d; + u_int lssc_m2; + /* upper-limit service curve */ + u_int ulsc_m1; + u_int ulsc_d; + u_int ulsc_m2; + int flags; +}; + +struct pf_altq { + char ifname[IFNAMSIZ]; + + void *altq_disc; /* discipline-specific state */ + TAILQ_ENTRY(pf_altq) entries; + + /* scheduler spec */ + uint8_t scheduler; /* scheduler type */ + uint16_t tbrsize; /* tokenbucket regulator size */ + uint32_t ifbandwidth; /* interface bandwidth */ + + /* queue spec */ + char qname[PF_QNAME_SIZE]; /* queue name */ + char parent[PF_QNAME_SIZE]; /* parent name */ + uint32_t parent_qid; /* parent queue id */ + uint32_t bandwidth; /* queue bandwidth */ + uint8_t priority; /* priority */ + uint8_t local_flags; /* dynamic interface */ +#define PFALTQ_FLAG_IF_REMOVED 0x01 + + uint16_t qlimit; /* queue size limit */ + uint16_t flags; /* misc flags */ + union { + struct cbq_opts cbq_opts; + struct priq_opts priq_opts; + struct hfsc_opts hfsc_opts; + } pq_u; + + uint32_t qid; /* return value */ +}; + +#endif /* _NET_PF_ALTQ_H_ */ Modified: head/sys/netpfil/pf/pf_lb.c ============================================================================== --- head/sys/netpfil/pf/pf_lb.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/netpfil/pf/pf_lb.c Sun Oct 27 16:25:57 2013 (r257215) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x Copied: head/sys/netpfil/pf/pf_mtag.h (from r257189, head/sys/net/pf_mtag.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netpfil/pf/pf_mtag.h Sun Oct 27 16:25:57 2013 (r257215, copy of r257189, head/sys/net/pf_mtag.h) @@ -0,0 +1,62 @@ +/* $FreeBSD$ */ +/* + * Copyright (c) 2001 Daniel Hartmeier + * 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. + * + * 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 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef _NET_PF_MTAG_H_ +#define _NET_PF_MTAG_H_ + +#ifdef _KERNEL + +#define PF_TAG_GENERATED 0x01 +#define PF_TAG_FRAGCACHE 0x02 +#define PF_TAG_TRANSLATE_LOCALHOST 0x04 +#define PF_PACKET_LOOPED 0x08 +#define PF_FASTFWD_OURS_PRESENT 0x10 + +struct pf_mtag { + void *hdr; /* saved hdr pos in mbuf, for ECN */ + u_int32_t qid; /* queue id */ + u_int16_t tag; /* tag id */ + u_int8_t flags; + u_int8_t routed; +}; + +static __inline struct pf_mtag * +pf_find_mtag(struct mbuf *m) +{ + struct m_tag *mtag; + + if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) + return (NULL); + + return ((struct pf_mtag *)(mtag + 1)); +} +#endif /* _KERNEL */ +#endif /* _NET_PF_MTAG_H_ */ Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Sun Oct 27 16:20:52 2013 (r257214) +++ head/sys/netpfil/pf/pf_norm.c Sun Oct 27 16:25:57 2013 (r257215) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:29:14 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0764DBA5; Sun, 27 Oct 2013 16:29:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id A5B752F8D; Sun, 27 Oct 2013 16:29:13 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id C694BD42279; Mon, 28 Oct 2013 03:07:47 +1100 (EST) Date: Mon, 28 Oct 2013 03:07:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i8032... In-Reply-To: <201310270051.r9R0pl3j024025@svn.freebsd.org> Message-ID: <20131028015840.V929@besplex.bde.org> References: <201310270051.r9R0pl3j024025@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=0gCR9s_oylQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=XT1p1CXzdcAA:10 a=_QVvMFUpw_FK3yl96rUA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:29:14 -0000 On Sun, 27 Oct 2013, Ian Lepore wrote: > Log: > Remove all #include from arm code. It's already > included by vm/pmap.h, which is a prerequisite for arm/machine/pmap.h > so there's no reason to ever include it directly. > > Thanks to alc@ for pointing this out. I noticed this style bug in the recent commit, but didn't complain before. Including machine/pmap.h directly is unwarranted chumminess with the implementation. When vm/pmap.h is also included, it less than that. The chumminess is merely unwarranted in just a few cases. vm/map.h is not includable in some asm files. machine/pmap.h is includable in asm files, but shouldn't be on some arches. genassym should be used. The hack of including machine/pmap.h is currently used in 5 asm files (essentially the same 2: 2 on i386 cloned to amd64 and 1 of these cloned to xen/i386). All file counts are for /sys. In 2004, there were: - 2 .c files that include only machine/pmap.h (chummy) - 20 .c files that include vm/pmap.h and machine/pmap.h (less than that) - 231 .c files that include vm/pmap.h only (correct) The style bugs have expanded exponentially since then of course :-(. In -current before this comment, there are: - 9 .c files that include only machine/pmap.h (chummy) - 80 .c files that include vm/pmap.h and machine/pmap.h (less than that) - 421 .c files that include vm/pmap.h only (correct) The files with mere unwarranted chumminess are 2 in sparc64 (in 2004 and now), 6 in mips (now) and 1 in powerpc (now). MD files can reasonably use only the level, but there is no reason to avoid the vm level for just pmap. The 9 files that avoid vm for pmap use vm includes for most other things. These file counts by grep don't show the complexities from nested pollution. machine/pmap.h is now included nested in 7 headers. This is pollution except in vm/vmap.h. vm/pmap.h is now included in 32 headers. This is gross pollution in vm/vm_page.h. It is perhaps needed in sys/user.h, where it is marked as a mistake by XXX. The others are mostly for drivers doing bad things like using vtophys(). Similarly for many other nested includes, except it is usually not so clear that the machine includes should only be included directly in 1 place. > Modified: head/sys/arm/allwinner/a10_machdep.c > ============================================================================== > --- head/sys/arm/allwinner/a10_machdep.c Sat Oct 26 23:41:11 2013 (r257198) > +++ head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 00:51:46 2013 (r257199) > @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); > #include > #include /* For trapframe_t, used in */ > #include > -#include > > #include Some other style bugs are visible in the patch. Saying what an include is for is a bogus "come from" comment. Such comments are usually rotten, and the above is no exception. trapframe_t is a style bug (an "opaque" type that must be visible to use it) that still exists (only arm has it, at least now). But arm/machine/machdep.h doesn't use it now. I don't know if machine/machdep.h needed to use it. But the optimization of passing full trap frames without copying them has been lost because it depended on undefined behaviour in C. Everything now passes pointers to trap frames instead. arm/machine/machdep.h spells the pointers correctly as "struct trapframe *" after forward-declaring an incomplete "struct trapframe", so it doesn't actually use trapframe_t. Perhaps the include is now included for some unclaimed reason. arm spells "struct trapframe" correctly in 45 places. It uses trapframe_t in 29 places. 6 of these are for the same false "come from" comment. machine/frame.h is still included nested in too many headers. arm is not worse than i386 here. > Modified: head/sys/arm/arm/minidump_machdep.c > ============================================================================== > --- head/sys/arm/arm/minidump_machdep.c Sat Oct 26 23:41:11 2013 (r257198) > +++ head/sys/arm/arm/minidump_machdep.c Sun Oct 27 00:51:46 2013 (r257199) > @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); > #endif > #include > #include > -#include > #include > #include > #include Missing blank line before the includes. There order is improved. > Modified: head/sys/arm/arm/nexus.c > ============================================================================== > --- head/sys/arm/arm/nexus.c Sat Oct 26 23:41:11 2013 (r257198) > +++ head/sys/arm/arm/nexus.c Sun Oct 27 00:51:46 2013 (r257199) > @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > > #include > #include This also fixes the misplaced blank line. The order of the 2 includes visible is still backwards. > --- head/sys/arm/freescale/imx/imx_machdep.c Sat Oct 26 23:41:11 2013 (r257198) > +++ head/sys/arm/freescale/imx/imx_machdep.c Sun Oct 27 00:51:46 2013 (r257199) > @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); > #include > #include /* For trapframe_t, used in */ > #include > -#include > > #include > #include The above count of 6 of these false "come from" comments is for a ~Sep 10 version of -current. There are now 10 of them visible in this patch alone. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:31:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 88AFECEB; Sun, 27 Oct 2013 16:31:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0632FBD; Sun, 27 Oct 2013 16:31:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RGVDeA040743; Sun, 27 Oct 2013 16:31:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RGVDen040742; Sun, 27 Oct 2013 16:31:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310271631.r9RGVDen040742@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Oct 2013 16:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257216 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:31:13 -0000 Author: kib Date: Sun Oct 27 16:31:12 2013 New Revision: 257216 URL: http://svnweb.freebsd.org/changeset/base/257216 Log: Several small fixes for the amd64 minidump code. In report_progress(), use nitems(progress_track) instead of manually hard-coding array size. Wrap long line. In blk_write(), code verifies that ptr and pa cannot be non-zero simultaneously. The later check for the page-alignment of the ptr argument never triggers due to pa != 0 always implying ptr == NULL. I believe that the intent was to ensure that physicall address passed is page-aligned, since the address is (temporary) mapped for the duration of the page write. Clear the progress_track.visited fields when starting minidump. If minidump is restarted or taken second time during the system lifetime, progress is not printed otherwise, making operator suspectible to the dump status. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Sun Oct 27 16:25:57 2013 (r257215) +++ head/sys/amd64/amd64/minidump_machdep.c Sun Oct 27 16:31:12 2013 (r257216) @@ -127,8 +127,9 @@ report_progress(size_t progress, size_t int sofar, i; sofar = 100 - ((progress * 100) / dumpsize); - for (i = 0; i < 10; i++) { - if (sofar < progress_track[i].min_per || sofar > progress_track[i].max_per) + for (i = 0; i < nitems(progress_track); i++) { + if (sofar < progress_track[i].min_per || + sofar > progress_track[i].max_per) continue; if (progress_track[i].visited) return; @@ -157,8 +158,8 @@ blk_write(struct dumperinfo *di, char *p printf("cant have both va and pa!\n"); return (EINVAL); } - if (pa != 0 && (((uintptr_t)ptr) % PAGE_SIZE) != 0) { - printf("address not page aligned\n"); + if ((((uintptr_t)pa) % PAGE_SIZE) != 0) { + printf("address not page aligned %p\n", ptr); return (EINVAL); } if (ptr != NULL) { @@ -230,6 +231,8 @@ minidumpsys(struct dumperinfo *di) retry: retry_count++; counter = 0; + for (i = 0; i < nitems(progress_track); i++) + progress_track[i].visited = 0; /* Walk page table pages, set bits in vm_page_dump */ pmapsize = 0; for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR, From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 16:46:28 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 410A1161; Sun, 27 Oct 2013 16:46:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 135C6205F; Sun, 27 Oct 2013 16:46:27 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VaTTp-000A7Z-3y; Sun, 27 Oct 2013 16:46:21 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9RGkIcn048995; Sun, 27 Oct 2013 10:46:18 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19SXmZD2b+cvpr2xg7Rymm8 Subject: Re: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i8032... From: Ian Lepore To: Bruce Evans In-Reply-To: <20131028015840.V929@besplex.bde.org> References: <201310270051.r9R0pl3j024025@svn.freebsd.org> <20131028015840.V929@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 27 Oct 2013 10:46:18 -0600 Message-ID: <1382892378.1170.170.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 16:46:28 -0000 On Mon, 2013-10-28 at 03:07 +1100, Bruce Evans wrote: > > > Modified: head/sys/arm/allwinner/a10_machdep.c > > ============================================================================== > > --- head/sys/arm/allwinner/a10_machdep.c Sat Oct 26 23:41:11 2013 (r257198) > > +++ head/sys/arm/allwinner/a10_machdep.c Sun Oct 27 00:51:46 2013 (r257199) > > @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); > > #include > > #include /* For trapframe_t, used in */ > > #include > > -#include > > > > #include > > Some other style bugs are visible in the patch. > > Saying what an include is for is a bogus "come from" comment. Such comments > are usually rotten, and the above is no exception. trapframe_t is a > style bug (an "opaque" type that must be visible to use it) that still > exists (only arm has it, at least now). But arm/machine/machdep.h doesn't > use it now. I don't know if machine/machdep.h needed to use it. But the > optimization of passing full trap frames without copying them has been lost > because it depended on undefined behaviour in C. Everything now passes > pointers to trap frames instead. arm/machine/machdep.h spells the pointers > correctly as "struct trapframe *" after forward-declaring an incomplete > "struct trapframe", so it doesn't actually use trapframe_t. Perhaps the > include is now included for some unclaimed reason. > > The "come from" comment bogosity was mine, although the trapframe_t unhappiness came first. I had at one time started flagged them as a baby step towards cleaning them all up, then did nothing for months. You may have noticed that I finally finished the job of eliminating frame.h from most of the places that didn't actually need it in r257200. While doing that, I noticed a whole lot of other includes in arm source code that just aren't needed (things like cpu.h and intr.h in virtually every file). So much of our arm code gets created by wholesale pasting some other code and then hacking. That's not completely invalid, I do it myself sometimes, but I generally start by commenting out most of the includes, then uncomment until it compiles. I didn't realize only arm had a trapframe_t. Now I'm inclined to just seek and destroy the remnants of it. -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 17:09:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1D21D5E5; Sun, 27 Oct 2013 17:09:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA27211E; Sun, 27 Oct 2013 17:09:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RH9O0p051767; Sun, 27 Oct 2013 17:09:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RH9Ow8051758; Sun, 27 Oct 2013 17:09:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310271709.r9RH9Ow8051758@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Oct 2013 17:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257217 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 17:09:25 -0000 Author: ian Date: Sun Oct 27 17:09:23 2013 New Revision: 257217 URL: http://svnweb.freebsd.org/changeset/base/257217 Log: Remove the last dregs of trapframe_t. It turns out only arm was using this type, so remove it to make arm code more consistant with other platforms. Thanks to bde@ for pointing out only arm used trapframe_t. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/trap.c head/sys/arm/arm/undefined.c head/sys/arm/arm/vm_machdep.c head/sys/arm/include/frame.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun Oct 27 16:31:12 2013 (r257216) +++ head/sys/arm/arm/cpufunc.c Sun Oct 27 17:09:23 2013 (r257217) @@ -1721,7 +1721,7 @@ int early_abort_fixup(arg) void *arg; { - trapframe_t *frame = arg; + struct trapframe *frame = arg; u_int fault_pc; u_int fault_instruction; int saved_lr = 0; @@ -1862,7 +1862,7 @@ int late_abort_fixup(arg) void *arg; { - trapframe_t *frame = arg; + struct trapframe *frame = arg; u_int fault_pc; u_int fault_instruction; int saved_lr = 0; Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Sun Oct 27 16:31:12 2013 (r257216) +++ head/sys/arm/arm/trap.c Sun Oct 27 17:09:23 2013 (r257217) @@ -123,8 +123,8 @@ __FBSDID("$FreeBSD$"); #endif -void swi_handler(trapframe_t *); -void undefinedinstruction(trapframe_t *); +void swi_handler(struct trapframe *); +void undefinedinstruction(struct trapframe *); #include #include @@ -145,13 +145,17 @@ struct ksig { u_long code; }; struct data_abort { - int (*func)(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); + int (*func)(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); const char *desc; }; -static int dab_fatal(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); -static int dab_align(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); -static int dab_buserr(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); +static int dab_fatal(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); +static int dab_align(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); +static int dab_buserr(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); static const struct data_abort data_aborts[] = { {dab_fatal, "Vector Exception"}, @@ -196,7 +200,8 @@ call_trapsignal(struct thread *td, int s } static __inline int -data_abort_fixup(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +data_abort_fixup(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { #ifdef CPU_ABORT_FIXUP_REQUIRED int error; @@ -226,7 +231,7 @@ data_abort_fixup(trapframe_t *tf, u_int } void -data_abort_handler(trapframe_t *tf) +data_abort_handler(struct trapframe *tf) { struct vm_map *map; struct pcb *pcb; @@ -482,7 +487,8 @@ out: * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort. */ static int -dab_fatal(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { const char *mode; @@ -538,7 +544,8 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_ * deliver a bus error to the process. */ static int -dab_align(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_align(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { /* Alignment faults are always fatal if they occur in kernel mode */ @@ -586,7 +593,8 @@ dab_align(trapframe_t *tf, u_int fsr, u_ * In all other cases, these data aborts are considered fatal. */ static int -dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_buserr(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { struct pcb *pcb = td->td_pcb; @@ -607,7 +615,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u * If the current trapframe is at the top of the kernel stack, * the fault _must_ have come from user mode. */ - if (tf != ((trapframe_t *)pcb->un_32.pcb32_sp) - 1) { + if (tf != ((struct trapframe *)pcb->un_32.pcb32_sp) - 1) { /* * Kernel mode. We're either about to die a * spectacular death, or pcb_onfault will come @@ -660,7 +668,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u } static __inline int -prefetch_abort_fixup(trapframe_t *tf, struct ksig *ksig) +prefetch_abort_fixup(struct trapframe *tf, struct ksig *ksig) { #ifdef CPU_ABORT_FIXUP_REQUIRED int error; @@ -691,7 +699,7 @@ prefetch_abort_fixup(trapframe_t *tf, st } /* - * void prefetch_abort_handler(trapframe_t *tf) + * void prefetch_abort_handler(struct trapframe *tf) * * Abort handler called when instruction execution occurs at * a non existent or restricted (access permissions) memory page. @@ -702,7 +710,7 @@ prefetch_abort_fixup(trapframe_t *tf, st * Otherwise fault the page in and try again. */ void -prefetch_abort_handler(trapframe_t *tf) +prefetch_abort_handler(struct trapframe *tf) { struct thread *td; struct proc * p; @@ -907,7 +915,7 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" static void -syscall(struct thread *td, trapframe_t *frame) +syscall(struct thread *td, struct trapframe *frame) { struct syscall_args sa; int error; @@ -932,7 +940,7 @@ syscall(struct thread *td, trapframe_t * } void -swi_handler(trapframe_t *frame) +swi_handler(struct trapframe *frame) { struct thread *td = curthread; Modified: head/sys/arm/arm/undefined.c ============================================================================== --- head/sys/arm/arm/undefined.c Sun Oct 27 16:31:12 2013 (r257216) +++ head/sys/arm/arm/undefined.c Sun Oct 27 17:09:23 2013 (r257217) @@ -166,7 +166,7 @@ undefined_init() void -undefinedinstruction(trapframe_t *frame) +undefinedinstruction(struct trapframe *frame) { struct thread *td; u_int fault_pc; Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Oct 27 16:31:12 2013 (r257216) +++ head/sys/arm/arm/vm_machdep.c Sun Oct 27 17:09:23 2013 (r257217) @@ -295,7 +295,7 @@ done: void cpu_set_syscall_retval(struct thread *td, int error) { - trapframe_t *frame; + struct trapframe *frame; int fixup; #ifdef __ARMEB__ uint32_t insn; Modified: head/sys/arm/include/frame.h ============================================================================== --- head/sys/arm/include/frame.h Sun Oct 27 16:31:12 2013 (r257216) +++ head/sys/arm/include/frame.h Sun Oct 27 17:09:23 2013 (r257217) @@ -59,7 +59,7 @@ * Trap frame. Pushed onto the kernel stack on a trap (synchronous exception). */ -typedef struct trapframe { +struct trapframe { register_t tf_spsr; /* Zero on arm26 */ register_t tf_r0; register_t tf_r1; @@ -80,7 +80,7 @@ typedef struct trapframe { register_t tf_svc_lr; /* Not used on arm26 */ register_t tf_pc; register_t tf_pad; -} trapframe_t; +}; /* Register numbers */ #define tf_r13 tf_usr_sp From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 17:12:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 37A8874E; Sun, 27 Oct 2013 17:12:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2529F215D; Sun, 27 Oct 2013 17:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RHCWht054384; Sun, 27 Oct 2013 17:12:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RHCW0r054383; Sun, 27 Oct 2013 17:12:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310271712.r9RHCW0r054383@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 27 Oct 2013 17:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257218 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 17:12:32 -0000 Author: glebius Date: Sun Oct 27 17:12:31 2013 New Revision: 257218 URL: http://svnweb.freebsd.org/changeset/base/257218 Log: Include lock.h before mutex.h. Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Oct 27 17:09:23 2013 (r257217) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Oct 27 17:12:31 2013 (r257218) @@ -146,6 +146,7 @@ struct ether_addr { # endif /* _KERNEL */ # include +# include # include # define KRWLOCK_FILL_SZ 56 # define KMUTEX_FILL_SZ 56 From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 17:14:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AC93D9B9; Sun, 27 Oct 2013 17:14:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD6A217B; Sun, 27 Oct 2013 17:14:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RHEXRF054714; Sun, 27 Oct 2013 17:14:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RHEXlB054713; Sun, 27 Oct 2013 17:14:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310271714.r9RHEXlB054713@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 27 Oct 2013 17:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257219 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 17:14:33 -0000 Author: glebius Date: Sun Oct 27 17:14:33 2013 New Revision: 257219 URL: http://svnweb.freebsd.org/changeset/base/257219 Log: Almost all if_clone consumers do not care about if_clone_event. Do not force them to include sys/eventhandler.h. Those who utilize EVENTHANDLER(9), will see the declaration. Modified: head/sys/net/if_clone.h Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Sun Oct 27 17:12:31 2013 (r257218) +++ head/sys/net/if_clone.h Sun Oct 27 17:14:33 2013 (r257219) @@ -58,9 +58,11 @@ int ifc_name2unit(const char *name, int int ifc_alloc_unit(struct if_clone *, int *); void ifc_free_unit(struct if_clone *, int); +#ifdef SYS_EVENTHANDLER_H /* Interface clone event. */ typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); +#endif /* The below interfaces used only by net/if.c. */ void if_clone_init(void); From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 17:27:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18DE7DC8; Sun, 27 Oct 2013 17:27:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0590B2212; Sun, 27 Oct 2013 17:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RHR6UP058302; Sun, 27 Oct 2013 17:27:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RHR6Zw058301; Sun, 27 Oct 2013 17:27:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310271727.r9RHR6Zw058301@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 27 Oct 2013 17:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257220 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 17:27:07 -0000 Author: glebius Date: Sun Oct 27 17:27:06 2013 New Revision: 257220 URL: http://svnweb.freebsd.org/changeset/base/257220 Log: Provide forward declaration for struct ifnet. Consumers of this header don't need contents of struct. Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Sun Oct 27 17:14:33 2013 (r257219) +++ head/sys/net/if_media.h Sun Oct 27 17:27:06 2013 (r257220) @@ -54,6 +54,8 @@ #include +struct ifnet; + /* * Driver callbacks for media status and change requests. */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 17:29:38 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDAFCFAF; Sun, 27 Oct 2013 17:29:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4992232; Sun, 27 Oct 2013 17:29:37 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 44DBB1041C1A; Mon, 28 Oct 2013 04:01:30 +1100 (EST) Date: Mon, 28 Oct 2013 04:01:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r257200 - in head/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx include lpc mv rockchip samsung/exynos tegra ti ti/am335x ti/omap4 ti/twl versatile xili... In-Reply-To: <201310270134.r9R1YBbI037760@svn.freebsd.org> Message-ID: <20131028030951.V929@besplex.bde.org> References: <201310270134.r9R1YBbI037760@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=wN7JUwX51CgA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=HEFGpEVvdEcA:10 a=FAH0mBd8HFrLEcHYz4UA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 17:29:38 -0000 On Sun, 27 Oct 2013, Ian Lepore wrote: > Log: > Remove #include from all the arm code that doesn't > really need it. That would be almost everywhere it was included. Add > it in a couple files that really do need it and were previously getting > it by accident via another header. Oops, I complained too soon about style bugs attached to these includes in another reply. Removing the includes also removes most of the collateral style bugs. How do you find the files that _really_ do need it? Nested pollution makes this difficult. tools/kerninclude barely works. When I tried to reduce nested pollution, I used a predecessor of tools/kerninclude that was more usable because it was more localized, but it got other things wrong. > Modified: head/sys/arm/include/undefined.h > ============================================================================== > --- head/sys/arm/include/undefined.h Sun Oct 27 00:51:46 2013 (r257199) > +++ head/sys/arm/include/undefined.h Sun Oct 27 01:34:10 2013 (r257200) > @@ -52,7 +52,9 @@ > > #include > > -typedef int (*undef_handler_t) (unsigned int, unsigned int, trapframe_t *, int); > +struct trapframe; > + > +typedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe *, int); > > #define FP_COPROC 1 > #define FP_COPROC2 2 Other uses of the trapframe_t style bug reqiore more editing. This adds a style bug (extra blank line which separates the forward declaration from its one use). Old style bugs remaining in the main changed line include: - not using u_int (perhaps it should be foo_t) - gnu style parentheses - long line I don't like extensive use of typedefs to obfuscate function pointers, even without the style bug of declaring a typedef for the pointer and not a typedef for the function. We use typedefs for function pointers because the syntax for a function pointer is complicated, not primarily to hide the type. Here the pointer is used only a few times so repeating the declaration would be clearer. However, if the typedef were for the function then it could be used more. Now, most of the few uses are for a public function that seems to be never called: - install_coproc_handler() is declared in this header and its declaration uses the typedef - install_coproc_handler() is defined in arm/undefined.c and its definition uses the typedef - install_coproc_handler() seems to be never called. The installation function that is actually called is install_coproc_handler_static(). This was apparently originally a static internal for install_coproc_handler(). It is still named with 'static' and is still used internally but is now public and used externally. - a critical struct declaration in this header also uses the typedef. install_coproc_handler_static() takes a pointer to this struct as an arg so its callers don't need the typedef. Since the typedef is for a pointer and not a function, it cannot be used in forward declarations of handlers. Even if the typedef were for a function, C syntax wouldn't allow using it in definitions of handlers. So the typedef ends up being used once in used code and twice in unused code. Old style bugs visible in unchanged lines: - space instead of tab after #define. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 17:42:46 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2A98565; Sun, 27 Oct 2013 17:42:45 +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 B4AF822FC; Sun, 27 Oct 2013 17:42:45 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id D2DE9781274; Mon, 28 Oct 2013 04:42:41 +1100 (EST) Date: Mon, 28 Oct 2013 04:42:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r257203 - head/sys/arm/arm In-Reply-To: <201310270329.r9R3Tcoi076809@svn.freebsd.org> Message-ID: <20131028040222.G929@besplex.bde.org> References: <201310270329.r9R3Tcoi076809@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=zbkiI427TaUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=E11o_6pwCccA:10 a=y8rJQ-hqLJ560y21m9wA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 17:42:46 -0000 On Sun, 27 Oct 2013, Ian Lepore wrote: > Log: > Eliminate a compiler warning about extraneous parens. Wow, what flags give these warnings? Next I'll ask for -Wexcessive-braces, -Wbogus-cast and -Wno-sloppy-format. > Modified: head/sys/arm/arm/busdma_machdep.c > ============================================================================== > --- head/sys/arm/arm/busdma_machdep.c Sun Oct 27 03:24:46 2013 (r257202) > +++ head/sys/arm/arm/busdma_machdep.c Sun Oct 27 03:29:38 2013 (r257203) > @@ -807,7 +807,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma > bus_addr_t curaddr; > bus_size_t sgsize; > > - if ((map->pagesneeded == 0)) { > + if (map->pagesneeded == 0) { > CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", > dmat->lowaddr, dmat->boundary, dmat->alignment); > CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", Formats for CTR*s are extremely bogus and can't be handled by -Wformat or -Wno-sloppy-format. If it did, then -Wno-sloppy-format would complain about printing unsigned longs (bus_addr_t's) using %d format even if -Wformat wouldn't because unsigned longs have the same size as ints. CTR*() is actually not variadic, but converts all args to u_long, so %d and %p cannot work without further magic to convert back to the original type. I never been able to find this magic and suspect it doesn't exist. I think the format strings are not used in the kernel. They are used with gross type mismatches in ktrdump unless all the format specifiers in them are %lu or similar: ktrdump just does: fprintf(out, desc, parms[0], parms[1], parms[2], parms[3], parms[4], parms[5]); It parses the format string using a primitive parser but doesn't rewrite any of the types or args except to replace kernel pointers to strings by user pointers to copies of the strings. Integer and pointer args remain in parms[] as u_longs from the kernel conversion, and are then printed with the format specifiers in the CTR*() calls which almost never match the u_long. Most of the kernel conversions to u_long are automatic, but sometimes bogus casts (which might match neither the format specifier nor u_long) are used to defeat the type checking in automatic conversions. If the original types are 64 bits, then passing them as u_long's just doesn't work and some CTR*() calls use extremely ugly code with bogus casts in it to split the 64 into two. The undefined behaviour in ktrdump can be fixed fairly easily by rewriting all the integer format specifiers to %lu or %ld. %p needs to be left as itself since %p format is too different from %lu format. But without format checking, the formats will often be too broken to be displayed correctly. %d in the above is a bad format for addresses anyway. %jx is always wrong in MI code -- it works if u_long == uintmax_t, but on 32-bit arches with large values in the original type uintmax_t, it indicates that the programmer doesn't know that CTR*() will truncate to u_long. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 18:34:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 22752843; Sun, 27 Oct 2013 18:34:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id D610725C1; Sun, 27 Oct 2013 18:34:55 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VaVCn-0009yv-AU; Sun, 27 Oct 2013 22:36:53 +0400 Date: Sun, 27 Oct 2013 22:36:53 +0400 From: Slawa Olhovchenkov To: Scott Long Subject: Re: svn commit: r252010 - head/sys/geom/mirror Message-ID: <20131027183653.GA9023@zxy.spb.ru> References: <201306192152.r5JLqWfs058862@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306192152.r5JLqWfs058862@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 18:34:56 -0000 On Wed, Jun 19, 2013 at 09:52:32PM +0000, Scott Long wrote: > Author: scottl > Date: Wed Jun 19 21:52:32 2013 > New Revision: 252010 > URL: http://svnweb.freebsd.org/changeset/base/252010 > > Log: > Mark geom_mirror as capable of unmapped i/o Can you add capable of unmapped i/o to geom_stripe? From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 18:52:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A7A50DAE; Sun, 27 Oct 2013 18:52:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 954BB267D; Sun, 27 Oct 2013 18:52:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RIq9In088286; Sun, 27 Oct 2013 18:52:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RIq9wx088285; Sun, 27 Oct 2013 18:52:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310271852.r9RIq9wx088285@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Oct 2013 18:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257221 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 18:52:09 -0000 Author: kib Date: Sun Oct 27 18:52:09 2013 New Revision: 257221 URL: http://svnweb.freebsd.org/changeset/base/257221 Log: Fix typo. MFC after: 3 days Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Sun Oct 27 17:27:06 2013 (r257220) +++ head/sys/kern/subr_param.c Sun Oct 27 18:52:09 2013 (r257221) @@ -344,7 +344,7 @@ init_param2(long physpages) } /* - * Sysctl stringiying handler for kern.vm_guest. + * Sysctl stringifying handler for kern.vm_guest. */ static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 19:00:05 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BBEE2235; Sun, 27 Oct 2013 19:00:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9184726D0; Sun, 27 Oct 2013 19:00:05 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VaVZE-000AW7-88; Sun, 27 Oct 2013 19:00:04 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9RJ01BM049063; Sun, 27 Oct 2013 13:00:01 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+LJe1yEW18A+xCjswA3liE Subject: Re: svn commit: r257203 - head/sys/arm/arm From: Ian Lepore To: Bruce Evans In-Reply-To: <20131028040222.G929@besplex.bde.org> References: <201310270329.r9R3Tcoi076809@svn.freebsd.org> <20131028040222.G929@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 27 Oct 2013 13:00:01 -0600 Message-ID: <1382900401.1170.227.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 19:00:05 -0000 On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote: > On Sun, 27 Oct 2013, Ian Lepore wrote: > > > Log: > > Eliminate a compiler warning about extraneous parens. > > Wow, what flags give these warnings? --- busdma_machdep.o --- /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((map->pagesneeded == 0)) { ~~~~~~~~~~~~~~~~~^~~~ /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: remove extraneous parentheses around the comparison to silence this warning if ((map->pagesneeded == 0)) { ~ ^ ~ /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: use '=' to turn this equality comparison into an assignment if ((map->pagesneeded == 0)) { ^~ = That's what the compiler had to say about it. I guess in somebody's mind if it's a probable error to have done if (testandassign = something) and somehow it's less probably an error to have done if ((testandassign = something)) then surely the converse must also be true and double parens not syntactically necessary in either case must be indicative of error in one of the cases. The warning doesn't bother me as much as the two useless notes that follow it (which are annoying when combined with my editor's feature of parsing compiler output and jumping to the next error point in the code). I've notice clang is particularly chatty, with things like suggesting what you might have meant when you spell a variable name wrong. Before long it's going to be like RPG and COBOL where it's willing to assume what you meant and try to generate runnable code in the face of almost any error. I probably date myself with references to RPG and COBOL, but it does bring back fond memories of slapping a boilerplate header on every interoffice memo issued by management and running it through the cobol compiler, and grading them on whether their memos generated runnable code or so many errors the compiler gave up. -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 19:19:16 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 95066565; Sun, 27 Oct 2013 19:19:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68B2427A1; Sun, 27 Oct 2013 19:19:16 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VaVrh-000AQS-2d; Sun, 27 Oct 2013 19:19:09 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9RJJ6cn049074; Sun, 27 Oct 2013 13:19:06 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/q7q+4SfU1fL54ecXzGSWe Subject: Re: svn commit: r257200 - in head/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx include lpc mv rockchip samsung/exynos tegra ti ti/am335x ti/omap4 ti/twl versatile xili... From: Ian Lepore To: Bruce Evans In-Reply-To: <20131028030951.V929@besplex.bde.org> References: <201310270134.r9R1YBbI037760@svn.freebsd.org> <20131028030951.V929@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 27 Oct 2013 13:19:06 -0600 Message-ID: <1382901546.1170.236.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 19:19:16 -0000 On Mon, 2013-10-28 at 04:01 +1100, Bruce Evans wrote: > On Sun, 27 Oct 2013, Ian Lepore wrote: > > > Log: > > Remove #include from all the arm code that doesn't > > really need it. That would be almost everywhere it was included. Add > > it in a couple files that really do need it and were previously getting > > it by accident via another header. > > Oops, I complained too soon about style bugs attached to these includes > in another reply. Removing the includes also removes most of the > collateral style bugs. > > How do you find the files that _really_ do need it? Nested pollution > makes this difficult. tools/kerninclude barely works. When I tried > to reduce nested pollution, I used a predecessor of tools/kerninclude > that was more usable because it was more localized, but it got other > things wrong. Mostly by brute force and a fast machine for compiling. I removed it from pretty much everywhere it appeared except the few places I knew were legit (such as arm/trap.c), then added it back as needed to get a clean compile. At one point I realized that a place where it was included from within another header was really required[1] and I had to backtrack a bit, do that, then re-iterate forward. Luckily that didn't happen until most of the arm tree had compiled without frame.h being included from any other .h. I've had this brute force method break down completely with more complex situations, but it went pretty quickly with this one. [1] Really required given the way other code is structured now. There's a macro in cpu.h that expands to derefence trapframe, and that macro is used in kern/something.c. Maybe that macro could be a function, but I didn't want to sidetrack and review the performance implications of that change at the time. -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 19:42:11 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3D8FBC22; Sun, 27 Oct 2013 19:42:11 +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 DB5B028C7; Sun, 27 Oct 2013 19:42:10 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7D5FE1A1DB0; Mon, 28 Oct 2013 06:16:23 +1100 (EST) Date: Mon, 28 Oct 2013 06:16:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r257199 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/omap4/pandaboard versatile xilinx xscale/i8032... In-Reply-To: <1382892378.1170.170.camel@revolution.hippie.lan> Message-ID: <20131028044855.J1749@besplex.bde.org> References: <201310270051.r9R0pl3j024025@svn.freebsd.org> <20131028015840.V929@besplex.bde.org> <1382892378.1170.170.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=0gCR9s_oylQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=XT1p1CXzdcAA:10 a=yVqmWZZe6C5zgX1zquoA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 19:42:11 -0000 On Sun, 27 Oct 2013, Ian Lepore wrote: > While doing that, I noticed a whole lot of other includes in arm source > code that just aren't needed (things like cpu.h and intr.h in virtually > every file). So much of our arm code gets created by wholesale pasting > some other code and then hacking. That's not completely invalid, I do > it myself sometimes, but I generally start by commenting out most of the > includes, then uncomment until it compiles. Including cpu.h is an especially large style bug. It is for MD implementations of MI interfaces (mostly function-line ones; simple macros are mostly in *param.h). Thus it should be very small and rarely used, especially in MD code. Since the interfaces are MI, they can be extern and declared in MI headers unless they are macros or inlines. Since MD code can get at the details directly, it shouldn't use these MI interfaces much, and the only includes of cpu.h in MD code should be to help implement it. cpu.h was almost completely cleaned up on x86. It has regressed a bit with get_cyclecount() and xen. The complexity and divergence of the implementations of the relatively trivial and unimportant interface get_cyclecount() as an inline or macro shows why you shouldn't micro-optimize many MI interfaces with inline functions or macros. arm cpu.h is a bit smaller than i386 cpu.h so it should be included a bit less. It has the following easy-to-fix (?) obvious bugs: duplicated across all arches for at least some interfaces: - declarations of cpu_halt, swi_vm (?!) and fork_trampoline(). These are extern, and should always be extern. Since they are MI, they should be declared in an MI header. They are also unsorted here. - bad MI implementation of get_cyclecount(). (Not all implementations are bad or duplicated.) There should be a way to default to an MI interfaces for some things, and use a less bad one here and for other places that use bad ones. arm-specific: - declarations of arm_boot_params, arm_vector_init(), identify_arm_cpu(), initarm(). Obviously not MI interfaces, and also not used to implement MI interfaces, so they don't belong here. - badaddr_read(). Not obviously not an MI interface, but not in any other cpu.h, so cannot be called from MI code, so it doesn't belong here. arm cpu.h is missing a few interaces that i386 has, e.g., cpu_exec(). Therefore, these must be impossible to call from MI code, so they are misplaced on i386. Actually, cpu_exec() is never used. It is only defined on amd64 and i386. sparc64 has an XXX comment in exec_setregs() saying that it doesn't exist. Most interfaces named cpu_foo() are MI, and IIRC the declarations of many are misplaced in MD headers, but most have never been misplaced in cpu.h because they never were inlines or macros. The cpu_ prefix for functions should probably be reserved for MI interfaces, and it might be worth using a variation of it for ones that should be extern. It isn't used very much in i386/include/. Older interfaces like fork_trampoline() use even more inconsistent names. cpu_exec() should probably exist instead of exec_setregs() (unless multiple MD calls are needed for multiple stages of exec). exec_setregs() should have a cpu_ prefix. After removing the garbage, there are just 7 interfaces implemented in arm cpu.h (btext and etext could also use an MI default. This reduces to 5). can be about as simple as used to be before it was complicated by compiler builtins. It is possible to document this many interfaces! :-) However, it is hard to document all the symbols needed to implement these 5 interfaces. armreg.h is included for just PSR_MODE and PSR32_MODE and brings an undocumented number of other symbols. But armreg.h doesn't include enough pollution to actually work -- it uses frame pointers but doesn't include frame.h. It is unclear how the MI code that includes it manages to include frame.h. This is one case where nested includes are almost justified -- cpu.h is supposed to be self-sufficient so that MI code that uses it doesn't need to know about the MD headers that it depends on. i386 cpu.h includes psl.h, frame.h and also segments.h. segments.h seems to be unused pollution. TRAPF_USERMODE() is missing parenthesization of 'frame'. Further cleaning for i386 cpu.h: - cpu_swapin(): like cpu_exec() except sparc64 doesn't mention it. - cpu_ops: highly MD; shouldn't have a cpu_ prefix or be declared here. - cpu_reset(): like cpu_halt(); correct prefix, but should never be optimized to a macro or inline here. Unlike cpu_halt(), it is not used for normal shutdowns and is needed mainly by ddb. arm declares it in cpufunc.h. This is wrong for many reasons. It is only declared there and not implemented. cpufunc.h is for access to special CPU instructions, preferably only 1 instruction per function. I shouldn't have named it cpu*.h. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 20:39:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D0E51723; Sun, 27 Oct 2013 20:39:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC8BC2B02; Sun, 27 Oct 2013 20:39:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RKdBcH022521; Sun, 27 Oct 2013 20:39:11 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RKdAnk022511; Sun, 27 Oct 2013 20:39:10 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310272039.r9RKdAnk022511@svn.freebsd.org> From: Mark Johnston Date: Sun, 27 Oct 2013 20:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257222 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 20:39:11 -0000 Author: markj Date: Sun Oct 27 20:39:10 2013 New Revision: 257222 URL: http://svnweb.freebsd.org/changeset/base/257222 Log: Clean up the debug printing in libproc a bit. In particular: * Don't print any error messages to stderr unless DEBUG is defined. * Add a DPRINTFX macro for use when errno isn't set. * Print the error string from libelf when appropriate. Modified: head/lib/libproc/_libproc.h head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_create.c head/lib/libproc/proc_regs.c head/lib/libproc/proc_sym.c head/lib/libproc/proc_util.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Sun Oct 27 18:52:09 2013 (r257221) +++ head/lib/libproc/_libproc.h Sun Oct 27 20:39:10 2013 (r257222) @@ -49,7 +49,9 @@ struct proc_handle { }; #ifdef DEBUG -#define DPRINTF(...) warn(__VA_ARGS__) +#define DPRINTF(...) warn(__VA_ARGS__) +#define DPRINTFX(...) warnx(__VA_ARGS__) #else -#define DPRINTF(...) +#define DPRINTF(...) +#define DPRINTFX(...) #endif Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Sun Oct 27 18:52:09 2013 (r257221) +++ head/lib/libproc/proc_bkpt.c Sun Oct 27 20:39:10 2013 (r257222) @@ -78,8 +78,8 @@ proc_bkptset(struct proc_handle *phdl, u piod.piod_addr = &paddr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't read instruction at address 0x%" PRIuPTR, - address); + DPRINTF("ERROR: couldn't read instruction at address 0x%" + PRIuPTR, address); return (-1); } *saved = paddr; @@ -93,8 +93,8 @@ proc_bkptset(struct proc_handle *phdl, u piod.piod_addr = &paddr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - warn("ERROR: couldn't write instruction at address 0x%" PRIuPTR, - address); + DPRINTF("ERROR: couldn't write instruction at address 0x%" + PRIuPTR, address); return (-1); } @@ -113,7 +113,7 @@ proc_bkptdel(struct proc_handle *phdl, u errno = ENOENT; return (-1); } - DPRINTF("removing breakpoint at 0x%lx\n", address); + DPRINTFX("removing breakpoint at 0x%lx\n", address); /* * Overwrite the breakpoint instruction that we setup previously. */ @@ -124,8 +124,8 @@ proc_bkptdel(struct proc_handle *phdl, u piod.piod_addr = &paddr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { - DPRINTF("ERROR: couldn't write instruction at address 0x%" PRIuPTR, - address); + DPRINTF("ERROR: couldn't write instruction at address 0x%" + PRIuPTR, address); return (-1); } @@ -153,12 +153,12 @@ proc_bkptexec(struct proc_handle *phdl, int status; if (proc_regget(phdl, REG_PC, &pc) < 0) { - warn("ERROR: couldn't get PC register"); + DPRINTFX("ERROR: couldn't get PC register"); return (-1); } proc_bkptregadj(&pc); if (proc_bkptdel(phdl, pc, saved) < 0) { - warn("ERROR: couldn't delete breakpoint"); + DPRINTFX("ERROR: couldn't delete breakpoint"); return (-1); } /* @@ -167,13 +167,13 @@ proc_bkptexec(struct proc_handle *phdl, */ proc_regset(phdl, REG_PC, pc); if (ptrace(PT_STEP, proc_getpid(phdl), (caddr_t)1, 0) < 0) { - warn("ERROR: ptrace step failed"); + DPRINTFX("ERROR: ptrace step failed"); return (-1); } proc_wstatus(phdl); status = proc_getwstat(phdl); if (!WIFSTOPPED(status)) { - warn("ERROR: don't know why process stopped"); + DPRINTFX("ERROR: don't know why process stopped"); return (-1); } /* @@ -181,7 +181,7 @@ proc_bkptexec(struct proc_handle *phdl, * the same as the one that we were passed in. */ if (proc_bkptset(phdl, pc, &samesaved) < 0) { - warn("ERROR: couldn't restore breakpoint"); + DPRINTFX("ERROR: couldn't restore breakpoint"); return (-1); } assert(samesaved == saved); Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Sun Oct 27 18:52:09 2013 (r257221) +++ head/lib/libproc/proc_create.c Sun Oct 27 20:39:10 2013 (r257222) @@ -75,7 +75,7 @@ proc_attach(pid_t pid, int flags, struct /* Check for an unexpected status. */ if (WIFSTOPPED(status) == 0) - DPRINTF("ERROR: child process %d status 0x%x", pid, status); + DPRINTFX("ERROR: child process %d status 0x%x", pid, status); else phdl->status = PS_STOP; @@ -130,14 +130,14 @@ proc_create(const char *file, char * con /* Wait for the child process to stop. */ if (waitpid(pid, &status, WUNTRACED) == -1) { error = errno; - DPRINTF("ERROR: child process %d didn't stop as expected", pid); + DPRINTF("ERROR: child process %d didn't stop as expected", pid); goto bad; } /* Check for an unexpected status. */ if (WIFSTOPPED(status) == 0) { error = errno; - DPRINTF("ERROR: child process %d status 0x%x", pid, status); + DPRINTFX("ERROR: child process %d status 0x%x", pid, status); goto bad; } else phdl->status = PS_STOP; Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Sun Oct 27 18:52:09 2013 (r257221) +++ head/lib/libproc/proc_regs.c Sun Oct 27 20:39:10 2013 (r257222) @@ -76,7 +76,7 @@ proc_regget(struct proc_handle *phdl, pr #endif break; default: - warn("ERROR: no support for reg number %d", reg); + DPRINTFX("ERROR: no support for reg number %d", reg); return (-1); } @@ -119,7 +119,7 @@ proc_regset(struct proc_handle *phdl, pr #endif break; default: - warn("ERROR: no support for reg number %d", reg); + DPRINTFX("ERROR: no support for reg number %d", reg); return (-1); } if (ptrace(PT_SETREGS, proc_getpid(phdl), (caddr_t)®s, 0) < 0) Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Sun Oct 27 18:52:09 2013 (r257221) +++ head/lib/libproc/proc_sym.c Sun Oct 27 20:39:10 2013 (r257222) @@ -238,16 +238,16 @@ proc_addr2sym(struct proc_handle *p, uin if ((map = proc_addr2map(p, addr)) == NULL) return (-1); - if (!map->pr_mapname || (fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) { - warn("ERROR: open %s failed", map->pr_mapname); + if ((fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) { + DPRINTF("ERROR: open %s failed", map->pr_mapname); goto err0; } if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - warn("ERROR: elf_begin() failed"); + DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); goto err1; } if (gelf_getehdr(e, &ehdr) == NULL) { - warn("ERROR: gelf_getehdr() failed"); + DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); goto err2; } /* @@ -275,7 +275,7 @@ proc_addr2sym(struct proc_handle *p, uin * Then look up the string name in STRTAB (.dynstr) */ if ((data = elf_getdata(dynsymscn, NULL)) == NULL) { - DPRINTF("ERROR: elf_getdata() failed"); + DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); goto symtab; } i = 0; @@ -312,7 +312,7 @@ symtab: if (symtabscn == NULL) goto err2; if ((data = elf_getdata(symtabscn, NULL)) == NULL) { - DPRINTF("ERROR: elf_getdata() failed"); + DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); goto err2; } i = 0; @@ -420,7 +420,7 @@ proc_name2sym(struct proc_handle *p, con unsigned long symtabstridx = 0, dynsymstridx = 0; if ((map = proc_name2map(p, object)) == NULL) { - DPRINTF("ERROR: couldn't find object %s", object); + DPRINTFX("ERROR: couldn't find object %s", object); goto err0; } if ((fd = open(map->pr_mapname, O_RDONLY, 0)) < 0) { @@ -428,11 +428,11 @@ proc_name2sym(struct proc_handle *p, con goto err0; } if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - warn("ERROR: elf_begin() failed"); + DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); goto err1; } if (gelf_getehdr(e, &ehdr) == NULL) { - warn("ERROR: gelf_getehdr() failed"); + DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); goto err2; } /* @@ -460,7 +460,7 @@ proc_name2sym(struct proc_handle *p, con * Then look up the string name in STRTAB (.dynstr) */ if ((data = elf_getdata(dynsymscn, NULL))) { - DPRINTF("ERROR: elf_getdata() failed"); + DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); i = 0; while (gelf_getsym(data, i++, &sym) != NULL) { s = elf_strptr(e, dynsymstridx, sym.st_name); @@ -519,11 +519,11 @@ proc_iter_symbyaddr(struct proc_handle * if ((map = proc_name2map(p, object)) == NULL) return (-1); if ((fd = open(map->pr_mapname, O_RDONLY)) < 0) { - warn("ERROR: open %s failed", map->pr_mapname); + DPRINTF("ERROR: open %s failed", map->pr_mapname); goto err0; } if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - warn("ERROR: elf_begin() failed"); + DPRINTFX("ERROR: elf_begin() failed: %s", elf_errmsg(-1)); goto err1; } /* @@ -546,7 +546,7 @@ proc_iter_symbyaddr(struct proc_handle * return (-1); stridx = shdr.sh_link; if ((data = elf_getdata(foundscn, NULL)) == NULL) { - DPRINTF("ERROR: elf_getdata() failed"); + DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); goto err2; } i = 0; Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Sun Oct 27 18:52:09 2013 (r257221) +++ head/lib/libproc/proc_util.c Sun Oct 27 20:39:10 2013 (r257222) @@ -146,7 +146,7 @@ proc_wstatus(struct proc_handle *phdl) return (-1); if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { if (errno != EINTR) - warn("waitpid"); + DPRINTF("waitpid"); return (-1); } if (WIFSTOPPED(status)) From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 20:44:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 68138998; Sun, 27 Oct 2013 20:44:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 449C22B54; Sun, 27 Oct 2013 20:44:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RKihtk025350; Sun, 27 Oct 2013 20:44:43 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RKigKS025348; Sun, 27 Oct 2013 20:44:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310272044.r9RKigKS025348@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 27 Oct 2013 20:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257223 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 20:44:43 -0000 Author: bapt Date: Sun Oct 27 20:44:42 2013 New Revision: 257223 URL: http://svnweb.freebsd.org/changeset/base/257223 Log: Import pf.c 1.635 and pf_lb.c 1.4 from OpenBSD Stricter state checking for ICMP and ICMPv6 packets: include the ICMP type in one port of the state key, using the type to determine which side should be the id, and which should be the type. Also: - Handle ICMP6 messages which are typically sent to multicast addresses but recieve unicast replies, by doing fallthrough lookups against the correct multicast address. - Clear up some mistaken assumptions in the PF code: - Not all ICMP packets have an icmp_id, so simulate one based on other data if we can, otherwise set it to 0. - Don't modify the icmp id field in NAT unless it's echo - Use the full range of possible id's when NATing icmp6 echoy Difference with OpenBSD version: - C99ify the new code - WITHOUT_INET6 safe Reviewed by: glebius Obtained from: OpenBSD Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_lb.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Oct 27 20:39:10 2013 (r257222) +++ head/sys/netpfil/pf/pf.c Sun Oct 27 20:44:42 2013 (r257223) @@ -210,6 +210,8 @@ static void pf_change_ap(struct pf_add u_int16_t, u_int8_t, sa_family_t); static int pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *, struct tcphdr *, struct pf_state_peer *); +static int pf_icmp_mapping(struct pf_pdesc *, uint8_t, int *, + int *, uint16_t *, uint16_t *); static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, @@ -256,6 +258,10 @@ static int pf_test_state_tcp(struct pf static int pf_test_state_udp(struct pf_state **, int, struct pfi_kif *, struct mbuf *, int, void *, struct pf_pdesc *); +static int pf_icmp_state_lookup(struct pf_state_key_cmp *, + struct pf_pdesc *, struct pf_state **, struct mbuf *, + int, struct pfi_kif *, uint16_t, uint16_t, + int, int *, int); static int pf_test_state_icmp(struct pf_state **, int, struct pfi_kif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -304,6 +310,8 @@ VNET_DECLARE(int, pf_end_threads); VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; + #define PACKET_LOOPED(pd) ((pd)->pf_mtag && \ (pd)->pf_mtag->flags & PF_PACKET_LOOPED) @@ -2018,6 +2026,155 @@ pf_change_a6(struct pf_addr *a, u_int16_ } #endif /* INET6 */ +static int +pf_icmp_mapping(struct pf_pdesc *pd, uint8_t type, + int *icmp_dir, int *multi, uint16_t *icmpid, uint16_t *icmptype) +{ + /* + * ICMP types marked with PF_OUT are typically responses to + * PF_IN, and will match states in the opposite direction. + * PF_IN ICMP types need to match a state with that type. + */ + *icmp_dir = PF_OUT; + *multi = PF_ICMP_MULTI_LINK; + /* Queries (and responses) */ + switch (type) { + case ICMP_ECHO: + *icmp_dir = PF_IN; + case ICMP_ECHOREPLY: + *icmptype = ICMP_ECHO; + *icmpid = pd->hdr.icmp->icmp_id; + break; + + case ICMP_TSTAMP: + *icmp_dir = PF_IN; + case ICMP_TSTAMPREPLY: + *icmptype = ICMP_TSTAMP; + *icmpid = 0; /* Time is not a secret. */ + break; + + case ICMP_IREQ: + *icmp_dir = PF_IN; + case ICMP_IREQREPLY: + *icmptype = ICMP_IREQ; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_MASKREQ: + *icmp_dir = PF_IN; + case ICMP_MASKREPLY: + *icmptype = ICMP_MASKREQ; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_IPV6_WHEREAREYOU: + *icmp_dir = PF_IN; + case ICMP_IPV6_IAMHERE: + *icmptype = ICMP_IPV6_WHEREAREYOU; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_MOBILE_REGREQUEST: + *icmp_dir = PF_IN; + case ICMP_MOBILE_REGREPLY: + *icmptype = ICMP_MOBILE_REGREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_ROUTERSOLICIT: + *icmp_dir = PF_IN; + case ICMP_ROUTERADVERT: + *icmptype = ICMP_MOBILE_REGREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + +#ifdef INET6 + case ICMP6_ECHO_REQUEST: + *icmp_dir = PF_IN; + case ICMP6_ECHO_REPLY: + *icmptype = ICMP6_ECHO_REPLY; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case MLD_LISTENER_QUERY: + *icmp_dir = PF_IN; + case MLD_LISTENER_REPORT: { + struct mld_hdr *mld = (void *)pd->hdr.icmp6; + + *icmptype = MLD_LISTENER_QUERY; + /* generate fake id for these messages */ + *icmpid = (mld->mld_addr.s6_addr32[0] ^ + mld->mld_addr.s6_addr32[1] ^ + mld->mld_addr.s6_addr32[2] ^ + mld->mld_addr.s6_addr32[3]) & 0xffff; + break; + } + + /* ICMP6_FQDN and ICMP6_NI query/reply are the same type as ICMP6_WRU */ + case ICMP6_WRUREQUEST: + *icmp_dir = PF_IN; + case ICMP6_WRUREPLY: + *icmptype = ICMP6_WRUREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case MLD_MTRACE: + *icmp_dir = PF_IN; + case MLD_MTRACE_RESP: + *icmptype = MLD_MTRACE; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ND_NEIGHBOR_SOLICIT: + *icmp_dir = PF_IN; + case ND_NEIGHBOR_ADVERT: { + struct nd_neighbor_solicit *nd = (void *)pd->hdr.icmp6; + + *icmptype = ND_NEIGHBOR_SOLICIT; + *multi = PF_ICMP_MULTI_SOLICITED; + /* generate fake id for these messages */ + *icmpid = (nd->nd_ns_target.s6_addr32[0] ^ + nd->nd_ns_target.s6_addr32[1] ^ + nd->nd_ns_target.s6_addr32[2] ^ + nd->nd_ns_target.s6_addr32[3]) & 0xffff; + break; + } + +#endif /* INET6 */ + /* These ICMP types map to other connections */ + case ICMP_UNREACH: + case ICMP_SOURCEQUENCH: + case ICMP_REDIRECT: + case ICMP_TIMXCEED: + case ICMP_PARAMPROB: +#ifdef INET6 + /* + * ICMP6_TIME_EXCEEDED is the same type as ICMP_UNREACH + * ND_REDIRECT can't be in this list because the triggering packet + * header is optional. + */ + case ICMP6_PACKET_TOO_BIG: +#endif /* INET6 */ + /* These will not be used, but set them anyways */ + *icmp_dir = PF_IN; + *icmptype = htons(type); + *icmpid = 0; + return (1); /* These types are matched to other state */ + /* + * All remaining ICMP types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *icmptype = type; + *icmpid = 0; + break; + } + *icmptype = htons(*icmptype); + + return (0); +} + static void pf_change_icmp(struct pf_addr *ia, u_int16_t *ip, struct pf_addr *oa, struct pf_addr *na, u_int16_t np, u_int16_t *pc, u_int16_t *h2c, @@ -2992,8 +3149,8 @@ pf_test_rule(struct pf_rule **rm, struct int tag = -1, rtableid = -1; int asd = 0; int match = 0; - int state_icmp = 0; - u_int16_t sport = 0, dport = 0; + int state_icmp = 0, icmp_dir, multi; + uint16_t sport = 0 , dport = 0, virtual_type = 0, virtual_id = 0; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; struct pf_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; @@ -3022,33 +3179,38 @@ pf_test_rule(struct pf_rule **rm, struct case IPPROTO_ICMP: if (pd->af != AF_INET) break; - sport = dport = pd->hdr.icmp->icmp_id; hdrlen = sizeof(*pd->hdr.icmp); icmptype = pd->hdr.icmp->icmp_type; icmpcode = pd->hdr.icmp->icmp_code; - if (icmptype == ICMP_UNREACH || - icmptype == ICMP_SOURCEQUENCH || - icmptype == ICMP_REDIRECT || - icmptype == ICMP_TIMXCEED || - icmptype == ICMP_PARAMPROB) - state_icmp++; + state_icmp = pf_icmp_mapping(pd, icmptype, + &icmp_dir, &multi, &virtual_id, &virtual_type); + if (icmp_dir == PF_IN) { + sport = virtual_id; + dport = virtual_type; + } else { + sport = virtual_type; + dport = virtual_id; + } break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: if (af != AF_INET6) break; - sport = dport = pd->hdr.icmp6->icmp6_id; hdrlen = sizeof(*pd->hdr.icmp6); icmptype = pd->hdr.icmp6->icmp6_type; icmpcode = pd->hdr.icmp6->icmp6_code; - if (icmptype == ICMP6_DST_UNREACH || - icmptype == ICMP6_PACKET_TOO_BIG || - icmptype == ICMP6_TIME_EXCEEDED || - icmptype == ICMP6_PARAM_PROB) - state_icmp++; + state_icmp = pf_icmp_mapping(pd, icmptype, + &icmp_dir, &multi, &virtual_id, &virtual_type); + if (icmp_dir == PF_IN) { + sport = virtual_id; + dport = virtual_type; + } else { + sport = virtual_type; + dport = virtual_id; + } break; #endif /* INET6 */ default: @@ -3118,7 +3280,6 @@ pf_test_rule(struct pf_rule **rm, struct break; #ifdef INET case IPPROTO_ICMP: - nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET)) pf_change_a(&saddr->v4.s_addr, pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, 0); @@ -3127,11 +3288,12 @@ pf_test_rule(struct pf_rule **rm, struct pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[1] != pd->hdr.icmp->icmp_id) { + if (virtual_type == ICMP_ECHO && + nk->port[pd->sidx] != pd->hdr.icmp->icmp_id) { pd->hdr.icmp->icmp_cksum = pf_cksum_fixup( pd->hdr.icmp->icmp_cksum, sport, - nk->port[1], 0); - pd->hdr.icmp->icmp_id = nk->port[1]; + nk->port[pd->sidx], 0); + pd->hdr.icmp->icmp_id = nk->port[pd->sidx]; pd->sport = &pd->hdr.icmp->icmp_id; } m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp); @@ -4348,13 +4510,69 @@ pf_test_state_udp(struct pf_state **stat } static int +pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, + struct pf_state **state, struct mbuf *m, int direction, struct pfi_kif *kif, + uint16_t icmpid, uint16_t type, int icmp_dir, int *iidx, int multi) +{ + + key->af = pd->af; + key->proto = pd->proto; + if (icmp_dir == PF_IN) { + *iidx = pd->sidx; + key->port[pd->sidx] = icmpid; + key->port[pd->didx] = type; + } else { + *iidx = pd->didx; + key->port[pd->sidx] = type; + key->port[pd->didx] = icmpid; + } +#ifdef INET6 + if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { + switch (multi) { + case PF_ICMP_MULTI_SOLICITED: + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; + key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; + key->addr[pd->sidx].addr8[12] = 0xff; + break; + case PF_ICMP_MULTI_LINK: + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = 0; + key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + break; + } + } else +#endif + PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); + PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + + STATE_LOOKUP(kif, key, direction, *state, pd); + + /* Is this ICMP message flowing in right direction? */ + if ((*state)->rule.ptr->type && + (((*state)->direction == direction) ? + PF_IN : PF_OUT) != icmp_dir) { + if (pf_status.debug >= PF_DEBUG_MISC) { + printf("pf: icmp type %d in wrong direction (%d): ", + icmp_dir, direction); + pf_print_state(*state); + printf("\n"); + } + return (PF_DROP); + } + return (-1); +} + +static int pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kif *kif, struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) { struct pf_addr *saddr = pd->src, *daddr = pd->dst; - u_int16_t icmpid = 0, *icmpsum; + u_int16_t icmpid = 0, *icmpsum, virtual_id, virtual_type; u_int8_t icmptype; - int state_icmp = 0; + int icmp_dir, iidx, ret, multi; struct pf_state_key_cmp key; bzero(&key, sizeof(key)); @@ -4365,12 +4583,6 @@ pf_test_state_icmp(struct pf_state **sta icmpid = pd->hdr.icmp->icmp_id; icmpsum = &pd->hdr.icmp->icmp_cksum; - if (icmptype == ICMP_UNREACH || - icmptype == ICMP_SOURCEQUENCH || - icmptype == ICMP_REDIRECT || - icmptype == ICMP_TIMXCEED || - icmptype == ICMP_PARAMPROB) - state_icmp++; break; #endif /* INET */ #ifdef INET6 @@ -4379,34 +4591,31 @@ pf_test_state_icmp(struct pf_state **sta icmpid = pd->hdr.icmp6->icmp6_id; icmpsum = &pd->hdr.icmp6->icmp6_cksum; - if (icmptype == ICMP6_DST_UNREACH || - icmptype == ICMP6_PACKET_TOO_BIG || - icmptype == ICMP6_TIME_EXCEEDED || - icmptype == ICMP6_PARAM_PROB) - state_icmp++; break; #endif /* INET6 */ } - if (!state_icmp) { - + if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, + &virtual_id, &virtual_type) == 0) { /* * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - key.af = pd->af; - key.proto = pd->proto; - key.port[0] = key.port[1] = icmpid; - if (direction == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); + ret = pf_icmp_state_lookup(&key, pd, state, m, direction, + kif, virtual_id, virtual_type, icmp_dir, &iidx, + PF_ICMP_MULTI_NONE); + if (ret >= 0) { + if (ret == PF_DROP && pd->af == AF_INET6 && + icmp_dir == PF_OUT) { + ret = pf_icmp_state_lookup(&key, pd, state, m, + direction, kif, virtual_id, virtual_type, + icmp_dir, &iidx, multi); + if (ret >= 0) + return (ret); + } else + return (ret); } - STATE_LOOKUP(kif, &key, direction, *state, pd); - (*state)->expire = time_uptime; (*state)->timeout = PFTM_ICMP_ERROR_REPLY; @@ -4429,14 +4638,13 @@ pf_test_state_icmp(struct pf_state **sta pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[0] != + if (nk->port[iidx] != pd->hdr.icmp->icmp_id) { pd->hdr.icmp->icmp_cksum = pf_cksum_fixup( pd->hdr.icmp->icmp_cksum, icmpid, - nk->port[pd->sidx], 0); - pd->hdr.icmp->icmp_id = - nk->port[pd->sidx]; + nk->port[iidx], 0); + pd->hdr.icmp->icmp_id = nk->port[iidx]; } m_copyback(m, off, ICMP_MINLEN, @@ -4786,13 +4994,15 @@ pf_test_state_icmp(struct pf_state **sta return (PF_DROP); } - key.af = pd2.af; - key.proto = IPPROTO_ICMP; - PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); - PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); - key.port[0] = key.port[1] = iih.icmp_id; - - STATE_LOOKUP(kif, &key, direction, *state, pd); + icmpid = iih.icmp_id; + pf_icmp_mapping(&pd2, iih.icmp_type, + &icmp_dir, &multi, &virtual_id, &virtual_type); + + ret = pf_icmp_state_lookup(&key, &pd2, state, m, + direction, kif, virtual_id, virtual_type, + icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + if (ret >= 0) + return (ret); /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -4802,20 +5012,20 @@ pf_test_state_icmp(struct pf_state **sta if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - nk->port[pd2.sidx] != iih.icmp_id) - pf_change_icmp(pd2.src, &iih.icmp_id, + (virtual_type == ICMP_ECHO && + nk->port[iidx] != iih.icmp_id)) + pf_change_icmp(pd2.src, + (virtual_type == ICMP_ECHO) ? + &iih.icmp_id : NULL, daddr, &nk->addr[pd2.sidx], nk->port[pd2.sidx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af) || - nk->port[pd2.didx] != iih.icmp_id) - pf_change_icmp(pd2.dst, &iih.icmp_id, - NULL, /* XXX Inbound NAT? */ - &nk->addr[pd2.didx], - nk->port[pd2.didx], NULL, + &nk->addr[pd2.didx], pd2.af)) + pf_change_icmp(pd2.dst, NULL, NULL, + &nk->addr[pd2.didx], 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); @@ -4839,13 +5049,23 @@ pf_test_state_icmp(struct pf_state **sta return (PF_DROP); } - key.af = pd2.af; - key.proto = IPPROTO_ICMPV6; - PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); - PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); - key.port[0] = key.port[1] = iih.icmp6_id; - - STATE_LOOKUP(kif, &key, direction, *state, pd); + pf_icmp_mapping(&pd2, iih.icmp6_type, + &icmp_dir, &multi, &virtual_id, &virtual_type); + ret = pf_icmp_state_lookup(&key, &pd2, state, m, + direction, kif, virtual_id, virtual_type, + icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + if (ret >= 0) { + if (ret == PF_DROP && pd->af == AF_INET6 && + icmp_dir == PF_OUT) { + ret = pf_icmp_state_lookup(&key, pd, + state, m, direction, kif, + virtual_id, virtual_type, + icmp_dir, &iidx, multi); + if (ret >= 0) + return (ret); + } else + return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -4855,20 +5075,21 @@ pf_test_state_icmp(struct pf_state **sta if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - nk->port[pd2.sidx] != iih.icmp6_id) - pf_change_icmp(pd2.src, &iih.icmp6_id, + ((virtual_type == ICMP6_ECHO_REQUEST) && + nk->port[pd2.sidx] != iih.icmp6_id)) + pf_change_icmp(pd2.src, + (virtual_type == ICMP6_ECHO_REQUEST) + ? &iih.icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], - nk->port[pd2.sidx], NULL, + (virtual_type == ICMP6_ECHO_REQUEST) + ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af) || - nk->port[pd2.didx] != iih.icmp6_id) - pf_change_icmp(pd2.dst, &iih.icmp6_id, - NULL, /* XXX Inbound NAT? */ - &nk->addr[pd2.didx], - nk->port[pd2.didx], NULL, + &nk->addr[pd2.didx], pd2.af)) + pf_change_icmp(pd2.dst, NULL, NULL, + &nk->addr[pd2.didx], 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); @@ -6192,10 +6413,32 @@ pf_test6(int dir, struct ifnet *ifp, str } case IPPROTO_ICMPV6: { - struct icmp6_hdr ih; + union { + struct icmp6_hdr icmp6; + struct mld_hdr mld; + struct nd_neighbor_solicit nd; + } ih; + size_t icmp_hlen = sizeof(struct icmp6_hdr); - pd.hdr.icmp6 = &ih; - if (!pf_pull_hdr(m, off, &ih, sizeof(ih), + pd.hdr.icmp6 = &ih.icmp6; + if (!pf_pull_hdr(m, off, &ih, icmp_hlen, + &action, &reason, AF_INET6)) { + log = action != PF_PASS; + goto done; + } + /* ICMP headers we look further into to match state */ + switch (ih.icmp6.icmp6_type) { + case MLD_LISTENER_QUERY: + case MLD_LISTENER_REPORT: + icmp_hlen = sizeof(struct mld_hdr); + break; + case ND_NEIGHBOR_SOLICIT: + case ND_NEIGHBOR_ADVERT: + icmp_hlen = sizeof(struct nd_neighbor_solicit); + break; + } + if (icmp_hlen > sizeof(struct icmp6_hdr) && + !pf_pull_hdr(m, off, &ih, icmp_hlen, &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; Modified: head/sys/netpfil/pf/pf_lb.c ============================================================================== --- head/sys/netpfil/pf/pf_lb.c Sun Oct 27 20:39:10 2013 (r257222) +++ head/sys/netpfil/pf/pf_lb.c Sun Oct 27 20:44:42 2013 (r257223) @@ -53,6 +53,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + +#ifdef INET6 +#include +#include +#endif + #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x static void pf_hash(struct pf_addr *, struct pf_addr *, @@ -224,9 +233,23 @@ pf_get_sport(sa_family_t af, u_int8_t pr if (pf_map_addr(af, r, saddr, naddr, &init_addr, sn)) return (1); - if (proto == IPPROTO_ICMP) { + switch (proto) { + case IPPROTO_ICMP: + if (dport != ICMP_ECHO) + return (0); low = 1; high = 65535; + break; +#ifdef INET6 + case IPPROTO_ICMPV6: + if (dport != ICMP_ECHO) + return (0); + low = 1; + high = 65535; + break; +#endif + default: + return (0); /* Don't try to modify non-echo ICMP */ } bzero(&key, sizeof(key)); From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 20:52:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3995EB77; Sun, 27 Oct 2013 20:52:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25A0B2BB0; Sun, 27 Oct 2013 20:52:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RKqAbE028273; Sun, 27 Oct 2013 20:52:10 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RKqAN2028272; Sun, 27 Oct 2013 20:52:10 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310272052.r9RKqAN2028272@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 27 Oct 2013 20:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257224 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 20:52:10 -0000 Author: bapt Date: Sun Oct 27 20:52:09 2013 New Revision: 257224 URL: http://svnweb.freebsd.org/changeset/base/257224 Log: Improt pf.c 1.636 from OpenBSD Original log: Make sure pd2 has a pointer to the icmp header in the payload; fixes panic seen with some some icmp types in icmp error message payloads. Obtained from: OpenBSD Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Oct 27 20:44:42 2013 (r257223) +++ head/sys/netpfil/pf/pf.c Sun Oct 27 20:52:09 2013 (r257224) @@ -4994,7 +4994,7 @@ pf_test_state_icmp(struct pf_state **sta return (PF_DROP); } - icmpid = iih.icmp_id; + pd2.hdr.icmp = &iih; pf_icmp_mapping(&pd2, iih.icmp_type, &icmp_dir, &multi, &virtual_id, &virtual_type); @@ -5049,6 +5049,7 @@ pf_test_state_icmp(struct pf_state **sta return (PF_DROP); } + pd2.hdr.icmp6 = &iih; pf_icmp_mapping(&pd2, iih.icmp6_type, &icmp_dir, &multi, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, m, From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 20:56:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F3CF8DCC; Sun, 27 Oct 2013 20:56:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E02E52BD4; Sun, 27 Oct 2013 20:56:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RKuN3i028792; Sun, 27 Oct 2013 20:56:23 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RKuN2o028791; Sun, 27 Oct 2013 20:56:23 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310272056.r9RKuN2o028791@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 27 Oct 2013 20:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257225 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 20:56:24 -0000 Author: bapt Date: Sun Oct 27 20:56:23 2013 New Revision: 257225 URL: http://svnweb.freebsd.org/changeset/base/257225 Log: Import pf.c 1.638 from OpenBSD Original log: Some ICMP types that also have icmp_id, pointed out by markus@ Obtained from: OpenBSD Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Oct 27 20:52:09 2013 (r257224) +++ head/sys/netpfil/pf/pf.c Sun Oct 27 20:56:23 2013 (r257225) @@ -2050,21 +2050,21 @@ pf_icmp_mapping(struct pf_pdesc *pd, uin *icmp_dir = PF_IN; case ICMP_TSTAMPREPLY: *icmptype = ICMP_TSTAMP; - *icmpid = 0; /* Time is not a secret. */ + *icmpid = pd->hdr.icmp->icmp_id; break; case ICMP_IREQ: *icmp_dir = PF_IN; case ICMP_IREQREPLY: *icmptype = ICMP_IREQ; - *icmpid = 0; /* Nothing sane to match on! */ + *icmpid = pd->hdr.icmp->icmp_id; break; case ICMP_MASKREQ: *icmp_dir = PF_IN; case ICMP_MASKREPLY: *icmptype = ICMP_MASKREQ; - *icmpid = 0; /* Nothing sane to match on! */ + *icmpid = pd->hdr.icmp->icmp_id; break; case ICMP_IPV6_WHEREAREYOU: From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:06:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7785D30E; Sun, 27 Oct 2013 21:06:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 65A842C73; Sun, 27 Oct 2013 21:06:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RL6ILn032376; Sun, 27 Oct 2013 21:06:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RL6I0J032375; Sun, 27 Oct 2013 21:06:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310272106.r9RL6I0J032375@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 27 Oct 2013 21:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257226 - head/usr.sbin/edquota X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:06:18 -0000 Author: jilles Date: Sun Oct 27 21:06:17 2013 New Revision: 257226 URL: http://svnweb.freebsd.org/changeset/base/257226 Log: edquota: Don't pass fd for temporary file to editor. The editor opens the temporary file by name. Modified: head/usr.sbin/edquota/edquota.c Modified: head/usr.sbin/edquota/edquota.c ============================================================================== --- head/usr.sbin/edquota/edquota.c Sun Oct 27 20:56:23 2013 (r257225) +++ head/usr.sbin/edquota/edquota.c Sun Oct 27 21:06:17 2013 (r257226) @@ -284,7 +284,7 @@ main(int argc, char *argv[]) freeprivs(protoprivs); exit(0); } - tmpfd = mkstemp(tmpfil); + tmpfd = mkostemp(tmpfil, O_CLOEXEC); fchown(tmpfd, getuid(), getgid()); if (tflag) { if ((protoprivs = getprivs(0, quotatype, fspath)) != NULL) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:07:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 998AC47B; Sun, 27 Oct 2013 21:07:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86A8F2C95; Sun, 27 Oct 2013 21:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RL7bu8032599; Sun, 27 Oct 2013 21:07:37 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RL7bQ5032598; Sun, 27 Oct 2013 21:07:37 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310272107.r9RL7bQ5032598@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 27 Oct 2013 21:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257227 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:07:37 -0000 Author: bapt Date: Sun Oct 27 21:07:37 2013 New Revision: 257227 URL: http://svnweb.freebsd.org/changeset/base/257227 Log: Import pf_print_state.c 1.54 from OpenBSD Original log: pfctl -ss printed state levels for ICMPv6. Disable this the same way it has already been done for ICMPv4. Difference with OpenBSD: - WITHOUT_INET6 safe Obtained from: OpenBSD Modified: head/sbin/pfctl/pf_print_state.c Modified: head/sbin/pfctl/pf_print_state.c ============================================================================== --- head/sbin/pfctl/pf_print_state.c Sun Oct 27 21:06:17 2013 (r257226) +++ head/sbin/pfctl/pf_print_state.c Sun Oct 27 21:07:37 2013 (r257227) @@ -285,8 +285,13 @@ print_state(struct pfsync_state *s, int const char *states[] = PFUDPS_NAMES; printf(" %s:%s\n", states[src->state], states[dst->state]); +#ifndef INET6 } else if (s->proto != IPPROTO_ICMP && src->state < PFOTHERS_NSTATES && dst->state < PFOTHERS_NSTATES) { +#else + } else if (s->proto != IPPROTO_ICMP && s->proto != IPPROTO_ICMPV6 && + src->state < PFOTHERS_NSTATES && dst->state < PFOTHERS_NSTATES) { +#endif /* XXX ICMP doesn't really have state levels */ const char *states[] = PFOTHERS_NAMES; From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:08:47 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 791EE5FA; Sun, 27 Oct 2013 21:08:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5752CBC; Sun, 27 Oct 2013 21:08:47 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id DAFF5D42A55; Mon, 28 Oct 2013 08:08:43 +1100 (EST) Date: Mon, 28 Oct 2013 08:08:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r257217 - in head/sys/arm: arm include In-Reply-To: <201310271709.r9RH9Ow8051758@svn.freebsd.org> Message-ID: <20131028080703.A1749@besplex.bde.org> References: <201310271709.r9RH9Ow8051758@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=HJ-ZpemzcVAA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=dhiH2-YPAykA:10 a=4KOMn9Ij5fW9Z8bXObAA:9 a=CjuIK1q_8ugA:10 a=hTXNkrwoIw0A:10 a=q9uEI-O3NaoA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:08:47 -0000 On Sun, 27 Oct 2013, Ian Lepore wrote: > Log: > Remove the last dregs of trapframe_t. It turns out only arm was using > this type, so remove it to make arm code more consistant with other > platforms. Thanks to bde@ for pointing out only arm used trapframe_t. Thanks. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:27:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89709AD0; Sun, 27 Oct 2013 21:27:09 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [IPv6:2a00:1450:4010:c04::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8238B2DB2; Sun, 27 Oct 2013 21:27:08 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id o14so2199636lbi.23 for ; Sun, 27 Oct 2013 14:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Pd3dDeySE3d1e+KmPgA+vxhboDJtmOoMOfpqUVAoPvM=; b=BKXC3OHLQmYTCnUZtF+wep7uG44lxnw3flFvGDttBQc0M+hMnLnsk4TpAAap4Tk263 cFrbZxRsWqOnFOybC/aPG19FkPEWDB5gjDUqBVuBVN4Yz/4GBs/elEAcGSijY/Ac3Ww8 PiAuHDPf5C3XKeYWPabz541hw91RYBzDaWgsjexJmyJFc16X5D231E9ML7kRLNlxvGoO jmLcA8A1FwY0d2hKrGefo73gtmXhnJhhzq1QY1dCC59G9EbFW5l1cyzyR3Qz0oFM96bJ bZApaBQCXlEnAJE2IDvertVONiDu36Px0fQkKD3HxvmtlQ52aRD6Pl9Iyh2R4vsqB7bS e0/g== X-Received: by 10.112.198.39 with SMTP id iz7mr8916842lbc.24.1382909226308; Sun, 27 Oct 2013 14:27:06 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([91.198.175.1]) by mx.google.com with ESMTPSA id l10sm10678255lbh.13.2013.10.27.14.27.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Oct 2013 14:27:03 -0700 (PDT) Sender: Alexander Motin Message-ID: <526D9336.5020209@FreeBSD.org> Date: Mon, 28 Oct 2013 00:27:02 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Slawa Olhovchenkov Subject: Re: svn commit: r252010 - head/sys/geom/mirror References: <201306192152.r5JLqWfs058862@svn.freebsd.org> <20131027183653.GA9023@zxy.spb.ru> In-Reply-To: <20131027183653.GA9023@zxy.spb.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:27:09 -0000 On 27.10.2013 20:36, Slawa Olhovchenkov wrote: > On Wed, Jun 19, 2013 at 09:52:32PM +0000, Scott Long wrote: > >> Author: scottl >> Date: Wed Jun 19 21:52:32 2013 >> New Revision: 252010 >> URL: http://svnweb.freebsd.org/changeset/base/252010 >> >> Log: >> Mark geom_mirror as capable of unmapped i/o > > Can you add capable of unmapped i/o to geom_stripe? I've added support for unmapped I/O for STRIPE and CONCAT as part of my GEOM direct dispatch commit (r256880). I've forgot to mention it in the commit message. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:30:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 21E74CA4; Sun, 27 Oct 2013 21:30:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id AE1A32DE8; Sun, 27 Oct 2013 21:30:06 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VaXwK-000FDN-GH; Mon, 28 Oct 2013 01:32:04 +0400 Date: Mon, 28 Oct 2013 01:32:04 +0400 From: Slawa Olhovchenkov To: Alexander Motin Subject: Re: svn commit: r252010 - head/sys/geom/mirror Message-ID: <20131027213204.GN63359@zxy.spb.ru> References: <201306192152.r5JLqWfs058862@svn.freebsd.org> <20131027183653.GA9023@zxy.spb.ru> <526D9336.5020209@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <526D9336.5020209@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:30:07 -0000 On Mon, Oct 28, 2013 at 12:27:02AM +0200, Alexander Motin wrote: > On 27.10.2013 20:36, Slawa Olhovchenkov wrote: > > On Wed, Jun 19, 2013 at 09:52:32PM +0000, Scott Long wrote: > > > >> Author: scottl > >> Date: Wed Jun 19 21:52:32 2013 > >> New Revision: 252010 > >> URL: http://svnweb.freebsd.org/changeset/base/252010 > >> > >> Log: > >> Mark geom_mirror as capable of unmapped i/o > > > > Can you add capable of unmapped i/o to geom_stripe? > > I've added support for unmapped I/O for STRIPE and CONCAT as part of my > GEOM direct dispatch commit (r256880). I've forgot to mention it in the > commit message. Thanks! Can I direct applay this commit to 10.x? From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:37:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 23812184; Sun, 27 Oct 2013 21:37:11 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CF282E80; Sun, 27 Oct 2013 21:37:09 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id hp15so4584448lab.19 for ; Sun, 27 Oct 2013 14:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Cti/UApU8nS1f+PW9k8njKJegICc+oEH+ys8GtHP6DI=; b=ba2CZWlnX+SxHmgN8Z17jd5SjqTTcYsQ0UGzc9jslnrpYA7YY+VJhvTqIt4tHEd+f+ BcBgvocsDKQXc9vpggj7bCq77OCFJd8ebgulhW01y4js9e9D6Ufdw2/qia1NpzUIfZjh JVXXM1aCOS7GHUJdGVtCJzN7MxzSsC75R2cQqneZ3fxTrrAdwb8l3XfIfmkPeyJrxbRf Zgc7Y8lZjCdyyBhZKghdyvorRali1ozJh188rZVO2KQJCN89Qb9mVV00J0p1jPmT6zGw Az4XJZKJ+AnAExxq1V9Fssvr5XEe3Ohp7E6dcJDixK0uKFaLJwzGoMsLuucbOWZP8qyN EMoA== X-Received: by 10.152.29.103 with SMTP id j7mr12025533lah.7.1382909828183; Sun, 27 Oct 2013 14:37:08 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([91.198.175.1]) by mx.google.com with ESMTPSA id zc3sm10727612lbb.2.2013.10.27.14.37.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Oct 2013 14:37:07 -0700 (PDT) Sender: Alexander Motin Message-ID: <526D8780.2080600@FreeBSD.org> Date: Sun, 27 Oct 2013 23:37:04 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130616 Thunderbird/17.0.6 MIME-Version: 1.0 To: Slawa Olhovchenkov Subject: Re: svn commit: r252010 - head/sys/geom/mirror References: <201306192152.r5JLqWfs058862@svn.freebsd.org> <20131027183653.GA9023@zxy.spb.ru> <526D9336.5020209@FreeBSD.org> <20131027213204.GN63359@zxy.spb.ru> In-Reply-To: <20131027213204.GN63359@zxy.spb.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:37:11 -0000 On 27.10.2013 23:32, Slawa Olhovchenkov wrote: > On Mon, Oct 28, 2013 at 12:27:02AM +0200, Alexander Motin wrote: > >> On 27.10.2013 20:36, Slawa Olhovchenkov wrote: >>> On Wed, Jun 19, 2013 at 09:52:32PM +0000, Scott Long wrote: >>> >>>> Author: scottl >>>> Date: Wed Jun 19 21:52:32 2013 >>>> New Revision: 252010 >>>> URL: http://svnweb.freebsd.org/changeset/base/252010 >>>> >>>> Log: >>>> Mark geom_mirror as capable of unmapped i/o >>> >>> Can you add capable of unmapped i/o to geom_stripe? >> >> I've added support for unmapped I/O for STRIPE and CONCAT as part of my >> GEOM direct dispatch commit (r256880). I've forgot to mention it in the >> commit message. > > Thanks! > Can I direct applay this commit to 10.x? You may wish/need to pick up some other nearby commits of mine too. I've tested that at some point, but then cut the big patch into several commits separated by few days. I plan to merge it all to 10/9-STABLE after 10.0 cycle complete. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:39:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7990C3BE; Sun, 27 Oct 2013 21:39:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 65E622ED8; Sun, 27 Oct 2013 21:39:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RLdI8W042704; Sun, 27 Oct 2013 21:39:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RLdGRY042692; Sun, 27 Oct 2013 21:39:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310272139.r9RLdGRY042692@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Oct 2013 21:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257228 - in head/sys: arm/arm ia64/ia64 kern mips/mips powerpc/powerpc sparc64/include sys x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:39:18 -0000 Author: kib Date: Sun Oct 27 21:39:16 2013 New Revision: 257228 URL: http://svnweb.freebsd.org/changeset/base/257228 Log: Add bus_dmamap_load_ma() function to load map with the array of vm_pages. Provide trivial implementation which forwards the load to _bus_dmamap_load_phys() page by page. Right now all architectures use bus_dmamap_load_ma_triv(). Tested by: pho (as part of the functional patch) Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm/arm/busdma_machdep.c head/sys/ia64/ia64/busdma_machdep.c head/sys/kern/subr_bus_dma.c head/sys/mips/mips/busdma_machdep.c head/sys/powerpc/powerpc/busdma_machdep.c head/sys/sparc64/include/bus_dma.h head/sys/sys/bus_dma.h head/sys/x86/x86/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Oct 27 21:39:16 2013 (r257228) @@ -975,6 +975,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat return (0); } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrace, and the ending segment on exit. Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/arm/arm/busdma_machdep.c Sun Oct 27 21:39:16 2013 (r257228) @@ -992,6 +992,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat } return (0); } + +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. Modified: head/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- head/sys/ia64/ia64/busdma_machdep.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/ia64/ia64/busdma_machdep.c Sun Oct 27 21:39:16 2013 (r257228) @@ -658,6 +658,17 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat */ return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } + +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrace, and the ending segment on exit. Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/kern/subr_bus_dma.c Sun Oct 27 21:39:16 2013 (r257228) @@ -124,24 +124,33 @@ static int _bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, int *nsegs, int flags) { - vm_paddr_t paddr; - bus_size_t len, tlen; - int error, i, ma_offs; + int error; if ((bio->bio_flags & BIO_UNMAPPED) == 0) { error = _bus_dmamap_load_buffer(dmat, map, bio->bio_data, bio->bio_bcount, kernel_pmap, flags, NULL, nsegs); - return (error); + } else { + error = _bus_dmamap_load_ma(dmat, map, bio->bio_ma, + bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs); } + return (error); +} + +int +bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + vm_paddr_t paddr; + bus_size_t len; + int error, i; error = 0; - tlen = bio->bio_bcount; - ma_offs = bio->bio_ma_offset; for (i = 0; tlen > 0; i++, tlen -= len) { len = min(PAGE_SIZE - ma_offs, tlen); - paddr = VM_PAGE_TO_PHYS(bio->bio_ma[i]) + ma_offs; + paddr = VM_PAGE_TO_PHYS(ma[i]) + ma_offs; error = _bus_dmamap_load_phys(dmat, map, paddr, len, - flags, NULL, nsegs); + flags, segs, segp); if (error != 0) break; ma_offs = 0; Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/mips/mips/busdma_machdep.c Sun Oct 27 21:39:16 2013 (r257228) @@ -878,6 +878,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat return (0); } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/powerpc/powerpc/busdma_machdep.c Sun Oct 27 21:39:16 2013 (r257228) @@ -754,6 +754,16 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + /* * Utility function to load a linear buffer. segp contains * the starting segment on entrance, and the ending segment on exit. Modified: head/sys/sparc64/include/bus_dma.h ============================================================================== --- head/sys/sparc64/include/bus_dma.h Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/sparc64/include/bus_dma.h Sun Oct 27 21:39:16 2013 (r257228) @@ -146,5 +146,7 @@ struct bus_dma_tag { ((t)->dt_mt->dm_dmamem_alloc((t), (v), (f), (m))) #define bus_dmamem_free(t, v, m) \ ((t)->dt_mt->dm_dmamem_free((t), (v), (m))) +#define _bus_dmamap_load_ma(t, m, a, tt, o, f, s, p) \ + bus_dmamap_load_ma_triv((t), (m), (a), (tt), (o), (f), (s), (p)) #endif /* !_SPARC64_BUS_DMA_H_ */ Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/sys/bus_dma.h Sun Oct 27 21:39:16 2013 (r257228) @@ -247,6 +247,15 @@ int bus_dmamap_load_mem(bus_dma_tag_t dm void *callback_arg, int flags); /* + * Placeholder for use by busdma implementations which do not benefit + * from optimized procedure to load an array of vm_page_t. Falls back + * to do _bus_dmamap_load_phys() in loop. + */ +int bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + +/* * XXX sparc64 uses the same interface, but a much different implementation. * for the sparc64 arch contains the equivalent * declarations. @@ -324,6 +333,10 @@ int _bus_dmamap_load_phys(bus_dma_tag_t vm_paddr_t paddr, bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp); +int _bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + bus_dma_segment_t *_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dma_segment_t *segs, Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Sun Oct 27 21:07:37 2013 (r257227) +++ head/sys/x86/x86/busdma_machdep.c Sun Oct 27 21:39:16 2013 (r257228) @@ -849,6 +849,16 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } +int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + + return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + void __bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, struct memdesc *mem, bus_dmamap_callback_t *callback, From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:43:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 929B2686; Sun, 27 Oct 2013 21:43:42 +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 21B702F27; Sun, 27 Oct 2013 21:43:41 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id F0F231A2748; Mon, 28 Oct 2013 08:43:38 +1100 (EST) Date: Mon, 28 Oct 2013 08:43:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r257203 - head/sys/arm/arm In-Reply-To: <1382900401.1170.227.camel@revolution.hippie.lan> Message-ID: <20131028081925.C2294@besplex.bde.org> References: <201310270329.r9R3Tcoi076809@svn.freebsd.org> <20131028040222.G929@besplex.bde.org> <1382900401.1170.227.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=zbkiI427TaUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=E11o_6pwCccA:10 a=5rOP3BK-mveX7-Rzz9EA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:43:42 -0000 On Sun, 27 Oct 2013, Ian Lepore wrote: > On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote: >> On Sun, 27 Oct 2013, Ian Lepore wrote: >> >>> Log: >>> Eliminate a compiler warning about extraneous parens. >> >> Wow, what flags give these warnings? > > --- busdma_machdep.o --- > /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] > if ((map->pagesneeded == 0)) { > ~~~~~~~~~~~~~~~~~^~~~ Ahh. I guess what I really want is -Wredundant-parentheses -Wredundant-braces ... The parser can easily tell what is redundant than what is bogus since bogusness depends on style and too many suboptions would be required to specify styles (-Wparentheses[-operator][-context]. Oops, the parser easily can't do this right because macro parameters must usually have redundant parentheses and C parsers are specified to act as if on the output of the preprocessor so they can't easily either have a special case to ignore these redundant parentheses or know that they aren't in the unpreprocessed source so they should be ignored. > /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: remove extraneous parentheses around the comparison to silence this warning > if ((map->pagesneeded == 0)) { > ~ ^ ~ > /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: use '=' to turn this equality comparison into an assignment > if ((map->pagesneeded == 0)) { > ^~ > = > > That's what the compiler had to say about it. I guess in somebody's > mind if it's a probable error to have done > ... This expression could be the result of a macro #define ISZERO(x) ((x) == 0) which for if (ISZERO(map->pagesneeded)) expands to almost the above. I guess clang warns excessively about this. > The warning doesn't bother me as much as the two useless notes that > follow it (which are annoying when combined with my editor's feature of > parsing compiler output and jumping to the next error point in the > code). I've notice clang is particularly chatty, with things like > suggesting what you might have meant when you spell a variable name > wrong. Before long it's going to be like RPG and COBOL where it's > willing to assume what you meant and try to generate runnable code in > the face of almost any error. The verbose prettyprinted output can be annoying. If clang would print its man page then I might know its options so I could turn it off :-). > I probably date myself with references to RPG and COBOL, but it does > bring back fond memories of slapping a boilerplate header on every > interoffice memo issued by management and running it through the cobol > compiler, and grading them on whether their memos generated runnable > code or so many errors the compiler gave up. I started late enough to not touch these or spend more than 2 years on accounting-related software. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 21:49:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FDA1802; Sun, 27 Oct 2013 21:49:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A86C2F43; Sun, 27 Oct 2013 21:49:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RLnspE046154; Sun, 27 Oct 2013 21:49:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RLnqnm046148; Sun, 27 Oct 2013 21:49:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310272149.r9RLnqnm046148@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 27 Oct 2013 21:49:52 +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: r257229 - in stable/9: lib/libc/stdio tools/regression/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 21:49:54 -0000 Author: jilles Date: Sun Oct 27 21:49:52 2013 New Revision: 257229 URL: http://svnweb.freebsd.org/changeset/base/257229 Log: MFC r243731,r255303: libc: Allow setting close-on-exec in fopen/freopen/ fdopen. This commit adds a new mode option 'e'. For freopen() with a non-NULL path argument and fopen(), the close-on-exec flag is set iff the 'e' mode option is specified. For freopen() with a NULL path argument and fdopen(), the close-on-exec flag is turned on if the 'e' mode option is specified and remains unchanged otherwise. Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC) and fdopen(), this needlessly complicates the calling code. PR: kern/169320 Added: stable/9/tools/regression/lib/libc/stdio/test-fopen.c - copied unchanged from r255303, head/tools/regression/lib/libc/stdio/test-fopen.c stable/9/tools/regression/lib/libc/stdio/test-fopen.t - copied unchanged from r255303, head/tools/regression/lib/libc/stdio/test-fopen.t Modified: stable/9/lib/libc/stdio/fdopen.c stable/9/lib/libc/stdio/flags.c stable/9/lib/libc/stdio/fopen.3 stable/9/lib/libc/stdio/freopen.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/tools/regression/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/fdopen.c ============================================================================== --- stable/9/lib/libc/stdio/fdopen.c Sun Oct 27 21:39:16 2013 (r257228) +++ stable/9/lib/libc/stdio/fdopen.c Sun Oct 27 21:49:52 2013 (r257229) @@ -80,6 +80,12 @@ fdopen(fd, mode) if ((fp = __sfp()) == NULL) return (NULL); + + if ((oflags & O_CLOEXEC) && _fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { + fp->_flags = 0; + return (NULL); + } + fp->_flags = flags; /* * If opened for appending, but underlying descriptor does not have Modified: stable/9/lib/libc/stdio/flags.c ============================================================================== --- stable/9/lib/libc/stdio/flags.c Sun Oct 27 21:39:16 2013 (r257228) +++ stable/9/lib/libc/stdio/flags.c Sun Oct 27 21:49:52 2013 (r257229) @@ -53,7 +53,7 @@ __sflags(mode, optr) const char *mode; int *optr; { - int ret, m, o; + int ret, m, o, known; switch (*mode++) { @@ -80,28 +80,34 @@ __sflags(mode, optr) return (0); } - /* 'b' (binary) is ignored */ - if (*mode == 'b') - mode++; - - /* [rwa][b]\+ means read and write */ - if (*mode == '+') { - mode++; - ret = __SRW; - m = O_RDWR; - } - - /* 'b' (binary) can appear here, too -- and is ignored again */ - if (*mode == 'b') - mode++; - - /* 'x' means exclusive (fail if the file exists) */ - if (*mode == 'x') { - if (m == O_RDONLY) { - errno = EINVAL; - return (0); + do { + known = 1; + switch (*mode++) { + case 'b': + /* 'b' (binary) is ignored */ + break; + case '+': + /* [rwa][b]\+ means read and write */ + ret = __SRW; + m = O_RDWR; + break; + case 'x': + /* 'x' means exclusive (fail if the file exists) */ + o |= O_EXCL; + break; + case 'e': + /* set close-on-exec */ + o |= O_CLOEXEC; + break; + default: + known = 0; + break; } - o |= O_EXCL; + } while (known); + + if ((o & O_EXCL) != 0 && m == O_RDONLY) { + errno = EINVAL; + return (0); } *optr = m | o; Modified: stable/9/lib/libc/stdio/fopen.3 ============================================================================== --- stable/9/lib/libc/stdio/fopen.3 Sun Oct 27 21:39:16 2013 (r257228) +++ stable/9/lib/libc/stdio/fopen.3 Sun Oct 27 21:49:52 2013 (r257229) @@ -100,6 +100,14 @@ or causes the .Fn fopen call to fail if the file already exists. +An optional +.Dq Li e +following the above +causes the +.Fn fopen +call to set the +.Dv FD_CLOEXEC +flag on the underlying file descriptor. .Pp The .Fa mode @@ -149,6 +157,11 @@ of the stream must be compatible with th The .Dq Li x mode option is ignored. +If the +.Dq Li e +mode option is present, the +.Dv FD_CLOEXEC +flag is set, otherwise it remains unchanged. When the stream is closed via .Xr fclose 3 , .Fa fildes @@ -313,6 +326,10 @@ function conforms to .St -p1003.1-88 . The +.Dq Li e +mode option does not conform to any standard +but is also supported by glibc. +The .Fn fmemopen function conforms to Modified: stable/9/lib/libc/stdio/freopen.c ============================================================================== --- stable/9/lib/libc/stdio/freopen.c Sun Oct 27 21:39:16 2013 (r257228) +++ stable/9/lib/libc/stdio/freopen.c Sun Oct 27 21:49:52 2013 (r257229) @@ -118,6 +118,8 @@ freopen(file, mode, fp) (void) ftruncate(fp->_file, (off_t)0); if (!(oflags & O_APPEND)) (void) _sseek(fp, (fpos_t)0, SEEK_SET); + if (oflags & O_CLOEXEC) + (void) _fcntl(fp->_file, F_SETFD, FD_CLOEXEC); f = fp->_file; isopen = 0; wantfd = -1; @@ -194,7 +196,8 @@ finish: * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ if (wantfd >= 0) { - if (_dup2(f, wantfd) >= 0) { + if ((oflags & O_CLOEXEC ? _fcntl(f, F_DUP2FD_CLOEXEC, wantfd) : + _dup2(f, wantfd)) >= 0) { (void)_close(f); f = wantfd; } else Copied: stable/9/tools/regression/lib/libc/stdio/test-fopen.c (from r255303, head/tools/regression/lib/libc/stdio/test-fopen.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/lib/libc/stdio/test-fopen.c Sun Oct 27 21:49:52 2013 (r257229, copy of r255303, head/tools/regression/lib/libc/stdio/test-fopen.c) @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2013 Jilles Tjoelker + * 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 + +/* + * O_ACCMODE is currently defined incorrectly. This is what it should be. + * Various code depends on the incorrect value. + */ +#define CORRECT_O_ACCMODE (O_ACCMODE | O_EXEC) + +static int testnum = 1; + +static void +runtest(const char *fname, const char *mode) +{ + FILE *fp; + int fd, flags, wantedflags; + + fp = fopen(fname, mode); + if (fp == NULL) { + printf("not ok %d - fopen(\"%s\", \"%s\") failed\n", + testnum++, fname, mode); + printf("not ok %d - FD_CLOEXEC # SKIP\n", + testnum++); + return; + } + fd = fileno(fp); + if (fd < 0) + printf("not ok %d - fileno() failed\n", testnum++); + else + printf("ok %d - fopen(\"%s\", \"%s\") and fileno() succeeded\n", + testnum++, fname, mode); + if (fcntl(fd, F_GETFD) == (strchr(mode, 'e') != NULL ? FD_CLOEXEC : 0)) + printf("ok %d - FD_CLOEXEC flag correct\n", testnum++); + else + printf("not ok %d - FD_CLOEXEC flag incorrect\n", testnum++); + flags = fcntl(fd, F_GETFL); + if (strchr(mode, '+')) + wantedflags = O_RDWR | (*mode == 'a' ? O_APPEND : 0); + else if (*mode == 'r') + wantedflags = O_RDONLY; + else if (*mode == 'w') + wantedflags = O_WRONLY; + else if (*mode == 'a') + wantedflags = O_WRONLY | O_APPEND; + else + wantedflags = -1; + if (wantedflags == -1) + printf("not ok %d - unrecognized mode\n", testnum++); + else if ((flags & (CORRECT_O_ACCMODE | O_APPEND)) == wantedflags) + printf("ok %d - correct access mode\n", testnum++); + else + printf("not ok %d - incorrect access mode\n", testnum++); + fclose(fp); +} + +/* + * Test program for fopen(). + */ +int +main(int argc, char *argv[]) +{ + printf("1..45\n"); + runtest("/dev/null", "r"); + runtest("/dev/null", "r+"); + runtest("/dev/null", "w"); + runtest("/dev/null", "w+"); + runtest("/dev/null", "a"); + runtest("/dev/null", "a+"); + runtest("/dev/null", "re"); + runtest("/dev/null", "r+e"); + runtest("/dev/null", "we"); + runtest("/dev/null", "w+e"); + runtest("/dev/null", "ae"); + runtest("/dev/null", "a+e"); + runtest("/dev/null", "re+"); + runtest("/dev/null", "we+"); + runtest("/dev/null", "ae+"); + + return 0; +} + +/* vim:ts=8:cin:sw=8 + * */ Copied: stable/9/tools/regression/lib/libc/stdio/test-fopen.t (from r255303, head/tools/regression/lib/libc/stdio/test-fopen.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/lib/libc/stdio/test-fopen.t Sun Oct 27 21:49:52 2013 (r257229, copy of r255303, head/tools/regression/lib/libc/stdio/test-fopen.t) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 22:03:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 47A54ED7 for ; Sun, 27 Oct 2013 22:03:17 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5EFE202B for ; Sun, 27 Oct 2013 22:03:16 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdtw9+43oQGYIsZZxQQ0xcmsA== X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (cl-3506.cgn-01.de.sixxs.net [IPv6:2001:4dd0:ff00:db1::2]) by smtp.strato.de (RZmta 32.11 AUTH) with (TLSv1.0:DHE-RSA-AES256-SHA encrypted) ESMTPSA id n01a69p9RLdYfE for ; Sun, 27 Oct 2013 23:03:05 +0100 (CET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 27 Oct 2013 23:03:03 +0100 Date: Sun, 27 Oct 2013 23:03:03 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Subject: Re: svn commit: r257203 - head/sys/arm/arm Message-ID: <20131027220303.GA13990@britannica.bec.de> References: <201310270329.r9R3Tcoi076809@svn.freebsd.org> <20131028040222.G929@besplex.bde.org> <1382900401.1170.227.camel@revolution.hippie.lan> <20131028081925.C2294@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131028081925.C2294@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 22:03:17 -0000 On Mon, Oct 28, 2013 at 08:43:37AM +1100, Bruce Evans wrote: > Oops, the parser easily can't do this right because macro parameters > must usually have redundant parentheses and C parsers are specified > to act as if on the output of the preprocessor so they can't easily > either have a special case to ignore these redundant parentheses or > know that they aren't in the unpreprocessed source so they should be > ignored. Did you bother to try your assumptions about the compiler in question? Joerg From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 22:05:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B5A7F7F; Sun, 27 Oct 2013 22:05:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 381BE2065; Sun, 27 Oct 2013 22:05:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RM5CEu052750; Sun, 27 Oct 2013 22:05:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RM5BVG052740; Sun, 27 Oct 2013 22:05:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310272205.r9RM5BVG052740@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Oct 2013 22:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257230 - in head/sys: conf x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 22:05:12 -0000 Author: kib Date: Sun Oct 27 22:05:10 2013 New Revision: 257230 URL: http://svnweb.freebsd.org/changeset/base/257230 Log: Add a virtual table for the busdma methods on x86, to allow different busdma implementations to coexist. Copy busdma_machdep.c to busdma_bounce.c, which is still a single implementation of the busdma interface on x86 for now. The busdma_machdep.c only contains common and dispatch code. Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/x86/include/busdma_impl.h (contents, props changed) head/sys/x86/x86/busdma_bounce.c - copied, changed from r257229, head/sys/x86/x86/busdma_machdep.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/x86/x86/busdma_machdep.c Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Oct 27 21:49:52 2013 (r257229) +++ head/sys/conf/files.amd64 Sun Oct 27 22:05:10 2013 (r257230) @@ -541,6 +541,7 @@ x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci +x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Oct 27 21:49:52 2013 (r257229) +++ head/sys/conf/files.i386 Sun Oct 27 22:05:10 2013 (r257230) @@ -564,6 +564,7 @@ x86/isa/nmi.c standard x86/isa/orm.c optional isa x86/pci/pci_bus.c optional pci x86/pci/qpi.c optional pci +x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sun Oct 27 21:49:52 2013 (r257229) +++ head/sys/conf/files.pc98 Sun Oct 27 22:05:10 2013 (r257230) @@ -247,6 +247,7 @@ x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa x86/pci/pci_bus.c optional pci +x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/intr_machdep.c standard Added: head/sys/x86/include/busdma_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/busdma_impl.h Sun Oct 27 22:05:10 2013 (r257230) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 __X86_BUSDMA_IMPL_H +#define __X86_BUSDMA_IMPL_H + +struct bus_dma_tag_common { + struct bus_dma_impl *impl; + struct bus_dma_tag_common *parent; + bus_size_t alignment; + bus_addr_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; + bus_dma_filter_t *filter; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + bus_dma_lock_t *lockfunc; + void *lockfuncarg; + int ref_count; +}; + +struct bus_dma_impl { + int (*tag_create)(bus_dma_tag_t parent, + bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, + bus_addr_t highaddr, bus_dma_filter_t *filter, + void *filterarg, bus_size_t maxsize, int nsegments, + bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat); + int (*tag_destroy)(bus_dma_tag_t dmat); + int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); + int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); + int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp); + void (*mem_free)(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map); + int (*load_ma)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_phys)(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_buffer)(bus_dma_tag_t dmat, bus_dmamap_t map, + void *buf, bus_size_t buflen, pmap_t pmap, int flags, + bus_dma_segment_t *segs, int *segp); + void (*map_waitok)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, + void *callback_arg); + bus_dma_segment_t *(*map_complete)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error); + void (*map_unload)(bus_dma_tag_t dmat, bus_dmamap_t map); + void (*map_sync)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op); +}; + +void busdma_lock_mutex(void *arg, bus_dma_lock_op_t op); +void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); +int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); +int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, + bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, size_t sz, void **dmat); + +extern struct bus_dma_impl bus_dma_bounce_impl; + +#endif Copied and modified: head/sys/x86/x86/busdma_bounce.c (from r257229, head/sys/x86/x86/busdma_machdep.c) ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Sun Oct 27 21:49:52 2013 (r257229, copy source) +++ head/sys/x86/x86/busdma_bounce.c Sun Oct 27 22:05:10 2013 (r257230) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef __i386__ #define MAX_BPAGES 512 @@ -63,21 +64,8 @@ __FBSDID("$FreeBSD$"); struct bounce_zone; struct bus_dma_tag { - bus_dma_tag_t parent; - bus_size_t alignment; - bus_addr_t boundary; - bus_addr_t lowaddr; - bus_addr_t highaddr; - bus_dma_filter_t *filter; - void *filterarg; - bus_size_t maxsize; - u_int nsegments; - bus_size_t maxsegsz; - int flags; - int ref_count; + struct bus_dma_tag_common common; int map_count; - bus_dma_lock_t *lockfunc; - void *lockfuncarg; bus_dma_segment_t *segments; struct bounce_zone *bounce_zone; }; @@ -160,158 +148,43 @@ static int _bus_dmamap_reserve_pages(bus #endif /* - * Return true if a match is made. - * - * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. - * - * If paddr is within the bounds of the dma tag then call the filter callback - * to check for a match, if there is no filter callback then assume a match. - */ -int -run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) -{ - int retval; - - retval = 0; - - do { - if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) - || ((paddr & (dmat->alignment - 1)) != 0)) - && (dmat->filter == NULL - || (*dmat->filter)(dmat->filterarg, paddr) != 0)) - retval = 1; - - dmat = dmat->parent; - } while (retval == 0 && dmat != NULL); - return (retval); -} - -/* - * Convenience function for manipulating driver locks from busdma (during - * busdma_swi, for example). Drivers that don't provide their own locks - * should specify &Giant to dmat->lockfuncarg. Drivers that use their own - * non-mutex locking scheme don't have to use this at all. - */ -void -busdma_lock_mutex(void *arg, bus_dma_lock_op_t op) -{ - struct mtx *dmtx; - - dmtx = (struct mtx *)arg; - switch (op) { - case BUS_DMA_LOCK: - mtx_lock(dmtx); - break; - case BUS_DMA_UNLOCK: - mtx_unlock(dmtx); - break; - default: - panic("Unknown operation 0x%x for busdma_lock_mutex!", op); - } -} - -/* - * dflt_lock should never get called. It gets put into the dma tag when - * lockfunc == NULL, which is only valid if the maps that are associated - * with the tag are meant to never be defered. - * XXX Should have a way to identify which driver is responsible here. - */ -static void -dflt_lock(void *arg, bus_dma_lock_op_t op) -{ - panic("driver error: busdma dflt_lock called"); -} - -/* * Allocate a device specific dma_tag. */ -int -bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, - bus_addr_t boundary, bus_addr_t lowaddr, - bus_addr_t highaddr, bus_dma_filter_t *filter, - void *filterarg, bus_size_t maxsize, int nsegments, - bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, - void *lockfuncarg, bus_dma_tag_t *dmat) +static int +bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) { bus_dma_tag_t newtag; - int error = 0; - - /* Basic sanity checking */ - if (boundary != 0 && boundary < maxsegsz) - maxsegsz = boundary; - - if (maxsegsz == 0) { - return (EINVAL); - } + int error; - /* Return a NULL tag on failure */ *dmat = NULL; + error = common_bus_dma_tag_create(parent != NULL ? &parent->common : + NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg, + maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg, + sizeof (struct bus_dma_tag), (void **)&newtag); + if (error != 0) + return (error); - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, - M_ZERO | M_NOWAIT); - if (newtag == NULL) { - CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", - __func__, newtag, 0, ENOMEM); - return (ENOMEM); - } - - newtag->parent = parent; - newtag->alignment = alignment; - newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1); - newtag->filter = filter; - newtag->filterarg = filterarg; - newtag->maxsize = maxsize; - newtag->nsegments = nsegments; - newtag->maxsegsz = maxsegsz; - newtag->flags = flags; - newtag->ref_count = 1; /* Count ourself */ + newtag->common.impl = &bus_dma_bounce_impl; newtag->map_count = 0; - if (lockfunc != NULL) { - newtag->lockfunc = lockfunc; - newtag->lockfuncarg = lockfuncarg; - } else { - newtag->lockfunc = dflt_lock; - newtag->lockfuncarg = NULL; - } newtag->segments = NULL; - /* Take into account any restrictions imposed by our parent tag */ - if (parent != NULL) { - newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); - if (newtag->boundary == 0) - newtag->boundary = parent->boundary; - else if (parent->boundary != 0) - newtag->boundary = MIN(parent->boundary, - newtag->boundary); - if ((newtag->filter != NULL) || - ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) - newtag->flags |= BUS_DMA_COULD_BOUNCE; - if (newtag->filter == NULL) { - /* - * Short circuit looking at our parent directly - * since we have encapsulated all of its information - */ - newtag->filter = parent->filter; - newtag->filterarg = parent->filterarg; - newtag->parent = parent->parent; - } - if (newtag->parent != NULL) - atomic_add_int(&parent->ref_count, 1); - } - - if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) - || newtag->alignment > 1) - newtag->flags |= BUS_DMA_COULD_BOUNCE; + if (parent != NULL && ((newtag->common.filter != NULL) || + ((parent->common.flags & BUS_DMA_COULD_BOUNCE) != 0))) + newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || + newtag->common.alignment > 1) + newtag->common.flags |= BUS_DMA_COULD_BOUNCE; - if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && (flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; /* Must bounce */ - if ((error = alloc_bounce_zone(newtag)) != 0) { free(newtag, M_DEVBUF); return (error); @@ -328,41 +201,38 @@ bus_dma_tag_create(bus_dma_tag_t parent, error = ENOMEM; } /* Performed initial allocation */ - newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; - } + newtag->common.flags |= BUS_DMA_MIN_ALLOC_COMP; + } else + error = 0; - if (error != 0) { + if (error != 0) free(newtag, M_DEVBUF); - } else { + else *dmat = newtag; - } CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", - __func__, newtag, (newtag != NULL ? newtag->flags : 0), error); + __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), + error); return (error); } -int -bus_dma_tag_destroy(bus_dma_tag_t dmat) +static int +bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) { - bus_dma_tag_t dmat_copy; + bus_dma_tag_t dmat_copy, parent; int error; error = 0; dmat_copy = dmat; if (dmat != NULL) { - if (dmat->map_count != 0) { error = EBUSY; goto out; } - while (dmat != NULL) { - bus_dma_tag_t parent; - - parent = dmat->parent; - atomic_subtract_int(&dmat->ref_count, 1); - if (dmat->ref_count == 0) { + parent = (bus_dma_tag_t)dmat->common.parent; + atomic_subtract_int(&dmat->common.ref_count, 1); + if (dmat->common.ref_count == 0) { if (dmat->segments != NULL) free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); @@ -385,17 +255,18 @@ out: * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. */ -int -bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +static int +bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { - int error; + struct bounce_zone *bz; + int error, maxpages, pages; error = 0; if (dmat->segments == NULL) { dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - M_NOWAIT); + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -408,12 +279,8 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->flags & BUS_DMA_COULD_BOUNCE) { - + if (dmat->common.flags & BUS_DMA_COULD_BOUNCE) { /* Must bounce */ - struct bounce_zone *bz; - int maxpages; - if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) return (error); @@ -421,7 +288,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in bz = dmat->bounce_zone; *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT | M_ZERO); + M_NOWAIT | M_ZERO); if (*mapp == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -435,26 +302,26 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * Attempt to add pages to our pool on a per-instance * basis up to a sane limit. */ - if (dmat->alignment > 1) + if (dmat->common.alignment > 1) maxpages = MAX_BPAGES; else - maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); - if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (bz->map_count > 0 && bz->total_bpages < maxpages)) { - int pages; - - pages = MAX(atop(dmat->maxsize), 1); + maxpages = MIN(MAX_BPAGES, Maxmem - + atop(dmat->common.lowaddr)); + if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + (bz->map_count > 0 && bz->total_bpages < maxpages)) { + pages = MAX(atop(dmat->common.maxsize), 1); pages = MIN(maxpages - bz->total_bpages, pages); pages = MAX(pages, 1); if (alloc_bounce_pages(dmat, pages) < pages) error = ENOMEM; - - if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { - if (error == 0) - dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; - } else { + if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) + == 0) { + if (error == 0) { + dmat->common.flags |= + BUS_DMA_MIN_ALLOC_COMP; + } + } else error = 0; - } } bz->map_count++; } else { @@ -463,7 +330,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in if (error == 0) dmat->map_count++; CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, error); + __func__, dmat, dmat->common.flags, error); return (error); } @@ -471,9 +338,10 @@ bus_dmamap_create(bus_dma_tag_t dmat, in * Destroy a handle for mapping from kva/uva/physical * address space into bus device space. */ -int -bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +static int +bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { + if (map != NULL && map != &nobounce_dmamap && map != &contig_dmamap) { if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", @@ -495,9 +363,9 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b * bus device space based on the constraints lited in the dma tag. * A dmamap to for use with dmamap_load is also allocated. */ -int -bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, - bus_dmamap_t *mapp) +static int +bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) { vm_memattr_t attr; int mflags; @@ -512,11 +380,11 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (dmat->segments == NULL) { dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - mflags); + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); + __func__, dmat, dmat->common.flags, ENOMEM); return (ENOMEM); } } @@ -535,33 +403,36 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi * * In the meantime, we'll warn the user if malloc gets it wrong. */ - if ((dmat->maxsize <= PAGE_SIZE) && - (dmat->alignment < dmat->maxsize) && - dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) && + if ((dmat->common.maxsize <= PAGE_SIZE) && + (dmat->common.alignment < dmat->common.maxsize) && + dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); - } else if (dmat->nsegments >= btoc(dmat->maxsize) && - dmat->alignment <= PAGE_SIZE && - (dmat->boundary == 0 || dmat->boundary >= dmat->lowaddr)) { + *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); + } else if (dmat->common.nsegments >= btoc(dmat->common.maxsize) && + dmat->common.alignment <= PAGE_SIZE && + (dmat->common.boundary == 0 || + dmat->common.boundary >= dmat->common.lowaddr)) { /* Page-based multi-segment allocations allowed */ - *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->maxsize, - mflags, 0ul, dmat->lowaddr, attr); + *vaddr = (void *)kmem_alloc_attr(kernel_arena, + dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + attr); *mapp = &contig_dmamap; } else { - *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, - mflags, 0ul, dmat->lowaddr, dmat->alignment ? - dmat->alignment : 1ul, dmat->boundary, attr); + *vaddr = (void *)kmem_alloc_contig(kernel_arena, + dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, + dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, + dmat->common.boundary, attr); *mapp = &contig_dmamap; } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); + __func__, dmat, dmat->common.flags, ENOMEM); return (ENOMEM); - } else if (vtophys(*vaddr) & (dmat->alignment - 1)) { + } else if (vtophys(*vaddr) & (dmat->common.alignment - 1)) { printf("bus_dmamem_alloc failed to align memory properly.\n"); } CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, 0); + __func__, dmat, dmat->common.flags, 0); return (0); } @@ -569,8 +440,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi * Free a piece of memory and it's allociated dmamap, that was allocated * via bus_dmamem_alloc. Make the same choice for free/contigfree. */ -void -bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +static void +bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { /* * dmamem does not need to be bounced, so the map should be @@ -582,8 +453,10 @@ bus_dmamem_free(bus_dma_tag_t dmat, void if (map == NULL) free(vaddr, M_DEVBUF); else - kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->maxsize); - CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); + kmem_free(kernel_arena, (vm_offset_t)vaddr, + dmat->common.maxsize); + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, + dmat->common.flags); } static void @@ -600,8 +473,8 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma */ curaddr = buf; while (buflen != 0) { - sgsize = MIN(buflen, dmat->maxsegsz); - if (run_filter(dmat, curaddr)) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE); map->pagesneeded++; } @@ -619,11 +492,13 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vm_offset_t vaddr; vm_offset_t vendaddr; bus_addr_t paddr; + bus_size_t sg_len; if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " - "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), - dmat->boundary, dmat->alignment); + "alignment= %d", dmat->common.lowaddr, + ptoa((vm_paddr_t)Maxmem), + dmat->common.boundary, dmat->common.alignment); CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", map, &nobounce_dmamap, map->pagesneeded); /* @@ -634,15 +509,14 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { - bus_size_t sg_len; - sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); if (pmap == kernel_pmap) paddr = pmap_kextract(vaddr); else paddr = pmap_extract(pmap, vaddr); - if (run_filter(dmat, paddr) != 0) { - sg_len = roundup2(sg_len, dmat->alignment); + if (bus_dma_run_filter(&dmat->common, paddr) != 0) { + sg_len = roundup2(sg_len, + dmat->common.alignment); map->pagesneeded++; } vaddr += sg_len; @@ -680,7 +554,7 @@ _bus_dmamap_reserve_pages(bus_dma_tag_t */ static int _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, - bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) + bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) { bus_addr_t baddr, bmask; int seg; @@ -688,9 +562,9 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b /* * Make sure we don't cross any boundaries. */ - bmask = ~(dmat->boundary - 1); - if (dmat->boundary > 0) { - baddr = (curaddr + dmat->boundary) & bmask; + bmask = ~(dmat->common.boundary - 1); + if (dmat->common.boundary > 0) { + baddr = (curaddr + dmat->common.boundary) & bmask; if (sgsize > (baddr - curaddr)) sgsize = (baddr - curaddr); } @@ -706,12 +580,12 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b segs[seg].ds_len = sgsize; } else { if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && - (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && - (dmat->boundary == 0 || + (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && + (dmat->common.boundary == 0 || (segs[seg].ds_addr & bmask) == (curaddr & bmask))) segs[seg].ds_len += sgsize; else { - if (++seg >= dmat->nsegments) + if (++seg >= dmat->common.nsegments) return (0); segs[seg].ds_addr = curaddr; segs[seg].ds_len = sgsize; @@ -725,13 +599,10 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b * Utility function to load a physical buffer. segp contains * the starting segment on entrace, and the ending segment on exit. */ -int -_bus_dmamap_load_phys(bus_dma_tag_t dmat, - bus_dmamap_t map, - vm_paddr_t buf, bus_size_t buflen, - int flags, - bus_dma_segment_t *segs, - int *segp) +static int +bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, + int *segp) { bus_size_t sgsize; bus_addr_t curaddr; @@ -743,7 +614,7 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat if (segs == NULL) segs = dmat->segments; - if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -754,12 +625,13 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat while (buflen > 0) { curaddr = buf; - sgsize = MIN(buflen, dmat->maxsegsz); - if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE); curaddr = add_bounce_page(dmat, map, 0, curaddr, - sgsize); + sgsize); } sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, segp); @@ -779,16 +651,12 @@ _bus_dmamap_load_phys(bus_dma_tag_t dmat * Utility function to load a linear buffer. segp contains * the starting segment on entrace, and the ending segment on exit. */ -int -_bus_dmamap_load_buffer(bus_dma_tag_t dmat, - bus_dmamap_t map, - void *buf, bus_size_t buflen, - pmap_t pmap, - int flags, - bus_dma_segment_t *segs, - int *segp) +static int +bounce_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, + int *segp) { - bus_size_t sgsize; + bus_size_t sgsize, max_sgsize; bus_addr_t curaddr; vm_offset_t vaddr; int error; @@ -799,7 +667,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm if (segs == NULL) segs = dmat->segments; - if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -809,10 +677,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm } vaddr = (vm_offset_t)buf; - while (buflen > 0) { - bus_size_t max_sgsize; - /* * Get the physical address for this segment. */ @@ -824,19 +689,20 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm /* * Compute the segment size, and adjust counts. */ - max_sgsize = MIN(buflen, dmat->maxsegsz); + max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); - if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && - map->pagesneeded != 0 && run_filter(dmat, curaddr)) { - sgsize = roundup2(sgsize, dmat->alignment); + if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = roundup2(sgsize, dmat->common.alignment); sgsize = MIN(sgsize, max_sgsize); curaddr = add_bounce_page(dmat, map, vaddr, curaddr, - sgsize); + sgsize); } else { sgsize = MIN(sgsize, max_sgsize); } sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, - segp); + segp); if (sgsize == 0) break; vaddr += sgsize; @@ -849,32 +715,22 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm return (buflen != 0 ? EFBIG : 0); /* XXX better return value here? */ } -int -_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, - struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, - bus_dma_segment_t *segs, int *segp) +static void +bounce_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) { - return (bus_dmamap_load_ma_triv(dmat, map, ma, tlen, ma_offs, flags, - segs, segp)); -} - -void -__bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, - struct memdesc *mem, bus_dmamap_callback_t *callback, - void *callback_arg) -{ - if (map != NULL) { - map->mem = *mem; - map->dmat = dmat; - map->callback = callback; - map->callback_arg = callback_arg; - } + if (map == NULL) + return; + map->mem = *mem; + map->dmat = dmat; + map->callback = callback; + map->callback_arg = callback_arg; } -bus_dma_segment_t * -_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, - bus_dma_segment_t *segs, int nsegs, int error) +static bus_dma_segment_t * +bounce_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) { if (segs == NULL) @@ -885,8 +741,8 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, /* * Release the mapping held by map. */ -void -_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +static void +bounce_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) { struct bounce_page *bpage; @@ -896,8 +752,9 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b } } -void -_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +static void +bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op) { struct bounce_page *bpage; @@ -908,33 +765,36 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus * the caches on broken hardware */ CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " - "performing bounce", __func__, dmat, dmat->flags, op); + "performing bounce", __func__, dmat, + dmat->common.flags, op); - if (op & BUS_DMASYNC_PREWRITE) { + if ((op & BUS_DMASYNC_PREWRITE) != 0) { while (bpage != NULL) { - if (bpage->datavaddr != 0) + if (bpage->datavaddr != 0) { bcopy((void *)bpage->datavaddr, - (void *)bpage->vaddr, - bpage->datacount); - else + (void *)bpage->vaddr, + bpage->datacount); + } else { physcopyout(bpage->dataaddr, - (void *)bpage->vaddr, - bpage->datacount); + (void *)bpage->vaddr, + bpage->datacount); + } bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; } - if (op & BUS_DMASYNC_POSTREAD) { + if ((op & BUS_DMASYNC_POSTREAD) != 0) { while (bpage != NULL) { - if (bpage->datavaddr != 0) + if (bpage->datavaddr != 0) { bcopy((void *)bpage->vaddr, - (void *)bpage->datavaddr, - bpage->datacount); - else + (void *)bpage->datavaddr, + bpage->datacount); + } else { physcopyin((void *)bpage->vaddr, - bpage->dataaddr, - bpage->datacount); + bpage->dataaddr, + bpage->datacount); + } bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; @@ -980,8 +840,8 @@ alloc_bounce_zone(bus_dma_tag_t dmat) /* Check to see if we already have a suitable zone */ STAILQ_FOREACH(bz, &bounce_zone_list, links) { - if ((dmat->alignment <= bz->alignment) - && (dmat->lowaddr >= bz->lowaddr)) { + if ((dmat->common.alignment <= bz->alignment) && + (dmat->common.lowaddr >= bz->lowaddr)) { dmat->bounce_zone = bz; return (0); } @@ -995,8 +855,8 @@ alloc_bounce_zone(bus_dma_tag_t dmat) bz->free_bpages = 0; bz->reserved_bpages = 0; bz->active_bpages = 0; - bz->lowaddr = dmat->lowaddr; - bz->alignment = MAX(dmat->alignment, PAGE_SIZE); + bz->lowaddr = dmat->common.lowaddr; + bz->alignment = MAX(dmat->common.alignment, PAGE_SIZE); bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; @@ -1134,7 +994,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ bz->active_bpages++; mtx_unlock(&bounce_lock); - if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { /* Page offset needs to be preserved. */ bpage->vaddr |= vaddr & PAGE_MASK; bpage->busaddr |= vaddr & PAGE_MASK; @@ -1155,7 +1015,7 @@ free_bounce_page(bus_dma_tag_t dmat, str bz = dmat->bounce_zone; bpage->datavaddr = 0; bpage->datacount = 0; - if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) { /* * Reset the bounce page to start at offset 0. Other uses * of this bounce page may need to store a full page of @@ -1173,7 +1033,7 @@ free_bounce_page(bus_dma_tag_t dmat, str if (reserve_bounce_pages(map->dmat, map, 1) == 0) { STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links); STAILQ_INSERT_TAIL(&bounce_map_callbacklist, - map, links); + map, links); busdma_swi_pending = 1; bz->total_deferred++; swi_sched(vm_ih, 0); @@ -1193,12 +1053,28 @@ busdma_swi(void) STAILQ_REMOVE_HEAD(&bounce_map_callbacklist, links); mtx_unlock(&bounce_lock); dmat = map->dmat; - (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_LOCK); + (dmat->common.lockfunc)(dmat->common.lockfuncarg, BUS_DMA_LOCK); bus_dmamap_load_mem(map->dmat, map, &map->mem, - map->callback, map->callback_arg, - BUS_DMA_WAITOK); - (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_UNLOCK); + map->callback, map->callback_arg, BUS_DMA_WAITOK); + (dmat->common.lockfunc)(dmat->common.lockfuncarg, + BUS_DMA_UNLOCK); mtx_lock(&bounce_lock); } mtx_unlock(&bounce_lock); } + +struct bus_dma_impl bus_dma_bounce_impl = { + .tag_create = bounce_bus_dma_tag_create, + .tag_destroy = bounce_bus_dma_tag_destroy, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 22:08:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ECDF7174; Sun, 27 Oct 2013 22:08:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC84A2077; Sun, 27 Oct 2013 22:08:01 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 796B03592F2; Sun, 27 Oct 2013 23:07:59 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 4CD12CB4E; Sun, 27 Oct 2013 23:07:59 +0100 (CET) Date: Sun, 27 Oct 2013 23:07:58 +0100 From: Jilles Tjoelker To: Bruce Evans Subject: Re: svn commit: r257203 - head/sys/arm/arm Message-ID: <20131027220758.GA12425@stack.nl> References: <201310270329.r9R3Tcoi076809@svn.freebsd.org> <20131028040222.G929@besplex.bde.org> <1382900401.1170.227.camel@revolution.hippie.lan> <20131028081925.C2294@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131028081925.C2294@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 22:08:02 -0000 On Mon, Oct 28, 2013 at 08:43:37AM +1100, Bruce Evans wrote: > On Sun, 27 Oct 2013, Ian Lepore wrote: > >On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote: > >>On Sun, 27 Oct 2013, Ian Lepore wrote: > >> > >>>Log: > >>> Eliminate a compiler warning about extraneous parens. > >> > >>Wow, what flags give these warnings? > >--- busdma_machdep.o --- > >/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] > > if ((map->pagesneeded == 0)) { > > ~~~~~~~~~~~~~~~~~^~~~ > Ahh. I guess what I really want is -Wredundant-parentheses > -Wredundant-braces ... The parser can easily tell what is redundant > than what is bogus since bogusness depends on style and too many > suboptions would be required to specify styles > (-Wparentheses[-operator][-context]. > Oops, the parser easily can't do this right because macro parameters > must usually have redundant parentheses and C parsers are specified > to act as if on the output of the preprocessor so they can't easily > either have a special case to ignore these redundant parentheses or > know that they aren't in the unpreprocessed source so they should be > ignored. > >/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: remove extraneous parentheses around the comparison to silence this warning > > if ((map->pagesneeded == 0)) { > > ~ ^ ~ > >/local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: use '=' to turn this equality comparison into an assignment > > if ((map->pagesneeded == 0)) { > > ^~ > > = > >That's what the compiler had to say about it. I guess in somebody's > >mind if it's a probable error to have done > >... > This expression could be the result of a macro > #define ISZERO(x) ((x) == 0) > which for if (ISZERO(map->pagesneeded)) expands to almost the above. I > guess clang warns excessively about this. Clang takes advantage of its internal preprocessor to suppress certain warnings in results of macro expansion. In fact, this is what makes -Wparentheses-equality possible at all. It does not violate the C standard, since it is only used to decide whether to issue certain warnings and does not affect the semantics of the code. This check breaks down when the internal preprocessor is not used, such as with ccache. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 22:15:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0EF30553; Sun, 27 Oct 2013 22:15:51 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F09DE2103; Sun, 27 Oct 2013 22:15:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RMFo0O056488; Sun, 27 Oct 2013 22:15:50 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RMFoNx056487; Sun, 27 Oct 2013 22:15:50 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310272215.r9RMFoNx056487@svn.freebsd.org> From: Olivier Houchard Date: Sun, 27 Oct 2013 22:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257231 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 22:15:51 -0000 Author: cognet Date: Sun Oct 27 22:15:50 2013 New Revision: 257231 URL: http://svnweb.freebsd.org/changeset/base/257231 Log: Make sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it, which may have strong alignment requirements. Modified: head/sys/arm/include/pcb.h Modified: head/sys/arm/include/pcb.h ============================================================================== --- head/sys/arm/include/pcb.h Sun Oct 27 22:05:10 2013 (r257230) +++ head/sys/arm/include/pcb.h Sun Oct 27 22:15:50 2013 (r257231) @@ -81,7 +81,11 @@ struct pcb { struct pcb_arm32 un_32; struct vfp_state pcb_vfpstate; /* VP/NEON state */ u_int pcb_vfpcpu; /* VP/NEON last cpu */ -}; +} __aligned(8); /* + * We need the PCB to be aligned on 8 bytes, as we may + * access it using ldrd/strd, and some CPUs require it + * to by aligned on 8 bytes. + */ /* * No additional data for core dumps. From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 22:18:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 32275742; Sun, 27 Oct 2013 22:18:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 057552121; Sun, 27 Oct 2013 22:18:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RMIRH5056807; Sun, 27 Oct 2013 22:18:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RMIRV4056803; Sun, 27 Oct 2013 22:18:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310272218.r9RMIRV4056803@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 27 Oct 2013 22:18:27 +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: r257232 - stable/9/tools/regression/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 22:18:28 -0000 Author: jilles Date: Sun Oct 27 22:18:27 2013 New Revision: 257232 URL: http://svnweb.freebsd.org/changeset/base/257232 Log: MFC r255301: libc/stdio: Provide proper TAP output for fmemopen/ open_memstream/open_wmemstream. A *.t file should provide Test Anything Protocol output so that it can be run using the Perl "prove" tool. Modified: stable/9/tools/regression/lib/libc/stdio/test-fmemopen.t stable/9/tools/regression/lib/libc/stdio/test-open_memstream.t stable/9/tools/regression/lib/libc/stdio/test-open_wmemstream.t Directory Properties: stable/9/tools/regression/lib/libc/ (props changed) Modified: stable/9/tools/regression/lib/libc/stdio/test-fmemopen.t ============================================================================== --- stable/9/tools/regression/lib/libc/stdio/test-fmemopen.t Sun Oct 27 22:15:50 2013 (r257231) +++ stable/9/tools/regression/lib/libc/stdio/test-fmemopen.t Sun Oct 27 22:18:27 2013 (r257232) @@ -7,4 +7,9 @@ executable=`basename $0 .t` make $executable 2>&1 > /dev/null -exec ./$executable +echo 1..1 +if ./$executable; then + echo ok 1 - $executable successful +else + echo not ok 1 - $executable failed +fi Modified: stable/9/tools/regression/lib/libc/stdio/test-open_memstream.t ============================================================================== --- stable/9/tools/regression/lib/libc/stdio/test-open_memstream.t Sun Oct 27 22:15:50 2013 (r257231) +++ stable/9/tools/regression/lib/libc/stdio/test-open_memstream.t Sun Oct 27 22:18:27 2013 (r257232) @@ -7,4 +7,9 @@ executable=`basename $0 .t` make $executable 2>&1 > /dev/null -exec ./$executable +echo 1..1 +if ./$executable; then + echo ok 1 - $executable successful +else + echo not ok 1 - $executable failed +fi Modified: stable/9/tools/regression/lib/libc/stdio/test-open_wmemstream.t ============================================================================== --- stable/9/tools/regression/lib/libc/stdio/test-open_wmemstream.t Sun Oct 27 22:15:50 2013 (r257231) +++ stable/9/tools/regression/lib/libc/stdio/test-open_wmemstream.t Sun Oct 27 22:18:27 2013 (r257232) @@ -7,4 +7,9 @@ executable=`basename $0 .t` make $executable 2>&1 > /dev/null -exec ./$executable +echo 1..1 +if ./$executable; then + echo ok 1 - $executable successful +else + echo not ok 1 - $executable failed +fi From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 23:48:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9AAFDBBA; Sun, 27 Oct 2013 23:48:59 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8862E2508; Sun, 27 Oct 2013 23:48:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9RNmxbT086869; Sun, 27 Oct 2013 23:48:59 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9RNmxU5086868; Sun, 27 Oct 2013 23:48:59 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310272348.r9RNmxU5086868@svn.freebsd.org> From: Olivier Houchard Date: Sun, 27 Oct 2013 23:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257233 - head/lib/csu/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 27 Oct 2013 23:48:59 -0000 Author: cognet Date: Sun Oct 27 23:48:59 2013 New Revision: 257233 URL: http://svnweb.freebsd.org/changeset/base/257233 Log: Use the size of the MACHINE_ARCH string instead of sizeof(uint32_t). It can happen sizeof(MACHINE_ARCH) is more than 4 bytes, and bad things would happen. This should make the ctors being called again on armeb. Modified: head/lib/csu/arm/crt1.c Modified: head/lib/csu/arm/crt1.c ============================================================================== --- head/lib/csu/arm/crt1.c Sun Oct 27 22:18:27 2013 (r257232) +++ head/lib/csu/arm/crt1.c Sun Oct 27 23:48:59 2013 (r257233) @@ -123,7 +123,7 @@ static const struct { char desc[sizeof(MACHINE_ARCH)]; } archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = { .namesz = sizeof(NOTE_FREEBSD_VENDOR), - .descsz = sizeof(int32_t), + .descsz = sizeof(MACHINE_ARCH), .type = ARCH_NOTETYPE, .name = NOTE_FREEBSD_VENDOR, .desc = MACHINE_ARCH From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 00:20:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D41EA1A3; Mon, 28 Oct 2013 00:20:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0B2A2655; Mon, 28 Oct 2013 00:20:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S0KULX098356; Mon, 28 Oct 2013 00:20:30 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S0KUYQ098355; Mon, 28 Oct 2013 00:20:30 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310280020.r9S0KUYQ098355@svn.freebsd.org> From: Mark Johnston Date: Mon, 28 Oct 2013 00:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257234 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 00:20:30 -0000 Author: markj Date: Mon Oct 28 00:20:30 2013 New Revision: 257234 URL: http://svnweb.freebsd.org/changeset/base/257234 Log: With r247602, the "c" flag is no longer printed as a file descriptor flag. Reviewed by: pjd MFC after: 3 days Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sun Oct 27 23:48:59 2013 (r257233) +++ head/usr.bin/procstat/procstat.1 Mon Oct 28 00:20:30 2013 (r257234) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2013 +.Dd October 27, 2013 .Dt PROCSTAT 1 .Os .Sh NAME @@ -225,8 +225,6 @@ non-blocking direct I/O .It l lock held -.It c -descriptor is a capability .El .Pp If the From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 01:42:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A08D10C; Mon, 28 Oct 2013 01:42:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 65C50295F; Mon, 28 Oct 2013 01:42:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S1g0SG027210; Mon, 28 Oct 2013 01:42:00 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S1g0C7027209; Mon, 28 Oct 2013 01:42:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310280142.r9S1g0C7027209@svn.freebsd.org> From: Mark Johnston Date: Mon, 28 Oct 2013 01:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257235 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 01:42:00 -0000 Author: markj Date: Mon Oct 28 01:41:59 2013 New Revision: 257235 URL: http://svnweb.freebsd.org/changeset/base/257235 Log: Remove an incorrect debug printf. Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Mon Oct 28 00:20:30 2013 (r257234) +++ head/lib/libproc/proc_sym.c Mon Oct 28 01:41:59 2013 (r257235) @@ -460,7 +460,6 @@ proc_name2sym(struct proc_handle *p, con * Then look up the string name in STRTAB (.dynstr) */ if ((data = elf_getdata(dynsymscn, NULL))) { - DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); i = 0; while (gelf_getsym(data, i++, &sym) != NULL) { s = elf_strptr(e, dynsymstridx, sym.st_name); From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 02:36:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CC8F6756; Mon, 28 Oct 2013 02:36:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA8952B54; Mon, 28 Oct 2013 02:36:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S2aY6j044681; Mon, 28 Oct 2013 02:36:34 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S2aYlI044680; Mon, 28 Oct 2013 02:36:34 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310280236.r9S2aYlI044680@svn.freebsd.org> From: Sean Bruno Date: Mon, 28 Oct 2013 02:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257236 - head/sys/dev/lmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 02:36:34 -0000 Author: sbruno Date: Mon Oct 28 02:36:34 2013 New Revision: 257236 URL: http://svnweb.freebsd.org/changeset/base/257236 Log: Quiesce warning -Wmissing-variable-declarations from buildworld, which is slightly unnerving. In file included from ioctl.c:48: /var/tmp/home/sbruno/bsd/head/tmp/usr/include/dev/lmc/if_lmc.h:939:13: warning: no previous extern declaration for non-static variable 'ssi_cables' [-Wmissing-variable-declarations] const char *ssi_cables[] = Modified: head/sys/dev/lmc/if_lmc.h Modified: head/sys/dev/lmc/if_lmc.h ============================================================================== --- head/sys/dev/lmc/if_lmc.h Mon Oct 28 01:41:59 2013 (r257235) +++ head/sys/dev/lmc/if_lmc.h Mon Oct 28 02:36:34 2013 (r257236) @@ -936,7 +936,7 @@ struct ioctl #define IOCTL_RESET_CNTRS 54 /* reset event counters */ /* storage for these strings is allocated here! */ -const char *ssi_cables[] = +static const char *ssi_cables[] = { "V.10/EIA423", "V.11/EIA530A", From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 05:55:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5905BEA; Mon, 28 Oct 2013 05:55:47 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B521723DA; Mon, 28 Oct 2013 05:55:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S5tl1A026818; Mon, 28 Oct 2013 05:55:47 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S5tlTs026817; Mon, 28 Oct 2013 05:55:47 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201310280555.r9S5tlTs026817@svn.freebsd.org> From: Eygene Ryabinkin Date: Mon, 28 Oct 2013 05:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257239 - head/gnu/usr.bin/binutils/ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 05:55:48 -0000 Author: rea (ports committer) Date: Mon Oct 28 05:55:47 2013 New Revision: 257239 URL: http://svnweb.freebsd.org/changeset/base/257239 Log: Correct ld(1) manual page for --no-add-needed set as default after r253839 Approved by: dim MFC after: 2 weeks Modified: head/gnu/usr.bin/binutils/ld/ld.1 Modified: head/gnu/usr.bin/binutils/ld/ld.1 ============================================================================== --- head/gnu/usr.bin/binutils/ld/ld.1 Mon Oct 28 04:41:49 2013 (r257238) +++ head/gnu/usr.bin/binutils/ld/ld.1 Mon Oct 28 05:55:47 2013 (r257239) @@ -929,20 +929,6 @@ the default behaviour of the linker, bef behaviour from release 2.14 onwards is to reject such input files, and so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to restore the old behaviour. -.IP "\fB\-\-as\-needed\fR" 4 -.IX Item "--as-needed" -.PD 0 -.IP "\fB\-\-no\-as\-needed\fR" 4 -.IX Item "--no-as-needed" -.PD -This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic libraries mentioned -on the command line after the \fB\-\-as\-needed\fR option. Normally, -the linker will add a \s-1DT_NEEDED\s0 tag for each dynamic library mentioned -on the command line, regardless of whether the library is actually -needed. \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags to only be emitted -for libraries that satisfy some symbol reference from regular objects -which is undefined at the point that the library was linked. -\&\fB\-\-no\-as\-needed\fR restores the default behaviour. .IP "\fB\-\-add\-needed\fR" 4 .IX Item "--add-needed" .PD 0 @@ -951,11 +937,25 @@ which is undefined at the point that the .PD This option affects the treatment of dynamic libraries from \s-1ELF\s0 \&\s-1DT_NEEDED\s0 tags in dynamic libraries mentioned on the command line after -the \fB\-\-no\-add\-needed\fR option. Normally, the linker will add -a \s-1DT_NEEDED\s0 tag for each dynamic library from \s-1DT_NEEDED\s0 tags. -\&\fB\-\-no\-add\-needed\fR causes \s-1DT_NEEDED\s0 tags will never be emitted -for those libraries from \s-1DT_NEEDED\s0 tags. \fB\-\-add\-needed\fR restores -the default behaviour. +the \fB\-\-add\-needed\fR option. Normally, the linker will not copy +a \s-1DT_NEEDED\s0 tags from each dynamic library to the produced output object. +\&\fB\-\-add\-needed\fR makes linker to copy \s-1DT_NEEDED\s0 tags from all +dynamic libraries mentioned after this flag. +\fB\-\-no\-add\-needed\fR restores the default behaviour. +.IP "\fB\-\-as\-needed\fR" 4 +.IX Item "--as-needed" +.PD 0 +.IP "\fB\-\-no\-as\-needed\fR" 4 +.IX Item "--no-as-needed" +.PD +This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic +libraries mentioned on the command line after the \fB\-\-as\-needed\fR +option when \fB\-\-add\-needed\fR is in effect. +In such a case \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags +to only be emitted for libraries that satisfy some symbol reference +from regular objects which is undefined at the point that the library +was linked. +\&\fB\-\-no\-as\-needed\fR restores the default behaviour. .IP "\fB\-assert\fR \fIkeyword\fR" 4 .IX Item "-assert keyword" This option is ignored for SunOS compatibility. From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 07:18:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F0B7C75; Mon, 28 Oct 2013 07:18:25 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8F0272E; Mon, 28 Oct 2013 07:18:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S7IPmP037823; Mon, 28 Oct 2013 07:18:25 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S7IP20037819; Mon, 28 Oct 2013 07:18:25 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310280718.r9S7IP20037819@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 07:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257240 - in head/sys: arm/conf dev/mvs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 07:18:25 -0000 Author: zbb Date: Mon Oct 28 07:18:24 2013 New Revision: 257240 URL: http://svnweb.freebsd.org/changeset/base/257240 Log: Run mvs SATA driver on Armada XP instead of old mv_sata The mvs driver seems to be more functional than mv_sata and is not causing random interrupt storms during boot. Modified: head/sys/arm/conf/ARMADAXP head/sys/dev/mvs/mvs_soc.c Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Mon Oct 28 05:55:47 2013 (r257239) +++ head/sys/arm/conf/ARMADAXP Mon Oct 28 07:18:24 2013 (r257240) @@ -76,8 +76,7 @@ device pass device da # SATA -device ata -#device mvs +device mvs # Serial ports device uart Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Mon Oct 28 05:55:47 2013 (r257239) +++ head/sys/dev/mvs/mvs_soc.c Mon Oct 28 07:18:24 2013 (r257240) @@ -66,6 +66,8 @@ static struct { {MV_DEV_88F6282, 0x00, "Marvell 88F6282", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100, 0x00, "Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100_Z0, 0x00,"Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, + {MV_DEV_MV78260, 0x00, "Marvell MV78260", 2, MVS_Q_GENIIE|MVS_Q_SOC}, + {MV_DEV_MV78460, 0x00, "Marvell MV78460", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {0, 0x00, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 07:29:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F344133; Mon, 28 Oct 2013 07:29:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD9027C1; Mon, 28 Oct 2013 07:29:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S7TQcE044421; Mon, 28 Oct 2013 07:29:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S7TG9d044368; Mon, 28 Oct 2013 07:29:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310280729.r9S7TG9d044368@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 07:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257241 - in head/sys: compat/ndis dev/ath dev/bwi dev/cxgb dev/cxgb/ulp/tom dev/cxgbe dev/cxgbe/common dev/cxgbe/tom dev/hyperv/netvsc dev/if_ndis dev/malo dev/oce dev/qlxgb dev/qlxgbe... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 07:29:26 -0000 Author: glebius Date: Mon Oct 28 07:29:16 2013 New Revision: 257241 URL: http://svnweb.freebsd.org/changeset/base/257241 Log: Include necessary headers that now are available due to pollution via if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/compat/ndis/subr_usbd.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/bwi/if_bwi_pci.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgb/ulp/tom/cxgb_listen.c head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/t4_tracer.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/if_ndis/if_ndis_pci.c head/sys/dev/malo/if_malo_pci.c head/sys/dev/malo/if_malohal.c head/sys/dev/oce/oce_if.h head/sys/dev/qlxgb/qla_os.h head/sys/dev/qlxgbe/ql_os.h head/sys/dev/qlxge/qls_os.h head/sys/dev/siba/siba_bwn.c head/sys/dev/siba/siba_core.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_smsc.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/net/ieee8023ad_lacp.c head/sys/net/if_bridge.c head/sys/net/if_clone.c head/sys/net/if_vlan.c head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_dfs.c head/sys/net80211/ieee80211_radiotap.c head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_rssadapt.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_fec.c head/sys/netinet/in.c head/sys/netinet/ip_divert.c head/sys/netinet/siftr.c head/sys/netinet/toecore.c head/sys/netinet6/in6.c head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/compat/ndis/subr_usbd.c Mon Oct 28 07:29:16 2013 (r257241) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/ath/if_ath_pci.c Mon Oct 28 07:29:16 2013 (r257241) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/dev/bwi/if_bwi_pci.c ============================================================================== --- head/sys/dev/bwi/if_bwi_pci.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/bwi/if_bwi_pci.c Mon Oct 28 07:29:16 2013 (r257241) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgb/cxgb_sge.c Mon Oct 28 07:29:16 2013 (r257241) @@ -56,9 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include -#include #include #include Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Mon Oct 28 07:29:16 2013 (r257241) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Mon Oct 28 07:29:16 2013 (r257241) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Oct 28 07:29:16 2013 (r257241) @@ -29,6 +29,9 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include +#include + #include "common.h" #include "t4_regs.h" #include "t4_regs_values.h" Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgbe/t4_l2t.c Mon Oct 28 07:29:16 2013 (r257241) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 28 07:29:16 2013 (r257241) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include Modified: head/sys/dev/cxgbe/t4_tracer.c ============================================================================== --- head/sys/dev/cxgbe/t4_tracer.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgbe/t4_tracer.c Mon Oct 28 07:29:16 2013 (r257241) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/cxgbe/tom/t4_tom.c Mon Oct 28 07:29:16 2013 (r257241) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Oct 28 07:29:16 2013 (r257241) @@ -24,6 +24,8 @@ * 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$ */ /** @@ -37,6 +39,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Oct 28 07:29:16 2013 (r257241) @@ -75,9 +75,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Mon Oct 28 07:29:16 2013 (r257241) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/if_ndis/if_ndis_pci.c Mon Oct 28 07:29:16 2013 (r257241) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/malo/if_malo_pci.c ============================================================================== --- head/sys/dev/malo/if_malo_pci.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/malo/if_malo_pci.c Mon Oct 28 07:29:16 2013 (r257241) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/dev/malo/if_malohal.c ============================================================================== --- head/sys/dev/malo/if_malohal.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/malo/if_malohal.c Mon Oct 28 07:29:16 2013 (r257241) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/oce/oce_if.h Mon Oct 28 07:29:16 2013 (r257241) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include Modified: head/sys/dev/qlxgb/qla_os.h ============================================================================== --- head/sys/dev/qlxgb/qla_os.h Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/qlxgb/qla_os.h Mon Oct 28 07:29:16 2013 (r257241) @@ -52,6 +52,7 @@ #endif #include +#include #include #include #include Modified: head/sys/dev/qlxgbe/ql_os.h ============================================================================== --- head/sys/dev/qlxgbe/ql_os.h Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/qlxgbe/ql_os.h Mon Oct 28 07:29:16 2013 (r257241) @@ -53,6 +53,7 @@ #endif #include +#include #include #include #include Modified: head/sys/dev/qlxge/qls_os.h ============================================================================== --- head/sys/dev/qlxge/qls_os.h Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/qlxge/qls_os.h Mon Oct 28 07:29:16 2013 (r257241) @@ -53,6 +53,7 @@ #endif #include +#include #include #include #include Modified: head/sys/dev/siba/siba_bwn.c ============================================================================== --- head/sys/dev/siba/siba_bwn.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/siba/siba_bwn.c Mon Oct 28 07:29:16 2013 (r257241) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/siba/siba_core.c Mon Oct 28 07:29:16 2013 (r257241) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/usb/net/if_ipheth.c Mon Oct 28 07:29:16 2013 (r257241) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,6 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include #include Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/usb/net/if_smsc.c Mon Oct 28 07:29:16 2013 (r257241) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -82,6 +83,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "opt_platform.h" #ifdef FDT Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Oct 28 07:29:16 2013 (r257241) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Oct 28 07:29:16 2013 (r257241) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net/ieee8023ad_lacp.c Mon Oct 28 07:29:16 2013 (r257241) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net/if_bridge.c Mon Oct 28 07:29:16 2013 (r257241) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net/if_clone.c Mon Oct 28 07:29:16 2013 (r257241) @@ -32,6 +32,7 @@ */ #include +#include #include #include #include Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net/if_vlan.c Mon Oct 28 07:29:16 2013 (r257241) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vlan.h" #include +#include #include #include #include Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net80211/ieee80211_amrr.c Mon Oct 28 07:29:16 2013 (r257241) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET #include Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net80211/ieee80211_dfs.c Mon Oct 28 07:29:16 2013 (r257241) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net80211/ieee80211_radiotap.c Mon Oct 28 07:29:16 2013 (r257241) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net80211/ieee80211_regdomain.c Mon Oct 28 07:29:16 2013 (r257241) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- head/sys/net80211/ieee80211_rssadapt.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/net80211/ieee80211_rssadapt.c Mon Oct 28 07:29:16 2013 (r257241) @@ -33,13 +33,17 @@ #include "opt_wlan.h" #include +#include #include +#include #include #include #include #include +#include #include +#include #include #include Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netgraph/ng_eiface.c Mon Oct 28 07:29:16 2013 (r257241) @@ -29,6 +29,7 @@ */ #include +#include #include #include #include Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netgraph/ng_ether.c Mon Oct 28 07:29:16 2013 (r257241) @@ -47,6 +47,7 @@ */ #include +#include #include #include #include Modified: head/sys/netgraph/ng_fec.c ============================================================================== --- head/sys/netgraph/ng_fec.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netgraph/ng_fec.c Mon Oct 28 07:29:16 2013 (r257241) @@ -89,6 +89,7 @@ */ #include +#include #include #include #include Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netinet/in.c Mon Oct 28 07:29:16 2013 (r257241) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mpath.h" #include +#include #include #include #include Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netinet/ip_divert.c Mon Oct 28 07:29:16 2013 (r257241) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #include #include Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netinet/siftr.c Mon Oct 28 07:29:16 2013 (r257241) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netinet/toecore.c Mon Oct 28 07:29:16 2013 (r257241) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netinet6/in6.c Mon Oct 28 07:29:16 2013 (r257241) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Mon Oct 28 07:18:24 2013 (r257240) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Mon Oct 28 07:29:16 2013 (r257241) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 07:45:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDA354E3; Mon, 28 Oct 2013 07:45:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B17DA28AC; Mon, 28 Oct 2013 07:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S7j4Gf050444; Mon, 28 Oct 2013 07:45:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S7j4XX050440; Mon, 28 Oct 2013 07:45:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310280745.r9S7j4XX050440@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 07:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257242 - in head/sys: net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 07:45:04 -0000 Author: glebius Date: Mon Oct 28 07:45:03 2013 New Revision: 257242 URL: http://svnweb.freebsd.org/changeset/base/257242 Log: Instead of putting ifnet declaration into eventhandler.h, move bpf(4) and vlan(4) related event declarations to bpf.h and if_vlan_var.h. To avoid dependency on eventhandler.h, protect these declarations with ifdef SYS_EVENTHANDLER_H. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/bpf.h head/sys/net/if_vlan_var.h head/sys/sys/eventhandler.h Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon Oct 28 07:29:16 2013 (r257241) +++ head/sys/net/bpf.h Mon Oct 28 07:45:03 2013 (r257242) @@ -1310,4 +1310,12 @@ bpf_peers_present(struct bpf_if *bpf) */ #define BPF_MEMWORDS 16 +#ifdef SYS_EVENTHANDLER_H +/* BPF attach/detach events */ +struct ifnet; +typedef void (*bpf_track_fn)(void *, struct ifnet *, int /* dlt */, + int /* 1 =>'s attach */); +EVENTHANDLER_DECLARE(bpf_track, bpf_track_fn); +#endif /* SYS_EVENTHANDLER_H */ + #endif /* _NET_BPF_H_ */ Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Mon Oct 28 07:29:16 2013 (r257241) +++ head/sys/net/if_vlan_var.h Mon Oct 28 07:45:03 2013 (r257242) @@ -150,6 +150,14 @@ extern int (*vlan_tag_p)(struct ifnet *, extern int (*vlan_setcookie_p)(struct ifnet *, void *); extern void *(*vlan_cookie_p)(struct ifnet *); +#ifdef SYS_EVENTHANDLER_H +/* VLAN state change events */ +typedef void (*vlan_config_fn)(void *, struct ifnet *, uint16_t); +typedef void (*vlan_unconfig_fn)(void *, struct ifnet *, uint16_t); +EVENTHANDLER_DECLARE(vlan_config, vlan_config_fn); +EVENTHANDLER_DECLARE(vlan_unconfig, vlan_unconfig_fn); +#endif /* SYS_EVENTHANDLER_H */ + #endif /* _KERNEL */ #endif /* _NET_IF_VLAN_VAR_H_ */ Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Mon Oct 28 07:29:16 2013 (r257241) +++ head/sys/sys/eventhandler.h Mon Oct 28 07:45:03 2013 (r257242) @@ -203,19 +203,6 @@ typedef void (*vfs_unmounted_notify_fn)( EVENTHANDLER_DECLARE(vfs_mounted, vfs_mounted_notify_fn); EVENTHANDLER_DECLARE(vfs_unmounted, vfs_unmounted_notify_fn); -/* VLAN state change events */ -struct ifnet; -typedef void (*vlan_config_fn)(void *, struct ifnet *, uint16_t); -typedef void (*vlan_unconfig_fn)(void *, struct ifnet *, uint16_t); -EVENTHANDLER_DECLARE(vlan_config, vlan_config_fn); -EVENTHANDLER_DECLARE(vlan_unconfig, vlan_unconfig_fn); - -/* BPF attach/detach events */ -struct ifnet; -typedef void (*bpf_track_fn)(void *, struct ifnet *, int /* dlt */, - int /* 1 =>'s attach */); -EVENTHANDLER_DECLARE(bpf_track, bpf_track_fn); - /* * Process events * process_fork and exit handlers are called without Giant. From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 08:03:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DD578B39; Mon, 28 Oct 2013 08:03:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9E8A29CB; Mon, 28 Oct 2013 08:03:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9S83eKP056998; Mon, 28 Oct 2013 08:03:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9S83eOe056996; Mon, 28 Oct 2013 08:03:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310280803.r9S83eOe056996@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 08:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257244 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 08:03:41 -0000 Author: glebius Date: Mon Oct 28 08:03:40 2013 New Revision: 257244 URL: http://svnweb.freebsd.org/changeset/base/257244 Log: - Make the prophecy from 1997 happen and remove if_var.h inclusion from if.h. - Remove unnecessary includes and declarations from if.h - Remove unnecessary includes and declarations from if_var.h [1] - Mark some declarations that are about to be removed in near future with comments, explaning why this declaration is still necessary. - Protect eventhandler declarations with #ifdef SYS_EVENTHANDLER_H. Obtained from: bdeBSD [1] Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.h head/sys/net/if_var.h Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Mon Oct 28 07:47:52 2013 (r257243) +++ head/sys/net/if.h Mon Oct 28 08:03:40 2013 (r257244) @@ -35,10 +35,6 @@ #include -#ifdef _KERNEL -#include -#endif - #if __BSD_VISIBLE /* * does not depend on on most other systems. This @@ -49,8 +45,6 @@ #include #include #endif - -struct ifnet; #endif /* @@ -537,10 +531,4 @@ struct if_nameindex *if_nameindex(void); unsigned int if_nametoindex(const char *); __END_DECLS #endif - -#ifdef _KERNEL -/* XXX - this should go away soon. */ -#include -#endif - #endif /* !_NET_IF_H_ */ Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Oct 28 07:47:52 2013 (r257243) +++ head/sys/net/if_var.h Mon Oct 28 08:03:40 2013 (r257244) @@ -58,38 +58,26 @@ * interfaces. These routines live in the files if.c and route.c */ -#ifdef __STDC__ -/* - * Forward structure declarations for function prototypes [sic]. - */ -struct mbuf; -struct thread; -struct rtentry; -struct rt_addrinfo; +struct rtentry; /* ifa_rtrequest */ +struct rt_addrinfo; /* ifa_rtrequest */ struct socket; -struct ether_header; struct carp_if; struct carp_softc; struct ifvlantrunk; -struct route; +struct route; /* if_output */ struct vnet; -#endif - -#include /* get TAILQ macros */ #ifdef _KERNEL -#include -#include +#include /* ifqueue only? */ #include #include #endif /* _KERNEL */ #include #include /* XXX */ -#include /* XXX */ +#include /* struct ifqueue */ #include /* XXX */ #include /* XXX */ -#include /* XXX */ -#include +#include /* if_link_task */ #define IF_DUNIT_NONE -1 @@ -220,8 +208,6 @@ struct ifnet { void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; -typedef void if_init_f_t(void *); - /* * XXX These aliases are terribly dangerous because they could apply * to anything. @@ -367,6 +353,7 @@ void if_maddr_runlock(struct ifnet *ifp) } while(0) #ifdef _KERNEL +#ifdef SYS_EVENTHANDLER_H /* interface link layer address change event */ typedef void (*iflladdr_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(iflladdr_event, iflladdr_event_handler_t); @@ -382,6 +369,7 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); +#endif /* SYS_EVENTHANDLER_H */ /* * interface groups @@ -404,6 +392,7 @@ struct ifg_list { TAILQ_ENTRY(ifg_list) ifgl_next; }; +#ifdef SYS_EVENTHANDLER_H /* group attach event */ typedef void (*group_attach_event_handler_t)(void *, struct ifg_group *); EVENTHANDLER_DECLARE(group_attach_event, group_attach_event_handler_t); @@ -413,6 +402,7 @@ EVENTHANDLER_DECLARE(group_detach_event, /* group change event */ typedef void (*group_change_event_handler_t)(void *, const char *); EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t); +#endif /* SYS_EVENTHANDLER_H */ #define IF_AFDATA_LOCK_INIT(ifp) \ rw_init(&(ifp)->if_afdata_lock, "if_afdata") From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 10:12:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B99B2909; Mon, 28 Oct 2013 10:12:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6F9F20F4; Mon, 28 Oct 2013 10:12:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SACJJP001924; Mon, 28 Oct 2013 10:12:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SACJPF001923; Mon, 28 Oct 2013 10:12:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281012.r9SACJPF001923@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 10:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257246 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 10:12:19 -0000 Author: glebius Date: Mon Oct 28 10:12:19 2013 New Revision: 257246 URL: http://svnweb.freebsd.org/changeset/base/257246 Log: - Fix VIMAGE build. - Fix build with gcc. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Oct 28 09:43:15 2013 (r257245) +++ head/sys/netpfil/pf/pf.c Mon Oct 28 10:12:19 2013 (r257246) @@ -4554,7 +4554,7 @@ pf_icmp_state_lookup(struct pf_state_key if ((*state)->rule.ptr->type && (((*state)->direction == direction) ? PF_IN : PF_OUT) != icmp_dir) { - if (pf_status.debug >= PF_DEBUG_MISC) { + if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", icmp_dir, direction); pf_print_state(*state); @@ -4593,6 +4593,8 @@ pf_test_state_icmp(struct pf_state **sta break; #endif /* INET6 */ + default: + panic("%s: proto %d\n", __func__, pd->proto); } if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 12:42:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 143D1D5F; Mon, 28 Oct 2013 12:42:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01E0E2B97; Mon, 28 Oct 2013 12:42:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SCgRvG051341; Mon, 28 Oct 2013 12:42:27 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SCgRkU051340; Mon, 28 Oct 2013 12:42:27 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310281242.r9SCgRkU051340@svn.freebsd.org> From: Mark Johnston Date: Mon, 28 Oct 2013 12:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257248 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 12:42:28 -0000 Author: markj Date: Mon Oct 28 12:42:27 2013 New Revision: 257248 URL: http://svnweb.freebsd.org/changeset/base/257248 Log: Fix the build with gcc. Modified: head/lib/libproc/proc_util.c Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Mon Oct 28 10:32:14 2013 (r257247) +++ head/lib/libproc/proc_util.c Mon Oct 28 12:42:27 2013 (r257248) @@ -145,8 +145,9 @@ proc_wstatus(struct proc_handle *phdl) if (phdl == NULL) return (-1); if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { - if (errno != EINTR) + if (errno != EINTR) { DPRINTF("waitpid"); + } return (-1); } if (WIFSTOPPED(status)) From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 12:47:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 37631334; Mon, 28 Oct 2013 12:47:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23C4F2C08; Mon, 28 Oct 2013 12:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SCl63R051945; Mon, 28 Oct 2013 12:47:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SCl54T051943; Mon, 28 Oct 2013 12:47:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281247.r9SCl54T051943@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 12:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257249 - in head: share/man/man4 sys/modules/netgraph sys/modules/netgraph/fec sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 12:47:06 -0000 Author: glebius Date: Mon Oct 28 12:47:05 2013 New Revision: 257249 URL: http://svnweb.freebsd.org/changeset/base/257249 Log: Axe ng_fec(4). It has never been a real netgraph(4) module, since it had no hooks. It has abused ifnet's if_afdata slot and actually abused every subsystem it touched. lagg(4) is a proper trunking solution at ifnet(9) layer. ng_one2many(4) is a proper trunking solution in netgraph(4). Deleted: head/share/man/man4/ng_fec.4 head/sys/modules/netgraph/fec/ head/sys/netgraph/ng_fec.c head/sys/netgraph/ng_fec.h Modified: head/share/man/man4/Makefile head/sys/modules/netgraph/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Oct 28 12:42:27 2013 (r257248) +++ head/share/man/man4/Makefile Mon Oct 28 12:47:05 2013 (r257249) @@ -295,7 +295,6 @@ MAN= aac.4 \ ng_etf.4 \ ng_ether.4 \ ng_ether_echo.4 \ - ng_fec.4 \ ng_frame_relay.4 \ ng_gif.4 \ ng_gif_demux.4 \ Modified: head/sys/modules/netgraph/Makefile ============================================================================== --- head/sys/modules/netgraph/Makefile Mon Oct 28 12:42:27 2013 (r257248) +++ head/sys/modules/netgraph/Makefile Mon Oct 28 12:47:05 2013 (r257249) @@ -18,7 +18,6 @@ SUBDIR= async \ etf \ ether \ ether_echo \ - fec \ frame_relay \ gif \ gif_demux \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 12:49:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B205C6E6; Mon, 28 Oct 2013 12:49:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D44A2C3F; Mon, 28 Oct 2013 12:49:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SCn7VD052195; Mon, 28 Oct 2013 12:49:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SCn70Q052194; Mon, 28 Oct 2013 12:49:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281249.r9SCn70Q052194@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 12:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257250 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 12:49:07 -0000 Author: glebius Date: Mon Oct 28 12:49:07 2013 New Revision: 257250 URL: http://svnweb.freebsd.org/changeset/base/257250 Log: ng_fec(4) removed. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 28 12:47:05 2013 (r257249) +++ head/ObsoleteFiles.inc Mon Oct 28 12:49:07 2013 (r257250) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20131028: ng_fec(4) removed +OLD_FILES+=usr/include/netgraph/ng_fec.h +OLD_FILES+=usr/share/man/man4/ng_fec.4.gz # 20131023: remove never used iscsi directory OLD_DIRS+=usr/share/examples/iscsi # 20131014: libbsdyml becomes private From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 13:33:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 02C6062B; Mon, 28 Oct 2013 13:33:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2B1D2F5F; Mon, 28 Oct 2013 13:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SDXVqk069010; Mon, 28 Oct 2013 13:33:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SDXUJF068995; Mon, 28 Oct 2013 13:33:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310281333.r9SDXUJF068995@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Oct 2013 13:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257251 - in head/sys: amd64/conf conf dev/acpica i386/conf x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 13:33:32 -0000 Author: kib Date: Mon Oct 28 13:33:29 2013 New Revision: 257251 URL: http://svnweb.freebsd.org/changeset/base/257251 Log: Import the driver for VT-d DMAR hardware, as specified in the revision 1.3 of Intelб╝ Virtualization Technology for Directed I/O Architecture Specification. The Extended Context and PASIDs from the rev. 2.2 are not supported, but I am not aware of any released hardware which implements them. Code does not use queued invalidation, see comments for the reason, and does not provide interrupt remapping services. Code implements the management of the guest address space per domain and allows to establish and tear down arbitrary mappings, but not partial unmapping. The superpages are created as needed, but not promoted. Faults are recorded, fault records could be obtained programmatically, and printed on the console. Implement the busdma(9) using DMARs. This busdma backend avoids bouncing and provides security against misbehaving hardware and driver bad programming, preventing leaks and corruption of the memory by wild DMA accesses. By default, the implementation is compiled into amd64 GENERIC kernel but disabled; to enable, set hw.dmar.enable=1 loader tunable. Code is written to work on i386, but testing there was low priority, and driver is not enabled in GENERIC. Even with the DMAR turned on, individual devices could be directed to use the bounce busdma with the hw.busdma.pci:::.bounce=1 tunable. If DMARs are capable of the pass-through translations, it is used, otherwise, an identity-mapping page table is constructed. The driver was tested on Xeon 5400/5500 chipset legacy machine, Haswell desktop and E5 SandyBridge dual-socket boxes, with ahci(4), ata(4), bce(4), ehci(4), mfi(4), uhci(4), xhci(4) devices. It also works with em(4) and igb(4), but there some fixes are needed for drivers, which are not committed yet. Intel GPUs do not work with DMAR (yet). Many thanks to John Baldwin, who explained me the newbus integration; Peter Holm, who did all testing and helped me to discover and understand several incredible bugs; and to Jim Harris for the access to the EDS and BWG and for listening when I have to explain my findings to somebody. Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/x86/iommu/ head/sys/x86/iommu/busdma_dmar.c (contents, props changed) head/sys/x86/iommu/busdma_dmar.h (contents, props changed) head/sys/x86/iommu/intel_ctx.c (contents, props changed) head/sys/x86/iommu/intel_dmar.h (contents, props changed) head/sys/x86/iommu/intel_drv.c (contents, props changed) head/sys/x86/iommu/intel_fault.c (contents, props changed) head/sys/x86/iommu/intel_gas.c (contents, props changed) head/sys/x86/iommu/intel_idpgtbl.c (contents, props changed) head/sys/x86/iommu/intel_quirks.c (contents, props changed) head/sys/x86/iommu/intel_reg.h (contents, props changed) head/sys/x86/iommu/intel_utils.c (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/options head/sys/dev/acpica/acpi_pci.c head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Oct 28 12:49:07 2013 (r257250) +++ head/sys/amd64/conf/GENERIC Mon Oct 28 13:33:29 2013 (r257251) @@ -94,6 +94,7 @@ device cpufreq # Bus support. device acpi +options ACPI_DMAR device pci # Floppy drives Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Oct 28 12:49:07 2013 (r257250) +++ head/sys/conf/files.amd64 Mon Oct 28 13:33:29 2013 (r257251) @@ -531,6 +531,14 @@ x86/cpufreq/powernow.c optional cpufreq x86/cpufreq/est.c optional cpufreq x86/cpufreq/hwpstate.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq +x86/iommu/busdma_dmar.c optional acpi acpi_dmar pci +x86/iommu/intel_ctx.c optional acpi acpi_dmar pci +x86/iommu/intel_drv.c optional acpi acpi_dmar pci +x86/iommu/intel_fault.c optional acpi acpi_dmar pci +x86/iommu/intel_gas.c optional acpi acpi_dmar pci +x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci +x86/iommu/intel_quirks.c optional acpi acpi_dmar pci +x86/iommu/intel_utils.c optional acpi acpi_dmar pci x86/isa/atpic.c optional atpic isa x86/isa/atrtc.c standard x86/isa/clock.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Oct 28 12:49:07 2013 (r257250) +++ head/sys/conf/files.i386 Mon Oct 28 13:33:29 2013 (r257251) @@ -554,6 +554,14 @@ x86/cpufreq/hwpstate.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq x86/cpufreq/smist.c optional cpufreq +x86/iommu/busdma_dmar.c optional acpi acpi_dmar pci +x86/iommu/intel_ctx.c optional acpi acpi_dmar pci +x86/iommu/intel_drv.c optional acpi acpi_dmar pci +x86/iommu/intel_fault.c optional acpi acpi_dmar pci +x86/iommu/intel_gas.c optional acpi acpi_dmar pci +x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci +x86/iommu/intel_quirks.c optional acpi acpi_dmar pci +x86/iommu/intel_utils.c optional acpi acpi_dmar pci x86/isa/atpic.c optional atpic x86/isa/atrtc.c optional native x86/isa/clock.c optional native Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Oct 28 12:49:07 2013 (r257250) +++ head/sys/conf/options Mon Oct 28 13:33:29 2013 (r257251) @@ -688,6 +688,7 @@ OPENSOLARIS_WITNESS opt_global.h ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h ACPI_MAX_THREADS opt_acpi.h +ACPI_DMAR opt_acpi.h # ISA support DEV_ISA opt_isa.h Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Mon Oct 28 12:49:07 2013 (r257250) +++ head/sys/dev/acpica/acpi_pci.c Mon Oct 28 13:33:29 2013 (r257251) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" + #include #include #include @@ -80,6 +82,7 @@ static ACPI_STATUS acpi_pci_save_handle( static int acpi_pci_set_powerstate_method(device_t dev, device_t child, int state); static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); +static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child); static device_method_t acpi_pci_methods[] = { /* Device interface */ @@ -90,6 +93,7 @@ static device_method_t acpi_pci_methods[ DEVMETHOD(bus_read_ivar, acpi_pci_read_ivar), DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), DEVMETHOD(bus_child_location_str, acpi_pci_child_location_str_method), + DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), /* PCI interface */ DEVMETHOD(pci_set_powerstate, acpi_pci_set_powerstate_method), @@ -308,3 +312,28 @@ acpi_pci_attach(device_t dev) return (bus_generic_attach(dev)); } + +#ifdef ACPI_DMAR +bus_dma_tag_t dmar_get_dma_tag(device_t dev, device_t child); +static bus_dma_tag_t +acpi_pci_get_dma_tag(device_t bus, device_t child) +{ + bus_dma_tag_t tag; + + if (device_get_parent(child) == bus) { + /* try dmar and return if it works */ + tag = dmar_get_dma_tag(bus, child); + } else + tag = NULL; + if (tag == NULL) + tag = pci_get_dma_tag(bus, child); + return (tag); +} +#else +static bus_dma_tag_t +acpi_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (pci_get_dma_tag(bus, child)); +} +#endif Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Oct 28 12:49:07 2013 (r257250) +++ head/sys/i386/conf/NOTES Mon Oct 28 13:33:29 2013 (r257251) @@ -491,6 +491,7 @@ device tdfx_linux # Enable Linuxulator device acpi options ACPI_DEBUG +options ACPI_DMAR # ACPI WMI Mapping driver device acpi_wmi Added: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/iommu/busdma_dmar.c Mon Oct 28 13:33:29 2013 (r257251) @@ -0,0 +1,754 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * busdma_dmar.c, the implementation of the busdma(9) interface using + * DMAR units from Intel VT-d. + */ + +static bool +dmar_bus_dma_is_dev_disabled(device_t dev) +{ + char str[128], *env; + int domain, bus, slot, func; + + domain = pci_get_domain(dev); + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d.bounce", + domain, bus, slot, func); + env = getenv(str); + if (env == NULL) + return (false); + freeenv(env); + return (true); +} + +struct dmar_ctx * +dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr) +{ + struct dmar_ctx *ctx; + bool disabled; + + /* + * If the user requested the IOMMU disabled for the device, we + * cannot disable the DMAR, due to possibility of other + * devices on the same DMAR still requiring translation. + * Instead provide the identity mapping for the device + * context. + */ + disabled = dmar_bus_dma_is_dev_disabled(dev); + ctx = dmar_get_ctx(dmar, dev, disabled, rmrr); + if (ctx == NULL) + return (NULL); + ctx->ctx_tag.owner = dev; + if (disabled) { + /* + * Keep the first reference on context, release the + * later refs. + */ + DMAR_LOCK(dmar); + if ((ctx->flags & DMAR_CTX_DISABLED) == 0) { + ctx->flags |= DMAR_CTX_DISABLED; + DMAR_UNLOCK(dmar); + } else { + dmar_free_ctx_locked(dmar, ctx); + } + ctx = NULL; + } + return (ctx); +} + +bus_dma_tag_t +dmar_get_dma_tag(device_t dev, device_t child) +{ + struct dmar_unit *dmar; + struct dmar_ctx *ctx; + bus_dma_tag_t res; + + dmar = dmar_find(child); + /* Not in scope of any DMAR ? */ + if (dmar == NULL) + return (NULL); + dmar_quirks_pre_use(dmar); + dmar_instantiate_rmrr_ctxs(dmar); + + ctx = dmar_instantiate_ctx(dmar, child, false); + res = ctx == NULL ? NULL : (bus_dma_tag_t)&ctx->ctx_tag; + return (res); +} + +static MALLOC_DEFINE(M_DMAR_DMAMAP, "dmar_dmamap", "Intel DMAR DMA Map"); + +static void dmar_bus_schedule_dmamap(struct dmar_unit *unit, + struct bus_dmamap_dmar *map); + +static int +dmar_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) +{ + struct bus_dma_tag_dmar *newtag, *oldtag; + int error; + + *dmat = NULL; + error = common_bus_dma_tag_create(parent != NULL ? + &((struct bus_dma_tag_dmar *)parent)->common : NULL, alignment, + boundary, lowaddr, highaddr, filter, filterarg, maxsize, + nsegments, maxsegsz, flags, lockfunc, lockfuncarg, + sizeof(struct bus_dma_tag_dmar), (void **)&newtag); + if (error != 0) + return (error); + + oldtag = (struct bus_dma_tag_dmar *)parent; + newtag->common.impl = &bus_dma_dmar_impl; + newtag->ctx = oldtag->ctx; + newtag->owner = oldtag->owner; + error = 0; + + if (error != 0) + free(newtag, M_DEVBUF); + else + *dmat = (bus_dma_tag_t)newtag; + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), + error); + return (error); +} + +static int +dmar_bus_dma_tag_destroy(bus_dma_tag_t dmat1) +{ + struct bus_dma_tag_dmar *dmat, *dmat_copy, *parent; + int error; + + error = 0; + dmat_copy = dmat = (struct bus_dma_tag_dmar *)dmat1; + + if (dmat != NULL) { + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } + while (dmat != NULL) { + parent = (struct bus_dma_tag_dmar *)dmat->common.parent; + if (atomic_fetchadd_int(&dmat->common.ref_count, -1) == + 1) { + if (dmat == &dmat->ctx->ctx_tag) + dmar_free_ctx(dmat->ctx); + free(dmat->segments, M_DMAR_DMAMAP); + free(dmat, M_DEVBUF); + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); +} + +static int +dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = malloc(sizeof(*map), M_DMAR_DMAMAP, M_NOWAIT | M_ZERO); + if (map == NULL) { + *mapp = NULL; + return (ENOMEM); + } + if (tag->segments == NULL) { + tag->segments = malloc(sizeof(bus_dma_segment_t) * + tag->common.nsegments, M_DMAR_DMAMAP, M_NOWAIT); + if (tag->segments == NULL) { + free(map, M_DMAR_DMAMAP); + *mapp = NULL; + return (ENOMEM); + } + } + TAILQ_INIT(&map->map_entries); + map->tag = tag; + map->locked = true; + map->cansleep = false; + tag->map_count++; + *mapp = (bus_dmamap_t)map; + + return (0); +} + +static int +dmar_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map1) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + if (map != NULL) { + DMAR_CTX_LOCK(tag->ctx); + if (!TAILQ_EMPTY(&map->map_entries)) { + DMAR_CTX_UNLOCK(tag->ctx); + return (EBUSY); + } + DMAR_CTX_UNLOCK(tag->ctx); + free(map, M_DMAR_DMAMAP); + } + tag->map_count--; + return (0); +} + + +static int +dmar_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + int error, mflags; + vm_memattr_t attr; + + error = dmar_bus_dmamap_create(dmat, flags, mapp); + if (error != 0) + return (error); + + mflags = (flags & BUS_DMA_NOWAIT) != 0 ? M_NOWAIT : M_WAITOK; + mflags |= (flags & BUS_DMA_ZERO) != 0 ? M_ZERO : 0; + attr = (flags & BUS_DMA_NOCACHE) != 0 ? VM_MEMATTR_UNCACHEABLE : + VM_MEMATTR_DEFAULT; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)*mapp; + + if (tag->common.maxsize < PAGE_SIZE && + tag->common.alignment <= tag->common.maxsize && + attr == VM_MEMATTR_DEFAULT) { + *vaddr = malloc(tag->common.maxsize, M_DEVBUF, mflags); + map->flags |= BUS_DMAMAP_DMAR_MALLOC; + } else { + *vaddr = (void *)kmem_alloc_attr(kernel_arena, + tag->common.maxsize, mflags, 0ul, BUS_SPACE_MAXADDR, + attr); + map->flags |= BUS_DMAMAP_DMAR_KMEM_ALLOC; + } + if (*vaddr == NULL) { + dmar_bus_dmamap_destroy(dmat, *mapp); + *mapp = NULL; + return (ENOMEM); + } + return (0); +} + +static void +dmar_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map1) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + + if ((map->flags & BUS_DMAMAP_DMAR_MALLOC) != 0) { + free(vaddr, M_DEVBUF); + map->flags &= ~BUS_DMAMAP_DMAR_MALLOC; + } else { + KASSERT((map->flags & BUS_DMAMAP_DMAR_KMEM_ALLOC) != 0, + ("dmar_bus_dmamem_free for non alloced map %p", map)); + kmem_free(kernel_arena, (vm_offset_t)vaddr, tag->common.maxsize); + map->flags &= ~BUS_DMAMAP_DMAR_KMEM_ALLOC; + } + + dmar_bus_dmamap_destroy(dmat, map1); +} + +static int +dmar_bus_dmamap_load_something1(struct bus_dma_tag_dmar *tag, + struct bus_dmamap_dmar *map, vm_page_t *ma, int offset, bus_size_t buflen, + int flags, bus_dma_segment_t *segs, int *segp, + struct dmar_map_entries_tailq *unroll_list) +{ + struct dmar_ctx *ctx; + struct dmar_map_entry *entry; + dmar_gaddr_t size; + bus_size_t buflen1; + int error, idx, gas_flags, seg; + + if (segs == NULL) + segs = tag->segments; + ctx = tag->ctx; + seg = *segp; + idx = 0; + while (buflen > 0) { + seg++; + if (seg >= tag->common.nsegments) { + error = EFBIG; + break; + } + buflen1 = buflen > tag->common.maxsegsz ? + tag->common.maxsegsz : buflen; + buflen -= buflen1; + size = round_page(offset + buflen1); + + /* + * (Too) optimistically allow split if there are more + * then one segments left. + */ + gas_flags = map->cansleep ? DMAR_GM_CANWAIT : 0; + if (seg + 1 < tag->common.nsegments) + gas_flags |= DMAR_GM_CANSPLIT; + + error = dmar_gas_map(ctx, &tag->common, size, + DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, + gas_flags, ma + idx, &entry); + if (error != 0) + break; + if ((gas_flags & DMAR_GM_CANSPLIT) != 0) { + KASSERT(size >= entry->end - entry->start, + ("split increased entry size %jx %jx %jx", + (uintmax_t)size, (uintmax_t)entry->start, + (uintmax_t)entry->end)); + size = entry->end - entry->start; + if (buflen1 > size) + buflen1 = size; + } else { + KASSERT(entry->end - entry->start == size, + ("no split allowed %jx %jx %jx", + (uintmax_t)size, (uintmax_t)entry->start, + (uintmax_t)entry->end)); + } + + KASSERT(((entry->start + offset) & (tag->common.alignment - 1)) + == 0, + ("alignment failed: ctx %p start 0x%jx offset %x " + "align 0x%jx", ctx, (uintmax_t)entry->start, offset, + (uintmax_t)tag->common.alignment)); + KASSERT(entry->end <= tag->common.lowaddr || + entry->start >= tag->common.highaddr, + ("entry placement failed: ctx %p start 0x%jx end 0x%jx " + "lowaddr 0x%jx highaddr 0x%jx", ctx, + (uintmax_t)entry->start, (uintmax_t)entry->end, + (uintmax_t)tag->common.lowaddr, + (uintmax_t)tag->common.highaddr)); + KASSERT(dmar_test_boundary(entry->start, entry->end - + entry->start, tag->common.boundary), + ("boundary failed: ctx %p start 0x%jx end 0x%jx " + "boundary 0x%jx", ctx, (uintmax_t)entry->start, + (uintmax_t)entry->end, (uintmax_t)tag->common.boundary)); + KASSERT(buflen1 <= tag->common.maxsegsz, + ("segment too large: ctx %p start 0x%jx end 0x%jx " + "maxsegsz 0x%jx", ctx, (uintmax_t)entry->start, + (uintmax_t)entry->end, (uintmax_t)tag->common.maxsegsz)); + + DMAR_CTX_LOCK(ctx); + TAILQ_INSERT_TAIL(&map->map_entries, entry, dmamap_link); + entry->flags |= DMAR_MAP_ENTRY_MAP; + DMAR_CTX_UNLOCK(ctx); + TAILQ_INSERT_TAIL(unroll_list, entry, unroll_link); + + segs[seg].ds_addr = entry->start + offset; + segs[seg].ds_len = buflen1; + + idx += OFF_TO_IDX(trunc_page(offset + buflen1)); + offset += buflen1; + offset &= DMAR_PAGE_MASK; + } + if (error == 0) + *segp = seg; + return (error); +} + +static int +dmar_bus_dmamap_load_something(struct bus_dma_tag_dmar *tag, + struct bus_dmamap_dmar *map, vm_page_t *ma, int offset, bus_size_t buflen, + int flags, bus_dma_segment_t *segs, int *segp) +{ + struct dmar_ctx *ctx; + struct dmar_map_entry *entry, *entry1; + struct dmar_map_entries_tailq unroll_list; + int error; + + ctx = tag->ctx; + atomic_add_long(&ctx->loads, 1); + + TAILQ_INIT(&unroll_list); + error = dmar_bus_dmamap_load_something1(tag, map, ma, offset, + buflen, flags, segs, segp, &unroll_list); + if (error != 0) { + /* + * The busdma interface does not allow us to report + * partial buffer load, so unfortunately we have to + * revert all work done. + */ + DMAR_CTX_LOCK(ctx); + TAILQ_FOREACH_SAFE(entry, &unroll_list, unroll_link, + entry1) { + /* + * No entries other than what we have created + * during the failed run might have been + * inserted there in between, since we own ctx + * pglock. + */ + TAILQ_REMOVE(&map->map_entries, entry, dmamap_link); + TAILQ_REMOVE(&unroll_list, entry, unroll_link); + TAILQ_INSERT_TAIL(&ctx->unload_entries, entry, + dmamap_link); + } + DMAR_CTX_UNLOCK(ctx); + taskqueue_enqueue(ctx->dmar->delayed_taskqueue, + &ctx->unload_task); + } + + if (error == ENOMEM && (flags & BUS_DMA_NOWAIT) == 0 && + !map->cansleep) + error = EINPROGRESS; + if (error == EINPROGRESS) + dmar_bus_schedule_dmamap(ctx->dmar, map); + return (error); +} + +static int +dmar_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map1, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + return (dmar_bus_dmamap_load_something(tag, map, ma, ma_offs, tlen, + flags, segs, segp)); +} + +static int +dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map1, + vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + vm_page_t *ma; + vm_paddr_t pstart, pend; + int error, i, ma_cnt, offset; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + pstart = trunc_page(buf); + pend = round_page(buf + buflen); + offset = buf & PAGE_MASK; + ma_cnt = OFF_TO_IDX(pend - pstart); + ma = malloc(sizeof(vm_page_t) * ma_cnt, M_DEVBUF, map->cansleep ? + M_WAITOK : M_NOWAIT); + if (ma == NULL) + return (ENOMEM); + for (i = 0; i < ma_cnt; i++) + ma[i] = PHYS_TO_VM_PAGE(pstart + i * PAGE_SIZE); + error = dmar_bus_dmamap_load_something(tag, map, ma, offset, buflen, + flags, segs, segp); + free(ma, M_DEVBUF); + return (error); +} + +static int +dmar_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map1, void *buf, + bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + vm_page_t *ma, fma; + vm_paddr_t pstart, pend, paddr; + int error, i, ma_cnt, offset; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + pstart = trunc_page((vm_offset_t)buf); + pend = round_page((vm_offset_t)buf + buflen); + offset = (vm_offset_t)buf & PAGE_MASK; + ma_cnt = OFF_TO_IDX(pend - pstart); + ma = malloc(sizeof(vm_page_t) * ma_cnt, M_DEVBUF, map->cansleep ? + M_WAITOK : M_NOWAIT); + if (ma == NULL) + return (ENOMEM); + if (dumping) { + /* + * If dumping, do not attempt to call + * PHYS_TO_VM_PAGE() at all. It may return non-NULL + * but the vm_page returned might be not initialized, + * e.g. for the kernel itself. + */ + KASSERT(pmap == kernel_pmap, ("non-kernel address write")); + fma = malloc(sizeof(struct vm_page) * ma_cnt, M_DEVBUF, + M_ZERO | (map->cansleep ? M_WAITOK : M_NOWAIT)); + if (fma == NULL) { + free(ma, M_DEVBUF); + return (ENOMEM); + } + for (i = 0; i < ma_cnt; i++, pstart += PAGE_SIZE) { + paddr = pmap_kextract(pstart); + vm_page_initfake(&fma[i], paddr, VM_MEMATTR_DEFAULT); + ma[i] = &fma[i]; + } + } else { + fma = NULL; + for (i = 0; i < ma_cnt; i++, pstart += PAGE_SIZE) { + if (pmap == kernel_pmap) + paddr = pmap_kextract(pstart); + else + paddr = pmap_extract(pmap, pstart); + ma[i] = PHYS_TO_VM_PAGE(paddr); + KASSERT(VM_PAGE_TO_PHYS(ma[i]) == paddr, + ("PHYS_TO_VM_PAGE failed %jx %jx m %p", + (uintmax_t)paddr, (uintmax_t)VM_PAGE_TO_PHYS(ma[i]), + ma[i])); + } + } + error = dmar_bus_dmamap_load_something(tag, map, ma, offset, buflen, + flags, segs, segp); + free(ma, M_DEVBUF); + free(fma, M_DEVBUF); + return (error); +} + +static void +dmar_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map1, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) +{ + struct bus_dmamap_dmar *map; + + if (map1 == NULL) + return; + map = (struct bus_dmamap_dmar *)map1; + map->mem = *mem; + map->tag = (struct bus_dma_tag_dmar *)dmat; + map->callback = callback; + map->callback_arg = callback_arg; +} + +static bus_dma_segment_t * +dmar_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map1, + bus_dma_segment_t *segs, int nsegs, int error) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + + if (!map->locked) { + KASSERT(map->cansleep, + ("map not locked and not sleepable context %p", map)); + + /* + * We are called from the delayed context. Relock the + * driver. + */ + (tag->common.lockfunc)(tag->common.lockfuncarg, BUS_DMA_LOCK); + map->locked = true; + } + + if (segs == NULL) + segs = tag->segments; + return (segs); +} + +/* + * The limitations of busdma KPI forces the dmar to perform the actual + * unload, consisting of the unmapping of the map entries page tables, + * from the delayed context on i386, since page table page mapping + * might require a sleep to be successfull. The unfortunate + * consequence is that the DMA requests can be served some time after + * the bus_dmamap_unload() call returned. + * + * On amd64, we assume that sf allocation cannot fail. + */ +static void +dmar_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map1) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + struct dmar_ctx *ctx; +#if defined(__amd64__) + struct dmar_map_entries_tailq entries; +#endif + + tag = (struct bus_dma_tag_dmar *)dmat; + map = (struct bus_dmamap_dmar *)map1; + ctx = tag->ctx; + atomic_add_long(&ctx->unloads, 1); + +#if defined(__i386__) + DMAR_CTX_LOCK(ctx); + TAILQ_CONCAT(&ctx->unload_entries, &map->map_entries, dmamap_link); + DMAR_CTX_UNLOCK(ctx); + taskqueue_enqueue(ctx->dmar->delayed_taskqueue, &ctx->unload_task); +#else /* defined(__amd64__) */ + TAILQ_INIT(&entries); + DMAR_CTX_LOCK(ctx); + TAILQ_CONCAT(&entries, &map->map_entries, dmamap_link); + DMAR_CTX_UNLOCK(ctx); + THREAD_NO_SLEEPING(); + dmar_ctx_unload(ctx, &entries, false); + THREAD_SLEEPING_OK(); + KASSERT(TAILQ_EMPTY(&entries), ("lazy dmar_ctx_unload %p", ctx)); +#endif +} + +static void +dmar_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op) +{ +} + +struct bus_dma_impl bus_dma_dmar_impl = { + .tag_create = dmar_bus_dma_tag_create, + .tag_destroy = dmar_bus_dma_tag_destroy, + .map_create = dmar_bus_dmamap_create, + .map_destroy = dmar_bus_dmamap_destroy, + .mem_alloc = dmar_bus_dmamem_alloc, + .mem_free = dmar_bus_dmamem_free, + .load_phys = dmar_bus_dmamap_load_phys, + .load_buffer = dmar_bus_dmamap_load_buffer, + .load_ma = dmar_bus_dmamap_load_ma, + .map_waitok = dmar_bus_dmamap_waitok, + .map_complete = dmar_bus_dmamap_complete, + .map_unload = dmar_bus_dmamap_unload, + .map_sync = dmar_bus_dmamap_sync +}; + +static void +dmar_bus_task_dmamap(void *arg, int pending) +{ + struct bus_dma_tag_dmar *tag; + struct bus_dmamap_dmar *map; + struct dmar_unit *unit; + struct dmar_ctx *ctx; + + unit = arg; + DMAR_LOCK(unit); + while ((map = TAILQ_FIRST(&unit->delayed_maps)) != NULL) { + TAILQ_REMOVE(&unit->delayed_maps, map, delay_link); + DMAR_UNLOCK(unit); + tag = map->tag; + ctx = map->tag->ctx; + map->cansleep = true; + map->locked = false; + bus_dmamap_load_mem((bus_dma_tag_t)tag, (bus_dmamap_t)map, + &map->mem, map->callback, map->callback_arg, + BUS_DMA_WAITOK); + map->cansleep = false; + if (map->locked) { + (tag->common.lockfunc)(tag->common.lockfuncarg, + BUS_DMA_UNLOCK); + } else + map->locked = true; + map->cansleep = false; + DMAR_LOCK(unit); + } + DMAR_UNLOCK(unit); +} + +static void +dmar_bus_schedule_dmamap(struct dmar_unit *unit, struct bus_dmamap_dmar *map) +{ + struct dmar_ctx *ctx; + + ctx = map->tag->ctx; + map->locked = false; + DMAR_LOCK(unit); + TAILQ_INSERT_TAIL(&unit->delayed_maps, map, delay_link); + DMAR_UNLOCK(unit); + taskqueue_enqueue(unit->delayed_taskqueue, &unit->dmamap_load_task); +} + +int +dmar_init_busdma(struct dmar_unit *unit) +{ + + TAILQ_INIT(&unit->delayed_maps); + TASK_INIT(&unit->dmamap_load_task, 0, dmar_bus_task_dmamap, unit); + unit->delayed_taskqueue = taskqueue_create("dmar", M_WAITOK, + taskqueue_thread_enqueue, &unit->delayed_taskqueue); + taskqueue_start_threads(&unit->delayed_taskqueue, 1, PI_DISK, + "dmar%d busdma taskq", unit->unit); + return (0); +} + +void +dmar_fini_busdma(struct dmar_unit *unit) +{ + + if (unit->delayed_taskqueue == NULL) + return; + + taskqueue_drain(unit->delayed_taskqueue, &unit->dmamap_load_task); + taskqueue_free(unit->delayed_taskqueue); + unit->delayed_taskqueue = NULL; +} Added: head/sys/x86/iommu/busdma_dmar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/iommu/busdma_dmar.h Mon Oct 28 13:33:29 2013 (r257251) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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 __X86_IOMMU_BUSDMA_DMAR_H +#define __X86_IOMMU_BUSDMA_DMAR_H + +struct dmar_map_entry; +TAILQ_HEAD(dmar_map_entries_tailq, dmar_map_entry); + +struct bus_dma_tag_dmar { + struct bus_dma_tag_common common; + struct dmar_ctx *ctx; + device_t owner; + int map_count; + bus_dma_segment_t *segments; +}; + +struct bus_dmamap_dmar { + struct bus_dma_tag_dmar *tag; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + struct dmar_map_entries_tailq map_entries; + TAILQ_ENTRY(bus_dmamap_dmar) delay_link; + bool locked; + bool cansleep; + int flags; +}; + +#define BUS_DMAMAP_DMAR_MALLOC 0x0001 +#define BUS_DMAMAP_DMAR_KMEM_ALLOC 0x0002 + +extern struct bus_dma_impl bus_dma_dmar_impl; + +bus_dma_tag_t dmar_get_dma_tag(device_t dev, device_t child); + +#endif Added: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/iommu/intel_ctx.c Mon Oct 28 13:33:29 2013 (r257251) @@ -0,0 +1,553 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 14:27:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3405BC33; Mon, 28 Oct 2013 14:27:36 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20711231B; Mon, 28 Oct 2013 14:27:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SERZBx088866; Mon, 28 Oct 2013 14:27:35 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SERZhP088865; Mon, 28 Oct 2013 14:27:35 GMT (envelope-from will@svn.freebsd.org) Message-Id: <201310281427.r9SERZhP088865@svn.freebsd.org> From: Will Andrews Date: Mon, 28 Oct 2013 14:27:35 +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: r257253 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 14:27:36 -0000 Author: will Date: Mon Oct 28 14:27:35 2013 New Revision: 257253 URL: http://svnweb.freebsd.org/changeset/base/257253 Log: MFC r248653: ZFS: Fix a panic while unmounting a busy filesystem. This particular scenario was easily reproduced using a NFS export. When the first 'zfs unmount' occurred, it returned EBUSY via this path, while vflush() had flushed references on the filesystem's root vnode, which in turn caused its v_interlock to be destroyed. The next time 'zfs unmount' was called, vflush() tried to obtain this lock, which caused this panic. Since vflush() on FreeBSD is a definitive call, there is no need to check vfsp->vfs_count after it completes. Simply #ifdef sun this check. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Oct 28 14:00:06 2013 (r257252) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Oct 28 14:27:35 2013 (r257253) @@ -1988,6 +1988,7 @@ zfs_umount(vfs_t *vfsp, int fflag) return (ret); } +#ifdef sun if (!(fflag & MS_FORCE)) { /* * Check the number of active vnodes in the file system. @@ -2008,6 +2009,7 @@ zfs_umount(vfs_t *vfsp, int fflag) return (SET_ERROR(EBUSY)); } } +#endif VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); os = zfsvfs->z_os; From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 14:47:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AFA6F203; Mon, 28 Oct 2013 14:47:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2C22424; Mon, 28 Oct 2013 14:47:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SElXC2095571; Mon, 28 Oct 2013 14:47:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SElXLa095570; Mon, 28 Oct 2013 14:47:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281447.r9SElXLa095570@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 14:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257254 - head/lib/libnetgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 14:47:33 -0000 Author: glebius Date: Mon Oct 28 14:47:33 2013 New Revision: 257254 URL: http://svnweb.freebsd.org/changeset/base/257254 Log: Remove ng_fec(4). Modified: head/lib/libnetgraph/debug.c Modified: head/lib/libnetgraph/debug.c ============================================================================== --- head/lib/libnetgraph/debug.c Mon Oct 28 14:27:35 2013 (r257253) +++ head/lib/libnetgraph/debug.c Mon Oct 28 14:47:33 2013 (r257254) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -136,7 +135,6 @@ static const struct ng_cookie cookies[] COOKIE(EIFACE), COOKIE(ETF), COOKIE(ETHER), - COOKIE(FEC), COOKIE(FRAMERELAY), COOKIE(GIF), COOKIE(GIF_DEMUX), From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 14:52:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 95A4D46F; Mon, 28 Oct 2013 14:52:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 832352498; Mon, 28 Oct 2013 14:52:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SEq90o098262; Mon, 28 Oct 2013 14:52:09 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SEq9Dq098261; Mon, 28 Oct 2013 14:52:09 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281452.r9SEq9Dq098261@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 14:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257255 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 14:52:09 -0000 Author: glebius Date: Mon Oct 28 14:52:08 2013 New Revision: 257255 URL: http://svnweb.freebsd.org/changeset/base/257255 Log: Remove ng_fec(4). Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 28 14:47:33 2013 (r257254) +++ head/sys/conf/files Mon Oct 28 14:52:08 2013 (r257255) @@ -3205,7 +3205,6 @@ netgraph/ng_echo.c optional netgraph_ec netgraph/ng_eiface.c optional netgraph_eiface netgraph/ng_ether.c optional netgraph_ether netgraph/ng_ether_echo.c optional netgraph_ether_echo -netgraph/ng_fec.c optional netgraph_fec netgraph/ng_frame_relay.c optional netgraph_frame_relay netgraph/ng_gif.c optional netgraph_gif netgraph/ng_gif_demux.c optional netgraph_gif_demux From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 15:11:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C2F5EFAC; Mon, 28 Oct 2013 15:11:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B089D2624; Mon, 28 Oct 2013 15:11:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SFBbOq005574; Mon, 28 Oct 2013 15:11:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SFBbHq005573; Mon, 28 Oct 2013 15:11:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281511.r9SFBbHq005573@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 15:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257256 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 15:11:37 -0000 Author: glebius Date: Mon Oct 28 15:11:37 2013 New Revision: 257256 URL: http://svnweb.freebsd.org/changeset/base/257256 Log: Fix build. We need to include systm.h before if_var.h. Pointy hat to: glebius Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/radix_ipf.c Mon Oct 28 14:52:08 2013 (r257255) +++ head/sys/contrib/ipfilter/netinet/radix_ipf.c Mon Oct 28 15:11:37 2013 (r257256) @@ -9,12 +9,14 @@ #include #include #include -#if !defined(_KERNEL) +#ifdef _KERNEL +#include +#else # include # include # include # include -#endif +#endif /* !_KERNEL */ #include "netinet/ip_compat.h" #include "netinet/ip_fil.h" #ifdef RDX_DEBUG From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 15:17:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A121F27E; Mon, 28 Oct 2013 15:17:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6F02666; Mon, 28 Oct 2013 15:17:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SFHfau006398; Mon, 28 Oct 2013 15:17:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SFHfe7006397; Mon, 28 Oct 2013 15:17:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281517.r9SFHfe7006397@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 15:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257257 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 15:17:41 -0000 Author: glebius Date: Mon Oct 28 15:17:41 2013 New Revision: 257257 URL: http://svnweb.freebsd.org/changeset/base/257257 Log: Remove ng_fec(4). Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 28 15:11:37 2013 (r257256) +++ head/sys/conf/NOTES Mon Oct 28 15:17:41 2013 (r257257) @@ -728,7 +728,6 @@ options NETGRAPH_DEVICE options NETGRAPH_ECHO options NETGRAPH_EIFACE options NETGRAPH_ETHER -options NETGRAPH_FEC options NETGRAPH_FRAME_RELAY options NETGRAPH_GIF options NETGRAPH_GIF_DEMUX From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 15:20:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9C300417; Mon, 28 Oct 2013 15:20:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 897F72682; Mon, 28 Oct 2013 15:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SFKJcF008433; Mon, 28 Oct 2013 15:20:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SFKIA1008421; Mon, 28 Oct 2013 15:20:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310281520.r9SFKIA1008421@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Oct 2013 15:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257258 - in head/sys/arm: at91 econa lpc ti/cpsw versatile xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 15:20:19 -0000 Author: ian Date: Mon Oct 28 15:20:17 2013 New Revision: 257258 URL: http://svnweb.freebsd.org/changeset/base/257258 Log: Sweep up a bit of arm-land fallout after r257244; include necessary headers directly that are no longer available via accidental include. Modified: head/sys/arm/at91/if_ate.c head/sys/arm/econa/if_ece.c head/sys/arm/lpc/if_lpe.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/versatile/if_smc_fdt.c head/sys/arm/xscale/pxa/if_smc_smi.c Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Mon Oct 28 15:17:41 2013 (r257257) +++ head/sys/arm/at91/if_ate.c Mon Oct 28 15:20:17 2013 (r257258) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET #include Modified: head/sys/arm/econa/if_ece.c ============================================================================== --- head/sys/arm/econa/if_ece.c Mon Oct 28 15:17:41 2013 (r257257) +++ head/sys/arm/econa/if_ece.c Mon Oct 28 15:20:17 2013 (r257258) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef INET Modified: head/sys/arm/lpc/if_lpe.c ============================================================================== --- head/sys/arm/lpc/if_lpe.c Mon Oct 28 15:17:41 2013 (r257257) +++ head/sys/arm/lpc/if_lpe.c Mon Oct 28 15:20:17 2013 (r257258) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 28 15:17:41 2013 (r257257) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Oct 28 15:20:17 2013 (r257258) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm/versatile/if_smc_fdt.c ============================================================================== --- head/sys/arm/versatile/if_smc_fdt.c Mon Oct 28 15:17:41 2013 (r257257) +++ head/sys/arm/versatile/if_smc_fdt.c Mon Oct 28 15:20:17 2013 (r257258) @@ -28,11 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include - #include -#include +#include +#include +#include #include #include Modified: head/sys/arm/xscale/pxa/if_smc_smi.c ============================================================================== --- head/sys/arm/xscale/pxa/if_smc_smi.c Mon Oct 28 15:17:41 2013 (r257257) +++ head/sys/arm/xscale/pxa/if_smc_smi.c Mon Oct 28 15:20:17 2013 (r257258) @@ -28,11 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include - #include -#include +#include +#include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 15:33:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6CF9BD97; Mon, 28 Oct 2013 15:33:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E125227DB; Mon, 28 Oct 2013 15:33:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r9SFXNmQ039377; Mon, 28 Oct 2013 19:33:23 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r9SFXNJa039369; Mon, 28 Oct 2013 19:33:23 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 28 Oct 2013 19:33:23 +0400 From: Gleb Smirnoff To: Ian Lepore Subject: Re: svn commit: r257258 - in head/sys/arm: at91 econa lpc ti/cpsw versatile xscale/pxa Message-ID: <20131028153323.GR52889@FreeBSD.org> References: <201310281520.r9SFKIA1008421@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310281520.r9SFKIA1008421@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 15:33:36 -0000 On Mon, Oct 28, 2013 at 03:20:18PM +0000, Ian Lepore wrote: I> Author: ian I> Date: Mon Oct 28 15:20:17 2013 I> New Revision: 257258 I> URL: http://svnweb.freebsd.org/changeset/base/257258 I> I> Log: I> Sweep up a bit of arm-land fallout after r257244; include necessary I> headers directly that are no longer available via accidental include. I> I> Modified: I> head/sys/arm/at91/if_ate.c I> head/sys/arm/econa/if_ece.c I> head/sys/arm/lpc/if_lpe.c I> head/sys/arm/ti/cpsw/if_cpsw.c I> head/sys/arm/versatile/if_smc_fdt.c I> head/sys/arm/xscale/pxa/if_smc_smi.c Thanks, Ian! I started working on them as soon as I noticed tinderbox message, but surprisingly all arm LINTs built well. That is because I checked in your commit :) Thanks again and sorry for problems. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 15:38:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C563EF6C; Mon, 28 Oct 2013 15:38:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0BEA2809; Mon, 28 Oct 2013 15:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SFcQbx013054; Mon, 28 Oct 2013 15:38:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SFcQGS013053; Mon, 28 Oct 2013 15:38:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281538.r9SFcQGS013053@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 15:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257259 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 15:38:26 -0000 Author: glebius Date: Mon Oct 28 15:38:26 2013 New Revision: 257259 URL: http://svnweb.freebsd.org/changeset/base/257259 Log: Remove ng_fec.4 Submitted by: Dmitry Luhtionov Modified: head/share/man/man4/netgraph.4 Modified: head/share/man/man4/netgraph.4 ============================================================================== --- head/share/man/man4/netgraph.4 Mon Oct 28 15:20:17 2013 (r257258) +++ head/share/man/man4/netgraph.4 Mon Oct 28 15:38:26 2013 (r257259) @@ -1430,7 +1430,6 @@ common networking problems, solved using .Xr ng_eiface 4 , .Xr ng_etf 4 , .Xr ng_ether 4 , -.Xr ng_fec 4 , .Xr ng_frame_relay 4 , .Xr ng_gif 4 , .Xr ng_gif_demux 4 , From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 16:21:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F05AAC3E; Mon, 28 Oct 2013 16:21:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF62C2AB8; Mon, 28 Oct 2013 16:21:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SGLWAm029405; Mon, 28 Oct 2013 16:21:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SGLVQN029396; Mon, 28 Oct 2013 16:21:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310281621.r9SGLVQN029396@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 16:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257261 - in head: etc etc/defaults etc/rc.d share/man/man4 share/man/man5 sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 16:21:33 -0000 Author: glebius Date: Mon Oct 28 16:21:31 2013 New Revision: 257261 URL: http://svnweb.freebsd.org/changeset/base/257261 Log: Remove more remnants of ng_fec(4). The ng_create_one() and ng_mkpeer() functions in network.subr are now not used anywhere, but I left them, since they can be useful in future in netgraph scripting. Submitted by: pluknet Modified: head/etc/defaults/rc.conf head/etc/network.subr head/etc/rc.d/netif head/share/man/man4/lagg.4 head/share/man/man5/rc.conf.5 head/sys/boot/forth/loader.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Oct 28 15:38:52 2013 (r257260) +++ head/etc/defaults/rc.conf Mon Oct 28 16:21:31 2013 (r257261) @@ -235,10 +235,6 @@ gif_interfaces="" # List of GIF tunnels # Choose correct tunnel addrs. #gifconfig_gif0="10.1.1.1 10.1.2.1" # Examples typically for a router. #gifconfig_gif1="10.1.1.2 10.1.2.2" # Examples typically for a router. -fec_interfaces="" # List of Fast EtherChannels. -#fec_interfaces="fec0 fec1" -#fecconfig_fec0="fxp0 dc0" # Examples typically for two NICs -#fecconfig_fec1="em0 em1 bge0 bge1" # Examples typically for four NICs # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Oct 28 15:38:52 2013 (r257260) +++ head/etc/network.subr Mon Oct 28 16:21:31 2013 (r257261) @@ -1520,54 +1520,6 @@ ng_create_one() done } -# ng_fec_create ifn -# Configure Fast EtherChannel for interface $ifn. Returns 0 if -# FEC arguments were found and configured; returns !0 otherwise. -ng_fec_create() -{ - local req_iface iface bogus - req_iface="$1" - - ngctl shutdown ${req_iface}: > /dev/null 2>&1 - - bogus="" - while true; do - iface=`ng_create_one fec dummy fec` - if [ -z "${iface}" ]; then - exit 2 - fi - if [ "${iface}" = "${req_iface}" ]; then - break - fi - bogus="${bogus} ${iface}" - done - - for iface in ${bogus}; do - ngctl shutdown ${iface}: - done -} - -# fec_up -# Create Fast EtherChannel interfaces. -fec_up() -{ - local i j - - for i in ${fec_interfaces}; do - ng_fec_create $i - for j in `get_if_var $i fecconfig_IF`; do - case ${j} in - '') - continue - ;; - *) - ngctl msg ${i}: add_iface "\"${j}\"" - ;; - esac - done - done -} - # ipx_up ifn # Configure any IPX addresses for interface $ifn. Returns 0 if # IPX arguments were found and configured; returns 1 otherwise. Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Mon Oct 28 15:38:52 2013 (r257260) +++ head/etc/rc.d/netif Mon Oct 28 16:21:31 2013 (r257261) @@ -62,9 +62,6 @@ network_start() # disable SIGINT (Ctrl-c) when running at startup trap : 2 - - # Create Fast EtherChannel interfaces - fec_up fi # Create cloned interfaces Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Mon Oct 28 15:38:52 2013 (r257260) +++ head/share/man/man4/lagg.4 Mon Oct 28 16:21:31 2013 (r257261) @@ -175,7 +175,6 @@ device will be used: (Note the mac address of the wireless device is forced to match the wired device as a workaround.) .Sh SEE ALSO -.Xr ng_fec 4 , .Xr ng_one2many 4 , .Xr sysctl 8 , .Xr ifconfig 8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Oct 28 15:38:52 2013 (r257260) +++ head/share/man/man5/rc.conf.5 Mon Oct 28 16:21:31 2013 (r257261) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2013 +.Dd October 28, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -1676,33 +1676,6 @@ Even if this variable is specified to .Dq YES , .Dq :nosticky keyword can be used to override it on per interface basis. -.It Va fec_interfaces -.Pq Vt str -Set to the list of -.Xr ng_fec 4 -Fast EtherChannel interfaces to configure on this host. -A -.Va fecconfig_ Ns Aq Ar interface -variable is assumed to exist for each value of -.Ar interface . -The value of this variable is used to configure link aggregated interfaces -according to the syntax of the -.Cm NGM_FEC_ADD_IFACE -to -.Xr ngctl 8 -msg. -Additionally, this option ensures that each listed interface is created -via the -.Cm mkpeer -command to -.Xr ngctl 8 -before attempting to configure it. -For example: -.Bd -literal -fec_interfaces="fec0" -fecconfig_fec0="em0 em1" -ifconfig_fec0="DHCP" -.Ed .It Va gif_interfaces .Pq Vt str This variable is deprecated in favor of Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Mon Oct 28 15:38:52 2013 (r257260) +++ head/sys/boot/forth/loader.conf Mon Oct 28 16:21:31 2013 (r257261) @@ -375,7 +375,6 @@ ng_echo_load="NO" # Netgraph echo node 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_fec_load="NO" # netgraph Fast EtherChannel node 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 From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 16:27:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DFF4813B; Mon, 28 Oct 2013 16:27:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDA3E2B18; Mon, 28 Oct 2013 16:27:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SGR1GJ030084; Mon, 28 Oct 2013 16:27:01 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SGR1Av030083; Mon, 28 Oct 2013 16:27:01 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310281627.r9SGR1Av030083@svn.freebsd.org> From: Sean Bruno Date: Mon, 28 Oct 2013 16:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257262 - head/sys/dev/cs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 16:27:02 -0000 Author: sbruno Date: Mon Oct 28 16:27:01 2013 New Revision: 257262 URL: http://svnweb.freebsd.org/changeset/base/257262 Log: repair build for dev/cs. Reported by: Outback Dingo Modified: head/sys/dev/cs/if_cs_isa.c Modified: head/sys/dev/cs/if_cs_isa.c ============================================================================== --- head/sys/dev/cs/if_cs_isa.c Mon Oct 28 16:21:31 2013 (r257261) +++ head/sys/dev/cs/if_cs_isa.c Mon Oct 28 16:27:01 2013 (r257262) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 17:17:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2396F599; Mon, 28 Oct 2013 17:17:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4C9B2EC3; Mon, 28 Oct 2013 17:17:03 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id e16so3731260qcx.34 for ; Mon, 28 Oct 2013 10:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZmpnKkER7jE3ZeyjzmB44Vtl0/qLUltiWH4gkM62TXE=; b=HOmspQ1e4r2bIkwMjStsxRmlmiBfuyxWTRTyjA5dbrQ/vjII0alWUApZ3INlu7JbgK D8SS3uCDhi0xMNLbmKmEPf8rpimvTSRWK9IhdvE9mO80xbXgMh01c90h/Tj/NKXHSsxg iKsM8BhM6ng2YxmHqWuc6I3F8k0YyKLjcgFcouBlgIRJSI3HsuWV7EI6THti9xa2B9D1 cn+4vageve5PA/d5f4uVzYbPkmne42+rbOtMQvFCb8HKywyAikJDLgeiHaRSZsXAmNDB zii8egX0A9Y5FVlgk/WmcimBOjSyCXbfkKAibkkuaBatI9oCE5DR0Un+YAarpslkmy6v VwJQ== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr30882587qad.76.1382980622806; Mon, 28 Oct 2013 10:17:02 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 28 Oct 2013 10:17:02 -0700 (PDT) In-Reply-To: References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> Date: Mon, 28 Oct 2013 10:17:02 -0700 X-Google-Sender-Auth: EKOvAbwGqKcTw383jviVFwzcMR8 Message-ID: Subject: Re: svn commit: r257133 - head/sys/dev/iwn From: Adrian Chadd To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 17:17:04 -0000 Ping, any response? I'd like to narrow down what's going on here. Thanks! -adrian On 27 October 2013 09:04, Adrian Chadd wrote: > Hm, ok. > > Can you compile it with IWN_DEBUG and IEEE80211_DEBUG, then do this: > > sysctl dev.iwn.0.debug=0x1 > wlandebug +rate > > I'd like to see what the selected rate is and what the logged reason > for failing to transmit is. > > I have a 5100 and it works totally fine for me. > > Thanks! > > > > -adrian > > > On 27 October 2013 03:11, Stefan Farfeleder wrote: >> On Fri, Oct 25, 2013 at 07:44:54PM +0000, Adrian Chadd wrote: >>> Author: adrian >>> Date: Fri Oct 25 19:44:53 2013 >>> New Revision: 257133 >>> URL: http://svnweb.freebsd.org/changeset/base/257133 >>> >>> Log: >>> Temporarily disable multi-rate retry (link quality) and eliminate rate >>> index lookups. >>> >>> * My recent(ish) change to iwn(4) and the net80211 rate control API to >>> support 11n rates broke the link quality table use. So, until I or >>> someone else decides to fix it, let's just disable it for now. >>> >>> * Teach iwn_tx_data_raw() to use the iwn_rate_to_plcp() function. >>> >>> * Eliminate two uses of the net80211 rate index lookup functions - they >>> are only for legacy rates and they're not needed here. >>> >>> This fixes some invalid looking rate control TX issues that showed up >>> on my 4965 but it doesn't fix the two TX hangs I've noticed. Those look >>> like DMA related issues. >>> >>> Tested: >>> >>> * 4965, STA mode >>> * 5100, STA mode >> >> Hi Adrian, >> >> this change completely broke iwn for me. It's a >> >> iwn0: mem 0xf1ffe000-0xf1ffffff irq 17 at device 0.0 on pci12 >> >> built-in device in a Dell Precision m4400. >> >> With this change, wpa_supplicant cannot associate any longer. In the >> logs I see every few seconds >> >> Oct 27 10:57:37 mole wpa_supplicant[2256]: wlan0: Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xx' freq=2427 MHz) >> Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: Authentication with xx:xx:xx:xx:xx:xx timed out. >> Oct 27 10:57:47 mole wpa_supplicant[2256]: wlan0: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1 >> >> If I revert just this revision based on a r257155 checkout, it works >> again. >> >> Stefan From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 18:10:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7EA33778; Mon, 28 Oct 2013 18:10:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2272236; Mon, 28 Oct 2013 18:10:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SIAaYN066380; Mon, 28 Oct 2013 18:10:36 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SIAZgK066376; Mon, 28 Oct 2013 18:10:35 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310281810.r9SIAZgK066376@svn.freebsd.org> From: Sean Bruno Date: Mon, 28 Oct 2013 18:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257263 - head/contrib/groff/src/roff/troff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 18:10:36 -0000 Author: sbruno Date: Mon Oct 28 18:10:35 2013 New Revision: 257263 URL: http://svnweb.freebsd.org/changeset/base/257263 Log: Quiesce warnings -Wdangling-else Thanks to jilles for some reviews and tips. Modified: head/contrib/groff/src/roff/troff/input.cpp head/contrib/groff/src/roff/troff/mtsm.cpp head/contrib/groff/src/roff/troff/node.cpp Modified: head/contrib/groff/src/roff/troff/input.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/input.cpp Mon Oct 28 16:27:01 2013 (r257262) +++ head/contrib/groff/src/roff/troff/input.cpp Mon Oct 28 18:10:35 2013 (r257263) @@ -2789,18 +2789,19 @@ void process_input_stack() case token::TOKEN_TRANSPARENT: { if (bol) { - if (possibly_handle_first_page_transition()) + if (possibly_handle_first_page_transition()) { ; - else { + } else { int cc; do { node *n; cc = get_copy(&n); - if (cc != EOF) + if (cc != EOF) { if (cc != '\0') curdiv->transparent_output(transparent_translate(cc)); else curdiv->transparent_output(n); + } } while (cc != '\n' && cc != EOF); if (cc == EOF) curdiv->transparent_output('\n'); @@ -2811,9 +2812,9 @@ void process_input_stack() case token::TOKEN_NEWLINE: { if (bol && !old_have_input - && !curenv->get_prev_line_interrupted()) + && !curenv->get_prev_line_interrupted()) { trapping_blank_line(); - else { + } else { curenv->newline(); bol = 1; } Modified: head/contrib/groff/src/roff/troff/mtsm.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/mtsm.cpp Mon Oct 28 16:27:01 2013 (r257262) +++ head/contrib/groff/src/roff/troff/mtsm.cpp Mon Oct 28 18:10:35 2013 (r257263) @@ -482,21 +482,24 @@ void mtsm::flush(FILE *fp, statem *s, st void statem::display_state() { fprintf(stderr, " "); fflush(stderr); } Modified: head/contrib/groff/src/roff/troff/node.cpp ============================================================================== --- head/contrib/groff/src/roff/troff/node.cpp Mon Oct 28 16:27:01 2013 (r257262) +++ head/contrib/groff/src/roff/troff/node.cpp Mon Oct 28 18:10:35 2013 (r257263) @@ -4600,14 +4600,14 @@ void hline_node::tprint(troff_output_fil } else { hunits rem = x - w*i; - if (rem > H0) + if (rem > H0) { if (n->overlaps_horizontally()) { if (out->is_on()) n->tprint(out); out->right(rem - w); - } - else + } else out->right(rem); + } while (--i >= 0) if (out->is_on()) n->tprint(out); From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 18:15:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 84313C60; Mon, 28 Oct 2013 18:15:27 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAD92288; Mon, 28 Oct 2013 18:15:25 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep23-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131028181405.BHN8401.viefep23-int.chello.at@edge02.upcmail.net>; Mon, 28 Oct 2013 19:14:05 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge02.upcmail.net with edge id iiE51m01W2xdvHc02iE5ss; Mon, 28 Oct 2013 19:14:05 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 0698F6D47B; Mon, 28 Oct 2013 19:14:04 +0100 (CET) Date: Mon, 28 Oct 2013 19:14:04 +0100 From: Stefan Farfeleder To: Adrian Chadd Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131028181403.GD1550@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 18:15:27 -0000 On Mon, Oct 28, 2013 at 10:17:02AM -0700, Adrian Chadd wrote: > Ping, any response? > > I'd like to narrow down what's going on here. Yeah, I'll have results soon, at the moment rebuilding my kernel. Stefan From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 18:24:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 911E56C9; Mon, 28 Oct 2013 18:24:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC202343; Mon, 28 Oct 2013 18:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SIOYX4073430; Mon, 28 Oct 2013 18:24:34 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SIOWSl073414; Mon, 28 Oct 2013 18:24:32 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310281824.r9SIOWSl073414@svn.freebsd.org> From: Sean Bruno Date: Mon, 28 Oct 2013 18:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257264 - in head/contrib/opie: . libopie X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 18:24:34 -0000 Author: sbruno Date: Mon Oct 28 18:24:31 2013 New Revision: 257264 URL: http://svnweb.freebsd.org/changeset/base/257264 Log: Queisce two category of clang warnings: 1. missing explicit includes for string.h, stdio.h, etc 2. missing explicit declaration for some common functions I have been unable to contact the upstream maintainer for this patch, http://www.inner.net/opie appears to be the source of truth but it unreachable Modified: head/contrib/opie/libopie/accessfile.c head/contrib/opie/libopie/generator.c head/contrib/opie/libopie/lookup.c head/contrib/opie/libopie/newseed.c head/contrib/opie/libopie/parsechallenge.c head/contrib/opie/libopie/passwd.c head/contrib/opie/libopie/randomchallenge.c head/contrib/opie/libopie/verify.c head/contrib/opie/libopie/version.c head/contrib/opie/opie.h head/contrib/opie/opieinfo.c head/contrib/opie/opiekey.c Modified: head/contrib/opie/libopie/accessfile.c ============================================================================== --- head/contrib/opie/libopie/accessfile.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/accessfile.c Mon Oct 28 18:24:31 2013 (r257264) @@ -28,6 +28,7 @@ License Agreement applies to this softwa #include "opie_cfg.h" #include +#include #include #include #include Modified: head/contrib/opie/libopie/generator.c ============================================================================== --- head/contrib/opie/libopie/generator.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/generator.c Mon Oct 28 18:24:31 2013 (r257264) @@ -49,6 +49,7 @@ $FreeBSD$ #if DEBUG #include #endif /* DEBUG */ +#include #include "opie.h" static char *algids[] = { NULL, NULL, NULL, "sha1", "md4", "md5" }; Modified: head/contrib/opie/libopie/lookup.c ============================================================================== --- head/contrib/opie/libopie/lookup.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/lookup.c Mon Oct 28 18:24:31 2013 (r257264) @@ -13,6 +13,7 @@ you didn't get a copy, you may request o #include "opie_cfg.h" #include +#include #include "opie.h" int opielookup FUNCTION((opie, principal), struct opie *opie AND char *principal) Modified: head/contrib/opie/libopie/newseed.c ============================================================================== --- head/contrib/opie/libopie/newseed.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/newseed.c Mon Oct 28 18:24:31 2013 (r257264) @@ -18,6 +18,9 @@ $FreeBSD$ */ #include "opie_cfg.h" +#ifndef HAVE_TIME_H +#define HAVE_TIME_H 1 +#endif #if HAVE_TIME_H #include #endif /* HAVE_TIME_H */ @@ -35,6 +38,8 @@ $FreeBSD$ #if DEBUG #include #endif /* DEBUG */ +#include +#include #include "opie.h" int opienewseed FUNCTION((seed), char *seed) Modified: head/contrib/opie/libopie/parsechallenge.c ============================================================================== --- head/contrib/opie/libopie/parsechallenge.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/parsechallenge.c Mon Oct 28 18:24:31 2013 (r257264) @@ -19,6 +19,8 @@ you didn't get a copy, you may request o #if HAVE_STRING_H #include #endif /* HAVE_STRING_H */ +#include +#include #include "opie.h" struct algorithm { Modified: head/contrib/opie/libopie/passwd.c ============================================================================== --- head/contrib/opie/libopie/passwd.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/passwd.c Mon Oct 28 18:24:31 2013 (r257264) @@ -20,6 +20,7 @@ you didn't get a copy, you may request o Created by cmetz for OPIE 2.22. */ +#include #include "opie_cfg.h" #include "opie.h" Modified: head/contrib/opie/libopie/randomchallenge.c ============================================================================== --- head/contrib/opie/libopie/randomchallenge.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/randomchallenge.c Mon Oct 28 18:24:31 2013 (r257264) @@ -26,6 +26,9 @@ License Agreement applies to this softwa Created at NRL for OPIE 2.2 from opiesubr2.c */ +#include +#include +#include #include "opie_cfg.h" #include "opie.h" Modified: head/contrib/opie/libopie/verify.c ============================================================================== --- head/contrib/opie/libopie/verify.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/verify.c Mon Oct 28 18:24:31 2013 (r257264) @@ -24,6 +24,7 @@ you didn't get a copy, you may request o #ifdef HAVE_STRING_H #include #endif /* HAVE_STRING_H */ +#include #include "opie.h" #define RESPONSE_STANDARD 0 Modified: head/contrib/opie/libopie/version.c ============================================================================== --- head/contrib/opie/libopie/version.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/libopie/version.c Mon Oct 28 18:24:31 2013 (r257264) @@ -17,6 +17,8 @@ License Agreement applies to this softwa Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. Created at NRL for OPIE 2.2 from opiesubr.c. */ +#include +#include #include "opie_cfg.h" #include "opie.h" Modified: head/contrib/opie/opie.h ============================================================================== --- head/contrib/opie/opie.h Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/opie.h Mon Oct 28 18:24:31 2013 (r257264) @@ -128,6 +128,7 @@ void opieunlockaeh __P((void)); void opiedisableaeh __P((void)); int opielookup __P((struct opie *,char *)); int opiepasscheck __P((char *)); +int opienewseed __P((char *)); void opierandomchallenge __P((char *)); char * opieskipspace __P((register char *)); void opiestripcrlf __P((char *)); @@ -139,6 +140,8 @@ const char *opie_get_algorithm __P((void int opie_haskey __P((char *username)); char *opie_keyinfo __P((char *)); int opie_passverify __P((char *username, char *passwd)); +int opieinsecure __P((void)); +void opieversion __P((void)); __END_DECLS #if _OPIE @@ -158,6 +161,7 @@ FILE *__opieopen __P((char *, int, int)) int __opiereadrec __P((struct opie *)); int __opiewriterec __P((struct opie *)); int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts)); +VOIDRET opiehashlen __P((int algorithm, VOIDPTR in, struct opie_otpkey *out, int n)); __END_DECLS #define opiestrncpy(dst, src, n) \ Modified: head/contrib/opie/opieinfo.c ============================================================================== --- head/contrib/opie/opieinfo.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/opieinfo.c Mon Oct 28 18:24:31 2013 (r257264) @@ -38,6 +38,7 @@ $FreeBSD$ #include #include #include +#include #include #if HAVE_UNISTD_H #include Modified: head/contrib/opie/opiekey.c ============================================================================== --- head/contrib/opie/opiekey.c Mon Oct 28 18:10:35 2013 (r257263) +++ head/contrib/opie/opiekey.c Mon Oct 28 18:24:31 2013 (r257264) @@ -45,6 +45,7 @@ $FreeBSD$ #include #include #include +#include #include "opie.h" From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 18:43:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 324D7752; Mon, 28 Oct 2013 18:43:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C01724CF; Mon, 28 Oct 2013 18:43:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SIh0ox081500; Mon, 28 Oct 2013 18:43:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SIh0vP081499; Mon, 28 Oct 2013 18:43:00 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310281843.r9SIh0vP081499@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Oct 2013 18:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257265 - head/sys/arm/xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 18:43:01 -0000 Author: ian Date: Mon Oct 28 18:43:00 2013 New Revision: 257265 URL: http://svnweb.freebsd.org/changeset/base/257265 Log: Follow r257244; it's now necessary to include if_var.h. Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Mon Oct 28 18:24:31 2013 (r257264) +++ head/sys/arm/xscale/ixp425/if_npe.c Mon Oct 28 18:43:00 2013 (r257265) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 19:00:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2C252352; Mon, 28 Oct 2013 19:00:35 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id BF4F925F3; Mon, 28 Oct 2013 19:00:33 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep19-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131028190005.ADH11128.viefep19-int.chello.at@edge02.upcmail.net>; Mon, 28 Oct 2013 20:00:05 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge02.upcmail.net with edge id ij051m00o2xdvHc02j050J; Mon, 28 Oct 2013 20:00:05 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 4D1FD6D47B; Mon, 28 Oct 2013 20:00:05 +0100 (CET) Date: Mon, 28 Oct 2013 20:00:05 +0100 From: Stefan Farfeleder To: Adrian Chadd Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131028190005.GA1509@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 19:00:35 -0000 On Mon, Oct 28, 2013 at 10:17:02AM -0700, Adrian Chadd wrote: > Ping, any response? > > I'd like to narrow down what's going on here. http://pastebin.com/veDsb0Xj Does this help in any way? Stefan From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 19:07:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 361AB823; Mon, 28 Oct 2013 19:07:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5BE1263D; Mon, 28 Oct 2013 19:07:18 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id x19so4092163qcw.37 for ; Mon, 28 Oct 2013 12:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=WMKALzX3l9hbpsRsgm/QoImAwPGeOkLfHAOKhw8hV94=; b=gw/H8ESuO4/3QcPye3CEYxTeEmIe2g1i33f4++DPxuv/kclD6tnGLa4XBSvjgn06hu +WV+N1ub8mGZR9fbsIbwMrQcSHMJmqqhYvTQDDO7hTJW+M6nqgEagzezubmNrtqVQbRL BA8eFF2O1UebL/DBKM+zlrgyCyoIjbZ3kCrpiqRWqnrhdPpd2bFIu8TGgoc178OfQa1U B+xF3DzbznKh51wTkswmbCOqeSoLyOyJd6h0EzjquhrtlF8Nw6Zorp+WPWDSFaJOufZP udp0QdkNKOvHTBiKlCXOZcRUTzSzP0GIPCwHzyhaPf/zhGAG0GwjC4oJnmqWDIQQptHs s1hw== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr31536413qad.76.1382987237152; Mon, 28 Oct 2013 12:07:17 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 28 Oct 2013 12:07:17 -0700 (PDT) In-Reply-To: <20131028190005.GA1509@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> Date: Mon, 28 Oct 2013 12:07:17 -0700 X-Google-Sender-Auth: mELik8Sivb0UMjqbFIEfcV_i5lc Message-ID: Subject: Re: svn commit: r257133 - head/sys/dev/iwn From: Adrian Chadd To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 19:07:19 -0000 Yeah: Oct 28 19:43:43 mole kernel: iwn5000_tx_done: qid 3 idx 4 retries 7 nkill 0 rate a902 duration 686 status 83 status 0x83 is LONG_LIMIT, which meant it tried to transmit and it failed to get an ACK each time. The rate control says: 0x02: the rate in question bit 8: MCS bit 11: HT40 bits 14+15: transmit antennas A+B .. and it's an association/management frame, which is odd as they're not supposed to be sent as 11n HT40 frames like this. can you do the same experiment but with the patch reverted? I'd like to see what the selected rate is. Thanks! -adrian On 28 October 2013 12:00, Stefan Farfeleder wrote: > On Mon, Oct 28, 2013 at 10:17:02AM -0700, Adrian Chadd wrote: >> Ping, any response? >> >> I'd like to narrow down what's going on here. > > http://pastebin.com/veDsb0Xj > > Does this help in any way? > > Stefan From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 19:27:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5686732; Mon, 28 Oct 2013 19:27:41 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 9388E27CC; Mon, 28 Oct 2013 19:27:39 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep12-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131028192733.KHD985.viefep12-int.chello.at@edge03.upcmail.net>; Mon, 28 Oct 2013 20:27:33 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge03.upcmail.net with edge id ijTY1m01A2xdvHc03jTY8C; Mon, 28 Oct 2013 20:27:33 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id AAF1C6D47B; Mon, 28 Oct 2013 20:27:32 +0100 (CET) Date: Mon, 28 Oct 2013 20:27:32 +0100 From: Stefan Farfeleder To: Adrian Chadd Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131028192731.GA1505@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 19:27:41 -0000 On Mon, Oct 28, 2013 at 12:07:17PM -0700, Adrian Chadd wrote: > Yeah: > > Oct 28 19:43:43 mole kernel: iwn5000_tx_done: qid 3 idx 4 retries 7 > nkill 0 rate a902 duration 686 status 83 > > status 0x83 is LONG_LIMIT, which meant it tried to transmit and it > failed to get an ACK each time. > > The rate control says: > > 0x02: the rate in question > bit 8: MCS > bit 11: HT40 > bits 14+15: transmit antennas A+B > > .. and it's an association/management frame, which is odd as they're > not supposed to be sent as 11n HT40 frames like this. > > can you do the same experiment but with the patch reverted? I'd like > to see what the selected rate is. Ok, here's the output with r257155 and r257133 reverted: http://pastebin.com/CJzsTANv Stefan From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 19:30:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CB8AF892; Mon, 28 Oct 2013 19:30:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B951E27E3; Mon, 28 Oct 2013 19:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SJU96k004066; Mon, 28 Oct 2013 19:30:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SJU9b8004065; Mon, 28 Oct 2013 19:30:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310281930.r9SJU9b8004065@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 28 Oct 2013 19:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257266 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 19:30:09 -0000 Author: kib Date: Mon Oct 28 19:30:09 2013 New Revision: 257266 URL: http://svnweb.freebsd.org/changeset/base/257266 Log: Remove redundand assignment to error variable and check for its value [1]. Do CTR logging in the case of error as well. Noted by: rdivacky [1] Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Mon Oct 28 18:43:00 2013 (r257265) +++ head/sys/x86/iommu/busdma_dmar.c Mon Oct 28 19:30:09 2013 (r257266) @@ -163,18 +163,15 @@ dmar_bus_dma_tag_create(bus_dma_tag_t pa nsegments, maxsegsz, flags, lockfunc, lockfuncarg, sizeof(struct bus_dma_tag_dmar), (void **)&newtag); if (error != 0) - return (error); + goto out; oldtag = (struct bus_dma_tag_dmar *)parent; newtag->common.impl = &bus_dma_dmar_impl; newtag->ctx = oldtag->ctx; newtag->owner = oldtag->owner; - error = 0; - if (error != 0) - free(newtag, M_DEVBUF); - else - *dmat = (bus_dma_tag_t)newtag; + *dmat = (bus_dma_tag_t)newtag; +out: CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), error); From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 19:46:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8CB7EB2A; Mon, 28 Oct 2013 19:46:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77C3C28D4; Mon, 28 Oct 2013 19:46:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SJk23E008505; Mon, 28 Oct 2013 19:46:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SJk2ss008503; Mon, 28 Oct 2013 19:46:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310281946.r9SJk2ss008503@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 28 Oct 2013 19:46:02 +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: r257267 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 19:46:02 -0000 Author: pfg Date: Mon Oct 28 19:46:01 2013 New Revision: 257267 URL: http://svnweb.freebsd.org/changeset/base/257267 Log: MFC r255338: ext2fs: temporarily disable htree directory index. In addition to our implementation not having workarounds for hash collisions, it appears we also have a compatibility problem. For now disable the htree code until we are able to re-examine both issues. PR: kern/183230 Modified: stable/9/sys/fs/ext2fs/ext2_htree.c stable/9/sys/fs/ext2fs/ext2_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_htree.c Mon Oct 28 19:30:09 2013 (r257266) +++ stable/9/sys/fs/ext2fs/ext2_htree.c Mon Oct 28 19:46:01 2013 (r257267) @@ -89,10 +89,12 @@ static int ext2_htree_writebuf(struct ex int ext2_htree_has_idx(struct inode *ip) { +#ifdef EXT2FS_HTREE if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) && ip->i_flags & EXT4_INDEX) return (1); else +#endif return (0); } Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Mon Oct 28 19:30:09 2013 (r257266) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Mon Oct 28 19:46:01 2013 (r257267) @@ -884,6 +884,7 @@ ext2_direnter(struct inode *ip, struct v bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1); newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen); +#ifdef EXT2FS_HTREE if (ext2_htree_has_idx(dp)) { error = ext2_htree_add_entry(dvp, &newdir, cnp); if (error) { @@ -904,6 +905,7 @@ ext2_direnter(struct inode *ip, struct v return ext2_htree_create_index(dvp, cnp, &newdir); } } +#endif /* EXT2FS_HTREE */ if (dp->i_count == 0) { /* From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 19:56:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 640BFEEA; Mon, 28 Oct 2013 19:56:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9CC296A; Mon, 28 Oct 2013 19:56:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SJulNT012028; Mon, 28 Oct 2013 19:56:47 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SJuleA012027; Mon, 28 Oct 2013 19:56:47 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310281956.r9SJuleA012027@svn.freebsd.org> From: Brooks Davis Date: Mon, 28 Oct 2013 19:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257268 - head/gnu/usr.bin/binutils/ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 19:56:47 -0000 Author: brooks Date: Mon Oct 28 19:56:46 2013 New Revision: 257268 URL: http://svnweb.freebsd.org/changeset/base/257268 Log: Enable the --sysroot=/foo option in ld by always building with a sysroot defined. When not building as a cross linker, the sysroot is set to "/". Exp-run by: bdrewery (ports/183206) MFC after: 3 days Modified: head/gnu/usr.bin/binutils/ld/Makefile Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:46:01 2013 (r257267) +++ head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:56:46 2013 (r257268) @@ -31,7 +31,7 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\" CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\" CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\" +CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\" CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\" CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:16:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB38849D; Mon, 28 Oct 2013 20:16:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 972AC2AD8; Mon, 28 Oct 2013 20:16:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SKG08S019157; Mon, 28 Oct 2013 20:16:00 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SKG0KU019154; Mon, 28 Oct 2013 20:16:00 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310282016.r9SKG0KU019154@svn.freebsd.org> From: Brooks Davis Date: Mon, 28 Oct 2013 20:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257269 - head/sys/dev/altera/atse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:16:00 -0000 Author: brooks Date: Mon Oct 28 20:15:59 2013 New Revision: 257269 URL: http://svnweb.freebsd.org/changeset/base/257269 Log: Add a couple includes if net/if_var.h that were missed in r257176. Modified: head/sys/dev/altera/atse/if_atse_fdt.c head/sys/dev/altera/atse/if_atse_nexus.c Modified: head/sys/dev/altera/atse/if_atse_fdt.c ============================================================================== --- head/sys/dev/altera/atse/if_atse_fdt.c Mon Oct 28 19:56:46 2013 (r257268) +++ head/sys/dev/altera/atse/if_atse_fdt.c Mon Oct 28 20:15:59 2013 (r257269) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/altera/atse/if_atse_nexus.c ============================================================================== --- head/sys/dev/altera/atse/if_atse_nexus.c Mon Oct 28 19:56:46 2013 (r257268) +++ head/sys/dev/altera/atse/if_atse_nexus.c Mon Oct 28 20:15:59 2013 (r257269) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:26:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 39A0D840; Mon, 28 Oct 2013 20:26:35 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 277A12B88; Mon, 28 Oct 2013 20:26:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SKQZth022825; Mon, 28 Oct 2013 20:26:35 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SKQYYq022824; Mon, 28 Oct 2013 20:26:34 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201310282026.r9SKQYYq022824@svn.freebsd.org> From: Olivier Houchard Date: Mon, 28 Oct 2013 20:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257270 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:26:35 -0000 Author: cognet Date: Mon Oct 28 20:26:34 2013 New Revision: 257270 URL: http://svnweb.freebsd.org/changeset/base/257270 Log: Include , since we need it if ATH_DEBUG is defined. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Oct 28 20:15:59 2013 (r257269) +++ head/sys/dev/ath/if_ath_tx.c Mon Oct 28 20:26:34 2013 (r257270) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:32:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A1E9BAE; Mon, 28 Oct 2013 20:32:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06F522BFF; Mon, 28 Oct 2013 20:32:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SKW6G3025644; Mon, 28 Oct 2013 20:32:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SKW6JC025639; Mon, 28 Oct 2013 20:32:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282032.r9SKW6JC025639@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 20:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257271 - in head/sys: net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:32:07 -0000 Author: glebius Date: Mon Oct 28 20:32:05 2013 New Revision: 257271 URL: http://svnweb.freebsd.org/changeset/base/257271 Log: Style: s/SYS_EVENTHANDLER_H/_SYS_EVENTHANDLER_H_/g Submitted by: bde Modified: head/sys/net/bpf.h head/sys/net/if_clone.h head/sys/net/if_var.h head/sys/net/if_vlan_var.h head/sys/sys/eventhandler.h Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon Oct 28 20:26:34 2013 (r257270) +++ head/sys/net/bpf.h Mon Oct 28 20:32:05 2013 (r257271) @@ -1310,12 +1310,12 @@ bpf_peers_present(struct bpf_if *bpf) */ #define BPF_MEMWORDS 16 -#ifdef SYS_EVENTHANDLER_H +#ifdef _SYS_EVENTHANDLER_H_ /* BPF attach/detach events */ struct ifnet; typedef void (*bpf_track_fn)(void *, struct ifnet *, int /* dlt */, int /* 1 =>'s attach */); EVENTHANDLER_DECLARE(bpf_track, bpf_track_fn); -#endif /* SYS_EVENTHANDLER_H */ +#endif /* _SYS_EVENTHANDLER_H_ */ #endif /* _NET_BPF_H_ */ Modified: head/sys/net/if_clone.h ============================================================================== --- head/sys/net/if_clone.h Mon Oct 28 20:26:34 2013 (r257270) +++ head/sys/net/if_clone.h Mon Oct 28 20:32:05 2013 (r257271) @@ -58,7 +58,7 @@ int ifc_name2unit(const char *name, int int ifc_alloc_unit(struct if_clone *, int *); void ifc_free_unit(struct if_clone *, int); -#ifdef SYS_EVENTHANDLER_H +#ifdef _SYS_EVENTHANDLER_H_ /* Interface clone event. */ typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Oct 28 20:26:34 2013 (r257270) +++ head/sys/net/if_var.h Mon Oct 28 20:32:05 2013 (r257271) @@ -353,7 +353,7 @@ void if_maddr_runlock(struct ifnet *ifp) } while(0) #ifdef _KERNEL -#ifdef SYS_EVENTHANDLER_H +#ifdef _SYS_EVENTHANDLER_H_ /* interface link layer address change event */ typedef void (*iflladdr_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(iflladdr_event, iflladdr_event_handler_t); @@ -369,7 +369,7 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); -#endif /* SYS_EVENTHANDLER_H */ +#endif /* _SYS_EVENTHANDLER_H_ */ /* * interface groups @@ -392,7 +392,7 @@ struct ifg_list { TAILQ_ENTRY(ifg_list) ifgl_next; }; -#ifdef SYS_EVENTHANDLER_H +#ifdef _SYS_EVENTHANDLER_H_ /* group attach event */ typedef void (*group_attach_event_handler_t)(void *, struct ifg_group *); EVENTHANDLER_DECLARE(group_attach_event, group_attach_event_handler_t); @@ -402,7 +402,7 @@ EVENTHANDLER_DECLARE(group_detach_event, /* group change event */ typedef void (*group_change_event_handler_t)(void *, const char *); EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t); -#endif /* SYS_EVENTHANDLER_H */ +#endif /* _SYS_EVENTHANDLER_H_ */ #define IF_AFDATA_LOCK_INIT(ifp) \ rw_init(&(ifp)->if_afdata_lock, "if_afdata") Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Mon Oct 28 20:26:34 2013 (r257270) +++ head/sys/net/if_vlan_var.h Mon Oct 28 20:32:05 2013 (r257271) @@ -150,13 +150,13 @@ extern int (*vlan_tag_p)(struct ifnet *, extern int (*vlan_setcookie_p)(struct ifnet *, void *); extern void *(*vlan_cookie_p)(struct ifnet *); -#ifdef SYS_EVENTHANDLER_H +#ifdef _SYS_EVENTHANDLER_H_ /* VLAN state change events */ typedef void (*vlan_config_fn)(void *, struct ifnet *, uint16_t); typedef void (*vlan_unconfig_fn)(void *, struct ifnet *, uint16_t); EVENTHANDLER_DECLARE(vlan_config, vlan_config_fn); EVENTHANDLER_DECLARE(vlan_unconfig, vlan_unconfig_fn); -#endif /* SYS_EVENTHANDLER_H */ +#endif /* _SYS_EVENTHANDLER_H_ */ #endif /* _KERNEL */ Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Mon Oct 28 20:26:34 2013 (r257270) +++ head/sys/sys/eventhandler.h Mon Oct 28 20:32:05 2013 (r257271) @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef SYS_EVENTHANDLER_H -#define SYS_EVENTHANDLER_H +#ifndef _SYS_EVENTHANDLER_H_ +#define _SYS_EVENTHANDLER_H_ #include #include @@ -262,4 +262,4 @@ EVENTHANDLER_DECLARE(kld_load, kld_load_ EVENTHANDLER_DECLARE(kld_unload, kld_unload_fn); EVENTHANDLER_DECLARE(kld_unload_try, kld_unload_try_fn); -#endif /* SYS_EVENTHANDLER_H */ +#endif /* _SYS_EVENTHANDLER_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:32:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F0834CEC; Mon, 28 Oct 2013 20:32:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDE5D2C06; Mon, 28 Oct 2013 20:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SKWbEd025732; Mon, 28 Oct 2013 20:32:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SKWb2q025731; Mon, 28 Oct 2013 20:32:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201310282032.r9SKWb2q025731@svn.freebsd.org> From: Michael Tuexen Date: Mon, 28 Oct 2013 20:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257272 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:32:38 -0000 Author: tuexen Date: Mon Oct 28 20:32:37 2013 New Revision: 257272 URL: http://svnweb.freebsd.org/changeset/base/257272 Log: Fix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined. The issue was reported by Andrew Galante. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Oct 28 20:32:05 2013 (r257271) +++ head/sys/netinet/sctp_pcb.c Mon Oct 28 20:32:37 2013 (r257272) @@ -3740,7 +3740,7 @@ sctp_add_remote_addr(struct sctp_tcb *st sin->sin_len = sizeof(struct sockaddr_in); if (set_scope) { #ifdef SCTP_DONT_DO_PRIVADDR_SCOPE - stcb->ipv4_local_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; #else if (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { stcb->asoc.scope.ipv4_local_scope = 1; From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:38:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F3B92E9E; Mon, 28 Oct 2013 20:38:17 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0C842C40; Mon, 28 Oct 2013 20:38:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SKcHov026449; Mon, 28 Oct 2013 20:38:17 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SKcHrr026448; Mon, 28 Oct 2013 20:38:17 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310282038.r9SKcHrr026448@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 28 Oct 2013 20:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257273 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:38:18 -0000 Author: pluknet Date: Mon Oct 28 20:38:17 2013 New Revision: 257273 URL: http://svnweb.freebsd.org/changeset/base/257273 Log: G/c unused mountrootfsname. It was replaced with rootdevnames in r52778. Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Mon Oct 28 20:32:37 2013 (r257272) +++ head/sys/sys/mount.h Mon Oct 28 20:38:17 2013 (r257273) @@ -806,8 +806,6 @@ vfs_statfs_t __vfs_statfs; }; \ DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE) -extern char *mountrootfsname; - /* * exported vnode operations */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:45:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D1095E8; Mon, 28 Oct 2013 20:45:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE2F32CA6; Mon, 28 Oct 2013 20:45:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SKjJU7029439; Mon, 28 Oct 2013 20:45:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SKjJTS029438; Mon, 28 Oct 2013 20:45:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201310282045.r9SKjJTS029438@svn.freebsd.org> From: Michael Tuexen Date: Mon, 28 Oct 2013 20:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257274 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:45:19 -0000 Author: tuexen Date: Mon Oct 28 20:45:19 2013 New Revision: 257274 URL: http://svnweb.freebsd.org/changeset/base/257274 Log: Fis the value of *optlen when calling getsockopt() for SCTP_REMOTE_UDP_ENCAPS_PORT. This issue was reported by Andrew Galante. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Oct 28 20:38:17 2013 (r257273) +++ head/sys/netinet/sctp_usrreq.c Mon Oct 28 20:45:19 2013 (r257274) @@ -3281,7 +3281,7 @@ flags_out: } } if (error == 0) { - *optsize = sizeof(struct sctp_paddrparams); + *optsize = sizeof(struct sctp_udpencaps); } break; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 20:49:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE8CD3CE; Mon, 28 Oct 2013 20:49:06 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 760302CD5; Mon, 28 Oct 2013 20:49:06 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id F3221C2586; Mon, 28 Oct 2013 20:41:13 +0000 (UTC) Date: Mon, 28 Oct 2013 21:41:13 +0100 From: Jeremie Le Hen To: Gleb Smirnoff Subject: Re: svn commit: r256512 - head/usr.bin/netstat Message-ID: <20131028204113.GA37879@caravan.chchile.org> Mail-Followup-To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201310150955.r9F9t8pq084143@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310150955.r9F9t8pq084143@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 20:49:06 -0000 Hi Gleb, On Tue, Oct 15, 2013 at 09:55:08AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Oct 15 09:55:07 2013 > New Revision: 256512 > URL: http://svnweb.freebsd.org/changeset/base/256512 > > Log: > Rewrite netstat/if.c to use getifaddrs(3) and getifmaddrs(3) instead of > libkvm digging in kernel memory. This is possible since r231506 made > getifaddrs(3) to supply if_data for each ifaddr. > > The pros of this change is that now netstat(1) doesn't know about kernel > struct ifnet and struct ifaddr. And these structs are about to change > significantly in head soon. New netstat binary will work well with 10.0 > and any future kernel. > > The cons is that now it isn't possible to obtain interface statistics > from a vmcore. Is there a kgdb macro or something like that that could be used for debugging purpose? -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:08:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7D5A0A24; Mon, 28 Oct 2013 21:08:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0E92E29; Mon, 28 Oct 2013 21:08:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SL859l036504; Mon, 28 Oct 2013 21:08:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SL85aM036502; Mon, 28 Oct 2013 21:08:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282108.r9SL85aM036502@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 21:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257275 - in head/sys/dev/xen: netback netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:08:05 -0000 Author: glebius Date: Mon Oct 28 21:08:04 2013 New Revision: 257275 URL: http://svnweb.freebsd.org/changeset/base/257275 Log: Include if_var.h. Modified: head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Mon Oct 28 20:45:19 2013 (r257274) +++ head/sys/dev/xen/netback/netback.c Mon Oct 28 21:08:04 2013 (r257275) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Mon Oct 28 20:45:19 2013 (r257274) +++ head/sys/dev/xen/netfront/netfront.c Mon Oct 28 21:08:04 2013 (r257275) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:09:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 96A3CB8C; Mon, 28 Oct 2013 21:09:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 822952E40; Mon, 28 Oct 2013 21:09:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SL9x6w036794; Mon, 28 Oct 2013 21:09:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SL9xuu036793; Mon, 28 Oct 2013 21:09:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282109.r9SL9xuu036793@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 21:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257276 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:09:59 -0000 Author: glebius Date: Mon Oct 28 21:09:59 2013 New Revision: 257276 URL: http://svnweb.freebsd.org/changeset/base/257276 Log: Remove dead function show_device(). It isn't buildable if DEBUG is defined, due to unknown field "xn_ifno". The field wasn't known since beginning of history of this file. Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Mon Oct 28 21:08:04 2013 (r257275) +++ head/sys/dev/xen/netfront/netfront.c Mon Oct 28 21:09:59 2013 (r257276) @@ -165,7 +165,6 @@ static int xn_configure_features(struct static void xn_watchdog(struct ifnet *); #endif -static void show_device(struct netfront_info *sc); #ifdef notyet static void netfront_closing(device_t dev); #endif @@ -644,8 +643,6 @@ setup_device(device_t dev, struct netfro goto fail; } - show_device(info); - return (0); fail: @@ -1969,25 +1966,6 @@ network_connect(struct netfront_info *np return (0); } -static void -show_device(struct netfront_info *sc) -{ -#ifdef DEBUG - if (sc) { - IPRINTK("\n", - sc->xn_ifno, - be_state_name[sc->xn_backend_state], - sc->xn_user_state ? "open" : "closed", - sc->xn_evtchn, - sc->xn_irq, - sc->xn_tx_if, - sc->xn_rx_if); - } else { - IPRINTK("\n"); - } -#endif -} - static void xn_query_features(struct netfront_info *np) { From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:11:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AE097DD8; Mon, 28 Oct 2013 21:11:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B6282E89; Mon, 28 Oct 2013 21:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SLBSn1039211; Mon, 28 Oct 2013 21:11:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SLBSSA039209; Mon, 28 Oct 2013 21:11:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282111.r9SLBSSA039209@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 21:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257277 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:11:28 -0000 Author: glebius Date: Mon Oct 28 21:11:28 2013 New Revision: 257277 URL: http://svnweb.freebsd.org/changeset/base/257277 Log: Include XEN and HyperV into amd64 LINT. Modified: head/sys/amd64/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Oct 28 21:09:59 2013 (r257276) +++ head/sys/amd64/conf/NOTES Mon Oct 28 21:11:28 2013 (r257277) @@ -473,6 +473,12 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device hyperv # HyperV drivers + +# Xen HVM Guest Optimizations +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver + ##################################################################### # From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:17:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56AD52AD; Mon, 28 Oct 2013 21:17:02 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE202EE0; Mon, 28 Oct 2013 21:17:02 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id 7F34EC2965; Mon, 28 Oct 2013 21:17:00 +0000 (UTC) Date: Mon, 28 Oct 2013 22:17:00 +0100 From: Jeremie Le Hen To: Adam McDougall Subject: Re: svn commit: r254974 - in head: etc/defaults etc/periodic/monthly etc/periodic/security etc/periodic/weekly share/man/man5 Message-ID: <20131028211700.GB37879@caravan.chchile.org> Mail-Followup-To: Adam McDougall , svn-src-all@freebsd.org References: <201308272120.r7RLKTvk066897@svn.freebsd.org> <20131021000110.GJ2097@egr.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131021000110.GJ2097@egr.msu.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Jeremie Le Hen , svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:17:02 -0000 Hi Adam, On Sun, Oct 20, 2013 at 08:01:10PM -0400, Adam McDougall wrote: > Thanks for working on this, I look forward to taking advantage of it! > > I have a system with some old style adjustments in periodic.conf but > the compat shim doesn't seem to be working (it is running r255793). > I filed PR conf/183137 with more details. Sorry for the late reply, I was abroad. Can you test the following patch please? Index: etc/defaults/periodic.conf =================================================================== --- etc/defaults/periodic.conf (revision 255169) +++ etc/defaults/periodic.conf (working copy) @@ -319,7 +319,7 @@ security_daily_compat_var() { local var=$1 dailyvar value - dailyvar=daily_status_security${#status_security} + dailyvar=daily_status_security${var#status_security} periodvar=${var%enable}period eval value=\"\$$dailyvar\" [ -z "$value" ] && return -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:31:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AC6221B6; Mon, 28 Oct 2013 21:31:13 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8C4206E; Mon, 28 Oct 2013 21:31:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SLVDGE045955; Mon, 28 Oct 2013 21:31:13 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SLVDGD045953; Mon, 28 Oct 2013 21:31:13 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310282131.r9SLVDGD045953@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 21:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257278 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:31:13 -0000 Author: zbb Date: Mon Oct 28 21:31:12 2013 New Revision: 257278 URL: http://svnweb.freebsd.org/changeset/base/257278 Log: Remove hard-coded mappings related to Armada XP support Armada XP initialization flow requires SoC registers to be mapped very early in order to configure Snoop Filter for SMP. Additional mapping in locore.S is redundant as proper mapping is made in pmap_devmap_bootstrap() prior to calling cpu_setup() which configures the Snoop Filter. For secondaru CPUs it is better to pass VA of the SoC registers defined in MV_BASE and PA consistent with the value in the Device Tree. Tested by: kevlo Modified: head/sys/arm/arm/locore.S head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Mon Oct 28 21:11:28 2013 (r257277) +++ head/sys/arm/arm/locore.S Mon Oct 28 21:31:12 2013 (r257278) @@ -266,10 +266,6 @@ mmu_init_table: /* map VA 0xc0000000..0xc3ffffff to PA */ MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(CPU_MV_PJ4B) - /* map VA 0xf1000000..0xf1100000 to PA 0xd0000000 */ - MMU_INIT(0xf1000000, 0xd0000000, 1, L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)) -#endif /* CPU_MV_PJ4B */ #endif /* SMP */ .word 0 /* end of table */ #endif Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Mon Oct 28 21:11:28 2013 (r257277) +++ head/sys/arm/arm/mp_machdep.c Mon Oct 28 21:31:12 2013 (r257278) @@ -52,6 +52,10 @@ __FBSDID("$FreeBSD$"); #ifdef VFP #include #endif +#ifdef CPU_MV_PJ4B +#include +#include +#endif #include "opt_smp.h" @@ -131,8 +135,8 @@ cpu_mp_start(void) #if defined(CPU_MV_PJ4B) /* Add ARMADAXP registers required for snoop filter initialization */ - ((int *)(temp_pagetable_va))[0xf1000000 >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)|0xd0000000; + ((int *)(temp_pagetable_va))[MV_BASE >> L1_S_SHIFT] = + L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)|fdt_immr_pa; #endif temp_pagetable = (void*)(vtophys(temp_pagetable_va)); From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:34:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6A2745C3; Mon, 28 Oct 2013 21:34:33 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55D0920B2; Mon, 28 Oct 2013 21:34:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SLYXCq046417; Mon, 28 Oct 2013 21:34:33 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SLYW8d046415; Mon, 28 Oct 2013 21:34:32 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310282134.r9SLYW8d046415@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 21:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257279 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:34:33 -0000 Author: zbb Date: Mon Oct 28 21:34:32 2013 New Revision: 257279 URL: http://svnweb.freebsd.org/changeset/base/257279 Log: Fix-up DTB for Armada XP registers' base according to the actual settings Depending on u-boot's flavor some boards have their SoC registers base address configured to 0xD0000000 and other to 0xF1000000. U-boot is passing currently set value via CP15 register. In order to create proper mapping for SoC registers and allow further successful initialization it is necessary to replace fdt_immr_pa with the real value and eventually fix-up device tree blob. Tested by: kevlo Modified: head/sys/arm/mv/common.c head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Mon Oct 28 21:31:12 2013 (r257278) +++ head/sys/arm/mv/common.c Mon Oct 28 21:34:32 2013 (r257279) @@ -2091,9 +2091,79 @@ fdt_fixup_busfreq(phandle_t root) OF_setprop(sb, "bus-frequency", (void *)&freq, sizeof(freq)); } +static void +fdt_fixup_ranges(phandle_t root) +{ + phandle_t node; + pcell_t par_addr_cells, addr_cells, size_cells; + pcell_t ranges[3], reg[2], *rangesptr; + int len, tuple_size, tuples_count; + uint32_t base; + + /* Fix-up SoC ranges according to real fdt_immr_pa */ + if ((node = fdt_find_compatible(root, "simple-bus", 1)) != 0) { + if (fdt_addrsize_cells(node, &addr_cells, &size_cells) == 0 && + (par_addr_cells = fdt_parent_addr_cells(node) <= 2)) { + tuple_size = sizeof(pcell_t) * (par_addr_cells + + addr_cells + size_cells); + len = OF_getprop(node, "ranges", ranges, + sizeof(ranges)); + tuples_count = len / tuple_size; + /* Unexpected settings are not supported */ + if (tuples_count != 1) + goto fixup_failed; + + rangesptr = &ranges[0]; + rangesptr += par_addr_cells; + base = fdt_data_get((void *)rangesptr, addr_cells); + *rangesptr = cpu_to_fdt32(fdt_immr_pa); + if (OF_setprop(node, "ranges", (void *)&ranges[0], + sizeof(ranges)) < 0) + goto fixup_failed; + } + } + + /* Fix-up PCIe reg according to real PCIe registers' PA */ + if ((node = fdt_find_compatible(root, "mrvl,pcie", 1)) != 0) { + if (fdt_addrsize_cells(OF_parent(node), &par_addr_cells, + &size_cells) == 0) { + tuple_size = sizeof(pcell_t) * (par_addr_cells + + size_cells); + len = OF_getprop(node, "reg", reg, sizeof(reg)); + tuples_count = len / tuple_size; + /* Unexpected settings are not supported */ + if (tuples_count != 1) + goto fixup_failed; + + base = fdt_data_get((void *)®[0], par_addr_cells); + base &= ~0xFF000000; + base |= fdt_immr_pa; + reg[0] = cpu_to_fdt32(base); + if (OF_setprop(node, "reg", (void *)®[0], + sizeof(reg)) < 0) + goto fixup_failed; + } + } + /* Fix-up succeeded. May return and continue */ + return; + +fixup_failed: + while (1) { + /* + * In case of any error while fixing ranges just hang. + * 1. No message can be displayed yet since console + * is not initialized. + * 2. Going further will cause failure on bus_space_map() + * relying on the wrong ranges or data abort when + * accessing PCIe registers. + */ + } +} + struct fdt_fixup_entry fdt_fixup_table[] = { { "mrvl,DB-88F6281", &fdt_fixup_busfreq }, { "mrvl,DB-78460", &fdt_fixup_busfreq }, + { "mrvl,DB-78460", &fdt_fixup_ranges }, { NULL, NULL } }; Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Mon Oct 28 21:31:12 2013 (r257278) +++ head/sys/arm/mv/mv_machdep.c Mon Oct 28 21:34:32 2013 (r257279) @@ -324,6 +324,19 @@ platform_devmap_init(void) i = 0; pmap_devmap_bootstrap_table = &fdt_devmap[0]; +#ifdef SOC_MV_ARMADAXP + vm_paddr_t cur_immr_pa; + + /* + * Acquire SoC registers' base passed by u-boot and fill devmap + * accordingly. DTB is going to be modified basing on this data + * later. + */ + __asm __volatile("mrc p15, 4, %0, c15, c0, 0" : "=r" (cur_immr_pa)); + cur_immr_pa = (cur_immr_pa << 13) & 0xff000000; + if (cur_immr_pa != 0) + fdt_immr_pa = cur_immr_pa; +#endif /* * IMMR range. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:37:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B29278B0; Mon, 28 Oct 2013 21:37:45 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FB8320D9; Mon, 28 Oct 2013 21:37:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SLbj4d046927; Mon, 28 Oct 2013 21:37:45 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SLbjdN046926; Mon, 28 Oct 2013 21:37:45 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310282137.r9SLbjdN046926@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 21:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257280 - head/sys/arm/mv/armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:37:45 -0000 Author: zbb Date: Mon Oct 28 21:37:45 2013 New Revision: 257280 URL: http://svnweb.freebsd.org/changeset/base/257280 Log: Change Armada XP kernel load address to the u-boot's end address Loading kernel to 0xf00000 has no practical reason. Starting it from the u-boot's highest possible end address (2MB counting from 0x0) makes more sense. Tested by: kevlo Modified: head/sys/arm/mv/armadaxp/std.armadaxp Modified: head/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- head/sys/arm/mv/armadaxp/std.armadaxp Mon Oct 28 21:34:32 2013 (r257279) +++ head/sys/arm/mv/armadaxp/std.armadaxp Mon Oct 28 21:37:45 2013 (r257280) @@ -1,16 +1,16 @@ # $FreeBSD$ -# kernel gets loaded at 0x00f00000 by the loader, but runs at virtual address -# 0xc0f00000. RAM starts at 0. We put the pagetable at a reasonable place +# kernel gets loaded at 0x00200000 by the loader, but runs at virtual address +# 0xc0200000. RAM starts at 0. We put the pagetable at a reasonable place # in memory, but may need to bounce it higher if there's a problem with this. # We could paper over this by loading the kernel at 0xc0000000 virtual, but # that leads to other complications, so we'll just reclaim the lower region of # ram after we're loaded. Put the page tables for startup at 1MB. -makeoptions KERNPHYSADDR=0x00f00000 -makeoptions KERNVIRTADDR=0xc0f00000 +makeoptions KERNPHYSADDR=0x00200000 +makeoptions KERNVIRTADDR=0xc0200000 -options KERNPHYSADDR=0x00f00000 -options KERNVIRTADDR=0xc0f00000 +options KERNPHYSADDR=0x00200000 +options KERNVIRTADDR=0xc0200000 options PHYSADDR=0x00000000 options STARTUP_PAGETABLE_ADDR=0x00100000 From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:39:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 07C99BA1; Mon, 28 Oct 2013 21:39:56 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8BFE20FD; Mon, 28 Oct 2013 21:39:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SLdtdC047182; Mon, 28 Oct 2013 21:39:55 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SLds7Z047177; Mon, 28 Oct 2013 21:39:54 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310282139.r9SLds7Z047177@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 21:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257281 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:39:56 -0000 Author: zbb Date: Mon Oct 28 21:39:54 2013 New Revision: 257281 URL: http://svnweb.freebsd.org/changeset/base/257281 Log: Remove not working and deprecated PJ4Bv6 support Sheeva PJ4Bv6 - based chips were only prototypes for V7 class Armada SoC family. Current in-tree support for PJ4Bv6 will not work and also there should be no platforms in active use that would incorporate that CPU revision. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_pj4b.S head/sys/arm/arm/identcpu.c head/sys/arm/include/armreg.h head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Mon Oct 28 21:37:45 2013 (r257280) +++ head/sys/arm/arm/cpufunc.c Mon Oct 28 21:39:54 2013 (r257281) @@ -541,65 +541,6 @@ struct cpu_functions pj4bv7_cpufuncs = { pj4bv7_setup /* cpu setup */ }; - -struct cpu_functions pj4bv6_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - arm11_drain_writebuf, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* Domain */ - pj4b_setttb, /* Setttb */ - cpufunc_faultstatus, /* Faultstatus */ - cpufunc_faultaddress, /* Faultaddress */ - - /* TLB functions */ - - arm11_tlb_flushID, /* tlb_flushID */ - arm11_tlb_flushID_SE, /* tlb_flushID_SE */ - arm11_tlb_flushI, /* tlb_flushI */ - arm11_tlb_flushI_SE, /* tlb_flushI_SE */ - arm11_tlb_flushD, /* tlb_flushD */ - arm11_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - armv6_icache_sync_all, /* icache_sync_all */ - pj4b_icache_sync_range, /* icache_sync_range */ - - armv6_dcache_wbinv_all, /* dcache_wbinv_all */ - pj4b_dcache_wbinv_range, /* dcache_wbinv_range */ - pj4b_dcache_inv_range, /* dcache_inv_range */ - pj4b_dcache_wb_range, /* dcache_wb_range */ - - armv6_idcache_wbinv_all, /* idcache_wbinv_all */ - pj4b_idcache_wbinv_range, /* idcache_wbinv_all */ - - (void *)cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - pj4b_drain_readbuf, /* flush_prefetchbuf */ - arm11_drain_writebuf, /* drain_writebuf */ - pj4b_flush_brnchtgt_all, /* flush_brnchtgt_C */ - pj4b_flush_brnchtgt_va, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - arm11_context_switch, /* context_switch */ - - pj4bv6_setup /* cpu setup */ -}; #endif /* CPU_MV_PJ4B */ #ifdef CPU_SA110 @@ -1497,27 +1438,14 @@ set_cpufuncs() #endif /* CPU_CORTEXA */ #if defined(CPU_MV_PJ4B) - if (cputype == CPU_ID_MV88SV581X_V6 || - cputype == CPU_ID_MV88SV581X_V7 || + if (cputype == CPU_ID_MV88SV581X_V7 || cputype == CPU_ID_MV88SV584X_V7 || - cputype == CPU_ID_ARM_88SV581X_V6 || cputype == CPU_ID_ARM_88SV581X_V7) { - if (cpu_pfr(0) & ARM_PFR0_THUMBEE_MASK) - cpufuncs = pj4bv7_cpufuncs; - else - cpufuncs = pj4bv6_cpufuncs; - - get_cachetype_cp15(); - pmap_pte_init_mmu_v6(); - goto out; - } else if (cputype == CPU_ID_ARM_88SV584X_V6 || - cputype == CPU_ID_MV88SV584X_V6) { - cpufuncs = pj4bv6_cpufuncs; + cpufuncs = pj4bv7_cpufuncs; get_cachetype_cp15(); pmap_pte_init_mmu_v6(); goto out; } - #endif /* CPU_MV_PJ4B */ #ifdef CPU_SA110 if (cputype == CPU_ID_SA110) { @@ -2447,44 +2375,6 @@ arm11x6_setup(char *args) #ifdef CPU_MV_PJ4B void -pj4bv6_setup(char *args) -{ - int cpuctrl; - - pj4b_config(); - - cpuctrl = CPU_CONTROL_MMU_ENABLE; -#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS - cpuctrl |= CPU_CONTROL_AFLT_ENABLE; -#endif - cpuctrl |= CPU_CONTROL_DC_ENABLE; - cpuctrl |= (0xf << 3); -#ifdef __ARMEB__ - cpuctrl |= CPU_CONTROL_BEND_ENABLE; -#endif - cpuctrl |= CPU_CONTROL_SYST_ENABLE; - cpuctrl |= CPU_CONTROL_BPRD_ENABLE; - cpuctrl |= CPU_CONTROL_IC_ENABLE; - if (vector_page == ARM_VECTORS_HIGH) - cpuctrl |= CPU_CONTROL_VECRELOC; - cpuctrl |= (0x5 << 16); - cpuctrl |= CPU_CONTROL_V6_EXTPAGE; - /* XXX not yet */ - /* cpuctrl |= CPU_CONTROL_L2_ENABLE; */ - - /* Make sure caches are clean. */ - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); - - /* Set the control register */ - ctrl = cpuctrl; - cpu_control(0xffffffff, cpuctrl); - - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); -} - -void pj4bv7_setup(args) char *args; { Modified: head/sys/arm/arm/cpufunc_asm_pj4b.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_pj4b.S Mon Oct 28 21:37:45 2013 (r257280) +++ head/sys/arm/arm/cpufunc_asm_pj4b.S Mon Oct 28 21:39:54 2013 (r257281) @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); #include -.Lpj4b_cache_line_size: - .word _C_LABEL(arm_pdcache_line_size) - .Lpj4b_sf_ctrl_reg: .word 0xf1021820 @@ -52,135 +49,6 @@ ENTRY(pj4b_setttb) RET END(pj4b_setttb) -ENTRY_NP(armv6_icache_sync_all) - /* - * We assume that the code here can never be out of sync with the - * dcache, so that we can safely flush the Icache and fall through - * into the Dcache cleaning code. - */ - mov r0, #0 - mcr p15, 0, r0, c7, c5, 0 /* Invalidate ICache */ - mcr p15, 0, r0, c7, c10, 0 /* Clean (don't invalidate) DCache */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(armv6_icache_sync_all) - -ENTRY(pj4b_icache_sync_range) - sub r1, r1, #1 - add r1, r0, r1 - mcrr p15, 0, r1, r0, c5 /* invalidate IC range */ - mcrr p15, 0, r1, r0, c12 /* clean DC range */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_icache_sync_range) - -ENTRY(pj4b_dcache_inv_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4413 */ -1: - mcr p15, 0, r0, c7, c6, 1 - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_dcache_inv_range) - -ENTRY(armv6_idcache_wbinv_all) - mov r0, #0 - mcr p15, 0, r0, c7, c5, 0 /* invalidate ICache */ - mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate DCache */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(armv6_idcache_wbinv_all) - -ENTRY(armv6_dcache_wbinv_all) - mov r0, #0 - mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate DCache */ - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(armv6_dcache_wbinv_all) - -ENTRY(pj4b_idcache_wbinv_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4611 */ -1: -#ifdef SMP - /* Request for ownership */ - ldr r2, [r0] - str r2, [r0] -#endif - mcr p15, 0, r0, c7, c5, 1 - mcr p15, 0, r0, c7, c14, 1 /* L2C clean and invalidate entry */ - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_idcache_wbinv_range) - -ENTRY(pj4b_dcache_wbinv_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4611 */ -1: -#ifdef SMP - /* Request for ownership */ - ldr r2, [r0] - str r2, [r0] -#endif - mcr p15, 0, r0, c7, c14, 1 - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_dcache_wbinv_range) - -ENTRY(pj4b_dcache_wb_range) - ldr ip, .Lpj4b_cache_line_size - ldr ip, [ip] - sub r1, r1, #1 /* Don't overrun */ - sub r3, ip, #1 - and r2, r0, r3 - add r1, r1, r2 - bic r0, r0, r3 - - mcr p15, 0, r0, c7, c10, 5 /* Data Memory Barrier err:4611 */ -1: -#ifdef SMP - /* Request for ownership */ - ldr r2, [r0] - str r2, [r0] -#endif - mcr p15, 0, r0, c7, c10, 1 /* L2C clean single entry by MVA */ - add r0, r0, ip - subs r1, r1, ip - bpl 1b - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - RET -END(pj4b_dcache_wb_range) - ENTRY(pj4b_drain_readbuf) mcr p15, 0, r0, c7, c5, 4 /* flush prefetch buffers */ RET Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Mon Oct 28 21:37:45 2013 (r257280) +++ head/sys/arm/arm/identcpu.c Mon Oct 28 21:39:54 2013 (r257281) @@ -323,18 +323,10 @@ const struct cpuidtab cpuids[] = { { CPU_ID_MV88FR571_VD, CPU_CLASS_MARVELL, "Feroceon 88FR571-VD", generic_steppings }, - { CPU_ID_MV88SV581X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, - { CPU_ID_ARM_88SV581X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV581x", - generic_steppings }, { CPU_ID_MV88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", generic_steppings }, { CPU_ID_ARM_88SV581X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV581x", generic_steppings }, - { CPU_ID_MV88SV584X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV584x", - generic_steppings }, - { CPU_ID_ARM_88SV584X_V6, CPU_CLASS_MARVELL, "Sheeva 88SV584x", - generic_steppings }, { CPU_ID_MV88SV584X_V7, CPU_CLASS_MARVELL, "Sheeva 88SV584x", generic_steppings }, Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Mon Oct 28 21:37:45 2013 (r257280) +++ head/sys/arm/include/armreg.h Mon Oct 28 21:39:54 2013 (r257281) @@ -173,14 +173,10 @@ #define CPU_ID_MV88FR571_41 0x41159260 /* Marvell Feroceon 88FR571-VD Core (actual ID from CPU reg) */ #endif -#define CPU_ID_MV88SV581X_V6 0x560F5810 /* Marvell Sheeva 88SV581x v6 Core */ #define CPU_ID_MV88SV581X_V7 0x561F5810 /* Marvell Sheeva 88SV581x v7 Core */ -#define CPU_ID_MV88SV584X_V6 0x561F5840 /* Marvell Sheeva 88SV584x v6 Core */ #define CPU_ID_MV88SV584X_V7 0x562F5840 /* Marvell Sheeva 88SV584x v7 Core */ /* Marvell's CPUIDs with ARM ID in implementor field */ -#define CPU_ID_ARM_88SV581X_V6 0x410fb760 /* Marvell Sheeva 88SV581x v6 Core */ #define CPU_ID_ARM_88SV581X_V7 0x413FC080 /* Marvell Sheeva 88SV581x v7 Core */ -#define CPU_ID_ARM_88SV584X_V6 0x410FB020 /* Marvell Sheeva 88SV584x v6 Core */ #define CPU_ID_FA526 0x66015260 #define CPU_ID_FA626TE 0x66056260 Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Mon Oct 28 21:37:45 2013 (r257280) +++ head/sys/arm/include/cpufunc.h Mon Oct 28 21:39:54 2013 (r257281) @@ -482,14 +482,6 @@ void arm11_drain_writebuf (void); void pj4b_setttb (u_int); -void pj4b_icache_sync_range (vm_offset_t, vm_size_t); - -void pj4b_dcache_wbinv_range (vm_offset_t, vm_size_t); -void pj4b_dcache_inv_range (vm_offset_t, vm_size_t); -void pj4b_dcache_wb_range (vm_offset_t, vm_size_t); - -void pj4b_idcache_wbinv_range (vm_offset_t, vm_size_t); - void pj4b_drain_readbuf (void); void pj4b_flush_brnchtgt_all (void); void pj4b_flush_brnchtgt_va (u_int); @@ -523,7 +515,6 @@ void armv7_drain_writebuf (void); void armv7_sev (void); u_int armv7_auxctrl (u_int, u_int); void pj4bv7_setup (char *string); -void pj4bv6_setup (char *string); void pj4b_config (void); int get_core_id (void); From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 21:41:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2CE0BE6D; Mon, 28 Oct 2013 21:41:44 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C89462133; Mon, 28 Oct 2013 21:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SLfiiH049497; Mon, 28 Oct 2013 21:41:44 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SLfiol049496; Mon, 28 Oct 2013 21:41:44 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310282141.r9SLfiol049496@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 21:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257282 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 21:41:46 -0000 Author: zbb Date: Mon Oct 28 21:41:44 2013 New Revision: 257282 URL: http://svnweb.freebsd.org/changeset/base/257282 Log: Switch off explicit broadcasting of the TLB flush operations for PJ4B CPU Since CPU_MV_PJ4B describes ARMv7 compliant CPU there is no need for sending an IPI each time when TLB is flushed in any way. Tested by: kevlo Modified: head/sys/arm/include/cpufunc.h Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Mon Oct 28 21:39:54 2013 (r257281) +++ head/sys/arm/include/cpufunc.h Mon Oct 28 21:41:44 2013 (r257282) @@ -188,7 +188,7 @@ extern u_int cputype; #else void tlb_broadcast(int); -#ifdef CPU_CORTEXA +#if defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) #define TLB_BROADCAST /* No need to explicitely send an IPI */ #else #define TLB_BROADCAST tlb_broadcast(7) From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 22:05:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA4891E4; Mon, 28 Oct 2013 22:05:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4530B22FF; Mon, 28 Oct 2013 22:05:09 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id n9so4284970qcw.1 for ; Mon, 28 Oct 2013 15:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=vh3tQyIXSOmlEUxmRoCIiKeUeHnESE9NLENzAXYkunI=; b=vxb+CvWpUWbNK5uLwBWcC/8WWbupOnIgh2HuVBOAkRm7FXMdjtJV5qEVaWo0F0fbta O9Y3zo78eiMialYv2QDUfnPddE8r5vSQqvRWxniM/uPPh9JZinc5+sy8R4yDZLICoNvP 6k0rNkdSr4krcid7CaStBdHcXXlNy7E2BpSzdU22v4JLIFom1L/BodloUO1+qeWQ5q4V SOKfpqxGxf4ckKBJpjr0VJxH+OTGrLAtWP+ARsSjvU/Rr8EKXdMy1Xps9Bv3/ImI5m7E 2wgbLk6hLBvZPiIN4f3x5hv/c+FWV65ByLUZ1pTmpNHXpjJsrG4m/ROjJYVx6nZHYzdn 9qhg== MIME-Version: 1.0 X-Received: by 10.49.62.3 with SMTP id u3mr31934124qer.6.1382997908362; Mon, 28 Oct 2013 15:05:08 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 28 Oct 2013 15:05:08 -0700 (PDT) In-Reply-To: <20131028192731.GA1505@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> <20131028192731.GA1505@mole.fafoe.narf.at> Date: Mon, 28 Oct 2013 15:05:08 -0700 X-Google-Sender-Auth: UFh1w7gf7OBWNzxJ4Y0s3nB2QUs Message-ID: Subject: Re: svn commit: r257133 - head/sys/dev/iwn From: Adrian Chadd To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 22:05:09 -0000 Hi! Yup! So, the difference is in the rate being selected. It looks like the remote end is just plainly not ACKing the 11n management frame being sent; but it totally ACKs the 11b CCK frame being sent. So, thanks for pointing that out. I'll go and err, "fix" this mistake. The driver should be doing what the stack says. Bernhard figured out a couple years ago that doing 11n management frames to 11n devices is not guaranteed to work, so we "fixed" that. I will go and figure out why this is now broken for iwn. Thanks! Would you mind filing a PR with what we've gathered? -adrian On 28 October 2013 12:27, Stefan Farfeleder wrote: > On Mon, Oct 28, 2013 at 12:07:17PM -0700, Adrian Chadd wrote: >> Yeah: >> >> Oct 28 19:43:43 mole kernel: iwn5000_tx_done: qid 3 idx 4 retries 7 >> nkill 0 rate a902 duration 686 status 83 >> >> status 0x83 is LONG_LIMIT, which meant it tried to transmit and it >> failed to get an ACK each time. >> >> The rate control says: >> >> 0x02: the rate in question >> bit 8: MCS >> bit 11: HT40 >> bits 14+15: transmit antennas A+B >> >> .. and it's an association/management frame, which is odd as they're >> not supposed to be sent as 11n HT40 frames like this. >> >> can you do the same experiment but with the patch reverted? I'd like >> to see what the selected rate is. > > Ok, here's the output with r257155 and r257133 reverted: > > http://pastebin.com/CJzsTANv > > Stefan From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 22:26:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77E1FD5C; Mon, 28 Oct 2013 22:26:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5577F244A; Mon, 28 Oct 2013 22:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SMQ5Of064266; Mon, 28 Oct 2013 22:26:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SMQ3AX064257; Mon, 28 Oct 2013 22:26:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282226.r9SMQ3AX064257@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 22:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257284 - in head/sys: dev/ath dev/etherswitch dev/etherswitch/arswitch mips/atheros net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 22:26:05 -0000 Author: glebius Date: Mon Oct 28 22:26:03 2013 New Revision: 257284 URL: http://svnweb.freebsd.org/changeset/base/257284 Log: - Provide necessary includes, that before came via if.h pollution. - Remove unnecessary ones. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/ath/if_ath_ahb.c head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/miiproxy.c head/sys/mips/atheros/if_arge.c head/sys/net80211/ieee80211_alq.c head/sys/net80211/ieee80211_superg.c Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/dev/ath/if_ath_ahb.c Mon Oct 28 22:26:03 2013 (r257284) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Oct 28 22:26:03 2013 (r257284) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include #include +#include #include #include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Mon Oct 28 22:26:03 2013 (r257284) @@ -31,18 +31,16 @@ #include #include #include +#include #include +#include #include #include #include #include #include -#include -#include -#include #include -#include #include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Mon Oct 28 22:26:03 2013 (r257284) @@ -31,12 +31,13 @@ #include #include #include +#include #include +#include #include #include #include - #include #include Modified: head/sys/dev/etherswitch/miiproxy.c ============================================================================== --- head/sys/dev/etherswitch/miiproxy.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/dev/etherswitch/miiproxy.c Mon Oct 28 22:26:03 2013 (r257284) @@ -29,17 +29,14 @@ #include #include #include +#include #include #include #include #include #include -#include -#include -#include #include -#include #include #include Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/mips/atheros/if_arge.c Mon Oct 28 22:26:03 2013 (r257284) @@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -50,10 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include #include +#include #include #include Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/net80211/ieee80211_alq.c Mon Oct 28 22:26:03 2013 (r257284) @@ -53,10 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#include +#include #include #include Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Mon Oct 28 22:13:50 2013 (r257283) +++ head/sys/net80211/ieee80211_superg.c Mon Oct 28 22:26:03 2013 (r257284) @@ -38,11 +38,12 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include #include +#include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 22:41:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AF94A3E1; Mon, 28 Oct 2013 22:41:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C7782561; Mon, 28 Oct 2013 22:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SMfaWs070167; Mon, 28 Oct 2013 22:41:36 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SMfawT070166; Mon, 28 Oct 2013 22:41:36 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310282241.r9SMfawT070166@svn.freebsd.org> From: Peter Grehan Date: Mon, 28 Oct 2013 22:41:36 +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: r257285 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 22:41:36 -0000 Author: grehan Date: Mon Oct 28 22:41:36 2013 New Revision: 257285 URL: http://svnweb.freebsd.org/changeset/base/257285 Log: MFC r257078 Fix panic in the tap driver when a tap and vmnet interface were created after each other e.g. ifconfig tap0 ifconfig vmnet0 Appears to be a cut'n'paste error from the tap code to the vmnet code where the name string wasn't updated in the call to make_dev(). Approved by: re (glebius) Modified: stable/10/sys/net/if_tap.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/net/if_tap.c ============================================================================== --- stable/10/sys/net/if_tap.c Mon Oct 28 22:26:03 2013 (r257284) +++ stable/10/sys/net/if_tap.c Mon Oct 28 22:41:36 2013 (r257285) @@ -205,7 +205,7 @@ vmnet_clone_create(struct if_clone *ifc, i = clone_create(&tapclones, &tap_cdevsw, &unit, &dev, VMNET_DEV_MASK); if (i) { dev = make_dev(&tap_cdevsw, unit | VMNET_DEV_MASK, UID_ROOT, - GID_WHEEL, 0600, "%s%d", tapname, unit); + GID_WHEEL, 0600, "%s%d", vmnetname, unit); } tapcreate(dev); From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 22:49:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1B3CE570; Mon, 28 Oct 2013 22:49:12 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E249525A0; Mon, 28 Oct 2013 22:49:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SMnBUB071081; Mon, 28 Oct 2013 22:49:11 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SMnB12071079; Mon, 28 Oct 2013 22:49:11 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310282249.r9SMnB12071079@svn.freebsd.org> From: Colin Percival Date: Mon, 28 Oct 2013 22:49:11 +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: r257286 - stable/10/contrib/subversion/subversion/libsvn_subr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 22:49:12 -0000 Author: cperciva Date: Mon Oct 28 22:49:11 2013 New Revision: 257286 URL: http://svnweb.freebsd.org/changeset/base/257286 Log: MFC r257129: Remove time and date stamps from svn* binaries, in order to make the builds reproducible. Approved by: re (glebius) Modified: stable/10/contrib/subversion/subversion/libsvn_subr/opt.c stable/10/contrib/subversion/subversion/libsvn_subr/version.c Directory Properties: stable/10/contrib/subversion/ (props changed) Modified: stable/10/contrib/subversion/subversion/libsvn_subr/opt.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_subr/opt.c Mon Oct 28 22:41:36 2013 (r257285) +++ stable/10/contrib/subversion/subversion/libsvn_subr/opt.c Mon Oct 28 22:49:11 2013 (r257286) @@ -1115,10 +1115,8 @@ svn_opt__print_version_info(const char * return svn_cmdline_printf(pool, "%s\n", SVN_VER_NUMBER); SVN_ERR(svn_cmdline_printf(pool, _("%s, version %s\n" - " compiled %s, %s on %s\n\n"), + " compiled on %s\n\n"), pgm_name, SVN_VERSION, - svn_version_ext_build_date(info), - svn_version_ext_build_time(info), svn_version_ext_build_host(info))); SVN_ERR(svn_cmdline_printf(pool, "%s\n", svn_version_ext_copyright(info))); Modified: stable/10/contrib/subversion/subversion/libsvn_subr/version.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_subr/version.c Mon Oct 28 22:41:36 2013 (r257285) +++ stable/10/contrib/subversion/subversion/libsvn_subr/version.c Mon Oct 28 22:49:11 2013 (r257286) @@ -125,8 +125,8 @@ svn_version_extended(svn_boolean_t verbo { svn_version_extended_t *info = apr_pcalloc(pool, sizeof(*info)); - info->build_date = __DATE__; - info->build_time = __TIME__; + info->build_date = NULL; + info->build_time = NULL; info->build_host = SVN_BUILD_HOST; info->copyright = apr_pstrdup (pool, _("Copyright (C) 2013 The Apache Software Foundation.\n" From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 22:54:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9C9FE738; Mon, 28 Oct 2013 22:54:29 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70BCF260D; Mon, 28 Oct 2013 22:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SMsTiS073747; Mon, 28 Oct 2013 22:54:29 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SMsTwY073746; Mon, 28 Oct 2013 22:54:29 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201310282254.r9SMsTwY073746@svn.freebsd.org> From: Christian Brueffer Date: Mon, 28 Oct 2013 22:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257287 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 22:54:29 -0000 Author: brueffer Date: Mon Oct 28 22:54:28 2013 New Revision: 257287 URL: http://svnweb.freebsd.org/changeset/base/257287 Log: New sentence -> new line and some mdoc cleanup. MFC after: 3 days Modified: head/share/man/man4/bpf.4 Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Mon Oct 28 22:49:11 2013 (r257286) +++ head/share/man/man4/bpf.4 Mon Oct 28 22:54:28 2013 (r257287) @@ -697,9 +697,11 @@ is used when the time stamp is set to .Dv BPF_T_MICROTIME_MONOTONIC_FAST , or .Dv BPF_T_NONE -for backward compatibility reasons. Otherwise, +for backward compatibility reasons. +Otherwise, .Vt bpf_xhdr -is used. However, +is used. +However, .Vt bpf_hdr may be deprecated in the near future. Suitable precautions @@ -962,19 +964,23 @@ subsystem .It Va net.bpf.optimize_writers: No 0 Various programs use BPF to send (but not receive) raw packets (cdpd, lldpd, dhcpd, dhcp relays, etc. are good examples of such programs). -They do not need incoming packets to be send to them. Turning this option on +They do not need incoming packets to be send to them. +Turning this option on makes new BPF users to be attached to write-only interface list until program explicitly specifies read filter via -.Cm pcap_set_filter() . +.Fn pcap_set_filter . This removes any performance degradation for high-speed interfaces. .It Va net.bpf.stats: Binary interface for retrieving general statistics. .It Va net.bpf.zerocopy_enable: No 0 -Permits zero-copy to be used with net BPF readers. Use with caution. +Permits zero-copy to be used with net BPF readers. +Use with caution. .It Va net.bpf.maxinsns: No 512 -Maximum number of instructions that BPF program can contain. Use +Maximum number of instructions that BPF program can contain. +Use .Xr tcpdump 1 --d option to determine approximate number of instruction for any filter. +.Fl d +option to determine approximate number of instruction for any filter. .It Va net.bpf.maxbufsize: No 524288 Maximum buffer size to allocate for packets buffer. .It Va net.bpf.bufsize: No 4096 From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 23:02:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9E2E78DF; Mon, 28 Oct 2013 23:02:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B61A266C; Mon, 28 Oct 2013 23:02:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SN2CSY076968; Mon, 28 Oct 2013 23:02:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SN2CC8076967; Mon, 28 Oct 2013 23:02:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201310282302.r9SN2CC8076967@svn.freebsd.org> From: Christian Brueffer Date: Mon, 28 Oct 2013 23:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257288 - head/bin/df X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 23:02:12 -0000 Author: brueffer Date: Mon Oct 28 23:02:12 2013 New Revision: 257288 URL: http://svnweb.freebsd.org/changeset/base/257288 Log: Clean up a spurious "." in SEE ALSO. MFC after: 3 days Modified: head/bin/df/df.1 Modified: head/bin/df/df.1 ============================================================================== --- head/bin/df/df.1 Mon Oct 28 22:54:28 2013 (r257287) +++ head/bin/df/df.1 Mon Oct 28 23:02:12 2013 (r257288) @@ -198,7 +198,7 @@ If the value is outside, it will be set .Xr mount 8 , .Xr pstat 8 , .Xr quot 8 , -.Xr swapinfo 8 . +.Xr swapinfo 8 .Sh STANDARDS With the exception of most options, the From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 23:17:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A666D80; Mon, 28 Oct 2013 23:17:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4812C273F; Mon, 28 Oct 2013 23:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SNHgXT081300; Mon, 28 Oct 2013 23:17:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SNHgqM081299; Mon, 28 Oct 2013 23:17:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282317.r9SNHgqM081299@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 23:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257289 - head/sys/dev/cm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 23:17:42 -0000 Author: glebius Date: Mon Oct 28 23:17:41 2013 New Revision: 257289 URL: http://svnweb.freebsd.org/changeset/base/257289 Log: Provide necessary includes that before came via if.h. Modified: head/sys/dev/cm/if_cm_isa.c Modified: head/sys/dev/cm/if_cm_isa.c ============================================================================== --- head/sys/dev/cm/if_cm_isa.c Mon Oct 28 23:02:12 2013 (r257288) +++ head/sys/dev/cm/if_cm_isa.c Mon Oct 28 23:17:41 2013 (r257289) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -45,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 23:34:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8B768619; Mon, 28 Oct 2013 23:34:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78A252889; Mon, 28 Oct 2013 23:34:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SNY65h087558; Mon, 28 Oct 2013 23:34:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SNY6Qr087556; Mon, 28 Oct 2013 23:34:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310282334.r9SNY6Qr087556@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Oct 2013 23:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257290 - in head/sys/dev: hme le X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 23:34:06 -0000 Author: glebius Date: Mon Oct 28 23:34:05 2013 New Revision: 257290 URL: http://svnweb.freebsd.org/changeset/base/257290 Log: Provide necessary includes. Modified: head/sys/dev/hme/if_hme_sbus.c head/sys/dev/le/if_le_ledma.c Modified: head/sys/dev/hme/if_hme_sbus.c ============================================================================== --- head/sys/dev/hme/if_hme_sbus.c Mon Oct 28 23:17:41 2013 (r257289) +++ head/sys/dev/hme/if_hme_sbus.c Mon Oct 28 23:34:05 2013 (r257290) @@ -39,8 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -52,11 +54,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include -#include #include +#include #include #include Modified: head/sys/dev/le/if_le_ledma.c ============================================================================== --- head/sys/dev/le/if_le_ledma.c Mon Oct 28 23:17:41 2013 (r257289) +++ head/sys/dev/le/if_le_ledma.c Mon Oct 28 23:34:05 2013 (r257290) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 23:42:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C53D2802; Mon, 28 Oct 2013 23:42:44 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B27AD2911; Mon, 28 Oct 2013 23:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SNgiFD090563; Mon, 28 Oct 2013 23:42:44 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SNgi4Y090562; Mon, 28 Oct 2013 23:42:44 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310282342.r9SNgi4Y090562@svn.freebsd.org> From: Zbigniew Bodek Date: Mon, 28 Oct 2013 23:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257291 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 23:42:44 -0000 Author: zbb Date: Mon Oct 28 23:42:44 2013 New Revision: 257291 URL: http://svnweb.freebsd.org/changeset/base/257291 Log: Fix condition that determines PMAP_NEEDS_PTE_SYNC value for ARM Use values of the correct defines to determine statement's result. ARM_ARCH_ symbols are always defined, hence only values are relevant. Reviewed by: cognet Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Oct 28 23:34:05 2013 (r257290) +++ head/sys/arm/include/pmap.h Mon Oct 28 23:42:44 2013 (r257291) @@ -489,7 +489,7 @@ extern int pmap_needs_pte_sync; #if (ARM_MMU_SA1 == 1) && (ARM_NMMUS == 1) #define PMAP_NEEDS_PTE_SYNC 1 #define PMAP_INCLUDE_PTE_SYNC -#elif defined(CPU_XSCALE_81342) || defined(ARM_ARCH_7) || defined(ARM_ARCH_7A) +#elif defined(CPU_XSCALE_81342) || ARM_ARCH_6 || ARM_ARCH_7A #define PMAP_NEEDS_PTE_SYNC 1 #define PMAP_INCLUDE_PTE_SYNC #elif (ARM_MMU_SA1 == 0) From owner-svn-src-all@FreeBSD.ORG Mon Oct 28 23:47:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DFA60A6A; Mon, 28 Oct 2013 23:47:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB684293F; Mon, 28 Oct 2013 23:47:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9SNlr4R091270; Mon, 28 Oct 2013 23:47:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9SNlrQl091263; Mon, 28 Oct 2013 23:47:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310282347.r9SNlrQl091263@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 28 Oct 2013 23:47:53 +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: r257292 - in stable/10/sys: conf powerpc/conf powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 28 Oct 2013 23:47:54 -0000 Author: nwhitehorn Date: Mon Oct 28 23:47:52 2013 New Revision: 257292 URL: http://svnweb.freebsd.org/changeset/base/257292 Log: MFC r256777-256779,256788: Add driver for POWER hypervisor interpartition ethernet. Approved by: re (glebius) Added: stable/10/sys/powerpc/pseries/phyp_llan.c - copied, changed from r256778, head/sys/powerpc/pseries/phyp_llan.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/conf/GENERIC64 stable/10/sys/powerpc/pseries/phyp-hvcall.S Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Mon Oct 28 23:42:44 2013 (r257291) +++ stable/10/sys/conf/files.powerpc Mon Oct 28 23:47:52 2013 (r257292) @@ -228,6 +228,7 @@ powerpc/ps3/ps3-hvcall.S optional ps3 sc powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 powerpc/pseries/mmu_phyp.c optional pseries powerpc64 powerpc/pseries/phyp_console.c optional pseries powerpc64 uart +powerpc/pseries/phyp_llan.c optional llan powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus powerpc/pseries/platform_chrp.c optional pseries powerpc/pseries/plpar_iommu.c optional pseries powerpc64 Modified: stable/10/sys/powerpc/conf/GENERIC64 ============================================================================== --- stable/10/sys/powerpc/conf/GENERIC64 Mon Oct 28 23:42:44 2013 (r257291) +++ stable/10/sys/powerpc/conf/GENERIC64 Mon Oct 28 23:47:52 2013 (r257292) @@ -128,6 +128,7 @@ device em # Intel PRO/1000 Gigabit Eth device igb # Intel PRO/1000 PCIE Server Gigabit Family device ixgbe # Intel PRO/10GbE PCIE Ethernet Family device glc # Sony Playstation 3 Ethernet +device llan # IBM pSeries Virtual Ethernet # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support Modified: stable/10/sys/powerpc/pseries/phyp-hvcall.S ============================================================================== --- stable/10/sys/powerpc/pseries/phyp-hvcall.S Mon Oct 28 23:42:44 2013 (r257291) +++ stable/10/sys/powerpc/pseries/phyp-hvcall.S Mon Oct 28 23:47:52 2013 (r257292) @@ -36,6 +36,8 @@ ASENTRY(phyp_hcall) mflr %r0 std %r0,16(%r1) + ld %r11,112(%r1) /* Last couple args into volatile regs*/ + ld %r12,120(%r1) hc /* invoke the hypervisor */ ld %r0,16(%r1) mtlr %r0 Copied and modified: stable/10/sys/powerpc/pseries/phyp_llan.c (from r256778, head/sys/powerpc/pseries/phyp_llan.c) ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Sun Oct 20 01:31:09 2013 (r256778, copy source) +++ stable/10/sys/powerpc/pseries/phyp_llan.c Mon Oct 28 23:47:52 2013 (r257292) @@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$"); #define LLAN_MAX_TX_PACKETS 100 #define LLAN_RX_BUF_LEN 8*PAGE_SIZE +#define LLAN_BUFDESC_VALID (1ULL << 63) +#define LLAN_ADD_MULTICAST 0x1 +#define LLAN_DEL_MULTICAST 0x2 +#define LLAN_CLEAR_MULTICAST 0x3 + struct llan_xfer { struct mbuf *rx_mbuf; bus_dmamap_t rx_dmamap; @@ -113,6 +118,7 @@ static int llan_ioctl(struct ifnet *ifp, static void llan_rx_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int err); static int llan_add_rxbuf(struct llan_softc *sc, struct llan_xfer *rx); +static int llan_set_multicast(struct llan_softc *sc); static devclass_t llan_devclass; static device_method_t llan_methods[] = { @@ -249,7 +255,7 @@ llan_init(void *xsc) sc->rx_dma_slot = 0; sc->rx_valid_val = 1; - rx_buf_desc = (1UL << 63); /* valid */ + rx_buf_desc = LLAN_BUFDESC_VALID; rx_buf_desc |= (sc->rx_buf_len << 32); rx_buf_desc |= sc->rx_buf_phys; memcpy(&macaddr, sc->mac_address, 8); @@ -307,7 +313,7 @@ llan_add_rxbuf(struct llan_softc *sc, st bus_dmamap_sync(sc->rxbuf_dma_tag, rx->rx_dmamap, BUS_DMASYNC_PREREAD); - rx->rx_bufdesc = (1UL << 63); /* valid */ + rx->rx_bufdesc = LLAN_BUFDESC_VALID; rx->rx_bufdesc |= (((uint64_t)segs[0].ds_len) << 32); rx->rx_bufdesc |= segs[0].ds_addr; error = phyp_hcall(H_ADD_LOGICAL_LAN_BUFFER, sc->unit, rx->rx_bufdesc); @@ -376,20 +382,19 @@ llan_send_packet(void *xsc, bus_dma_segm bzero(bufdescs, sizeof(bufdescs)); for (i = 0; i < nsegs; i++) { - bufdescs[i] = (1UL << 63); /* valid */ + bufdescs[i] = LLAN_BUFDESC_VALID; bufdescs[i] |= (((uint64_t)segs[i].ds_len) << 32); bufdescs[i] |= segs[i].ds_addr; } - error = phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], + phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0], bufdescs[1], bufdescs[2], bufdescs[3], bufdescs[4], bufdescs[5], 0); -#if 0 - if (error) - sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; - - /* XXX: handle H_BUSY? */ - /* H_SEND_LOGICAL_LAN returning 0 implies completion of the send op */ -#endif + /* + * The hypercall returning implies completion -- or that the call will + * not complete. In principle, we should try a few times if we get back + * H_BUSY based on the continuation token in R4. For now, just drop + * the packet in such cases. + */ } static void @@ -425,9 +430,9 @@ llan_start_locked(struct ifnet *ifp) } } - bus_dmamap_load_mbuf(sc->tx_dma_tag, sc->tx_dma_map, //xfer->dmamap, + bus_dmamap_load_mbuf(sc->tx_dma_tag, sc->tx_dma_map, mb_head, llan_send_packet, sc, 0); - bus_dmamap_unload(sc->tx_dma_tag, sc->tx_dma_map); // XXX + bus_dmamap_unload(sc->tx_dma_tag, sc->tx_dma_map); m_freem(mb_head); } } @@ -443,11 +448,50 @@ llan_start(struct ifnet *ifp) } static int +llan_set_multicast(struct llan_softc *sc) +{ + struct ifnet *ifp = sc->ifp; + struct ifmultiaddr *inm; + uint64_t macaddr; + + mtx_assert(&sc->io_lock, MA_OWNED); + + phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_CLEAR_MULTICAST, 0); + + if_maddr_rlock(ifp); + TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { + if (inm->ifma_addr->sa_family != AF_LINK) + continue; + + memcpy((uint8_t *)&macaddr + 2, + LLADDR((struct sockaddr_dl *)inm->ifma_addr), 6); + phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_ADD_MULTICAST, + macaddr); + } + if_maddr_runlock(ifp); + + return (0); +} + +static int llan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - int err; + int err = 0; + struct llan_softc *sc = ifp->if_softc; - err = ether_ioctl(ifp, cmd, data); + switch (cmd) { + case SIOCADDMULTI: + case SIOCDELMULTI: + mtx_lock(&sc->io_lock); + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + llan_set_multicast(sc); + mtx_unlock(&sc->io_lock); + break; + case SIOCSIFFLAGS: + default: + err = ether_ioctl(ifp, cmd, data); + break; + } return (err); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 00:18:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C92AC3B5; Tue, 29 Oct 2013 00:18:14 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4ADA2AD5; Tue, 29 Oct 2013 00:18:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T0IEAp002960; Tue, 29 Oct 2013 00:18:14 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T0ICj2002944; Tue, 29 Oct 2013 00:18:12 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310290018.r9T0ICj2002944@svn.freebsd.org> From: Neel Natu Date: Tue, 29 Oct 2013 00:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257293 - in head: share/examples/bhyve usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 00:18:15 -0000 Author: neel Date: Tue Oct 29 00:18:11 2013 New Revision: 257293 URL: http://svnweb.freebsd.org/changeset/base/257293 Log: Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached to a virtual machine then we implicitly create COM1 and COM2 ISA devices. Prior to this change the only way of attaching a COM port to the virtual machine was by presenting it as a PCI device that is mapped at the legacy I/O address 0x3F8 or 0x2F8. There were some issues with the original approach: - It did not work at all with UEFI because UEFI will reprogram the PCI device BARs and remap the COM1/COM2 ports at non-legacy addresses. - OpenBSD GENERIC kernel does not create a /dev/console because it expects the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device. - It was functional with a FreeBSD guest but caused the console to appear on /dev/ttyu2 which was not intuitive. The uart emulation is now independent of the bus on which it resides. Thus it is possible to have uart devices on the PCI bus in addition to the legacy COM1/COM2 devices behind the LPC bus. The command line option to attach ISA COM1/COM2 ports to a virtual machine is "-s ,lpc -l com1,stdio". The command line option to create a PCI-attached uart device is: "-s ,uart[,stdio]" The command line option to create PCI-attached COM1/COM2 device is: "-S ,uart[,stdio]". This style of creating COM ports is deprecated. Discussed with: grehan Reviewed by: grehan Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) M share/examples/bhyve/vmrun.sh AM usr.sbin/bhyve/legacy_irq.c AM usr.sbin/bhyve/legacy_irq.h M usr.sbin/bhyve/Makefile AM usr.sbin/bhyve/uart_emul.c M usr.sbin/bhyve/bhyverun.c AM usr.sbin/bhyve/uart_emul.h M usr.sbin/bhyve/pci_uart.c M usr.sbin/bhyve/pci_emul.c M usr.sbin/bhyve/inout.c M usr.sbin/bhyve/pci_emul.h M usr.sbin/bhyve/inout.h AM usr.sbin/bhyve/pci_lpc.c AM usr.sbin/bhyve/pci_lpc.h Added: head/usr.sbin/bhyve/legacy_irq.c (contents, props changed) head/usr.sbin/bhyve/legacy_irq.h (contents, props changed) head/usr.sbin/bhyve/pci_lpc.c (contents, props changed) head/usr.sbin/bhyve/pci_lpc.h (contents, props changed) head/usr.sbin/bhyve/uart_emul.c (contents, props changed) head/usr.sbin/bhyve/uart_emul.h (contents, props changed) Modified: head/share/examples/bhyve/vmrun.sh head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/inout.h head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_uart.c Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Mon Oct 28 23:47:52 2013 (r257292) +++ head/share/examples/bhyve/vmrun.sh Tue Oct 29 00:18:11 2013 (r257293) @@ -162,7 +162,7 @@ while [ 1 ]; do exit 1 fi BOOTDISK=${isofile} - installer_opt="-s 3:0,virtio-blk,${BOOTDISK}" + installer_opt="-s 31:0,virtio-blk,${BOOTDISK}" else BOOTDISK=${virtio_diskdev} installer_opt="" @@ -176,10 +176,11 @@ while [ 1 ]; do ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P \ -g ${gdbport} \ -s 0:0,hostbridge \ - -s 1:0,virtio-net,${tapdev} \ - -s 2:0,virtio-blk,${virtio_diskdev} \ + -s 1:0,lpc \ + -s 2:0,virtio-net,${tapdev} \ + -s 3:0,virtio-blk,${virtio_diskdev} \ + -l com1,stdio \ ${installer_opt} \ - -S 31,uart,stdio \ ${vmname} if [ $? -ne 0 ]; then break Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/Makefile Tue Oct 29 00:18:11 2013 (r257293) @@ -7,10 +7,10 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c -SRCS+= inout.c ioapic.c mem.c mevent.c mptbl.c pci_ahci.c -SRCS+= pci_emul.c pci_hostbridge.c pci_passthru.c pci_virtio_block.c +SRCS+= inout.c ioapic.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c +SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c pmtmr.c post.c rtc.c -SRCS+= virtio.c xmsr.c spinup_ap.c +SRCS+= uart_emul.c virtio.c xmsr.c spinup_ap.c .PATH: ${.CURDIR}/../../sys/amd64/vmm SRCS+= vmm_instruction_emul.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/bhyverun.c Tue Oct 29 00:18:11 2013 (r257293) @@ -54,10 +54,12 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "inout.h" #include "dbgport.h" +#include "legacy_irq.h" #include "mem.h" #include "mevent.h" #include "mptbl.h" #include "pci_emul.h" +#include "pci_lpc.h" #include "xmsr.h" #include "ioapic.h" #include "spinup_ap.h" @@ -123,7 +125,7 @@ usage(int code) fprintf(stderr, "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" - " %*s [-c vcpus] [-p pincpu] [-m mem] \n" + " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" " -g: gdb port\n" @@ -137,6 +139,7 @@ usage(int code) " -h: help\n" " -s: PCI slot config\n" " -S: legacy PCI slot config\n" + " -l: LPC device configuration\n" " -m: memory size in MB\n", progname, (int)strlen(progname), ""); @@ -553,7 +556,7 @@ main(int argc, char *argv[]) ioapic = 0; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:")) != -1) { + while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -573,6 +576,12 @@ main(int argc, char *argv[]) case 'g': gdb_port = atoi(optarg); break; + case 'l': + if (lpc_device_parse(optarg) != 0) { + errx(EX_USAGE, "invalid lpc device " + "configuration '%s'", optarg); + } + break; case 's': if (pci_parse_slot(optarg, 0) != 0) exit(1); @@ -640,6 +649,7 @@ main(int argc, char *argv[]) init_mem(); init_inout(); + legacy_irq_init(); rtc_init(ctx); Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/inout.c Tue Oct 29 00:18:11 2013 (r257293) @@ -84,7 +84,7 @@ register_default_iohandler(int start, in iop.name = "default"; iop.port = start; iop.size = size; - iop.flags = IOPORT_F_INOUT; + iop.flags = IOPORT_F_INOUT | IOPORT_F_DEFAULT; iop.handler = default_inout; register_inout(&iop); @@ -159,7 +159,18 @@ register_inout(struct inout_port *iop) int i; VERIFY_IOPORT(iop->port, iop->size); - + + /* + * Verify that the new registration is not overwriting an already + * allocated i/o range. + */ + if ((iop->flags & IOPORT_F_DEFAULT) == 0) { + for (i = iop->port; i < iop->port + iop->size; i++) { + if ((inout_handlers[i].flags & IOPORT_F_DEFAULT) == 0) + return (-1); + } + } + for (i = iop->port; i < iop->port + iop->size; i++) { inout_handlers[i].name = iop->name; inout_handlers[i].flags = iop->flags; Modified: head/usr.sbin/bhyve/inout.h ============================================================================== --- head/usr.sbin/bhyve/inout.h Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/inout.h Tue Oct 29 00:18:11 2013 (r257293) @@ -46,7 +46,13 @@ struct inout_port { }; #define IOPORT_F_IN 0x1 #define IOPORT_F_OUT 0x2 -#define IOPORT_F_INOUT 0x3 +#define IOPORT_F_INOUT (IOPORT_F_IN | IOPORT_F_OUT) + +/* + * The following flags are used internally and must not be used by + * device models. + */ +#define IOPORT_F_DEFAULT 0x80000000 /* claimed by default handler */ #define INOUT_PORT(name, port, flags, handler) \ static struct inout_port __CONCAT(__inout_port, __LINE__) = { \ Added: head/usr.sbin/bhyve/legacy_irq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/legacy_irq.c Tue Oct 29 00:18:11 2013 (r257293) @@ -0,0 +1,80 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +/* + * Used to keep track of legacy interrupt owners/requestors + */ +#define NLIRQ 16 + +static struct lirqinfo { + bool li_generic; + bool li_allocated; +} lirq[NLIRQ]; + +void +legacy_irq_init(void) +{ + + /* + * Allow ISA IRQs 5,10,11,12, and 15 to be available for generic use. + */ + lirq[5].li_generic = true; + lirq[10].li_generic = true; + lirq[11].li_generic = true; + lirq[12].li_generic = true; + lirq[15].li_generic = true; +} + +int +legacy_irq_alloc(int irq) +{ + int i; + + assert(irq < NLIRQ); + + if (irq < 0) { + for (i = 0; i < NLIRQ; i++) { + if (lirq[i].li_generic && !lirq[i].li_allocated) { + irq = i; + break; + } + } + } else { + if (lirq[irq].li_allocated) + irq = -1; + } + + if (irq >= 0) { + lirq[irq].li_allocated = true; + return (irq); + } else + return (-1); +} Added: head/usr.sbin/bhyve/legacy_irq.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/legacy_irq.h Tue Oct 29 00:18:11 2013 (r257293) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LEGACY_IRQ_H_ +#define _LEGACY_IRQ_H_ + +/* + * Allocate a legacy irq. The argument 'irq' can be set to -1 to allocate any + * available irq. + * + * Returns -1 on failure or the allocated irq number on success. + */ +int legacy_irq_alloc(int irq); +void legacy_irq_init(void); + +#endif Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/pci_emul.c Tue Oct 29 00:18:11 2013 (r257293) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" #include "inout.h" +#include "legacy_irq.h" #include "mem.h" #include "pci_emul.h" #include "ioapic.h" @@ -76,17 +77,6 @@ static struct slotinfo { int si_legacy; } pci_slotinfo[MAXSLOTS][MAXFUNCS]; -/* - * Used to keep track of legacy interrupt owners/requestors - */ -#define NLIRQ 16 - -static struct lirqinfo { - int li_generic; - int li_acount; - struct pci_devinst *li_owner; /* XXX should be a list */ -} lirq[NLIRQ]; - SET_DECLARE(pci_devemu_set, struct pci_devemu); static uint64_t pci_emul_iobase; @@ -682,6 +672,7 @@ pci_emul_init(struct vmctx *ctx, struct pdi->pi_bus = 0; pdi->pi_slot = slot; pdi->pi_func = func; + pdi->pi_lintr_pin = -1; pdi->pi_d = pde; snprintf(pdi->pi_name, PI_NAMESZ, "%s-pci-%d", pde->pe_emu, slot); @@ -1023,16 +1014,6 @@ init_pci(struct vmctx *ctx) pci_emul_membase32 = vm_get_lowmem_limit(ctx); pci_emul_membase64 = PCI_EMUL_MEMBASE64; - /* - * Allow ISA IRQs 5,10,11,12, and 15 to be available for - * generic use - */ - lirq[5].li_generic = 1; - lirq[10].li_generic = 1; - lirq[11].li_generic = 1; - lirq[12].li_generic = 1; - lirq[15].li_generic = 1; - for (slot = 0; slot < MAXSLOTS; slot++) { for (func = 0; func < MAXFUNCS; func++) { si = &pci_slotinfo[slot][func]; @@ -1135,40 +1116,17 @@ pci_is_legacy(struct pci_devinst *pi) return (pci_slotinfo[pi->pi_slot][pi->pi_func].si_legacy); } -static int -pci_lintr_alloc(struct pci_devinst *pi, int vec) -{ - int i; - - assert(vec < NLIRQ); - - if (vec == -1) { - for (i = 0; i < NLIRQ; i++) { - if (lirq[i].li_generic && - lirq[i].li_owner == NULL) { - vec = i; - break; - } - } - } else { - if (lirq[vec].li_owner != NULL) { - vec = -1; - } - } - assert(vec != -1); - - lirq[vec].li_owner = pi; - pi->pi_lintr_pin = vec; - - return (vec); -} - int -pci_lintr_request(struct pci_devinst *pi, int vec) +pci_lintr_request(struct pci_devinst *pi, int req) { + int irq; + + irq = legacy_irq_alloc(req); + if (irq < 0) + return (-1); - vec = pci_lintr_alloc(pi, vec); - pci_set_cfgdata8(pi, PCIR_INTLINE, vec); + pi->pi_lintr_pin = irq; + pci_set_cfgdata8(pi, PCIR_INTLINE, irq); pci_set_cfgdata8(pi, PCIR_INTPIN, 1); return (0); } @@ -1177,7 +1135,7 @@ void pci_lintr_assert(struct pci_devinst *pi) { - assert(pi->pi_lintr_pin); + assert(pi->pi_lintr_pin >= 0); ioapic_assert_pin(pi->pi_vmctx, pi->pi_lintr_pin); } @@ -1185,7 +1143,7 @@ void pci_lintr_deassert(struct pci_devinst *pi) { - assert(pi->pi_lintr_pin); + assert(pi->pi_lintr_pin >= 0); ioapic_deassert_pin(pi->pi_vmctx, pi->pi_lintr_pin); } Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/pci_emul.h Tue Oct 29 00:18:11 2013 (r257293) @@ -103,7 +103,7 @@ struct pci_devinst { struct pci_devemu *pi_d; struct vmctx *pi_vmctx; uint8_t pi_bus, pi_slot, pi_func; - uint8_t pi_lintr_pin; + int8_t pi_lintr_pin; char pi_name[PI_NAMESZ]; int pi_bar_getsize; Added: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_lpc.c Tue Oct 29 00:18:11 2013 (r257293) @@ -0,0 +1,214 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include + +#include "inout.h" +#include "ioapic.h" +#include "pci_emul.h" +#include "uart_emul.h" + +static struct pci_devinst *lpc_bridge; + +#define LPC_UART_NUM 2 +static struct lpc_uart_softc { + struct uart_softc *uart_softc; + const char *opts; + int iobase; + int irq; +} lpc_uart_softc[LPC_UART_NUM]; + +static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2" }; + +/* + * LPC device configuration is in the following form: + * [,] + * For e.g. "com1,stdio" + */ +int +lpc_device_parse(const char *opts) +{ + int unit, error; + char *str, *cpy, *lpcdev; + + error = -1; + str = cpy = strdup(opts); + lpcdev = strsep(&str, ","); + if (lpcdev != NULL) { + for (unit = 0; unit < LPC_UART_NUM; unit++) { + if (strcasecmp(lpcdev, lpc_uart_names[unit]) == 0) { + lpc_uart_softc[unit].opts = str; + error = 0; + goto done; + } + } + } + +done: + if (error) + free(cpy); + + return (error); +} + +static void +lpc_uart_intr_assert(void *arg) +{ + struct lpc_uart_softc *sc = arg; + + assert(sc->irq >= 0); + + ioapic_assert_pin(lpc_bridge->pi_vmctx, sc->irq); +} + +static void +lpc_uart_intr_deassert(void *arg) +{ + struct lpc_uart_softc *sc = arg; + + assert(sc->irq >= 0); + + ioapic_deassert_pin(lpc_bridge->pi_vmctx, sc->irq); +} + +static int +lpc_uart_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + int offset; + struct lpc_uart_softc *sc = arg; + + if (bytes != 1) + return (-1); + + offset = port - sc->iobase; + + if (in) + *eax = uart_read(sc->uart_softc, offset); + else + uart_write(sc->uart_softc, offset, *eax); + + return (0); +} + +static int +lpc_init(void) +{ + struct lpc_uart_softc *sc; + struct inout_port iop; + const char *name; + int unit, error; + + /* COM1 and COM2 */ + for (unit = 0; unit < LPC_UART_NUM; unit++) { + sc = &lpc_uart_softc[unit]; + name = lpc_uart_names[unit]; + + if (uart_legacy_alloc(unit, &sc->iobase, &sc->irq) != 0) { + fprintf(stderr, "Unable to allocate resources for " + "LPC device %s\n", name); + return (-1); + } + + sc->uart_softc = uart_init(lpc_uart_intr_assert, + lpc_uart_intr_deassert, sc); + + if (uart_set_backend(sc->uart_softc, sc->opts) != 0) { + fprintf(stderr, "Unable to initialize backend '%s' " + "for LPC device %s\n", sc->opts, name); + return (-1); + } + + bzero(&iop, sizeof(struct inout_port)); + iop.name = name; + iop.port = sc->iobase; + iop.size = UART_IO_BAR_SIZE; + iop.flags = IOPORT_F_INOUT; + iop.handler = lpc_uart_io_handler; + iop.arg = sc; + + error = register_inout(&iop); + assert(error == 0); + } + + return (0); +} + +static void +pci_lpc_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, + int baridx, uint64_t offset, int size, uint64_t value) +{ +} + +uint64_t +pci_lpc_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, + int baridx, uint64_t offset, int size) +{ + return (0); +} + +#define LPC_DEV 0x7000 +#define LPC_VENDOR 0x8086 + +static int +pci_lpc_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + /* + * Do not allow more than one LPC bridge to be configured. + */ + if (lpc_bridge != NULL) + return (-1); + + if (lpc_init() != 0) + return (-1); + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, LPC_DEV); + pci_set_cfgdata16(pi, PCIR_VENDOR, LPC_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_BRIDGE); + pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_BRIDGE_ISA); + + lpc_bridge = pi; + + return (0); +} + +struct pci_devemu pci_de_lpc = { + .pe_emu = "lpc", + .pe_init = pci_lpc_init, + .pe_barwrite = pci_lpc_write, + .pe_barread = pci_lpc_read +}; +PCI_EMUL_SET(pci_de_lpc); Added: head/usr.sbin/bhyve/pci_lpc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_lpc.h Tue Oct 29 00:18:11 2013 (r257293) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LPC_H_ +#define _LPC_H_ + +int lpc_device_parse(const char *opt); + +#endif Modified: head/usr.sbin/bhyve/pci_uart.c ============================================================================== --- head/usr.sbin/bhyve/pci_uart.c Mon Oct 28 23:47:52 2013 (r257292) +++ head/usr.sbin/bhyve/pci_uart.c Tue Oct 29 00:18:11 2013 (r257293) @@ -30,42 +30,12 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include "bhyverun.h" #include "pci_emul.h" -#include "mevent.h" - -#define COM1_BASE 0x3F8 -#define COM1_IRQ 4 -#define COM2_BASE 0x2F8 -#define COM2_IRQ 3 - -#define DEFAULT_RCLK 1843200 -#define DEFAULT_BAUD 9600 - -#define FCR_RX_MASK 0xC0 - -#define MCR_OUT1 0x04 -#define MCR_OUT2 0x08 - -#define MSR_DELTA_MASK 0x0f - -#ifndef REG_SCR -#define REG_SCR com_scr -#endif - -#define FIFOSZ 16 +#include "uart_emul.h" /* * Pick a PCI vid/did of a chip with a single uart at @@ -75,544 +45,82 @@ __FBSDID("$FreeBSD$"); #define COM_VENDOR 0x131f #define COM_DEV 0x2000 -static int pci_uart_stdio; /* stdio in use for i/o */ - -static int pci_uart_nldevs; /* number of legacy devices - 2 max */ - -static struct { - uint64_t baddr; - int vector; -} pci_uart_lres[] = { - { COM1_BASE, COM1_IRQ}, - { COM2_BASE, COM2_IRQ}, - { 0, 0 } -}; - -struct fifo { - uint8_t buf[FIFOSZ]; - int rindex; /* index to read from */ - int windex; /* index to write to */ - int num; /* number of characters in the fifo */ - int size; /* size of the fifo */ -}; - -struct pci_uart_softc { - struct pci_devinst *pi; - pthread_mutex_t mtx; /* protects all softc elements */ - uint8_t data; /* Data register (R/W) */ - uint8_t ier; /* Interrupt enable register (R/W) */ - uint8_t lcr; /* Line control register (R/W) */ - uint8_t mcr; /* Modem control register (R/W) */ - uint8_t lsr; /* Line status register (R/W) */ - uint8_t msr; /* Modem status register (R/W) */ - uint8_t fcr; /* FIFO control register (W) */ - uint8_t scr; /* Scratch register (R/W) */ - - uint8_t dll; /* Baudrate divisor latch LSB */ - uint8_t dlh; /* Baudrate divisor latch MSB */ - - struct fifo rxfifo; - - int opened; - int stdio; - bool thre_int_pending; /* THRE interrupt pending */ -}; - -static void pci_uart_drain(int fd, enum ev_type ev, void *arg); - -static struct termios tio_orig, tio_new; /* I/O Terminals */ - -static void -ttyclose(void) -{ - tcsetattr(STDIN_FILENO, TCSANOW, &tio_orig); -} - -static void -ttyopen(void) -{ - tcgetattr(STDIN_FILENO, &tio_orig); - - cfmakeraw(&tio_new); - tcsetattr(STDIN_FILENO, TCSANOW, &tio_new); - - atexit(ttyclose); -} - -static bool -tty_char_available(void) -{ - fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0 ) { - return (true); - } else { - return (false); - } -} - -static int -ttyread(void) -{ - char rb; - - if (tty_char_available()) { - read(STDIN_FILENO, &rb, 1); - return (rb & 0xff); - } else { - return (-1); - } -} - -static void -ttywrite(unsigned char wb) -{ - (void) write(STDIN_FILENO, &wb, 1); -} - -static void -fifo_reset(struct fifo *fifo, int size) -{ - bzero(fifo, sizeof(struct fifo)); - fifo->size = size; -} - -static int -fifo_putchar(struct fifo *fifo, uint8_t ch) -{ - - if (fifo->num < fifo->size) { - fifo->buf[fifo->windex] = ch; - fifo->windex = (fifo->windex + 1) % fifo->size; - fifo->num++; - return (0); - } else - return (-1); -} - -static int -fifo_getchar(struct fifo *fifo) -{ - int c; - - if (fifo->num > 0) { - c = fifo->buf[fifo->rindex]; - fifo->rindex = (fifo->rindex + 1) % fifo->size; - fifo->num--; - return (c); - } else - return (-1); -} - -static int -fifo_numchars(struct fifo *fifo) -{ - - return (fifo->num); -} - -static int -fifo_available(struct fifo *fifo) -{ - - return (fifo->num < fifo->size); -} - -static void -pci_uart_opentty(struct pci_uart_softc *sc) -{ - struct mevent *mev; - - assert(sc->opened == 0); - assert(sc->stdio); - - ttyopen(); - mev = mevent_add(STDIN_FILENO, EVF_READ, pci_uart_drain, sc); - assert(mev); -} - static void -pci_uart_legacy_res(uint64_t *bar, int *ivec) +pci_uart_intr_assert(void *arg) { - if (pci_uart_lres[pci_uart_nldevs].baddr != 0) { - *bar = pci_uart_lres[pci_uart_nldevs].baddr; - *ivec = pci_uart_lres[pci_uart_nldevs].vector; - pci_uart_nldevs++; - } else { - /* TODO: print warning ? */ - *bar = 0; - *ivec= -1; - } -} + struct pci_devinst *pi = arg; -/* - * The IIR returns a prioritized interrupt reason: - * - receive data available - * - transmit holding register empty - * - modem status change - * - * Return an interrupt reason if one is available. - */ -static int -pci_uart_intr_reason(struct pci_uart_softc *sc) -{ - - if ((sc->lsr & LSR_OE) != 0 && (sc->ier & IER_ERLS) != 0) - return (IIR_RLS); - else if (fifo_numchars(&sc->rxfifo) > 0 && (sc->ier & IER_ERXRDY) != 0) - return (IIR_RXTOUT); - else if (sc->thre_int_pending && (sc->ier & IER_ETXRDY) != 0) - return (IIR_TXRDY); - else if ((sc->msr & MSR_DELTA_MASK) != 0 && (sc->ier & IER_EMSC) != 0) - return (IIR_MLSC); - else - return (IIR_NOPEND); + pci_lintr_assert(pi); } static void -pci_uart_reset(struct pci_uart_softc *sc) +pci_uart_intr_deassert(void *arg) { - uint16_t divisor; + struct pci_devinst *pi = arg; - divisor = DEFAULT_RCLK / DEFAULT_BAUD / 16; - sc->dll = divisor; - sc->dlh = divisor >> 16; - - fifo_reset(&sc->rxfifo, 1); /* no fifo until enabled by software */ -} - -/* - * Toggle the COM port's intr pin depending on whether or not we have an - * interrupt condition to report to the processor. - */ -static void -pci_uart_toggle_intr(struct pci_uart_softc *sc) -{ - uint8_t intr_reason; - - intr_reason = pci_uart_intr_reason(sc); - - if (intr_reason == IIR_NOPEND) - pci_lintr_deassert(sc->pi); - else - pci_lintr_assert(sc->pi); -} - -static void -pci_uart_drain(int fd, enum ev_type ev, void *arg) -{ - struct pci_uart_softc *sc; - int ch; - - sc = arg; - - assert(fd == STDIN_FILENO); - assert(ev == EVF_READ); - - /* - * This routine is called in the context of the mevent thread - * to take out the softc lock to protect against concurrent - * access from a vCPU i/o exit - */ - pthread_mutex_lock(&sc->mtx); - - if ((sc->mcr & MCR_LOOPBACK) != 0) { - (void) ttyread(); - } else { - while (fifo_available(&sc->rxfifo) && - ((ch = ttyread()) != -1)) { - fifo_putchar(&sc->rxfifo, ch); - } - pci_uart_toggle_intr(sc); - } - - pthread_mutex_unlock(&sc->mtx); + pci_lintr_deassert(pi); } static void pci_uart_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { - struct pci_uart_softc *sc; - int fifosz; - uint8_t msr; - - sc = pi->pi_arg; assert(baridx == 0); assert(size == 1); - /* Open terminal */ - if (!sc->opened && sc->stdio) { - pci_uart_opentty(sc); - sc->opened = 1; - } - - pthread_mutex_lock(&sc->mtx); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 00:53:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D27F9C98; Tue, 29 Oct 2013 00:53:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE5F02C86; Tue, 29 Oct 2013 00:53:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T0rHsb015285; Tue, 29 Oct 2013 00:53:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T0rH0c015284; Tue, 29 Oct 2013 00:53:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310290053.r9T0rH0c015284@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 00:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257295 - head/sys/dev/adb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 00:53:17 -0000 Author: nwhitehorn Date: Tue Oct 29 00:53:17 2013 New Revision: 257295 URL: http://svnweb.freebsd.org/changeset/base/257295 Log: Return NOKEY instead of 0 if there are no more key presses queued. This worked by accident if and only if akbd was part of a kbdmux (which it always was in practice). MFC after: 1 week Modified: head/sys/dev/adb/adb_kbd.c Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Tue Oct 29 00:52:02 2013 (r257294) +++ head/sys/dev/adb/adb_kbd.c Tue Oct 29 00:53:17 2013 (r257295) @@ -621,7 +621,7 @@ akbd_read_char(keyboard_t *kbd, int wait if (!sc->buffers) { mtx_unlock(&sc->sc_mutex); - return (0); + return (NOKEY); } adb_code = sc->buffer[0]; From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 02:25:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB8ECD93; Tue, 29 Oct 2013 02:25:20 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 974A22095; Tue, 29 Oct 2013 02:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T2PKsk046373; Tue, 29 Oct 2013 02:25:20 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T2PJR7046363; Tue, 29 Oct 2013 02:25:19 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310290225.r9T2PJR7046363@svn.freebsd.org> From: Neel Natu Date: Tue, 29 Oct 2013 02:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257297 - in head/sys/amd64/vmm: . intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 02:25:20 -0000 Author: neel Date: Tue Oct 29 02:25:18 2013 New Revision: 257297 URL: http://svnweb.freebsd.org/changeset/base/257297 Log: Remove unnecessary includes of Requested by: alc@ Modified: head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx_genassym.c head/sys/amd64/vmm/intel/vtd.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/intel/vmcs.c Tue Oct 29 02:25:18 2013 (r257297) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include "vmm_host.h" #include "vmcs.h" Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/intel/vmx.c Tue Oct 29 02:25:18 2013 (r257297) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Tue Oct 29 02:25:18 2013 (r257297) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include "vmx.h" #include "vmx_cpufunc.h" Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/intel/vtd.c Tue Oct 29 02:25:18 2013 (r257297) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/vmm.c Tue Oct 29 02:25:18 2013 (r257297) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/vmm_dev.c Tue Oct 29 02:25:18 2013 (r257297) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue Oct 29 00:56:21 2013 (r257296) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue Oct 29 02:25:18 2013 (r257297) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #else /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 02:27:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7DA62ED7; Tue, 29 Oct 2013 02:27:20 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05DDF209D; Tue, 29 Oct 2013 02:27:19 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id v1so4406124qcw.33 for ; Mon, 28 Oct 2013 19:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=IcMHrHWEQo+x31HOvcpv/P9np8obqlGoxYCLMA6O/mw=; b=sHSGtqkvJi8S7+ygfZqTmDhZqpixj4iNeQkMUxutRSEOToYnw5ZplfkgRBNoNkoAje atrLRWzZB46npw69Y1xcX7lVGpXaNJWl+Eic2ZWcdS4y4Q1CVeFfWpsDVKA7LpAkDMeL MeX+WpWr8hkofERqE659aHmIifWbwSzsAKVt3yQNXYL4Yyt/6GnxC1UkToo8T2xJsAkO DiTo67DBX9P6utNldghG28r/4I7/JfeHzvKjKAdnza3jl73avpnOAm+tQ7o735pYe0XX owyqsPDYKjP8754ej/o4xNTG39mQc2jG1PdDZZeAVa1DCFVDKjJKaDQyaOaZYZsQk0ih pV8A== MIME-Version: 1.0 X-Received: by 10.229.244.69 with SMTP id lp5mr33334758qcb.14.1383013639191; Mon, 28 Oct 2013 19:27:19 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 28 Oct 2013 19:27:19 -0700 (PDT) In-Reply-To: <201310282026.r9SKQYYq022824@svn.freebsd.org> References: <201310282026.r9SKQYYq022824@svn.freebsd.org> Date: Mon, 28 Oct 2013 19:27:19 -0700 X-Google-Sender-Auth: 0Ns_ED9W30g5D4VDk28Qi3v6LDM Message-ID: Subject: Re: svn commit: r257270 - head/sys/dev/ath From: Adrian Chadd To: Olivier Houchard Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 02:27:20 -0000 Thanks! -adrian On 28 October 2013 13:26, Olivier Houchard wrote: > Author: cognet > Date: Mon Oct 28 20:26:34 2013 > New Revision: 257270 > URL: http://svnweb.freebsd.org/changeset/base/257270 > > Log: > Include , since we need it if ATH_DEBUG is defined. > > Modified: > head/sys/dev/ath/if_ath_tx.c > > Modified: head/sys/dev/ath/if_ath_tx.c > ============================================================================== > --- head/sys/dev/ath/if_ath_tx.c Mon Oct 28 20:15:59 2013 (r257269) > +++ head/sys/dev/ath/if_ath_tx.c Mon Oct 28 20:26:34 2013 (r257270) > @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 03:12:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 232A6B54; Tue, 29 Oct 2013 03:12:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1125F2343; Tue, 29 Oct 2013 03:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T3CVNY064239; Tue, 29 Oct 2013 03:12:31 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T3CVx4064237; Tue, 29 Oct 2013 03:12:31 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310290312.r9T3CVx4064237@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Oct 2013 03:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257298 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 03:12:32 -0000 Author: markj Date: Tue Oct 29 03:12:31 2013 New Revision: 257298 URL: http://svnweb.freebsd.org/changeset/base/257298 Log: Revert r257248 and fix the problem in a way that doesn't violate style(9). Suggested by: jmg Modified: head/lib/libproc/_libproc.h head/lib/libproc/proc_util.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Tue Oct 29 02:25:18 2013 (r257297) +++ head/lib/libproc/_libproc.h Tue Oct 29 03:12:31 2013 (r257298) @@ -52,6 +52,6 @@ struct proc_handle { #define DPRINTF(...) warn(__VA_ARGS__) #define DPRINTFX(...) warnx(__VA_ARGS__) #else -#define DPRINTF(...) -#define DPRINTFX(...) +#define DPRINTF(...) do { } while (0) +#define DPRINTFX(...) do { } while (0) #endif Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Tue Oct 29 02:25:18 2013 (r257297) +++ head/lib/libproc/proc_util.c Tue Oct 29 03:12:31 2013 (r257298) @@ -145,9 +145,8 @@ proc_wstatus(struct proc_handle *phdl) if (phdl == NULL) return (-1); if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { - if (errno != EINTR) { + if (errno != EINTR) DPRINTF("waitpid"); - } return (-1); } if (WIFSTOPPED(status)) From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 03:42:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E980DED1; Tue, 29 Oct 2013 03:42:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D713D2485; Tue, 29 Oct 2013 03:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T3giH0074002; Tue, 29 Oct 2013 03:42:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T3giR6073999; Tue, 29 Oct 2013 03:42:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310290342.r9T3giR6073999@svn.freebsd.org> From: Rui Paulo Date: Tue, 29 Oct 2013 03:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257299 - in head/sys: arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 03:42:45 -0000 Author: rpaulo Date: Tue Oct 29 03:42:43 2013 New Revision: 257299 URL: http://svnweb.freebsd.org/changeset/base/257299 Log: Digi-CCWMX53: enable ffec and uart. Modified: head/sys/arm/conf/DIGI-CCWMX53 head/sys/boot/fdt/dts/digi-ccwmx53.dts Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Tue Oct 29 03:12:31 2013 (r257298) +++ head/sys/arm/conf/DIGI-CCWMX53 Tue Oct 29 03:42:43 2013 (r257299) @@ -105,8 +105,12 @@ device ether # Ethernet support #device faith # IPv6-to-IPv4 relaying (translation) #device firmware # firmware assist module +# Ethernet +device ffec # Freescale Fast Ethernet Controller +device miibus # Standard mii bus + # Serial (COM) ports -#device uart # Multi-uart driver +device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER device ata Modified: head/sys/boot/fdt/dts/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/digi-ccwmx53.dts Tue Oct 29 03:12:31 2013 (r257298) +++ head/sys/boot/fdt/dts/digi-ccwmx53.dts Tue Oct 29 03:42:43 2013 (r257299) @@ -95,6 +95,10 @@ }; }; aips@60000000 { + ethernet@63fec000 { + status = "okay"; + phy-mode = "rmii"; + }; i2c@63fc4000 { status = "okay"; }; From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 03:52:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 83F1A149; Tue, 29 Oct 2013 03:52:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7128A24E9; Tue, 29 Oct 2013 03:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T3q6Uh077143; Tue, 29 Oct 2013 03:52:06 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T3q6JK077142; Tue, 29 Oct 2013 03:52:06 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310290352.r9T3q6JK077142@svn.freebsd.org> From: Mark Johnston Date: Tue, 29 Oct 2013 03:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257300 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 03:52:06 -0000 Author: markj Date: Tue Oct 29 03:52:05 2013 New Revision: 257300 URL: http://svnweb.freebsd.org/changeset/base/257300 Log: Fix an off-by-one error when checking whether a given address is within the extent of a symbol. Submitted by: Prashanth Kumar Reviewed by: rpaulo MFC after: 1 week Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Oct 29 03:42:43 2013 (r257299) +++ head/lib/libproc/proc_sym.c Tue Oct 29 03:52:05 2013 (r257300) @@ -285,7 +285,7 @@ proc_addr2sym(struct proc_handle *p, uin * by rtld. */ rsym = map->pr_vaddr + sym.st_value; - if (addr >= rsym && addr <= (rsym + sym.st_size)) { + if (addr >= rsym && addr < rsym + sym.st_size) { s = elf_strptr(e, dynsymstridx, sym.st_name); if (s) { if (s[0] == '_' && s[1] == 'Z' && s[2]) @@ -325,7 +325,7 @@ symtab: rsym = map->pr_vaddr + sym.st_value; else rsym = sym.st_value; - if (addr >= rsym && addr <= (rsym + sym.st_size)) { + if (addr >= rsym && addr < rsym + sym.st_size) { s = elf_strptr(e, symtabstridx, sym.st_name); if (s) { if (s[0] == '_' && s[1] == 'Z' && s[2]) From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 04:03:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6C9B2462; Tue, 29 Oct 2013 04:03:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9B12580; Tue, 29 Oct 2013 04:03:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T431S1080751; Tue, 29 Oct 2013 04:03:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T431Ur080749; Tue, 29 Oct 2013 04:03:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310290403.r9T431Ur080749@svn.freebsd.org> From: Adrian Chadd Date: Tue, 29 Oct 2013 04:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257301 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 04:03:01 -0000 Author: adrian Date: Tue Oct 29 04:03:00 2013 New Revision: 257301 URL: http://svnweb.freebsd.org/changeset/base/257301 Log: Fix the PLCP lookup code in iwn(4) to base the 11n decision on whether the rate is 11n, rather than whether the channel is 11n. This correctly allows the PLCP lookup code to return the legacy rates even on an 11n channel. PR: kern/183430 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Oct 29 03:52:05 2013 (r257300) +++ head/sys/dev/iwn/if_iwn.c Tue Oct 29 04:03:00 2013 (r257301) @@ -2210,7 +2210,7 @@ iwn_rate_to_plcp(struct iwn_softc *sc, s * If it's an MCS rate, let's set the plcp correctly * and set the relevant flags based on the node config. */ - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + if (rate & IEEE80211_RATE_MCS) { /* * Set the initial PLCP value to be between 0->31 for * MCS 0 -> MCS 31, then set the "I'm an MCS rate!" From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 04:25:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0AF5FA45; Tue, 29 Oct 2013 04:25:51 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1D4F26A8; Tue, 29 Oct 2013 04:25:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T4PoPQ087896; Tue, 29 Oct 2013 04:25:50 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T4PokD087893; Tue, 29 Oct 2013 04:25:50 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201310290425.r9T4PokD087893@svn.freebsd.org> From: Eygene Ryabinkin Date: Tue, 29 Oct 2013 04:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257302 - in head/contrib/binutils/bfd: . po X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 04:25:51 -0000 Author: rea (ports committer) Date: Tue Oct 29 04:25:49 2013 New Revision: 257302 URL: http://svnweb.freebsd.org/changeset/base/257302 Log: binutils/bfd: fix printf-like format strings for "bfd *" arguments There is a special format argument '%B' that directly handles values of type 'bfd *', they must be used instead of '%s'. Manifestations of this bug can be seen in ld(1) error messages, for example, http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html Approved by: dim MFC after: 2 weeks Modified: head/contrib/binutils/bfd/elf32-score.c head/contrib/binutils/bfd/elflink.c head/contrib/binutils/bfd/po/bfd.pot Modified: head/contrib/binutils/bfd/elf32-score.c ============================================================================== --- head/contrib/binutils/bfd/elf32-score.c Tue Oct 29 04:03:00 2013 (r257301) +++ head/contrib/binutils/bfd/elf32-score.c Tue Oct 29 04:25:49 2013 (r257302) @@ -2546,7 +2546,7 @@ _bfd_score_elf_check_relocs (bfd *abfd, } else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr)) { - (*_bfd_error_handler) (_("%s: Malformed reloc detected for section %s"), abfd, name); + (*_bfd_error_handler) (_("%B: Malformed reloc detected for section %s"), abfd, name); bfd_set_error (bfd_error_bad_value); return FALSE; } Modified: head/contrib/binutils/bfd/elflink.c ============================================================================== --- head/contrib/binutils/bfd/elflink.c Tue Oct 29 04:03:00 2013 (r257301) +++ head/contrib/binutils/bfd/elflink.c Tue Oct 29 04:25:49 2013 (r257302) @@ -4357,8 +4357,8 @@ elf_link_add_object_symbols (bfd *abfd, if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) { (*_bfd_error_handler) - (_("%s: invalid DSO for symbol `%s' definition"), - abfd, name); + (_("%B: invalid DSO for symbol `%s' definition"), + abfd, name); bfd_set_error (bfd_error_bad_value); goto error_free_vers; } Modified: head/contrib/binutils/bfd/po/bfd.pot ============================================================================== --- head/contrib/binutils/bfd/po/bfd.pot Tue Oct 29 04:03:00 2013 (r257301) +++ head/contrib/binutils/bfd/po/bfd.pot Tue Oct 29 04:25:49 2013 (r257302) @@ -1572,7 +1572,7 @@ msgstr "" #: elf32-score.c:2549 #, c-format -msgid "%s: Malformed reloc detected for section %s" +msgid "%B: Malformed reloc detected for section %s" msgstr "" #: elf32-score.c:2600 @@ -2440,7 +2440,7 @@ msgstr "" #: elflink.c:4309 #, c-format -msgid "%s: invalid DSO for symbol `%s' definition" +msgid "%B: invalid DSO for symbol `%s' definition" msgstr "" #: elflink.c:5535 From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 04:27:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D6947CBF; Tue, 29 Oct 2013 04:27:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x22b.google.com (mail-qa0-x22b.google.com [IPv6:2607:f8b0:400d:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49C2526C8; Tue, 29 Oct 2013 04:27:31 +0000 (UTC) Received: by mail-qa0-f43.google.com with SMTP id i13so2641598qae.16 for ; Mon, 28 Oct 2013 21:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lTpcHyGPuOHNuQFHIc1qdoXIMEVVjReu5BK7DCcMe1M=; b=d5mDUoJAew2tpjMV5msAxpqYyUBFY752Rl7o7Df4uZaQFBGHXHRIVyCGhQ8ru9LcaG y2EsoZeoWKs+9iAgf09J7wuBg6o/6JRwCnB7dr2uWrC170rK0rpm974KHVfn04PIxzta XqkpB0Kx/ckusDkwdoLtIbR/8hXiNFu5HfUp+u5LH39536kPig2fvN+Gtr8Tdf0gQObO 1lJy9Eqre2zglKePEJ4jh7JNm5btlOKOmKAUgybilFD/RDlayvDXH4YWGh/zDuXf5uMe Cto+xmq9DvRVw6vpujJCQZDLE7adtZyHUVekcr2Ua2bjtNX38OHhhOSBx6aGh3rN6z+t FwWw== MIME-Version: 1.0 X-Received: by 10.224.131.133 with SMTP id x5mr34486421qas.70.1383020850440; Mon, 28 Oct 2013 21:27:30 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 28 Oct 2013 21:27:30 -0700 (PDT) In-Reply-To: References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> <20131028192731.GA1505@mole.fafoe.narf.at> Date: Mon, 28 Oct 2013 21:27:30 -0700 X-Google-Sender-Auth: 5GuFnQt8ls2U1b44yhwgvWqrONw Message-ID: Subject: Re: svn commit: r257133 - head/sys/dev/iwn From: Adrian Chadd To: Stefan Farfeleder , "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 04:27:32 -0000 I've filed a PR. Please update to -HEAD and test. Thanks! -adrian On 28 October 2013 15:05, Adrian Chadd wrote: > Hi! > > Yup! So, the difference is in the rate being selected. > > It looks like the remote end is just plainly not ACKing the 11n > management frame being sent; but it totally ACKs the 11b CCK frame > being sent. > > So, thanks for pointing that out. I'll go and err, "fix" this mistake. > The driver should be doing what the stack says. Bernhard figured out a > couple years ago that doing 11n management frames to 11n devices is > not guaranteed to work, so we "fixed" that. I will go and figure out > why this is now broken for iwn. > > Thanks! > > Would you mind filing a PR with what we've gathered? > > > > -adrian > > > > On 28 October 2013 12:27, Stefan Farfeleder wrote: >> On Mon, Oct 28, 2013 at 12:07:17PM -0700, Adrian Chadd wrote: >>> Yeah: >>> >>> Oct 28 19:43:43 mole kernel: iwn5000_tx_done: qid 3 idx 4 retries 7 >>> nkill 0 rate a902 duration 686 status 83 >>> >>> status 0x83 is LONG_LIMIT, which meant it tried to transmit and it >>> failed to get an ACK each time. >>> >>> The rate control says: >>> >>> 0x02: the rate in question >>> bit 8: MCS >>> bit 11: HT40 >>> bits 14+15: transmit antennas A+B >>> >>> .. and it's an association/management frame, which is odd as they're >>> not supposed to be sent as 11n HT40 frames like this. >>> >>> can you do the same experiment but with the patch reverted? I'd like >>> to see what the selected rate is. >> >> Ok, here's the output with r257155 and r257133 reverted: >> >> http://pastebin.com/CJzsTANv >> >> Stefan From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 05:14:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ADEBC56C; Tue, 29 Oct 2013 05:14:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 821732901; Tue, 29 Oct 2013 05:14:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T5EdN0004406; Tue, 29 Oct 2013 05:14:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T5EdJ6004404; Tue, 29 Oct 2013 05:14:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310290514.r9T5EdJ6004404@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 29 Oct 2013 05:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257304 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 05:14:39 -0000 Author: yongari Date: Tue Oct 29 05:14:38 2013 New Revision: 257304 URL: http://svnweb.freebsd.org/changeset/base/257304 Log: Add support for new Gigabit PHY of RealTek. I don't have a copy of data sheet so I'm not sure exact PHY model name. Vendor's web page indicates RTL8251 is latest PHY so I used the name. This PHY is used with RTL8168G, RTL8168GU and RTL8411B. Modified: head/sys/dev/mii/miidevs head/sys/dev/mii/rgephy.c Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Tue Oct 29 04:31:07 2013 (r257303) +++ head/sys/dev/mii/miidevs Tue Oct 29 05:14:38 2013 (r257304) @@ -304,6 +304,7 @@ model yyREALTEK RTL8201L 0x0020 RTL8201L model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface model REALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch model REALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface +model REALTEK RTL8251 0x0000 RTL8251 1000BASE-T media interface model REALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface /* Seeq Seeq PHYs */ Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Tue Oct 29 04:31:07 2013 (r257303) +++ head/sys/dev/mii/rgephy.c Tue Oct 29 05:14:38 2013 (r257304) @@ -91,6 +91,7 @@ static void rgephy_load_dspcode(struct m static const struct mii_phydesc rgephys[] = { MII_PHY_DESC(REALTEK, RTL8169S), + MII_PHY_DESC(REALTEK, RTL8251), MII_PHY_END }; @@ -395,7 +396,8 @@ rgephy_loop(struct mii_softc *sc) { int i; - if (sc->mii_mpd_rev < 2) { + if (sc->mii_mpd_model != MII_MODEL_REALTEK_RTL8251 && + sc->mii_mpd_rev < 2) { PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_PDOWN); DELAY(1000); } @@ -428,7 +430,8 @@ rgephy_load_dspcode(struct mii_softc *sc { int val; - if (sc->mii_mpd_rev >= 2) + if (sc->mii_mpd_model == MII_MODEL_REALTEK_RTL8251 || + sc->mii_mpd_rev >= 2) return; PHY_WRITE(sc, 31, 0x0001); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 05:30:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A135B84E; Tue, 29 Oct 2013 05:30:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F73329DD; Tue, 29 Oct 2013 05:30:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T5UMcC008907; Tue, 29 Oct 2013 05:30:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T5UM0l008905; Tue, 29 Oct 2013 05:30:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310290530.r9T5UM0l008905@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 29 Oct 2013 05:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257305 - in head/sys: dev/re pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 05:30:22 -0000 Author: yongari Date: Tue Oct 29 05:30:21 2013 New Revision: 257305 URL: http://svnweb.freebsd.org/changeset/base/257305 Log: Add preliminary support for RTL8168G, RTL8168GU and RTL8411B. RTL8168GU has two variants(GMII and MII) but it uses the same chip revision id. Driver checks PCI device id of controller and sets internal capability flag(i.e. jumbo frame and link speed down in WOL). H/W donated by: RealTek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Oct 29 05:14:38 2013 (r257304) +++ head/sys/dev/re/if_re.c Tue Oct 29 05:30:21 2013 (r257305) @@ -182,7 +182,7 @@ static const struct rl_type re_devs[] = { RT_VENDORID, RT_DEVICEID_8101E, 0, "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, - "RealTek 8168/8111 B/C/CP/D/DP/E/F PCIe Gigabit Ethernet" }, + "RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, "RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169SC, 0, @@ -235,7 +235,10 @@ static const struct rl_hwrev re_hwrevs[] { RL_HWREV_8168E, RL_8169, "8168E/8111E", RL_JUMBO_MTU_9K}, { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL", RL_JUMBO_MTU_6K}, { RL_HWREV_8168F, RL_8169, "8168F/8111F", RL_JUMBO_MTU_9K}, + { RL_HWREV_8168G, RL_8169, "8168G/8111G", RL_JUMBO_MTU_9K}, + { RL_HWREV_8168GU, RL_8169, "8168GU/8111GU", RL_JUMBO_MTU_9K}, { RL_HWREV_8411, RL_8169, "8411", RL_JUMBO_MTU_9K}, + { RL_HWREV_8411B, RL_8169, "8411B", RL_JUMBO_MTU_9K}, { 0, 0, NULL, 0 } }; @@ -1460,12 +1463,25 @@ re_attach(device_t dev) break; case RL_HWREV_8168E_VL: case RL_HWREV_8168F: + case RL_HWREV_8168G: case RL_HWREV_8411: + case RL_HWREV_8411B: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_CMDSTOP_WAIT_TXQ | RL_FLAG_WOL_MANLINK; break; + case RL_HWREV_8168GU: + if (pci_get_device(dev) == RT_DEVICEID_8101E) { + /* RTL8106EUS */ + sc->rl_flags |= RL_FLAG_FASTETHER; + } else + sc->rl_flags |= RL_FLAG_JUMBOV2 | RL_FLAG_WOL_MANLINK; + + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD | RL_FLAG_CMDSTOP_WAIT_TXQ; + break; case RL_HWREV_8169_8110SB: case RL_HWREV_8169_8110SBL: case RL_HWREV_8169_8110SC: @@ -3336,7 +3352,9 @@ re_ioctl(struct ifnet *ifp, u_long comma switch (command) { case SIOCSIFMTU: if (ifr->ifr_mtu < ETHERMIN || - ifr->ifr_mtu > sc->rl_hwrev->rl_max_mtu) { + ifr->ifr_mtu > sc->rl_hwrev->rl_max_mtu || + ((sc->rl_flags & RL_FLAG_FASTETHER) != 0 && + ifr->ifr_mtu > RL_MTU)) { error = EINVAL; break; } Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Tue Oct 29 05:14:38 2013 (r257304) +++ head/sys/pci/if_rlreg.h Tue Oct 29 05:30:21 2013 (r257305) @@ -192,6 +192,9 @@ #define RL_HWREV_8106E 0x44800000 #define RL_HWREV_8168F 0x48000000 #define RL_HWREV_8411 0x48800000 +#define RL_HWREV_8168G 0x4C000000 +#define RL_HWREV_8168GU 0x50800000 +#define RL_HWREV_8411B 0x5C800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 05:37:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 473BD9FE; Tue, 29 Oct 2013 05:37:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 356D82A3C; Tue, 29 Oct 2013 05:37:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T5b6Xp011357; Tue, 29 Oct 2013 05:37:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T5b5KD011355; Tue, 29 Oct 2013 05:37:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310290537.r9T5b5KD011355@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 29 Oct 2013 05:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257306 - in head/sys: dev/re pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 05:37:06 -0000 Author: yongari Date: Tue Oct 29 05:37:05 2013 New Revision: 257306 URL: http://svnweb.freebsd.org/changeset/base/257306 Log: Add preliminary support for RTL8168EP. Submitted by: Edward O'Callaghan (eocallaghan <> alterapraxis dot com) Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Oct 29 05:30:21 2013 (r257305) +++ head/sys/dev/re/if_re.c Tue Oct 29 05:37:05 2013 (r257306) @@ -234,6 +234,7 @@ static const struct rl_hwrev re_hwrevs[] { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP", RL_JUMBO_MTU_9K }, { RL_HWREV_8168E, RL_8169, "8168E/8111E", RL_JUMBO_MTU_9K}, { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL", RL_JUMBO_MTU_6K}, + { RL_HWREV_8168EP, RL_8169, "8168EP/8111EP", RL_JUMBO_MTU_9K}, { RL_HWREV_8168F, RL_8169, "8168F/8111F", RL_JUMBO_MTU_9K}, { RL_HWREV_8168G, RL_8169, "8168G/8111G", RL_JUMBO_MTU_9K}, { RL_HWREV_8168GU, RL_8169, "8168GU/8111GU", RL_JUMBO_MTU_9K}, @@ -1462,6 +1463,7 @@ re_attach(device_t dev) RL_FLAG_WOL_MANLINK; break; case RL_HWREV_8168E_VL: + case RL_HWREV_8168EP: case RL_HWREV_8168F: case RL_HWREV_8168G: case RL_HWREV_8411: Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Tue Oct 29 05:30:21 2013 (r257305) +++ head/sys/pci/if_rlreg.h Tue Oct 29 05:37:05 2013 (r257306) @@ -193,6 +193,7 @@ #define RL_HWREV_8168F 0x48000000 #define RL_HWREV_8411 0x48800000 #define RL_HWREV_8168G 0x4C000000 +#define RL_HWREV_8168EP 0x50000000 #define RL_HWREV_8168GU 0x50800000 #define RL_HWREV_8411B 0x5C800000 #define RL_HWREV_8139 0x60000000 From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 06:37:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 98F7A67F; Tue, 29 Oct 2013 06:37:27 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 864342CFF; Tue, 29 Oct 2013 06:37:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T6bRDY031337; Tue, 29 Oct 2013 06:37:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T6bRfx031336; Tue, 29 Oct 2013 06:37:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201310290637.r9T6bRfx031336@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 29 Oct 2013 06:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257307 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 06:37:27 -0000 Author: yongari Date: Tue Oct 29 06:37:27 2013 New Revision: 257307 URL: http://svnweb.freebsd.org/changeset/base/257307 Log: Fix regression introduced in r235816. r235816 triggered kernel panic or hang after warm boot. Don't blindly restore BCE_EMAC_MODE media configuration in bce_reset(). If driver is about to shutdown it will invoke bce_reset() which in turn results in restoring BCE_EMAC_MODE media configuration. This operation seems to confuse controller firmware. Reported by: Paul Herman (herman <> cleverbridge dot com) Tested by: sbruno, Paul Herman (herman <> cleverbridge dot com) Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Tue Oct 29 05:37:05 2013 (r257306) +++ head/sys/dev/bce/if_bce.c Tue Oct 29 06:37:27 2013 (r257307) @@ -5112,9 +5112,11 @@ bce_reset(struct bce_softc *sc, u32 rese bce_reset_exit: /* Restore EMAC Mode bits needed to keep ASF/IPMI running. */ - val = REG_RD(sc, BCE_EMAC_MODE); - val = (val & ~emac_mode_mask) | emac_mode_save; - REG_WR(sc, BCE_EMAC_MODE, val); + if (reset_code == BCE_DRV_MSG_CODE_RESET) { + val = REG_RD(sc, BCE_EMAC_MODE); + val = (val & ~emac_mode_mask) | emac_mode_save; + REG_WR(sc, BCE_EMAC_MODE, val); + } DBEXIT(BCE_VERBOSE_RESET); return (rc); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 07:25:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F019548C; Tue, 29 Oct 2013 07:25:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCA692FA0; Tue, 29 Oct 2013 07:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T7PsN2047845; Tue, 29 Oct 2013 07:25:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T7Psw2047844; Tue, 29 Oct 2013 07:25:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310290725.r9T7Psw2047844@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Oct 2013 07:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257308 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 07:25:55 -0000 Author: kib Date: Tue Oct 29 07:25:54 2013 New Revision: 257308 URL: http://svnweb.freebsd.org/changeset/base/257308 Log: Remove redundand declaration, fixing the build with gcc. Reported and tested by: Michael Butler Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/x86/include/busdma_impl.h Modified: head/sys/x86/include/busdma_impl.h ============================================================================== --- head/sys/x86/include/busdma_impl.h Tue Oct 29 06:37:27 2013 (r257307) +++ head/sys/x86/include/busdma_impl.h Tue Oct 29 07:25:54 2013 (r257308) @@ -82,7 +82,6 @@ struct bus_dma_impl { bus_dmasync_op_t op); }; -void busdma_lock_mutex(void *arg, bus_dma_lock_op_t op); void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 07:33:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D71BC6A5; Tue, 29 Oct 2013 07:33:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4215200E; Tue, 29 Oct 2013 07:33:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T7XsbC050897; Tue, 29 Oct 2013 07:33:54 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T7XsP4050893; Tue, 29 Oct 2013 07:33:54 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310290733.r9T7XsP4050893@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 29 Oct 2013 07:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257309 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 07:33:54 -0000 Author: bapt Date: Tue Oct 29 07:33:53 2013 New Revision: 257309 URL: http://svnweb.freebsd.org/changeset/base/257309 Log: MFC: r256968, r256971, r256978 Improve SRV records support for the pkg(8) bootstrap: - order srv records by priorities - for all entries of the same priority, order randomly respect the weight - select the port where to fetch from respect the port provided in the SRV record Allow to bootstrap by doing pkg add ./a/path/to/a/pkg_package.txz Approved by: re (glebius) Modified: stable/10/usr.sbin/pkg/dns_utils.c stable/10/usr.sbin/pkg/dns_utils.h stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/usr.sbin/pkg/ (props changed) Modified: stable/10/usr.sbin/pkg/dns_utils.c ============================================================================== --- stable/10/usr.sbin/pkg/dns_utils.c Tue Oct 29 07:25:54 2013 (r257308) +++ stable/10/usr.sbin/pkg/dns_utils.c Tue Oct 29 07:33:53 2013 (r257309) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Baptiste Daroussin + * Copyright (c) 2012-2013 Baptiste Daroussin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,77 @@ typedef union { unsigned char buf[1024]; } dns_query; +static int +srv_priority_cmp(const void *a, const void *b) +{ + const struct dns_srvinfo *da, *db; + unsigned int r, l; + + da = *(struct dns_srvinfo * const *)a; + db = *(struct dns_srvinfo * const *)b; + + l = da->priority; + r = db->priority; + + return ((l > r) - (l < r)); +} + +static int +srv_final_cmp(const void *a, const void *b) +{ + const struct dns_srvinfo *da, *db; + unsigned int r, l, wr, wl; + int res; + + da = *(struct dns_srvinfo * const *)a; + db = *(struct dns_srvinfo * const *)b; + + l = da->priority; + r = db->priority; + + res = ((l > r) - (l < r)); + + if (res == 0) { + wl = da->finalweight; + wr = db->finalweight; + res = ((wr > wl) - (wr < wl)); + } + + return (res); +} + +static void +compute_weight(struct dns_srvinfo **d, int first, int last) +{ + int i, j, totalweight; + int *chosen; + + chosen = malloc(sizeof(int) * (last - first + 1)); + totalweight = 0; + + for (i = 0; i <= last; i++) + totalweight += d[i]->weight; + + if (totalweight == 0) + return; + + for (i = 0; i <= last; i++) { + for (;;) { + chosen[i] = random() % (d[i]->weight * 100 / totalweight); + for (j = 0; j < i; j++) { + if (chosen[i] == chosen[j]) + break; + } + if (j == i) { + d[i]->finalweight = chosen[i]; + break; + } + } + } + + free(chosen); +} + struct dns_srvinfo * dns_getsrvinfo(const char *zone) { @@ -46,7 +117,7 @@ dns_getsrvinfo(const char *zone) unsigned char *end, *p; char host[MAXHOSTNAMELEN]; dns_query q; - int len, qdcount, ancount, n, i; + int len, qdcount, ancount, n, i, f, l; unsigned int type, class, ttl, priority, weight, port; if ((len = res_query(zone, C_IN, T_SRV, q.buf, sizeof(q.buf))) == -1 || @@ -125,6 +196,21 @@ dns_getsrvinfo(const char *zone) n++; } + qsort(res, n, sizeof(res[0]), srv_priority_cmp); + + priority = f = l = 0; + for (i = 0; i < n; i++) { + if (res[i]->priority != priority) { + if (f != l) + compute_weight(res, f, l); + f = i; + priority = res[i]->priority; + } + l = i; + } + + qsort(res, n, sizeof(res[0]), srv_final_cmp); + for (i = 0; i < n - 1; i++) res[i]->next = res[i + 1]; Modified: stable/10/usr.sbin/pkg/dns_utils.h ============================================================================== --- stable/10/usr.sbin/pkg/dns_utils.h Tue Oct 29 07:25:54 2013 (r257308) +++ stable/10/usr.sbin/pkg/dns_utils.h Tue Oct 29 07:33:53 2013 (r257309) @@ -35,6 +35,7 @@ struct dns_srvinfo { unsigned int priority; unsigned int weight; unsigned int port; + unsigned int finalweight; char host[MAXHOSTNAMELEN]; struct dns_srvinfo *next; }; Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 07:25:54 2013 (r257308) +++ stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 07:33:53 2013 (r257309) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -191,8 +192,10 @@ bootstrap_pkg(void) } } - if (mirrors != NULL) + if (mirrors != NULL) { strlcpy(u->host, current->host, sizeof(u->host)); + u->port = current->port; + } remote = fetchXGet(u, &st, ""); if (remote == NULL) { @@ -295,7 +298,9 @@ int main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; + char pkgstatic[MAXPATHLEN]; bool yes = false; + int fd, ret; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); @@ -309,6 +314,19 @@ main(__unused int argc, char *argv[]) if (argv[1] != NULL && strcmp(argv[1], "-N") == 0) errx(EXIT_FAILURE, "pkg is not installed"); + if (argc > 2 && strcmp(argv[1], "add") == 0 && + access(argv[2], R_OK) == 0) { + fd = open(argv[2], O_RDONLY); + if (fd == -1) + err(EXIT_FAILURE, "Unable to open %s", argv[2]); + + if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) + ret = install_pkg_static(pkgstatic, argv[2]); + close(fd); + if (ret != 0) + exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); + } /* * Do not ask for confirmation if either of stdin or stdout is * not tty. Check the environment to see if user has answer From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 07:33:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 28FAE6A6; Tue, 29 Oct 2013 07:33:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1677C2010; Tue, 29 Oct 2013 07:33:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T7Xtxw050936; Tue, 29 Oct 2013 07:33:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T7XtjT050935; Tue, 29 Oct 2013 07:33:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310290733.r9T7XtjT050935@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Oct 2013 07:33: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: r257310 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 07:33:56 -0000 Author: kib Date: Tue Oct 29 07:33:55 2013 New Revision: 257310 URL: http://svnweb.freebsd.org/changeset/base/257310 Log: MFC r256847: Print more useful information about the transfer that trigger the assertion. Approved by: re (glebius) Modified: stable/10/sys/kern/uipc_syscalls.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/kern/uipc_syscalls.c ============================================================================== --- stable/10/sys/kern/uipc_syscalls.c Tue Oct 29 07:33:53 2013 (r257309) +++ stable/10/sys/kern/uipc_syscalls.c Tue Oct 29 07:33:55 2013 (r257310) @@ -2070,7 +2070,8 @@ free_page: } KASSERT(error != 0 || (m->wire_count > 0 && vm_page_is_valid(m, off & PAGE_MASK, xfsize)), - ("wrong page state m %p", m)); + ("wrong page state m %p off %#jx xfsize %d", m, (uintmax_t)off, + xfsize)); VM_OBJECT_WUNLOCK(obj); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 07:35:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA7C0A9A; Tue, 29 Oct 2013 07:35:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7AAD2023; Tue, 29 Oct 2013 07:35:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T7ZJiZ051202; Tue, 29 Oct 2013 07:35:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T7ZJFH051201; Tue, 29 Oct 2013 07:35:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310290735.r9T7ZJFH051201@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Oct 2013 07:35: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: r257311 - stable/10/sys/dev/drm2/i915 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 07:35:19 -0000 Author: kib Date: Tue Oct 29 07:35:19 2013 New Revision: 257311 URL: http://svnweb.freebsd.org/changeset/base/257311 Log: MFC r256848: Use plain register read for waiting of the reset completion notification, to avoid gt_lock recursion. Approved by: re (glebius) Modified: stable/10/sys/dev/drm2/i915/i915_drv.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- stable/10/sys/dev/drm2/i915/i915_drv.c Tue Oct 29 07:33:55 2013 (r257310) +++ stable/10/sys/dev/drm2/i915/i915_drv.c Tue Oct 29 07:35:19 2013 (r257311) @@ -685,7 +685,7 @@ gen6_do_reset(struct drm_device *dev, u8 /* Spin waiting for the device to ack the reset request */ ret = _intel_wait_for(dev, - (I915_READ(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, + (I915_READ_NOTRACE(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, 500, 1, "915rst"); /* If reset with a user forcewake, try to restore, otherwise turn it off */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 07:48:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D9CECC2; Tue, 29 Oct 2013 07:48:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AFCE20C9; Tue, 29 Oct 2013 07:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T7mbF3055225; Tue, 29 Oct 2013 07:48:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T7mb4v055224; Tue, 29 Oct 2013 07:48:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310290748.r9T7mb4v055224@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Oct 2013 07:48:37 +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: r257312 - stable/9/sys/dev/drm2/i915 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 07:48:37 -0000 Author: kib Date: Tue Oct 29 07:48:36 2013 New Revision: 257312 URL: http://svnweb.freebsd.org/changeset/base/257312 Log: MFC r256848: Use plain register read for waiting of the reset completion notification, to avoid gt_lock recursion. Modified: stable/9/sys/dev/drm2/i915/i915_drv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_drv.c Tue Oct 29 07:35:19 2013 (r257311) +++ stable/9/sys/dev/drm2/i915/i915_drv.c Tue Oct 29 07:48:36 2013 (r257312) @@ -685,7 +685,7 @@ gen6_do_reset(struct drm_device *dev, u8 /* Spin waiting for the device to ack the reset request */ ret = _intel_wait_for(dev, - (I915_READ(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, + (I915_READ_NOTRACE(GEN6_GDRST) & GEN6_GRDOM_FULL) == 0, 500, 1, "915rst"); /* If reset with a user forcewake, try to restore, otherwise turn it off */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 07:52:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 10EF61C3; Tue, 29 Oct 2013 07:52:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0A212139; Tue, 29 Oct 2013 07:52:42 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::7950:f87f:c6e0:7f05] (unknown [IPv6:2001:7b8:3a7:0:7950:f87f:c6e0:7f05]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id CA49C5C45; Tue, 29 Oct 2013 08:52:40 +0100 (CET) From: Dimitry Andric Content-Type: multipart/signed; boundary="Apple-Mail=_0225238F-F055-4F2C-9F6E-7884EF6FCE52"; protocol="application/pgp-signature"; micalg=pgp-sha1 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: svn commit: r257302 - in head/contrib/binutils/bfd: . po Date: Tue, 29 Oct 2013 08:52:32 +0100 References: <201310290425.r9T4PokD087893@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201310290425.r9T4PokD087893@svn.freebsd.org> X-Mailer: Apple Mail (2.1816) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 07:52:43 -0000 --Apple-Mail=_0225238F-F055-4F2C-9F6E-7884EF6FCE52 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 29 Oct 2013, at 05:25, Eygene Ryabinkin wrote: > Author: rea (ports committer) > Date: Tue Oct 29 04:25:49 2013 > New Revision: 257302 > URL: http://svnweb.freebsd.org/changeset/base/257302 >=20 > Log: > binutils/bfd: fix printf-like format strings for "bfd *" arguments >=20 > There is a special format argument '%B' that directly handles values > of type 'bfd *', they must be used instead of '%s'. Manifestations > of this bug can be seen in ld(1) error messages, for example, > = http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html= > = http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.htm= l Note this fixes the badly formatted error message, but *not* the other problem that some people have observed, for example with pkg:=20 = http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045962.htm= l See point 4) in Matthias's mail. Since r253839, ld was changed to default to --no-as-needed, but there is still something subtly broken with this behavior: sometimes, DT_NEEDED dependencies *are* automatically pulled in, sometimes they are not... If anyone has a clue what is wrong, please let us know. :-) -Dimitry --Apple-Mail=_0225238F-F055-4F2C-9F6E-7884EF6FCE52 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlJvaUYACgkQsF6jCi4glqPANACdEvea3CPXCQ8eiB7/3nVG2eUm TasAoKCsdp1FY4O8VaqnUyCQ+ui2XB9Y =/FU2 -----END PGP SIGNATURE----- --Apple-Mail=_0225238F-F055-4F2C-9F6E-7884EF6FCE52-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 08:09:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 30C7966A; Tue, 29 Oct 2013 08:09:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C8AD221B; Tue, 29 Oct 2013 08:09:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T894Al064988; Tue, 29 Oct 2013 08:09:04 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T88w8u064932; Tue, 29 Oct 2013 08:08:58 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310290808.r9T88w8u064932@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 29 Oct 2013 08:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r257313 - in vendor/byacc/dist: . package package/debian test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 08:09:04 -0000 Author: bapt Date: Tue Oct 29 08:08:57 2013 New Revision: 257313 URL: http://svnweb.freebsd.org/changeset/base/257313 Log: Import byacc version 20130925 Added: vendor/byacc/dist/package/mingw-byacc.spec Modified: vendor/byacc/dist/CHANGES vendor/byacc/dist/VERSION vendor/byacc/dist/aclocal.m4 vendor/byacc/dist/config.guess vendor/byacc/dist/config.sub vendor/byacc/dist/configure vendor/byacc/dist/package/byacc.spec vendor/byacc/dist/package/debian/changelog vendor/byacc/dist/reader.c vendor/byacc/dist/skeleton.c vendor/byacc/dist/test/calc.tab.c vendor/byacc/dist/test/calc1.tab.c vendor/byacc/dist/test/calc2.tab.c vendor/byacc/dist/test/calc3.tab.c vendor/byacc/dist/test/code_calc.code.c vendor/byacc/dist/test/code_error.code.c vendor/byacc/dist/test/error.tab.c vendor/byacc/dist/test/ftp.tab.c vendor/byacc/dist/test/grammar.tab.c vendor/byacc/dist/test/pure_calc.tab.c vendor/byacc/dist/test/pure_error.tab.c vendor/byacc/dist/test/quote_calc-s.tab.c vendor/byacc/dist/test/quote_calc.tab.c vendor/byacc/dist/test/quote_calc2-s.tab.c vendor/byacc/dist/test/quote_calc2.tab.c vendor/byacc/dist/test/quote_calc3-s.tab.c vendor/byacc/dist/test/quote_calc3.tab.c vendor/byacc/dist/test/quote_calc4-s.tab.c vendor/byacc/dist/test/quote_calc4.tab.c Modified: vendor/byacc/dist/CHANGES ============================================================================== --- vendor/byacc/dist/CHANGES Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/CHANGES Tue Oct 29 08:08:57 2013 (r257313) @@ -1,3 +1,44 @@ +2013-09-25 Thomas E. Dickey + + * reader.c: fix two loop-limits found by clang 3.3 --analyze + + * configure: regen + + * aclocal.m4: + tweaks to CF_MIXEDCASE_FILENAMES and CF_XOPEN_SOURCE for msys from ncurses + + * package/mingw-byacc.spec: RCS_BASE + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * skeleton.c: + Increase default stack-size to match FreeBSD version noted as from + "BSD 4.4 Lite Usr.bin Sources". See + + http://svnweb.freebsd.org/base/vendor/CSRG/dist/usr.bin/yacc/ + http://svnweb.freebsd.org/base/head/usr.bin/yacc/ + http://svnweb.freebsd.org/base/vendor/byacc/ + + The original 1.9 sources (on which I based development) used 500 for + stacksize; the BSD Lite sources (a year or two later) used 10000. + + This is a change to default values; the YYMAXDEPTH and YYSTACKSIZE + symbols have "always" been overridable by applications, but rarely + needed to do this. RedHat began using the FreeBSD source in 2000, + and switched to this source in 2007 using the 20050813 snapshot. + + RedHat #743343 misattributed the change in default stacksize to + a regression in byacc, but did not report the issue upstream. + + * package/debian/changelog, VERSION, package/byacc.spec: bump + +2013-09-07 Thomas E. Dickey + + * config.sub: update to 2013-09-15 + + * config.guess: update to 2013-06-10 + 2013-03-04 Thomas E. Dickey * package/debian/changelog, VERSION, package/byacc.spec: bump @@ -30,7 +71,7 @@ 2013-02-10 Thomas E. Dickey - * config.sub, config.guess: 2013-02-04 + * config.sub, config.guess: update to 2013-02-04 2012-10-03 Thomas E. Dickey @@ -348,11 +389,11 @@ 2011-04-01 Thomas E. Dickey - * config.sub: 2011-04-01 + * config.sub: update to 2011-04-01 2011-02-02 Thomas E. Dickey - * config.guess: 2011-01-01 + * config.guess: update to 2011-01-01 2010-12-29 Thomas E. Dickey @@ -530,11 +571,11 @@ 2010-09-28 Thomas E. Dickey - * config.guess: 2010-09-24 + * config.guess: update to 2010-09-24 2010-09-10 Thomas E. Dickey - * config.sub: 2010-09-11 + * config.sub: update to 2010-09-11 2010-06-10 Thomas E. Dickey @@ -770,9 +811,9 @@ 2009-12-31 Thomas E. Dickey - * config.guess: 2009-12-30 + * config.guess: update to 2009-12-30 - * config.sub: 2009-12-31 + * config.sub: update to 2009-12-31 2009-10-27 Thomas E. Dickey @@ -798,7 +839,7 @@ 2009-08-25 Thomas E. Dickey - * config.guess, config.sub: 2009-08-19 + * config.guess, config.sub: update to 2009-08-19 2009-02-21 Thomas E. Dickey @@ -979,11 +1020,11 @@ 2006-12-22 Thomas E. Dickey - * config.guess: 2006/12/22 + * config.guess: update to 2006/12/22 2006-12-08 Thomas E. Dickey - * config.sub: 2006/12/08 + * config.sub: update to 2006/12/08 2005-08-13 Thomas E. Dickey @@ -1012,9 +1053,9 @@ 2005-06-25 Thomas E. Dickey - * config.sub: 2005/6/2 + * config.sub: update to 2005/6/2 - * config.guess: 2005/5/27 + * config.guess: update to 2005/5/27 2005-05-05 Thomas E. Dickey @@ -1108,9 +1149,9 @@ 2005-04-16 Thomas E. Dickey - * config.sub: 2005/2/10 + * config.sub: update to 2005/2/10 - * config.guess: 2005/3/24 + * config.guess: update to 2005/3/24 2005-04-13 Thomas E. Dickey Modified: vendor/byacc/dist/VERSION ============================================================================== --- vendor/byacc/dist/VERSION Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/VERSION Tue Oct 29 08:08:57 2013 (r257313) @@ -1 +1 @@ -20130304 +20130925 Modified: vendor/byacc/dist/aclocal.m4 ============================================================================== --- vendor/byacc/dist/aclocal.m4 Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/aclocal.m4 Tue Oct 29 08:08:57 2013 (r257313) @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.30 2013/03/05 01:13:39 tom Exp $ +dnl $Id: aclocal.m4,v 1.31 2013/09/25 23:15:41 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- dnl Copyright 2004-2012,2013 Thomas E. Dickey @@ -671,7 +671,7 @@ AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MIXEDCASE_FILENAMES version: 4 updated: 2012/10/02 20:55:03 +dnl CF_MIXEDCASE_FILENAMES version: 5 updated: 2013/09/07 13:54:05 dnl ---------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. @@ -680,7 +680,7 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES], AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ if test "$cross_compiling" = yes ; then case $target_alias in #(vi - *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi + *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw32*|*-uwin*) #(vi cf_cv_mixedcase=no ;; *) @@ -1018,7 +1018,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05 +dnl CF_XOPEN_SOURCE version: 45 updated: 2013/09/07 14:06:25 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -1038,7 +1038,7 @@ case $host_os in #(vi aix[[4-7]]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; -cygwin) #(vi +cygwin|msys) #(vi cf_XOPEN_SOURCE=600 ;; darwin[[0-8]].*) #(vi Modified: vendor/byacc/dist/config.guess ============================================================================== --- vendor/byacc/dist/config.guess Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/config.guess Tue Oct 29 08:08:57 2013 (r257313) @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-02-04' +timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -132,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -853,21 +874,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -880,59 +901,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -951,54 +967,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1231,19 +1256,21 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) Modified: vendor/byacc/dist/config.sub ============================================================================== --- vendor/byacc/dist/config.sub Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/config.sub Tue Oct 29 08:08:57 2013 (r257313) @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-02-04' +timestamp='2013-09-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -252,12 +252,12 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -296,7 +296,7 @@ case $basic_machine in | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -324,7 +324,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -366,13 +366,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -794,7 +794,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -830,7 +830,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1546,6 +1546,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1589,6 +1592,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; Modified: vendor/byacc/dist/configure ============================================================================== --- vendor/byacc/dist/configure Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/configure Tue Oct 29 08:08:57 2013 (r257313) @@ -2112,7 +2112,7 @@ else if test "$cross_compiling" = yes ; then case $target_alias in #(vi - *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi + *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw32*|*-uwin*) #(vi cf_cv_mixedcase=no ;; *) @@ -2340,7 +2340,7 @@ case $host_os in #(vi aix[4-7]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; -cygwin) #(vi +cygwin|msys) #(vi cf_XOPEN_SOURCE=600 ;; darwin[0-8].*) #(vi Modified: vendor/byacc/dist/package/byacc.spec ============================================================================== --- vendor/byacc/dist/package/byacc.spec Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/package/byacc.spec Tue Oct 29 08:08:57 2013 (r257313) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20130304 +%define AppVersion 20130925 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.16 2013/03/05 01:17:35 tom Exp $ +# $XTermId: byacc.spec,v 1.17 2013/09/25 22:41:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: vendor/byacc/dist/package/debian/changelog ============================================================================== --- vendor/byacc/dist/package/debian/changelog Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/package/debian/changelog Tue Oct 29 08:08:57 2013 (r257313) @@ -1,3 +1,9 @@ +byacc (20130925) unstable; urgency=low + + * increase default stack-size + + -- Thomas E. Dickey Wed, 25 Sep 2013 18:41:54 -0400 + byacc (20130304) unstable; urgency=low * changes prompted by Richard Mitton bug-report Added: vendor/byacc/dist/package/mingw-byacc.spec ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/byacc/dist/package/mingw-byacc.spec Tue Oct 29 08:08:57 2013 (r257313) @@ -0,0 +1,60 @@ +Summary: byacc - public domain Berkeley LALR Yacc parser generator +%define AppProgram byacc +%define AppVersion 20130925 +%define UseProgram yacc +# $XTermId: mingw-byacc.spec,v 1.1 2013/09/25 23:12:06 tom Exp $ +Name: %{AppProgram} +Version: %{AppVersion} +Release: 1 +License: Public Domain, MIT +Group: Applications/Development +URL: ftp://invisible-island.net/%{AppProgram} +Source0: %{AppProgram}-%{AppVersion}.tgz +Packager: Thomas Dickey + +%description +This package provides a parser generator utility that reads a grammar +specification from a file and generates an LR(1) parser for it. The +parsers consist of a set of LALR(1) parsing tables and a driver +routine written in the C programming language. It has a public domain +license which includes the generated C. + +%prep + +%setup -q -n %{AppProgram}-%{AppVersion} + +%build + +INSTALL_PROGRAM='${INSTALL}' \ + ./configure \ + --program-prefix=b \ + --target %{_target_platform} \ + --prefix=%{_prefix} \ + --bindir=%{_bindir} \ + --libdir=%{_libdir} \ + --mandir=%{_mandir} + +make + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT +( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) + +strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_prefix}/bin/%{AppProgram} +%{_prefix}/bin/%{UseProgram} +%{_mandir}/man1/%{AppProgram}.* + +%changelog +# each patch should add its ChangeLog entries here + +* Wed Sep 25 2013 Thomas Dickey +- cloned from byacc.spec Modified: vendor/byacc/dist/reader.c ============================================================================== --- vendor/byacc/dist/reader.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/reader.c Tue Oct 29 08:08:57 2013 (r257313) @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.36 2012/05/26 16:05:41 tom Exp $ */ +/* $Id: reader.c,v 1.37 2013/09/25 23:46:18 tom Exp $ */ #include "defs.h" @@ -700,7 +700,7 @@ copy_param(int k) goto out; buf[i--] = '\0'; - while (i >= 0 && isspace(UCH(buf[i]))) + while (i > 0 && isspace(UCH(buf[i]))) buf[i--] = '\0'; if (buf[i] == ']') @@ -723,8 +723,8 @@ copy_param(int k) type2 = i + 1; } - while (i >= 0 && (isalnum(UCH(buf[i])) || - UCH(buf[i]) == '_')) + while (i > 0 && (isalnum(UCH(buf[i])) || + UCH(buf[i]) == '_')) i--; if (!isspace(UCH(buf[i])) && buf[i] != '*') Modified: vendor/byacc/dist/skeleton.c ============================================================================== --- vendor/byacc/dist/skeleton.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/skeleton.c Tue Oct 29 08:08:57 2013 (r257313) @@ -1,4 +1,4 @@ -/* $Id: skeleton.c,v 1.32 2013/03/04 23:19:39 tom Exp $ */ +/* $Id: skeleton.c,v 1.33 2013/09/25 22:44:22 tom Exp $ */ #include "defs.h" @@ -90,12 +90,12 @@ const char *const hdr_defs[] = "#ifdef YYMAXDEPTH", "#define YYSTACKSIZE YYMAXDEPTH", "#else", - "#define YYSTACKSIZE 500", - "#define YYMAXDEPTH 500", + "#define YYSTACKSIZE 10000", + "#define YYMAXDEPTH 10000", "#endif", "#endif", "", - "#define YYINITSTACKSIZE 500", + "#define YYINITSTACKSIZE 200", "", "typedef struct {", " unsigned stacksize;", Modified: vendor/byacc/dist/test/calc.tab.c ============================================================================== --- vendor/byacc/dist/test/calc.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/calc.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -284,12 +284,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/calc1.tab.c ============================================================================== --- vendor/byacc/dist/test/calc1.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/calc1.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -334,12 +334,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/calc2.tab.c ============================================================================== --- vendor/byacc/dist/test/calc2.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/calc2.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -286,12 +286,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/calc3.tab.c ============================================================================== --- vendor/byacc/dist/test/calc3.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/calc3.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -286,12 +286,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/code_calc.code.c ============================================================================== --- vendor/byacc/dist/test/code_calc.code.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/code_calc.code.c Tue Oct 29 08:08:57 2013 (r257313) @@ -187,12 +187,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/code_error.code.c ============================================================================== --- vendor/byacc/dist/test/code_error.code.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/code_error.code.c Tue Oct 29 08:08:57 2013 (r257313) @@ -179,12 +179,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/error.tab.c ============================================================================== --- vendor/byacc/dist/test/error.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/error.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -193,12 +193,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/ftp.tab.c ============================================================================== --- vendor/byacc/dist/test/ftp.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/ftp.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -559,12 +559,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/grammar.tab.c ============================================================================== --- vendor/byacc/dist/test/grammar.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/grammar.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -893,12 +893,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/pure_calc.tab.c ============================================================================== --- vendor/byacc/dist/test/pure_calc.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/pure_calc.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -289,12 +289,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/pure_error.tab.c ============================================================================== --- vendor/byacc/dist/test/pure_error.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/pure_error.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -200,12 +200,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/quote_calc-s.tab.c ============================================================================== --- vendor/byacc/dist/test/quote_calc-s.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/quote_calc-s.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -299,12 +299,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/quote_calc.tab.c ============================================================================== --- vendor/byacc/dist/test/quote_calc.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/quote_calc.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -305,12 +305,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/quote_calc2-s.tab.c ============================================================================== --- vendor/byacc/dist/test/quote_calc2-s.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/quote_calc2-s.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -299,12 +299,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/quote_calc2.tab.c ============================================================================== --- vendor/byacc/dist/test/quote_calc2.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/quote_calc2.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -305,12 +305,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/quote_calc3-s.tab.c ============================================================================== --- vendor/byacc/dist/test/quote_calc3-s.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/quote_calc3-s.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -300,12 +300,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: vendor/byacc/dist/test/quote_calc3.tab.c ============================================================================== --- vendor/byacc/dist/test/quote_calc3.tab.c Tue Oct 29 07:48:36 2013 (r257312) +++ vendor/byacc/dist/test/quote_calc3.tab.c Tue Oct 29 08:08:57 2013 (r257313) @@ -300,12 +300,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 08:10:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A48647C0; Tue, 29 Oct 2013 08:10:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 785C0225A; Tue, 29 Oct 2013 08:10:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T8AZsn067077; Tue, 29 Oct 2013 08:10:35 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T8AZ4X067076; Tue, 29 Oct 2013 08:10:35 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310290810.r9T8AZ4X067076@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 29 Oct 2013 08:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r257314 - vendor/byacc/20130925 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 08:10:35 -0000 Author: bapt Date: Tue Oct 29 08:10:34 2013 New Revision: 257314 URL: http://svnweb.freebsd.org/changeset/base/257314 Log: Tag byacc 20130925 Added: vendor/byacc/20130925/ - copied from r257313, vendor/byacc/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 08:21:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2CCF7CA9; Tue, 29 Oct 2013 08:21:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18AB62333; Tue, 29 Oct 2013 08:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T8LT5X071003; Tue, 29 Oct 2013 08:21:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T8LNO0070967; Tue, 29 Oct 2013 08:21:23 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310290821.r9T8LNO0070967@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 29 Oct 2013 08:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257315 - in head/contrib/byacc: . package package/debian test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 08:21:29 -0000 Author: bapt Date: Tue Oct 29 08:21:22 2013 New Revision: 257315 URL: http://svnweb.freebsd.org/changeset/base/257315 Log: Merge byacc 20130925 2 changes: - Increase default stack-size so that used to be our default stack-size prior byacc import - fix two loop-limits found by clang 3.3 Added: head/contrib/byacc/package/mingw-byacc.spec - copied unchanged from r257314, vendor/byacc/dist/package/mingw-byacc.spec Modified: head/contrib/byacc/CHANGES head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/configure head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/reader.c head/contrib/byacc/skeleton.c head/contrib/byacc/test/calc.tab.c head/contrib/byacc/test/calc1.tab.c head/contrib/byacc/test/calc2.tab.c head/contrib/byacc/test/calc3.tab.c head/contrib/byacc/test/code_calc.code.c head/contrib/byacc/test/code_error.code.c head/contrib/byacc/test/error.tab.c head/contrib/byacc/test/ftp.tab.c head/contrib/byacc/test/grammar.tab.c head/contrib/byacc/test/pure_calc.tab.c head/contrib/byacc/test/pure_error.tab.c head/contrib/byacc/test/quote_calc-s.tab.c head/contrib/byacc/test/quote_calc.tab.c head/contrib/byacc/test/quote_calc2-s.tab.c head/contrib/byacc/test/quote_calc2.tab.c head/contrib/byacc/test/quote_calc3-s.tab.c head/contrib/byacc/test/quote_calc3.tab.c head/contrib/byacc/test/quote_calc4-s.tab.c head/contrib/byacc/test/quote_calc4.tab.c Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/CHANGES Tue Oct 29 08:21:22 2013 (r257315) @@ -1,3 +1,44 @@ +2013-09-25 Thomas E. Dickey + + * reader.c: fix two loop-limits found by clang 3.3 --analyze + + * configure: regen + + * aclocal.m4: + tweaks to CF_MIXEDCASE_FILENAMES and CF_XOPEN_SOURCE for msys from ncurses + + * package/mingw-byacc.spec: RCS_BASE + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * skeleton.c: + Increase default stack-size to match FreeBSD version noted as from + "BSD 4.4 Lite Usr.bin Sources". See + + http://svnweb.freebsd.org/base/vendor/CSRG/dist/usr.bin/yacc/ + http://svnweb.freebsd.org/base/head/usr.bin/yacc/ + http://svnweb.freebsd.org/base/vendor/byacc/ + + The original 1.9 sources (on which I based development) used 500 for + stacksize; the BSD Lite sources (a year or two later) used 10000. + + This is a change to default values; the YYMAXDEPTH and YYSTACKSIZE + symbols have "always" been overridable by applications, but rarely + needed to do this. RedHat began using the FreeBSD source in 2000, + and switched to this source in 2007 using the 20050813 snapshot. + + RedHat #743343 misattributed the change in default stacksize to + a regression in byacc, but did not report the issue upstream. + + * package/debian/changelog, VERSION, package/byacc.spec: bump + +2013-09-07 Thomas E. Dickey + + * config.sub: update to 2013-09-15 + + * config.guess: update to 2013-06-10 + 2013-03-04 Thomas E. Dickey * package/debian/changelog, VERSION, package/byacc.spec: bump @@ -30,7 +71,7 @@ 2013-02-10 Thomas E. Dickey - * config.sub, config.guess: 2013-02-04 + * config.sub, config.guess: update to 2013-02-04 2012-10-03 Thomas E. Dickey @@ -348,11 +389,11 @@ 2011-04-01 Thomas E. Dickey - * config.sub: 2011-04-01 + * config.sub: update to 2011-04-01 2011-02-02 Thomas E. Dickey - * config.guess: 2011-01-01 + * config.guess: update to 2011-01-01 2010-12-29 Thomas E. Dickey @@ -530,11 +571,11 @@ 2010-09-28 Thomas E. Dickey - * config.guess: 2010-09-24 + * config.guess: update to 2010-09-24 2010-09-10 Thomas E. Dickey - * config.sub: 2010-09-11 + * config.sub: update to 2010-09-11 2010-06-10 Thomas E. Dickey @@ -770,9 +811,9 @@ 2009-12-31 Thomas E. Dickey - * config.guess: 2009-12-30 + * config.guess: update to 2009-12-30 - * config.sub: 2009-12-31 + * config.sub: update to 2009-12-31 2009-10-27 Thomas E. Dickey @@ -798,7 +839,7 @@ 2009-08-25 Thomas E. Dickey - * config.guess, config.sub: 2009-08-19 + * config.guess, config.sub: update to 2009-08-19 2009-02-21 Thomas E. Dickey @@ -979,11 +1020,11 @@ 2006-12-22 Thomas E. Dickey - * config.guess: 2006/12/22 + * config.guess: update to 2006/12/22 2006-12-08 Thomas E. Dickey - * config.sub: 2006/12/08 + * config.sub: update to 2006/12/08 2005-08-13 Thomas E. Dickey @@ -1012,9 +1053,9 @@ 2005-06-25 Thomas E. Dickey - * config.sub: 2005/6/2 + * config.sub: update to 2005/6/2 - * config.guess: 2005/5/27 + * config.guess: update to 2005/5/27 2005-05-05 Thomas E. Dickey @@ -1108,9 +1149,9 @@ 2005-04-16 Thomas E. Dickey - * config.sub: 2005/2/10 + * config.sub: update to 2005/2/10 - * config.guess: 2005/3/24 + * config.guess: update to 2005/3/24 2005-04-13 Thomas E. Dickey Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/VERSION Tue Oct 29 08:21:22 2013 (r257315) @@ -1 +1 @@ -20130304 +20130925 Modified: head/contrib/byacc/aclocal.m4 ============================================================================== --- head/contrib/byacc/aclocal.m4 Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/aclocal.m4 Tue Oct 29 08:21:22 2013 (r257315) @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.30 2013/03/05 01:13:39 tom Exp $ +dnl $Id: aclocal.m4,v 1.31 2013/09/25 23:15:41 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- dnl Copyright 2004-2012,2013 Thomas E. Dickey @@ -671,7 +671,7 @@ AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MIXEDCASE_FILENAMES version: 4 updated: 2012/10/02 20:55:03 +dnl CF_MIXEDCASE_FILENAMES version: 5 updated: 2013/09/07 13:54:05 dnl ---------------------- dnl Check if the file-system supports mixed-case filenames. If we're able to dnl create a lowercase name and see it as uppercase, it doesn't support that. @@ -680,7 +680,7 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES], AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ if test "$cross_compiling" = yes ; then case $target_alias in #(vi - *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi + *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw32*|*-uwin*) #(vi cf_cv_mixedcase=no ;; *) @@ -1018,7 +1018,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05 +dnl CF_XOPEN_SOURCE version: 45 updated: 2013/09/07 14:06:25 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -1038,7 +1038,7 @@ case $host_os in #(vi aix[[4-7]]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; -cygwin) #(vi +cygwin|msys) #(vi cf_XOPEN_SOURCE=600 ;; darwin[[0-8]].*) #(vi Modified: head/contrib/byacc/config.guess ============================================================================== --- head/contrib/byacc/config.guess Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/config.guess Tue Oct 29 08:21:22 2013 (r257315) @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-02-04' +timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -132,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -853,21 +874,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -880,59 +901,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -951,54 +967,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1231,19 +1256,21 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) Modified: head/contrib/byacc/config.sub ============================================================================== --- head/contrib/byacc/config.sub Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/config.sub Tue Oct 29 08:21:22 2013 (r257315) @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2013-02-04' +timestamp='2013-09-05' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -252,12 +252,12 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -296,7 +296,7 @@ case $basic_machine in | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -324,7 +324,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -366,13 +366,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -794,7 +794,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -830,7 +830,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1546,6 +1546,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1589,6 +1592,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; Modified: head/contrib/byacc/configure ============================================================================== --- head/contrib/byacc/configure Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/configure Tue Oct 29 08:21:22 2013 (r257315) @@ -2112,7 +2112,7 @@ else if test "$cross_compiling" = yes ; then case $target_alias in #(vi - *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi + *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw32*|*-uwin*) #(vi cf_cv_mixedcase=no ;; *) @@ -2340,7 +2340,7 @@ case $host_os in #(vi aix[4-7]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; -cygwin) #(vi +cygwin|msys) #(vi cf_XOPEN_SOURCE=600 ;; darwin[0-8].*) #(vi Modified: head/contrib/byacc/package/byacc.spec ============================================================================== --- head/contrib/byacc/package/byacc.spec Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/package/byacc.spec Tue Oct 29 08:21:22 2013 (r257315) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20130304 +%define AppVersion 20130925 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.16 2013/03/05 01:17:35 tom Exp $ +# $XTermId: byacc.spec,v 1.17 2013/09/25 22:41:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/debian/changelog ============================================================================== --- head/contrib/byacc/package/debian/changelog Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/package/debian/changelog Tue Oct 29 08:21:22 2013 (r257315) @@ -1,3 +1,9 @@ +byacc (20130925) unstable; urgency=low + + * increase default stack-size + + -- Thomas E. Dickey Wed, 25 Sep 2013 18:41:54 -0400 + byacc (20130304) unstable; urgency=low * changes prompted by Richard Mitton bug-report Copied: head/contrib/byacc/package/mingw-byacc.spec (from r257314, vendor/byacc/dist/package/mingw-byacc.spec) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/byacc/package/mingw-byacc.spec Tue Oct 29 08:21:22 2013 (r257315, copy of r257314, vendor/byacc/dist/package/mingw-byacc.spec) @@ -0,0 +1,60 @@ +Summary: byacc - public domain Berkeley LALR Yacc parser generator +%define AppProgram byacc +%define AppVersion 20130925 +%define UseProgram yacc +# $XTermId: mingw-byacc.spec,v 1.1 2013/09/25 23:12:06 tom Exp $ +Name: %{AppProgram} +Version: %{AppVersion} +Release: 1 +License: Public Domain, MIT +Group: Applications/Development +URL: ftp://invisible-island.net/%{AppProgram} +Source0: %{AppProgram}-%{AppVersion}.tgz +Packager: Thomas Dickey + +%description +This package provides a parser generator utility that reads a grammar +specification from a file and generates an LR(1) parser for it. The +parsers consist of a set of LALR(1) parsing tables and a driver +routine written in the C programming language. It has a public domain +license which includes the generated C. + +%prep + +%setup -q -n %{AppProgram}-%{AppVersion} + +%build + +INSTALL_PROGRAM='${INSTALL}' \ + ./configure \ + --program-prefix=b \ + --target %{_target_platform} \ + --prefix=%{_prefix} \ + --bindir=%{_bindir} \ + --libdir=%{_libdir} \ + --mandir=%{_mandir} + +make + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT +( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) + +strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_prefix}/bin/%{AppProgram} +%{_prefix}/bin/%{UseProgram} +%{_mandir}/man1/%{AppProgram}.* + +%changelog +# each patch should add its ChangeLog entries here + +* Wed Sep 25 2013 Thomas Dickey +- cloned from byacc.spec Modified: head/contrib/byacc/reader.c ============================================================================== --- head/contrib/byacc/reader.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/reader.c Tue Oct 29 08:21:22 2013 (r257315) @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.36 2012/05/26 16:05:41 tom Exp $ */ +/* $Id: reader.c,v 1.37 2013/09/25 23:46:18 tom Exp $ */ #include "defs.h" @@ -701,7 +701,7 @@ copy_param(int k) goto out; buf[i--] = '\0'; - while (i >= 0 && isspace(UCH(buf[i]))) + while (i > 0 && isspace(UCH(buf[i]))) buf[i--] = '\0'; if (buf[i] == ']') @@ -724,8 +724,8 @@ copy_param(int k) type2 = i + 1; } - while (i >= 0 && (isalnum(UCH(buf[i])) || - UCH(buf[i]) == '_')) + while (i > 0 && (isalnum(UCH(buf[i])) || + UCH(buf[i]) == '_')) i--; if (!isspace(UCH(buf[i])) && buf[i] != '*') Modified: head/contrib/byacc/skeleton.c ============================================================================== --- head/contrib/byacc/skeleton.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/skeleton.c Tue Oct 29 08:21:22 2013 (r257315) @@ -1,4 +1,4 @@ -/* $Id: skeleton.c,v 1.32 2013/03/04 23:19:39 tom Exp $ */ +/* $Id: skeleton.c,v 1.33 2013/09/25 22:44:22 tom Exp $ */ #include "defs.h" @@ -90,12 +90,12 @@ const char *const hdr_defs[] = "#ifdef YYMAXDEPTH", "#define YYSTACKSIZE YYMAXDEPTH", "#else", - "#define YYSTACKSIZE 500", - "#define YYMAXDEPTH 500", + "#define YYSTACKSIZE 10000", + "#define YYMAXDEPTH 10000", "#endif", "#endif", "", - "#define YYINITSTACKSIZE 500", + "#define YYINITSTACKSIZE 200", "", "typedef struct {", " unsigned stacksize;", Modified: head/contrib/byacc/test/calc.tab.c ============================================================================== --- head/contrib/byacc/test/calc.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/calc.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -284,12 +284,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/calc1.tab.c ============================================================================== --- head/contrib/byacc/test/calc1.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/calc1.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -334,12 +334,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/calc2.tab.c ============================================================================== --- head/contrib/byacc/test/calc2.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/calc2.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -286,12 +286,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/calc3.tab.c ============================================================================== --- head/contrib/byacc/test/calc3.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/calc3.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -286,12 +286,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/code_calc.code.c ============================================================================== --- head/contrib/byacc/test/code_calc.code.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/code_calc.code.c Tue Oct 29 08:21:22 2013 (r257315) @@ -187,12 +187,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/code_error.code.c ============================================================================== --- head/contrib/byacc/test/code_error.code.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/code_error.code.c Tue Oct 29 08:21:22 2013 (r257315) @@ -179,12 +179,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/error.tab.c ============================================================================== --- head/contrib/byacc/test/error.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/error.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -193,12 +193,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/ftp.tab.c ============================================================================== --- head/contrib/byacc/test/ftp.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/ftp.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -559,12 +559,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/grammar.tab.c ============================================================================== --- head/contrib/byacc/test/grammar.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/grammar.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -893,12 +893,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/pure_calc.tab.c ============================================================================== --- head/contrib/byacc/test/pure_calc.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/pure_calc.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -289,12 +289,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/pure_error.tab.c ============================================================================== --- head/contrib/byacc/test/pure_error.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/pure_error.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -200,12 +200,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/quote_calc-s.tab.c ============================================================================== --- head/contrib/byacc/test/quote_calc-s.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/quote_calc-s.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -299,12 +299,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/quote_calc.tab.c ============================================================================== --- head/contrib/byacc/test/quote_calc.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/quote_calc.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -305,12 +305,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/quote_calc2-s.tab.c ============================================================================== --- head/contrib/byacc/test/quote_calc2-s.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/quote_calc2-s.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -299,12 +299,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/quote_calc2.tab.c ============================================================================== --- head/contrib/byacc/test/quote_calc2.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/quote_calc2.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -305,12 +305,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/quote_calc3-s.tab.c ============================================================================== --- head/contrib/byacc/test/quote_calc3-s.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/quote_calc3-s.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -300,12 +300,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; Modified: head/contrib/byacc/test/quote_calc3.tab.c ============================================================================== --- head/contrib/byacc/test/quote_calc3.tab.c Tue Oct 29 08:10:34 2013 (r257314) +++ head/contrib/byacc/test/quote_calc3.tab.c Tue Oct 29 08:21:22 2013 (r257315) @@ -300,12 +300,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 08:22:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CEDFE08; Tue, 29 Oct 2013 08:22:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E60D72345; Tue, 29 Oct 2013 08:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T8McPr071218; Tue, 29 Oct 2013 08:22:38 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T8McT1071217; Tue, 29 Oct 2013 08:22:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310290822.r9T8McT1071217@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 29 Oct 2013 08:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257316 - head/usr.bin/yacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 08:22:39 -0000 Author: bapt Date: Tue Oct 29 08:22:38 2013 New Revision: 257316 URL: http://svnweb.freebsd.org/changeset/base/257316 Log: Change warning level to 6 Modified: head/usr.bin/yacc/Makefile Modified: head/usr.bin/yacc/Makefile ============================================================================== --- head/usr.bin/yacc/Makefile Tue Oct 29 08:21:22 2013 (r257315) +++ head/usr.bin/yacc/Makefile Tue Oct 29 08:22:38 2013 (r257316) @@ -15,5 +15,6 @@ CFLAGS+= -DMIXEDCASE_FILENAMES=1 \ LINKS= ${BINDIR}/yacc ${BINDIR}/byacc MLINKS= yacc.1 byacc.1 +WARNS= 6 .include From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 08:55:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 123015A3; Tue, 29 Oct 2013 08:55:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3EEA250C; Tue, 29 Oct 2013 08:55:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T8t9Gw081214; Tue, 29 Oct 2013 08:55:09 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T8t9X8081213; Tue, 29 Oct 2013 08:55:09 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310290855.r9T8t9X8081213@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 29 Oct 2013 08:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257317 - head/usr.bin/yacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 08:55:10 -0000 Author: bapt Date: Tue Oct 29 08:55:09 2013 New Revision: 257317 URL: http://svnweb.freebsd.org/changeset/base/257317 Log: Setting WARNS=6 is useless, as it is already the default Reported by: Sascha Wildner Modified: head/usr.bin/yacc/Makefile Modified: head/usr.bin/yacc/Makefile ============================================================================== --- head/usr.bin/yacc/Makefile Tue Oct 29 08:22:38 2013 (r257316) +++ head/usr.bin/yacc/Makefile Tue Oct 29 08:55:09 2013 (r257317) @@ -15,6 +15,5 @@ CFLAGS+= -DMIXEDCASE_FILENAMES=1 \ LINKS= ${BINDIR}/yacc ${BINDIR}/byacc MLINKS= yacc.1 byacc.1 -WARNS= 6 .include From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 09:17:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E19A9C80; Tue, 29 Oct 2013 09:17:33 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep17.mx.upcmail.net (fep17.mx.upcmail.net [62.179.121.37]) by mx1.freebsd.org (Postfix) with ESMTP id 8EAAC262B; Tue, 29 Oct 2013 09:17:32 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep22-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131029091719.GCU23634.viefep22-int.chello.at@edge04.upcmail.net>; Tue, 29 Oct 2013 10:17:19 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge04.upcmail.net with edge id ixHJ1m0432xdvHc03xHKsd; Tue, 29 Oct 2013 10:17:19 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id D005B6D47B; Tue, 29 Oct 2013 10:17:18 +0100 (CET) Date: Tue, 29 Oct 2013 10:17:18 +0100 From: Stefan Farfeleder To: Adrian Chadd Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131029091718.GA1520@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> <20131028192731.GA1505@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "freebsd-wireless@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 09:17:34 -0000 On Mon, Oct 28, 2013 at 09:27:30PM -0700, Adrian Chadd wrote: > I've filed a PR. > > Please update to -HEAD and test. Ok thanks, will do. Probably I won't be able before tomorrow though. Stefan From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 09:23:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA2B8E29; Tue, 29 Oct 2013 09:23:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 970F2267F; Tue, 29 Oct 2013 09:23:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T9Npwm091923; Tue, 29 Oct 2013 09:23:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T9NpL9091922; Tue, 29 Oct 2013 09:23:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310290923.r9T9NpL9091922@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Oct 2013 09:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257320 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 09:23:51 -0000 Author: glebius Date: Tue Oct 29 09:23:51 2013 New Revision: 257320 URL: http://svnweb.freebsd.org/changeset/base/257320 Log: Merge r256537 from head: Make getutxent(3) more robust against bad utx.log files. Whenever we read zeroes, don't stop processing the file, but read until its end or valid data. In collaboration with: ed Approved by: re (kib) Modified: stable/10/lib/libc/gen/getutxent.c Directory Properties: stable/10/lib/libc/ (props changed) Modified: stable/10/lib/libc/gen/getutxent.c ============================================================================== --- stable/10/lib/libc/gen/getutxent.c Tue Oct 29 09:04:25 2013 (r257319) +++ stable/10/lib/libc/gen/getutxent.c Tue Oct 29 09:23:51 2013 (r257320) @@ -122,9 +122,20 @@ getfutxent(struct futx *fu) if (udb == UTXDB_LOG) { uint16_t len; +retry: if (fread(&len, sizeof(len), 1, uf) != 1) return (-1); len = be16toh(len); + if (len == 0) { + /* + * XXX: Though zero-size records are valid in theory, + * they can never occur in practice. Zero-size records + * indicate file corruption. Seek one byte forward, to + * see if we can find a record there. + */ + ungetc('\0', uf); + goto retry; + } if (len > sizeof *fu) { /* Forward compatibility. */ if (fread(fu, sizeof(*fu), 1, uf) != 1) From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 09:24:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B1E98E5; Tue, 29 Oct 2013 09:24:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F1F22699; Tue, 29 Oct 2013 09:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T9Od8h092046; Tue, 29 Oct 2013 09:24:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T9Odsp092045; Tue, 29 Oct 2013 09:24:39 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310290924.r9T9Odsp092045@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Oct 2013 09:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257321 - stable/10/sbin/ifconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 09:24:39 -0000 Author: glebius Date: Tue Oct 29 09:24:39 2013 New Revision: 257321 URL: http://svnweb.freebsd.org/changeset/base/257321 Log: Merge r256824 from head: Provide a working example line for an interface with 1 address running with CARP. Currently, we've got a problem that interface isn't IFF_UP at the time we assign it a redundant address, and the latter gets stuck in INIT state. Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state. A proper fix is kernel side and appeared to be non-trivial, not to be checked in before 10.0-RELEASE. Submitted by: Ole Myhre Approved by: re (kib) Modified: stable/10/sbin/ifconfig/ifconfig.8 Directory Properties: stable/10/sbin/ifconfig/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.8 Tue Oct 29 09:23:51 2013 (r257320) +++ stable/10/sbin/ifconfig/ifconfig.8 Tue Oct 29 09:24:39 2013 (r257321) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd January 10, 2013 +.Dd October 21, 2013 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2690,7 +2690,7 @@ as a synonym for the canonical form of t .Pp Configure a single CARP redundant address on igb0, and then switch it to be master: -.Dl # ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar +.Dl # ifconfig igb0 vhid 1 10.0.0.1/24 pass foobar up .Dl # ifconfig igb0 vhid 1 state master .Pp Configure the interface From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 09:57:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1735782C; Tue, 29 Oct 2013 09:57:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB4EE2830; Tue, 29 Oct 2013 09:57:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T9v0c0002797; Tue, 29 Oct 2013 09:57:00 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T9v0Ws002796; Tue, 29 Oct 2013 09:57:00 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201310290957.r9T9v0Ws002796@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 29 Oct 2013 09:57:00 +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: r257323 - stable/9/sys/netgraph X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 09:57:01 -0000 Author: melifaro Date: Tue Oct 29 09:57:00 2013 New Revision: 257323 URL: http://svnweb.freebsd.org/changeset/base/257323 Log: Merge r256550. Improve locking model used to protect netgraph topology: use rwlocks instead of mutexes on node traversal. Reviewed by: glebius Tested by: Eugene Grosbein Sponsored by: Yandex LLC Modified: stable/9/sys/netgraph/ng_base.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_base.c ============================================================================== --- stable/9/sys/netgraph/ng_base.c Tue Oct 29 09:52:15 2013 (r257322) +++ stable/9/sys/netgraph/ng_base.c Tue Oct 29 09:57:00 2013 (r257323) @@ -74,7 +74,12 @@ MODULE_VERSION(netgraph, NG_ABI_VERSION); /* Mutex to protect topology events. */ -static struct mtx ng_topo_mtx; +static struct rwlock ng_topo_lock; +#define TOPOLOGY_RLOCK() rw_rlock(&ng_topo_lock) +#define TOPOLOGY_RUNLOCK() rw_runlock(&ng_topo_lock) +#define TOPOLOGY_WLOCK() rw_wlock(&ng_topo_lock) +#define TOPOLOGY_WUNLOCK() rw_wunlock(&ng_topo_lock) +#define TOPOLOGY_NOTOWNED() rw_assert(&ng_topo_lock, RA_UNLOCKED) #ifdef NETGRAPH_DEBUG static struct mtx ng_nodelist_mtx; /* protects global node/hook lists */ @@ -1162,7 +1167,7 @@ ng_destroy_hook(hook_p hook) * Protect divorce process with mutex, to avoid races on * simultaneous disconnect. */ - mtx_lock(&ng_topo_mtx); + TOPOLOGY_WLOCK(); hook->hk_flags |= HK_INVALID; @@ -1182,17 +1187,17 @@ ng_destroy_hook(hook_p hook) * If it's already divorced from a node, * just free it. */ - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); } else { - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); ng_rmhook_self(peer); /* Send it a surprise */ } NG_HOOK_UNREF(peer); /* account for peer link */ NG_HOOK_UNREF(hook); /* account for peer link */ } else - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); - mtx_assert(&ng_topo_mtx, MA_NOTOWNED); + TOPOLOGY_NOTOWNED(); /* * Remove the hook from the node's list to avoid possible recursion @@ -1233,9 +1238,9 @@ ng_bypass(hook_p hook1, hook_p hook2) TRAP_ERROR(); return (EINVAL); } - mtx_lock(&ng_topo_mtx); + TOPOLOGY_WLOCK(); if (NG_HOOK_NOT_VALID(hook1) || NG_HOOK_NOT_VALID(hook2)) { - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); return (EINVAL); } hook1->hk_peer->hk_peer = hook2->hk_peer; @@ -1243,7 +1248,7 @@ ng_bypass(hook_p hook1, hook_p hook2) hook1->hk_peer = &ng_deadhook; hook2->hk_peer = &ng_deadhook; - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); NG_HOOK_UNREF(hook1); NG_HOOK_UNREF(hook2); @@ -1440,15 +1445,15 @@ ng_con_part2(node_p node, item_p item, h /* * Acquire topo mutex to avoid race with ng_destroy_hook(). */ - mtx_lock(&ng_topo_mtx); + TOPOLOGY_RLOCK(); peer = hook->hk_peer; if (peer == &ng_deadhook) { - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_RUNLOCK(); printf("failed in ng_con_part2(B)\n"); ng_destroy_hook(hook); ERROUT(ENOENT); } - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_RUNLOCK(); if ((error = ng_send_fn2(peer->hk_node, peer, item, &ng_con_part3, NULL, 0, NG_REUSE_ITEM))) { @@ -1793,14 +1798,14 @@ ng_path2noderef(node_p here, const char /* We have a segment, so look for a hook by that name */ hook = ng_findhook(node, segment); - mtx_lock(&ng_topo_mtx); + TOPOLOGY_WLOCK(); /* Can't get there from here... */ if (hook == NULL || NG_HOOK_PEER(hook) == NULL || NG_HOOK_NOT_VALID(hook) || NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook))) { TRAP_ERROR(); NG_NODE_UNREF(node); - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); return (ENOENT); } @@ -1817,7 +1822,7 @@ ng_path2noderef(node_p here, const char NG_NODE_UNREF(oldnode); /* XXX another race */ if (NG_NODE_NOT_VALID(node)) { NG_NODE_UNREF(node); /* XXX more races */ - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); TRAP_ERROR(); return (ENXIO); } @@ -1830,11 +1835,11 @@ ng_path2noderef(node_p here, const char } else *lasthook = NULL; } - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); *destp = node; return (0); } - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_WUNLOCK(); } } @@ -3202,8 +3207,7 @@ ngb_mod_event(module_t mod, int event, v rw_init(&ng_typelist_lock, "netgraph types"); rw_init(&ng_idhash_lock, "netgraph idhash"); rw_init(&ng_namehash_lock, "netgraph namehash"); - mtx_init(&ng_topo_mtx, "netgraph topology mutex", NULL, - MTX_DEF); + rw_init(&ng_topo_lock, "netgraph topology mutex"); #ifdef NETGRAPH_DEBUG mtx_init(&ng_nodelist_mtx, "netgraph nodelist mutex", NULL, MTX_DEF); @@ -3579,13 +3583,13 @@ ng_address_hook(node_p here, item_p item * that the peer is still connected (even if invalid,) we know * that the peer node is present, though maybe invalid. */ - mtx_lock(&ng_topo_mtx); + TOPOLOGY_RLOCK(); if ((hook == NULL) || NG_HOOK_NOT_VALID(hook) || NG_HOOK_NOT_VALID(peer = NG_HOOK_PEER(hook)) || NG_NODE_NOT_VALID(peernode = NG_PEER_NODE(hook))) { NG_FREE_ITEM(item); TRAP_ERROR(); - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_RUNLOCK(); return (ENETDOWN); } @@ -3598,7 +3602,7 @@ ng_address_hook(node_p here, item_p item NGI_SET_NODE(item, peernode); SET_RETADDR(item, here, retaddr); - mtx_unlock(&ng_topo_mtx); + TOPOLOGY_RUNLOCK(); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 11:17:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D9673D21; Tue, 29 Oct 2013 11:17:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB1452D15; Tue, 29 Oct 2013 11:17:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TBHsc3030874; Tue, 29 Oct 2013 11:17:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TBHnnt030842; Tue, 29 Oct 2013 11:17:49 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310291117.r9TBHnnt030842@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Oct 2013 11:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257324 - in head/sys: compat/svr4 dev/cs dev/cxgbe/tom dev/ep dev/etherswitch/ukswitch dev/ie dev/pdq dev/sbni dev/tsec dev/vx i386/i386 mips/cavium/octe powerpc/ps3 powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 11:17:55 -0000 Author: glebius Date: Tue Oct 29 11:17:49 2013 New Revision: 257324 URL: http://svnweb.freebsd.org/changeset/base/257324 Log: - Provide necessary includes. - Remove unnecessary includes. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/compat/svr4/svr4_sockio.c head/sys/dev/cs/if_cs_isa.c head/sys/dev/cs/if_cs_pccard.c head/sys/dev/cs/if_csvar.h head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/ep/if_ep_mca.c head/sys/dev/etherswitch/ukswitch/ukswitch.c head/sys/dev/ie/if_ie_isa.c head/sys/dev/pdq/if_fea.c head/sys/dev/sbni/if_sbni_isa.c head/sys/dev/tsec/if_tsec_fdt.c head/sys/dev/vx/if_vx_eisa.c head/sys/i386/i386/bpf_jit_machdep.c head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-mdio.c head/sys/mips/cavium/octe/ethernet-mem.c head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-spi.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c head/sys/powerpc/ps3/if_glc.c head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/compat/svr4/svr4_sockio.c ============================================================================== --- head/sys/compat/svr4/svr4_sockio.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/compat/svr4/svr4_sockio.c Tue Oct 29 11:17:49 2013 (r257324) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/cs/if_cs_isa.c ============================================================================== --- head/sys/dev/cs/if_cs_isa.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/cs/if_cs_isa.c Tue Oct 29 11:17:49 2013 (r257324) @@ -30,9 +30,11 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include +#include #include -#include #include #include @@ -42,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include Modified: head/sys/dev/cs/if_cs_pccard.c ============================================================================== --- head/sys/dev/cs/if_cs_pccard.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/cs/if_cs_pccard.c Tue Oct 29 11:17:49 2013 (r257324) @@ -29,7 +29,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include @@ -40,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/dev/cs/if_csvar.h ============================================================================== --- head/sys/dev/cs/if_csvar.h Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/cs/if_csvar.h Tue Oct 29 11:17:49 2013 (r257324) @@ -28,9 +28,6 @@ #ifndef _IF_CSVAR_H #define _IF_CSVAR_H -#include -#include - /* * cs_softc: per line info and status */ Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Oct 29 11:17:49 2013 (r257324) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #ifdef TCP_OFFLOAD #include -#include +#include #include #include #include Modified: head/sys/dev/ep/if_ep_mca.c ============================================================================== --- head/sys/dev/ep/if_ep_mca.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/ep/if_ep_mca.c Tue Oct 29 11:17:49 2013 (r257324) @@ -28,9 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include +#include #include #include @@ -38,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c ============================================================================== --- head/sys/dev/etherswitch/ukswitch/ukswitch.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/etherswitch/ukswitch/ukswitch.c Tue Oct 29 11:17:49 2013 (r257324) @@ -32,16 +32,18 @@ #include #include #include +#include +#include #include +#include #include #include #include #include #include -#include +#include #include -#include #include #include Modified: head/sys/dev/ie/if_ie_isa.c ============================================================================== --- head/sys/dev/ie/if_ie_isa.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/ie/if_ie_isa.c Tue Oct 29 11:17:49 2013 (r257324) @@ -41,7 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include #include #include @@ -54,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/dev/pdq/if_fea.c ============================================================================== --- head/sys/dev/pdq/if_fea.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/pdq/if_fea.c Tue Oct 29 11:17:49 2013 (r257324) @@ -32,10 +32,11 @@ #include #include +#include #include #include - #include +#include #include #include @@ -43,6 +44,7 @@ #include #include +#include #include #include Modified: head/sys/dev/sbni/if_sbni_isa.c ============================================================================== --- head/sys/dev/sbni/if_sbni_isa.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/sbni/if_sbni_isa.c Tue Oct 29 11:17:49 2013 (r257324) @@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include #include Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/tsec/if_tsec_fdt.c Tue Oct 29 11:17:49 2013 (r257324) @@ -35,7 +35,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -48,9 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #include #include Modified: head/sys/dev/vx/if_vx_eisa.c ============================================================================== --- head/sys/dev/vx/if_vx_eisa.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/dev/vx/if_vx_eisa.c Tue Oct 29 11:17:49 2013 (r257324) @@ -33,7 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -44,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/i386/i386/bpf_jit_machdep.c Tue Oct 29 11:17:49 2013 (r257324) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 29 11:17:49 2013 (r257324) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-mdio.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mdio.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-mdio.c Tue Oct 29 11:17:49 2013 (r257324) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-mem.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mem.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-mem.c Tue Oct 29 11:17:49 2013 (r257324) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Oct 29 11:17:49 2013 (r257324) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-rx.c Tue Oct 29 11:17:49 2013 (r257324) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Oct 29 11:17:49 2013 (r257324) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-spi.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-spi.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-spi.c Tue Oct 29 11:17:49 2013 (r257324) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-tx.c Tue Oct 29 11:17:49 2013 (r257324) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet-xaui.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-xaui.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Tue Oct 29 11:17:49 2013 (r257324) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/mips/cavium/octe/ethernet.c Tue Oct 29 11:17:49 2013 (r257324) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "wrapper-cvmx-includes.h" Modified: head/sys/powerpc/ps3/if_glc.c ============================================================================== --- head/sys/powerpc/ps3/if_glc.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/powerpc/ps3/if_glc.c Tue Oct 29 11:17:49 2013 (r257324) @@ -29,9 +29,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -40,12 +42,11 @@ #include #include -#include +#include #include -#include #include #include -#include +#include #include #include Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Tue Oct 29 09:57:00 2013 (r257323) +++ head/sys/powerpc/pseries/phyp_llan.c Tue Oct 29 11:17:49 2013 (r257324) @@ -31,20 +31,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include #include #include -#include +#include #include #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 11:21:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D016EF09; Tue, 29 Oct 2013 11:21:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD2912D79; Tue, 29 Oct 2013 11:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TBLVvh033381; Tue, 29 Oct 2013 11:21:31 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TBLVMm033379; Tue, 29 Oct 2013 11:21:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310291121.r9TBLVMm033379@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Oct 2013 11:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257325 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 11:21:32 -0000 Author: glebius Date: Tue Oct 29 11:21:31 2013 New Revision: 257325 URL: http://svnweb.freebsd.org/changeset/base/257325 Log: Uninline inm_lookup_locked(). Now in_var.h doesn't dereference fields of struct ifnet. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/in_mcast.c head/sys/netinet/in_var.h Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue Oct 29 11:17:49 2013 (r257324) +++ head/sys/netinet/in_mcast.c Tue Oct 29 11:21:31 2013 (r257325) @@ -224,6 +224,49 @@ imf_init(struct in_mfilter *imf, const i } /* + * Function for looking up an in_multi record for an IPv4 multicast address + * on a given interface. ifp must be valid. If no record found, return NULL. + * The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held. + */ +struct in_multi * +inm_lookup_locked(struct ifnet *ifp, const struct in_addr ina) +{ + struct ifmultiaddr *ifma; + struct in_multi *inm; + + IN_MULTI_LOCK_ASSERT(); + IF_ADDR_LOCK_ASSERT(ifp); + + inm = NULL; + TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { + if (ifma->ifma_addr->sa_family == AF_INET) { + inm = (struct in_multi *)ifma->ifma_protospec; + if (inm->inm_addr.s_addr == ina.s_addr) + break; + inm = NULL; + } + } + return (inm); +} + +/* + * Wrapper for inm_lookup_locked(). + * The IF_ADDR_LOCK will be taken on ifp and released on return. + */ +struct in_multi * +inm_lookup(struct ifnet *ifp, const struct in_addr ina) +{ + struct in_multi *inm; + + IN_MULTI_LOCK_ASSERT(); + IF_ADDR_RLOCK(ifp); + inm = inm_lookup_locked(ifp, ina); + IF_ADDR_RUNLOCK(ifp); + + return (inm); +} + +/* * Resize the ip_moptions vector to the next power-of-two minus 1. * May be called with locks held; do not sleep. */ Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Tue Oct 29 11:17:49 2013 (r257324) +++ head/sys/netinet/in_var.h Tue Oct 29 11:21:31 2013 (r257325) @@ -363,49 +363,6 @@ extern struct mtx in_multi_mtx; #define IN_MULTI_LOCK_ASSERT() mtx_assert(&in_multi_mtx, MA_OWNED) #define IN_MULTI_UNLOCK_ASSERT() mtx_assert(&in_multi_mtx, MA_NOTOWNED) -/* - * Function for looking up an in_multi record for an IPv4 multicast address - * on a given interface. ifp must be valid. If no record found, return NULL. - * The IN_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held. - */ -static __inline struct in_multi * -inm_lookup_locked(struct ifnet *ifp, const struct in_addr ina) -{ - struct ifmultiaddr *ifma; - struct in_multi *inm; - - IN_MULTI_LOCK_ASSERT(); - IF_ADDR_LOCK_ASSERT(ifp); - - inm = NULL; - TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { - if (ifma->ifma_addr->sa_family == AF_INET) { - inm = (struct in_multi *)ifma->ifma_protospec; - if (inm->inm_addr.s_addr == ina.s_addr) - break; - inm = NULL; - } - } - return (inm); -} - -/* - * Wrapper for inm_lookup_locked(). - * The IF_ADDR_LOCK will be taken on ifp and released on return. - */ -static __inline struct in_multi * -inm_lookup(struct ifnet *ifp, const struct in_addr ina) -{ - struct in_multi *inm; - - IN_MULTI_LOCK_ASSERT(); - IF_ADDR_RLOCK(ifp); - inm = inm_lookup_locked(ifp, ina); - IF_ADDR_RUNLOCK(ifp); - - return (inm); -} - /* Acquire an in_multi record. */ static __inline void inm_acquire_locked(struct in_multi *inm) @@ -428,6 +385,8 @@ struct route; struct ip_moptions; struct radix_node_head; +struct in_multi *inm_lookup_locked(struct ifnet *, const struct in_addr); +struct in_multi *inm_lookup(struct ifnet *, const struct in_addr); int imo_multi_filter(const struct ip_moptions *, const struct ifnet *, const struct sockaddr *, const struct sockaddr *); void inm_commit(struct in_multi *); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 11:28:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C442046C; Tue, 29 Oct 2013 11:28:11 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B22E12DCC; Tue, 29 Oct 2013 11:28:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TBSBvq034154; Tue, 29 Oct 2013 11:28:11 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TBSB4q034153; Tue, 29 Oct 2013 11:28:11 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201310291128.r9TBSB4q034153@svn.freebsd.org> From: Randall Stewart Date: Tue, 29 Oct 2013 11:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257326 - head/sys/dev/cesa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 11:28:11 -0000 Author: rrs Date: Tue Oct 29 11:28:11 2013 New Revision: 257326 URL: http://svnweb.freebsd.org/changeset/base/257326 Log: Opps, my kirkwood fix for the dreamplug missed this. Modified: head/sys/dev/cesa/cesa.c Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Tue Oct 29 11:21:31 2013 (r257325) +++ head/sys/dev/cesa/cesa.c Tue Oct 29 11:28:11 2013 (r257326) @@ -995,11 +995,17 @@ cesa_attach(device_t dev) sc->sc_dev = dev; /* Check if CESA peripheral device has power turned on */ +#if defined(SOC_MV_KIRKWOOD) + if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) == CPU_PM_CTRL_CRYPTO) { + device_printf(dev, "not powered on\n"); + return (ENXIO); + } +#else if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) != CPU_PM_CTRL_CRYPTO) { device_printf(dev, "not powered on\n"); return (ENXIO); } - +#endif soc_id(&d, &r); switch (d) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 11:36:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 47D878BB; Tue, 29 Oct 2013 11:36:32 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 322B52E51; Tue, 29 Oct 2013 11:36:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TBaWXG037292; Tue, 29 Oct 2013 11:36:32 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TBaWHa037291; Tue, 29 Oct 2013 11:36:32 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201310291136.r9TBaWHa037291@svn.freebsd.org> From: Steven Hartland Date: Tue, 29 Oct 2013 11:36:32 +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: r257327 - stable/10/contrib/llvm/tools/clang/tools/driver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 11:36:32 -0000 Author: smh Date: Tue Oct 29 11:36:31 2013 New Revision: 257327 URL: http://svnweb.freebsd.org/changeset/base/257327 Log: MFC r257109: Add clang-CC and CC to list of hints allowing clang to identify its operating mode as c++ instead of defaulting to c for the binary names CC and clang-CC. This fixes builds that use cmake which automatically sets CXX to /usr/bin/CC by default. PR: bin/182442 Approved by: re (glebius) Modified: stable/10/contrib/llvm/tools/clang/tools/driver/driver.cpp Directory Properties: stable/10/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/tools/driver/driver.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/tools/driver/driver.cpp Tue Oct 29 11:28:11 2013 (r257326) +++ stable/10/contrib/llvm/tools/clang/tools/driver/driver.cpp Tue Oct 29 11:36:31 2013 (r257327) @@ -284,11 +284,13 @@ static void ParseProgName(SmallVectorImp } suffixes [] = { { "clang", false, false }, { "clang++", true, false }, + { "clang-CC", true, false }, { "clang-c++", true, false }, { "clang-cc", false, false }, { "clang-cpp", false, true }, { "clang-g++", true, false }, { "clang-gcc", false, false }, + { "CC", true, false }, { "cc", false, false }, { "cpp", false, true }, { "++", true, false }, From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 12:25:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38D378AF; Tue, 29 Oct 2013 12:25:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B2AF2253; Tue, 29 Oct 2013 12:25:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TCPMBR053723; Tue, 29 Oct 2013 12:25:22 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TCPMSG053719; Tue, 29 Oct 2013 12:25:22 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291225.r9TCPMSG053719@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 12:25: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: r257328 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 12:25:23 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 12:25:22 2013 New Revision: 257328 URL: http://svnweb.freebsd.org/changeset/base/257328 Log: MFC r257051: Add support for using "pkg+http://" for the PACKAGESITE. pkg 1.2 is adding this support as well. This should help lessen the confusion on why the default SRV PACKAGESITE does not load in a browser. Approved by: bapt Approved by: re (glebius) Modified: stable/10/usr.sbin/pkg/config.c stable/10/usr.sbin/pkg/config.h stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/usr.sbin/pkg/ (props changed) Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Tue Oct 29 11:36:31 2013 (r257327) +++ stable/10/usr.sbin/pkg/config.c Tue Oct 29 12:25:22 2013 (r257328) @@ -62,7 +62,7 @@ static struct config_entry c[] = { [PACKAGESITE] = { PKG_CONFIG_STRING, "PACKAGESITE", - "http://pkg.FreeBSD.org/${ABI}/latest", + URL_SCHEME_PREFIX "http://pkg.FreeBSD.org/${ABI}/latest", NULL, false, }, Modified: stable/10/usr.sbin/pkg/config.h ============================================================================== --- stable/10/usr.sbin/pkg/config.h Tue Oct 29 11:36:31 2013 (r257327) +++ stable/10/usr.sbin/pkg/config.h Tue Oct 29 12:25:22 2013 (r257328) @@ -30,6 +30,7 @@ #define _PKG_CONFIG_H #define _LOCALBASE "/usr/local" +#define URL_SCHEME_PREFIX "pkg+" typedef enum { PACKAGESITE = 0, Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 11:36:31 2013 (r257327) +++ stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 12:25:22 2013 (r257328) @@ -168,6 +168,13 @@ bootstrap_pkg(void) warnx("No MIRROR_TYPE defined"); return (-1); } + + /* Support pkg+http:// for PACKAGESITE which is the new format + in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has + no A record. */ + if (strncmp(URL_SCHEME_PREFIX, packagesite, + strlen(URL_SCHEME_PREFIX)) == 0) + packagesite += strlen(URL_SCHEME_PREFIX); snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite); snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 12:34:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99960C3F; Tue, 29 Oct 2013 12:34:11 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 878F82317; Tue, 29 Oct 2013 12:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TCYB4K056939; Tue, 29 Oct 2013 12:34:11 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TCYBu2056938; Tue, 29 Oct 2013 12:34:11 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201310291234.r9TCYBu2056938@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 29 Oct 2013 12:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257329 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 12:34:11 -0000 Author: nyan Date: Tue Oct 29 12:34:11 2013 New Revision: 257329 URL: http://svnweb.freebsd.org/changeset/base/257329 Log: Fix build. Both clang and gcc are required on pc98. X-MFC with: r256915 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 29 12:25:22 2013 (r257328) +++ head/Makefile.inc1 Tue Oct 29 12:34:11 2013 (r257329) @@ -1388,12 +1388,17 @@ _binutils= gnu/usr.bin/binutils # If an full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" -.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && ${TARGET} != "pc98" +.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" _clang= usr.bin/clang _clang_libs= lib/clang .else _cc= gnu/usr.bin/cc .endif + +# The boot2 for pc98 requires gcc. +.if ${TARGET} == "pc98" +_cc= gnu/usr.bin/cc +.endif .endif cross-tools: .MAKE From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 12:53:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C23914A8; Tue, 29 Oct 2013 12:53:24 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9B82471; Tue, 29 Oct 2013 12:53:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TCrOYm064528; Tue, 29 Oct 2013 12:53:24 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TCrOsl064526; Tue, 29 Oct 2013 12:53:24 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201310291253.r9TCrOsl064526@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 29 Oct 2013 12:53:24 +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: r257330 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 12:53:24 -0000 Author: melifaro Date: Tue Oct 29 12:53:23 2013 New Revision: 257330 URL: http://svnweb.freebsd.org/changeset/base/257330 Log: MFC r256624: Fix long-standing issue with incorrect radix mask calculation. Usual symptoms are messages like rn_delete: inconsistent annotation rn_addmask: mask impossibly already in tree routing daemon constantly deleting IPv6 default route or inability to flush/delete particular prefix in ipfw table. Changes: * Assume 32 bytes as maximum radix key length * Remove rn_init() * Statically allocate rn_ones/rn_zeroes * Make separate mask tree for each "normal" tree instead of system global one * Remove "optimization" on masks reusage and key zeroying * Change rn_addmask() arguments to accept tree pointer (no users in base) MFC changes: * keep rn_init() * create global mask tree, protected with mutex, for old rn_addmask users (currently 0 in base) * Add new rn_addmask_r() function (rn_addmask in head) with additional argument to accept tree pointer PR: kern/182851, kern/169206, kern/135476, kern/134531 Found by: Slawa Olhovchenkov Reviewed by: glebius (previous versions) Sponsored by: Yandex LLC Approved by: re (glebius) Modified: stable/10/sys/net/radix.c stable/10/sys/net/radix.h Modified: stable/10/sys/net/radix.c ============================================================================== --- stable/10/sys/net/radix.c Tue Oct 29 12:34:11 2013 (r257329) +++ stable/10/sys/net/radix.c Tue Oct 29 12:53:23 2013 (r257330) @@ -66,27 +66,27 @@ static struct radix_node *rn_search(void *, struct radix_node *), *rn_search_m(void *, struct radix_node *, void *); -static int max_keylen; -static struct radix_mask *rn_mkfreelist; -static struct radix_node_head *mask_rnhead; +static void rn_detachhead_internal(void **head); +static int rn_inithead_internal(void **head, int off); + +#define RADIX_MAX_KEY_LEN 32 + +static char rn_zeros[RADIX_MAX_KEY_LEN]; +static char rn_ones[RADIX_MAX_KEY_LEN] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, +}; + /* - * Work area -- the following point to 3 buffers of size max_keylen, - * allocated in this order in a block of memory malloc'ed by rn_init. - * rn_zeros, rn_ones are set in rn_init and used in readonly afterwards. - * addmask_key is used in rn_addmask in rw mode and not thread-safe. + * XXX: Compat stuff for old rn_addmask() users */ -static char *rn_zeros, *rn_ones, *addmask_key; - -#define MKGet(m) { \ - if (rn_mkfreelist) { \ - m = rn_mkfreelist; \ - rn_mkfreelist = (m)->rm_mklist; \ - } else \ - R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask)); } - -#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);} +static struct radix_node_head *mask_rnhead_compat; +#ifdef _KERNEL +static struct mtx mask_mtx; +#endif -#define rn_masktop (mask_rnhead->rnh_treetop) static int rn_lexobetter(void *m_arg, void *n_arg); static struct radix_mask * @@ -230,7 +230,8 @@ rn_lookup(v_arg, m_arg, head) caddr_t netmask = 0; if (m_arg) { - x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_offset); + x = rn_addmask_r(m_arg, head->rnh_masks, 1, + head->rnh_treetop->rn_offset); if (x == 0) return (0); netmask = x->rn_key; @@ -489,53 +490,47 @@ on1: } struct radix_node * -rn_addmask(n_arg, search, skip) - int search, skip; - void *n_arg; +rn_addmask_r(void *arg, struct radix_node_head *maskhead, int search, int skip) { - caddr_t netmask = (caddr_t)n_arg; + caddr_t netmask = (caddr_t)arg; register struct radix_node *x; register caddr_t cp, cplim; register int b = 0, mlen, j; - int maskduplicated, m0, isnormal; + int maskduplicated, isnormal; struct radix_node *saved_x; - static int last_zeroed = 0; + char addmask_key[RADIX_MAX_KEY_LEN]; - if ((mlen = LEN(netmask)) > max_keylen) - mlen = max_keylen; + if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN) + mlen = RADIX_MAX_KEY_LEN; if (skip == 0) skip = 1; if (mlen <= skip) - return (mask_rnhead->rnh_nodes); + return (maskhead->rnh_nodes); + + bzero(addmask_key, RADIX_MAX_KEY_LEN); if (skip > 1) bcopy(rn_ones + 1, addmask_key + 1, skip - 1); - if ((m0 = mlen) > skip) - bcopy(netmask + skip, addmask_key + skip, mlen - skip); + bcopy(netmask + skip, addmask_key + skip, mlen - skip); /* * Trim trailing zeroes. */ for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;) cp--; mlen = cp - addmask_key; - if (mlen <= skip) { - if (m0 >= last_zeroed) - last_zeroed = mlen; - return (mask_rnhead->rnh_nodes); - } - if (m0 < last_zeroed) - bzero(addmask_key + m0, last_zeroed - m0); - *addmask_key = last_zeroed = mlen; - x = rn_search(addmask_key, rn_masktop); + if (mlen <= skip) + return (maskhead->rnh_nodes); + *addmask_key = mlen; + x = rn_search(addmask_key, maskhead->rnh_treetop); if (bcmp(addmask_key, x->rn_key, mlen) != 0) x = 0; if (x || search) return (x); - R_Zalloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x)); + R_Zalloc(x, struct radix_node *, RADIX_MAX_KEY_LEN + 2 * sizeof (*x)); if ((saved_x = x) == 0) return (0); netmask = cp = (caddr_t)(x + 2); bcopy(addmask_key, cp, mlen); - x = rn_insert(cp, mask_rnhead, &maskduplicated, x); + x = rn_insert(cp, maskhead, &maskduplicated, x); if (maskduplicated) { log(LOG_ERR, "rn_addmask: mask impossibly already in tree"); Free(saved_x); @@ -568,6 +563,23 @@ rn_addmask(n_arg, search, skip) return (x); } +struct radix_node * +rn_addmask(void *n_arg, int search, int skip) +{ + struct radix_node *tt; + +#ifdef _KERNEL + mtx_lock(&mask_mtx); +#endif + tt = rn_addmask_r(&mask_rnhead_compat, n_arg, search, skip); + +#ifdef _KERNEL + mtx_unlock(&mask_mtx); +#endif + + return (tt); +} + static int /* XXX: arbitrary ordering for non-contiguous masks */ rn_lexobetter(m_arg, n_arg) void *m_arg, *n_arg; @@ -590,12 +602,12 @@ rn_new_radix_mask(tt, next) { register struct radix_mask *m; - MKGet(m); + R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask)); if (m == 0) { - log(LOG_ERR, "Mask for route not entered\n"); + log(LOG_ERR, "Failed to allocate route mask\n"); return (0); } - bzero(m, sizeof *m); + bzero(m, sizeof(*m)); m->rm_bit = tt->rn_bit; m->rm_flags = tt->rn_flags; if (tt->rn_flags & RNF_NORMAL) @@ -629,7 +641,8 @@ rn_addroute(v_arg, n_arg, head, treenode * nodes and possibly save time in calculating indices. */ if (netmask) { - if ((x = rn_addmask(netmask, 0, top->rn_offset)) == 0) + x = rn_addmask_r(netmask, head->rnh_masks, 0, top->rn_offset); + if (x == NULL) return (0); b_leaf = x->rn_bit; b = -1 - x->rn_bit; @@ -808,7 +821,8 @@ rn_delete(v_arg, netmask_arg, head) * Delete our route from mask lists. */ if (netmask) { - if ((x = rn_addmask(netmask, 1, head_off)) == 0) + x = rn_addmask_r(netmask, head->rnh_masks, 1, head_off); + if (x == NULL) return (0); netmask = x->rn_key; while (tt->rn_mask != netmask) @@ -841,7 +855,7 @@ rn_delete(v_arg, netmask_arg, head) for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) if (m == saved_m) { *mp = m->rm_mklist; - MKFree(m); + Free(m); break; } if (m == 0) { @@ -932,7 +946,7 @@ on1: struct radix_mask *mm = m->rm_mklist; x->rn_mklist = 0; if (--(m->rm_refs) < 0) - MKFree(m); + Free(m); m = mm; } if (m) @@ -1128,10 +1142,8 @@ rn_walktree(h, f, w) * bits starting at 'off'. * Return 1 on success, 0 on error. */ -int -rn_inithead(head, off) - void **head; - int off; +static int +rn_inithead_internal(void **head, int off) { register struct radix_node_head *rnh; register struct radix_node *t, *tt, *ttt; @@ -1163,8 +1175,8 @@ rn_inithead(head, off) return (1); } -int -rn_detachhead(void **head) +static void +rn_detachhead_internal(void **head) { struct radix_node_head *rnh; @@ -1176,28 +1188,60 @@ rn_detachhead(void **head) Free(rnh); *head = NULL; +} + +int +rn_inithead(void **head, int off) +{ + struct radix_node_head *rnh; + + if (*head != NULL) + return (1); + + if (rn_inithead_internal(head, off) == 0) + return (0); + + rnh = (struct radix_node_head *)(*head); + + if (rn_inithead_internal((void **)&rnh->rnh_masks, 0) == 0) { + rn_detachhead_internal(head); + return (0); + } + + return (1); +} + +int +rn_detachhead(void **head) +{ + struct radix_node_head *rnh; + + KASSERT((head != NULL && *head != NULL), + ("%s: head already freed", __func__)); + + rnh = *head; + + rn_detachhead_internal((void **)&rnh->rnh_masks); + rn_detachhead_internal(head); return (1); } void rn_init(int maxk) { - char *cp, *cplim; - - max_keylen = maxk; - if (max_keylen == 0) { + if ((maxk <= 0) || (maxk > RADIX_MAX_KEY_LEN)) { log(LOG_ERR, - "rn_init: radix functions require max_keylen be set\n"); + "rn_init: max_keylen must be within 1..%d\n", + RADIX_MAX_KEY_LEN); return; } - R_Malloc(rn_zeros, char *, 3 * max_keylen); - if (rn_zeros == NULL) - panic("rn_init"); - bzero(rn_zeros, 3 * max_keylen); - rn_ones = cp = rn_zeros + max_keylen; - addmask_key = cplim = rn_ones + max_keylen; - while (cp < cplim) - *cp++ = -1; - if (rn_inithead((void **)(void *)&mask_rnhead, 0) == 0) + + /* + * XXX: Compat for old rn_addmask() users + */ + if (rn_inithead((void **)(void *)&mask_rnhead_compat, 0) == 0) panic("rn_init 2"); +#ifdef _KERNEL + mtx_init(&mask_mtx, "radix_mask", NULL, MTX_DEF); +#endif } Modified: stable/10/sys/net/radix.h ============================================================================== --- stable/10/sys/net/radix.h Tue Oct 29 12:34:11 2013 (r257329) +++ stable/10/sys/net/radix.h Tue Oct 29 12:53:23 2013 (r257330) @@ -136,6 +136,7 @@ struct radix_node_head { #ifdef _KERNEL struct rwlock rnh_lock; /* locks entire radix tree */ #endif + struct radix_node_head *rnh_masks; /* Storage for our masks */ }; #ifndef _KERNEL @@ -167,6 +168,7 @@ int rn_detachhead(void **); int rn_refines(void *, void *); struct radix_node *rn_addmask(void *, int, int), + *rn_addmask_r(void *, struct radix_node_head *, int, int), *rn_addroute (void *, void *, struct radix_node_head *, struct radix_node [2]), *rn_delete(void *, void *, struct radix_node_head *), From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 13:16:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C4CA1C51; Tue, 29 Oct 2013 13:16:05 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B21462648; Tue, 29 Oct 2013 13:16:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TDG5jZ072458; Tue, 29 Oct 2013 13:16:05 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TDG5ba072457; Tue, 29 Oct 2013 13:16:05 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201310291316.r9TDG5ba072457@svn.freebsd.org> From: Zbigniew Bodek Date: Tue, 29 Oct 2013 13:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257332 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 13:16:05 -0000 Author: zbb Date: Tue Oct 29 13:16:05 2013 New Revision: 257332 URL: http://svnweb.freebsd.org/changeset/base/257332 Log: Add missing ARMv6 CPU functions to ARM Makefile Will fix RPI-B kernel build failure since it adds missing armv6_idcache_wbinv_all which was previously taken from cpufunc_asm_pj4b.S. Reviewed by: gber Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue Oct 29 12:56:21 2013 (r257331) +++ head/sys/conf/Makefile.arm Tue Oct 29 13:16:05 2013 (r257332) @@ -75,7 +75,8 @@ FILES_CPU_FUNC = $S/$M/$M/cpufunc_asm_ar $S/$M/$M/cpufunc_asm_xscale.S $S/$M/$M/cpufunc_asm.S \ $S/$M/$M/cpufunc_asm_xscale_c3.S $S/$M/$M/cpufunc_asm_armv5_ec.S \ $S/$M/$M/cpufunc_asm_fa526.S $S/$M/$M/cpufunc_asm_sheeva.S \ - $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv7.S + $S/$M/$M/cpufunc_asm_pj4b.S $S/$M/$M/cpufunc_asm_armv6.S \ + $S/$M/$M/cpufunc_asm_armv7.S KERNEL_EXTRA=trampoline KERNEL_EXTRA_INSTALL=kernel.gz.tramp From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 13:21:39 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 64466FB3; Tue, 29 Oct 2013 13:21:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 27AAC26C0; Tue, 29 Oct 2013 13:21:38 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 5D517780AD2; Wed, 30 Oct 2013 00:21:30 +1100 (EST) Date: Wed, 30 Oct 2013 00:21:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston Subject: Re: svn commit: r257298 - head/lib/libproc In-Reply-To: <201310290312.r9T3CVx4064237@svn.freebsd.org> Message-ID: <20131029235717.M905@besplex.bde.org> References: <201310290312.r9T3CVx4064237@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=OlY6O5FfQTkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=c1kkC1SkZDMA:10 a=dCe2TcBUkNIx_7PF2fMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 13:21:39 -0000 On Tue, 29 Oct 2013, Mark Johnston wrote: > Log: > Revert r257248 and fix the problem in a way that doesn't violate style(9). Why did gcc complain about the original version? > Modified: head/lib/libproc/_libproc.h > ============================================================================== > --- head/lib/libproc/_libproc.h Tue Oct 29 02:25:18 2013 (r257297) > +++ head/lib/libproc/_libproc.h Tue Oct 29 03:12:31 2013 (r257298) > @@ -52,6 +52,6 @@ struct proc_handle { > #define DPRINTF(...) warn(__VA_ARGS__) > #define DPRINTFX(...) warnx(__VA_ARGS__) > #else > -#define DPRINTF(...) > -#define DPRINTFX(...) > +#define DPRINTF(...) do { } while (0) > +#define DPRINTFX(...) do { } while (0) > #endif > > Modified: head/lib/libproc/proc_util.c > ============================================================================== > --- head/lib/libproc/proc_util.c Tue Oct 29 02:25:18 2013 (r257297) > +++ head/lib/libproc/proc_util.c Tue Oct 29 03:12:31 2013 (r257298) > @@ -145,9 +145,8 @@ proc_wstatus(struct proc_handle *phdl) > if (phdl == NULL) > return (-1); > if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { > - if (errno != EINTR) { > + if (errno != EINTR) > DPRINTF("waitpid"); > - } > return (-1); > } > if (WIFSTOPPED(status)) Unlike some buggy macros, the null macro expanded to syntactically correct code: if (errno != EINTR) ; so it doesn't need the do-while hack. Empty statements are common in some contexts, so compilers shouldn't warn about them. In all versions, the macro isn't completely function-like and the if statement is dead code, so if compilers warn about too many things then the do-while hack wouldn't work here or in most places that it is used. Nearby style bugs: - the error check is for "< 0" instead of for "== -1" - the error message is not as loud as old ones. All old ones begin with "ERROR: ". The new style is better. "ERROR" is not even redundant. It is wrong, since the errors are just warnings. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 13:43:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 714399A7; Tue, 29 Oct 2013 13:43:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E35627EE; Tue, 29 Oct 2013 13:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TDhAAG081955; Tue, 29 Oct 2013 13:43:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TDhARE081953; Tue, 29 Oct 2013 13:43:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291343.r9TDhARE081953@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 13:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257334 - in head/sys/dev/terasic: de4led mtl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 13:43:10 -0000 Author: nwhitehorn Date: Tue Oct 29 13:43:09 2013 New Revision: 257334 URL: http://svnweb.freebsd.org/changeset/base/257334 Log: Hints-only devices should have BUS_PROBE_NOWILDCARD set. We probably need a better flag for this (in the driver metadata, for example). Modified: head/sys/dev/terasic/de4led/terasic_de4led_nexus.c head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Modified: head/sys/dev/terasic/de4led/terasic_de4led_nexus.c ============================================================================== --- head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Tue Oct 29 13:38:44 2013 (r257333) +++ head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Tue Oct 29 13:43:09 2013 (r257334) @@ -58,7 +58,7 @@ terasic_de4led_nexus_probe(device_t dev) { device_set_desc(dev, "Terasic DE4 8-element LED"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/terasic/mtl/terasic_mtl_nexus.c ============================================================================== --- head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Tue Oct 29 13:38:44 2013 (r257333) +++ head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Tue Oct 29 13:43:09 2013 (r257334) @@ -55,7 +55,7 @@ terasic_mtl_nexus_probe(device_t dev) { device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 13:44:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0AE1BD4; Tue, 29 Oct 2013 13:44:19 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE35C280F; Tue, 29 Oct 2013 13:44:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TDiJQa082163; Tue, 29 Oct 2013 13:44:19 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TDiJLL082162; Tue, 29 Oct 2013 13:44:19 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310291344.r9TDiJLL082162@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 29 Oct 2013 13:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257335 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 13:44:20 -0000 Author: pluknet Date: Tue Oct 29 13:44:19 2013 New Revision: 257335 URL: http://svnweb.freebsd.org/changeset/base/257335 Log: OS X 10.9 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 29 13:43:09 2013 (r257334) +++ head/share/misc/bsd-family-tree Tue Oct 29 13:44:19 2013 (r257335) @@ -282,7 +282,8 @@ FreeBSD 5.2 | | | | 8.4 | | NetBSD 6.1.1 | | | | | | | | | | FreeBSD | | NetBSD 6.1.2 | | - | 9.2 | | | | + | 9.2 Mac OS X | | | + | 10.0 | | | | | | | | | | | | | | | | | | @@ -600,6 +601,7 @@ NetBSD 5.2.1 2013-09-29 [NBD] FreeBSD 9.2 2013-09-30 [FBD] NetBSD 6.0.3 2013-09-30 [NBD] NetBSD 6.1.2 2013-09-30 [NBD] +Mac OS X 10.9 2013-10-22 [APL] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 13:48:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FCD4DFB; Tue, 29 Oct 2013 13:48:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 126FF2840; Tue, 29 Oct 2013 13:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TDmgEX082698; Tue, 29 Oct 2013 13:48:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TDmgQP082693; Tue, 29 Oct 2013 13:48:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291348.r9TDmgQP082693@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 13:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257336 - in head/sys/dev/altera: atse avgen jtag_uart sdcard X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 13:48:43 -0000 Author: nwhitehorn Date: Tue Oct 29 13:48:41 2013 New Revision: 257336 URL: http://svnweb.freebsd.org/changeset/base/257336 Log: These nexus attachments do not execute a real probe and so need BUS_PROBE_NOWILDCARD set. Modified: head/sys/dev/altera/atse/if_atse_nexus.c head/sys/dev/altera/avgen/altera_avgen_nexus.c head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c head/sys/dev/altera/sdcard/altera_sdcard_nexus.c Modified: head/sys/dev/altera/atse/if_atse_nexus.c ============================================================================== --- head/sys/dev/altera/atse/if_atse_nexus.c Tue Oct 29 13:44:19 2013 (r257335) +++ head/sys/dev/altera/atse/if_atse_nexus.c Tue Oct 29 13:48:41 2013 (r257336) @@ -130,7 +130,7 @@ atse_probe_nexus(device_t dev) /* Success. */ device_set_desc(dev, "Altera Triple-Speed Ethernet MegaCore"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/altera/avgen/altera_avgen_nexus.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_nexus.c Tue Oct 29 13:44:19 2013 (r257335) +++ head/sys/dev/altera/avgen/altera_avgen_nexus.c Tue Oct 29 13:48:41 2013 (r257336) @@ -58,7 +58,7 @@ altera_avgen_nexus_probe(device_t dev) { device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Tue Oct 29 13:44:19 2013 (r257335) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Tue Oct 29 13:48:41 2013 (r257336) @@ -62,7 +62,7 @@ altera_jtag_uart_nexus_probe(device_t de { device_set_desc(dev, "Altera JTAG UART"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/altera/sdcard/altera_sdcard_nexus.c ============================================================================== --- head/sys/dev/altera/sdcard/altera_sdcard_nexus.c Tue Oct 29 13:44:19 2013 (r257335) +++ head/sys/dev/altera/sdcard/altera_sdcard_nexus.c Tue Oct 29 13:48:41 2013 (r257336) @@ -62,7 +62,7 @@ altera_sdcard_nexus_probe(device_t dev) { device_set_desc(dev, "Altera Secure Data Card IP Core"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 13:52:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 98729F0; Tue, 29 Oct 2013 13:52:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 862C12887; Tue, 29 Oct 2013 13:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TDq6Ij085240; Tue, 29 Oct 2013 13:52:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TDq6JA085238; Tue, 29 Oct 2013 13:52:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291352.r9TDq6JA085238@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 13:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257337 - in head/sys/arm/xscale: i80321 pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 13:52:06 -0000 Author: nwhitehorn Date: Tue Oct 29 13:52:05 2013 New Revision: 257337 URL: http://svnweb.freebsd.org/changeset/base/257337 Log: Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe methods. Modified: head/sys/arm/xscale/i80321/iq80321.c head/sys/arm/xscale/pxa/pxa_obio.c Modified: head/sys/arm/xscale/i80321/iq80321.c ============================================================================== --- head/sys/arm/xscale/i80321/iq80321.c Tue Oct 29 13:48:41 2013 (r257336) +++ head/sys/arm/xscale/i80321/iq80321.c Tue Oct 29 13:52:05 2013 (r257337) @@ -72,7 +72,7 @@ int iq80321_probe(device_t dev) { device_set_desc(dev, "Intel 80321"); - return (0); + return (BUS_PROBE_NOWILDCARD); } void Modified: head/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_obio.c Tue Oct 29 13:48:41 2013 (r257336) +++ head/sys/arm/xscale/pxa/pxa_obio.c Tue Oct 29 13:52:05 2013 (r257337) @@ -92,7 +92,7 @@ pxa_probe(device_t dev) { device_set_desc(dev, "XScale PXA On-board IO"); - return (0); + return (BUS_PROBE_NOWILDCARD); } int From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:07:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D59294A1; Tue, 29 Oct 2013 14:07:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3AA4293A; Tue, 29 Oct 2013 14:07:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TE7aMb089536; Tue, 29 Oct 2013 14:07:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TE7VwC089505; Tue, 29 Oct 2013 14:07:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291407.r9TE7VwC089505@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 14:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257338 - in head/sys/mips: adm5120 alchemy atheros cavium idt malta mips nlm rmi rt305x sibyte X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:07:37 -0000 Author: nwhitehorn Date: Tue Oct 29 14:07:31 2013 New Revision: 257338 URL: http://svnweb.freebsd.org/changeset/base/257338 Log: Devices that rely on hints or identify routines for discovery need to return BUS_PROBE_NOWILDCARD from their probe routines to avoid claiming wildcard devices on their parent bus. Do a sweep through the MIPS tree. MFC after: 2 weeks Modified: head/sys/mips/adm5120/obio.c head/sys/mips/alchemy/obio.c head/sys/mips/atheros/apb.c head/sys/mips/atheros/ar71xx_ehci.c head/sys/mips/atheros/ar71xx_pci.c head/sys/mips/atheros/ar71xx_spi.c head/sys/mips/atheros/ar71xx_wdog.c head/sys/mips/atheros/ar724x_pci.c head/sys/mips/atheros/if_arge.c head/sys/mips/cavium/ciu.c head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_pmc.c head/sys/mips/cavium/octeon_rnd.c head/sys/mips/cavium/octeon_rtc.c head/sys/mips/idt/obio.c head/sys/mips/malta/gt.c head/sys/mips/mips/tick.c head/sys/mips/nlm/tick.c head/sys/mips/nlm/xlp_pci.c head/sys/mips/rmi/iodi.c head/sys/mips/rmi/tick.c head/sys/mips/rt305x/obio.c head/sys/mips/sibyte/sb_zbbus.c Modified: head/sys/mips/adm5120/obio.c ============================================================================== --- head/sys/mips/adm5120/obio.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/adm5120/obio.c Tue Oct 29 14:07:31 2013 (r257338) @@ -157,7 +157,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/alchemy/obio.c ============================================================================== --- head/sys/mips/alchemy/obio.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/alchemy/obio.c Tue Oct 29 14:07:31 2013 (r257338) @@ -158,7 +158,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NO_WILDCARD); } static int Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/apb.c Tue Oct 29 14:07:31 2013 (r257338) @@ -103,7 +103,7 @@ static int apb_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/ar71xx_ehci.c Tue Oct 29 14:07:31 2013 (r257338) @@ -75,7 +75,7 @@ ar71xx_ehci_probe(device_t self) device_set_desc(self, EHCI_HC_DEVSTR); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/ar71xx_pci.c Tue Oct 29 14:07:31 2013 (r257338) @@ -371,7 +371,7 @@ static int ar71xx_pci_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/atheros/ar71xx_spi.c ============================================================================== --- head/sys/mips/atheros/ar71xx_spi.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/ar71xx_spi.c Tue Oct 29 14:07:31 2013 (r257338) @@ -92,7 +92,7 @@ static int ar71xx_spi_probe(device_t dev) { device_set_desc(dev, "AR71XX SPI"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/atheros/ar71xx_wdog.c ============================================================================== --- head/sys/mips/atheros/ar71xx_wdog.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/ar71xx_wdog.c Tue Oct 29 14:07:31 2013 (r257338) @@ -92,7 +92,7 @@ ar71xx_wdog_probe(device_t dev) { device_set_desc(dev, "Atheros AR71XX watchdog timer"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/ar724x_pci.c Tue Oct 29 14:07:31 2013 (r257338) @@ -349,7 +349,7 @@ static int ar724x_pci_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/atheros/if_arge.c Tue Oct 29 14:07:31 2013 (r257338) @@ -262,7 +262,7 @@ arge_probe(device_t dev) { device_set_desc(dev, "Atheros AR71xx built-in ethernet interface"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/mips/cavium/ciu.c ============================================================================== --- head/sys/mips/cavium/ciu.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/cavium/ciu.c Tue Oct 29 14:07:31 2013 (r257338) @@ -109,7 +109,7 @@ ciu_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Central Interrupt Unit"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Oct 29 14:07:31 2013 (r257338) @@ -599,7 +599,7 @@ static int cf_probe (device_t dev) device_set_desc(dev, "Octeon Compact Flash Driver"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /* ------------------------------------------------------------------- * Modified: head/sys/mips/cavium/octeon_pmc.c ============================================================================== --- head/sys/mips/cavium/octeon_pmc.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/cavium/octeon_pmc.c Tue Oct 29 14:07:31 2013 (r257338) @@ -71,7 +71,7 @@ octeon_pmc_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Performance Counters"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/cavium/octeon_rnd.c ============================================================================== --- head/sys/mips/cavium/octeon_rnd.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/cavium/octeon_rnd.c Tue Oct 29 14:07:31 2013 (r257338) @@ -86,7 +86,7 @@ octeon_rnd_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Random Number Generator"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/cavium/octeon_rtc.c ============================================================================== --- head/sys/mips/cavium/octeon_rtc.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/cavium/octeon_rtc.c Tue Oct 29 14:07:31 2013 (r257338) @@ -81,7 +81,7 @@ octeon_rtc_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Cavium Octeon Realtime Clock"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/idt/obio.c ============================================================================== --- head/sys/mips/idt/obio.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/idt/obio.c Tue Oct 29 14:07:31 2013 (r257338) @@ -108,7 +108,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/malta/gt.c ============================================================================== --- head/sys/mips/malta/gt.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/malta/gt.c Tue Oct 29 14:07:31 2013 (r257338) @@ -51,7 +51,7 @@ static int gt_probe(device_t dev) { device_set_desc(dev, "GT64120 chip"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/mips/tick.c Tue Oct 29 14:07:31 2013 (r257338) @@ -313,7 +313,7 @@ clock_probe(device_t dev) panic("can't attach more clocks"); device_set_desc(dev, "Generic MIPS32 ticker"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/mips/nlm/tick.c ============================================================================== --- head/sys/mips/nlm/tick.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/nlm/tick.c Tue Oct 29 14:07:31 2013 (r257338) @@ -318,7 +318,7 @@ clock_probe(device_t dev) panic("can't attach more clocks"); device_set_desc(dev, "Generic MIPS32 ticker"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/nlm/xlp_pci.c Tue Oct 29 14:07:31 2013 (r257338) @@ -383,8 +383,7 @@ xlp_pcib_probe(device_t dev) { device_set_desc(dev, "XLP PCI bus"); - xlp_pcib_init_resources(); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int @@ -524,6 +523,8 @@ xlp_pcib_attach(device_t dev) { int node, link; + xlp_pcib_init_resources(); + /* enable hardware swap on all nodes/links */ for (node = 0; node < XLP_MAX_NODES; node++) for (link = 0; link < 4; link++) Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/rmi/iodi.c Tue Oct 29 14:07:31 2013 (r257338) @@ -190,7 +190,7 @@ static void iodi_identify(driver_t *, de int iodi_probe(device_t dev) { - return 0; + return (BUS_PROBE_NOWILDCARD); } void Modified: head/sys/mips/rmi/tick.c ============================================================================== --- head/sys/mips/rmi/tick.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/rmi/tick.c Tue Oct 29 14:07:31 2013 (r257338) @@ -315,7 +315,7 @@ clock_probe(device_t dev) panic("can't attach more clocks"); device_set_desc(dev, "Generic MIPS32 ticker"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/mips/rt305x/obio.c ============================================================================== --- head/sys/mips/rt305x/obio.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/rt305x/obio.c Tue Oct 29 14:07:31 2013 (r257338) @@ -148,7 +148,7 @@ static int obio_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/mips/sibyte/sb_zbbus.c ============================================================================== --- head/sys/mips/sibyte/sb_zbbus.c Tue Oct 29 13:52:05 2013 (r257337) +++ head/sys/mips/sibyte/sb_zbbus.c Tue Oct 29 14:07:31 2013 (r257338) @@ -207,7 +207,7 @@ zbbus_probe(device_t dev) { device_set_desc(dev, "Broadcom/Sibyte ZBbus"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:07:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ABD064AC; Tue, 29 Oct 2013 14:07:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9902E293D; Tue, 29 Oct 2013 14:07:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TE7gDK089587; Tue, 29 Oct 2013 14:07:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TE7gdb089586; Tue, 29 Oct 2013 14:07:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310291407.r9TE7gdb089586@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 Oct 2013 14:07:42 +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: r257339 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:07:42 -0000 Author: trasz Date: Tue Oct 29 14:07:42 2013 New Revision: 257339 URL: http://svnweb.freebsd.org/changeset/base/257339 Log: MFC r257061: Don't spin with mutex hold when there is not enough room in the send socket buffer. While here, make the code flow somewhat nicer. Thanks to mav@ for tracking it down. Approved by: re (glebius) Modified: stable/10/sys/dev/iscsi/icl.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/iscsi/icl.c ============================================================================== --- stable/10/sys/dev/iscsi/icl.c Tue Oct 29 14:07:31 2013 (r257338) +++ stable/10/sys/dev/iscsi/icl.c Tue Oct 29 14:07:42 2013 (r257339) @@ -723,11 +723,7 @@ icl_receive_thread(void *arg) for (;;) { if (ic->ic_disconnecting) { //ICL_DEBUG("terminating"); - ICL_CONN_LOCK(ic); - ic->ic_receive_running = false; - ICL_CONN_UNLOCK(ic); - kthread_exit(); - return; + break; } SOCKBUF_LOCK(&so->so_rcv); @@ -740,6 +736,11 @@ icl_receive_thread(void *arg) icl_conn_receive_pdus(ic, available); } + + ICL_CONN_LOCK(ic); + ic->ic_receive_running = false; + ICL_CONN_UNLOCK(ic); + kthread_exit(); } static int @@ -879,22 +880,19 @@ icl_send_thread(void *arg) ICL_CONN_LOCK(ic); ic->ic_send_running = true; - ICL_CONN_UNLOCK(ic); for (;;) { - ICL_CONN_LOCK(ic); if (ic->ic_disconnecting) { //ICL_DEBUG("terminating"); - ic->ic_send_running = false; - ICL_CONN_UNLOCK(ic); - kthread_exit(); - return; + break; } - if (TAILQ_EMPTY(&ic->ic_to_send)) - cv_wait(&ic->ic_send_cv, &ic->ic_lock); icl_conn_send_pdus(ic); - ICL_CONN_UNLOCK(ic); + cv_wait(&ic->ic_send_cv, &ic->ic_lock); } + + ic->ic_send_running = false; + ICL_CONN_UNLOCK(ic); + kthread_exit(); } static int From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:15:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 321408DA; Tue, 29 Oct 2013 14:15:10 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA7929BB; Tue, 29 Oct 2013 14:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TEF9GU092847; Tue, 29 Oct 2013 14:15:09 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TEF9wk092846; Tue, 29 Oct 2013 14:15:09 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310291415.r9TEF9wk092846@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 29 Oct 2013 14:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257340 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:15:10 -0000 Author: pluknet Date: Tue Oct 29 14:15:09 2013 New Revision: 257340 URL: http://svnweb.freebsd.org/changeset/base/257340 Log: Fixed typo. Submitted by: Nikolai Lifanov Pointyhat: pluknet Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 29 14:07:42 2013 (r257339) +++ head/share/misc/bsd-family-tree Tue Oct 29 14:15:09 2013 (r257340) @@ -283,7 +283,7 @@ FreeBSD 5.2 | | | | | | | | | | FreeBSD | | NetBSD 6.1.2 | | | 9.2 Mac OS X | | | - | 10.0 | | | + | 10.9 | | | | | | | | | | | | | | | | | | From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:19:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ACE46B48; Tue, 29 Oct 2013 14:19:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B48E29F0; Tue, 29 Oct 2013 14:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TEJiDB093467; Tue, 29 Oct 2013 14:19:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TEJgxo093458; Tue, 29 Oct 2013 14:19:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291419.r9TEJgxo093458@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 14:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257341 - in head/sys/dev: acpica cfe gxemul/disk gxemul/ether hyperv/vmbus rt xen/console xen/pcifront xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:19:44 -0000 Author: nwhitehorn Date: Tue Oct 29 14:19:42 2013 New Revision: 257341 URL: http://svnweb.freebsd.org/changeset/base/257341 Log: More BUS_PROBE_NOWILDCARD sweeping. Some devices here (if_ath_ahb and siba) resist easy conversion since they implement a great deal of their attach logic inside probe(). Some of this could be fixed by moving it to attach(), but some requires something more subtle than BUS_PROBE_NOWILDCARD. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/cfe/cfe_resource.c head/sys/dev/gxemul/disk/gxemul_disk.c head/sys/dev/gxemul/ether/if_gx.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/rt/if_rt.c head/sys/dev/xen/console/console.c head/sys/dev/xen/pcifront/pcifront.c head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/acpica/acpi.c Tue Oct 29 14:19:42 2013 (r257341) @@ -431,7 +431,7 @@ acpi_probe(device_t dev) device_set_desc(dev, acpi_desc); - return_VALUE (0); + return_VALUE (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/cfe/cfe_resource.c ============================================================================== --- head/sys/dev/cfe/cfe_resource.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/cfe/cfe_resource.c Tue Oct 29 14:19:42 2013 (r257341) @@ -61,7 +61,7 @@ static int cferes_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/gxemul/disk/gxemul_disk.c ============================================================================== --- head/sys/dev/gxemul/disk/gxemul_disk.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/gxemul/disk/gxemul_disk.c Tue Oct 29 14:19:42 2013 (r257341) @@ -158,7 +158,7 @@ gxemul_disk_probe(device_t dev) { device_set_desc(dev, "GXemul test disk"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/dev/gxemul/ether/if_gx.c ============================================================================== --- head/sys/dev/gxemul/ether/if_gx.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/gxemul/ether/if_gx.c Tue Oct 29 14:19:42 2013 (r257341) @@ -125,7 +125,7 @@ gx_probe(device_t dev) device_set_desc(dev, "GXemul test Ethernet"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Oct 29 14:19:42 2013 (r257341) @@ -313,7 +313,7 @@ vmbus_probe(device_t dev) { device_set_desc(dev, "Vmbus Devices"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /** Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/rt/if_rt.c Tue Oct 29 14:19:42 2013 (r257341) @@ -149,7 +149,7 @@ static int rt_probe(device_t dev) { device_set_desc(dev, "Ralink RT305XF onChip Ethernet MAC"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /* Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/xen/console/console.c Tue Oct 29 14:19:42 2013 (r257341) @@ -226,7 +226,7 @@ static int xc_probe(device_t dev) { - return (0); + return (BUS_PROBE_NOWILDCARD); } static int Modified: head/sys/dev/xen/pcifront/pcifront.c ============================================================================== --- head/sys/dev/xen/pcifront/pcifront.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/xen/pcifront/pcifront.c Tue Oct 29 14:19:42 2013 (r257341) @@ -441,7 +441,7 @@ xpcife_probe(device_t dev) struct pcifront_device *pdev = (struct pcifront_device *)device_get_ivars(dev); DPRINTF("xpcife probe (unit=%d)\n", pdev->unit); #endif - return 0; + return (BUS_PROBE_NOWILDCARD); } /* Newbus xpcife device driver attach */ Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Tue Oct 29 14:15:09 2013 (r257340) +++ head/sys/dev/xen/timer/timer.c Tue Oct 29 14:19:42 2013 (r257341) @@ -142,7 +142,7 @@ xentimer_probe(device_t dev) "VCPUOPs interface unavailable\n"); #undef XTREQUIRES device_set_desc(dev, "Xen PV Clock"); - return (0); + return (BUS_PROBE_NOWILDCARD); } /* From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:32:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 789B0687; Tue, 29 Oct 2013 14:32:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6610A2B0B; Tue, 29 Oct 2013 14:32:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TEWYBO099797; Tue, 29 Oct 2013 14:32:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TEWX02099793; Tue, 29 Oct 2013 14:32:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291432.r9TEWX02099793@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 14:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257342 - in head/sys/arm: econa s3c2xx0 sa11x0 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:32:34 -0000 Author: nwhitehorn Date: Tue Oct 29 14:32:33 2013 New Revision: 257342 URL: http://svnweb.freebsd.org/changeset/base/257342 Log: A few last BUS_PROBE_NOWILDCARDs are in order. Modified: head/sys/arm/econa/econa.c head/sys/arm/s3c2xx0/s3c24x0.c head/sys/arm/sa11x0/sa11x0.c Modified: head/sys/arm/econa/econa.c ============================================================================== --- head/sys/arm/econa/econa.c Tue Oct 29 14:19:42 2013 (r257341) +++ head/sys/arm/econa/econa.c Tue Oct 29 14:32:33 2013 (r257342) @@ -172,7 +172,7 @@ econa_probe(device_t dev) { device_set_desc(dev, "ECONA device bus"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void Modified: head/sys/arm/s3c2xx0/s3c24x0.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0.c Tue Oct 29 14:19:42 2013 (r257341) +++ head/sys/arm/s3c2xx0/s3c24x0.c Tue Oct 29 14:32:33 2013 (r257342) @@ -429,7 +429,7 @@ s3c24x0_identify(driver_t *driver, devic int s3c24x0_probe(device_t dev) { - return 0; + return (BUS_PROBE_NOWILDCARD); } int Modified: head/sys/arm/sa11x0/sa11x0.c ============================================================================== --- head/sys/arm/sa11x0/sa11x0.c Tue Oct 29 14:19:42 2013 (r257341) +++ head/sys/arm/sa11x0/sa11x0.c Tue Oct 29 14:32:33 2013 (r257342) @@ -139,7 +139,7 @@ extern vm_offset_t saipic_base; int sa11x0_probe(device_t dev) { - return 0; + return (BUS_PROBE_NOWILDCARD); } void From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:44:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8F408B7F; Tue, 29 Oct 2013 14:44:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C58D2BBF; Tue, 29 Oct 2013 14:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TEibBM003492; Tue, 29 Oct 2013 14:44:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TEibs0003491; Tue, 29 Oct 2013 14:44:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291444.r9TEibs0003491@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 14:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257343 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:44:37 -0000 Author: nwhitehorn Date: Tue Oct 29 14:44:36 2013 New Revision: 257343 URL: http://svnweb.freebsd.org/changeset/base/257343 Log: A last BUS_PROBE_NOWILDCARD. Move setting the postfilter function into the attach function probe shouldn't actually set anything up but just bid on the device. Modified: head/sys/arm/at91/at91.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Oct 29 14:32:33 2013 (r257342) +++ head/sys/arm/at91/at91.c Tue Oct 29 14:44:36 2013 (r257343) @@ -231,8 +231,7 @@ at91_probe(device_t dev) { device_set_desc(dev, "AT91 device bus"); - arm_post_filter = at91_eoi; - return (0); + return (BUS_PROBE_NO_WILDCARD); } static void @@ -261,6 +260,8 @@ at91_attach(device_t dev) const struct pmap_devmap *pdevmap; int i; + arm_post_filter = at91_eoi; + at91_softc = sc; sc->sc_st = &at91_bs_tag; sc->sc_sh = AT91_BASE; From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 14:45:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 230A8DAA; Tue, 29 Oct 2013 14:45:17 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mail.egr.msu.edu (hill.egr.msu.edu [35.9.37.162]) by mx1.freebsd.org (Postfix) with ESMTP id E81DA2BD1; Tue, 29 Oct 2013 14:45:16 +0000 (UTC) Received: from hill (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id A8CDD2DA57; Tue, 29 Oct 2013 10:35:53 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by hill (hill.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CYXjthznXqce; Tue, 29 Oct 2013 10:35:53 -0400 (EDT) Received: from daemon.localdomain (daemon.egr.msu.edu [35.9.44.65]) by mail.egr.msu.edu (Postfix) with ESMTP id 83F1D2DA50; Tue, 29 Oct 2013 10:35:53 -0400 (EDT) Received: by daemon.localdomain (Postfix, from userid 21281) id 7F4A5290B81; Tue, 29 Oct 2013 10:35:53 -0400 (EDT) Date: Tue, 29 Oct 2013 10:35:53 -0400 From: Adam McDougall To: jlh@FreeBSD.org Subject: Re: svn commit: r254974 - in head: etc/defaults etc/periodic/monthly etc/periodic/security etc/periodic/weekly share/man/man5 Message-ID: <20131029143553.GO1807@egr.msu.edu> References: <201308272120.r7RLKTvk066897@svn.freebsd.org> <20131021000110.GJ2097@egr.msu.edu> <20131028211700.GB37879@caravan.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131028211700.GB37879@caravan.chchile.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 14:45:17 -0000 On Mon, Oct 28, 2013 at 10:17:00PM +0100, Jeremie Le Hen wrote: Hi Adam, On Sun, Oct 20, 2013 at 08:01:10PM -0400, Adam McDougall wrote: > Thanks for working on this, I look forward to taking advantage of it! > > I have a system with some old style adjustments in periodic.conf but > the compat shim doesn't seem to be working (it is running r255793). > I filed PR conf/183137 with more details. Sorry for the late reply, I was abroad. Can you test the following patch please? Index: etc/defaults/periodic.conf =================================================================== --- etc/defaults/periodic.conf (revision 255169) +++ etc/defaults/periodic.conf (working copy) @@ -319,7 +319,7 @@ security_daily_compat_var() { local var=$1 dailyvar value - dailyvar=daily_status_security${#status_security} + dailyvar=daily_status_security${var#status_security} periodvar=${var%enable}period eval value=\"\$$dailyvar\" [ -z "$value" ] && return -- Jeremie Le Hen Sorry, that didn't work (on r255793). Hand applied by adding the 'var', was that the only change? Thanks. From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 15:07:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A36A500; Tue, 29 Oct 2013 15:07:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 651A32D34; Tue, 29 Oct 2013 15:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TF7uSl010845; Tue, 29 Oct 2013 15:07:56 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TF7s06010835; Tue, 29 Oct 2013 15:07:54 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291507.r9TF7s06010835@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 15:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257344 - in head: etc etc/keys etc/mtree etc/pkg share share/keys share/keys/pkg/trusted share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 15:07:56 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 15:07:54 2013 New Revision: 257344 URL: http://svnweb.freebsd.org/changeset/base/257344 Log: Move /etc/keys to /usr/share/keys where users are less likely to modify them. Requested by: secteam (cperciva, des) Approved by: bapt Added: head/share/keys/ - copied from r257343, head/etc/keys/ Deleted: head/etc/keys/ Modified: head/etc/Makefile head/etc/mtree/BSD.root.dist head/etc/mtree/BSD.usr.dist head/etc/pkg/FreeBSD.conf head/share/Makefile head/share/keys/pkg/trusted/Makefile head/share/man/man7/hier.7 Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Oct 29 14:44:36 2013 (r257343) +++ head/etc/Makefile Tue Oct 29 15:07:54 2013 (r257344) @@ -224,7 +224,6 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install - ${_+_}cd ${.CURDIR}/keys; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install .if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Tue Oct 29 14:44:36 2013 (r257343) +++ head/etc/mtree/BSD.root.dist Tue Oct 29 15:07:54 2013 (r257344) @@ -34,14 +34,6 @@ .. gss .. - keys - pkg - revoked - .. - trusted - .. - .. - .. mail .. mtree Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Oct 29 14:44:36 2013 (r257343) +++ head/etc/mtree/BSD.usr.dist Tue Oct 29 15:07:54 2013 (r257344) @@ -478,6 +478,14 @@ .. info .. + keys + pkg + revoked + .. + trusted + .. + .. + .. locale UTF-8 .. Modified: head/etc/pkg/FreeBSD.conf ============================================================================== --- head/etc/pkg/FreeBSD.conf Tue Oct 29 14:44:36 2013 (r257343) +++ head/etc/pkg/FreeBSD.conf Tue Oct 29 15:07:54 2013 (r257344) @@ -3,6 +3,6 @@ FreeBSD: { url: "pkg+http://pkg.freebsd.org/${ABI}/latest", mirror_type: "srv", signature_type: "none", - fingerprints: "/etc/keys/pkg", + fingerprints: "/usr/share/keys/pkg", enabled: "yes" } Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Tue Oct 29 14:44:36 2013 (r257343) +++ head/share/Makefile Tue Oct 29 15:07:54 2013 (r257344) @@ -11,6 +11,7 @@ SUBDIR= ${_colldef} \ dtrace \ ${_examples} \ ${_i18n} \ + keys \ ${_man} \ ${_me} \ misc \ Modified: head/share/keys/pkg/trusted/Makefile ============================================================================== --- head/etc/keys/pkg/trusted/Makefile Tue Oct 29 14:44:36 2013 (r257343) +++ head/share/keys/pkg/trusted/Makefile Tue Oct 29 15:07:54 2013 (r257344) @@ -4,7 +4,7 @@ NO_OBJ= FILES= pkg.freebsd.org.2013102301 -FILESDIR= /etc/keys/pkg/trusted +FILESDIR= /usr/share/keys/pkg/trusted FILESMODE= 644 .include Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Tue Oct 29 14:44:36 2013 (r257343) +++ head/share/man/man7/hier.7 Tue Oct 29 15:07:54 2013 (r257344) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 23, 2013 +.Dd October 29, 2013 .Dt HIER 7 .Os .Sh NAME @@ -94,15 +94,6 @@ bluetooth configuration files gnats configuration files; see .Xr send-pr 1 -.It Pa keys/ -known trusted and revoked keys. -.Pp -.Bl -tag -width ".Pa keys/pkg/" -compact -.It Pa keys/pkg/ -fingerprints for -.Xr pkg 8 -.El -.Pp .It Pa localtime local timezone information; see @@ -556,6 +547,16 @@ ASCII text files used by various games device description file for device name .It Pa info/ GNU Info hypertext system +.It Pa keys/ +known trusted and revoked keys. +.Bl -tag -width ".Pa keys/pkg/" -compact +.It Pa keys/pkg/ +fingerprints for +.Xr pkg 7 +and +.Xr pkg 8 +.El +.Pp .It Pa locale/ localization files; see From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 15:29:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B3F8DFFB; Tue, 29 Oct 2013 15:29:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2302EAA; Tue, 29 Oct 2013 15:29:22 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id k4so112448qaq.7 for ; Tue, 29 Oct 2013 08:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7rBP0pH97g/TqPN4Ro+9t5fSoVjPInMZO5ip+tDPmBw=; b=jIx8En9Fui0/ZlLLe4OQB03ZQ4sT8mtQanQbfX/lTOL6NWAA/JvLLluM6Y42Izhoi7 cqe4xZKW160B8T2JIMHA7bwDXZq4EQ6JqBhWnP1TzGdbwTQqS0qJIpc9oTPbIlHUNenx 7bHW4rG8efjY1tECQq7D4Bq0rJHMVB/FYPLACvMA5rKC13MKKJqcjAJo83gCdSYTpZQ1 nJwdCDZkX6xiZHaaOR4wqbxqoDzYkGCZX+jgDJR4/zaTqhdWf7uRcZjhEKDWzzwu+3KG hNdVf6J4/4IZVkJIDF9k3Qtld1vFANOwy7yXHhJc4fnqHckjErTtp7AbpO6Q20GtJfY7 KxlA== X-Received: by 10.224.87.198 with SMTP id x6mr1404333qal.61.1383060560536; Tue, 29 Oct 2013 08:29:20 -0700 (PDT) Received: from charmander.sandvine.com ([64.7.137.182]) by mx.google.com with ESMTPSA id b10sm55056387qeg.7.2013.10.29.08.29.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Oct 2013 08:29:19 -0700 (PDT) Sender: Mark Johnston Date: Tue, 29 Oct 2013 11:29:05 -0400 From: Mark Johnston To: Bruce Evans Subject: Re: svn commit: r257298 - head/lib/libproc Message-ID: <20131029152905.GA2652@charmander.sandvine.com> References: <201310290312.r9T3CVx4064237@svn.freebsd.org> <20131029235717.M905@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131029235717.M905@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 15:29:22 -0000 On Wed, Oct 30, 2013 at 12:21:28AM +1100, Bruce Evans wrote: > On Tue, 29 Oct 2013, Mark Johnston wrote: > > > Log: > > Revert r257248 and fix the problem in a way that doesn't violate style(9). > > Why did gcc complain about the original version? It looks like this is because of the use of -W, which is apparently an alias for -Wextra; according to the gcc man page, this will trigger a warning when "an empty body occurs in an if or else statement." > > > Modified: head/lib/libproc/_libproc.h > > ============================================================================== > > --- head/lib/libproc/_libproc.h Tue Oct 29 02:25:18 2013 (r257297) > > +++ head/lib/libproc/_libproc.h Tue Oct 29 03:12:31 2013 (r257298) > > @@ -52,6 +52,6 @@ struct proc_handle { > > #define DPRINTF(...) warn(__VA_ARGS__) > > #define DPRINTFX(...) warnx(__VA_ARGS__) > > #else > > -#define DPRINTF(...) > > -#define DPRINTFX(...) > > +#define DPRINTF(...) do { } while (0) > > +#define DPRINTFX(...) do { } while (0) > > #endif > > > > Modified: head/lib/libproc/proc_util.c > > ============================================================================== > > --- head/lib/libproc/proc_util.c Tue Oct 29 02:25:18 2013 (r257297) > > +++ head/lib/libproc/proc_util.c Tue Oct 29 03:12:31 2013 (r257298) > > @@ -145,9 +145,8 @@ proc_wstatus(struct proc_handle *phdl) > > if (phdl == NULL) > > return (-1); > > if (waitpid(phdl->pid, &status, WUNTRACED) < 0) { > > - if (errno != EINTR) { > > + if (errno != EINTR) > > DPRINTF("waitpid"); > > - } > > return (-1); > > } > > if (WIFSTOPPED(status)) > > Unlike some buggy macros, the null macro expanded to syntactically correct > code: > > if (errno != EINTR) > ; > > so it doesn't need the do-while hack. Empty statements are common in some > contexts, so compilers shouldn't warn about them. In all versions, the > macro isn't completely function-like and the if statement is dead code, > so if compilers warn about too many things then the do-while hack wouldn't > work here or in most places that it is used. > > Nearby style bugs: > - the error check is for "< 0" instead of for "== -1" > - the error message is not as loud as old ones. All old ones begin with > "ERROR: ". The new style is better. "ERROR" is not even redundant. > It is wrong, since the errors are just warnings. > > Bruce From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 15:36:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1C0DF4D5 for ; Tue, 29 Oct 2013 15:36:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E70CB2F5D for ; Tue, 29 Oct 2013 15:36:44 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TFaid4081731 for ; Tue, 29 Oct 2013 15:36:44 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9TFai3K081726 for svn-src-all@freebsd.org; Tue, 29 Oct 2013 15:36:44 GMT (envelope-from bdrewery) Received: (qmail 25906 invoked from network); 29 Oct 2013 10:36:43 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 29 Oct 2013 10:36:43 -0500 Message-ID: <526FD606.3040301@FreeBSD.org> Date: Tue, 29 Oct 2013 10:36:38 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r257344 - in head: etc etc/keys etc/mtree etc/pkg share share/keys share/keys/pkg/trusted share/man/man7 References: <201310291507.r9TF7s06010835@svn.freebsd.org> In-Reply-To: <201310291507.r9TF7s06010835@svn.freebsd.org> X-Enigmail-Version: 1.5.2 OpenPGP: id=3C9B0CF9; url=http://www.shatow.net/bryan/bryan.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ngPFApEJBd3mMSGglbWBxIcqUOR953iNO" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 15:36:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ngPFApEJBd3mMSGglbWBxIcqUOR953iNO Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 10/29/2013 10:07 AM, Bryan Drewery wrote: > Author: bdrewery (ports committer) > Date: Tue Oct 29 15:07:54 2013 > New Revision: 257344 > URL: http://svnweb.freebsd.org/changeset/base/257344 >=20 > Log: > Move /etc/keys to /usr/share/keys where users are less likely to modi= fy them. > =20 > Requested by: secteam (cperciva, des) > Approved by: bapt I plan to MFC after 2 days. >=20 > Added: > head/share/keys/ > - copied from r257343, head/etc/keys/ > Deleted: > head/etc/keys/ > Modified: > head/etc/Makefile > head/etc/mtree/BSD.root.dist > head/etc/mtree/BSD.usr.dist > head/etc/pkg/FreeBSD.conf > head/share/Makefile > head/share/keys/pkg/trusted/Makefile > head/share/man/man7/hier.7 >=20 > Modified: head/etc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/Makefile Tue Oct 29 14:44:36 2013 (r257343) > +++ head/etc/Makefile Tue Oct 29 15:07:54 2013 (r257344) > @@ -224,7 +224,6 @@ distribution: > ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install > ${_+_}cd ${.CURDIR}/devd; ${MAKE} install > ${_+_}cd ${.CURDIR}/gss; ${MAKE} install > - ${_+_}cd ${.CURDIR}/keys; ${MAKE} install > ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install > .if ${MK_PKGBOOTSTRAP} !=3D "no" > ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install >=20 > Modified: head/etc/mtree/BSD.root.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/mtree/BSD.root.dist Tue Oct 29 14:44:36 2013 (r257343) > +++ head/etc/mtree/BSD.root.dist Tue Oct 29 15:07:54 2013 (r257344) > @@ -34,14 +34,6 @@ > .. > gss > .. > - keys > - pkg > - revoked > - .. > - trusted > - .. > - .. > - .. > mail > .. > mtree >=20 > Modified: head/etc/mtree/BSD.usr.dist > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/mtree/BSD.usr.dist Tue Oct 29 14:44:36 2013 (r257343) > +++ head/etc/mtree/BSD.usr.dist Tue Oct 29 15:07:54 2013 (r257344) > @@ -478,6 +478,14 @@ > .. > info > .. > + keys > + pkg > + revoked > + .. > + trusted > + .. > + .. > + .. > locale > UTF-8 > .. >=20 > Modified: head/etc/pkg/FreeBSD.conf > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/etc/pkg/FreeBSD.conf Tue Oct 29 14:44:36 2013 (r257343) > +++ head/etc/pkg/FreeBSD.conf Tue Oct 29 15:07:54 2013 (r257344) > @@ -3,6 +3,6 @@ FreeBSD: { > url: "pkg+http://pkg.freebsd.org/${ABI}/latest", > mirror_type: "srv", > signature_type: "none", > - fingerprints: "/etc/keys/pkg", > + fingerprints: "/usr/share/keys/pkg", > enabled: "yes" > } >=20 > Modified: head/share/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/Makefile Tue Oct 29 14:44:36 2013 (r257343) > +++ head/share/Makefile Tue Oct 29 15:07:54 2013 (r257344) > @@ -11,6 +11,7 @@ SUBDIR=3D ${_colldef} \ > dtrace \ > ${_examples} \ > ${_i18n} \ > + keys \ > ${_man} \ > ${_me} \ > misc \ >=20 > Modified: head/share/keys/pkg/trusted/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/keys/pkg/trusted/Makefile Tue Oct 29 14:44:36 2013 (r25734= 3) > +++ head/share/keys/pkg/trusted/Makefile Tue Oct 29 15:07:54 2013 (r257= 344) > @@ -4,7 +4,7 @@ NO_OBJ=3D > =20 > FILES=3D pkg.freebsd.org.2013102301 > =20 > -FILESDIR=3D /etc/keys/pkg/trusted > +FILESDIR=3D /usr/share/keys/pkg/trusted > FILESMODE=3D 644 > =20 > .include >=20 > Modified: head/share/man/man7/hier.7 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/man/man7/hier.7 Tue Oct 29 14:44:36 2013 (r257343) > +++ head/share/man/man7/hier.7 Tue Oct 29 15:07:54 2013 (r257344) > @@ -32,7 +32,7 @@ > .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 > .\" $FreeBSD$ > .\" > -.Dd October 23, 2013 > +.Dd October 29, 2013 > .Dt HIER 7 > .Os > .Sh NAME > @@ -94,15 +94,6 @@ bluetooth configuration files > gnats configuration files; > see > .Xr send-pr 1 > -.It Pa keys/ > -known trusted and revoked keys. > -.Pp > -.Bl -tag -width ".Pa keys/pkg/" -compact > -.It Pa keys/pkg/ > -fingerprints for > -.Xr pkg 8 > -.El > -.Pp > .It Pa localtime > local timezone information; > see > @@ -556,6 +547,16 @@ ASCII text files used by various games > device description file for device name > .It Pa info/ > GNU Info hypertext system > +.It Pa keys/ > +known trusted and revoked keys. > +.Bl -tag -width ".Pa keys/pkg/" -compact > +.It Pa keys/pkg/ > +fingerprints for > +.Xr pkg 7 > +and > +.Xr pkg 8 > +.El > +.Pp > .It Pa locale/ > localization files; > see > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >=20 --=20 Regards, Bryan Drewery --ngPFApEJBd3mMSGglbWBxIcqUOR953iNO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSb9YGAAoJEG54KsA8mwz5BnAQAJF+kP+r0ySy2ZrDXoJU3Kx7 T0fWkxYHn2W+EVSjHuFhPMxPzn3nElLdlogcC76HuaTI1WBDz7gKNo6oHLkiYP31 aG71MU+csBmD5DwIf4qa1iZcXDXjbp5UZmbifwcg5gzqHAhUHbCQp2VUOWdhhhZF /4gskLSlbVnesGPR5NAfSuHSeK77p3sN98hWX49ctbXGNTrv2R24dJsmXQnbMMT3 dtVTN0SiJqdxh/fWces0U6WOPW84YeWZFuyzmmCTOPFIOjn1VXJE8FSX9Mh6Jx0j DWPUPu6oDxjXXWIoI9wK+XBU9AArlzVMEQhYqocMX/oOjWGAVUrowRhn1+CMSeY2 qYrit/KOHtLbOADxlQCsqIJFE+oWl8fABzo+hTVA8x4eu7Kf8KCcZGgMiQVB1vGn Wj/3gIELRAg71BvHEuYO6M1bl5eZ5IWDxKr0I09ydgpg3JRLq9bmKf61GErz7RaG EeVwfbAD0zqyEcIq1VvRdE1wbtb0vYj+Su0qEOWVzvARVTSUyA8eqVYXIHPhWfSc XYxUsjLvGdFQI9QONfo1kodyo/qIbYwh5D5NUzDitDkQjdQKQcp19G4zLZqINQNX 47/jrp1RDbLnUEQ8yzamN0nl20qviIKfogbfh1QWnAVQK6lXQXuUvoVW0Un92tu0 5dQgcIdr347VcziAV38g =cvbC -----END PGP SIGNATURE----- --ngPFApEJBd3mMSGglbWBxIcqUOR953iNO-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 15:36:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F42D60A; Tue, 29 Oct 2013 15:36:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FAAC2F5F; Tue, 29 Oct 2013 15:36:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TFawig021058; Tue, 29 Oct 2013 15:36:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TFaw8A021055; Tue, 29 Oct 2013 15:36:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310291536.r9TFaw8A021055@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 15:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257345 - in head/sys: cam cam/scsi powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 15:36:59 -0000 Author: nwhitehorn Date: Tue Oct 29 15:36:58 2013 New Revision: 257345 URL: http://svnweb.freebsd.org/changeset/base/257345 Log: Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode the upper 32-bits of the LUN, if possible, into the target_lun field as passed directly from the REPORT LUNs response. This allows extended LUN support to work for all LUNs with zeros in the lower 32-bits, which covers most addressing modes without breaking KBI. Behavior for drivers not setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified. Extended LUNs are stored with swizzled 16-bit word order so that, for devices implementing LUN addressing (like SCSI-2), the numerical representation of the LUN is identical with and without PIM_EXTLUNS. Thus setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged. This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE) is provided to transform a lun_id_t into a uint64_t ordered for the wire. This is the second part of work for full 64-bit extended LUN support and is designed to a bridge for stable/10 to the final 64-bit LUN code. The third and final part will involve widening lun_id_t to 64 bits and will not be MFCed. This third part will break the KBI but will keep the KPI unchanged so that all drivers that will care about this can be updated now and not require code changes between HEAD and stable/10. Reviewed by: scottl MFC after: 2 weeks Modified: head/sys/cam/cam.h head/sys/cam/scsi/scsi_xpt.c head/sys/powerpc/pseries/phyp_vscsi.c Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Tue Oct 29 15:07:54 2013 (r257344) +++ head/sys/cam/cam.h Tue Oct 29 15:36:58 2013 (r257345) @@ -50,6 +50,12 @@ typedef union { #define CAM_TARGET_WILDCARD ((target_id_t)~0) #define CAM_LUN_WILDCARD ((lun_id_t)~0) +#define CAM_EXTLUN_BYTE_SWIZZLE(lun) ( \ + ((((u_int64_t)lun) & 0xffff000000000000L) >> 48) | \ + ((((u_int64_t)lun) & 0x0000ffff00000000L) >> 16) | \ + ((((u_int64_t)lun) & 0x00000000ffff0000L) << 16) | \ + ((((u_int64_t)lun) & 0x000000000000ffffL) << 48)) + /* * Maximum length for a CAM CDB. */ Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Oct 29 15:07:54 2013 (r257344) +++ head/sys/cam/scsi/scsi_xpt.c Tue Oct 29 15:36:58 2013 (r257345) @@ -100,6 +100,12 @@ SYSCTL_PROC(_kern_cam, OID_AUTO, cam_src (lval) <<= 8; \ (lval) |= (lp)->luns[(i)].lundata[1]; \ } +#define CAM_GET_LUN(lp, i, lval) \ + (lval) = scsi_4btoul((lp)->luns[(i)].lundata); \ + (lval) = ((lval) >> 16) | ((lval) << 16); +#define CAM_LUN_ONLY_32BITS(lp, i) \ + (scsi_4btoul(&((lp)->luns[(i)].lundata[4])) == 0) + /* * If we're not quirked to search <= the first 8 luns * and we are either quirked to search above lun 8, @@ -175,7 +181,8 @@ do { \ typedef enum { PROBE_INQUIRY_CKSUM = 0x01, PROBE_SERIAL_CKSUM = 0x02, - PROBE_NO_ANNOUNCE = 0x04 + PROBE_NO_ANNOUNCE = 0x04, + PROBE_EXTLUN = 0x08 } probe_flags; typedef struct { @@ -561,10 +568,9 @@ static void proberequestdefaultnegotiat static int proberequestbackoff(struct cam_periph *periph, struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); -static int probe_strange_rpl_data(struct scsi_report_luns_data *rp, - uint32_t maxlun); static void probe_purge_old(struct cam_path *path, - struct scsi_report_luns_data *new); + struct scsi_report_luns_data *new, + probe_flags flags); static void probecleanup(struct cam_periph *periph); static void scsi_find_quirk(struct cam_ed *device); static void scsi_scan_bus(struct cam_periph *periph, union ccb *ccb); @@ -700,6 +706,11 @@ probeschedule(struct cam_periph *periph) else softc->flags &= ~PROBE_NO_ANNOUNCE; + if (cpi.hba_misc & PIM_EXTLUNS) + softc->flags |= PROBE_EXTLUN; + else + softc->flags &= ~PROBE_EXTLUN; + xpt_schedule(periph, CAM_PRIORITY_XPT); } @@ -1278,13 +1289,6 @@ out: */ free(lp, M_CAMXPT); lp = NULL; - } else if (probe_strange_rpl_data(lp, maxlun)) { - /* - * If we can't understand the lun format - * of any entry, bail. - */ - free(lp, M_CAMXPT); - lp = NULL; } else { lun_id_t lun; int idx; @@ -1292,14 +1296,14 @@ out: CAM_DEBUG(path, CAM_DEBUG_PROBE, ("Probe: %u lun(s) reported\n", nlun)); - CAM_GET_SIMPLE_LUN(lp, 0, lun); + CAM_GET_LUN(lp, 0, lun); /* * If the first lun is not lun 0, then either there * is no lun 0 in the list, or the list is unsorted. */ if (lun != 0) { for (idx = 0; idx < nlun; idx++) { - CAM_GET_SIMPLE_LUN(lp, idx, lun); + CAM_GET_LUN(lp, idx, lun); if (lun == 0) { break; } @@ -1331,7 +1335,7 @@ out: * This function will also install the new list * in the target structure. */ - probe_purge_old(path, lp); + probe_purge_old(path, lp, softc->flags); lp = NULL; } if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { @@ -1703,26 +1707,14 @@ probe_device_check: } } -static int -probe_strange_rpl_data(struct scsi_report_luns_data *rp, uint32_t maxlun) -{ - uint32_t idx; - uint32_t nlun = MIN(maxlun, (scsi_4btoul(rp->length) / 8)); - - for (idx = 0; idx < nlun; idx++) { - if (!CAM_CAN_GET_SIMPLE_LUN(rp, idx)) { - return (-1); - } - } - return (0); -} - static void -probe_purge_old(struct cam_path *path, struct scsi_report_luns_data *new) +probe_purge_old(struct cam_path *path, struct scsi_report_luns_data *new, + probe_flags flags) { struct cam_path *tp; struct scsi_report_luns_data *old; - u_int idx1, idx2, nlun_old, nlun_new, this_lun; + u_int idx1, idx2, nlun_old, nlun_new; + lun_id_t this_lun; u_int8_t *ol, *nl; if (path->target == NULL) { @@ -1757,17 +1749,26 @@ probe_purge_old(struct cam_path *path, s * that would be what the probe state * machine is currently working on, * so we won't do that. - * - * We also cannot nuke it if it is - * not in a lun format we understand. */ - if (!CAM_CAN_GET_SIMPLE_LUN(old, idx1)) { - continue; - } - CAM_GET_SIMPLE_LUN(old, idx1, this_lun); + CAM_GET_LUN(old, idx1, this_lun); if (this_lun == 0) { continue; } + + /* + * We also cannot nuke it if it is + * not in a lun format we understand + * and replace the LUN with a "simple" LUN + * if that is all the HBA supports. + */ + if (!(flags & PROBE_EXTLUN)) { + if (!CAM_CAN_GET_SIMPLE_LUN(old, idx1)) + continue; + CAM_GET_SIMPLE_LUN(old, idx1, this_lun); + } + if (!CAM_LUN_ONLY_32BITS(old, idx1)) + continue; + if (xpt_create_path(&tp, NULL, xpt_path_path_id(path), xpt_path_target_id(path), this_lun) == CAM_REQ_CMP) { xpt_async(AC_LOST_DEVICE, tp, NULL); @@ -2013,7 +2014,7 @@ scsi_scan_bus(struct cam_periph *periph, mtx_lock(mtx); mtx_lock(&target->luns_mtx); if (target->luns) { - uint32_t first; + lun_id_t first; u_int nluns = scsi_4btoul(target->luns->length) / 8; /* @@ -2021,20 +2022,45 @@ scsi_scan_bus(struct cam_periph *periph, * of the list as we've actually just finished probing * it. */ - CAM_GET_SIMPLE_LUN(target->luns, 0, first); + CAM_GET_LUN(target->luns, 0, first); if (first == 0 && scan_info->lunindex[target_id] == 0) { scan_info->lunindex[target_id]++; } + /* + * Skip any LUNs that the HBA can't deal with. + */ + while (scan_info->lunindex[target_id] < nluns) { + if (scan_info->cpi->hba_misc & PIM_EXTLUNS) { + CAM_GET_LUN(target->luns, + scan_info->lunindex[target_id], + lun_id); + break; + } + + /* XXX print warning? */ + if (!CAM_LUN_ONLY_32BITS(target->luns, + scan_info->lunindex[target_id])) + continue; + if (CAM_CAN_GET_SIMPLE_LUN(target->luns, + scan_info->lunindex[target_id])) { + CAM_GET_SIMPLE_LUN(target->luns, + scan_info->lunindex[target_id], + lun_id); + break; + } + + scan_info->lunindex[target_id]++; + } + if (scan_info->lunindex[target_id] < nluns) { - CAM_GET_SIMPLE_LUN(target->luns, - scan_info->lunindex[target_id], lun_id); mtx_unlock(&target->luns_mtx); next_target = 0; CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("next lun to try at index %u is %u\n", - scan_info->lunindex[target_id], lun_id)); + ("next lun to try at index %u is %jx\n", + scan_info->lunindex[target_id], + (uintmax_t)lun_id)); scan_info->lunindex[target_id]++; } else { mtx_unlock(&target->luns_mtx); Modified: head/sys/powerpc/pseries/phyp_vscsi.c ============================================================================== --- head/sys/powerpc/pseries/phyp_vscsi.c Tue Oct 29 15:07:54 2013 (r257344) +++ head/sys/powerpc/pseries/phyp_vscsi.c Tue Oct 29 15:36:58 2013 (r257345) @@ -548,12 +548,6 @@ vscsi_task_management(struct vscsi_softc TAILQ_REMOVE(&sc->free_xferq, xp, queue); TAILQ_INSERT_TAIL(&sc->active_xferq, xp, queue); - if (!(ccb->ccb_h.xflags & CAM_EXTLUN_VALID)) { - ccb->ccb_h.xflags |= CAM_EXTLUN_VALID; - ccb->ccb_h.ext_lun.lun64 = (0x1UL << 62) | - ((uint64_t)ccb->ccb_h.target_lun << 48); - } - xp->srp_iu_size = crq.iu_length = sizeof(*cmd); err = vmem_alloc(xp->sc->srp_iu_arena, xp->srp_iu_size, M_BESTFIT | M_NOWAIT, &xp->srp_iu_offset); @@ -565,7 +559,7 @@ vscsi_task_management(struct vscsi_softc bzero(cmd, xp->srp_iu_size); cmd->type = SRP_TSK_MGMT; cmd->tag = (uint64_t)xp; - cmd->lun = ccb->ccb_h.ext_lun.lun64; + cmd->lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); switch (ccb->ccb_h.func_code) { case XPT_RESET_DEV: @@ -608,12 +602,6 @@ vscsi_scsi_command(void *xxp, bus_dma_se cdb = (ccb->ccb_h.flags & CAM_CDB_POINTER) ? ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes; - if (!(ccb->ccb_h.xflags & CAM_EXTLUN_VALID)) { - ccb->ccb_h.xflags |= CAM_EXTLUN_VALID; - ccb->ccb_h.ext_lun.lun64 = (0x1UL << 62) | - ((uint64_t)ccb->ccb_h.target_lun << 48); - } - /* Command format from Table 20, page 37 of SRP spec */ crq.iu_length = 48 + ((nsegs > 1) ? 20 : 16) + ((ccb->csio.cdb_len > 16) ? (ccb->csio.cdb_len - 16) : 0); @@ -635,7 +623,7 @@ vscsi_scsi_command(void *xxp, bus_dma_se memcpy(cmd->cdb, cdb, ccb->csio.cdb_len); cmd->tag = (uint64_t)(xp); /* Let the responder find this again */ - cmd->lun = ccb->ccb_h.ext_lun.lun64; + cmd->lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); if (nsegs > 1) { /* Use indirect descriptors */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 15:45:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E51E6B0E; Tue, 29 Oct 2013 15:45:11 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D284B2006; Tue, 29 Oct 2013 15:45:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TFjBZ3024123; Tue, 29 Oct 2013 15:45:11 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TFjB32024122; Tue, 29 Oct 2013 15:45:11 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201310291545.r9TFjB32024122@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 29 Oct 2013 15:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257346 - head/sys/dev/etherswitch/rtl8366 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 15:45:12 -0000 Author: loos Date: Tue Oct 29 15:45:11 2013 New Revision: 257346 URL: http://svnweb.freebsd.org/changeset/base/257346 Log: Fix the build of TP-WN1043ND kernel. Provide necessary includes and remove unnecessary includes for rtl8366rb. Approved by: adrian (mentor) Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c ============================================================================== --- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Oct 29 15:36:58 2013 (r257345) +++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c Tue Oct 29 15:45:11 2013 (r257346) @@ -30,16 +30,18 @@ #include #include #include +#include +#include #include +#include #include #include #include #include #include -#include +#include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 17:31:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 43E05C90; Tue, 29 Oct 2013 17:31:17 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 319D52777; Tue, 29 Oct 2013 17:31:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9THVHOL061479; Tue, 29 Oct 2013 17:31:17 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9THVHU4061478; Tue, 29 Oct 2013 17:31:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310291731.r9THVHU4061478@svn.freebsd.org> From: Neel Natu Date: Tue, 29 Oct 2013 17:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257347 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 17:31:17 -0000 Author: neel Date: Tue Oct 29 17:31:16 2013 New Revision: 257347 URL: http://svnweb.freebsd.org/changeset/base/257347 Log: Update copyright to include the author of the LPC bridge emulation code. Modified: head/usr.sbin/bhyve/pci_lpc.c Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Tue Oct 29 15:45:11 2013 (r257346) +++ head/usr.sbin/bhyve/pci_lpc.c Tue Oct 29 17:31:16 2013 (r257347) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Neel Natu + * Copyright (c) 2013 Tycho Nightingale * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 17:34:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7D2D6DF8; Tue, 29 Oct 2013 17:34:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE0E2799; Tue, 29 Oct 2013 17:34:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9THYGq6061873; Tue, 29 Oct 2013 17:34:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9THYGoF061872; Tue, 29 Oct 2013 17:34:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310291734.r9THYGoF061872@svn.freebsd.org> From: Xin LI Date: Tue, 29 Oct 2013 17:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257348 - head/sbin/newfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 17:34:16 -0000 Author: delphij Date: Tue Oct 29 17:34:15 2013 New Revision: 257348 URL: http://svnweb.freebsd.org/changeset/base/257348 Log: Don't call arc4random_stir() explicitly. To quote arc4random(3) manual page: There is no need to call arc4random_stir() before using arc4random() functions family, since they automatically initialize themselves. No objection: des MFC after: 2 weeks Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Tue Oct 29 17:31:16 2013 (r257347) +++ head/sbin/newfs/mkfs.c Tue Oct 29 17:34:15 2013 (r257348) @@ -134,12 +134,10 @@ mkfs(struct partition *pp, char *fsys) */ disk.d_bsize = sectorsize; disk.d_ufs = Oflag; - if (Rflag) { + if (Rflag) utime = 1000000000; - } else { + else time(&utime); - arc4random_stir(); - } sblock.fs_old_flags = FS_FLAGS_UPDATED; sblock.fs_flags = 0; if (Uflag) From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 17:38:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8FDA71A9; Tue, 29 Oct 2013 17:38:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD3727CB; Tue, 29 Oct 2013 17:38:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9THcFP1062347; Tue, 29 Oct 2013 17:38:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9THcEeu062337; Tue, 29 Oct 2013 17:38:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310291738.r9THcEeu062337@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 Oct 2013 17:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257349 - in head: contrib/tcpdump sbin/ifconfig usr.bin/netstat usr.sbin/tcpdump/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 17:38:15 -0000 Author: glebius Date: Tue Oct 29 17:38:13 2013 New Revision: 257349 URL: http://svnweb.freebsd.org/changeset/base/257349 Log: Make userland tools honor WITHOUT_PF build option. Tested by: dt71@gmx.com Modified: head/contrib/tcpdump/print-ip.c head/sbin/ifconfig/Makefile head/usr.bin/netstat/Makefile head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/contrib/tcpdump/print-ip.c ============================================================================== --- head/contrib/tcpdump/print-ip.c Tue Oct 29 17:34:15 2013 (r257348) +++ head/contrib/tcpdump/print-ip.c Tue Oct 29 17:38:13 2013 (r257349) @@ -483,9 +483,11 @@ again: pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); break; +#if defined(HAVE_NET_PFVAR_H) case IPPROTO_PFSYNC: pfsync_ip_print(ipds->cp, ipds->len); break; +#endif default: if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL) Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Tue Oct 29 17:34:15 2013 (r257348) +++ head/sbin/ifconfig/Makefile Tue Oct 29 17:38:13 2013 (r257349) @@ -40,7 +40,9 @@ LDADD+= -lbsdxml -lsbuf SRCS+= carp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... +.if ${MK_PF} != "no" SRCS+= ifpfsync.c # pfsync(4) support +.endif SRCS+= ifbridge.c # bridge support SRCS+= iflagg.c # lagg support Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Tue Oct 29 17:34:15 2013 (r257348) +++ head/usr.bin/netstat/Makefile Tue Oct 29 17:38:13 2013 (r257349) @@ -26,6 +26,10 @@ CFLAGS+=-DINET6 CFLAGS+=-DSDP .endif +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + BINGRP= kmem BINMODE=2555 DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL} Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Tue Oct 29 17:34:15 2013 (r257348) +++ head/usr.bin/netstat/if.c Tue Oct 29 17:38:13 2013 (r257349) @@ -48,13 +48,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include #include #include +#ifdef PF +#include +#include +#endif #include #include @@ -80,6 +82,7 @@ static void sidewaysintpr(int); static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */ #endif +#ifdef PF static const char* pfsyncacts[] = { /* PFSYNC_ACT_CLR */ "clear all request", /* PFSYNC_ACT_INS */ "state insert", @@ -154,6 +157,7 @@ pfsync_stats(u_long off, const char *nam p(pfsyncs_oerrors, "\t\t%ju send error%s\n"); #undef p } +#endif /* PF */ /* * Display a formatted value, or a '-' in the same space. Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Oct 29 17:34:15 2013 (r257348) +++ head/usr.bin/netstat/main.c Tue Oct 29 17:38:13 2013 (r257349) @@ -214,8 +214,10 @@ struct protox { pim_stats, NULL, "pim", 1, IPPROTO_PIM }, { -1, N_CARPSTAT, 1, NULL, carp_stats, NULL, "carp", 1, 0 }, +#ifdef PF { -1, N_PFSYNCSTAT, 1, NULL, pfsync_stats, NULL, "pfsync", 1, 0 }, +#endif { -1, N_ARPSTAT, 1, NULL, arp_stats, NULL, "arp", 1, 0 }, { -1, -1, 0, NULL, Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Tue Oct 29 17:34:15 2013 (r257348) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Tue Oct 29 17:38:13 2013 (r257349) @@ -89,7 +89,6 @@ SRCS= addrtoname.c \ print-olsr.c \ print-ospf.c \ print-otv.c \ - print-pfsync.c \ print-pgm.c \ print-pim.c \ print-ppi.c \ @@ -171,7 +170,8 @@ CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL .endif .if ${MK_PF} != "no" -SRCS+= print-pflog.c +SRCS+= print-pflog.c \ + print-pfsync.c CFLAGS+= -DHAVE_NET_PFVAR_H .endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 17:46:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 61DFF7B5; Tue, 29 Oct 2013 17:46:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC5B2877; Tue, 29 Oct 2013 17:46:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9THkRbr065383; Tue, 29 Oct 2013 17:46:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9THkR6D065382; Tue, 29 Oct 2013 17:46:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310291746.r9THkR6D065382@svn.freebsd.org> From: Xin LI Date: Tue, 29 Oct 2013 17:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257350 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 17:46:27 -0000 Author: delphij Date: Tue Oct 29 17:46:26 2013 New Revision: 257350 URL: http://svnweb.freebsd.org/changeset/base/257350 Log: In r257079, SRCDIR is pointed to ${.CURDIR} when not set. However, Makefile.inc1 is being called in sub-make's where make(1) would, by default, implicitly chdir(2) to ${.OBJDIR} before executing any targets. This would make some targets, like delete-old, when trying to derive various variables introduced by change r256921 using ``make -f Makefile.inc1'' that also rely on SRCDIR to fail. This changeset adds an explicit cd ${.CURDIR} before these unwrapped make calls, making them in line with the other ones that are already being wrapped with the explicit chdir's. Tested by: gjb MFC after: 5 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 29 17:38:13 2013 (r257349) +++ head/Makefile.inc1 Tue Oct 29 17:46:26 2013 (r257350) @@ -1686,6 +1686,7 @@ delete-old-files: # argument list will get too long. Using .for/.endfor make "loops" will make # the Makefile parser segfault. @exec 3<&0; \ + cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ while read file; do \ @@ -1708,7 +1709,8 @@ delete-old-files: check-old-files: @echo ">>> Checking for old files" - @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ @@ -1729,6 +1731,7 @@ delete-old-libs: @echo ">>> Removing old libraries" @echo "${OLD_LIBS_MESSAGE}" | fmt @exec 3<&0; \ + cd ${.CURDIR}; \ ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_LIBS | xargs -n1 | \ while read file; do \ @@ -1748,7 +1751,8 @@ delete-old-libs: check-old-libs: @echo ">>> Checking for old libraries" - @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_LIBS | xargs -n1 | \ while read file; do \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ @@ -1763,7 +1767,8 @@ check-old-libs: delete-old-dirs: @echo ">>> Removing old directories" - @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_DIRS | xargs -n1 | sort -r | \ while read dir; do \ if [ -d "${DESTDIR}/$${dir}" ]; then \ @@ -1776,7 +1781,8 @@ delete-old-dirs: check-old-dirs: @echo ">>> Checking for old directories" - @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ + @cd ${.CURDIR}; \ + ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ -V OLD_DIRS | xargs -n1 | \ while read dir; do \ if [ -d "${DESTDIR}/$${dir}" ]; then \ From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 17:48:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B2079BB; Tue, 29 Oct 2013 17:48:09 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 379B9289E; Tue, 29 Oct 2013 17:48:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9THm9F4065617; Tue, 29 Oct 2013 17:48:09 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9THm84X065615; Tue, 29 Oct 2013 17:48:08 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310291748.r9THm84X065615@svn.freebsd.org> From: Andre Oppermann Date: Tue, 29 Oct 2013 17:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257351 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 17:48:09 -0000 Author: andre Date: Tue Oct 29 17:48:08 2013 New Revision: 257351 URL: http://svnweb.freebsd.org/changeset/base/257351 Log: Move all interface queue related structures, macros and definitions from net/if_var to it own new net/ifq.h. For now net/ifq.h is unconditionally included through net/if_var.h. This is a mechanical change in preparation to make struct ifnet and the individual interface queue mechanisms opaque. Discussed with: glebius Sponsored by: The FreeBSD Foundation Added: head/sys/net/ifq.h - copied, changed from r257282, head/sys/net/if_var.h Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Tue Oct 29 17:46:26 2013 (r257350) +++ head/sys/net/if_var.h Tue Oct 29 17:48:08 2013 (r257351) @@ -94,18 +94,6 @@ VNET_DECLARE(struct pfil_head, link_pfil #endif /* _KERNEL */ /* - * Structure defining a queue for a network interface. - */ -struct ifqueue { - struct mbuf *ifq_head; - struct mbuf *ifq_tail; - int ifq_len; - int ifq_maxlen; - int ifq_drops; - struct mtx ifq_mtx; -}; - -/* * Structure defining a network interface. * * (Would like to call this struct ``if'', but C isn't PL/1.) @@ -208,6 +196,8 @@ struct ifnet { void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; +#include /* XXXAO: temporary unconditional include */ + /* * XXX These aliases are terribly dangerous because they could apply * to anything. @@ -262,96 +252,6 @@ void if_addr_runlock(struct ifnet *ifp); void if_maddr_rlock(struct ifnet *ifp); /* if_multiaddrs */ void if_maddr_runlock(struct ifnet *ifp); /* if_multiaddrs */ -/* - * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq) - * are queues of messages stored on ifqueue structures - * (defined above). Entries are added to and deleted from these structures - * by these macros. - */ -#define IF_LOCK(ifq) mtx_lock(&(ifq)->ifq_mtx) -#define IF_UNLOCK(ifq) mtx_unlock(&(ifq)->ifq_mtx) -#define IF_LOCK_ASSERT(ifq) mtx_assert(&(ifq)->ifq_mtx, MA_OWNED) -#define _IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen) -#define _IF_DROP(ifq) ((ifq)->ifq_drops++) -#define _IF_QLEN(ifq) ((ifq)->ifq_len) - -#define _IF_ENQUEUE(ifq, m) do { \ - (m)->m_nextpkt = NULL; \ - if ((ifq)->ifq_tail == NULL) \ - (ifq)->ifq_head = m; \ - else \ - (ifq)->ifq_tail->m_nextpkt = m; \ - (ifq)->ifq_tail = m; \ - (ifq)->ifq_len++; \ -} while (0) - -#define IF_ENQUEUE(ifq, m) do { \ - IF_LOCK(ifq); \ - _IF_ENQUEUE(ifq, m); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define _IF_PREPEND(ifq, m) do { \ - (m)->m_nextpkt = (ifq)->ifq_head; \ - if ((ifq)->ifq_tail == NULL) \ - (ifq)->ifq_tail = (m); \ - (ifq)->ifq_head = (m); \ - (ifq)->ifq_len++; \ -} while (0) - -#define IF_PREPEND(ifq, m) do { \ - IF_LOCK(ifq); \ - _IF_PREPEND(ifq, m); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define _IF_DEQUEUE(ifq, m) do { \ - (m) = (ifq)->ifq_head; \ - if (m) { \ - if (((ifq)->ifq_head = (m)->m_nextpkt) == NULL) \ - (ifq)->ifq_tail = NULL; \ - (m)->m_nextpkt = NULL; \ - (ifq)->ifq_len--; \ - } \ -} while (0) - -#define IF_DEQUEUE(ifq, m) do { \ - IF_LOCK(ifq); \ - _IF_DEQUEUE(ifq, m); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define _IF_DEQUEUE_ALL(ifq, m) do { \ - (m) = (ifq)->ifq_head; \ - (ifq)->ifq_head = (ifq)->ifq_tail = NULL; \ - (ifq)->ifq_len = 0; \ -} while (0) - -#define IF_DEQUEUE_ALL(ifq, m) do { \ - IF_LOCK(ifq); \ - _IF_DEQUEUE_ALL(ifq, m); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define _IF_POLL(ifq, m) ((m) = (ifq)->ifq_head) -#define IF_POLL(ifq, m) _IF_POLL(ifq, m) - -#define _IF_DRAIN(ifq) do { \ - struct mbuf *m; \ - for (;;) { \ - _IF_DEQUEUE(ifq, m); \ - if (m == NULL) \ - break; \ - m_freem(m); \ - } \ -} while (0) - -#define IF_DRAIN(ifq) do { \ - IF_LOCK(ifq); \ - _IF_DRAIN(ifq); \ - IF_UNLOCK(ifq); \ -} while(0) - #ifdef _KERNEL #ifdef _SYS_EVENTHANDLER_H_ /* interface link layer address change event */ @@ -421,172 +321,6 @@ EVENTHANDLER_DECLARE(group_change_event, #define IF_AFDATA_WLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_WLOCKED) #define IF_AFDATA_UNLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_UNLOCKED) -int if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, - int adjust); -#define IF_HANDOFF(ifq, m, ifp) \ - if_handoff((struct ifqueue *)ifq, m, ifp, 0) -#define IF_HANDOFF_ADJ(ifq, m, ifp, adj) \ - if_handoff((struct ifqueue *)ifq, m, ifp, adj) - -void if_start(struct ifnet *); - -#define IFQ_ENQUEUE(ifq, m, err) \ -do { \ - IF_LOCK(ifq); \ - if (ALTQ_IS_ENABLED(ifq)) \ - ALTQ_ENQUEUE(ifq, m, NULL, err); \ - else { \ - if (_IF_QFULL(ifq)) { \ - m_freem(m); \ - (err) = ENOBUFS; \ - } else { \ - _IF_ENQUEUE(ifq, m); \ - (err) = 0; \ - } \ - } \ - if (err) \ - (ifq)->ifq_drops++; \ - IF_UNLOCK(ifq); \ -} while (0) - -#define IFQ_DEQUEUE_NOLOCK(ifq, m) \ -do { \ - if (TBR_IS_ENABLED(ifq)) \ - (m) = tbr_dequeue_ptr(ifq, ALTDQ_REMOVE); \ - else if (ALTQ_IS_ENABLED(ifq)) \ - ALTQ_DEQUEUE(ifq, m); \ - else \ - _IF_DEQUEUE(ifq, m); \ -} while (0) - -#define IFQ_DEQUEUE(ifq, m) \ -do { \ - IF_LOCK(ifq); \ - IFQ_DEQUEUE_NOLOCK(ifq, m); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define IFQ_POLL_NOLOCK(ifq, m) \ -do { \ - if (TBR_IS_ENABLED(ifq)) \ - (m) = tbr_dequeue_ptr(ifq, ALTDQ_POLL); \ - else if (ALTQ_IS_ENABLED(ifq)) \ - ALTQ_POLL(ifq, m); \ - else \ - _IF_POLL(ifq, m); \ -} while (0) - -#define IFQ_POLL(ifq, m) \ -do { \ - IF_LOCK(ifq); \ - IFQ_POLL_NOLOCK(ifq, m); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define IFQ_PURGE_NOLOCK(ifq) \ -do { \ - if (ALTQ_IS_ENABLED(ifq)) { \ - ALTQ_PURGE(ifq); \ - } else \ - _IF_DRAIN(ifq); \ -} while (0) - -#define IFQ_PURGE(ifq) \ -do { \ - IF_LOCK(ifq); \ - IFQ_PURGE_NOLOCK(ifq); \ - IF_UNLOCK(ifq); \ -} while (0) - -#define IFQ_SET_READY(ifq) \ - do { ((ifq)->altq_flags |= ALTQF_READY); } while (0) - -#define IFQ_LOCK(ifq) IF_LOCK(ifq) -#define IFQ_UNLOCK(ifq) IF_UNLOCK(ifq) -#define IFQ_LOCK_ASSERT(ifq) IF_LOCK_ASSERT(ifq) -#define IFQ_IS_EMPTY(ifq) ((ifq)->ifq_len == 0) -#define IFQ_INC_LEN(ifq) ((ifq)->ifq_len++) -#define IFQ_DEC_LEN(ifq) (--(ifq)->ifq_len) -#define IFQ_INC_DROPS(ifq) ((ifq)->ifq_drops++) -#define IFQ_SET_MAXLEN(ifq, len) ((ifq)->ifq_maxlen = (len)) - -/* - * The IFF_DRV_OACTIVE test should really occur in the device driver, not in - * the handoff logic, as that flag is locked by the device driver. - */ -#define IFQ_HANDOFF_ADJ(ifp, m, adj, err) \ -do { \ - int len; \ - short mflags; \ - \ - len = (m)->m_pkthdr.len; \ - mflags = (m)->m_flags; \ - IFQ_ENQUEUE(&(ifp)->if_snd, m, err); \ - if ((err) == 0) { \ - (ifp)->if_obytes += len + (adj); \ - if (mflags & M_MCAST) \ - (ifp)->if_omcasts++; \ - if (((ifp)->if_drv_flags & IFF_DRV_OACTIVE) == 0) \ - if_start(ifp); \ - } \ -} while (0) - -#define IFQ_HANDOFF(ifp, m, err) \ - IFQ_HANDOFF_ADJ(ifp, m, 0, err) - -#define IFQ_DRV_DEQUEUE(ifq, m) \ -do { \ - (m) = (ifq)->ifq_drv_head; \ - if (m) { \ - if (((ifq)->ifq_drv_head = (m)->m_nextpkt) == NULL) \ - (ifq)->ifq_drv_tail = NULL; \ - (m)->m_nextpkt = NULL; \ - (ifq)->ifq_drv_len--; \ - } else { \ - IFQ_LOCK(ifq); \ - IFQ_DEQUEUE_NOLOCK(ifq, m); \ - while ((ifq)->ifq_drv_len < (ifq)->ifq_drv_maxlen) { \ - struct mbuf *m0; \ - IFQ_DEQUEUE_NOLOCK(ifq, m0); \ - if (m0 == NULL) \ - break; \ - m0->m_nextpkt = NULL; \ - if ((ifq)->ifq_drv_tail == NULL) \ - (ifq)->ifq_drv_head = m0; \ - else \ - (ifq)->ifq_drv_tail->m_nextpkt = m0; \ - (ifq)->ifq_drv_tail = m0; \ - (ifq)->ifq_drv_len++; \ - } \ - IFQ_UNLOCK(ifq); \ - } \ -} while (0) - -#define IFQ_DRV_PREPEND(ifq, m) \ -do { \ - (m)->m_nextpkt = (ifq)->ifq_drv_head; \ - if ((ifq)->ifq_drv_tail == NULL) \ - (ifq)->ifq_drv_tail = (m); \ - (ifq)->ifq_drv_head = (m); \ - (ifq)->ifq_drv_len++; \ -} while (0) - -#define IFQ_DRV_IS_EMPTY(ifq) \ - (((ifq)->ifq_drv_len == 0) && ((ifq)->ifq_len == 0)) - -#define IFQ_DRV_PURGE(ifq) \ -do { \ - struct mbuf *m, *n = (ifq)->ifq_drv_head; \ - while((m = n) != NULL) { \ - n = m->m_nextpkt; \ - m_freem(m); \ - } \ - (ifq)->ifq_drv_head = (ifq)->ifq_drv_tail = NULL; \ - (ifq)->ifq_drv_len = 0; \ - IFQ_PURGE(ifq); \ -} while (0) - -#ifdef _KERNEL static __inline void if_initbaudrate(struct ifnet *ifp, uintmax_t baud) { @@ -599,165 +333,6 @@ if_initbaudrate(struct ifnet *ifp, uintm ifp->if_baudrate = baud; } -static __inline int -drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) -{ - int error = 0; - -#ifdef ALTQ - if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - IFQ_ENQUEUE(&ifp->if_snd, m, error); - return (error); - } -#endif - error = buf_ring_enqueue(br, m); - if (error) - m_freem(m); - - return (error); -} - -static __inline void -drbr_putback(struct ifnet *ifp, struct buf_ring *br, struct mbuf *new) -{ - /* - * The top of the list needs to be swapped - * for this one. - */ -#ifdef ALTQ - if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { - /* - * Peek in altq case dequeued it - * so put it back. - */ - IFQ_DRV_PREPEND(&ifp->if_snd, new); - return; - } -#endif - buf_ring_putback_sc(br, new); -} - -static __inline struct mbuf * -drbr_peek(struct ifnet *ifp, struct buf_ring *br) -{ -#ifdef ALTQ - struct mbuf *m; - if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { - /* - * Pull it off like a dequeue - * since drbr_advance() does nothing - * for altq and drbr_putback() will - * use the old prepend function. - */ - IFQ_DEQUEUE(&ifp->if_snd, m); - return (m); - } -#endif - return(buf_ring_peek(br)); -} - -static __inline void -drbr_flush(struct ifnet *ifp, struct buf_ring *br) -{ - struct mbuf *m; - -#ifdef ALTQ - if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) - IFQ_PURGE(&ifp->if_snd); -#endif - while ((m = buf_ring_dequeue_sc(br)) != NULL) - m_freem(m); -} - -static __inline void -drbr_free(struct buf_ring *br, struct malloc_type *type) -{ - - drbr_flush(NULL, br); - buf_ring_free(br, type); -} - -static __inline struct mbuf * -drbr_dequeue(struct ifnet *ifp, struct buf_ring *br) -{ -#ifdef ALTQ - struct mbuf *m; - - if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) { - IFQ_DEQUEUE(&ifp->if_snd, m); - return (m); - } -#endif - return (buf_ring_dequeue_sc(br)); -} - -static __inline void -drbr_advance(struct ifnet *ifp, struct buf_ring *br) -{ -#ifdef ALTQ - /* Nothing to do here since peek dequeues in altq case */ - if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) - return; -#endif - return (buf_ring_advance_sc(br)); -} - - -static __inline struct mbuf * -drbr_dequeue_cond(struct ifnet *ifp, struct buf_ring *br, - int (*func) (struct mbuf *, void *), void *arg) -{ - struct mbuf *m; -#ifdef ALTQ - if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - IFQ_LOCK(&ifp->if_snd); - IFQ_POLL_NOLOCK(&ifp->if_snd, m); - if (m != NULL && func(m, arg) == 0) { - IFQ_UNLOCK(&ifp->if_snd); - return (NULL); - } - IFQ_DEQUEUE_NOLOCK(&ifp->if_snd, m); - IFQ_UNLOCK(&ifp->if_snd); - return (m); - } -#endif - m = buf_ring_peek(br); - if (m == NULL || func(m, arg) == 0) - return (NULL); - - return (buf_ring_dequeue_sc(br)); -} - -static __inline int -drbr_empty(struct ifnet *ifp, struct buf_ring *br) -{ -#ifdef ALTQ - if (ALTQ_IS_ENABLED(&ifp->if_snd)) - return (IFQ_IS_EMPTY(&ifp->if_snd)); -#endif - return (buf_ring_empty(br)); -} - -static __inline int -drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) -{ -#ifdef ALTQ - if (ALTQ_IS_ENABLED(&ifp->if_snd)) - return (1); -#endif - return (!buf_ring_empty(br)); -} - -static __inline int -drbr_inuse(struct ifnet *ifp, struct buf_ring *br) -{ -#ifdef ALTQ - if (ALTQ_IS_ENABLED(&ifp->if_snd)) - return (ifp->if_snd.ifq_len); -#endif - return (buf_ring_count(br)); -} -#endif /* * 72 was chosen below because it is the size of a TCP/IP * header (40) + the minimum mss (32). @@ -893,8 +468,6 @@ VNET_DECLARE(int, useloopback); #define V_loif VNET(loif) #define V_useloopback VNET(useloopback) -extern int ifqmaxlen; - int if_addgroup(struct ifnet *, const char *); int if_delgroup(struct ifnet *, const char *); int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); @@ -915,7 +488,6 @@ void if_free(struct ifnet *); void if_initname(struct ifnet *, const char *, int); void if_link_state_change(struct ifnet *, int); int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); -void if_qflush(struct ifnet *); void if_ref(struct ifnet *); void if_rele(struct ifnet *); int if_setlladdr(struct ifnet *, const u_char *, int); @@ -925,9 +497,6 @@ int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); struct ifnet *ifunit_ref(const char *); -void ifq_init(struct ifaltq *, struct ifnet *ifp); -void ifq_delete(struct ifaltq *); - int ifa_add_loopback_route(struct ifaddr *, struct sockaddr *); int ifa_del_loopback_route(struct ifaddr *, struct sockaddr *); @@ -951,14 +520,6 @@ void if_deregister_com_alloc(u_char type #define IF_LLADDR(ifp) \ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) -#ifdef DEVICE_POLLING -enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; - -typedef int poll_handler_t(struct ifnet *ifp, enum poll_cmd cmd, int count); -int ether_poll_register(poll_handler_t *h, struct ifnet *ifp); -int ether_poll_deregister(struct ifnet *ifp); -#endif /* DEVICE_POLLING */ - #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Copied and modified: head/sys/net/ifq.h (from r257282, head/sys/net/if_var.h) ============================================================================== --- head/sys/net/if_var.h Mon Oct 28 21:41:44 2013 (r257282, copy source) +++ head/sys/net/ifq.h Tue Oct 29 17:48:08 2013 (r257351) @@ -30,69 +30,21 @@ * $FreeBSD$ */ -#ifndef _NET_IF_VAR_H_ -#define _NET_IF_VAR_H_ - -/* - * Structures defining a network interface, providing a packet - * transport mechanism (ala level 0 of the PUP protocols). - * - * Each interface accepts output datagrams of a specified maximum - * length, and provides higher level routines with input datagrams - * received from its medium. - * - * Output occurs when the routine if_output is called, with three parameters: - * (*ifp->if_output)(ifp, m, dst, rt) - * Here m is the mbuf chain to be sent and dst is the destination address. - * The output routine encapsulates the supplied datagram if necessary, - * and then transmits it on its medium. - * - * On input, each interface unwraps the data received by it, and either - * places it on the input queue of an internetwork datagram routine - * and posts the associated software interrupt, or passes the datagram to a raw - * packet input routine. - * - * Routines exist for locating interfaces by their addresses - * or for locating an interface on a certain network, as well as more general - * routing and gateway routines maintaining information used to locate - * interfaces. These routines live in the files if.c and route.c - */ - -struct rtentry; /* ifa_rtrequest */ -struct rt_addrinfo; /* ifa_rtrequest */ -struct socket; -struct carp_if; -struct carp_softc; -struct ifvlantrunk; -struct route; /* if_output */ -struct vnet; +#ifndef _NET_IFQ_H_ +#define _NET_IFQ_H_ #ifdef _KERNEL #include /* ifqueue only? */ #include #include #endif /* _KERNEL */ -#include #include /* XXX */ #include /* struct ifqueue */ -#include /* XXX */ -#include /* XXX */ -#include /* if_link_task */ #define IF_DUNIT_NONE -1 #include -TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ -TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ -TAILQ_HEAD(ifmultihead, ifmultiaddr); -TAILQ_HEAD(ifgrouphead, ifg_group); - -#ifdef _KERNEL -VNET_DECLARE(struct pfil_head, link_pfil_hook); /* packet filter hooks */ -#define V_link_pfil_hook VNET(link_pfil_hook) -#endif /* _KERNEL */ - /* * Structure defining a queue for a network interface. */ @@ -105,163 +57,7 @@ struct ifqueue { struct mtx ifq_mtx; }; -/* - * Structure defining a network interface. - * - * (Would like to call this struct ``if'', but C isn't PL/1.) - */ - -struct ifnet { - void *if_softc; /* pointer to driver state */ - void *if_l2com; /* pointer to protocol bits */ - struct vnet *if_vnet; /* pointer to network stack instance */ - TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */ - char if_xname[IFNAMSIZ]; /* external name (name + unit) */ - const char *if_dname; /* driver name */ - int if_dunit; /* unit or IF_DUNIT_NONE */ - u_int if_refcount; /* reference count */ - struct ifaddrhead if_addrhead; /* linked list of addresses per if */ - /* - * if_addrhead is the list of all addresses associated to - * an interface. - * Some code in the kernel assumes that first element - * of the list has type AF_LINK, and contains sockaddr_dl - * addresses which store the link-level address and the name - * of the interface. - * However, access to the AF_LINK address through this - * field is deprecated. Use if_addr or ifaddr_byindex() instead. - */ - int if_pcount; /* number of promiscuous listeners */ - struct carp_if *if_carp; /* carp interface structure */ - struct bpf_if *if_bpf; /* packet filter structure */ - u_short if_index; /* numeric abbreviation for this if */ - short if_index_reserved; /* spare space to grow if_index */ - struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */ - int if_flags; /* up/down, broadcast, etc. */ - int if_capabilities; /* interface features & capabilities */ - int if_capenable; /* enabled features & capabilities */ - void *if_linkmib; /* link-type-specific MIB data */ - size_t if_linkmiblen; /* length of above data */ - struct if_data if_data; - struct ifmultihead if_multiaddrs; /* multicast addresses configured */ - int if_amcount; /* number of all-multicast requests */ -/* procedure handles */ - int (*if_output) /* output routine (enqueue) */ - (struct ifnet *, struct mbuf *, const struct sockaddr *, - struct route *); - void (*if_input) /* input routine (from h/w driver) */ - (struct ifnet *, struct mbuf *); - void (*if_start) /* initiate output routine */ - (struct ifnet *); - int (*if_ioctl) /* ioctl routine */ - (struct ifnet *, u_long, caddr_t); - void (*if_init) /* Init routine */ - (void *); - int (*if_resolvemulti) /* validate/resolve multicast */ - (struct ifnet *, struct sockaddr **, struct sockaddr *); - void (*if_qflush) /* flush any queues */ - (struct ifnet *); - int (*if_transmit) /* initiate output routine */ - (struct ifnet *, struct mbuf *); - void (*if_reassign) /* reassign to vnet routine */ - (struct ifnet *, struct vnet *, char *); - struct vnet *if_home_vnet; /* where this ifnet originates from */ - struct ifaddr *if_addr; /* pointer to link-level address */ - void *if_llsoftc; /* link layer softc */ - int if_drv_flags; /* driver-managed status flags */ - struct ifaltq if_snd; /* output queue (includes altq) */ - const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ - - void *if_bridge; /* bridge glue */ - - struct label *if_label; /* interface MAC label */ - - /* these are only used by IPv6 */ - void *if_unused[2]; - void *if_afdata[AF_MAX]; - int if_afdata_initialized; - struct rwlock if_afdata_lock; - struct task if_linktask; /* task for link change events */ - struct rwlock if_addr_lock; /* lock to protect address lists */ - - LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ - TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ - /* protected by if_addr_lock */ - void *if_pf_kif; - void *if_lagg; /* lagg glue */ - char *if_description; /* interface description */ - u_int if_fib; /* interface FIB */ - u_char if_alloctype; /* if_type at time of allocation */ - - u_int if_hw_tsomax; /* tso burst length limit, the minimum - * is (IP_MAXPACKET / 8). - * XXXAO: Have to find a better place - * for it eventually. */ - - /* - * Spare fields are added so that we can modify sensitive data - * structures without changing the kernel binary interface, and must - * be used with care where binary compatibility is required. - */ - char if_cspare[3]; - int if_ispare[4]; - void *if_pspare[8]; /* 1 netmap, 7 TDB */ -}; - -/* - * XXX These aliases are terribly dangerous because they could apply - * to anything. - */ -#define if_mtu if_data.ifi_mtu -#define if_type if_data.ifi_type -#define if_physical if_data.ifi_physical -#define if_addrlen if_data.ifi_addrlen -#define if_hdrlen if_data.ifi_hdrlen -#define if_metric if_data.ifi_metric -#define if_link_state if_data.ifi_link_state -#define if_baudrate if_data.ifi_baudrate -#define if_baudrate_pf if_data.ifi_baudrate_pf -#define if_hwassist if_data.ifi_hwassist -#define if_ipackets if_data.ifi_ipackets -#define if_ierrors if_data.ifi_ierrors -#define if_opackets if_data.ifi_opackets -#define if_oerrors if_data.ifi_oerrors -#define if_collisions if_data.ifi_collisions -#define if_ibytes if_data.ifi_ibytes -#define if_obytes if_data.ifi_obytes -#define if_imcasts if_data.ifi_imcasts -#define if_omcasts if_data.ifi_omcasts -#define if_iqdrops if_data.ifi_iqdrops -#define if_noproto if_data.ifi_noproto -#define if_lastchange if_data.ifi_lastchange - -/* for compatibility with other BSDs */ -#define if_addrlist if_addrhead -#define if_list if_link -#define if_name(ifp) ((ifp)->if_xname) - -/* - * Locks for address lists on the network interface. - */ -#define IF_ADDR_LOCK_INIT(if) rw_init(&(if)->if_addr_lock, "if_addr_lock") -#define IF_ADDR_LOCK_DESTROY(if) rw_destroy(&(if)->if_addr_lock) -#define IF_ADDR_WLOCK(if) rw_wlock(&(if)->if_addr_lock) -#define IF_ADDR_WUNLOCK(if) rw_wunlock(&(if)->if_addr_lock) -#define IF_ADDR_RLOCK(if) rw_rlock(&(if)->if_addr_lock) -#define IF_ADDR_RUNLOCK(if) rw_runlock(&(if)->if_addr_lock) -#define IF_ADDR_LOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_LOCKED) -#define IF_ADDR_WLOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_WLOCKED) - -/* - * Function variations on locking macros intended to be used by loadable - * kernel modules in order to divorce them from the internals of address list - * locking. - */ -void if_addr_rlock(struct ifnet *ifp); /* if_addrhead */ -void if_addr_runlock(struct ifnet *ifp); /* if_addrhead */ -void if_maddr_rlock(struct ifnet *ifp); /* if_multiaddrs */ -void if_maddr_runlock(struct ifnet *ifp); /* if_multiaddrs */ - +#ifdef _KERNEL /* * Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq) * are queues of messages stored on ifqueue structures @@ -352,75 +148,6 @@ void if_maddr_runlock(struct ifnet *ifp) IF_UNLOCK(ifq); \ } while(0) -#ifdef _KERNEL -#ifdef _SYS_EVENTHANDLER_H_ -/* interface link layer address change event */ -typedef void (*iflladdr_event_handler_t)(void *, struct ifnet *); -EVENTHANDLER_DECLARE(iflladdr_event, iflladdr_event_handler_t); -/* interface address change event */ -typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); -EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); -/* new interface arrival event */ -typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); -EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); -/* interface departure event */ -typedef void (*ifnet_departure_event_handler_t)(void *, struct ifnet *); -EVENTHANDLER_DECLARE(ifnet_departure_event, ifnet_departure_event_handler_t); -/* Interface link state change event */ -typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int); -EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); -#endif /* _SYS_EVENTHANDLER_H_ */ - -/* - * interface groups - */ -struct ifg_group { - char ifg_group[IFNAMSIZ]; - u_int ifg_refcnt; - void *ifg_pf_kif; - TAILQ_HEAD(, ifg_member) ifg_members; - TAILQ_ENTRY(ifg_group) ifg_next; -}; - -struct ifg_member { - TAILQ_ENTRY(ifg_member) ifgm_next; - struct ifnet *ifgm_ifp; -}; - -struct ifg_list { - struct ifg_group *ifgl_group; - TAILQ_ENTRY(ifg_list) ifgl_next; -}; - -#ifdef _SYS_EVENTHANDLER_H_ -/* group attach event */ -typedef void (*group_attach_event_handler_t)(void *, struct ifg_group *); -EVENTHANDLER_DECLARE(group_attach_event, group_attach_event_handler_t); -/* group detach event */ -typedef void (*group_detach_event_handler_t)(void *, struct ifg_group *); -EVENTHANDLER_DECLARE(group_detach_event, group_detach_event_handler_t); -/* group change event */ -typedef void (*group_change_event_handler_t)(void *, const char *); -EVENTHANDLER_DECLARE(group_change_event, group_change_event_handler_t); -#endif /* _SYS_EVENTHANDLER_H_ */ - -#define IF_AFDATA_LOCK_INIT(ifp) \ - rw_init(&(ifp)->if_afdata_lock, "if_afdata") - -#define IF_AFDATA_WLOCK(ifp) rw_wlock(&(ifp)->if_afdata_lock) -#define IF_AFDATA_RLOCK(ifp) rw_rlock(&(ifp)->if_afdata_lock) -#define IF_AFDATA_WUNLOCK(ifp) rw_wunlock(&(ifp)->if_afdata_lock) -#define IF_AFDATA_RUNLOCK(ifp) rw_runlock(&(ifp)->if_afdata_lock) -#define IF_AFDATA_LOCK(ifp) IF_AFDATA_WLOCK(ifp) -#define IF_AFDATA_UNLOCK(ifp) IF_AFDATA_WUNLOCK(ifp) -#define IF_AFDATA_TRYLOCK(ifp) rw_try_wlock(&(ifp)->if_afdata_lock) -#define IF_AFDATA_DESTROY(ifp) rw_destroy(&(ifp)->if_afdata_lock) - -#define IF_AFDATA_LOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_LOCKED) -#define IF_AFDATA_RLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_RLOCKED) -#define IF_AFDATA_WLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_WLOCKED) -#define IF_AFDATA_UNLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_UNLOCKED) - int if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust); #define IF_HANDOFF(ifq, m, ifp) \ @@ -586,19 +313,6 @@ do { \ IFQ_PURGE(ifq); \ } while (0) -#ifdef _KERNEL -static __inline void -if_initbaudrate(struct ifnet *ifp, uintmax_t baud) -{ - - ifp->if_baudrate_pf = 0; - while (baud > (u_long)(~0UL)) { - baud /= 10; - ifp->if_baudrate_pf++; - } - ifp->if_baudrate = baud; -} - static __inline int drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) { @@ -757,200 +471,13 @@ drbr_inuse(struct ifnet *ifp, struct buf #endif return (buf_ring_count(br)); } -#endif -/* - * 72 was chosen below because it is the size of a TCP/IP - * header (40) + the minimum mss (32). - */ -#define IF_MINMTU 72 -#define IF_MAXMTU 65535 - -#define TOEDEV(ifp) ((ifp)->if_llsoftc) - -#endif /* _KERNEL */ - -/* - * The ifaddr structure contains information about one address - * of an interface. They are maintained by the different address families, - * are allocated and attached when an address is set, and are linked - * together so all addresses for an interface can be located. - * - * NOTE: a 'struct ifaddr' is always at the beginning of a larger - * chunk of malloc'ed memory, where we store the three addresses - * (ifa_addr, ifa_dstaddr and ifa_netmask) referenced here. - */ -#if defined(_KERNEL) || defined(_WANT_IFADDR) -struct ifaddr { - struct sockaddr *ifa_addr; /* address of interface */ - struct sockaddr *ifa_dstaddr; /* other end of p-to-p link */ -#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ - struct sockaddr *ifa_netmask; /* used to determine subnet */ - struct ifnet *ifa_ifp; /* back-pointer to interface */ - struct carp_softc *ifa_carp; /* pointer to CARP data */ - TAILQ_ENTRY(ifaddr) ifa_link; /* queue macro glue */ - void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */ - (int, struct rtentry *, struct rt_addrinfo *); - u_short ifa_flags; /* mostly rt_flags for cloning */ - u_int ifa_refcnt; /* references to this structure */ - int ifa_metric; /* cost of going out this interface */ - int (*ifa_claim_addr) /* check if an addr goes to this if */ - (struct ifaddr *, struct sockaddr *); - - counter_u64_t ifa_ipackets; - counter_u64_t ifa_opackets; - counter_u64_t ifa_ibytes; - counter_u64_t ifa_obytes; -}; -#endif - -#ifdef _KERNEL -#define IFA_ROUTE RTF_UP /* route installed */ -#define IFA_RTSELF RTF_HOST /* loopback route to self installed */ - -/* For compatibility with other BSDs. SCTP uses it. */ -#define ifa_list ifa_link - -struct ifaddr * ifa_alloc(size_t size, int flags); -void ifa_free(struct ifaddr *ifa); -void ifa_ref(struct ifaddr *ifa); -#endif /* _KERNEL */ - -/* - * Multicast address structure. This is analogous to the ifaddr - * structure except that it keeps track of multicast addresses. - */ -struct ifmultiaddr { - TAILQ_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */ - struct sockaddr *ifma_addr; /* address this membership is for */ - struct sockaddr *ifma_lladdr; /* link-layer translation, if any */ - struct ifnet *ifma_ifp; /* back-pointer to interface */ - u_int ifma_refcount; /* reference count */ - void *ifma_protospec; /* protocol-specific state, if any */ - struct ifmultiaddr *ifma_llifma; /* pointer to ifma for ifma_lladdr */ -}; - -#ifdef _KERNEL - -extern struct rwlock ifnet_rwlock; -extern struct sx ifnet_sxlock; - -#define IFNET_LOCK_INIT() do { \ - rw_init_flags(&ifnet_rwlock, "ifnet_rw", RW_RECURSE); \ - sx_init_flags(&ifnet_sxlock, "ifnet_sx", SX_RECURSE); \ -} while(0) - -#define IFNET_WLOCK() do { \ - sx_xlock(&ifnet_sxlock); \ - rw_wlock(&ifnet_rwlock); \ -} while (0) - -#define IFNET_WUNLOCK() do { \ - rw_wunlock(&ifnet_rwlock); \ - sx_xunlock(&ifnet_sxlock); \ -} while (0) - -/* - * To assert the ifnet lock, you must know not only whether it's for read or - * write, but also whether it was acquired with sleep support or not. - */ -#define IFNET_RLOCK_ASSERT() sx_assert(&ifnet_sxlock, SA_SLOCKED) -#define IFNET_RLOCK_NOSLEEP_ASSERT() rw_assert(&ifnet_rwlock, RA_RLOCKED) -#define IFNET_WLOCK_ASSERT() do { \ - sx_assert(&ifnet_sxlock, SA_XLOCKED); \ - rw_assert(&ifnet_rwlock, RA_WLOCKED); \ -} while (0) - -#define IFNET_RLOCK() sx_slock(&ifnet_sxlock) -#define IFNET_RLOCK_NOSLEEP() rw_rlock(&ifnet_rwlock) -#define IFNET_RUNLOCK() sx_sunlock(&ifnet_sxlock) -#define IFNET_RUNLOCK_NOSLEEP() rw_runlock(&ifnet_rwlock) - -/* - * Look up an ifnet given its index; the _ref variant also acquires a - * reference that must be freed using if_rele(). It is almost always a bug - * to call ifnet_byindex() instead if ifnet_byindex_ref(). - */ -struct ifnet *ifnet_byindex(u_short idx); -struct ifnet *ifnet_byindex_locked(u_short idx); -struct ifnet *ifnet_byindex_ref(u_short idx); - -/* - * Given the index, ifaddr_byindex() returns the one and only - * link-level ifaddr for the interface. You are not supposed to use - * it to traverse the list of addresses associated to the interface. - */ -struct ifaddr *ifaddr_byindex(u_short idx); - -VNET_DECLARE(struct ifnethead, ifnet); -VNET_DECLARE(struct ifgrouphead, ifg_head); -VNET_DECLARE(int, if_index); -VNET_DECLARE(struct ifnet *, loif); /* first loopback interface */ -VNET_DECLARE(int, useloopback); - -#define V_ifnet VNET(ifnet) -#define V_ifg_head VNET(ifg_head) -#define V_if_index VNET(if_index) -#define V_loif VNET(loif) -#define V_useloopback VNET(useloopback) extern int ifqmaxlen; -int if_addgroup(struct ifnet *, const char *); -int if_delgroup(struct ifnet *, const char *); -int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); -int if_allmulti(struct ifnet *, int); -struct ifnet* if_alloc(u_char); -void if_attach(struct ifnet *); -void if_dead(struct ifnet *); -int if_delmulti(struct ifnet *, struct sockaddr *); -void if_delmulti_ifma(struct ifmultiaddr *); -void if_detach(struct ifnet *); -void if_vmove(struct ifnet *, struct vnet *); -void if_purgeaddrs(struct ifnet *); -void if_delallmulti(struct ifnet *); -void if_down(struct ifnet *); -struct ifmultiaddr * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 18:36:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 925E517F; Tue, 29 Oct 2013 18:36:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F72D2C71; Tue, 29 Oct 2013 18:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TIakaV082771; Tue, 29 Oct 2013 18:36:46 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TIaiXQ082763; Tue, 29 Oct 2013 18:36:44 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291836.r9TIaiXQ082763@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 18:36: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: r257353 - in stable/10: etc etc/keys etc/mtree etc/pkg share/man/man7 usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 18:36:46 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 18:36:44 2013 New Revision: 257353 URL: http://svnweb.freebsd.org/changeset/base/257353 Log: MFC: r256770,r257142,r257145,r257146,r257147,r257148, r257149,r257150,r257158,r257159,r257164,r257168, r257193 - Support checking signature for pkg bootstrap from remote and for 'pkg add ./pkg.txz' - Be verbose on where pkg is being bootstrapped from. - Add support for reading configuration files from /etc/pkg. For now only /etc/pkg/FreeBSD.conf is supported. - Add test package signing key fingerprint into /etc/keys/pkg/trusted. - Disable fingerprint checking by default for now as the official packages are not yet signed. Approved by: bapt Approved by: re (glebius) Added: stable/10/etc/keys/ - copied from r257150, head/etc/keys/ stable/10/etc/pkg/ - copied from r257145, head/etc/pkg/ Modified: stable/10/etc/Makefile stable/10/etc/mtree/BSD.root.dist stable/10/etc/pkg/FreeBSD.conf stable/10/share/man/man7/hier.7 stable/10/usr.sbin/pkg/Makefile stable/10/usr.sbin/pkg/config.c stable/10/usr.sbin/pkg/config.h stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/etc/ (props changed) stable/10/share/man/man7/ (props changed) stable/10/usr.sbin/pkg/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/etc/Makefile Tue Oct 29 18:36:44 2013 (r257353) @@ -221,7 +221,11 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install + ${_+_}cd ${.CURDIR}/keys; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install +.if ${MK_PKGBOOTSTRAP} != "no" + ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install +.endif ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/etc/mtree/BSD.root.dist Tue Oct 29 18:36:44 2013 (r257353) @@ -34,6 +34,14 @@ .. gss .. + keys + pkg + revoked + .. + trusted + .. + .. + .. mail .. mtree @@ -52,6 +60,8 @@ weekly .. .. + pkg + .. ppp .. rc.d Modified: stable/10/etc/pkg/FreeBSD.conf ============================================================================== --- head/etc/pkg/FreeBSD.conf Sat Oct 26 03:31:05 2013 (r257145) +++ stable/10/etc/pkg/FreeBSD.conf Tue Oct 29 18:36:44 2013 (r257353) @@ -2,5 +2,7 @@ FreeBSD: { url: "pkg+http://pkg.freebsd.org/${ABI}/latest", mirror_type: "srv", + signature_type: "none", + fingerprints: "/etc/keys/pkg", enabled: "yes" } Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/share/man/man7/hier.7 Tue Oct 29 18:36:44 2013 (r257353) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 21, 2010 +.Dd October 23, 2013 .Dt HIER 7 .Os .Sh NAME @@ -94,6 +94,15 @@ bluetooth configuration files gnats configuration files; see .Xr send-pr 1 +.It Pa keys/ +known trusted and revoked keys. +.Pp +.Bl -tag -width ".Pa keys/pkg/" -compact +.It Pa keys/pkg/ +fingerprints for +.Xr pkg 8 +.El +.Pp .It Pa localtime local timezone information; see Modified: stable/10/usr.sbin/pkg/Makefile ============================================================================== --- stable/10/usr.sbin/pkg/Makefile Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/usr.sbin/pkg/Makefile Tue Oct 29 18:36:44 2013 (r257353) @@ -6,8 +6,9 @@ SRCS= pkg.c dns_utils.c config.c NO_MAN= yes CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include .PATH: ${.CURDIR}/../../contrib/libyaml/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} -LDADD= -larchive -lelf -lfetch -lyaml -lsbuf +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} ${LIBSSL} \ + ${LIBCRYPTO} +LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl -lcrypto USEPRIVATELIB= yaml .include Modified: stable/10/usr.sbin/pkg/config.c ============================================================================== --- stable/10/usr.sbin/pkg/config.c Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/usr.sbin/pkg/config.c Tue Oct 29 18:36:44 2013 (r257353) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Baptiste Daroussin + * Copyright (c) 2013 Bryan Drewery * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,7 +87,21 @@ static struct config_entry c[] = { "NO", NULL, false, - } + }, + [SIGNATURE_TYPE] = { + PKG_CONFIG_STRING, + "SIGNATURE_TYPE", + NULL, + NULL, + false, + }, + [FINGERPRINTS] = { + PKG_CONFIG_STRING, + "FINGERPRINTS", + NULL, + NULL, + false, + }, }; static const char * @@ -460,7 +475,7 @@ subst_packagesite(const char *abi) } static void -config_parse(yaml_document_t *doc, yaml_node_t *node) +config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) { yaml_node_pair_t *pair; yaml_node_t *key, *val; @@ -495,15 +510,39 @@ config_parse(yaml_document_t *doc, yaml_ } sbuf_clear(buf); - for (j = 0; j < strlen(key->data.scalar.value); ++j) - sbuf_putc(buf, toupper(key->data.scalar.value[j])); - sbuf_finish(buf); + if (conftype == CONFFILE_PKG) { + for (j = 0; j < strlen(key->data.scalar.value); ++j) + sbuf_putc(buf, + toupper(key->data.scalar.value[j])); + sbuf_finish(buf); + } else if (conftype == CONFFILE_REPO) { + /* The CONFFILE_REPO type is more restrictive. Only + parse known elements. */ + if (strcasecmp(key->data.scalar.value, "url") == 0) + sbuf_cpy(buf, "PACKAGESITE"); + else if (strcasecmp(key->data.scalar.value, + "mirror_type") == 0) + sbuf_cpy(buf, "MIRROR_TYPE"); + else if (strcasecmp(key->data.scalar.value, + "signature_type") == 0) + sbuf_cpy(buf, "SIGNATURE_TYPE"); + else if (strcasecmp(key->data.scalar.value, + "fingerprints") == 0) + sbuf_cpy(buf, "FINGERPRINTS"); + else { /* Skip unknown entries for future use. */ + ++pair; + continue; + } + sbuf_finish(buf); + } + for (i = 0; i < CONFIG_SIZE; i++) { if (strcmp(sbuf_data(buf), c[i].key) == 0) break; } + /* Silently skip unknown keys to be future compatible. */ if (i == CONFIG_SIZE) { ++pair; continue; @@ -522,13 +561,80 @@ config_parse(yaml_document_t *doc, yaml_ sbuf_delete(buf); } -int -config_init(void) +/*- + * Parse new repo style configs in style: + * Name: + * URL: + * MIRROR_TYPE: + * etc... + */ +static void +parse_repo_file(yaml_document_t *doc, yaml_node_t *node) +{ + yaml_node_pair_t *pair; + + pair = node->data.mapping.pairs.start; + while (pair < node->data.mapping.pairs.top) { + yaml_node_t *key = yaml_document_get_node(doc, pair->key); + yaml_node_t *val = yaml_document_get_node(doc, pair->value); + + if (key->data.scalar.length <= 0) { + ++pair; + continue; + } + + if (val->type != YAML_MAPPING_NODE) { + ++pair; + continue; + } + + config_parse(doc, val, CONFFILE_REPO); + ++pair; + } +} + + +static int +read_conf_file(const char *confpath, pkg_conf_file_t conftype) { FILE *fp; yaml_parser_t parser; yaml_document_t doc; yaml_node_t *node; + + if ((fp = fopen(confpath, "r")) == NULL) { + if (errno != ENOENT) + err(EXIT_FAILURE, "Unable to open configuration " + "file %s", confpath); + /* no configuration present */ + return (1); + } + + yaml_parser_initialize(&parser); + yaml_parser_set_input_file(&parser, fp); + yaml_parser_load(&parser, &doc); + + node = yaml_document_get_root_node(&doc); + + if (node == NULL || node->type != YAML_MAPPING_NODE) + warnx("Invalid configuration format, ignoring the " + "configuration file %s", confpath); + else { + if (conftype == CONFFILE_PKG) + config_parse(&doc, node, conftype); + else if (conftype == CONFFILE_REPO) + parse_repo_file(&doc, node); + } + + yaml_document_delete(&doc); + yaml_parser_delete(&parser); + + return (0); +} + +int +config_init(void) +{ const char *val; int i; const char *localbase; @@ -544,37 +650,23 @@ config_init(void) } localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; - snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); + snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", + localbase); - if ((fp = fopen(confpath, "r")) == NULL) { - if (errno != ENOENT) - err(EXIT_FAILURE, "Unable to open configuration file %s", confpath); - /* no configuration present */ + if (access(confpath, F_OK) == 0 && read_conf_file(confpath, + CONFFILE_PKG)) goto finalize; - } - yaml_parser_initialize(&parser); - yaml_parser_set_input_file(&parser, fp); - yaml_parser_load(&parser, &doc); - - node = yaml_document_get_root_node(&doc); - - if (node != NULL) { - if (node->type != YAML_MAPPING_NODE) - warnx("Invalid configuration format, ignoring the configuration file"); - else - config_parse(&doc, node); - } else { - warnx("Invalid configuration format, ignoring the configuration file"); - } - - yaml_document_delete(&doc); - yaml_parser_delete(&parser); + snprintf(confpath, sizeof(confpath), "/etc/pkg/FreeBSD.conf"); + if (access(confpath, F_OK) == 0 && read_conf_file(confpath, + CONFFILE_REPO)) + goto finalize; finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { if (pkg_get_myabi(abi, BUFSIZ) != 0) - errx(EXIT_FAILURE, "Failed to determine the system ABI"); + errx(EXIT_FAILURE, "Failed to determine the system " + "ABI"); c[ABI].val = abi; } Modified: stable/10/usr.sbin/pkg/config.h ============================================================================== --- stable/10/usr.sbin/pkg/config.h Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/usr.sbin/pkg/config.h Tue Oct 29 18:36:44 2013 (r257353) @@ -37,6 +37,8 @@ typedef enum { ABI, MIRROR_TYPE, ASSUME_ALWAYS_YES, + SIGNATURE_TYPE, + FINGERPRINTS, CONFIG_SIZE } pkg_config_key; @@ -45,6 +47,11 @@ typedef enum { PKG_CONFIG_BOOL, } pkg_config_t; +typedef enum { + CONFFILE_PKG=0, + CONFFILE_REPO, +} pkg_conf_file_t; + int config_init(void); void config_finish(void); int config_string(pkg_config_key, const char **); Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 18:13:04 2013 (r257352) +++ stable/10/usr.sbin/pkg/pkg.c Tue Oct 29 18:36:44 2013 (r257353) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012-2013 Baptiste Daroussin + * Copyright (c) 2013 Bryan Drewery * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,10 +29,15 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include +#define _WITH_GETLINE #include #include +#include #include #include #include @@ -43,10 +49,37 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include +#include #include "dns_utils.h" #include "config.h" +struct sig_cert { + char *name; + unsigned char *sig; + int siglen; + unsigned char *cert; + int certlen; + bool trusted; +}; + +typedef enum { + HASH_UNKNOWN, + HASH_SHA256, +} hash_t; + +struct fingerprint { + hash_t type; + char *name; + char hash[BUFSIZ]; + STAILQ_ENTRY(fingerprint) next; +}; + +STAILQ_HEAD(fingerprint_list, fingerprint); + static int extract_pkg_static(int fd, char *p, int sz) { @@ -102,7 +135,7 @@ cleanup: } static int -install_pkg_static(char *path, char *pkgpath) +install_pkg_static(const char *path, const char *pkgpath) { int pstat; pid_t pid; @@ -129,58 +162,34 @@ install_pkg_static(char *path, char *pkg } static int -bootstrap_pkg(void) +fetch_to_fd(const char *url, char *path) { struct url *u; - FILE *remote; - FILE *config; - char *site; struct dns_srvinfo *mirrors, *current; - /* To store _https._tcp. + hostname + \0 */ - char zone[MAXHOSTNAMELEN + 13]; - char url[MAXPATHLEN]; - char conf[MAXPATHLEN]; - char tmppkg[MAXPATHLEN]; - const char *packagesite, *mirror_type; - char buf[10240]; - char pkgstatic[MAXPATHLEN]; - int fd, retry, ret, max_retry; struct url_stat st; + FILE *remote; + /* To store _https._tcp. + hostname + \0 */ + int fd; + int retry, max_retry; off_t done, r; - time_t now; - time_t last; + time_t now, last; + char buf[10240]; + char zone[MAXHOSTNAMELEN + 13]; + static const char *mirror_type = NULL; done = 0; last = 0; max_retry = 3; - ret = -1; - remote = NULL; - config = NULL; current = mirrors = NULL; + remote = NULL; - printf("Bootstrapping pkg please wait\n"); - - if (config_string(PACKAGESITE, &packagesite) != 0) { - warnx("No PACKAGESITE defined"); - return (-1); - } - if (config_string(MIRROR_TYPE, &mirror_type) != 0) { + if (mirror_type == NULL && config_string(MIRROR_TYPE, &mirror_type) + != 0) { warnx("No MIRROR_TYPE defined"); return (-1); } - /* Support pkg+http:// for PACKAGESITE which is the new format - in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has - no A record. */ - if (strncmp(URL_SCHEME_PREFIX, packagesite, - strlen(URL_SCHEME_PREFIX)) == 0) - packagesite += strlen(URL_SCHEME_PREFIX); - snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite); - - snprintf(tmppkg, MAXPATHLEN, "%s/pkg.txz.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); - - if ((fd = mkstemp(tmppkg)) == -1) { + if ((fd = mkstemp(path)) == -1) { warn("mkstemp()"); return (-1); } @@ -228,7 +237,7 @@ bootstrap_pkg(void) if (write(fd, buf, r) != r) { warn("write()"); - goto cleanup; + goto fetchfail; } done += r; @@ -240,7 +249,558 @@ bootstrap_pkg(void) if (ferror(remote)) goto fetchfail; - if ((ret = extract_pkg_static(fd, pkgstatic, MAXPATHLEN)) == 0) + goto cleanup; + +fetchfail: + if (fd != -1) { + close(fd); + fd = -1; + unlink(path); + } + +cleanup: + if (remote != NULL) + fclose(remote); + + return fd; +} + +static struct fingerprint * +parse_fingerprint(yaml_document_t *doc, yaml_node_t *node) +{ + yaml_node_pair_t *pair; + yaml_char_t *function, *fp; + struct fingerprint *f; + hash_t fct = HASH_UNKNOWN; + + function = fp = NULL; + + pair = node->data.mapping.pairs.start; + while (pair < node->data.mapping.pairs.top) { + yaml_node_t *key = yaml_document_get_node(doc, pair->key); + yaml_node_t *val = yaml_document_get_node(doc, pair->value); + + if (key->data.scalar.length <= 0) { + ++pair; + continue; + } + + if (val->type != YAML_SCALAR_NODE) { + ++pair; + continue; + } + + if (strcasecmp(key->data.scalar.value, "function") == 0) + function = val->data.scalar.value; + else if (strcasecmp(key->data.scalar.value, "fingerprint") + == 0) + fp = val->data.scalar.value; + + ++pair; + continue; + } + + if (fp == NULL || function == NULL) + return (NULL); + + if (strcasecmp(function, "sha256") == 0) + fct = HASH_SHA256; + + if (fct == HASH_UNKNOWN) { + fprintf(stderr, "Unsupported hashing function: %s\n", function); + return (NULL); + } + + f = calloc(1, sizeof(struct fingerprint)); + f->type = fct; + strlcpy(f->hash, fp, sizeof(f->hash)); + + return (f); +} + +static void +free_fingerprint_list(struct fingerprint_list* list) +{ + struct fingerprint* fingerprint; + + STAILQ_FOREACH(fingerprint, list, next) { + if (fingerprint->name) + free(fingerprint->name); + free(fingerprint); + } + free(list); +} + +static struct fingerprint * +load_fingerprint(const char *dir, const char *filename) +{ + yaml_parser_t parser; + yaml_document_t doc; + yaml_node_t *node; + FILE *fp; + struct fingerprint *f; + char path[MAXPATHLEN]; + + f = NULL; + + snprintf(path, MAXPATHLEN, "%s/%s", dir, filename); + + if ((fp = fopen(path, "r")) == NULL) + return (NULL); + + yaml_parser_initialize(&parser); + yaml_parser_set_input_file(&parser, fp); + yaml_parser_load(&parser, &doc); + + node = yaml_document_get_root_node(&doc); + if (node == NULL || node->type != YAML_MAPPING_NODE) + goto out; + + f = parse_fingerprint(&doc, node); + f->name = strdup(filename); + +out: + yaml_document_delete(&doc); + yaml_parser_delete(&parser); + fclose(fp); + + return (f); +} + +static struct fingerprint_list * +load_fingerprints(const char *path, int *count) +{ + DIR *d; + struct dirent *ent; + struct fingerprint *finger; + struct fingerprint_list *fingerprints; + + *count = 0; + + fingerprints = calloc(1, sizeof(struct fingerprint_list)); + if (fingerprints == NULL) + return (NULL); + STAILQ_INIT(fingerprints); + + if ((d = opendir(path)) == NULL) + return (NULL); + + while ((ent = readdir(d))) { + if (strcmp(ent->d_name, ".") == 0 || + strcmp(ent->d_name, "..") == 0) + continue; + finger = load_fingerprint(path, ent->d_name); + if (finger != NULL) { + STAILQ_INSERT_TAIL(fingerprints, finger, next); + ++(*count); + } + } + + closedir(d); + + return (fingerprints); +} + +static void +sha256_hash(unsigned char hash[SHA256_DIGEST_LENGTH], + char out[SHA256_DIGEST_LENGTH * 2 + 1]) +{ + int i; + + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + sprintf(out + (i * 2), "%02x", hash[i]); + + out[SHA256_DIGEST_LENGTH * 2] = '\0'; +} + +static void +sha256_buf(char *buf, size_t len, char out[SHA256_DIGEST_LENGTH * 2 + 1]) +{ + unsigned char hash[SHA256_DIGEST_LENGTH]; + SHA256_CTX sha256; + + out[0] = '\0'; + + SHA256_Init(&sha256); + SHA256_Update(&sha256, buf, len); + SHA256_Final(hash, &sha256); + sha256_hash(hash, out); +} + +static int +sha256_fd(int fd, char out[SHA256_DIGEST_LENGTH * 2 + 1]) +{ + int my_fd; + FILE *fp; + char buffer[BUFSIZ]; + unsigned char hash[SHA256_DIGEST_LENGTH]; + size_t r; + int ret; + SHA256_CTX sha256; + + my_fd = -1; + fp = NULL; + r = 0; + ret = 1; + + out[0] = '\0'; + + /* Duplicate the fd so that fclose(3) does not close it. */ + if ((my_fd = dup(fd)) == -1) { + warnx("dup"); + goto cleanup; + } + + if ((fp = fdopen(my_fd, "rb")) == NULL) { + warnx("fdopen"); + goto cleanup; + } + + SHA256_Init(&sha256); + + while ((r = fread(buffer, 1, BUFSIZ, fp)) > 0) + SHA256_Update(&sha256, buffer, r); + + if (ferror(fp) != 0) { + warnx("fread"); + goto cleanup; + } + + SHA256_Final(hash, &sha256); + sha256_hash(hash, out); + ret = 0; + +cleanup: + if (fp != NULL) + fclose(fp); + else if (my_fd != -1) + close(my_fd); + (void)lseek(fd, 0, SEEK_SET); + + return (ret); +} + +static EVP_PKEY * +load_public_key_buf(const unsigned char *cert, int certlen) +{ + EVP_PKEY *pkey; + BIO *bp; + char errbuf[1024]; + + bp = BIO_new_mem_buf(__DECONST(void *, cert), certlen); + + if ((pkey = PEM_read_bio_PUBKEY(bp, NULL, NULL, NULL)) == NULL) + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + + BIO_free(bp); + + return (pkey); +} + +static bool +rsa_verify_cert(int fd, const unsigned char *key, int keylen, + unsigned char *sig, int siglen) +{ + EVP_MD_CTX *mdctx; + EVP_PKEY *pkey; + char sha256[(SHA256_DIGEST_LENGTH * 2) + 2]; + char errbuf[1024]; + bool ret; + + pkey = NULL; + mdctx = NULL; + ret = false; + + /* Compute SHA256 of the package. */ + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + goto cleanup; + } + if ((sha256_fd(fd, sha256)) == -1) { + warnx("Error creating SHA256 hash for package"); + goto cleanup; + } + + if ((pkey = load_public_key_buf(key, keylen)) == NULL) { + warnx("Error reading public key"); + goto cleanup; + } + + /* Verify signature of the SHA256(pkg) is valid. */ + if ((mdctx = EVP_MD_CTX_create()) == NULL) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + + if (EVP_DigestVerifyInit(mdctx, NULL, EVP_sha256(), NULL, pkey) != 1) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + if (EVP_DigestVerifyUpdate(mdctx, sha256, strlen(sha256)) != 1) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + + if (EVP_DigestVerifyFinal(mdctx, sig, siglen) != 1) { + warnx("%s", ERR_error_string(ERR_get_error(), errbuf)); + goto error; + } + + ret = true; + printf("done\n"); + goto cleanup; + +error: + printf("failed\n"); + +cleanup: + if (pkey) + EVP_PKEY_free(pkey); + if (mdctx) + EVP_MD_CTX_destroy(mdctx); + ERR_free_strings(); + + return (ret); +} + +static struct sig_cert * +parse_cert(int fd) { + int my_fd; + struct sig_cert *sc; + FILE *fp; + struct sbuf *buf, *sig, *cert; + char *line; + size_t linecap; + ssize_t linelen; + + buf = NULL; + my_fd = -1; + sc = NULL; + line = NULL; + linecap = 0; + + if (lseek(fd, 0, 0) == -1) { + warn("lseek"); + return (NULL); + } + + /* Duplicate the fd so that fclose(3) does not close it. */ + if ((my_fd = dup(fd)) == -1) { + warnx("dup"); + return (NULL); + } + + if ((fp = fdopen(my_fd, "rb")) == NULL) { + warn("fdopen"); + close(my_fd); + return (NULL); + } + + sig = sbuf_new_auto(); + cert = sbuf_new_auto(); + + while ((linelen = getline(&line, &linecap, fp)) > 0) { + if (strcmp(line, "SIGNATURE\n") == 0) { + buf = sig; + continue; + } else if (strcmp(line, "CERT\n") == 0) { + buf = cert; + continue; + } else if (strcmp(line, "END\n") == 0) { + break; + } + if (buf != NULL) + sbuf_bcat(buf, line, linelen); + } + + fclose(fp); + + /* Trim out unrelated trailing newline */ + sbuf_setpos(sig, sbuf_len(sig) - 1); + + sbuf_finish(sig); + sbuf_finish(cert); + + sc = calloc(1, sizeof(struct sig_cert)); + sc->siglen = sbuf_len(sig); + sc->sig = calloc(1, sc->siglen); + memcpy(sc->sig, sbuf_data(sig), sc->siglen); + + sc->certlen = sbuf_len(cert); + sc->cert = strdup(sbuf_data(cert)); + + sbuf_delete(sig); + sbuf_delete(cert); + + return (sc); +} + +static bool +verify_signature(int fd_pkg, int fd_sig) +{ + struct fingerprint_list *trusted, *revoked; + struct fingerprint *fingerprint; + struct sig_cert *sc; + bool ret; + int trusted_count, revoked_count; + const char *fingerprints; + char path[MAXPATHLEN]; + char hash[SHA256_DIGEST_LENGTH * 2 + 1]; + + sc = NULL; + trusted = revoked = NULL; + ret = false; + + /* Read and parse fingerprints. */ + if (config_string(FINGERPRINTS, &fingerprints) != 0) { + warnx("No CONFIG_FINGERPRINTS defined"); + goto cleanup; + } + + snprintf(path, MAXPATHLEN, "%s/trusted", fingerprints); + if ((trusted = load_fingerprints(path, &trusted_count)) == NULL) { + warnx("Error loading trusted certificates"); + goto cleanup; + } + + if (trusted_count == 0 || trusted == NULL) { + fprintf(stderr, "No trusted certificates found.\n"); + goto cleanup; + } + + snprintf(path, MAXPATHLEN, "%s/revoked", fingerprints); + if ((revoked = load_fingerprints(path, &revoked_count)) == NULL) { + warnx("Error loading revoked certificates"); + goto cleanup; + } + + /* Read certificate and signature in. */ + if ((sc = parse_cert(fd_sig)) == NULL) { + warnx("Error parsing certificate"); + goto cleanup; + } + /* Explicitly mark as non-trusted until proven otherwise. */ + sc->trusted = false; + + /* Parse signature and pubkey out of the certificate */ + sha256_buf(sc->cert, sc->certlen, hash); + + /* Check if this hash is revoked */ + if (revoked != NULL) { + STAILQ_FOREACH(fingerprint, revoked, next) { + if (strcasecmp(fingerprint->hash, hash) == 0) { + fprintf(stderr, "The package was signed with " + "revoked certificate %s\n", + fingerprint->name); + goto cleanup; + } + } + } + + STAILQ_FOREACH(fingerprint, trusted, next) { + if (strcasecmp(fingerprint->hash, hash) == 0) { + sc->trusted = true; + sc->name = strdup(fingerprint->name); + break; + } + } + + if (sc->trusted == false) { + fprintf(stderr, "No trusted fingerprint found matching " + "package's certificate\n"); + goto cleanup; + } + + /* Verify the signature. */ + printf("Verifying signature with trusted certificate %s... ", sc->name); + if (rsa_verify_cert(fd_pkg, sc->cert, sc->certlen, sc->sig, + sc->siglen) == false) { + fprintf(stderr, "Signature is not valid\n"); + goto cleanup; + } + + ret = true; + +cleanup: + if (trusted) + free_fingerprint_list(trusted); + if (revoked) + free_fingerprint_list(revoked); + if (sc) { + if (sc->cert) + free(sc->cert); + if (sc->sig) + free(sc->sig); + if (sc->name) + free(sc->name); + free(sc); + } + + return (ret); +} + +static int +bootstrap_pkg(void) +{ + FILE *config; + int fd_pkg, fd_sig; + int ret; + char *site; + char url[MAXPATHLEN]; + char conf[MAXPATHLEN]; + char tmppkg[MAXPATHLEN]; + char tmpsig[MAXPATHLEN]; + const char *packagesite; + const char *signature_type; + char pkgstatic[MAXPATHLEN]; + + fd_sig = -1; + ret = -1; + config = NULL; + + if (config_string(PACKAGESITE, &packagesite) != 0) { + warnx("No PACKAGESITE defined"); + return (-1); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 18:37:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7B6442B4; Tue, 29 Oct 2013 18:37:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 645212C7C; Tue, 29 Oct 2013 18:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TIbdgW082898; Tue, 29 Oct 2013 18:37:39 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TIbdtC082897; Tue, 29 Oct 2013 18:37:39 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291837.r9TIbdtC082897@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 18:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257354 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 18:37:39 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 18:37:38 2013 New Revision: 257354 URL: http://svnweb.freebsd.org/changeset/base/257354 Log: MFC r257151: Document /var/cache/pkg into hier(7) which pkg(8) uses. Approved by: bapt Approved by: re (glebius) Modified: stable/10/share/man/man7/hier.7 Directory Properties: stable/10/share/man/man7/ (props changed) Modified: stable/10/share/man/man7/hier.7 ============================================================================== --- stable/10/share/man/man7/hier.7 Tue Oct 29 18:36:44 2013 (r257353) +++ stable/10/share/man/man7/hier.7 Tue Oct 29 18:37:38 2013 (r257354) @@ -729,6 +729,14 @@ directory containing output spool files .Pp .It Pa backups/ miscellaneous backup files +.It Pa cache/ +miscellaneous cached files +.Bl -tag -width ".Pa pkg/" -compact +.It Pa pkg/ +cached packages for +.Xr pkg 8 +.El +.Pp .It Pa crash/ default directory to store kernel crash dumps; see .Xr crash 8 From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 18:45:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A05F16BD; Tue, 29 Oct 2013 18:45:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B98E2D14; Tue, 29 Oct 2013 18:45:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TIjmbT085999; Tue, 29 Oct 2013 18:45:48 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TIjmne085998; Tue, 29 Oct 2013 18:45:48 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291845.r9TIjmne085998@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 18:45:48 +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: r257355 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 18:45:48 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 18:45:48 2013 New Revision: 257355 URL: http://svnweb.freebsd.org/changeset/base/257355 Log: MFC r257151: Document /var/cache/pkg into hier(7) which pkg(8) uses. Approved by: bapt Modified: stable/9/share/man/man7/hier.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/hier.7 ============================================================================== --- stable/9/share/man/man7/hier.7 Tue Oct 29 18:37:38 2013 (r257354) +++ stable/9/share/man/man7/hier.7 Tue Oct 29 18:45:48 2013 (r257355) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 21, 2010 +.Dd October 23, 2010 .Dt HIER 7 .Os .Sh NAME @@ -705,6 +705,14 @@ directory containing output spool files .Pp .It Pa backups/ miscellaneous backup files +.It Pa cache/ +miscellaneous cached files +.Bl -tag -width ".Pa pkg/" -compact +.It Pa pkg/ +cached packages for +.Xr pkg 8 +.El +.Pp .It Pa crash/ default directory to store kernel crash dumps; see .Xr crash 8 From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 18:46:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 97E66810; Tue, 29 Oct 2013 18:46:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 849FB2D25; Tue, 29 Oct 2013 18:46:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TIkfVx086192; Tue, 29 Oct 2013 18:46:41 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TIkfQm086191; Tue, 29 Oct 2013 18:46:41 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291846.r9TIkfQm086191@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 18:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257356 - stable/8/share/man/man7 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 18:46:41 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 18:46:41 2013 New Revision: 257356 URL: http://svnweb.freebsd.org/changeset/base/257356 Log: MFC r257151: Document /var/cache/pkg into hier(7) which pkg(8) uses. Approved by: bapt Modified: stable/8/share/man/man7/hier.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/hier.7 ============================================================================== --- stable/8/share/man/man7/hier.7 Tue Oct 29 18:45:48 2013 (r257355) +++ stable/8/share/man/man7/hier.7 Tue Oct 29 18:46:41 2013 (r257356) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 25, 2008 +.Dd October 23, 2013 .Dt HIER 7 .Os .Sh NAME @@ -705,6 +705,14 @@ directory containing output spool files .Pp .It Pa backups/ miscellaneous backup files +.It Pa cache/ +miscellaneous cached files +.Bl -tag -width ".Pa pkg/" -compact +.It Pa pkg/ +cached packages for +.Xr pkg 8 +.El +.Pp .It Pa crash/ default directory to store kernel crash dumps; see .Xr crash 8 From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 18:47:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D350E93F; Tue, 29 Oct 2013 18:47:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFFEB2D2B; Tue, 29 Oct 2013 18:47:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TIl7M4086282; Tue, 29 Oct 2013 18:47:07 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TIl7la086281; Tue, 29 Oct 2013 18:47:07 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310291847.r9TIl7la086281@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Oct 2013 18:47:07 +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: r257357 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 18:47:07 -0000 Author: bdrewery (ports committer) Date: Tue Oct 29 18:47:07 2013 New Revision: 257357 URL: http://svnweb.freebsd.org/changeset/base/257357 Log: Fix Dd from MFCing r257151 Modified: stable/9/share/man/man7/hier.7 Modified: stable/9/share/man/man7/hier.7 ============================================================================== --- stable/9/share/man/man7/hier.7 Tue Oct 29 18:46:41 2013 (r257356) +++ stable/9/share/man/man7/hier.7 Tue Oct 29 18:47:07 2013 (r257357) @@ -32,7 +32,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 23, 2010 +.Dd October 23, 2013 .Dt HIER 7 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 19:21:33 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2589AFD; Tue, 29 Oct 2013 19:21:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id DB67A2F11; Tue, 29 Oct 2013 19:21:32 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 01E7B422219; Wed, 30 Oct 2013 05:54:31 +1100 (EST) Date: Wed, 30 Oct 2013 05:54:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston Subject: Re: svn commit: r257298 - head/lib/libproc In-Reply-To: <20131029152905.GA2652@charmander.sandvine.com> Message-ID: <20131030055021.H2325@besplex.bde.org> References: <201310290312.r9T3CVx4064237@svn.freebsd.org> <20131029235717.M905@besplex.bde.org> <20131029152905.GA2652@charmander.sandvine.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=OlY6O5FfQTkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=c1kkC1SkZDMA:10 a=7B3j6aZmG816uNN3KPIA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 19:21:33 -0000 On Tue, 29 Oct 2013, Mark Johnston wrote: > On Wed, Oct 30, 2013 at 12:21:28AM +1100, Bruce Evans wrote: >> On Tue, 29 Oct 2013, Mark Johnston wrote: >> >>> Log: >>> Revert r257248 and fix the problem in a way that doesn't violate style(9). >> >> Why did gcc complain about the original version? > > It looks like this is because of the use of -W, which is apparently an > alias for -Wextra; according to the gcc man page, this will trigger a > warning when "an empty body occurs in an if or else statement." Thanks. I have -W in some CFLAGS but never noticed this behaviour before. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 19:50:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3FD82D09; Tue, 29 Oct 2013 19:50:41 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDAC212A; Tue, 29 Oct 2013 19:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TJofNM007986; Tue, 29 Oct 2013 19:50:41 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TJofXk007985; Tue, 29 Oct 2013 19:50:41 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201310291950.r9TJofXk007985@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 29 Oct 2013 19:50:41 +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: r257358 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 19:50:41 -0000 Author: dumbbell Date: Tue Oct 29 19:50:40 2013 New Revision: 257358 URL: http://svnweb.freebsd.org/changeset/base/257358 Log: MFC r256771: drm/radeon: radeonkms depends on firmware(9) Submitted by: tijl@ Approved by: re (kib) Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_drv.c Tue Oct 29 18:47:07 2013 (r257357) +++ stable/10/sys/dev/drm2/radeon/radeon_drv.c Tue Oct 29 19:50:40 2013 (r257358) @@ -512,3 +512,4 @@ MODULE_DEPEND(radeonkms, agp, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1); MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); +MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:04:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6005B944; Tue, 29 Oct 2013 20:04:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5112275; Tue, 29 Oct 2013 20:04:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TK4pSe013938; Tue, 29 Oct 2013 20:04:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TK4pQA013936; Tue, 29 Oct 2013 20:04:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201310292004.r9TK4pQA013936@svn.freebsd.org> From: Michael Tuexen Date: Tue, 29 Oct 2013 20:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257359 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:04:51 -0000 Author: tuexen Date: Tue Oct 29 20:04:50 2013 New Revision: 257359 URL: http://svnweb.freebsd.org/changeset/base/257359 Log: Terminate a debug output with a \n. Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Tue Oct 29 19:50:40 2013 (r257358) +++ head/sys/netinet/sctp_timer.c Tue Oct 29 20:04:50 2013 (r257359) @@ -552,7 +552,7 @@ start_again: TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.TSN_seq)) { /* Strange case our list got out of order? */ - SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x", + SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x\n", (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.TSN_seq); recovery_cnt++; #ifdef INVARIANTS From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:35:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7255C8BF; Tue, 29 Oct 2013 20:35:29 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4E024AE; Tue, 29 Oct 2013 20:35:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKZT6j024603; Tue, 29 Oct 2013 20:35:29 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKZTIG024601; Tue, 29 Oct 2013 20:35:29 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310292035.r9TKZTIG024601@svn.freebsd.org> From: Sean Bruno Date: Tue, 29 Oct 2013 20:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257360 - in head/contrib/binutils/gas: . config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:35:29 -0000 Author: sbruno Date: Tue Oct 29 20:35:28 2013 New Revision: 257360 URL: http://svnweb.freebsd.org/changeset/base/257360 Log: Queisce warning about empty bodies in these loops by bumping the ;; to the next line. Modified: head/contrib/binutils/gas/config/atof-ieee.c head/contrib/binutils/gas/symbols.c Modified: head/contrib/binutils/gas/config/atof-ieee.c ============================================================================== --- head/contrib/binutils/gas/config/atof-ieee.c Tue Oct 29 20:04:50 2013 (r257359) +++ head/contrib/binutils/gas/config/atof-ieee.c Tue Oct 29 20:35:28 2013 (r257360) @@ -420,7 +420,8 @@ gen_to_words (LITTLENUM_TYPE *words, int - generic_floating_point_number.low); /* Seek (and forget) 1st significant bit. */ - for (exponent_skippage = 0; !next_bits (1); ++exponent_skippage);; + for (exponent_skippage = 0; !next_bits (1); ++exponent_skippage) + ;; exponent_1 = (generic_floating_point_number.exponent + generic_floating_point_number.leader + 1 Modified: head/contrib/binutils/gas/symbols.c ============================================================================== --- head/contrib/binutils/gas/symbols.c Tue Oct 29 20:04:50 2013 (r257359) +++ head/contrib/binutils/gas/symbols.c Tue Oct 29 20:35:28 2013 (r257360) @@ -1666,7 +1666,8 @@ dollar_label_name (register long n, /* w *q = i % 10 + '0'; i /= 10; } - while ((*p++ = *--q) != '\0');; + while ((*p++ = *--q) != '\0') + ;; /* The label, as a '\0' ended string, starts at symbol_name_build. */ return symbol_name_build; @@ -1837,7 +1838,8 @@ fb_label_name (long n, /* We just saw "n *q = i % 10 + '0'; i /= 10; } - while ((*p++ = *--q) != '\0');; + while ((*p++ = *--q) != '\0') + ;; /* The label, as a '\0' ended string, starts at symbol_name_build. */ return (symbol_name_build); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:35:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DFE7C983; Tue, 29 Oct 2013 20:35:35 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 91B6C24AF; Tue, 29 Oct 2013 20:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKZZiE024649; Tue, 29 Oct 2013 20:35:35 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKZZ09024648; Tue, 29 Oct 2013 20:35:35 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201310292035.r9TKZZ09024648@svn.freebsd.org> From: Jeremie Le Hen Date: Tue, 29 Oct 2013 20:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257361 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:35:36 -0000 Author: jlh Date: Tue Oct 29 20:35:35 2013 New Revision: 257361 URL: http://svnweb.freebsd.org/changeset/base/257361 Log: Fix compatibility function for old daily_status_security_${name}_enable variable PR: conf/183137 Reported by: Adam McDougall MFC after: 3 days Modified: head/etc/defaults/periodic.conf Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Oct 29 20:35:28 2013 (r257360) +++ head/etc/defaults/periodic.conf Tue Oct 29 20:35:35 2013 (r257361) @@ -319,7 +319,7 @@ if [ -z "${source_periodic_confs_defined security_daily_compat_var() { local var=$1 dailyvar value - dailyvar=daily_status_security${#status_security} + dailyvar=daily_status_security${var#security_status} periodvar=${var%enable}period eval value=\"\$$dailyvar\" [ -z "$value" ] && return @@ -331,7 +331,7 @@ if [ -z "${source_periodic_confs_defined $periodvar=daily ;; *) - $var="$value" + eval $var=\"$value\" ;; esac } From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:36:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A02A0B32; Tue, 29 Oct 2013 20:36:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C3AE24B8; Tue, 29 Oct 2013 20:36:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKa4bl024748; Tue, 29 Oct 2013 20:36:04 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKa4gm024747; Tue, 29 Oct 2013 20:36:04 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310292036.r9TKa4gm024747@svn.freebsd.org> From: Sean Bruno Date: Tue, 29 Oct 2013 20:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257362 - head/contrib/gcclibs/libssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:36:04 -0000 Author: sbruno Date: Tue Oct 29 20:36:04 2013 New Revision: 257362 URL: http://svnweb.freebsd.org/changeset/base/257362 Log: Quiesce warning by including appropriate header file Modified: head/contrib/gcclibs/libssp/ssp.c Modified: head/contrib/gcclibs/libssp/ssp.c ============================================================================== --- head/contrib/gcclibs/libssp/ssp.c Tue Oct 29 20:35:35 2013 (r257361) +++ head/contrib/gcclibs/libssp/ssp.c Tue Oct 29 20:36:04 2013 (r257362) @@ -56,6 +56,8 @@ Software Foundation, 51 Franklin Street, # include #endif +#include + void *__stack_chk_guard = 0; static void __attribute__ ((constructor)) From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:38:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 458F6CAA; Tue, 29 Oct 2013 20:38:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 180F324D2; Tue, 29 Oct 2013 20:38:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKc0um024997; Tue, 29 Oct 2013 20:38:00 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKc0IM024996; Tue, 29 Oct 2013 20:38:00 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310292038.r9TKc0IM024996@svn.freebsd.org> From: Sean Bruno Date: Tue, 29 Oct 2013 20:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257363 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:38:01 -0000 Author: sbruno Date: Tue Oct 29 20:38:00 2013 New Revision: 257363 URL: http://svnweb.freebsd.org/changeset/base/257363 Log: Queisce sign errors by using unsigned char * and casting MAP_FAILED as unsigned char * Reviewed by: brooks@ Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Tue Oct 29 20:36:04 2013 (r257362) +++ head/usr.bin/xinstall/xinstall.c Tue Oct 29 20:38:00 2013 (r257363) @@ -1002,7 +1002,7 @@ compare(int from_fd, const char *from_na int to_fd, const char *to_name __unused, size_t to_len, char **dresp) { - char *p, *q; + unsigned char *p, *q; int rv; int done_compare; DIGEST_CTX ctx; @@ -1018,11 +1018,11 @@ compare(int from_fd, const char *from_na if (trymmap(from_fd) && trymmap(to_fd)) { p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, from_fd, (off_t)0); - if (p == (char *)MAP_FAILED) + if (p == (unsigned char *)MAP_FAILED) goto out; q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, to_fd, (off_t)0); - if (q == (char *)MAP_FAILED) { + if (q == (unsigned char *)MAP_FAILED) { munmap(p, from_len); goto out; } @@ -1036,7 +1036,7 @@ compare(int from_fd, const char *from_na } out: if (!done_compare) { - char buf1[MAXBSIZE]; + unsigned char buf1[MAXBSIZE]; char buf2[MAXBSIZE]; int n1, n2; @@ -1146,7 +1146,8 @@ copy(int from_fd, const char *from_name, { int nr, nw; int serrno; - char *p, buf[MAXBSIZE]; + unsigned char *p; + unsigned char buf[MAXBSIZE]; int done_copy; DIGEST_CTX ctx; @@ -1166,7 +1167,7 @@ copy(int from_fd, const char *from_name, done_copy = 0; if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, - from_fd, (off_t)0)) != (char *)MAP_FAILED) { + from_fd, (off_t)0)) != (unsigned char *)MAP_FAILED) { nw = write(to_fd, p, size); if (nw != size) { serrno = errno; From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:38:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 223BCDE8; Tue, 29 Oct 2013 20:38:20 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED8C24DB; Tue, 29 Oct 2013 20:38:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKcJbO025188; Tue, 29 Oct 2013 20:38:19 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKcJZi025187; Tue, 29 Oct 2013 20:38:19 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201310292038.r9TKcJZi025187@svn.freebsd.org> From: Jeremie Le Hen Date: Tue, 29 Oct 2013 20:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257364 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:38:20 -0000 Author: jlh Date: Tue Oct 29 20:38:19 2013 New Revision: 257364 URL: http://svnweb.freebsd.org/changeset/base/257364 Log: Fix indentation. MFC after: 4 days Modified: head/etc/defaults/periodic.conf Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Oct 29 20:38:00 2013 (r257363) +++ head/etc/defaults/periodic.conf Tue Oct 29 20:38:19 2013 (r257364) @@ -331,7 +331,7 @@ if [ -z "${source_periodic_confs_defined $periodvar=daily ;; *) - eval $var=\"$value\" + eval $var=\"$value\" ;; esac } From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:38:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE44178; Tue, 29 Oct 2013 20:38:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE1C24E8; Tue, 29 Oct 2013 20:38:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKcxJ8025290; Tue, 29 Oct 2013 20:38:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKcxoC025287; Tue, 29 Oct 2013 20:38:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310292038.r9TKcxoC025287@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 20:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257365 - in head/sys/mips: mips nlm rmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:38:59 -0000 Author: nwhitehorn Date: Tue Oct 29 20:38:58 2013 New Revision: 257365 URL: http://svnweb.freebsd.org/changeset/base/257365 Log: Panics about how things can't be attached should probably happen in the attach method rather than probe. Submitted by: brooks Modified: head/sys/mips/mips/tick.c head/sys/mips/nlm/tick.c head/sys/mips/rmi/tick.c Modified: head/sys/mips/mips/tick.c ============================================================================== --- head/sys/mips/mips/tick.c Tue Oct 29 20:38:19 2013 (r257364) +++ head/sys/mips/mips/tick.c Tue Oct 29 20:38:58 2013 (r257365) @@ -309,9 +309,6 @@ static int clock_probe(device_t dev) { - if (device_get_unit(dev) != 0) - panic("can't attach more clocks"); - device_set_desc(dev, "Generic MIPS32 ticker"); return (BUS_PROBE_NOWILDCARD); } @@ -329,6 +326,9 @@ clock_attach(device_t dev) struct clock_softc *sc; int error; + if (device_get_unit(dev) != 0) + panic("can't attach more clocks"); + softc = sc = device_get_softc(dev); sc->intr_rid = 0; sc->intr_res = bus_alloc_resource(dev, Modified: head/sys/mips/nlm/tick.c ============================================================================== --- head/sys/mips/nlm/tick.c Tue Oct 29 20:38:19 2013 (r257364) +++ head/sys/mips/nlm/tick.c Tue Oct 29 20:38:58 2013 (r257365) @@ -314,9 +314,6 @@ static int clock_probe(device_t dev) { - if (device_get_unit(dev) != 0) - panic("can't attach more clocks"); - device_set_desc(dev, "Generic MIPS32 ticker"); return (BUS_PROBE_NOWILDCARD); } @@ -333,6 +330,9 @@ clock_attach(device_t dev) { struct clock_softc *sc; + if (device_get_unit(dev) != 0) + panic("can't attach more clocks"); + softc = sc = device_get_softc(dev); cpu_establish_hardintr("compare", clock_intr, NULL, sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler); Modified: head/sys/mips/rmi/tick.c ============================================================================== --- head/sys/mips/rmi/tick.c Tue Oct 29 20:38:19 2013 (r257364) +++ head/sys/mips/rmi/tick.c Tue Oct 29 20:38:58 2013 (r257365) @@ -311,9 +311,6 @@ static int clock_probe(device_t dev) { - if (device_get_unit(dev) != 0) - panic("can't attach more clocks"); - device_set_desc(dev, "Generic MIPS32 ticker"); return (BUS_PROBE_NOWILDCARD); } @@ -330,6 +327,9 @@ clock_attach(device_t dev) { struct clock_softc *sc; + if (device_get_unit(dev) != 0) + panic("can't attach more clocks"); + softc = sc = device_get_softc(dev); cpu_establish_hardintr("compare", clock_intr, NULL, sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 20:53:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 19648DED; Tue, 29 Oct 2013 20:53:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA04C2667; Tue, 29 Oct 2013 20:53:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKrA6d031545; Tue, 29 Oct 2013 20:53:10 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKr9TH031534; Tue, 29 Oct 2013 20:53:09 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310292053.r9TKr9TH031534@svn.freebsd.org> From: Sean Bruno Date: Tue, 29 Oct 2013 20:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257366 - head/contrib/libreadline X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 20:53:11 -0000 Author: sbruno Date: Tue Oct 29 20:53:09 2013 New Revision: 257366 URL: http://svnweb.freebsd.org/changeset/base/257366 Log: Quiesce warnings regarding assignement of loop conditionals by implementing the solution from the compiler to wrap the statement in parens. Modified: head/contrib/libreadline/bind.c head/contrib/libreadline/complete.c head/contrib/libreadline/histexpand.c head/contrib/libreadline/history.c head/contrib/libreadline/input.c head/contrib/libreadline/tilde.c Modified: head/contrib/libreadline/bind.c ============================================================================== --- head/contrib/libreadline/bind.c Tue Oct 29 20:38:58 2013 (r257365) +++ head/contrib/libreadline/bind.c Tue Oct 29 20:53:09 2013 (r257366) @@ -442,7 +442,7 @@ rl_translate_keyseq (seq, array, len) { register int i, c, l, temp; - for (i = l = 0; c = seq[i]; i++) + for (i = l = 0; (c = seq[i]); i++) { if (c == '\\') { @@ -1185,7 +1185,7 @@ rl_parse_and_bind (string) { int passc = 0; - for (i = 1; c = string[i]; i++) + for (i = 1; (c = string[i]); i++) { if (passc) { @@ -1276,7 +1276,7 @@ rl_parse_and_bind (string) int delimiter, passc; delimiter = string[i++]; - for (passc = 0; c = string[i]; i++) + for (passc = 0; (c = string[i]); i++) { if (passc) { @@ -2048,7 +2048,7 @@ rl_function_dumper (print_readably) fprintf (rl_outstream, "\n"); - for (i = 0; name = names[i]; i++) + for (i = 0; (name = names[i]); i++) { rl_command_func_t *function; char **invokers; Modified: head/contrib/libreadline/complete.c ============================================================================== --- head/contrib/libreadline/complete.c Tue Oct 29 20:38:58 2013 (r257365) +++ head/contrib/libreadline/complete.c Tue Oct 29 20:53:09 2013 (r257366) @@ -884,7 +884,7 @@ _rl_find_completion_word (fp, dp) /* We didn't find an unclosed quoted substring upon which to do completion, so use the word break characters to find the substring on which to complete. */ - while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) + while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))) { scan = rl_line_buffer[rl_point]; @@ -1803,7 +1803,7 @@ rl_completion_matches (text, entry_funct match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); match_list[1] = (char *)NULL; - while (string = (*entry_function) (text, matches)) + while ((string = (*entry_function) (text, matches))) { if (matches + 1 == match_list_size) match_list = (char **)xrealloc @@ -1854,7 +1854,7 @@ rl_username_completion_function (text, s } #if defined (HAVE_GETPWENT) - while (entry = getpwent ()) + while ((entry = getpwent ())) { /* Null usernames should result in all users as possible completions. */ if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) Modified: head/contrib/libreadline/histexpand.c ============================================================================== --- head/contrib/libreadline/histexpand.c Tue Oct 29 20:38:58 2013 (r257365) +++ head/contrib/libreadline/histexpand.c Tue Oct 29 20:53:09 2013 (r257366) @@ -203,7 +203,7 @@ get_history_event (string, caller_index, } /* Only a closing `?' or a newline delimit a substring search string. */ - for (local_index = i; c = string[i]; i++) + for (local_index = i; (c = string[i]); i++) { #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) Modified: head/contrib/libreadline/history.c ============================================================================== --- head/contrib/libreadline/history.c Tue Oct 29 20:38:58 2013 (r257365) +++ head/contrib/libreadline/history.c Tue Oct 29 20:53:09 2013 (r257366) @@ -306,7 +306,7 @@ add_history (string) } } - temp = alloc_history_entry (string, hist_inittime ()); + temp = alloc_history_entry ((char *)string, hist_inittime ()); the_history[history_length] = (HIST_ENTRY *)NULL; the_history[history_length - 1] = temp; Modified: head/contrib/libreadline/input.c ============================================================================== --- head/contrib/libreadline/input.c Tue Oct 29 20:38:58 2013 (r257365) +++ head/contrib/libreadline/input.c Tue Oct 29 20:53:09 2013 (r257366) @@ -428,7 +428,7 @@ rl_read_key () else { /* If input is coming from a macro, then use that. */ - if (c = _rl_next_macro_key ()) + if ((c = _rl_next_macro_key ())) return (c); /* If the user has an event function, then call it periodically. */ Modified: head/contrib/libreadline/tilde.c ============================================================================== --- head/contrib/libreadline/tilde.c Tue Oct 29 20:38:58 2013 (r257365) +++ head/contrib/libreadline/tilde.c Tue Oct 29 20:53:09 2013 (r257366) @@ -196,7 +196,7 @@ tilde_expand (string) int result_size, result_index; result_index = result_size = 0; - if (result = strchr (string, '~')) + if ((result = strchr (string, '~'))) result = (char *)xmalloc (result_size = (strlen (string) + 16)); else result = (char *)xmalloc (result_size = (strlen (string) + 1)); From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 21:00:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0E2222CE; Tue, 29 Oct 2013 21:00:55 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D49A4270B; Tue, 29 Oct 2013 21:00:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TL0sRL034735; Tue, 29 Oct 2013 21:00:54 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TL0sRR034734; Tue, 29 Oct 2013 21:00:54 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310292100.r9TL0sRR034734@svn.freebsd.org> From: Andre Oppermann Date: Tue, 29 Oct 2013 21:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257367 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 21:00:55 -0000 Author: andre Date: Tue Oct 29 21:00:54 2013 New Revision: 257367 URL: http://svnweb.freebsd.org/changeset/base/257367 Log: MFC r256920: The TCP delayed ACK logic isn't aware of LRO passing up large aggregated segments thinking it received only one segment. This causes it to enable the delay the ACK for 100ms to wait for another segment which may never come because all the data was received already. Doing delayed ACK for LRO segments is bogus for two reasons: a) it pushes us further away from acking every other packet; b) it introduces additional delay in responding to the sender. The latter is especially bad because it is in the nature of LRO to aggregated all segments of a burst with no more coming until an ACK is sent back. Change the delayed ACK logic to detect LRO segments by being larger than the MSS for this connection and issuing an immediate ACK for them to keep the ACK clock ticking without interruption. Reported by: julian, cperciva Tested by: cperciva Reviewed by: lstewart Approved by: re (glebius) Modified: stable/10/sys/netinet/tcp_input.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Tue Oct 29 20:53:09 2013 (r257366) +++ stable/10/sys/netinet/tcp_input.c Tue Oct 29 21:00:54 2013 (r257367) @@ -508,10 +508,13 @@ do { \ * the ack that opens up a 0-sized window and * - delayed acks are enabled or * - this is a half-synchronized T/TCP connection. + * - the segment size is not larger than the MSS and LRO wasn't used + * for this segment. */ -#define DELAY_ACK(tp) \ +#define DELAY_ACK(tp, tlen) \ ((!tcp_timer_active(tp, TT_DELACK) && \ (tp->t_flags & TF_RXWIN0SENT) == 0) && \ + (tlen <= tp->t_maxopd) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) /* @@ -1863,7 +1866,7 @@ tcp_do_segment(struct mbuf *m, struct tc } /* NB: sorwakeup_locked() does an implicit unlock. */ sorwakeup_locked(so); - if (DELAY_ACK(tp)) { + if (DELAY_ACK(tp, tlen)) { tp->t_flags |= TF_DELACK; } else { tp->t_flags |= TF_ACKNOW; @@ -1954,7 +1957,7 @@ tcp_do_segment(struct mbuf *m, struct tc * If there's data, delay ACK; if there's also a FIN * ACKNOW will be turned on later. */ - if (DELAY_ACK(tp) && tlen != 0) + if (DELAY_ACK(tp, tlen) && tlen != 0) tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); else @@ -2926,7 +2929,7 @@ dodata: /* XXX */ if (th->th_seq == tp->rcv_nxt && LIST_EMPTY(&tp->t_segq) && TCPS_HAVEESTABLISHED(tp->t_state)) { - if (DELAY_ACK(tp)) + if (DELAY_ACK(tp, tlen)) tp->t_flags |= TF_DELACK; else tp->t_flags |= TF_ACKNOW; From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 21:07:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0B117C4; Tue, 29 Oct 2013 21:07:28 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ob0-x22f.google.com (mail-ob0-x22f.google.com [IPv6:2607:f8b0:4003:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AAFA278D; Tue, 29 Oct 2013 21:07:28 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id wm4so529342obc.20 for ; Tue, 29 Oct 2013 14:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Tg1KCW9DmhQco0ovmeM5aG5VaB4xFHMIrCTnClLNQPg=; b=Wj9ruTh8grXwNvzy46Iz9TiW3NFoqOCy+SeRCb7vCYE7P85kBEU0rW9TeMAAiyobYE NgA8p4Yp6eIo5Bdf0++i2GxNCwHwzFWlFZgtkZW20J9CIqO9UPTxLyo7YRboAdmrFaWy jjc72HcQFWMpgd1Zo8hGh8vNY1zMmSCVr0gRjgPKquYc5C+23vtJtSAoqDqBiR2xLRIb Qp2spYG846ThRDvaY7iz7i/XDBBGXR6tylpYv7mkSFNVXaAG5Y+EY8vfCQFDZsftuJzY xrKzNEoPssgnQPy9Zd/s6q3sRB8yG2gVAWjUnSMihr+G3KylYUswBiq4U4EinyrerEwl a5+A== MIME-Version: 1.0 X-Received: by 10.60.52.1 with SMTP id p1mr1221387oeo.41.1383080847702; Tue, 29 Oct 2013 14:07:27 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.182.110.195 with HTTP; Tue, 29 Oct 2013 14:07:27 -0700 (PDT) In-Reply-To: <201310291746.r9THkR6D065382@svn.freebsd.org> References: <201310291746.r9THkR6D065382@svn.freebsd.org> Date: Tue, 29 Oct 2013 14:07:27 -0700 X-Google-Sender-Auth: nyNstsGq-AffkXIUpMOXUebHRzM Message-ID: Subject: Re: svn commit: r257350 - head From: Matthew Fleming To: Xin LI Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 21:07:29 -0000 On Tue, Oct 29, 2013 at 10:46 AM, Xin LI wrote: > Author: delphij > Date: Tue Oct 29 17:46:26 2013 > New Revision: 257350 > URL: http://svnweb.freebsd.org/changeset/base/257350 > > Log: > In r257079, SRCDIR is pointed to ${.CURDIR} when not set. However, > Makefile.inc1 is being called in sub-make's where make(1) would, > by default, implicitly chdir(2) to ${.OBJDIR} before executing any > targets. This would make some targets, like delete-old, when trying > to derive various variables introduced by change r256921 using > ``make -f Makefile.inc1'' that also rely on SRCDIR to fail. > > This changeset adds an explicit cd ${.CURDIR} before these unwrapped > make calls, making them in line with the other ones that are already > being wrapped with the explicit chdir's. > > Tested by: gjb > MFC after: 5 days > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > > ============================================================================== > --- head/Makefile.inc1 Tue Oct 29 17:38:13 2013 (r257349) > +++ head/Makefile.inc1 Tue Oct 29 17:46:26 2013 (r257350) > @@ -1686,6 +1686,7 @@ delete-old-files: > # argument list will get too long. Using .for/.endfor make "loops" will > make > # the Makefile parser segfault. > @exec 3<&0; \ > + cd ${.CURDIR}; \ > ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ > -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ > Here and below, wouldn't passing -C {.CURDIR} to make be safer? I admit I don't know make that well, so I may be wrong here. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 21:08:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA97EAD1; Tue, 29 Oct 2013 21:08:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96D02279F; Tue, 29 Oct 2013 21:08:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TL8KWP036212; Tue, 29 Oct 2013 21:08:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TL8KlL036211; Tue, 29 Oct 2013 21:08:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310292108.r9TL8KlL036211@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 21:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257368 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 21:08:20 -0000 Author: nwhitehorn Date: Tue Oct 29 21:08:20 2013 New Revision: 257368 URL: http://svnweb.freebsd.org/changeset/base/257368 Log: The ofw_bus() routines invoke the device's parent, not the device itself, so cease iterating when the parent is NULL, not when the device is. MFC after: 5 days Modified: head/sys/powerpc/pseries/plpar_iommu.c Modified: head/sys/powerpc/pseries/plpar_iommu.c ============================================================================== --- head/sys/powerpc/pseries/plpar_iommu.c Tue Oct 29 21:00:54 2013 (r257367) +++ head/sys/powerpc/pseries/plpar_iommu.c Tue Oct 29 21:08:20 2013 (r257368) @@ -69,14 +69,14 @@ struct dma_window { }; int -phyp_iommu_set_dma_tag(device_t dev, device_t child, bus_dma_tag_t tag) +phyp_iommu_set_dma_tag(device_t bus, device_t dev, bus_dma_tag_t tag) { device_t p; phandle_t node; cell_t dma_acells, dma_scells, dmawindow[5]; struct iommu_map *i; - for (p = child; p != NULL; p = device_get_parent(p)) { + for (p = dev; device_get_parent(p) != NULL; p = device_get_parent(p)) { if (ofw_bus_has_prop(p, "ibm,my-dma-window")) break; if (ofw_bus_has_prop(p, "ibm,dma-window")) @@ -145,7 +145,7 @@ phyp_iommu_set_dma_tag(device_t dev, dev papr_supports_stuff_tce = !(phyp_hcall(H_STUFF_TCE, window->map->iobn, 0, 0, 0) == H_FUNCTION); - bus_dma_tag_set_iommu(tag, dev, window); + bus_dma_tag_set_iommu(tag, bus, window); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 21:25:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7235E54D; Tue, 29 Oct 2013 21:25:30 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38CAA2914; Tue, 29 Oct 2013 21:25:29 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id AFC59C2495; Tue, 29 Oct 2013 21:25:21 +0000 (UTC) Date: Tue, 29 Oct 2013 22:25:21 +0100 From: Jeremie Le Hen To: Adam McDougall Subject: Re: svn commit: r254974 - in head: etc/defaults etc/periodic/monthly etc/periodic/security etc/periodic/weekly share/man/man5 Message-ID: <20131029212520.GD37879@caravan.chchile.org> Mail-Followup-To: Adam McDougall , svn-src-all@freebsd.org References: <201308272120.r7RLKTvk066897@svn.freebsd.org> <20131021000110.GJ2097@egr.msu.edu> <20131028211700.GB37879@caravan.chchile.org> <20131029143553.GO1807@egr.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131029143553.GO1807@egr.msu.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: jlh@FreeBSD.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 21:25:30 -0000 On Tue, Oct 29, 2013 at 10:35:53AM -0400, Adam McDougall wrote: > > Sorry, that didn't work (on r255793). Hand applied by adding the 'var', > was that the only change? Thanks. Alright, thanks for testing. I've committed a corrected patch in r257361 that should resolve the problem. Can you confirm that please, and I will close the PR. Regards, -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 22:42:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CEDC9364; Tue, 29 Oct 2013 22:42:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB88D2DF5; Tue, 29 Oct 2013 22:42:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TMgUIr070065; Tue, 29 Oct 2013 22:42:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TMgUQ5070064; Tue, 29 Oct 2013 22:42:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310292242.r9TMgUQ5070064@svn.freebsd.org> From: Xin LI Date: Tue, 29 Oct 2013 22:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257369 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 22:42:30 -0000 Author: delphij Date: Tue Oct 29 22:42:30 2013 New Revision: 257369 URL: http://svnweb.freebsd.org/changeset/base/257369 Log: Don't reference pointer before testing whether it is NULL. Submitted by: Clement Lecigne Reviewed by: grehan MFC after: 3 days Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Oct 29 21:08:20 2013 (r257368) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Oct 29 22:42:30 2013 (r257369) @@ -621,13 +621,15 @@ netvsc_recv(struct hv_device *device_ctx { hn_softc_t *sc = (hn_softc_t *)device_get_softc(device_ctx->device); struct mbuf *m_new; - struct ifnet *ifp = sc->hn_ifp; + struct ifnet *ifp; int size; int i; if (sc == NULL) { return (0); /* TODO: KYS how can this be! */ } + + ifp = sc->hn_ifp; ifp = sc->arpcom.ac_ifp; From owner-svn-src-all@FreeBSD.ORG Tue Oct 29 23:55:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 159CB465; Tue, 29 Oct 2013 23:55:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0206321BB; Tue, 29 Oct 2013 23:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TNtHe0093569; Tue, 29 Oct 2013 23:55:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TNtHLU093568; Tue, 29 Oct 2013 23:55:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310292355.r9TNtHLU093568@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 29 Oct 2013 23:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257370 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 29 Oct 2013 23:55:18 -0000 Author: nwhitehorn Date: Tue Oct 29 23:55:17 2013 New Revision: 257370 URL: http://svnweb.freebsd.org/changeset/base/257370 Log: Fix typo. Sorry! Modified: head/sys/arm/at91/at91.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Oct 29 22:42:30 2013 (r257369) +++ head/sys/arm/at91/at91.c Tue Oct 29 23:55:17 2013 (r257370) @@ -231,7 +231,7 @@ at91_probe(device_t dev) { device_set_desc(dev, "AT91 device bus"); - return (BUS_PROBE_NO_WILDCARD); + return (BUS_PROBE_NOWILDCARD); } static void From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 00:01:50 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6077986; Wed, 30 Oct 2013 00:01:50 +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 7078F2216; Wed, 30 Oct 2013 00:01:50 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2C275782E6B; Wed, 30 Oct 2013 11:01:17 +1100 (EST) Date: Wed, 30 Oct 2013 11:01:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Bruno Subject: Re: svn commit: r257363 - head/usr.bin/xinstall In-Reply-To: <201310292038.r9TKc0IM024996@svn.freebsd.org> Message-ID: <20131030084122.L2806@besplex.bde.org> References: <201310292038.r9TKc0IM024996@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=34LXto6PA54A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=fS_ZPdM9LlsA:10 a=V8hUVIDT4eTX4NKlP3UA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 00:01:50 -0000 On Tue, 29 Oct 2013, Sean Bruno wrote: > Log: > Queisce sign errors by using unsigned char * and casting MAP_FAILED as unsigned > char * This increases the type errors. > Modified: head/usr.bin/xinstall/xinstall.c > ============================================================================== > --- head/usr.bin/xinstall/xinstall.c Tue Oct 29 20:36:04 2013 (r257362) > +++ head/usr.bin/xinstall/xinstall.c Tue Oct 29 20:38:00 2013 (r257363) > @@ -1002,7 +1002,7 @@ compare(int from_fd, const char *from_na > int to_fd, const char *to_name __unused, size_t to_len, > char **dresp) > { > - char *p, *q; > + unsigned char *p, *q; > int rv; > int done_compare; > DIGEST_CTX ctx; Using plain char is fragile and often broken for the things that it is used for in C. I happen to have been recently writing too much about this in the comp.std.c newsgroup. Using plain char is less fragile in POSIX than in C, since POSIX-2001 requires signed char to be int8_t so it cannot be 1's complement or signed magnitude, or have padding bits. No change should be made here. Full changes to unsigned char would require poisoning almost all char declarations by adding 'unsigned', starting with strcpy(). Fixing strcpy()'s API was too hard for the C standard in 1990 when C was less than half as old as now. strcpy() is only required to use unsigned char's internally. This wasn't explicit until C99. > @@ -1018,11 +1018,11 @@ compare(int from_fd, const char *from_na > if (trymmap(from_fd) && trymmap(to_fd)) { > p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, > from_fd, (off_t)0); > - if (p == (char *)MAP_FAILED) > + if (p == (unsigned char *)MAP_FAILED) > goto out; > q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, > to_fd, (off_t)0); > - if (q == (char *)MAP_FAILED) { > + if (q == (unsigned char *)MAP_FAILED) { > munmap(p, from_len); > goto out; > } The casts of MAP_FAILED should be removed. They have no effect except to break some cases. Here they mainly caused a type mismatch when the type of the left hand operand was changed. This depends on MAP_FAILED having the correct type (void *). The fallback definition of MAP_FAILED in xinstall.c should also be removed. It is compatibility cruft that was last needed in FreeBSD in 1996. FreeBSD's MAP_FAILED had the wrong type (caddr_t) until 1997. > @@ -1036,7 +1036,7 @@ compare(int from_fd, const char *from_na > } > out: > if (!done_compare) { > - char buf1[MAXBSIZE]; > + unsigned char buf1[MAXBSIZE]; > char buf2[MAXBSIZE]; > int n1, n2; > It's bizarre to use unsigned chars for one buffer and still use plain chars for the other. I now see what this change does. digest_update() takes an unsigned char * pointer. This makes it hard to use with normal buffers containing char, like strcpy() would be if its pointers were unsigned char *. The correct fix is to break digest_update()'s API like strcpy()'s, or to cast the pointer arg to unsigned char * whenever it is called starting with a char * arg. APIs are hard to change, so the latter fix is normally used. Here the API is local, so it is easy to change. digest_update() calls SHA*_Update(), and no further changes are needed for that since it takes a void * arg and converts internally to the correct type, which can only be unsigned char *. Some applications are too smart and use unsigned char buffers. They have essentially the same problem in the opposite direction with using functions like strcpy(). I used to think that it was a bug to cast pointer args in str*() calls, since it either has no effect or hides type mismatch, and type mismatch may cause inconsistent comparisons. (Note that even strcpy() needs to do comparisons for finding the null terminator and must use unsigned char to get these right. However, the bug is just in the API -- both the caller and the callee should be using unsigned char for everything. The new type mismatch between buf1 and buf2 asks for identical files to often compare unequal, since bytes that have their "sign" bit set become negative in buf2 but stay positive in buf1. (Files contain bytes and bytes don't really have a sign bit, but accessing them via buf2 corrupts them iff chars are signed.) However, there is no problem in practice, since buf1[n] and buf2[n] are never compared directly -- all comparisons are done by calling memcmp(), and it compares bytes. > @@ -1146,7 +1146,8 @@ copy(int from_fd, const char *from_name, > { > int nr, nw; > int serrno; > - char *p, buf[MAXBSIZE]; > + unsigned char *p; > + unsigned char buf[MAXBSIZE]; > int done_copy; > DIGEST_CTX ctx; > Don't change. > @@ -1166,7 +1167,7 @@ copy(int from_fd, const char *from_name, > done_copy = 0; > if (size <= 8 * 1048576 && trymmap(from_fd) && > (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, > - from_fd, (off_t)0)) != (char *)MAP_FAILED) { > + from_fd, (off_t)0)) != (unsigned char *)MAP_FAILED) { > nw = write(to_fd, p, size); > if (nw != size) { > serrno = errno; > Remove bogus cast, and fix indentation. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 06:16:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 495C9619; Wed, 30 Oct 2013 06:16:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28013265D; Wed, 30 Oct 2013 06:16:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9U6GCGu038754; Wed, 30 Oct 2013 06:16:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9U6GBPd038749; Wed, 30 Oct 2013 06:16:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310300616.r9U6GBPd038749@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Oct 2013 06:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257372 - stable/8/sys/dev/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 06:16:12 -0000 Author: hselasky Date: Wed Oct 30 06:16:11 2013 New Revision: 257372 URL: http://svnweb.freebsd.org/changeset/base/257372 Log: MFC r257206: Fix a deadlock when trying to power off a USB device. The deadlock happens because the code in question is trying to modify the parent USB port registers outside the USB explore thread. Modified: stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_hub.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Wed Oct 30 00:05:02 2013 (r257371) +++ stable/8/sys/dev/usb/usb_dev.c Wed Oct 30 06:16:11 2013 (r257372) @@ -1095,7 +1095,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, /* Wait for re-enumeration, if any */ - while (f->udev->re_enumerate_wait != 0) { + while (f->udev->re_enumerate_wait != USB_RE_ENUM_DONE) { usb_unref_device(cpd, &refs); Modified: stable/8/sys/dev/usb/usb_device.h ============================================================================== --- stable/8/sys/dev/usb/usb_device.h Wed Oct 30 00:05:02 2013 (r257371) +++ stable/8/sys/dev/usb/usb_device.h Wed Oct 30 06:16:11 2013 (r257372) @@ -229,6 +229,9 @@ struct usb_device { uint8_t driver_added_refcount; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ uint8_t re_enumerate_wait; /* set if re-enum. is in progress */ +#define USB_RE_ENUM_DONE 0 +#define USB_RE_ENUM_START 1 +#define USB_RE_ENUM_PWR_OFF 2 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Wed Oct 30 00:05:02 2013 (r257371) +++ stable/8/sys/dev/usb/usb_generic.c Wed Oct 30 06:16:11 2013 (r257372) @@ -1749,16 +1749,11 @@ ugen_set_power_mode(struct usb_fifo *f, switch (mode) { case USB_POWER_MODE_OFF: - /* get the device unconfigured */ - err = ugen_set_config(f, USB_UNCONFIG_INDEX); - if (err) { - DPRINTFN(0, "Could not unconfigure " - "device (ignored)\n"); + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_PWR_OFF; } - - /* clear port enable */ - err = usbd_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_ENABLE); + /* set power mode will wake up the explore thread */ break; case USB_POWER_MODE_ON: @@ -1806,9 +1801,9 @@ ugen_set_power_mode(struct usb_fifo *f, /* if we are powered off we need to re-enumerate first */ if (old_mode == USB_POWER_MODE_OFF) { - if (udev->flags.usb_mode == USB_MODE_HOST) { - if (udev->re_enumerate_wait == 0) - udev->re_enumerate_wait = 1; + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; } /* set power mode will wake up the explore thread */ } Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Wed Oct 30 00:05:02 2013 (r257371) +++ stable/8/sys/dev/usb/usb_hub.c Wed Oct 30 06:16:11 2013 (r257372) @@ -242,7 +242,8 @@ uhub_explore_sub(struct uhub_softc *sc, uint8_t do_unlock; do_unlock = usbd_enum_lock(child); - if (child->re_enumerate_wait) { + switch (child->re_enumerate_wait) { + case USB_RE_ENUM_START: err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); if (err != 0) { @@ -257,8 +258,33 @@ uhub_explore_sub(struct uhub_softc *sc, err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); } - child->re_enumerate_wait = 0; + child->re_enumerate_wait = USB_RE_ENUM_DONE; err = 0; + break; + + case USB_RE_ENUM_PWR_OFF: + /* get the device unconfigured */ + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } + + /* clear port enable */ + err = usbd_req_clear_port_feature(child->parent_hub, + NULL, child->port_no, UHF_PORT_ENABLE); + if (err) { + DPRINTFN(0, "Could not disable port " + "(ignored)\n"); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + err = 0; + break; + + default: + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; } if (do_unlock) usbd_enum_unlock(child); @@ -2070,7 +2096,7 @@ usb_peer_should_wakeup(struct usb_device return (((udev->power_mode == USB_POWER_MODE_ON) && (udev->flags.usb_mode == USB_MODE_HOST)) || (udev->driver_added_refcount != udev->bus->driver_added_refcount) || - (udev->re_enumerate_wait != 0) || + (udev->re_enumerate_wait != USB_RE_ENUM_DONE) || (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) || (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -2486,6 +2512,8 @@ usbd_set_power_mode(struct usb_device *u #if USB_HAVE_POWERD usb_bus_power_update(udev->bus); +#else + usb_needs_explore(udev->bus, 0 /* no probe */ ); #endif } @@ -2524,8 +2552,8 @@ usbd_filter_power_mode(struct usb_device void usbd_start_re_enumerate(struct usb_device *udev) { - if (udev->re_enumerate_wait == 0) { - udev->re_enumerate_wait = 1; + if (udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; usb_needs_explore(udev->bus, 0); } } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 06:18:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D0BD08C9; Wed, 30 Oct 2013 06:18:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADFF6267B; Wed, 30 Oct 2013 06:18:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9U6ItVJ039133; Wed, 30 Oct 2013 06:18:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9U6Is0P039129; Wed, 30 Oct 2013 06:18:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310300618.r9U6Is0P039129@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Oct 2013 06:18:54 +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: r257373 - stable/9/sys/dev/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 06:18:56 -0000 Author: hselasky Date: Wed Oct 30 06:18:54 2013 New Revision: 257373 URL: http://svnweb.freebsd.org/changeset/base/257373 Log: MFC r257206: Fix a deadlock when trying to power off a USB device. The deadlock happens because the code in question is trying to modify the parent USB port registers outside the USB explore thread. Modified: stable/9/sys/dev/usb/usb_dev.c stable/9/sys/dev/usb/usb_device.h stable/9/sys/dev/usb/usb_generic.c stable/9/sys/dev/usb/usb_hub.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_dev.c ============================================================================== --- stable/9/sys/dev/usb/usb_dev.c Wed Oct 30 06:16:11 2013 (r257372) +++ stable/9/sys/dev/usb/usb_dev.c Wed Oct 30 06:18:54 2013 (r257373) @@ -1095,7 +1095,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, /* Wait for re-enumeration, if any */ - while (f->udev->re_enumerate_wait != 0) { + while (f->udev->re_enumerate_wait != USB_RE_ENUM_DONE) { usb_unref_device(cpd, &refs); Modified: stable/9/sys/dev/usb/usb_device.h ============================================================================== --- stable/9/sys/dev/usb/usb_device.h Wed Oct 30 06:16:11 2013 (r257372) +++ stable/9/sys/dev/usb/usb_device.h Wed Oct 30 06:18:54 2013 (r257373) @@ -230,6 +230,9 @@ struct usb_device { uint8_t driver_added_refcount; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ uint8_t re_enumerate_wait; /* set if re-enum. is in progress */ +#define USB_RE_ENUM_DONE 0 +#define USB_RE_ENUM_START 1 +#define USB_RE_ENUM_PWR_OFF 2 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: stable/9/sys/dev/usb/usb_generic.c ============================================================================== --- stable/9/sys/dev/usb/usb_generic.c Wed Oct 30 06:16:11 2013 (r257372) +++ stable/9/sys/dev/usb/usb_generic.c Wed Oct 30 06:18:54 2013 (r257373) @@ -1749,16 +1749,11 @@ ugen_set_power_mode(struct usb_fifo *f, switch (mode) { case USB_POWER_MODE_OFF: - /* get the device unconfigured */ - err = ugen_set_config(f, USB_UNCONFIG_INDEX); - if (err) { - DPRINTFN(0, "Could not unconfigure " - "device (ignored)\n"); + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_PWR_OFF; } - - /* clear port enable */ - err = usbd_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_ENABLE); + /* set power mode will wake up the explore thread */ break; case USB_POWER_MODE_ON: @@ -1806,9 +1801,9 @@ ugen_set_power_mode(struct usb_fifo *f, /* if we are powered off we need to re-enumerate first */ if (old_mode == USB_POWER_MODE_OFF) { - if (udev->flags.usb_mode == USB_MODE_HOST) { - if (udev->re_enumerate_wait == 0) - udev->re_enumerate_wait = 1; + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; } /* set power mode will wake up the explore thread */ } Modified: stable/9/sys/dev/usb/usb_hub.c ============================================================================== --- stable/9/sys/dev/usb/usb_hub.c Wed Oct 30 06:16:11 2013 (r257372) +++ stable/9/sys/dev/usb/usb_hub.c Wed Oct 30 06:18:54 2013 (r257373) @@ -242,7 +242,8 @@ uhub_explore_sub(struct uhub_softc *sc, uint8_t do_unlock; do_unlock = usbd_enum_lock(child); - if (child->re_enumerate_wait) { + switch (child->re_enumerate_wait) { + case USB_RE_ENUM_START: err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); if (err != 0) { @@ -257,8 +258,33 @@ uhub_explore_sub(struct uhub_softc *sc, err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); } - child->re_enumerate_wait = 0; + child->re_enumerate_wait = USB_RE_ENUM_DONE; err = 0; + break; + + case USB_RE_ENUM_PWR_OFF: + /* get the device unconfigured */ + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } + + /* clear port enable */ + err = usbd_req_clear_port_feature(child->parent_hub, + NULL, child->port_no, UHF_PORT_ENABLE); + if (err) { + DPRINTFN(0, "Could not disable port " + "(ignored)\n"); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + err = 0; + break; + + default: + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; } if (do_unlock) usbd_enum_unlock(child); @@ -2073,7 +2099,7 @@ usb_peer_should_wakeup(struct usb_device return (((udev->power_mode == USB_POWER_MODE_ON) && (udev->flags.usb_mode == USB_MODE_HOST)) || (udev->driver_added_refcount != udev->bus->driver_added_refcount) || - (udev->re_enumerate_wait != 0) || + (udev->re_enumerate_wait != USB_RE_ENUM_DONE) || (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) || (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -2489,6 +2515,8 @@ usbd_set_power_mode(struct usb_device *u #if USB_HAVE_POWERD usb_bus_power_update(udev->bus); +#else + usb_needs_explore(udev->bus, 0 /* no probe */ ); #endif } @@ -2527,8 +2555,8 @@ usbd_filter_power_mode(struct usb_device void usbd_start_re_enumerate(struct usb_device *udev) { - if (udev->re_enumerate_wait == 0) { - udev->re_enumerate_wait = 1; + if (udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; usb_needs_explore(udev->bus, 0); } } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 08:05:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7D3CE826; Wed, 30 Oct 2013 08:05:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8CA2C03; Wed, 30 Oct 2013 08:05:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9U85eHE074980; Wed, 30 Oct 2013 08:05:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9U85dIV074972; Wed, 30 Oct 2013 08:05:39 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310300805.r9U85dIV074972@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Oct 2013 08:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257375 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 08:05:40 -0000 Author: hselasky Date: Wed Oct 30 08:05:39 2013 New Revision: 257375 URL: http://svnweb.freebsd.org/changeset/base/257375 Log: MFC r257206: Fix a deadlock when trying to power off a USB device. The deadlock happens because the code in question is trying to modify the parent USB port registers outside the USB explore thread. Approved by: re (glebius) Modified: stable/10/sys/dev/usb/usb_dev.c stable/10/sys/dev/usb/usb_device.h stable/10/sys/dev/usb/usb_generic.c stable/10/sys/dev/usb/usb_hub.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/usb/usb_dev.c ============================================================================== --- stable/10/sys/dev/usb/usb_dev.c Wed Oct 30 07:51:08 2013 (r257374) +++ stable/10/sys/dev/usb/usb_dev.c Wed Oct 30 08:05:39 2013 (r257375) @@ -1099,7 +1099,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, /* Wait for re-enumeration, if any */ - while (f->udev->re_enumerate_wait != 0) { + while (f->udev->re_enumerate_wait != USB_RE_ENUM_DONE) { usb_unref_device(cpd, &refs); Modified: stable/10/sys/dev/usb/usb_device.h ============================================================================== --- stable/10/sys/dev/usb/usb_device.h Wed Oct 30 07:51:08 2013 (r257374) +++ stable/10/sys/dev/usb/usb_device.h Wed Oct 30 08:05:39 2013 (r257375) @@ -238,6 +238,9 @@ struct usb_device { uint8_t driver_added_refcount; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ uint8_t re_enumerate_wait; /* set if re-enum. is in progress */ +#define USB_RE_ENUM_DONE 0 +#define USB_RE_ENUM_START 1 +#define USB_RE_ENUM_PWR_OFF 2 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: stable/10/sys/dev/usb/usb_generic.c ============================================================================== --- stable/10/sys/dev/usb/usb_generic.c Wed Oct 30 07:51:08 2013 (r257374) +++ stable/10/sys/dev/usb/usb_generic.c Wed Oct 30 08:05:39 2013 (r257375) @@ -1762,16 +1762,11 @@ ugen_set_power_mode(struct usb_fifo *f, switch (mode) { case USB_POWER_MODE_OFF: - /* get the device unconfigured */ - err = ugen_set_config(f, USB_UNCONFIG_INDEX); - if (err) { - DPRINTFN(0, "Could not unconfigure " - "device (ignored)\n"); + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_PWR_OFF; } - - /* clear port enable */ - err = usbd_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_ENABLE); + /* set power mode will wake up the explore thread */ break; case USB_POWER_MODE_ON: @@ -1819,9 +1814,9 @@ ugen_set_power_mode(struct usb_fifo *f, /* if we are powered off we need to re-enumerate first */ if (old_mode == USB_POWER_MODE_OFF) { - if (udev->flags.usb_mode == USB_MODE_HOST) { - if (udev->re_enumerate_wait == 0) - udev->re_enumerate_wait = 1; + if (udev->flags.usb_mode == USB_MODE_HOST && + udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; } /* set power mode will wake up the explore thread */ } Modified: stable/10/sys/dev/usb/usb_hub.c ============================================================================== --- stable/10/sys/dev/usb/usb_hub.c Wed Oct 30 07:51:08 2013 (r257374) +++ stable/10/sys/dev/usb/usb_hub.c Wed Oct 30 08:05:39 2013 (r257375) @@ -248,7 +248,8 @@ uhub_explore_sub(struct uhub_softc *sc, uint8_t do_unlock; do_unlock = usbd_enum_lock(child); - if (child->re_enumerate_wait) { + switch (child->re_enumerate_wait) { + case USB_RE_ENUM_START: err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); if (err != 0) { @@ -263,8 +264,33 @@ uhub_explore_sub(struct uhub_softc *sc, err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); } - child->re_enumerate_wait = 0; + child->re_enumerate_wait = USB_RE_ENUM_DONE; err = 0; + break; + + case USB_RE_ENUM_PWR_OFF: + /* get the device unconfigured */ + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } + + /* clear port enable */ + err = usbd_req_clear_port_feature(child->parent_hub, + NULL, child->port_no, UHF_PORT_ENABLE); + if (err) { + DPRINTFN(0, "Could not disable port " + "(ignored)\n"); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + err = 0; + break; + + default: + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; } if (do_unlock) usbd_enum_unlock(child); @@ -2086,7 +2112,7 @@ usb_peer_should_wakeup(struct usb_device return (((udev->power_mode == USB_POWER_MODE_ON) && (udev->flags.usb_mode == USB_MODE_HOST)) || (udev->driver_added_refcount != udev->bus->driver_added_refcount) || - (udev->re_enumerate_wait != 0) || + (udev->re_enumerate_wait != USB_RE_ENUM_DONE) || (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) || (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && @@ -2502,6 +2528,8 @@ usbd_set_power_mode(struct usb_device *u #if USB_HAVE_POWERD usb_bus_power_update(udev->bus); +#else + usb_needs_explore(udev->bus, 0 /* no probe */ ); #endif } @@ -2540,8 +2568,8 @@ usbd_filter_power_mode(struct usb_device void usbd_start_re_enumerate(struct usb_device *udev) { - if (udev->re_enumerate_wait == 0) { - udev->re_enumerate_wait = 1; + if (udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + udev->re_enumerate_wait = USB_RE_ENUM_START; usb_needs_explore(udev->bus, 0); } } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 08:10:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 832BDA1C; Wed, 30 Oct 2013 08:10:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD4B2C53; Wed, 30 Oct 2013 08:10:43 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r9U8AfHK043373; Wed, 30 Oct 2013 12:10:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r9U8Af9c043372; Wed, 30 Oct 2013 12:10:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 30 Oct 2013 12:10:41 +0400 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r256512 - head/usr.bin/netstat Message-ID: <20131030081041.GU52889@FreeBSD.org> References: <201310150955.r9F9t8pq084143@svn.freebsd.org> <20131028204113.GA37879@caravan.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131028204113.GA37879@caravan.chchile.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 08:10:44 -0000 Jeremie, On Mon, Oct 28, 2013 at 09:41:13PM +0100, Jeremie Le Hen wrote: J> On Tue, Oct 15, 2013 at 09:55:08AM +0000, Gleb Smirnoff wrote: J> > Log: J> > Rewrite netstat/if.c to use getifaddrs(3) and getifmaddrs(3) instead of J> > libkvm digging in kernel memory. This is possible since r231506 made J> > getifaddrs(3) to supply if_data for each ifaddr. J> > J> > The pros of this change is that now netstat(1) doesn't know about kernel J> > struct ifnet and struct ifaddr. And these structs are about to change J> > significantly in head soon. New netstat binary will work well with 10.0 J> > and any future kernel. J> > J> > The cons is that now it isn't possible to obtain interface statistics J> > from a vmcore. J> J> Is there a kgdb macro or something like that that could be used for J> debugging purpose? No there is no such thing. I've been debugging network related problems a lot, but I never had a need to do 'netstat -i' on a vmcore. What we usually are interested at is consistency of pointers and so on, not packets/bytes counters of an already dead system. Such a tool can be developed and put into src/tools, but I don't see enough demand for it. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 08:13:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4F2F0BBE; Wed, 30 Oct 2013 08:13:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CAA62C77; Wed, 30 Oct 2013 08:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9U8DhNM078298; Wed, 30 Oct 2013 08:13:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9U8DhT5078297; Wed, 30 Oct 2013 08:13:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310300813.r9U8DhT5078297@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 30 Oct 2013 08:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257376 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 08:13:43 -0000 Author: glebius Date: Wed Oct 30 08:13:42 2013 New Revision: 257376 URL: http://svnweb.freebsd.org/changeset/base/257376 Log: 'netstat -i' no longer supports working on a vmcore. Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Wed Oct 30 08:05:39 2013 (r257375) +++ head/usr.bin/netstat/netstat.1 Wed Oct 30 08:13:42 2013 (r257376) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 17, 2013 +.Dd October 15, 2013 .Dt NETSTAT 1 .Os .Sh NAME @@ -94,8 +94,6 @@ retransmits, out-of-order packets receiv .Fl i | I Ar interface .Op Fl abdhnW .Op Fl f Ar address_family -.Op Fl M Ar core -.Op Fl N Ar system .Ek .Xc Show the state of all network interfaces or a single From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 10:17:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 091F24EB; Wed, 30 Oct 2013 10:17:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9DE323E8; Wed, 30 Oct 2013 10:17:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UAHGJr019607; Wed, 30 Oct 2013 10:17:16 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UAHGiF019606; Wed, 30 Oct 2013 10:17:16 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310301017.r9UAHGiF019606@svn.freebsd.org> From: Bryan Drewery Date: Wed, 30 Oct 2013 10:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257377 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 10:17:17 -0000 Author: bdrewery (ports committer) Date: Wed Oct 30 10:17:16 2013 New Revision: 257377 URL: http://svnweb.freebsd.org/changeset/base/257377 Log: Add a 'pkg bootstrap' command which will bootstrap pkg(8) without forwarding any command to it after installation. This is useful if the only goal is to install pkg(8) without any extra output. Requested by: cperciva Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Wed Oct 30 08:13:42 2013 (r257376) +++ head/usr.sbin/pkg/pkg.c Wed Oct 30 10:17:16 2013 (r257377) @@ -951,6 +951,15 @@ main(__unused int argc, char *argv[]) if (bootstrap_pkg() != 0) exit(EXIT_FAILURE); config_finish(); + + if (argv[1] != NULL && strcmp(argv[1], "bootstrap") == 0) + exit(EXIT_SUCCESS); + } else { + if (argv[1] != NULL && strcmp(argv[1], "bootstrap") == 0) { + printf("pkg already bootstrapped at %s\n", + pkgpath); + exit(EXIT_SUCCESS); + } } execv(pkgpath, argv); From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 10:39:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F1A29CC; Wed, 30 Oct 2013 10:39:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D04EF2563; Wed, 30 Oct 2013 10:39:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UAdEGa026338; Wed, 30 Oct 2013 10:39:14 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UAdEtJ026334; Wed, 30 Oct 2013 10:39:14 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310301039.r9UAdEtJ026334@svn.freebsd.org> From: Bryan Drewery Date: Wed, 30 Oct 2013 10:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257378 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 10:39:15 -0000 Author: bdrewery (ports committer) Date: Wed Oct 30 10:39:14 2013 New Revision: 257378 URL: http://svnweb.freebsd.org/changeset/base/257378 Log: Add a pkg(7) manpage for bootstrap Approved by: bapt MFC after: 2 days Added: head/usr.sbin/pkg/pkg.7 (contents, props changed) Modified: head/usr.sbin/pkg/Makefile Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Wed Oct 30 10:17:16 2013 (r257377) +++ head/usr.sbin/pkg/Makefile Wed Oct 30 10:39:14 2013 (r257378) @@ -2,8 +2,8 @@ PROG= pkg SRCS= pkg.c dns_utils.c config.c +MAN= pkg.7 -NO_MAN= yes CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include .PATH: ${.CURDIR}/../../contrib/libyaml/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} ${LIBSSL} \ Added: head/usr.sbin/pkg/pkg.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pkg/pkg.7 Wed Oct 30 10:39:14 2013 (r257378) @@ -0,0 +1,262 @@ +.\" Copyright (c) 2013 Bryan Drewery +.\" 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 October 30, 2013 +.Dt PKG 7 +.Os +.Sh NAME +.Nm pkg +.Nd a utility for manipulating packages. +.Sh SYNOPSIS +.Nm +.Ao Ar command Ac +.Nm +add +.Ao Pa pkg.txz Ac +.Nm +.Fl N +.Nm +bootstrap +.Sh DESCRIPTION +.Nm +is the package management tool. +It is used to manage local packages installed from +.Xr ports 7 +and install/upgrade packages from remote repositories. +.Pp +To avoid backwards incompatibility issues, the actual +.Xr pkg 8 +tool is not installed in the base system. +The first time invoked, +.Nm +will bootstrap the real +.Xr pkg 8 +from a remote repository. +.Pp +.Bl -tag -width "pkg add xxxxxxx" -compact +.It Nm Ao Ar command Ac +If +.Xr pkg 8 +is not installed yet, it will be fetched, have its signature verified, +installed, and then have the original command forwarded to it. +If already installed, the command requested will be forwarded to the real +.Xr pkg 8 . +.It Nm Li add Ao Pa pkg.txz Ac +Install +.Xr pkg 8 +from a local package instead of fetching from remote. +If a +.Pa pkg.txz.sig +file exists and +signature checking is enabled, then the signature will be verified +before installing the package. +.It Nm Fl N +Do not bootstrap, just determine if +.Xr pkg 8 +is actually installed or not. +Returns 0 and the number of packages installed +if it is, otherwise 1. +.It Nm Li bootstrap +Attempt to bootstrap and do not forward anything to +.Xr pkg 8 +after it is installed. +.El +.Sh CONFIGURATION +Configuration varies in whether it is in a repository configuration file +or the global configuration file. +.Pp +Repository configuration can be stored in +.Pa /etc/pkg/FreeBSD.conf +in the following format: +.Bd -literal -offset indent +FreeBSD: { + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + mirror_type: "srv", + signature_type: "none", + fingerprints: "/usr/share/keys/pkg", + enabled: "yes" +} +.Ed +.Bl -tag -width signature_type -compact +.It url +Refer to +.Dv PACKAGESITE +in +.Sx ENVIRONMENT +.It mirror_type +Refer to +.Dv MIRROR_TYPE +in +.Sx ENVIRONMENT +.It signature_type +Refer to +.Dv SIGNATURE_TYPE +in +.Sx ENVIRONMENT +.It fingerprints +Refer to +.Dv FINGERPRINTS +in +.Sx ENVIRONMENT +.It enabled +Defines whether this repository should be used or not. +Valid values are +.Dv yes , +.Dv true , +.Dv 1 , +.Dv no , +.Dv false , +.Dv 0 . +.El +.Pp +Global configuration can be stored in +.Pa /usr/local/etc/pkg.conf +in the following format: +.Bd -literal -offset indent +PACKAGESITE: "pkg+http://pkg.freebsd.org/${ABI}/latest", +MIRROR_TYPE: "srv", +SIGNATURE_TYPE: "none", +FINGERPRINTS: "/usr/share/keys/pkg", +ASSUME_ALWAYS_YES: "yes" +.Ed +Reference +.Sx ENVIRONMENT +for each variable. +.Sh ENVIRONMENT +The following environment variables can be set to override the settings +from the +.Pa pkg.conf +file used. +.Bl -tag -width "ASSUME_ALWAYS_YES" +.It Ev MIRROR_TYPE +This defines which mirror type should be used. +Valid values are +.Dv SRV , +.Dv HTTP , +.Dv NONE . +.It Ev ABI +This defines the ABI for the package to be installed. +Default ABI is determined from +.Pa /bin/sh . +.It Ev ASSUME_ALWAYS_YES +If set, no confirmation will be asked when bootstrapping +.Xr pkg 8 . +.It Ev SIGNATURE_TYPE +If set to +.Dv FINGERPRINTS +then a signature will be required and validated against known +certificate fingerprints when bootstrapping +.Xr pkg 8 . +.It Ev FINGERPRINTS +If +.Sy SIGNATURE_TYPE +is set to +.Dv FINGERPRINTS +this value should be set to the directory path where known fingerprints are +located. +.It Ev PACKAGESITE +The URL that +.Xr pkg 8 +and other packages +will be fetched from. +.El +.Sh FILES +Configuration is read from the files in the listed order. +The first enabled repository is the one used for bootstrapping +.Xr pkg 8 . +.Bl -tag -width "/usr/local/etc/pkg/repos/*.conf" +.It Pa /usr/local/etc/pkg.conf +.It Pa /etc/pkg/FreeBSD.conf +.El +.Sh EXAMPLES +Some examples are listed here. +The full list of available commands are available in +.Xr pkg 8 +once it is bootstrapped. +.Pp +Search for a package: +.Dl $ pkg search perl +.Pp +Install a package: +.Dl % pkg install perl +.Pp +List installed packages: +.Dl $ pkg info +.Pp +Upgrade from remote repository: +.Dl % pkg upgrade +.Pp +List non-automatic packages: +.Dl $ pkg query -e '%a = 0' %o +.Pp +List automatic packages: +.Dl $ pkg query -e '%a = 1' %o +.Pp +Delete an installed package: +.Dl % pkg delete perl +.Pp +Remove unneeded dependencies: +.Dl % pkg autoremove +.Pp +Change a package from automatic to non-automatic, which will prevent +.Ic autoremove +from removing it: +.Dl % pkg set -A 0 perl +.Pp +Change a package from non-automatic to automatic, which will make +.Ic autoremove +allow it be removed once nothing depends on it: +.Dl % pkg set -A 1 perl +.Pp +Create package file from an installed package: +.Dl % pkg create -o /usr/ports/packages/All perl +.Pp +Determine which package installed a file: +.Dl $ pkg which /usr/local/bin/perl +.Pp +Audit installed packages for security advisories: +.Dl $ pkg audit +.Pp +Check installed packages for checksum mismatches: +.Dl # pkg check -s -a +.Pp +Check for missing dependencies: +.Dl # pkg check -d -a +.Sh SEE ALSO +.Xr pkg 8 , +.Xr ports 7 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 9.1 . +It became the default package tool in +.Fx 10.0 , +replacing the +pkg_install suite of tools +.Xr pkg_add 1 , +.Xr pkg_info 1 and +.Xr pkg_create 1 . From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 11:38:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 64235F4E; Wed, 30 Oct 2013 11:38:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 369B42926; Wed, 30 Oct 2013 11:38:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UBclhd046157; Wed, 30 Oct 2013 11:38:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UBckoO046151; Wed, 30 Oct 2013 11:38:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310301138.r9UBckoO046151@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 30 Oct 2013 11:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257379 - in head: usr.bin/iscsictl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 11:38:47 -0000 Author: trasz Date: Wed Oct 30 11:38:46 2013 New Revision: 257379 URL: http://svnweb.freebsd.org/changeset/base/257379 Log: Rename '-h' option to '-p', and use "portal" instead of "host" or "address", in order to be consistent with iSCSI terminology. Besides, calling the option '-h' was just wrong. This changes usage for newly added iscsictl(8), and two newly added subcommands to ctladm(8). This breaks POLA between CURRENT and 10, but since 10.0 has not been released yet, it's still ok to do. MFC after: 3 days Discussed with: re (glebius) Sponsored by: FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.8 head/usr.bin/iscsictl/iscsictl.c head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/ctladm/ctladm.c Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Wed Oct 30 10:39:14 2013 (r257378) +++ head/usr.bin/iscsictl/iscsictl.8 Wed Oct 30 11:38:46 2013 (r257379) @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm .Fl A -.Fl h Ar host Fl t Ar target Op Fl u Ar user Fl s Ar secret +.Fl p Ar portal Fl t Ar target Op Fl u Ar user Fl s Ar secret .Nm .Fl A .Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret @@ -48,7 +48,7 @@ .Fl n Ar nickname Op Fl c Ar path .Nm .Fl R -.Op Fl h Ar host +.Op Fl p Ar portal .Op Fl t Ar target .Nm .Fl R @@ -84,10 +84,10 @@ Target host name or address used for Sen When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, and the temporary discovery sesion will be removed. -.It Fl h -Target host name or address for statically defined targets. .It Fl n The "nickname" of session defined in the configuration file. +.It Fl p +Target portal - host name or address - for statically defined targets. .It Fl t Target name. .It Fl v @@ -133,7 +133,7 @@ The utility exits 0 on success, and >0 if an error occurs. .Sh EXAMPLES Attach to target qn.2012-06.com.example:target0, served by 192.168.1.1: -.Dl Nm Fl A Fl t Ar qn.2012-06.com.example:target0 Fl h Ar 192.168.1.1 +.Dl Nm Fl A Fl t Ar qn.2012-06.com.example:target0 Fl p Ar 192.168.1.1 .Pp Disconnect all iSCSI sessions: .Dl Nm Fl Ra Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Wed Oct 30 10:39:14 2013 (r257378) +++ head/usr.bin/iscsictl/iscsictl.c Wed Oct 30 11:38:46 2013 (r257379) @@ -410,48 +410,48 @@ kernel_list(int iscsi_fd, const struct t state = &states[i]; conf = &state->iss_conf; - printf("Session ID: %d\n", state->iss_id); - printf("Initiator name: %s\n", conf->isc_initiator); - printf("Initiator addr: %s\n", + printf("Session ID: %d\n", state->iss_id); + printf("Initiator name: %s\n", conf->isc_initiator); + printf("Initiator portal: %s\n", conf->isc_initiator_addr); - printf("Initiator alias: %s\n", + printf("Initiator alias: %s\n", conf->isc_initiator_alias); - printf("Target name: %s\n", conf->isc_target); - printf("Target addr: %s\n", + printf("Target name: %s\n", conf->isc_target); + printf("Target portal: %s\n", conf->isc_target_addr); - printf("Target alias: %s\n", + printf("Target alias: %s\n", state->iss_target_alias); - printf("User: %s\n", conf->isc_user); - printf("Secret: %s\n", conf->isc_secret); - printf("Mutual user: %s\n", + printf("User: %s\n", conf->isc_user); + printf("Secret: %s\n", conf->isc_secret); + printf("Mutual user: %s\n", conf->isc_mutual_user); - printf("Mutual secret: %s\n", + printf("Mutual secret : %s\n", conf->isc_mutual_secret); - printf("Session type: %s\n", + printf("Session type: %s\n", conf->isc_discovery ? "Discovery" : "Normal"); - printf("Session state: %s\n", + printf("Session state: %s\n", state->iss_connected ? "Connected" : "Disconnected"); - printf("Failure reason: %s\n", state->iss_reason); - printf("Header digest: %s\n", + printf("Failure reason: %s\n", state->iss_reason); + printf("Header digest: %s\n", state->iss_header_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - printf("Data digest: %s\n", + printf("Data digest: %s\n", state->iss_data_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - printf("DataSegmentLen: %d\n", + printf("DataSegmentLen: %d\n", state->iss_max_data_segment_length); - printf("ImmediateData: %s\n", + printf("ImmediateData: %s\n", state->iss_immediate_data ? "Yes" : "No"); - printf("iSER (RDMA): %s\n", + printf("iSER (RDMA): %s\n", conf->isc_iser ? "Yes" : "No"); - printf("Device nodes: "); + printf("Device nodes: "); print_periphs(state->iss_id); printf("\n\n"); } } else { printf("%-36s %-16s %s\n", - "Target name", "Target addr", "State"); + "Target name", "Target portal", "State"); for (i = 0; i < isl.isl_nentries; i++) { state = &states[i]; conf = &state->iss_conf; @@ -483,13 +483,13 @@ static void usage(void) { - fprintf(stderr, "usage: iscsictl -A -h host -t target " + fprintf(stderr, "usage: iscsictl -A -p portal -t target " "[-u user -s secret]\n"); fprintf(stderr, " iscsictl -A -d discovery-host " "[-u user -s secret]\n"); fprintf(stderr, " iscsictl -A -a [-c path]\n"); fprintf(stderr, " iscsictl -A -n nickname [-c path]\n"); - fprintf(stderr, " iscsictl -R [-h host] [-t target]\n"); + fprintf(stderr, " iscsictl -R [-p portal] [-t target]\n"); fprintf(stderr, " iscsictl -R -a\n"); fprintf(stderr, " iscsictl -R -n nickname [-c path]\n"); fprintf(stderr, " iscsictl -L [-v]\n"); @@ -519,7 +519,7 @@ main(int argc, char **argv) struct conf *conf; struct target *targ; - while ((ch = getopt(argc, argv, "ARLac:d:n:h:t:u:s:v")) != -1) { + while ((ch = getopt(argc, argv, "ARLac:d:n:p:t:u:s:v")) != -1) { switch (ch) { case 'A': Aflag = 1; @@ -542,7 +542,7 @@ main(int argc, char **argv) case 'n': nickname = optarg; break; - case 'h': + case 'p': host = optarg; break; case 't': @@ -579,7 +579,7 @@ main(int argc, char **argv) if (Aflag != 0) { if (aflag != 0) { if (host != NULL) - errx(1, "-a and -h and mutually exclusive"); + errx(1, "-a and -p and mutually exclusive"); if (target != NULL) errx(1, "-a and -t and mutually exclusive"); if (user != NULL) @@ -592,7 +592,7 @@ main(int argc, char **argv) errx(1, "-a and -d and mutually exclusive"); } else if (nickname != NULL) { if (host != NULL) - errx(1, "-n and -h and mutually exclusive"); + errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); if (user != NULL) @@ -603,17 +603,17 @@ main(int argc, char **argv) errx(1, "-n and -d and mutually exclusive"); } else if (discovery_host != NULL) { if (host != NULL) - errx(1, "-d and -h and mutually exclusive"); + errx(1, "-d and -p and mutually exclusive"); if (target != NULL) errx(1, "-d and -t and mutually exclusive"); } else { if (target == NULL && host == NULL) - errx(1, "must specify -a, -n or -t/-h"); + errx(1, "must specify -a, -n or -t/-p"); if (target != NULL && host == NULL) - errx(1, "-t must always be used with -h"); + errx(1, "-t must always be used with -p"); if (host != NULL && target == NULL) - errx(1, "-h must always be used with -t"); + errx(1, "-p must always be used with -t"); } if (user != NULL && secret == NULL) @@ -634,24 +634,24 @@ main(int argc, char **argv) if (aflag != 0) { if (host != NULL) - errx(1, "-a and -h and mutually exclusive"); + errx(1, "-a and -p and mutually exclusive"); if (target != NULL) errx(1, "-a and -t and mutually exclusive"); if (nickname != NULL) errx(1, "-a and -n and mutually exclusive"); } else if (nickname != NULL) { if (host != NULL) - errx(1, "-n and -h and mutually exclusive"); + errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); } else if (host != NULL) { if (target != NULL) - errx(1, "-h and -t and mutually exclusive"); + errx(1, "-p and -t and mutually exclusive"); } else if (target != NULL) { if (host != NULL) - errx(1, "-t and -h and mutually exclusive"); + errx(1, "-t and -p and mutually exclusive"); } else - errx(1, "must specify either-a, -n, -t, or -h"); + errx(1, "must specify either -a, -n, -t, or -p"); if (vflag != 0) errx(1, "-v cannot be used with -R"); @@ -660,7 +660,7 @@ main(int argc, char **argv) assert(Lflag != 0); if (host != NULL) - errx(1, "-L and -h and mutually exclusive"); + errx(1, "-L and -p and mutually exclusive"); if (target != NULL) errx(1, "-L and -t and mutually exclusive"); if (user != NULL) Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Wed Oct 30 10:39:14 2013 (r257378) +++ head/usr.sbin/ctladm/ctladm.8 Wed Oct 30 11:38:46 2013 (r257379) @@ -202,10 +202,10 @@ .Op Fl x .Nm .Ic islogout -.Aq Fl a | Fl h Ar host | Fl c Ar connection-id | Fl i Ar name +.Aq Fl a | Fl c Ar connection-id | Fl i Ar name | Fl p Ar portal .Nm .Ic isterminate -.Aq Fl a | Fl h Ar host | Fl c Ar connection-id | Fl i Ar name +.Aq Fl a | Fl c Ar connection-id | Fl i Ar name | Fl p Ar portal .Nm .Ic help .Sh DESCRIPTION @@ -909,24 +909,24 @@ Ask the initiator to log out iSCSI conne .Bl -tag -width 11n .It Fl a Log out all connections. -.It Fl h -Specify initiator IP address. .It Fl c Specify connection ID. .It Fl i Specify initiator name. +.It Fl p +Specify initiator portal (hostname or IP address). .El .It Ic isterminate Forcibly terminate iSCSI connections matching criteria. .Bl -tag -width 11n .It Fl a Terminate all connections. -.It Fl h -Specify initiator IP address. .It Fl c Specify connection ID. .It Fl i Specify initiator name. +.It Fl p +Specify initiator portal (hostname or IP address). .El .It Ic help Display Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Wed Oct 30 10:39:14 2013 (r257378) +++ head/usr.sbin/ctladm/ctladm.c Wed Oct 30 11:38:46 2013 (r257379) @@ -184,8 +184,8 @@ static struct ctladm_opts option_table[] {"inject", CTLADM_CMD_ERR_INJECT, CTLADM_ARG_NEED_TL, "cd:i:p:r:s:"}, {"inquiry", CTLADM_CMD_INQUIRY, CTLADM_ARG_NEED_TL, NULL}, {"islist", CTLADM_CMD_ISLIST, CTLADM_ARG_NONE, "vx"}, - {"islogout", CTLADM_CMD_ISLOGOUT, CTLADM_ARG_NONE, "ah:c:i:"}, - {"isterminate", CTLADM_CMD_ISTERMINATE, CTLADM_ARG_NONE, "ah:c:i:"}, + {"islogout", CTLADM_CMD_ISLOGOUT, CTLADM_ARG_NONE, "ac:i:p:"}, + {"isterminate", CTLADM_CMD_ISTERMINATE, CTLADM_ARG_NONE, "ac:i:p:"}, {"lunlist", CTLADM_CMD_LUNLIST, CTLADM_ARG_NONE, NULL}, {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:s:"}, @@ -3633,21 +3633,21 @@ retry: if (verbose != 0) { STAILQ_FOREACH(conn, &islist.conn_list, links) { - printf("Session ID: %d\n", conn->connection_id); - printf("Initiator name: %s\n", conn->initiator); - printf("Initiator addr: %s\n", conn->initiator_addr); - printf("Initiator alias: %s\n", conn->initiator_alias); - printf("Target name: %s\n", conn->target); - printf("Target alias: %s\n", conn->target_alias); - printf("Header digest: %s\n", conn->header_digest); - printf("Data digest: %s\n", conn->data_digest); - printf("DataSegmentLen: %s\n", conn->max_data_segment_length); - printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No"); - printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No"); + printf("Session ID: %d\n", conn->connection_id); + printf("Initiator name: %s\n", conn->initiator); + printf("Initiator portal: %s\n", conn->initiator_addr); + printf("Initiator alias: %s\n", conn->initiator_alias); + printf("Target name: %s\n", conn->target); + printf("Target alias: %s\n", conn->target_alias); + printf("Header digest: %s\n", conn->header_digest); + printf("Data digest: %s\n", conn->data_digest); + printf("DataSegmentLen: %s\n", conn->max_data_segment_length); + printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No"); + printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No"); printf("\n"); } } else { - printf("%4s %-16s %-36s %-36s\n", "ID", "Address", "Initiator name", + printf("%4s %-16s %-36s %-36s\n", "ID", "Portal", "Initiator name", "Target name"); STAILQ_FOREACH(conn, &islist.conn_list, links) { printf("%4u %-16s %-36s %-36s\n", @@ -3675,12 +3675,6 @@ cctl_islogout(int fd, int argc, char **a all = 1; nargs++; break; - case 'h': - initiator_addr = strdup(optarg); - if (initiator_addr == NULL) - err(1, "%s: strdup", __func__); - nargs++; - break; case 'c': connection_id = strtoul(optarg, NULL, 0); nargs++; @@ -3691,16 +3685,22 @@ cctl_islogout(int fd, int argc, char **a err(1, "%s: strdup", __func__); nargs++; break; + case 'p': + initiator_addr = strdup(optarg); + if (initiator_addr == NULL) + err(1, "%s: strdup", __func__); + nargs++; + break; default: break; } } if (nargs == 0) - errx(1, "%s: either -a, -h, -c, or -i must be specified", + errx(1, "%s: either -a, -c, -i, or -p must be specified", __func__); if (nargs > 1) - errx(1, "%s: only one of -a, -h, -c, or -i may be specified", + errx(1, "%s: only one of -a, -c, -i, or -p may be specified", __func__); bzero(&req, sizeof(req)); @@ -3748,12 +3748,6 @@ cctl_isterminate(int fd, int argc, char all = 1; nargs++; break; - case 'h': - initiator_addr = strdup(optarg); - if (initiator_addr == NULL) - err(1, "%s: strdup", __func__); - nargs++; - break; case 'c': connection_id = strtoul(optarg, NULL, 0); nargs++; @@ -3764,16 +3758,22 @@ cctl_isterminate(int fd, int argc, char err(1, "%s: strdup", __func__); nargs++; break; + case 'p': + initiator_addr = strdup(optarg); + if (initiator_addr == NULL) + err(1, "%s: strdup", __func__); + nargs++; + break; default: break; } } if (nargs == 0) - errx(1, "%s: either -a, -h, -c, or -i must be specified", + errx(1, "%s: either -a, -c, -i, or -p must be specified", __func__); if (nargs > 1) - errx(1, "%s: only one of -a, -h, -c, or -i may be specified", + errx(1, "%s: only one of -a, -c, -i, or -p may be specified", __func__); bzero(&req, sizeof(req)); @@ -4121,8 +4121,8 @@ usage(int error) " ctladm port <-l | -o | [-w wwnn][-W wwpn]>\n" " [-p targ_port] [-t port_type] [-q] [-x]\n" " ctladm islist [-v | -x]\n" -" ctladm islogout <-A | -a addr | -c connection-id | -n name>\n" -" ctladm isterminate <-A | -a addr | -c connection-id | -n name>\n" +" ctladm islogout <-a | -c connection-id | -i name | -p portal>\n" +" ctladm isterminate <-a | -c connection-id | -i name | -p portal>\n" " ctladm dumpooa\n" " ctladm dumpstructs\n" " ctladm help\n" From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 11:41:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 363E226D; Wed, 30 Oct 2013 11:41:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2383A2984; Wed, 30 Oct 2013 11:41:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UBfTZs048563; Wed, 30 Oct 2013 11:41:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UBfSam048561; Wed, 30 Oct 2013 11:41:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310301141.r9UBfSam048561@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 30 Oct 2013 11:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257380 - in head: usr.bin/iscsictl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 11:41:29 -0000 Author: trasz Date: Wed Oct 30 11:41:28 2013 New Revision: 257380 URL: http://svnweb.freebsd.org/changeset/base/257380 Log: Bump .Dd after r257379. MFC after: 3 days Modified: head/usr.bin/iscsictl/iscsictl.8 head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Wed Oct 30 11:38:46 2013 (r257379) +++ head/usr.bin/iscsictl/iscsictl.8 Wed Oct 30 11:41:28 2013 (r257380) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd October 30, 2013 .Dt ISCSICTL 8 .Os .Sh NAME Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Wed Oct 30 11:38:46 2013 (r257379) +++ head/usr.sbin/ctladm/ctladm.8 Wed Oct 30 11:41:28 2013 (r257380) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd April 2, 2013 +.Dd October 30, 2013 .Dt CTLADM 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 13:32:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB2D993D; Wed, 30 Oct 2013 13:32:31 +0000 (UTC) (envelope-from BM-2cXppXU4T67w7j6NCir9T1WdzBHmFgBnLj@bitmessage.ch) Received: from mail.bitmessage.ch (unknown [IPv6:2002:92e4:70fc::92e4:70fc]) by mx1.freebsd.org (Postfix) with SMTP id 95856217D; Wed, 30 Oct 2013 13:32:30 +0000 (UTC) dkim-signature: v=1; a=rsa-sha256; d=bitmessage.ch; s=mail; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:In-Reply-To:References; bh=dbKkp6aLWn66aqWBuMzx2wE1wYq/cNEK2ZB8+esQxk0=; b=O+3v8ao77kxkwfVz4eo4yQKbOcIRKgZFGInl332OERk7EhnJcODM1x+Ji+Z2A3hyFxSlhRxheUH7wd04Mfo5zgIBb/yzr5XGS2t9tA6syTb2e5+oRJgtqD3oCeWFFaDf7w3aJo2iCX4Txt8TrT4xQRURwBNY5mJj1C+F90kGXeY= Received: from nil ([127.0.0.1]) by mail.bitmessage.ch ; Wed, 30 Oct 2013 14:31:31 +0100 From: Stefan Neudorf To: Konstantin Belousov Subject: Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat In-Reply-To: <201310211646.r9LGkDl5012906@svn.freebsd.org> (Konstantin Belousov's message of "Mon, 21 Oct 2013 16:46:13 +0000 (UTC)") Date: Wed, 30 Oct 2013 14:01:57 +0100 Message-ID: <20131030.86fvriud2y@bitmessage.ch> References: <201310211646.r9LGkDl5012906@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 13:32:31 -0000 Konstantin Belousov writes: > Author: kib > Date: Mon Oct 21 16:46:12 2013 > New Revision: 256850 > URL: http://svnweb.freebsd.org/changeset/base/256850 > > Log: > Add a resource limit for the total number of kqueues available to the > user. Kqueue now saves the ucred of the allocating thread, to > correctly decrement the counter on close. > > Under some specific and not real-world use scenario for kqueue, it is > possible for the kqueues to consume memory proportional to the square > of the number of the filedescriptors available to the process. Limit > allows administrator to prevent the abuse. > > This is kernel-mode side of the change, with the user-mode enabling > commit following. > > Reported and tested by: pho > Discussed with: jmg > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/bin/sh/miscbltin.c > head/etc/login.conf > head/lib/libc/sys/getrlimit.2 > head/lib/libutil/login_class.3 > head/lib/libutil/login_class.c > head/usr.bin/limits/limits.c > head/usr.bin/procstat/procstat_rlimit.c kqueues limit isn't documented in sh(1) and limits(1) manpages. > > Modified: head/bin/sh/miscbltin.c > ============================================================================== > --- head/bin/sh/miscbltin.c Mon Oct 21 16:44:53 2013 (r256849) > +++ head/bin/sh/miscbltin.c Mon Oct 21 16:46:12 2013 (r256850) > @@ -405,6 +405,9 @@ static const struct limits limits[] = { > #ifdef RLIMIT_NPTS > { "pseudo-terminals", (char *)0, RLIMIT_NPTS, 1, 'p' }, > #endif > +#ifdef RLIMIT_KQUEUES > + { "kqueues", (char *)0, RLIMIT_KQUEUES, 1, 'k' }, > +#endif > { (char *) 0, (char *)0, 0, 0, '\0' } > }; > I've submitted a patch to add ulimit -k (kqueue) to zsh but the reviewer asked me to rename -k to -K to avoid conflict with ulimit -k (posixlocks) from DragonFly. Do you anticipate FreeBSD never adds RLIMIT_POSIXLOCKS support or would use incompatible option switch? http://www.zsh.org/mla/workers/2013/msg00984.html http://gitweb.dragonflybsd.org/dragonfly.git?a=search&h=HEAD&st=commit&s=posixlocks > Modified: head/usr.bin/limits/limits.c > ============================================================================== > --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013 (r256849) > +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013 (r256850) This adds limits -e support only for sh, csh, tcsh. What about other shells that already support sbsize and swapuse extensions? From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 14:04:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2970B6C1; Wed, 30 Oct 2013 14:04:50 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14B4D2423; Wed, 30 Oct 2013 14:04:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UE4ohk098303; Wed, 30 Oct 2013 14:04:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UE4lGH098284; Wed, 30 Oct 2013 14:04:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310301404.r9UE4lGH098284@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 30 Oct 2013 14:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257381 - in head/sys/dev: arcmsr asr firewire hptiop iscsi_initiator isp mps mpt twa usb/storage wds X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 14:04:50 -0000 Author: nwhitehorn Date: Wed Oct 30 14:04:47 2013 New Revision: 257381 URL: http://svnweb.freebsd.org/changeset/base/257381 Log: Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t, mostly by adjustments to debugging printf() format specifiers. For high numbered LUNs, also switch to printing them in hex as per SAM-5. MFC after: 2 weeks Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/asr/asr.c head/sys/dev/firewire/sbp.c head/sys/dev/hptiop/hptiop.c head/sys/dev/iscsi_initiator/isc_cam.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/mps/mps_sas.c head/sys/dev/mpt/mpt_cam.c head/sys/dev/twa/tw_osl_cam.c head/sys/dev/usb/storage/umass.c head/sys/dev/wds/wd7000.c Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/arcmsr/arcmsr.c Wed Oct 30 14:04:47 2013 (r257381) @@ -957,9 +957,9 @@ static void arcmsr_iop_reset(struct Adap srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); - printf("arcmsr%d: scsi id=%d lun=%d srb='%p' aborted\n" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p' aborted\n" , acb->pci_unit, srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); } } /* enable all outbound interrupt */ @@ -2736,10 +2736,10 @@ static u_int8_t arcmsr_seek_cmd2abort(un if(srb->srb_state == ARCMSR_SRB_START) { if(srb->pccb == abortccb) { srb->srb_state = ARCMSR_SRB_ABORTED; - printf("arcmsr%d:scsi id=%d lun=%d abort srb '%p'" + printf("arcmsr%d:scsi id=%d lun=%jx abort srb '%p'" "outstanding command \n" , acb->pci_unit, abortccb->ccb_h.target_id - , abortccb->ccb_h.target_lun, srb); + , (uintmax_t)abortccb->ccb_h.target_lun, srb); arcmsr_polling_srbdone(acb, srb); /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); @@ -3176,11 +3176,11 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'" "poll command abort successfully \n" , acb->pci_unit , srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3236,11 +3236,11 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'" "poll command abort successfully \n" , acb->pci_unit , srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3291,8 +3291,8 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'poll command abort successfully \n" - , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'poll command abort successfully \n" + , acb->pci_unit, srb->pccb->ccb_h.target_id, (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3347,8 +3347,8 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'poll command abort successfully \n" - , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'poll command abort successfully \n" + , acb->pci_unit, srb->pccb->ccb_h.target_id, (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; Modified: head/sys/dev/asr/asr.c ============================================================================== --- head/sys/dev/asr/asr.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/asr/asr.c Wed Oct 30 14:04:47 2013 (r257381) @@ -2740,12 +2740,13 @@ asr_action(struct cam_sim *sim, union cc } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { printf( - "asr%d WARNING: scsi_cmd(%x) already done on b%dt%du%d\n", + "asr%d WARNING: scsi_cmd(%x) already done on b%dt%d " + "LUN %jx\n", cam_sim_unit(xpt_path_sim(ccb->ccb_h.path)), ccb->csio.cdb_io.cdb_bytes[0], cam_sim_bus(sim), ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); } debug_asr_cmd_printf("(%d,%d,%d,%d)", cam_sim_unit(sim), cam_sim_bus(sim), ccb->ccb_h.target_id, Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/firewire/sbp.c Wed Oct 30 14:04:47 2013 (r257381) @@ -1493,12 +1493,13 @@ sbp_print_scsi_cmd(struct sbp_ocb *ocb) struct ccb_scsiio *csio; csio = &ocb->ccb->csio; - printf("%s:%d:%d XPT_SCSI_IO: " + printf("%s:%d:%jx XPT_SCSI_IO: " "cmd: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x" ", flags: 0x%02x, " "%db cmd/%db data/%db sense\n", device_get_nameunit(ocb->sdev->target->sbp->fd.dev), - ocb->ccb->ccb_h.target_id, ocb->ccb->ccb_h.target_lun, + ocb->ccb->ccb_h.target_id, + (uintmax_t)ocb->ccb->ccb_h.target_lun, csio->cdb_io.cdb_bytes[0], csio->cdb_io.cdb_bytes[1], csio->cdb_io.cdb_bytes[2], @@ -2354,8 +2355,8 @@ sbp_action1(struct cam_sim *sim, union c SBP_DEBUG(1) if (sdev == NULL) - printf("invalid target %d lun %d\n", - ccb->ccb_h.target_id, ccb->ccb_h.target_lun); + printf("invalid target %d lun %jx\n", + ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun); END_DEBUG switch (ccb->ccb_h.func_code) { @@ -2366,10 +2367,11 @@ END_DEBUG case XPT_CALC_GEOMETRY: if (sdev == NULL) { SBP_DEBUG(1) - printf("%s:%d:%d:func_code 0x%04x: " + printf("%s:%d:%jx:func_code 0x%04x: " "Invalid target (target needed)\n", device_get_nameunit(sbp->fd.dev), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, + ccb->ccb_h.target_id, + (uintmax_t)ccb->ccb_h.target_lun, ccb->ccb_h.func_code); END_DEBUG @@ -2387,10 +2389,11 @@ END_DEBUG if (sbp == NULL && ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) { SBP_DEBUG(0) - printf("%s:%d:%d func_code 0x%04x: " + printf("%s:%d:%jx func_code 0x%04x: " "Invalid target (no wildcard)\n", device_get_nameunit(sbp->fd.dev), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, + ccb->ccb_h.target_id, + (uintmax_t)ccb->ccb_h.target_lun, ccb->ccb_h.func_code); END_DEBUG ccb->ccb_h.status = CAM_DEV_NOT_THERE; @@ -2415,12 +2418,12 @@ END_DEBUG mtx_assert(sim->mtx, MA_OWNED); SBP_DEBUG(2) - printf("%s:%d:%d XPT_SCSI_IO: " + printf("%s:%d:%jx XPT_SCSI_IO: " "cmd: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x" ", flags: 0x%02x, " "%db cmd/%db data/%db sense\n", device_get_nameunit(sbp->fd.dev), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, + ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun, csio->cdb_io.cdb_bytes[0], csio->cdb_io.cdb_bytes[1], csio->cdb_io.cdb_bytes[2], @@ -2521,7 +2524,7 @@ printf("ORB %08x %08x %08x %08x\n", ntoh break; } SBP_DEBUG(1) - printf("%s:%d:%d:%d:XPT_CALC_GEOMETRY: " + printf("%s:%d:%d:%jx:XPT_CALC_GEOMETRY: " #if defined(__DragonFly__) || __FreeBSD_version < 500000 "Volume size = %d\n", #else @@ -2529,7 +2532,7 @@ SBP_DEBUG(1) #endif device_get_nameunit(sbp->fd.dev), cam_sim_path(sbp->sim), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, + ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun, #if defined(__FreeBSD__) && __FreeBSD_version >= 500000 (uintmax_t) #endif @@ -2573,9 +2576,9 @@ END_DEBUG struct ccb_pathinq *cpi = &ccb->cpi; SBP_DEBUG(1) - printf("%s:%d:%d XPT_PATH_INQ:.\n", + printf("%s:%d:%jx XPT_PATH_INQ:.\n", device_get_nameunit(sbp->fd.dev), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun); + ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun); END_DEBUG cpi->version_num = 1; /* XXX??? */ cpi->hba_inquiry = PI_TAG_ABLE; @@ -2617,9 +2620,9 @@ END_DEBUG scsi->valid = CTS_SCSI_VALID_TQ; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; SBP_DEBUG(1) - printf("%s:%d:%d XPT_GET_TRAN_SETTINGS:.\n", + printf("%s:%d:%jx XPT_GET_TRAN_SETTINGS:.\n", device_get_nameunit(sbp->fd.dev), - ccb->ccb_h.target_id, ccb->ccb_h.target_lun); + ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun); END_DEBUG cts->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/hptiop/hptiop.c Wed Oct 30 14:04:47 2013 (r257381) @@ -2641,10 +2641,10 @@ static void hptiop_post_scsi_command(voi struct hpt_iop_hba *hba = srb->hba; if (error || nsegs > hba->max_sg_count) { - KdPrint(("hptiop: func_code=%x tid=%x lun=%x nsegs=%d\n", + KdPrint(("hptiop: func_code=%x tid=%x lun=%jx nsegs=%d\n", ccb->ccb_h.func_code, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, nsegs)); + (uintmax_t)ccb->ccb_h.target_lun, nsegs)); ccb->ccb_h.status = CAM_BUSY; bus_dmamap_unload(hba->io_dmat, srb->dma_map); hptiop_free_srb(hba, srb); Modified: head/sys/dev/iscsi_initiator/isc_cam.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_cam.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/iscsi_initiator/isc_cam.c Wed Oct 30 14:04:47 2013 (r257381) @@ -63,7 +63,7 @@ _inq(struct cam_sim *sim, union ccb *ccb isc_session_t *sp = cam_sim_softc(sim); debug_called(8); - debug(3, "sid=%d target=%d lun=%d", sp->sid, ccb->ccb_h.target_id, ccb->ccb_h.target_lun); + debug(3, "sid=%d target=%d lun=%jx", sp->sid, ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun); cpi->version_num = 1; /* XXX??? */ cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE | PI_WIDE_32; @@ -188,9 +188,9 @@ ic_action(struct cam_sim *sim, union ccb debug_called(8); ccb_h->spriv_ptr0 = sp; - sdebug(4, "func_code=0x%x flags=0x%x status=0x%x target=%d lun=%d retry_count=%d timeout=%d", + sdebug(4, "func_code=0x%x flags=0x%x status=0x%x target=%d lun=%jx retry_count=%d timeout=%d", ccb_h->func_code, ccb->ccb_h.flags, ccb->ccb_h.status, - ccb->ccb_h.target_id, ccb->ccb_h.target_lun, + ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun, ccb->ccb_h.retry_count, ccb_h->timeout); if(sp == NULL) { xdebug("sp == NULL! cannot happen"); @@ -235,8 +235,8 @@ ic_action(struct cam_sim *sim, union ccb struct ccb_calc_geometry *ccg; ccg = &ccb->ccg; - debug(4, "sid=%d target=%d lun=%d XPT_CALC_GEOMETRY vsize=%jd bsize=%d", - sp->sid, ccb->ccb_h.target_id, ccb->ccb_h.target_lun, + debug(4, "sid=%d target=%d lun=%jx XPT_CALC_GEOMETRY vsize=%jd bsize=%d", + sp->sid, ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun, ccg->volume_size, ccg->block_size); if(ccg->block_size == 0 || (ccg->volume_size < ccg->block_size)) { Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/isp/isp_freebsd.c Wed Oct 30 14:04:47 2013 (r257381) @@ -1382,7 +1382,7 @@ isp_enable_deferred(ispsoftc_t *isp, int int luns_already_enabled; ISP_GET_PC(isp, bus, tm_luns_enabled, luns_already_enabled); - isp_prt(isp, ISP_LOGTINFO, "%s: bus %d lun %u luns_enabled %d", __func__, bus, lun, luns_already_enabled); + isp_prt(isp, ISP_LOGTINFO, "%s: bus %d lun %jx luns_enabled %d", __func__, bus, (uintmax_t)lun, luns_already_enabled); if (IS_24XX(isp) || (IS_FC(isp) && luns_already_enabled)) { status = CAM_REQ_CMP; } else { @@ -1406,7 +1406,7 @@ isp_enable_deferred(ispsoftc_t *isp, int } if (status == CAM_REQ_CMP) { ISP_SET_PC(isp, bus, tm_luns_enabled, 1); - isp_prt(isp, ISP_LOGCONFIG|ISP_LOGTINFO, "bus %d lun %u now enabled for target mode", bus, lun); + isp_prt(isp, ISP_LOGCONFIG|ISP_LOGTINFO, "bus %d lun %jx now enabled for target mode", bus, (uintmax_t)lun); } return (status); } @@ -2362,7 +2362,7 @@ isp_handle_platform_atio2(ispsoftc_t *is if (tptr == NULL) { tptr = get_lun_statep(isp, 0, CAM_LUN_WILDCARD); if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [0x%x] no state pointer for lun %d or wildcard", __func__, aep->at_rxid, lun); + isp_prt(isp, ISP_LOGWARN, "%s: [0x%x] no state pointer for lun %jx or wildcard", __func__, aep->at_rxid, (uintmax_t)lun); if (lun == 0) { isp_endcmd(isp, aep, SCSI_STATUS_BUSY, 0); } else { @@ -2484,7 +2484,7 @@ isp_handle_platform_atio2(ispsoftc_t *is atp->tattr = aep->at_taskflags & ATIO2_TC_ATTR_MASK; atp->state = ATPD_STATE_CAM; xpt_done((union ccb *)atiop); - isp_prt(isp, ISP_LOGTDEBUG0, "ATIO2[0x%x] CDB=0x%x lun %d datalen %u", aep->at_rxid, atp->cdb0, lun, atp->orig_datalen); + isp_prt(isp, ISP_LOGTDEBUG0, "ATIO2[0x%x] CDB=0x%x lun %jx datalen %u", aep->at_rxid, atp->cdb0, (uintmax_t)lun, atp->orig_datalen); rls_lun_statep(isp, tptr); return; noresrc: @@ -3420,13 +3420,13 @@ isp_handle_platform_target_tmf(ispsoftc_ if (tptr == NULL) { tptr = get_lun_statep(isp, notify->nt_channel, CAM_LUN_WILDCARD); if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: no state pointer found for chan %d lun 0x%x", __func__, notify->nt_channel, lun); + isp_prt(isp, ISP_LOGWARN, "%s: no state pointer found for chan %d lun %#jx", __func__, notify->nt_channel, (uintmax_t)lun); goto bad; } } inot = (struct ccb_immediate_notify *) SLIST_FIRST(&tptr->inots); if (inot == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: out of immediate notify structures for chan %d lun 0x%x", __func__, notify->nt_channel, lun); + isp_prt(isp, ISP_LOGWARN, "%s: out of immediate notify structures for chan %d lun %#jx", __func__, notify->nt_channel, (uintmax_t)lun); goto bad; } @@ -3460,7 +3460,7 @@ isp_handle_platform_target_tmf(ispsoftc_ inot->arg = MSG_TARGET_RESET; break; default: - isp_prt(isp, ISP_LOGWARN, "%s: unknown TMF code 0x%x for chan %d lun 0x%x", __func__, notify->nt_ncode, notify->nt_channel, lun); + isp_prt(isp, ISP_LOGWARN, "%s: unknown TMF code 0x%x for chan %d lun %#jx", __func__, notify->nt_ncode, notify->nt_channel, (uintmax_t)lun); goto bad; } @@ -5187,7 +5187,7 @@ isp_action(struct cam_sim *sim, union cc } else { *dptr &= ~DPARM_SYNC; } - isp_prt(isp, ISP_LOGDEBUG0, "SET (%d.%d.%d) to flags %x off %x per %x", bus, tgt, cts->ccb_h.target_lun, sdp->isp_devparam[tgt].goal_flags, + isp_prt(isp, ISP_LOGDEBUG0, "SET (%d.%d.%jx) to flags %x off %x per %x", bus, tgt, (uintmax_t)cts->ccb_h.target_lun, sdp->isp_devparam[tgt].goal_flags, sdp->isp_devparam[tgt].goal_offset, sdp->isp_devparam[tgt].goal_period); sdp->isp_devparam[tgt].dev_update = 1; sdp->update = 1; @@ -5276,8 +5276,8 @@ isp_action(struct cam_sim *sim, union cc } spi->valid |= CTS_SPI_VALID_DISC; } - isp_prt(isp, ISP_LOGDEBUG0, "GET %s (%d.%d.%d) to flags %x off %x per %x", IS_CURRENT_SETTINGS(cts)? "ACTIVE" : "NVRAM", - bus, tgt, cts->ccb_h.target_lun, dval, oval, pval); + isp_prt(isp, ISP_LOGDEBUG0, "GET %s (%d.%d.%jx) to flags %x off %x per %x", IS_CURRENT_SETTINGS(cts)? "ACTIVE" : "NVRAM", + bus, tgt, (uintmax_t)cts->ccb_h.target_lun, dval, oval, pval); } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/isp/isp_freebsd.h Wed Oct 30 14:04:47 2013 (r257381) @@ -504,7 +504,7 @@ default: \ #define XS_ISP(ccb) cam_sim_softc(xpt_path_sim((ccb)->ccb_h.path)) #define XS_CHANNEL(ccb) cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path)) #define XS_TGT(ccb) (ccb)->ccb_h.target_id -#define XS_LUN(ccb) (ccb)->ccb_h.target_lun +#define XS_LUN(ccb) (uint32_t)((ccb)->ccb_h.target_lun) #define XS_CDBP(ccb) \ (((ccb)->ccb_h.flags & CAM_CDB_POINTER)? \ Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/mps/mps_sas.c Wed Oct 30 14:04:47 2013 (r257381) @@ -1063,8 +1063,8 @@ mpssas_announce_reset(struct mps_softc * path_id_t path_id = cam_sim_path(sc->sassc->sim); struct cam_path *path; - mps_dprint(sc, MPS_XINFO, "%s code %x target %d lun %d\n", __func__, - ac_code, target_id, lun_id); + mps_dprint(sc, MPS_XINFO, "%s code %x target %d lun %jx\n", __func__, + ac_code, target_id, (uintmax_t)lun_id); if (xpt_create_path(&path, NULL, path_id, target_id, lun_id) != CAM_REQ_CMP) { Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/mpt/mpt_cam.c Wed Oct 30 14:04:47 2013 (r257381) @@ -2203,8 +2203,8 @@ mpt_start(struct cam_sim *sim, union ccb "read" : "write", csio->dxfer_len, (csio->dxfer_len == 1)? ")" : "s)"); } - mpt_prtc(mpt, "tgt %u lun %u req %p:%u\n", tgt, - ccb->ccb_h.target_lun, req, req->serno); + mpt_prtc(mpt, "tgt %u lun %jx req %p:%u\n", tgt, + (uintmax_t)ccb->ccb_h.target_lun, req, req->serno); } error = bus_dmamap_load_ccb(mpt->buffer_dmat, req->dmap, ccb, cb, @@ -2978,8 +2978,8 @@ mpt_fc_els_reply_handler(struct mpt_soft ccb = tgt->ccb; if (ccb) { mpt_prt(mpt, - "CCB (%p): lun %u flags %x status %x\n", - ccb, ccb->ccb_h.target_lun, + "CCB (%p): lun %jx flags %x status %x\n", + ccb, (uintmax_t)ccb->ccb_h.target_lun, ccb->ccb_h.flags, ccb->ccb_h.status); } mpt_prt(mpt, "target state 0x%x resid %u xfrd %u rpwrd " @@ -3698,12 +3698,12 @@ mpt_action(struct cam_sim *sim, union cc } if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) { mpt_lprt(mpt, MPT_PRT_DEBUG1, - "Put FREE ATIO %p lun %d\n", ccb, lun); + "Put FREE ATIO %p lun %jx\n", ccb, (uintmax_t)lun); STAILQ_INSERT_TAIL(&trtp->atios, &ccb->ccb_h, sim_links.stqe); } else if (ccb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY) { mpt_lprt(mpt, MPT_PRT_DEBUG1, - "Put FREE INOT lun %d\n", lun); + "Put FREE INOT lun %jx\n", (uintmax_t)lun); STAILQ_INSERT_TAIL(&trtp->inots, &ccb->ccb_h, sim_links.stqe); } else { @@ -4866,7 +4866,8 @@ mpt_scsi_tgt_tsk_mgmt(struct mpt_softc * } STAILQ_REMOVE_HEAD(&trtp->inots, sim_links.stqe); mpt_lprt(mpt, MPT_PRT_DEBUG1, - "Get FREE INOT %p lun %d\n", inot, inot->ccb_h.target_lun); + "Get FREE INOT %p lun %jx\n", inot, + (uintmax_t)inot->ccb_h.target_lun); inot->initiator_id = init_id; /* XXX */ /* @@ -5093,8 +5094,8 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, return; default: mpt_lprt(mpt, MPT_PRT_DEBUG, - "CMD 0x%x to unmanaged lun %u\n", - cdbp[0], lun); + "CMD 0x%x to unmanaged lun %jx\n", + cdbp[0], (uintmax_t)lun); buf[12] = 0x25; break; } @@ -5126,7 +5127,7 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, atiop = (struct ccb_accept_tio *) STAILQ_FIRST(&trtp->atios); if (atiop == NULL) { mpt_lprt(mpt, MPT_PRT_WARN, - "no ATIOs for lun %u- sending back %s\n", lun, + "no ATIOs for lun %jx- sending back %s\n", (uintmax_t)lun, mpt->tenabled? "QUEUE FULL" : "BUSY"); mpt_scsi_tgt_status(mpt, NULL, req, mpt->tenabled? SCSI_STATUS_QUEUE_FULL : SCSI_STATUS_BUSY, @@ -5135,7 +5136,8 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, } STAILQ_REMOVE_HEAD(&trtp->atios, sim_links.stqe); mpt_lprt(mpt, MPT_PRT_DEBUG1, - "Get FREE ATIO %p lun %d\n", atiop, atiop->ccb_h.target_lun); + "Get FREE ATIO %p lun %jx\n", atiop, + (uintmax_t)atiop->ccb_h.target_lun); atiop->ccb_h.ccb_mpt_ptr = mpt; atiop->ccb_h.status = CAM_CDB_RECVD; atiop->ccb_h.target_lun = lun; @@ -5159,8 +5161,8 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, } if (mpt->verbose >= MPT_PRT_DEBUG) { int i; - mpt_prt(mpt, "START_CCB %p for lun %u CDB=<", atiop, - atiop->ccb_h.target_lun); + mpt_prt(mpt, "START_CCB %p for lun %jx CDB=<", atiop, + (uintmax_t)atiop->ccb_h.target_lun); for (i = 0; i < atiop->cdb_len; i++) { mpt_prtc(mpt, "%02x%c", cdbp[i] & 0xff, (i == (atiop->cdb_len - 1))? '>' : ' '); Modified: head/sys/dev/twa/tw_osl_cam.c ============================================================================== --- head/sys/dev/twa/tw_osl_cam.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/twa/tw_osl_cam.c Wed Oct 30 14:04:47 2013 (r257381) @@ -207,15 +207,17 @@ tw_osli_execute_scsi(struct tw_osli_req_ csio->cdb_io.cdb_bytes[0]); if (ccb_h->target_id >= TW_CL_MAX_NUM_UNITS) { - tw_osli_dbg_dprintf(3, sc, "Invalid target. PTL = %x %x %x", - ccb_h->path_id, ccb_h->target_id, ccb_h->target_lun); + tw_osli_dbg_dprintf(3, sc, "Invalid target. PTL = %x %x %jx", + ccb_h->path_id, ccb_h->target_id, + (uintmax_t)ccb_h->target_lun); ccb_h->status |= CAM_TID_INVALID; xpt_done(ccb); return(1); } if (ccb_h->target_lun >= TW_CL_MAX_NUM_LUNS) { - tw_osli_dbg_dprintf(3, sc, "Invalid lun. PTL = %x %x %x", - ccb_h->path_id, ccb_h->target_id, ccb_h->target_lun); + tw_osli_dbg_dprintf(3, sc, "Invalid lun. PTL = %x %x %jx", + ccb_h->path_id, ccb_h->target_id, + (uintmax_t)ccb_h->target_lun); ccb_h->status |= CAM_LUN_INVALID; xpt_done(ccb); return(1); Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/usb/storage/umass.c Wed Oct 30 14:04:47 2013 (r257381) @@ -2119,10 +2119,9 @@ umass_cam_attach(struct umass_softc *sc) #ifndef USB_DEBUG if (bootverbose) #endif - printf("%s:%d:%d:%d: Attached to scbus%d\n", + printf("%s:%d:%d: Attached to scbus%d\n", sc->sc_name, cam_sim_path(sc->sc_sim), - sc->sc_unit, CAM_LUN_WILDCARD, - cam_sim_path(sc->sc_sim)); + sc->sc_unit, cam_sim_path(sc->sc_sim)); } /* umass_cam_detach @@ -2173,19 +2172,19 @@ umass_cam_action(struct cam_sim *sim, un cmd = (uint8_t *)(ccb->csio.cdb_io.cdb_bytes); } - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_SCSI_IO: " + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_SCSI_IO: " "cmd: 0x%02x, flags: 0x%02x, " "%db cmd/%db data/%db sense\n", cam_sim_path(sc->sc_sim), ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, cmd[0], + (uintmax_t)ccb->ccb_h.target_lun, cmd[0], ccb->ccb_h.flags & CAM_DIR_MASK, ccb->csio.cdb_len, ccb->csio.dxfer_len, ccb->csio.sense_len); if (sc->sc_transfer.ccb) { - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_SCSI_IO: " + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_SCSI_IO: " "I/O in progress, deferring\n", cam_sim_path(sc->sc_sim), ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); ccb->ccb_h.status = CAM_SCSI_BUSY; xpt_done(ccb); goto done; @@ -2303,9 +2302,9 @@ umass_cam_action(struct cam_sim *sim, un { struct ccb_pathinq *cpi = &ccb->cpi; - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_PATH_INQ:.\n", + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_PATH_INQ:.\n", sc ? cam_sim_path(sc->sc_sim) : -1, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); /* host specific information */ cpi->version_num = 1; @@ -2358,9 +2357,9 @@ umass_cam_action(struct cam_sim *sim, un } case XPT_RESET_DEV: { - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_RESET_DEV:.\n", + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_RESET_DEV:.\n", cam_sim_path(sc->sc_sim), ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); umass_reset(sc); @@ -2372,9 +2371,9 @@ umass_cam_action(struct cam_sim *sim, un { struct ccb_trans_settings *cts = &ccb->cts; - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_GET_TRAN_SETTINGS:.\n", + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_GET_TRAN_SETTINGS:.\n", cam_sim_path(sc->sc_sim), ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_2; @@ -2388,9 +2387,9 @@ umass_cam_action(struct cam_sim *sim, un } case XPT_SET_TRAN_SETTINGS: { - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_SET_TRAN_SETTINGS:.\n", + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_SET_TRAN_SETTINGS:.\n", cam_sim_path(sc->sc_sim), ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; xpt_done(ccb); @@ -2404,19 +2403,19 @@ umass_cam_action(struct cam_sim *sim, un } case XPT_NOOP: { - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:XPT_NOOP:.\n", + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:XPT_NOOP:.\n", sc ? cam_sim_path(sc->sc_sim) : -1, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun); + (uintmax_t)ccb->ccb_h.target_lun); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; } default: - DPRINTF(sc, UDMASS_SCSI, "%d:%d:%d:func_code 0x%04x: " + DPRINTF(sc, UDMASS_SCSI, "%d:%d:%jx:func_code 0x%04x: " "Not implemented\n", sc ? cam_sim_path(sc->sc_sim) : -1, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, ccb->ccb_h.func_code); + (uintmax_t)ccb->ccb_h.target_lun, ccb->ccb_h.func_code); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; xpt_done(ccb); Modified: head/sys/dev/wds/wd7000.c ============================================================================== --- head/sys/dev/wds/wd7000.c Wed Oct 30 11:41:28 2013 (r257380) +++ head/sys/dev/wds/wd7000.c Wed Oct 30 14:04:47 2013 (r257381) @@ -1048,8 +1048,8 @@ wds_scsi_io(struct cam_sim * sim, struct wp = (struct wds *)cam_sim_softc(sim); ccb_h = &csio->ccb_h; - DBG(DBX "wds%d: cmd TARG=%d LUN=%d\n", unit, ccb_h->target_id, - ccb_h->target_lun); + DBG(DBX "wds%d: cmd TARG=%d LUN=%jx\n", unit, ccb_h->target_id, + (uintmax_t)ccb_h->target_lun); if (ccb_h->target_id > 7 || ccb_h->target_id == WDS_HBA_ID) { ccb_h->status = CAM_TID_INVALID; From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 14:13:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F4066C66; Wed, 30 Oct 2013 14:13:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D311B24BE; Wed, 30 Oct 2013 14:13:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UEDGuC002207; Wed, 30 Oct 2013 14:13:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UEDGYF002203; Wed, 30 Oct 2013 14:13:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310301413.r9UEDGYF002203@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 30 Oct 2013 14:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257382 - in head: lib/libcam sbin/camcontrol sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 14:13:17 -0000 Author: nwhitehorn Date: Wed Oct 30 14:13:15 2013 New Revision: 257382 URL: http://svnweb.freebsd.org/changeset/base/257382 Log: printf() specifier updates to CAM to handle either 32-bit or 64-bit lun_id_t. MFC after: 2 weeks Modified: head/lib/libcam/camlib.c head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_xpt.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Wed Oct 30 14:04:47 2013 (r257381) +++ head/lib/libcam/camlib.c Wed Oct 30 14:13:15 2013 (r257382) @@ -348,16 +348,16 @@ cam_open_btl(path_id_t path_id, target_i if (ccb.cdm.status == CAM_DEV_MATCH_MORE) { snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: CDM reported more than one" - " passthrough device at %d:%d:%d!!\n", - func_name, path_id, target_id, target_lun); + " passthrough device at %d:%d:%jx!!\n", + func_name, path_id, target_id, (uintmax_t)target_lun); goto btl_bailout; } if (ccb.cdm.num_matches == 0) { snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: no passthrough device found at" - " %d:%d:%d", func_name, path_id, target_id, - target_lun); + " %d:%d:%jx", func_name, path_id, target_id, + (uintmax_t)target_lun); goto btl_bailout; } @@ -687,14 +687,14 @@ cam_path_string(struct cam_device *dev, return(str); } - snprintf(str, len, "(%s%d:%s%d:%d:%d:%d): ", + snprintf(str, len, "(%s%d:%s%d:%d:%d:%jx): ", (dev->device_name[0] != '\0') ? dev->device_name : "pass", dev->dev_unit_num, (dev->sim_name[0] != '\0') ? dev->sim_name : "unknown", dev->sim_unit_number, dev->bus_id, dev->target_id, - dev->target_lun); + (uintmax_t)dev->target_lun); return(str); } Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Oct 30 14:04:47 2013 (r257381) +++ head/sbin/camcontrol/camcontrol.c Wed Oct 30 14:13:15 2013 (r257382) @@ -566,11 +566,11 @@ getdevtree(void) } fprintf(stdout, "%-33s at scbus%d " - "target %d lun %d (", + "target %d lun %jx (", tmpstr, dev_result->path_id, dev_result->target_id, - dev_result->target_lun); + (uintmax_t)dev_result->target_lun); need_close = 1; Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Oct 30 14:04:47 2013 (r257381) +++ head/sys/cam/cam_xpt.c Wed Oct 30 14:13:15 2013 (r257382) @@ -1020,14 +1020,14 @@ xpt_announce_periph(struct cam_periph *p cam_periph_assert(periph, MA_OWNED); periph->flags |= CAM_PERIPH_ANNOUNCED; - printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, path->bus->sim->unit_number, path->bus->sim->bus_id, path->bus->path_id, path->target->target_id, - path->device->lun_id); + (uintmax_t)path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); if (path->device->protocol == PROTO_SCSI) scsi_print_inquiry(&path->device->inq_data); @@ -1073,14 +1073,14 @@ xpt_denounce_periph(struct cam_periph *p struct cam_path *path = periph->path; cam_periph_assert(periph, MA_OWNED); - printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, path->bus->sim->unit_number, path->bus->sim->bus_id, path->bus->path_id, path->target->target_id, - path->device->lun_id); + (uintmax_t)path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); if (path->device->protocol == PROTO_SCSI) scsi_print_inquiry_short(&path->device->inq_data); @@ -3647,7 +3647,7 @@ xpt_print_path(struct cam_path *path) printf("X:"); if (path->device != NULL) - printf("%d): ", path->device->lun_id); + printf("%jx): ", (uintmax_t)path->device->lun_id); else printf("X): "); } @@ -3660,11 +3660,11 @@ xpt_print_device(struct cam_ed *device) if (device == NULL) printf("(nopath): "); else { - printf("(noperiph:%s%d:%d:%d:%d): ", device->sim->sim_name, + printf("(noperiph:%s%d:%d:%d:%jx): ", device->sim->sim_name, device->sim->unit_number, device->sim->bus_id, device->target->target_id, - device->lun_id); + (uintmax_t)device->lun_id); } } @@ -3707,7 +3707,8 @@ xpt_path_string(struct cam_path *path, c sbuf_printf(&sb, "X:"); if (path->device != NULL) - sbuf_printf(&sb, "%d): ", path->device->lun_id); + sbuf_printf(&sb, "%jx): ", + (uintmax_t)path->device->lun_id); else sbuf_printf(&sb, "X): "); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 14:33:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AC047958; Wed, 30 Oct 2013 14:33:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B1CC2658; Wed, 30 Oct 2013 14:33:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UEXG7Y009327; Wed, 30 Oct 2013 14:33:16 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UEXGgF009324; Wed, 30 Oct 2013 14:33:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310301433.r9UEXGgF009324@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Oct 2013 14:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257383 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 14:33:16 -0000 Author: ian Date: Wed Oct 30 14:33:15 2013 New Revision: 257383 URL: http://svnweb.freebsd.org/changeset/base/257383 Log: Add some bare-bones support for enabling usb and usbphy clocks. This is temporary code to keep imx development moving forward for now. In the long run we need a SoC-independant clock management API. Modified: head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx51_ccmreg.h head/sys/arm/freescale/imx/imx_machdep.h Modified: head/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccm.c Wed Oct 30 14:13:15 2013 (r257382) +++ head/sys/arm/freescale/imx/imx51_ccm.c Wed Oct 30 14:33:15 2013 (r257383) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define IMXCCMDEBUG #undef IMXCCMDEBUG @@ -473,3 +474,78 @@ imx51_get_clk_gating(int clk_src) return ((reg >> (clk_src % CCMR_CCGR_NSOURCE) * 2) & 0x03); } +/* + * Code from here down is temporary, in lieu of a SoC-independent clock API. + */ + +void +imx_ccm_usb_enable(device_t dev) +{ + uint32_t regval; + + /* + * Select PLL2 as the source for the USB clock. + * The default is PLL3, but U-boot changes it to PLL2. + */ + regval = bus_read_4(ccm_softc->res[0], CCMC_CSCMR1); + regval &= ~CSCMR1_USBOH3_CLK_SEL_MASK; + regval |= 1 << CSCMR1_USBOH3_CLK_SEL_SHIFT; + bus_write_4(ccm_softc->res[0], CCMC_CSCMR1, regval); + + /* + * Set the USB clock pre-divider to div-by-5, post-divider to div-by-2. + */ + regval = bus_read_4(ccm_softc->res[0], CCMC_CSCDR1); + regval &= ~CSCDR1_USBOH3_CLK_PODF_MASK; + regval &= ~CSCDR1_USBOH3_CLK_PRED_MASK; + regval |= 4 << CSCDR1_USBOH3_CLK_PRED_SHIFT; + regval |= 1 << CSCDR1_USBOH3_CLK_PODF_SHIFT; + bus_write_4(ccm_softc->res[0], CCMC_CSCDR1, regval); + + /* + * The same two clocks gates are used on imx51 and imx53. + */ + imx51_clk_gating(CCGR_USBOH3_IPG_AHB_CLK, CCGR_CLK_MODE_ALWAYS); + imx51_clk_gating(CCGR_USBOH3_60M_CLK, CCGR_CLK_MODE_ALWAYS); +} + +void +imx_ccm_usbphy_enable(device_t dev) +{ + uint32_t regval; + + /* + * Select PLL3 as the source for the USBPHY clock. U-boot does this + * only for imx53, but the bit exists on imx51. That seems a bit + * strange, but we'll go with it until more is known. + */ + if (imx_soc_type() == IMXSOC_53) { + regval = bus_read_4(ccm_softc->res[0], CCMC_CSCMR1); + regval |= 1 << CSCMR1_USBPHY_CLK_SEL_SHIFT; + bus_write_4(ccm_softc->res[0], CCMC_CSCMR1, regval); + } + + /* + * For the imx51 there's just one phy gate control, enable it. + */ + if (imx_soc_type() == IMXSOC_51) { + imx51_clk_gating(CCGR_USB_PHY_CLK, CCGR_CLK_MODE_ALWAYS); + return; + } + + /* + * For imx53 we don't have a full set of clock defines yet, but the + * datasheet says: + * gate reg 4, bits 13-12 usb ph2 clock (usb_phy2_clk_enable) + * gate reg 4, bits 11-10 usb ph1 clock (usb_phy1_clk_enable) + * + * We should use the fdt data for the device to figure out which of + * the two we're working on, but for now just turn them both on. + */ + if (imx_soc_type() == IMXSOC_53) { + imx51_clk_gating(__CCGR_NUM(4, 5), CCGR_CLK_MODE_ALWAYS); + imx51_clk_gating(__CCGR_NUM(4, 6), CCGR_CLK_MODE_ALWAYS); + return; + } +} + Modified: head/sys/arm/freescale/imx/imx51_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccmreg.h Wed Oct 30 14:13:15 2013 (r257382) +++ head/sys/arm/freescale/imx/imx51_ccmreg.h Wed Oct 30 14:33:15 2013 (r257383) @@ -114,12 +114,20 @@ #define CCMC_CSCMR1 0x001c #define CSCMR1_UART_CLK_SEL_SHIFT 24 #define CSCMR1_UART_CLK_SEL_MASK 0x03000000 +#define CSCMR1_USBPHY_CLK_SEL_SHIFT 26 +#define CSCMR1_USBPHY_CLK_SEL_MASK 0x04000000 +#define CSCMR1_USBOH3_CLK_SEL_SHIFT 22 +#define CSCMR1_USBOH3_CLK_SEL_MASK 0x00c00000 #define CCMC_CSCMR2 0x0020 #define CCMC_CSCDR1 0x0024 #define CSCDR1_UART_CLK_PRED_SHIFT 3 #define CSCDR1_UART_CLK_PRED_MASK 0x00000038 #define CSCDR1_UART_CLK_PODF_SHIFT 0 #define CSCDR1_UART_CLK_PODF_MASK 0x00000007 +#define CSCDR1_USBOH3_CLK_PRED_SHIFT 8 +#define CSCDR1_USBOH3_CLK_PRED_MASK 0x00000700 +#define CSCDR1_USBOH3_CLK_PODF_SHIFT 6 +#define CSCDR1_USBOH3_CLK_PODF_MASK 0x000000c0 #define CCMC_CS1CDR 0x0028 #define CCMC_CS2CDR 0x002c #define CCMC_CDCDR 0x0030 Modified: head/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.h Wed Oct 30 14:13:15 2013 (r257382) +++ head/sys/arm/freescale/imx/imx_machdep.h Wed Oct 30 14:33:15 2013 (r257383) @@ -56,5 +56,21 @@ u_int imx_soc_family(void); void imx_devmap_init(void); +/* + * We need a clock management system that works across unrelated SoCs and + * devices. For now, to keep imx development moving, define some barebones + * functionality that can be shared within the imx family by having each SoC + * implement functions with a common name. + * + * The usb enable functions are best-effort. They turn on the usb otg, host, + * and phy clocks in a SoC-specific manner, but it may take a lot more than that + * to make usb work on a given board. In particular, it can require specific + * pinmux setup of gpio pins connected to external phy parts, voltage regulators + * and overcurrent detectors, and so on. On such boards, u-boot or other early + * board setup code has to handle those things. + */ +void imx_ccm_usb_enable(device_t _usbdev); +void imx_ccm_usbphy_enable(device_t _phydev); + #endif From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 14:38:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6A12D92; Wed, 30 Oct 2013 14:38:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A52E326A7; Wed, 30 Oct 2013 14:38:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UEcPpq009934; Wed, 30 Oct 2013 14:38:25 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UEcPud009931; Wed, 30 Oct 2013 14:38:25 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310301438.r9UEcPud009931@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Oct 2013 14:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257384 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 14:38:25 -0000 Author: ian Date: Wed Oct 30 14:38:24 2013 New Revision: 257384 URL: http://svnweb.freebsd.org/changeset/base/257384 Log: Add a "no-op" USB PHY driver for imx-family SoCs. This is used when the phy clocks need to be enabled, but no other hardware setup is needed to make the phy work. Added: head/sys/arm/freescale/imx/imx_nop_usbphy.c (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Wed Oct 30 14:33:15 2013 (r257383) +++ head/sys/arm/freescale/imx/files.imx51 Wed Oct 30 14:38:24 2013 (r257384) @@ -37,7 +37,8 @@ dev/ata/chipsets/ata-fsl.c optional imx # UART driver dev/uart/uart_dev_imx.c optional uart -# USB join controller (1 OTG, 3 EHCI) +# USB OH3 controller (1 OTG, 3 EHCI) +arm/freescale/imx/imx_nop_usbphy.c optional echi dev/usb/controller/ehci_imx.c optional ehci # Watchdog Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Wed Oct 30 14:33:15 2013 (r257383) +++ head/sys/arm/freescale/imx/files.imx53 Wed Oct 30 14:38:24 2013 (r257384) @@ -37,7 +37,8 @@ arm/freescale/imx/imx51_ccm.c standard # i.MX5xx PATA controller dev/ata/chipsets/ata-fsl.c optional imxata -# USB join controller (1 OTG, 3 EHCI) +# USB OH3 controller (1 OTG, 3 EHCI) +arm/freescale/imx/imx_nop_usbphy.c optional ehci dev/usb/controller/ehci_imx.c optional ehci # Watchdog Added: head/sys/arm/freescale/imx/imx_nop_usbphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_nop_usbphy.c Wed Oct 30 14:38:24 2013 (r257384) @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2013 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$"); + +/* + * USBPHY "no-op" driver for Freescale family of SoCs. This driver is used on + * SoCs which have usbphy hardware whose clocks need to be enabled, but no other + * action has to be taken to make the hardware work. + */ + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Table of supported FDT compat strings. + */ +static struct ofw_compat_data compat_data[] = { + {"nop-usbphy", true}, + {"usb-nop-xceiv", true}, + {NULL, false}, +}; + +struct usbphy_softc { + device_t dev; + u_int phy_num; +}; + +static int +usbphy_detach(device_t dev) +{ + + return (0); +} + +static int +usbphy_attach(device_t dev) +{ + struct usbphy_softc *sc; + + sc = device_get_softc(dev); + + /* + * Turn on the phy clocks. + */ + imx_ccm_usbphy_enable(dev); + + return (0); +} + +static int +usbphy_probe(device_t dev) +{ + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale USB PHY"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static device_method_t usbphy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, usbphy_probe), + DEVMETHOD(device_attach, usbphy_attach), + DEVMETHOD(device_detach, usbphy_detach), + + DEVMETHOD_END +}; + +static driver_t usbphy_driver = { + "usbphy", + usbphy_methods, + sizeof(struct usbphy_softc) +}; + +static devclass_t usbphy_devclass; + +DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0); + From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 14:45:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B4282459; Wed, 30 Oct 2013 14:45:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 884372731; Wed, 30 Oct 2013 14:45:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UEj2TK014379; Wed, 30 Oct 2013 14:45:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UEj2nk014378; Wed, 30 Oct 2013 14:45:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310301445.r9UEj2nk014378@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 30 Oct 2013 14:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257385 - head/tools/regression/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 14:45:02 -0000 Author: trasz Date: Wed Oct 30 14:45:02 2013 New Revision: 257385 URL: http://svnweb.freebsd.org/changeset/base/257385 Log: Sponsored by: The FreeBSD Foundation Modified: head/tools/regression/iscsi/ctl.conf Modified: head/tools/regression/iscsi/ctl.conf ============================================================================== --- head/tools/regression/iscsi/ctl.conf Wed Oct 30 14:38:24 2013 (r257384) +++ head/tools/regression/iscsi/ctl.conf Wed Oct 30 14:45:02 2013 (r257385) @@ -1,3 +1,5 @@ +#XXX + auth-group meh { chap user secretsecret } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 14:48:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 061BA7BE; Wed, 30 Oct 2013 14:48:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8A9C276A; Wed, 30 Oct 2013 14:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UEmk83015048; Wed, 30 Oct 2013 14:48:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UEmk8f015047; Wed, 30 Oct 2013 14:48:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310301448.r9UEmk8f015047@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 30 Oct 2013 14:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257386 - head/tools/regression/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 14:48:47 -0000 Author: trasz Date: Wed Oct 30 14:48:46 2013 New Revision: 257386 URL: http://svnweb.freebsd.org/changeset/base/257386 Log: Revert r257385; was testing a shell script to automatically append the proper "Sponsored by" and failed at error handling. Sponsored by: The FreeBSD Foundation Modified: head/tools/regression/iscsi/ctl.conf Modified: head/tools/regression/iscsi/ctl.conf ============================================================================== --- head/tools/regression/iscsi/ctl.conf Wed Oct 30 14:45:02 2013 (r257385) +++ head/tools/regression/iscsi/ctl.conf Wed Oct 30 14:48:46 2013 (r257386) @@ -1,5 +1,3 @@ -#XXX - auth-group meh { chap user secretsecret } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 15:46:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 30DAE13C; Wed, 30 Oct 2013 15:46:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3772BDC; Wed, 30 Oct 2013 15:46:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UFkoaJ036400; Wed, 30 Oct 2013 15:46:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UFkoqw036399; Wed, 30 Oct 2013 15:46:50 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310301546.r9UFkoqw036399@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 30 Oct 2013 15:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257388 - head/lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 15:46:51 -0000 Author: nwhitehorn Date: Wed Oct 30 15:46:50 2013 New Revision: 257388 URL: http://svnweb.freebsd.org/changeset/base/257388 Log: Add missing header. Submitted by: Sean Bruno Modified: head/lib/libcam/camlib.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Wed Oct 30 15:25:23 2013 (r257387) +++ head/lib/libcam/camlib.c Wed Oct 30 15:46:50 2013 (r257388) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 16:08:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3143FF18; Wed, 30 Oct 2013 16:08:28 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1282D65; Wed, 30 Oct 2013 16:08:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UG8RNN044248; Wed, 30 Oct 2013 16:08:27 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UG8Rn5044246; Wed, 30 Oct 2013 16:08:27 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201310301608.r9UG8Rn5044246@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 30 Oct 2013 16:08:27 +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: r257389 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 16:08:28 -0000 Author: melifaro Date: Wed Oct 30 16:08:27 2013 New Revision: 257389 URL: http://svnweb.freebsd.org/changeset/base/257389 Log: MFC r256624: Fix long-standing issue with incorrect radix mask calculation. Usual symptoms are messages like rn_delete: inconsistent annotation rn_addmask: mask impossibly already in tree routing daemon constantly deleting IPv6 default route or inability to flush/delete particular prefix in ipfw table. Changes: * Assume 32 bytes as maximum radix key length * Remove rn_init() * Statically allocate rn_ones/rn_zeroes * Make separate mask tree for each "normal" tree instead of system global one * Remove "optimization" on masks reusage and key zeroying * Change rn_addmask() arguments to accept tree pointer (no users in base) MFC changes: * keep rn_init() * create global mask tree, protected with mutex, for old rn_addmask users (currently 0 in base) * Add new rn_addmask_r() function (rn_addmask in head) with additional argument to accept tree pointer PR: kern/182851, kern/169206, kern/135476, kern/134531 Found by: Slawa Olhovchenkov Reviewed by: glebius (previous versions) Sponsored by: Yandex LLC Modified: stable/9/sys/net/radix.c stable/9/sys/net/radix.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/radix.c ============================================================================== --- stable/9/sys/net/radix.c Wed Oct 30 15:46:50 2013 (r257388) +++ stable/9/sys/net/radix.c Wed Oct 30 16:08:27 2013 (r257389) @@ -66,27 +66,27 @@ static struct radix_node *rn_search(void *, struct radix_node *), *rn_search_m(void *, struct radix_node *, void *); -static int max_keylen; -static struct radix_mask *rn_mkfreelist; -static struct radix_node_head *mask_rnhead; +static void rn_detachhead_internal(void **head); +static int rn_inithead_internal(void **head, int off); + +#define RADIX_MAX_KEY_LEN 32 + +static char rn_zeros[RADIX_MAX_KEY_LEN]; +static char rn_ones[RADIX_MAX_KEY_LEN] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, +}; + /* - * Work area -- the following point to 3 buffers of size max_keylen, - * allocated in this order in a block of memory malloc'ed by rn_init. - * rn_zeros, rn_ones are set in rn_init and used in readonly afterwards. - * addmask_key is used in rn_addmask in rw mode and not thread-safe. + * XXX: Compat stuff for old rn_addmask() users */ -static char *rn_zeros, *rn_ones, *addmask_key; - -#define MKGet(m) { \ - if (rn_mkfreelist) { \ - m = rn_mkfreelist; \ - rn_mkfreelist = (m)->rm_mklist; \ - } else \ - R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask)); } - -#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);} +static struct radix_node_head *mask_rnhead_compat; +#ifdef _KERNEL +static struct mtx mask_mtx; +#endif -#define rn_masktop (mask_rnhead->rnh_treetop) static int rn_lexobetter(void *m_arg, void *n_arg); static struct radix_mask * @@ -230,7 +230,8 @@ rn_lookup(v_arg, m_arg, head) caddr_t netmask = 0; if (m_arg) { - x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_offset); + x = rn_addmask_r(m_arg, head->rnh_masks, 1, + head->rnh_treetop->rn_offset); if (x == 0) return (0); netmask = x->rn_key; @@ -489,53 +490,47 @@ on1: } struct radix_node * -rn_addmask(n_arg, search, skip) - int search, skip; - void *n_arg; +rn_addmask_r(void *arg, struct radix_node_head *maskhead, int search, int skip) { - caddr_t netmask = (caddr_t)n_arg; + caddr_t netmask = (caddr_t)arg; register struct radix_node *x; register caddr_t cp, cplim; register int b = 0, mlen, j; - int maskduplicated, m0, isnormal; + int maskduplicated, isnormal; struct radix_node *saved_x; - static int last_zeroed = 0; + char addmask_key[RADIX_MAX_KEY_LEN]; - if ((mlen = LEN(netmask)) > max_keylen) - mlen = max_keylen; + if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN) + mlen = RADIX_MAX_KEY_LEN; if (skip == 0) skip = 1; if (mlen <= skip) - return (mask_rnhead->rnh_nodes); + return (maskhead->rnh_nodes); + + bzero(addmask_key, RADIX_MAX_KEY_LEN); if (skip > 1) bcopy(rn_ones + 1, addmask_key + 1, skip - 1); - if ((m0 = mlen) > skip) - bcopy(netmask + skip, addmask_key + skip, mlen - skip); + bcopy(netmask + skip, addmask_key + skip, mlen - skip); /* * Trim trailing zeroes. */ for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;) cp--; mlen = cp - addmask_key; - if (mlen <= skip) { - if (m0 >= last_zeroed) - last_zeroed = mlen; - return (mask_rnhead->rnh_nodes); - } - if (m0 < last_zeroed) - bzero(addmask_key + m0, last_zeroed - m0); - *addmask_key = last_zeroed = mlen; - x = rn_search(addmask_key, rn_masktop); + if (mlen <= skip) + return (maskhead->rnh_nodes); + *addmask_key = mlen; + x = rn_search(addmask_key, maskhead->rnh_treetop); if (bcmp(addmask_key, x->rn_key, mlen) != 0) x = 0; if (x || search) return (x); - R_Zalloc(x, struct radix_node *, max_keylen + 2 * sizeof (*x)); + R_Zalloc(x, struct radix_node *, RADIX_MAX_KEY_LEN + 2 * sizeof (*x)); if ((saved_x = x) == 0) return (0); netmask = cp = (caddr_t)(x + 2); bcopy(addmask_key, cp, mlen); - x = rn_insert(cp, mask_rnhead, &maskduplicated, x); + x = rn_insert(cp, maskhead, &maskduplicated, x); if (maskduplicated) { log(LOG_ERR, "rn_addmask: mask impossibly already in tree"); Free(saved_x); @@ -568,6 +563,23 @@ rn_addmask(n_arg, search, skip) return (x); } +struct radix_node * +rn_addmask(void *n_arg, int search, int skip) +{ + struct radix_node *tt; + +#ifdef _KERNEL + mtx_lock(&mask_mtx); +#endif + tt = rn_addmask_r(&mask_rnhead_compat, n_arg, search, skip); + +#ifdef _KERNEL + mtx_unlock(&mask_mtx); +#endif + + return (tt); +} + static int /* XXX: arbitrary ordering for non-contiguous masks */ rn_lexobetter(m_arg, n_arg) void *m_arg, *n_arg; @@ -590,12 +602,12 @@ rn_new_radix_mask(tt, next) { register struct radix_mask *m; - MKGet(m); + R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask)); if (m == 0) { - log(LOG_ERR, "Mask for route not entered\n"); + log(LOG_ERR, "Failed to allocate route mask\n"); return (0); } - bzero(m, sizeof *m); + bzero(m, sizeof(*m)); m->rm_bit = tt->rn_bit; m->rm_flags = tt->rn_flags; if (tt->rn_flags & RNF_NORMAL) @@ -629,7 +641,8 @@ rn_addroute(v_arg, n_arg, head, treenode * nodes and possibly save time in calculating indices. */ if (netmask) { - if ((x = rn_addmask(netmask, 0, top->rn_offset)) == 0) + x = rn_addmask_r(netmask, head->rnh_masks, 0, top->rn_offset); + if (x == NULL) return (0); b_leaf = x->rn_bit; b = -1 - x->rn_bit; @@ -808,7 +821,8 @@ rn_delete(v_arg, netmask_arg, head) * Delete our route from mask lists. */ if (netmask) { - if ((x = rn_addmask(netmask, 1, head_off)) == 0) + x = rn_addmask_r(netmask, head->rnh_masks, 1, head_off); + if (x == NULL) return (0); netmask = x->rn_key; while (tt->rn_mask != netmask) @@ -841,7 +855,7 @@ rn_delete(v_arg, netmask_arg, head) for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) if (m == saved_m) { *mp = m->rm_mklist; - MKFree(m); + Free(m); break; } if (m == 0) { @@ -932,7 +946,7 @@ on1: struct radix_mask *mm = m->rm_mklist; x->rn_mklist = 0; if (--(m->rm_refs) < 0) - MKFree(m); + Free(m); m = mm; } if (m) @@ -1128,10 +1142,8 @@ rn_walktree(h, f, w) * bits starting at 'off'. * Return 1 on success, 0 on error. */ -int -rn_inithead(head, off) - void **head; - int off; +static int +rn_inithead_internal(void **head, int off) { register struct radix_node_head *rnh; register struct radix_node *t, *tt, *ttt; @@ -1163,8 +1175,8 @@ rn_inithead(head, off) return (1); } -int -rn_detachhead(void **head) +static void +rn_detachhead_internal(void **head) { struct radix_node_head *rnh; @@ -1176,28 +1188,60 @@ rn_detachhead(void **head) Free(rnh); *head = NULL; +} + +int +rn_inithead(void **head, int off) +{ + struct radix_node_head *rnh; + + if (*head != NULL) + return (1); + + if (rn_inithead_internal(head, off) == 0) + return (0); + + rnh = (struct radix_node_head *)(*head); + + if (rn_inithead_internal((void **)&rnh->rnh_masks, 0) == 0) { + rn_detachhead_internal(head); + return (0); + } + + return (1); +} + +int +rn_detachhead(void **head) +{ + struct radix_node_head *rnh; + + KASSERT((head != NULL && *head != NULL), + ("%s: head already freed", __func__)); + + rnh = *head; + + rn_detachhead_internal((void **)&rnh->rnh_masks); + rn_detachhead_internal(head); return (1); } void rn_init(int maxk) { - char *cp, *cplim; - - max_keylen = maxk; - if (max_keylen == 0) { + if ((maxk <= 0) || (maxk > RADIX_MAX_KEY_LEN)) { log(LOG_ERR, - "rn_init: radix functions require max_keylen be set\n"); + "rn_init: max_keylen must be within 1..%d\n", + RADIX_MAX_KEY_LEN); return; } - R_Malloc(rn_zeros, char *, 3 * max_keylen); - if (rn_zeros == NULL) - panic("rn_init"); - bzero(rn_zeros, 3 * max_keylen); - rn_ones = cp = rn_zeros + max_keylen; - addmask_key = cplim = rn_ones + max_keylen; - while (cp < cplim) - *cp++ = -1; - if (rn_inithead((void **)(void *)&mask_rnhead, 0) == 0) + + /* + * XXX: Compat for old rn_addmask() users + */ + if (rn_inithead((void **)(void *)&mask_rnhead_compat, 0) == 0) panic("rn_init 2"); +#ifdef _KERNEL + mtx_init(&mask_mtx, "radix_mask", NULL, MTX_DEF); +#endif } Modified: stable/9/sys/net/radix.h ============================================================================== --- stable/9/sys/net/radix.h Wed Oct 30 15:46:50 2013 (r257388) +++ stable/9/sys/net/radix.h Wed Oct 30 16:08:27 2013 (r257389) @@ -136,6 +136,7 @@ struct radix_node_head { #ifdef _KERNEL struct rwlock rnh_lock; /* locks entire radix tree */ #endif + struct radix_node_head *rnh_masks; /* Storage for our masks */ }; #ifndef _KERNEL @@ -167,6 +168,7 @@ int rn_detachhead(void **); int rn_refines(void *, void *); struct radix_node *rn_addmask(void *, int, int), + *rn_addmask_r(void *, struct radix_node_head *, int, int), *rn_addroute (void *, void *, struct radix_node_head *, struct radix_node [2]), *rn_delete(void *, void *, struct radix_node_head *), From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 16:34:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A02ABDD; Wed, 30 Oct 2013 16:34:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E0702F95; Wed, 30 Oct 2013 16:34:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UGYQuG054382; Wed, 30 Oct 2013 16:34:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UGYQWL054381; Wed, 30 Oct 2013 16:34:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310301634.r9UGYQWL054381@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Oct 2013 16:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257390 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 16:34:26 -0000 Author: ian Date: Wed Oct 30 16:34:26 2013 New Revision: 257390 URL: http://svnweb.freebsd.org/changeset/base/257390 Log: Add a vendor entry for Freescale Semiconductor. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Oct 30 16:08:27 2013 (r257389) +++ head/sys/dev/usb/usbdevs Wed Oct 30 16:34:26 2013 (r257390) @@ -655,6 +655,7 @@ vendor OWEN 0x1555 Owen vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline +vendor FREESCALE 0x15a2 Freescale Semiconductor, Inc. vendor AFATECH 0x15a4 Afatech Technologies, Inc. vendor SPARKLAN 0x15a9 SparkLAN vendor OLIMEX 0x15ba Olimex From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 16:56:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8876E9D9; Wed, 30 Oct 2013 16:56:47 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7543D2155; Wed, 30 Oct 2013 16:56:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UGul64061253; Wed, 30 Oct 2013 16:56:47 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UGul3V061251; Wed, 30 Oct 2013 16:56:47 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310301656.r9UGul3V061251@svn.freebsd.org> From: Andre Oppermann Date: Wed, 30 Oct 2013 16:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257391 - in head/sys: dev/snc mips/nlm/dev/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 16:56:47 -0000 Author: andre Date: Wed Oct 30 16:56:46 2013 New Revision: 257391 URL: http://svnweb.freebsd.org/changeset/base/257391 Log: nclude missing net/if_var.h. Due to header pollution it wasn't noticed before. Modified: head/sys/dev/snc/dp83932.c head/sys/mips/nlm/dev/net/xlpge.c Modified: head/sys/dev/snc/dp83932.c ============================================================================== --- head/sys/dev/snc/dp83932.c Wed Oct 30 16:34:26 2013 (r257390) +++ head/sys/dev/snc/dp83932.c Wed Oct 30 16:56:46 2013 (r257391) @@ -74,6 +74,7 @@ #include #include +#include #include #include #include Modified: head/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- head/sys/mips/nlm/dev/net/xlpge.c Wed Oct 30 16:34:26 2013 (r257390) +++ head/sys/mips/nlm/dev/net/xlpge.c Wed Oct 30 16:56:46 2013 (r257391) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 17:40:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B33A8B0A; Wed, 30 Oct 2013 17:40:16 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D354D2514; Wed, 30 Oct 2013 17:40:15 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id n12so1672427wgh.29 for ; Wed, 30 Oct 2013 10:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=9/1aVYMUJrjrJ9Wb9h8flbBhrxL9b2rg/NnJ3GbgKUo=; b=c3wcD9aZncO3sDmurcFdPO/25nNiYJJFsyjMMrr2RvVy1yBBFup2wsCt8WXxzvmvRJ vM6YcbNNTUMC4ut9wWj00Fzl6xrYdRD29gfrBVGtll4sla6GiAslmzfcD6ICaW/d2J8r UJ+5tWnOt49Px8QsgH2C1HbGjo7wYkAZJRKpjZwHUYQffXcBCc6jR2kYm37ZVfOBDvYd jIOd13jWuZx4f7iP6adM4GLER7y4dVP72cn1HciLGvnjD78M1cEr6Wehv9E03V0Bokk/ 6Rv3x+MjOJyW4fv7urcnJMKjajl+XbueWMDeBzI1XVZdr5nYw+MWkamF1hWFqeA1eVjp YHPw== MIME-Version: 1.0 X-Received: by 10.194.241.228 with SMTP id wl4mr6214027wjc.2.1383154814339; Wed, 30 Oct 2013 10:40:14 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.203.195 with HTTP; Wed, 30 Oct 2013 10:40:14 -0700 (PDT) In-Reply-To: <201310301656.r9UGul3V061251@svn.freebsd.org> References: <201310301656.r9UGul3V061251@svn.freebsd.org> Date: Wed, 30 Oct 2013 21:40:14 +0400 X-Google-Sender-Auth: sBivN7ZR6c_balm8LHsvNf1UYnM Message-ID: Subject: Re: svn commit: r257391 - in head/sys: dev/snc mips/nlm/dev/net From: Sergey Kandaurov To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 17:40:16 -0000 On 30 October 2013 20:56, Andre Oppermann wrote: > Author: andre > Date: Wed Oct 30 16:56:46 2013 > New Revision: 257391 > URL: http://svnweb.freebsd.org/changeset/base/257391 > > Log: > nclude missing net/if_var.h. > > Due to header pollution it wasn't noticed before. > > Modified: > head/sys/dev/snc/dp83932.c > head/sys/mips/nlm/dev/net/xlpge.c > > Modified: head/sys/dev/snc/dp83932.c > ============================================================================== > --- head/sys/dev/snc/dp83932.c Wed Oct 30 16:34:26 2013 (r257390) > +++ head/sys/dev/snc/dp83932.c Wed Oct 30 16:56:46 2013 (r257391) > @@ -74,6 +74,7 @@ > > #include > #include > +#include > #include > #include > #include > > Modified: head/sys/mips/nlm/dev/net/xlpge.c > ============================================================================== > --- head/sys/mips/nlm/dev/net/xlpge.c Wed Oct 30 16:34:26 2013 (r257390) > +++ head/sys/mips/nlm/dev/net/xlpge.c Wed Oct 30 16:56:46 2013 (r257391) > @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > #include > #include To complete TARGET=pc98 KERNCONF=GENERIC crossbuild, I had to apply also this change: Index: sys/dev/snc/if_snc.c =================================================================== --- sys/dev/snc/if_snc.c (revision 257391) +++ sys/dev/snc/if_snc.c (working copy) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Index: sys/dev/snc/if_snc_pccard.c =================================================================== --- sys/dev/snc/if_snc_pccard.c (revision 257391) +++ sys/dev/snc/if_snc_pccard.c (working copy) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 17:49:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3DBCCFFE for ; Wed, 30 Oct 2013 17:49:57 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88F8825AF for ; Wed, 30 Oct 2013 17:49:56 +0000 (UTC) Received: (qmail 63363 invoked from network); 30 Oct 2013 18:20:16 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 30 Oct 2013 18:20:16 -0000 Message-ID: <527146AD.4060905@freebsd.org> Date: Wed, 30 Oct 2013 18:49:33 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: svn commit: r257391 - in head/sys: dev/snc mips/nlm/dev/net References: <201310301656.r9UGul3V061251@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 17:49:57 -0000 On 30.10.2013 18:40, Sergey Kandaurov wrote: > On 30 October 2013 20:56, Andre Oppermann wrote: >> Author: andre >> Date: Wed Oct 30 16:56:46 2013 >> New Revision: 257391 >> URL: http://svnweb.freebsd.org/changeset/base/257391 >> >> Log: >> nclude missing net/if_var.h. >> >> Due to header pollution it wasn't noticed before. >> >> Modified: >> head/sys/dev/snc/dp83932.c >> head/sys/mips/nlm/dev/net/xlpge.c >> >> Modified: head/sys/dev/snc/dp83932.c >> ============================================================================== >> --- head/sys/dev/snc/dp83932.c Wed Oct 30 16:34:26 2013 (r257390) >> +++ head/sys/dev/snc/dp83932.c Wed Oct 30 16:56:46 2013 (r257391) >> @@ -74,6 +74,7 @@ >> >> #include >> #include >> +#include >> #include >> #include >> #include >> >> Modified: head/sys/mips/nlm/dev/net/xlpge.c >> ============================================================================== >> --- head/sys/mips/nlm/dev/net/xlpge.c Wed Oct 30 16:34:26 2013 (r257390) >> +++ head/sys/mips/nlm/dev/net/xlpge.c Wed Oct 30 16:56:46 2013 (r257391) >> @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); >> #include >> >> #include >> +#include >> #include >> #include >> #include > > To complete TARGET=pc98 KERNCONF=GENERIC crossbuild, > I had to apply also this change: Please commit. :) -- Andre > Index: sys/dev/snc/if_snc.c > =================================================================== > --- sys/dev/snc/if_snc.c (revision 257391) > +++ sys/dev/snc/if_snc.c (working copy) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > #include > Index: sys/dev/snc/if_snc_pccard.c > =================================================================== > --- sys/dev/snc/if_snc_pccard.c (revision 257391) > +++ sys/dev/snc/if_snc_pccard.c (working copy) > @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > > #include > #include > From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 17:55:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 82B7E26F; Wed, 30 Oct 2013 17:55:32 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F92F262A; Wed, 30 Oct 2013 17:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UHtWWe081302; Wed, 30 Oct 2013 17:55:32 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UHtWff081300; Wed, 30 Oct 2013 17:55:32 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201310301755.r9UHtWff081300@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 30 Oct 2013 17:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257392 - head/sys/dev/snc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 17:55:32 -0000 Author: pluknet Date: Wed Oct 30 17:55:31 2013 New Revision: 257392 URL: http://svnweb.freebsd.org/changeset/base/257392 Log: Include the now missing headers after untangling if.h and if_var.h. This fixes pc98 build. Reviewed by: andre Modified: head/sys/dev/snc/if_snc.c head/sys/dev/snc/if_snc_pccard.c Modified: head/sys/dev/snc/if_snc.c ============================================================================== --- head/sys/dev/snc/if_snc.c Wed Oct 30 16:56:46 2013 (r257391) +++ head/sys/dev/snc/if_snc.c Wed Oct 30 17:55:31 2013 (r257392) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/snc/if_snc_pccard.c ============================================================================== --- head/sys/dev/snc/if_snc_pccard.c Wed Oct 30 16:56:46 2013 (r257391) +++ head/sys/dev/snc/if_snc_pccard.c Wed Oct 30 17:55:31 2013 (r257392) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 18:26:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C0D919F; Wed, 30 Oct 2013 18:26:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67B7628BD; Wed, 30 Oct 2013 18:26:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UIQKwn091979; Wed, 30 Oct 2013 18:26:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UIQJQZ091972; Wed, 30 Oct 2013 18:26:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310301826.r9UIQJQZ091972@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Oct 2013 18:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257393 - in head/sys: boot/fdt/dts dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 18:26:20 -0000 Author: ian Date: Wed Oct 30 18:26:18 2013 New Revision: 257393 URL: http://svnweb.freebsd.org/changeset/base/257393 Log: Rework the imx ehci driver so that it's four separate ehci units rather than one unit with four busses attached to it. This allows us to use existing fdt data which describes separate devices with separate resources. It also allows any combination of the units to be en/disabled in the board dts files. Adjust our dts code to match what's used by linux and u-boot now that we're structured to do so. Document lots of interesting stuff learned whiling doing this with a big comment block in the driver, so I don't have to re-learn it for the next round of changes. Modified: head/sys/boot/fdt/dts/digi-ccwmx53.dts head/sys/boot/fdt/dts/efikamx.dts head/sys/boot/fdt/dts/imx51x.dtsi head/sys/boot/fdt/dts/imx53-qsb.dts head/sys/boot/fdt/dts/imx53x.dtsi head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/boot/fdt/dts/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/digi-ccwmx53.dts Wed Oct 30 17:55:31 2013 (r257392) +++ head/sys/boot/fdt/dts/digi-ccwmx53.dts Wed Oct 30 18:26:18 2013 (r257393) @@ -90,6 +90,12 @@ gpio@53f90000 { status = "okay"; }; + usb@53f80000 /* OTG */ { + status = "okay"; + }; + usb@53f80200 /* Host 1 */ { + status = "okay"; + }; wdog@53f98000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/efikamx.dts ============================================================================== --- head/sys/boot/fdt/dts/efikamx.dts Wed Oct 30 17:55:31 2013 (r257392) +++ head/sys/boot/fdt/dts/efikamx.dts Wed Oct 30 18:26:18 2013 (r257393) @@ -89,6 +89,12 @@ gpio@73f90000 { status = "okay"; }; + usb@73f80000 /* OTG */ { + status = "okay"; + }; + usb@73f80200 /* Host 1 */ { + status = "okay"; + }; wdog@73f98000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/imx51x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/imx51x.dtsi Wed Oct 30 17:55:31 2013 (r257392) +++ head/sys/boot/fdt/dts/imx51x.dtsi Wed Oct 30 18:26:18 2013 (r257393) @@ -246,16 +246,48 @@ /* 7003C000 0x4000 SPBA */ }; - /* 73F80000 0x4000 USBOH3 */ - /* irq14 USBOH3 USB Host 1 */ - /* irq16 USBOH3 USB Host 2 */ - /* irq17 USBOH3 USB Host 3 */ - /* irq18 USBOH3 USB OTG */ - usb1: usb@73F80000 { - compatible = "fsl,usb-4core"; - reg = <0x73f80000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <18 14 16 17>; + usbphy0: usbphy@0 { + compatible = "usb-nop-xceiv"; + status = "okay"; + }; + + usbotg: usb@73f80000 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80000 0x0200>; + interrupts = <18>; + fsl,usbmisc = <&usbmisc 0>; + fsl,usbphy = <&usbphy0>; + status = "disabled"; + }; + + usbh1: usb@73f80200 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80200 0x0200>; + interrupts = <14>; + fsl,usbmisc = <&usbmisc 1>; + status = "disabled"; + }; + + usbh2: usb@73f80400 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80400 0x0200>; + interrupts = <16>; + fsl,usbmisc = <&usbmisc 2>; + status = "disabled"; + }; + + usbh3: usb@73f80600 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80600 0x0200>; + interrupts = <17>; + fsl,usbmisc = <&usbmisc 3>; + status = "disabled"; + }; + + usbmisc: usbmisc@73f80800 { + #index-cells = <1>; + compatible = "fsl,imx51-usbmisc"; + reg = <0x73f80800 0x200>; }; /* 73F98000 0x4000 WDOG1 */ Modified: head/sys/boot/fdt/dts/imx53-qsb.dts ============================================================================== --- head/sys/boot/fdt/dts/imx53-qsb.dts Wed Oct 30 17:55:31 2013 (r257392) +++ head/sys/boot/fdt/dts/imx53-qsb.dts Wed Oct 30 18:26:18 2013 (r257393) @@ -28,6 +28,7 @@ * SUCH DAMAGE. * * Freescale i.MX53 Quick Start Board + * In u-boot, this board is known as "MX53LOCO" for some reason. * * $FreeBSD$ */ @@ -90,6 +91,12 @@ gpio@53f90000 { status = "okay"; }; + usb@53f80000 /* OTG */ { + status = "okay"; + }; + usb@53f80200 /* Host 1 */ { + status = "okay"; + }; wdog@53f98000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/imx53x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/imx53x.dtsi Wed Oct 30 17:55:31 2013 (r257392) +++ head/sys/boot/fdt/dts/imx53x.dtsi Wed Oct 30 18:26:18 2013 (r257393) @@ -290,16 +290,50 @@ /* 5003C000 0x4000 SPBA */ }; - /* 73F80000 0x4000 USBOH3 */ - /* irq14 USBOH3 USB Host 1 */ - /* irq16 USBOH3 USB Host 2 */ - /* irq17 USBOH3 USB Host 3 */ - /* irq18 USBOH3 USB OTG */ - usb1: usb@53F80000 { - compatible = "fsl,usb-4core"; - reg = <0x53f80000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <18 14 16 17>; + usbphy0: usbphy@0 { + compatible = "usb-nop-xceiv"; + status = "okay"; + }; + + usbphy1: usbphy@1 { + compatible = "usb-nop-xceiv"; + status = "okay"; + }; + + usbotg: usb@53f80000 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80000 0x0200>; + interrupts = <18>; + fsl,usbphy = <&usbphy0>; + status = "disabled"; + }; + + usbh1: usb@53f80200 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80200 0x0200>; + interrupts = <14>; + fsl,usbphy = <&usbphy1>; + status = "disabled"; + }; + + usbh2: usb@53f80400 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80400 0x0200>; + interrupts = <16>; + status = "disabled"; + }; + + usbh3: usb@53f80600 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80600 0x0200>; + interrupts = <17>; + status = "disabled"; + }; + + usbmisc: usbmisc@53f80800 { + #index-cells = <1>; + compatible = "fsl,imx53-usbmisc"; + reg = <0x53f80800 0x200>; }; /* 53F98000 0x4000 WDOG1 */ @@ -419,18 +453,6 @@ status = "disabled"; }; - - - /* 53FC4000 0x4000 USBOH3 */ - /* NOTYET - usb@53fc4000 { - compatible = "fsl,imx53-otg"; - reg = <0x53fc4000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <>; - status = "disabled"; - }; - */ /* 53FD0000 0x4000 SRC */ reset@53fd0000 { compatible = "fsl,imx53-src"; Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Wed Oct 30 17:55:31 2013 (r257392) +++ head/sys/dev/usb/controller/ehci_imx.c Wed Oct 30 18:26:18 2013 (r257393) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2010-2012 Semihalf * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2013 Ian Lepore * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko @@ -31,7 +32,9 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_bus.h" +/* + * EHCI driver for Freescale i.MX SoCs which incorporate the USBOH3 controller. + */ #include #include @@ -52,231 +55,278 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "usbdevs.h" #include #include -#include "opt_platform.h" +#include -#define FSL_EHCI_COUNT 4 -#define FSL_EHCI_REG_OFF 0x100 -#define FSL_EHCI_REG_SIZE 0x100 -#define FSL_EHCI_REG_STEP 0x200 +#include "opt_platform.h" -struct imx_ehci_softc { - ehci_softc_t ehci[FSL_EHCI_COUNT]; - /* MEM + 4 interrupts */ - struct resource *sc_res[1 + FSL_EHCI_COUNT]; -}; +/* + * Notes on the hardware and related FDT data seen in the wild. + * + * There are two sets of registers in the USBOH3 implementation; documentation + * refers to them as "core" and "non-core" registers. A set of core register + * exists for each OTG or EHCI device. There is a single set of non-core + * registers per USBOH3, and they control aspects of operation not directly + * related to the USB specs, such as whether interrupts from each of the core + * devices are able to generate a SoC wakeup event. + * + * In the FreeBSD universe we might be inclined to describe the core and + * non-core registers by using a pair of resource address/size values (two + * entries in the reg property for each core). However, we have to work with + * existing FDT data (which mostly comes from the linux universe), and the way + * they've chosen to represent this is with an entry for a "usbmisc" device + * whose reg property describes the non-core registers. The way we handle FDT + * data, this means that the resources (memory-mapped register range) for the + * non-core registers belongs to a device other than the echi devices. + * + * At the moment we have no need to access the non-core registers, so all of + * this amounts to documenting what's known. The following compat strings have + * been seen in existing FDT data: + * - "fsl,imx25-usbmisc" + * - "fsl,imx51-usbmisc"; + * - "fsl,imx6q-usbmisc"; + * + * In addition to the single usbmisc device, the existing FDT data defines a + * separate device for each of the OTG or EHCI cores within the USBOH3. Each of + * those devices has a set of core registers described by the reg property. + * + * The core registers for each of the four cores in the USBOH3 are divided into + * two parts: a set of imx-specific registers at an offset of 0 from the + * beginning of the register range, and the standard USB (EHCI or OTG) registers + * at an offset of 0x100 from the beginning of the register range. The FreeBSD + * way of dealing with this might be to map out two ranges in the reg property, + * but that's not what the alternate universe has done. To work with existing + * FDT data, we acquire the resource that maps all the core registers, then use + * bus_space_subregion() to create another resource that maps just the standard + * USB registers, which we provide to the standard USB code in the ehci_softc. + * + * The following compat strings have been seen for the OTG and EHCI cores. The + * FDT compat table in this driver contains all these strings, but as of this + * writing, not all of these SoCs have been tested with the driver. The fact + * that imx27 is common to all of them gives some hope that the driver will work + * on all these SoCs. + * - "fsl,imx23-usb", "fsl,imx27-usb"; + * - "fsl,imx25-usb", "fsl,imx27-usb"; + * - "fsl,imx28-usb", "fsl,imx27-usb"; + * - "fsl,imx51-usb", "fsl,imx27-usb"; + * - "fsl,imx53-usb", "fsl,imx27-usb"; + * - "fsl,imx6q-usb", "fsl,imx27-usb"; + * + * The FDT data for some SoCs contains the following properties, which we don't + * currently do anything with: + * - fsl,usbmisc = <&usbmisc 0>; + * - fsl,usbphy = <&usbphy0>; + * + * Some imx SoCs have FDT data related to USB PHY, some don't. We have separate + * usbphy drivers where needed; this data is mentioned here just to keep all the + * imx-FDT-usb-related info in one place. Here are the usbphy compat strings + * known to exist: + * - "nop-usbphy" + * - "usb-nop-xceiv"; + * - "fsl,imx23-usbphy" + * - "fsl,imx28-usbphy", "fsl,imx23-usbphy"; + * - "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + * + */ -/* i.MX515 have 4 EHCI inside USB core */ -/* TODO: we can get number of EHCIs by IRQ allocation */ -static struct resource_spec imx_ehci_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - /* RF_OPTIONAL will allow to use driver for systems with 3 EHCIs */ - { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, - { -1, 0 } +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-usb", 1}, + {"fsl,imx53-usb", 1}, + {"fsl,imx51-usb", 1}, + {"fsl,imx28-usb", 1}, + {"fsl,imx27-usb", 1}, + {"fsl,imx25-usb", 1}, + {"fsl,imx23-usb", 1}, + {NULL, 0}, }; -/* Forward declarations */ -static int fsl_ehci_attach(device_t self); -static int fsl_ehci_detach(device_t self); -static int fsl_ehci_probe(device_t self); - -static device_method_t ehci_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fsl_ehci_probe), - DEVMETHOD(device_attach, fsl_ehci_attach), - DEVMETHOD(device_detach, fsl_ehci_detach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - - { 0, 0 } -}; +/* + * Each EHCI device in the SoC has some SoC-specific per-device registers at an + * offset of 0, then the standard EHCI registers begin at an offset of 0x100. + */ +#define IMX_EHCI_REG_OFF 0x100 +#define IMX_EHCI_REG_SIZE 0x100 -/* kobj_class definition */ -static driver_t ehci_driver = { - "ehci", - ehci_methods, - sizeof(struct imx_ehci_softc) +struct imx_ehci_softc { + ehci_softc_t ehci_softc; + struct resource *ehci_mem_res; /* EHCI core regs. */ + struct resource *ehci_irq_res; /* EHCI core IRQ. */ }; -static devclass_t ehci_devclass; +static int +imx_ehci_probe(device_t dev) +{ -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX integrated USB controller"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} -/* - * Public methods - */ static int -fsl_ehci_probe(device_t dev) +imx_ehci_detach(device_t dev) { + struct imx_ehci_softc *sc; + ehci_softc_t *esc; - if (ofw_bus_is_compatible(dev, "fsl,usb-4core") == 0) - return (ENXIO); + sc = device_get_softc(dev); - device_set_desc(dev, "Freescale integrated USB controller"); + esc = &sc->ehci_softc; - return (BUS_PROBE_DEFAULT); + if (esc->sc_bus.bdev != NULL) + device_delete_child(dev, esc->sc_bus.bdev); + if (esc->sc_flags & EHCI_SCFLG_DONEINIT) + ehci_detach(esc); + if (esc->sc_intr_hdl != NULL) + bus_teardown_intr(dev, esc->sc_irq_res, + esc->sc_intr_hdl); + if (sc->ehci_irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->ehci_irq_res); + if (sc->ehci_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, + sc->ehci_mem_res); + + usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); + + /* During module unload there are lots of children leftover */ + device_delete_children(dev); + + return (0); } static int -fsl_ehci_attach(device_t self) +imx_ehci_attach(device_t dev) { struct imx_ehci_softc *sc; - bus_space_tag_t iot; ehci_softc_t *esc; - int err, i, rid; + int err, rid; + + sc = device_get_softc(dev); + esc = &sc->ehci_softc; + err = 0; - sc = device_get_softc(self); + /* Allocate bus_space resources. */ rid = 0; + sc->ehci_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->ehci_mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } - /* Allocate io resource for EHCI */ - if (bus_alloc_resources(self, imx_ehci_spec, sc->sc_res)) { - device_printf(self, "could not allocate resources\n"); - return (ENXIO); + rid = 0; + sc->ehci_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->ehci_irq_res == NULL) { + device_printf(dev, "Cannot allocate IRQ resources\n"); + err = ENXIO; + goto out; } - iot = rman_get_bustag(sc->sc_res[0]); - /* TODO: Power/clock enable */ - /* TODO: basic init */ + esc->sc_io_tag = rman_get_bustag(sc->ehci_mem_res); + esc->sc_bus.parent = dev; + esc->sc_bus.devices = esc->sc_devices; + esc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + if (usb_bus_mem_alloc_all(&esc->sc_bus, USB_GET_DMA_TAG(dev), + &ehci_iterate_hw_softc) != 0) { + device_printf(dev, "usb_bus_mem_alloc_all() failed\n"); + err = ENOMEM; + goto out; + } - for (i = 0; i < FSL_EHCI_COUNT; i ++) { - /* No interrupt - no driver */ - if (sc->sc_res[1 + i] == NULL) - continue; - - esc = &sc->ehci[i]; - esc->sc_io_tag = iot; - esc->sc_bus.parent = self; - esc->sc_bus.devices = esc->sc_devices; - esc->sc_bus.devices_max = EHCI_MAX_DEVICES; - - if (usb_bus_mem_alloc_all(&esc->sc_bus, USB_GET_DMA_TAG(self), - &ehci_iterate_hw_softc)) - continue; - - /* - * Set handle to USB related registers subregion used by - * generic EHCI driver. - */ - err = bus_space_subregion(iot, - rman_get_bushandle(sc->sc_res[0]), - FSL_EHCI_REG_OFF + (i * FSL_EHCI_REG_STEP), - FSL_EHCI_REG_SIZE, &esc->sc_io_hdl); - if (err != 0) - continue; - - /* Setup interrupt handler */ - err = bus_setup_intr(self, sc->sc_res[1 + i], INTR_TYPE_BIO, - NULL, (driver_intr_t *)ehci_interrupt, esc, - &esc->sc_intr_hdl); - if (err) { - device_printf(self, "Could not setup irq, " - "for EHCI%d %d\n", i, err); - continue; - } - - /* Add USB device */ - esc->sc_bus.bdev = device_add_child(self, "usbus", -1); - if (!esc->sc_bus.bdev) { - device_printf(self, "Could not add USB device\n"); - err = bus_teardown_intr(self, esc->sc_irq_res, - esc->sc_intr_hdl); - if (err) - device_printf(self, "Could not tear down irq," - " %d\n", err); - continue; - } - device_set_ivars(esc->sc_bus.bdev, &esc->sc_bus); - - esc->sc_id_vendor = 0x1234; - strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor)); - - /* Set flags */ - esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; - - err = ehci_init(esc); - if (!err) { - esc->sc_flags |= EHCI_SCFLG_DONEINIT; - err = device_probe_and_attach(esc->sc_bus.bdev); - } else { - device_printf(self, "USB init failed err=%d\n", err); - - device_delete_child(self, esc->sc_bus.bdev); - esc->sc_bus.bdev = NULL; - - err = bus_teardown_intr(self, esc->sc_irq_res, - esc->sc_intr_hdl); - if (err) - device_printf(self, "Could not tear down irq," - " %d\n", err); + /* + * Set handle to USB related registers subregion used by + * generic EHCI driver. + */ + err = bus_space_subregion(esc->sc_io_tag, + rman_get_bushandle(sc->ehci_mem_res), + IMX_EHCI_REG_OFF, IMX_EHCI_REG_SIZE, &esc->sc_io_hdl); + if (err != 0) { + device_printf(dev, "bus_space_subregion() failed\n"); + err = ENXIO; + goto out; + } - continue; - } + /* Setup interrupt handler. */ + err = bus_setup_intr(dev, sc->ehci_irq_res, INTR_TYPE_BIO, NULL, + (driver_intr_t *)ehci_interrupt, esc, &esc->sc_intr_hdl); + if (err != 0) { + device_printf(dev, "Could not setup IRQ\n"); + goto out; } - return (0); -} -static int -fsl_ehci_detach(device_t self) -{ - struct imx_ehci_softc *sc; - ehci_softc_t *esc; - int err, i; + /* Turn on clocks. */ + imx_ccm_usb_enable(dev); + + /* Add USB bus device. */ + esc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (esc->sc_bus.bdev == NULL) { + device_printf(dev, "Could not add USB device\n"); + goto out; + } + device_set_ivars(esc->sc_bus.bdev, &esc->sc_bus); - sc = device_get_softc(self); + esc->sc_id_vendor = USB_VENDOR_FREESCALE; + strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor)); - for (i = 0; i < FSL_EHCI_COUNT; i ++) { - esc = &sc->ehci[i]; - if (esc->sc_flags & EHCI_SCFLG_DONEINIT) - continue; - /* - * only call ehci_detach() after ehci_init() - */ - if (esc->sc_flags & EHCI_SCFLG_DONEINIT) { - ehci_detach(esc); - esc->sc_flags &= ~EHCI_SCFLG_DONEINIT; - } - - /* - * Disable interrupts that might have been switched on in - * ehci_init. - */ - if (esc->sc_io_tag && esc->sc_io_hdl) - bus_space_write_4(esc->sc_io_tag, esc->sc_io_hdl, - EHCI_USBINTR, 0); - - if (esc->sc_irq_res && esc->sc_intr_hdl) { - err = bus_teardown_intr(self, esc->sc_irq_res, - esc->sc_intr_hdl); - if (err) { - device_printf(self, "Could not tear down irq," - " %d\n", err); - return (err); - } - esc->sc_intr_hdl = NULL; - } - - if (esc->sc_bus.bdev) { - device_delete_child(self, esc->sc_bus.bdev); - esc->sc_bus.bdev = NULL; - } + /* Set flags that affect ehci_init() behavior. */ + esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; + err = ehci_init(esc); + if (err != 0) { + device_printf(dev, "USB init failed, usb_err_t=%d\n", + err); + goto out; } + esc->sc_flags |= EHCI_SCFLG_DONEINIT; - /* During module unload there are lots of children leftover */ - device_delete_children(self); + /* Probe the bus. */ + err = device_probe_and_attach(esc->sc_bus.bdev); + if (err != 0) { + device_printf(dev, + "device_probe_and_attach() failed\n"); + goto out; + } - if (sc->sc_res[0]) - bus_release_resources(self, imx_ehci_spec, sc->sc_res); + err = 0; - return (0); +out: + + if (err != 0) + imx_ehci_detach(dev); + + return (err); } + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx_ehci_probe), + DEVMETHOD(device_attach, imx_ehci_attach), + DEVMETHOD(device_detach, imx_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + DEVMETHOD_END +}; + +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(struct imx_ehci_softc) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 18:33:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0A06B557; Wed, 30 Oct 2013 18:33:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB0962984; Wed, 30 Oct 2013 18:33:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UIXedq094994; Wed, 30 Oct 2013 18:33:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UIXe5M094992; Wed, 30 Oct 2013 18:33:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310301833.r9UIXe5M094992@svn.freebsd.org> From: Ed Maste Date: Wed, 30 Oct 2013 18:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257394 - head/contrib/wpa/src/utils X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 18:33:41 -0000 Author: emaste Date: Wed Oct 30 18:33:40 2013 New Revision: 257394 URL: http://svnweb.freebsd.org/changeset/base/257394 Log: Revert to upstream literal $FreeBSD tag radiotap.h in upstream wpa originally came from the FreeBSD CVS repository. The copy in vendor/ matched the upstream one; with this change the contrib copy now matches too. Discussed with: jhb@ Modified: head/contrib/wpa/src/utils/radiotap.h Modified: head/contrib/wpa/src/utils/radiotap.h ============================================================================== --- head/contrib/wpa/src/utils/radiotap.h Wed Oct 30 18:26:18 2013 (r257393) +++ head/contrib/wpa/src/utils/radiotap.h Wed Oct 30 18:33:40 2013 (r257394) @@ -1,4 +1,4 @@ -/* $FreeBSD: head/contrib/wpa/src/utils/radiotap.h 214734 2010-11-03 10:43:38Z rpaulo $ */ +/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */ /* $NetBSD: ieee80211_radiotap.h,v 1.11 2005/06/22 06:16:02 dyoung Exp $ */ /*- From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 18:40:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2EC29D7; Wed, 30 Oct 2013 18:40:55 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D05872A16; Wed, 30 Oct 2013 18:40:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UIetem097938; Wed, 30 Oct 2013 18:40:55 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UIetpm097937; Wed, 30 Oct 2013 18:40:55 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310301840.r9UIetpm097937@svn.freebsd.org> From: Sean Bruno Date: Wed, 30 Oct 2013 18:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257395 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 18:40:56 -0000 Author: sbruno Date: Wed Oct 30 18:40:55 2013 New Revision: 257395 URL: http://svnweb.freebsd.org/changeset/base/257395 Log: revert sign changes to buffers used in invocation of digest_update() Instead, change arguments of internal function digest_update() to accept signed char arguments. Remove MAP_FAILED fallback definition and casts of MAP_FAILED. Thanks to bde@ for looking over this and doing the code analysis. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Wed Oct 30 18:33:40 2013 (r257394) +++ head/usr.bin/xinstall/xinstall.c Wed Oct 30 18:40:55 2013 (r257395) @@ -72,11 +72,6 @@ __FBSDID("$FreeBSD$"); #include "mtree.h" -/* Bootstrap aid - this doesn't exist in most older releases */ -#ifndef MAP_FAILED -#define MAP_FAILED ((void *)-1) /* from */ -#endif - #define MAX_CMP_SIZE (16 * 1024 * 1024) #define LN_ABSOLUTE 0x01 @@ -126,7 +121,7 @@ static int create_tempfile(const char *, static char *quiet_mktemp(char *template); static char *digest_file(const char *); static void digest_init(DIGEST_CTX *); -static void digest_update(DIGEST_CTX *, const unsigned char *, size_t); +static void digest_update(DIGEST_CTX *, const char *, size_t); static char *digest_end(DIGEST_CTX *, char *); static int do_link(const char *, const char *, const struct stat *); static void do_symlink(const char *, const char *, const struct stat *); @@ -431,7 +426,7 @@ digest_init(DIGEST_CTX *c) } static void -digest_update(DIGEST_CTX *c, const unsigned char *data, size_t len) +digest_update(DIGEST_CTX *c, const char *data, size_t len) { switch (digesttype) { @@ -1002,7 +997,7 @@ compare(int from_fd, const char *from_na int to_fd, const char *to_name __unused, size_t to_len, char **dresp) { - unsigned char *p, *q; + char *p, *q; int rv; int done_compare; DIGEST_CTX ctx; @@ -1018,11 +1013,11 @@ compare(int from_fd, const char *from_na if (trymmap(from_fd) && trymmap(to_fd)) { p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, from_fd, (off_t)0); - if (p == (unsigned char *)MAP_FAILED) + if (p == MAP_FAILED) goto out; q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, to_fd, (off_t)0); - if (q == (unsigned char *)MAP_FAILED) { + if (q == MAP_FAILED) { munmap(p, from_len); goto out; } @@ -1036,7 +1031,7 @@ compare(int from_fd, const char *from_na } out: if (!done_compare) { - unsigned char buf1[MAXBSIZE]; + char buf1[MAXBSIZE]; char buf2[MAXBSIZE]; int n1, n2; @@ -1146,8 +1141,8 @@ copy(int from_fd, const char *from_name, { int nr, nw; int serrno; - unsigned char *p; - unsigned char buf[MAXBSIZE]; + char *p; + char buf[MAXBSIZE]; int done_copy; DIGEST_CTX ctx; @@ -1167,7 +1162,7 @@ copy(int from_fd, const char *from_name, done_copy = 0; if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, - from_fd, (off_t)0)) != (unsigned char *)MAP_FAILED) { + from_fd, (off_t)0)) != MAP_FAILED) { nw = write(to_fd, p, size); if (nw != size) { serrno = errno; From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 19:17:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A5CEDE4; Wed, 30 Oct 2013 19:17:52 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep19.mx.upcmail.net (fep19.mx.upcmail.net [62.179.121.39]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8DF2C66; Wed, 30 Oct 2013 19:17:50 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep19-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131030191749.MDI6747.viefep19-int.chello.at@edge02.upcmail.net>; Wed, 30 Oct 2013 20:17:49 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge02.upcmail.net with edge id jXHp1m0082xdvHc02XHpfj; Wed, 30 Oct 2013 20:17:49 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id E10A96D47B; Wed, 30 Oct 2013 20:17:48 +0100 (CET) Date: Wed, 30 Oct 2013 20:17:48 +0100 From: Stefan Farfeleder To: Adrian Chadd Subject: Re: svn commit: r257133 - head/sys/dev/iwn Message-ID: <20131030191748.GA1463@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> <20131028192731.GA1505@mole.fafoe.narf.at> <20131029091718.GA1520@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131029091718.GA1520@mole.fafoe.narf.at> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "freebsd-wireless@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 19:17:52 -0000 On Tue, Oct 29, 2013 at 10:17:18AM +0100, Stefan Farfeleder wrote: > On Mon, Oct 28, 2013 at 09:27:30PM -0700, Adrian Chadd wrote: > > I've filed a PR. > > > > Please update to -HEAD and test. > > Ok thanks, will do. Probably I won't be able before tomorrow though. Seems to work as before, thanks! Stefan From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 19:18:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7BBFE241; Wed, 30 Oct 2013 19:18:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [IPv6:2607:f8b0:400d:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E36882C78; Wed, 30 Oct 2013 19:18:38 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id n7so1046284qcx.41 for ; Wed, 30 Oct 2013 12:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7RBMDZoLj4RG7QacXBH7t3yLsiWlWB63FmqrUaXk0Pg=; b=PzpijeuWqTDTqRMHLXs6mtnD8Q/o036M1j9Ws0vJqywYNxSTmjPZdOcpVLdSpaSpXo ttbXY0KuONhvfApz9dnKBAYt6v+bJSo7pW5BfMoSpXsP0b194SnY7lY8r8q9gA2ovUxX WzZJar7oXdTdKq9beDK0HnMrOiOOK4FUd6g3T3Ibwg4J2gW/O5YKcdIz0EXNBZJ/Z/to zAktrRpmtOYYeXgWFaRDpyIMHajSWhBS28tg5MV1vHBrT/K3pFpFPUCh/djGw9zLBAti KXuzkS52rH3+aScU716Vhq06NmBtwyvQtG8lZPtzwSNTqgCnAZ5USXY/K47HTH2KTUMU BVBQ== MIME-Version: 1.0 X-Received: by 10.224.51.131 with SMTP id d3mr182048qag.0.1383160717999; Wed, 30 Oct 2013 12:18:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Wed, 30 Oct 2013 12:18:37 -0700 (PDT) In-Reply-To: <20131030191748.GA1463@mole.fafoe.narf.at> References: <201310251944.r9PJis6q004419@svn.freebsd.org> <20131027101106.GA2843@mole.fafoe.narf.at> <20131028190005.GA1509@mole.fafoe.narf.at> <20131028192731.GA1505@mole.fafoe.narf.at> <20131029091718.GA1520@mole.fafoe.narf.at> <20131030191748.GA1463@mole.fafoe.narf.at> Date: Wed, 30 Oct 2013 12:18:37 -0700 X-Google-Sender-Auth: 2r7mjsWStBmdkIviUXOYbPUlLtk Message-ID: Subject: Re: svn commit: r257133 - head/sys/dev/iwn From: Adrian Chadd To: Stefan Farfeleder Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "freebsd-wireless@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 19:18:39 -0000 Sweet, thankyou! -a On 30 October 2013 12:17, Stefan Farfeleder wrote: > On Tue, Oct 29, 2013 at 10:17:18AM +0100, Stefan Farfeleder wrote: >> On Mon, Oct 28, 2013 at 09:27:30PM -0700, Adrian Chadd wrote: >> > I've filed a PR. >> > >> > Please update to -HEAD and test. >> >> Ok thanks, will do. Probably I won't be able before tomorrow though. > > Seems to work as before, thanks! > > Stefan From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 20:04:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 645B35C4; Wed, 30 Oct 2013 20:04:42 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mail.egr.msu.edu (dauterive.egr.msu.edu [35.9.37.168]) by mx1.freebsd.org (Postfix) with ESMTP id 369DC2F75; Wed, 30 Oct 2013 20:04:41 +0000 (UTC) Received: from dauterive (localhost [127.0.0.1]) by mail.egr.msu.edu (Postfix) with ESMTP id 4B8173CC3C; Wed, 30 Oct 2013 16:04:35 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mail.egr.msu.edu ([127.0.0.1]) by dauterive (dauterive.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RtbD6nJFoGmO; Wed, 30 Oct 2013 16:04:35 -0400 (EDT) Received: from EGR authenticated sender Message-ID: <52716653.5050203@egr.msu.edu> Date: Wed, 30 Oct 2013 16:04:35 -0400 From: Adam McDougall User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: jlh@FreeBSD.org Subject: Re: svn commit: r254974 - in head: etc/defaults etc/periodic/monthly etc/periodic/security etc/periodic/weekly share/man/man5 References: <201308272120.r7RLKTvk066897@svn.freebsd.org> <20131021000110.GJ2097@egr.msu.edu> <20131028211700.GB37879@caravan.chchile.org> <20131029143553.GO1807@egr.msu.edu> <20131029212520.GD37879@caravan.chchile.org> In-Reply-To: <20131029212520.GD37879@caravan.chchile.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 20:04:42 -0000 On 10/29/2013 17:25, Jeremie Le Hen wrote: > On Tue, Oct 29, 2013 at 10:35:53AM -0400, Adam McDougall wrote: >> >> Sorry, that didn't work (on r255793). Hand applied by adding the 'var', >> was that the only change? Thanks. > > Alright, thanks for testing. I've committed a corrected patch in > r257361 that should resolve the problem. Can you confirm that please, > and I will close the PR. > > Regards, > I can confirm r257361 is working, thanks! From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 20:42:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AAE0AFDA; Wed, 30 Oct 2013 20:42:12 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96AA42204; Wed, 30 Oct 2013 20:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UKgC3M039761; Wed, 30 Oct 2013 20:42:12 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UKgAgJ039738; Wed, 30 Oct 2013 20:42:10 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310302042.r9UKgAgJ039738@svn.freebsd.org> From: Neel Natu Date: Wed, 30 Oct 2013 20:42:10 +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: r257396 - in stable/10: share/examples/bhyve usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 20:42:12 -0000 Author: neel Date: Wed Oct 30 20:42:09 2013 New Revision: 257396 URL: http://svnweb.freebsd.org/changeset/base/257396 Log: MFC r257293. Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached to a virtual machine then we implicitly create COM1 and COM2 ISA devices. Prior to this change the only way of attaching a COM port to the virtual machine was by presenting it as a PCI device that is mapped at the legacy I/O address 0x3F8 or 0x2F8. There were some issues with the original approach: - It did not work at all with UEFI because UEFI will reprogram the PCI device BARs and remap the COM1/COM2 ports at non-legacy addresses. - OpenBSD GENERIC kernel does not create a /dev/console because it expects the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device. - It was functional with a FreeBSD guest but caused the console to appear on /dev/ttyu2 which was not intuitive. The uart emulation is now independent of the bus on which it resides. Thus it is possible to have uart devices on the PCI bus in addition to the legacy COM1/COM2 devices behind the LPC bus. The command line option to attach ISA COM1/COM2 ports to a virtual machine is "-s ,lpc -l com1,stdio". The command line option to create a PCI-attached uart device is: "-s ,uart[,stdio]" The command line option to create PCI-attached COM1/COM2 device is: "-S ,uart[,stdio]". This style of creating COM ports is deprecated. Approved by: re (glebius) Added: stable/10/usr.sbin/bhyve/legacy_irq.c - copied unchanged from r257293, head/usr.sbin/bhyve/legacy_irq.c stable/10/usr.sbin/bhyve/legacy_irq.h - copied unchanged from r257293, head/usr.sbin/bhyve/legacy_irq.h stable/10/usr.sbin/bhyve/pci_lpc.c - copied, changed from r257293, head/usr.sbin/bhyve/pci_lpc.c stable/10/usr.sbin/bhyve/pci_lpc.h - copied unchanged from r257293, head/usr.sbin/bhyve/pci_lpc.h stable/10/usr.sbin/bhyve/uart_emul.c - copied unchanged from r257293, head/usr.sbin/bhyve/uart_emul.c stable/10/usr.sbin/bhyve/uart_emul.h - copied unchanged from r257293, head/usr.sbin/bhyve/uart_emul.h Modified: stable/10/share/examples/bhyve/vmrun.sh stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/inout.c stable/10/usr.sbin/bhyve/inout.h stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_uart.c Directory Properties: stable/10/share/examples/bhyve/ (props changed) stable/10/usr.sbin/bhyve/ (props changed) Modified: stable/10/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/10/share/examples/bhyve/vmrun.sh Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/share/examples/bhyve/vmrun.sh Wed Oct 30 20:42:09 2013 (r257396) @@ -157,7 +157,7 @@ while [ 1 ]; do exit 1 fi BOOTDISK=${isofile} - installer_opt="-s 3:0,virtio-blk,${BOOTDISK}" + installer_opt="-s 31:0,virtio-blk,${BOOTDISK}" else BOOTDISK=${virtio_diskdev} installer_opt="" @@ -171,10 +171,11 @@ while [ 1 ]; do ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P \ -g ${gdbport} \ -s 0:0,hostbridge \ - -s 1:0,virtio-net,${tapdev} \ - -s 2:0,virtio-blk,${virtio_diskdev} \ + -s 1:0,lpc \ + -s 2:0,virtio-net,${tapdev} \ + -s 3:0,virtio-blk,${virtio_diskdev} \ + -l com1,stdio \ ${installer_opt} \ - -S 31,uart,stdio \ ${vmname} if [ $? -ne 0 ]; then break Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/Makefile Wed Oct 30 20:42:09 2013 (r257396) @@ -7,10 +7,10 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c -SRCS+= inout.c ioapic.c mem.c mevent.c mptbl.c pci_ahci.c -SRCS+= pci_emul.c pci_hostbridge.c pci_passthru.c pci_virtio_block.c +SRCS+= inout.c ioapic.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c +SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c SRCS+= pci_virtio_net.c pci_uart.c pit_8254.c pmtmr.c post.c rtc.c -SRCS+= virtio.c xmsr.c spinup_ap.c +SRCS+= uart_emul.c virtio.c xmsr.c spinup_ap.c .PATH: ${.CURDIR}/../../sys/amd64/vmm SRCS+= vmm_instruction_emul.c Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/bhyverun.c Wed Oct 30 20:42:09 2013 (r257396) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -53,10 +54,12 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "inout.h" #include "dbgport.h" +#include "legacy_irq.h" #include "mem.h" #include "mevent.h" #include "mptbl.h" #include "pci_emul.h" +#include "pci_lpc.h" #include "xmsr.h" #include "ioapic.h" #include "spinup_ap.h" @@ -121,9 +124,8 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-aehAHIPW][-g ][-s ][-S ]" - "[-c vcpus][-p pincpu][-m mem]" - " \n" + "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" + " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" " -g: gdb port\n" @@ -132,13 +134,14 @@ usage(int code) " -H: vmexit from the guest on hlt\n" " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" - " -W: force virtio to use single-vector MSI\n" - " -e: exit on unhandled i/o access\n" + " -W: force virtio to use single-vector MSI\n" + " -e: exit on unhandled I/O access\n" " -h: help\n" " -s: PCI slot config\n" " -S: legacy PCI slot config\n" + " -l: LPC device configuration\n" " -m: memory size in MB\n", - progname); + progname, (int)strlen(progname), ""); exit(code); } @@ -553,7 +556,7 @@ main(int argc, char *argv[]) ioapic = 0; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:")) != -1) { + while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { switch (c) { case 'a': disable_x2apic = 1; @@ -573,6 +576,12 @@ main(int argc, char *argv[]) case 'g': gdb_port = atoi(optarg); break; + case 'l': + if (lpc_device_parse(optarg) != 0) { + errx(EX_USAGE, "invalid lpc device " + "configuration '%s'", optarg); + } + break; case 's': if (pci_parse_slot(optarg, 0) != 0) exit(1); @@ -640,6 +649,7 @@ main(int argc, char *argv[]) init_mem(); init_inout(); + legacy_irq_init(); rtc_init(ctx); Modified: stable/10/usr.sbin/bhyve/inout.c ============================================================================== --- stable/10/usr.sbin/bhyve/inout.c Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/inout.c Wed Oct 30 20:42:09 2013 (r257396) @@ -84,7 +84,7 @@ register_default_iohandler(int start, in iop.name = "default"; iop.port = start; iop.size = size; - iop.flags = IOPORT_F_INOUT; + iop.flags = IOPORT_F_INOUT | IOPORT_F_DEFAULT; iop.handler = default_inout; register_inout(&iop); @@ -159,7 +159,18 @@ register_inout(struct inout_port *iop) int i; VERIFY_IOPORT(iop->port, iop->size); - + + /* + * Verify that the new registration is not overwriting an already + * allocated i/o range. + */ + if ((iop->flags & IOPORT_F_DEFAULT) == 0) { + for (i = iop->port; i < iop->port + iop->size; i++) { + if ((inout_handlers[i].flags & IOPORT_F_DEFAULT) == 0) + return (-1); + } + } + for (i = iop->port; i < iop->port + iop->size; i++) { inout_handlers[i].name = iop->name; inout_handlers[i].flags = iop->flags; Modified: stable/10/usr.sbin/bhyve/inout.h ============================================================================== --- stable/10/usr.sbin/bhyve/inout.h Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/inout.h Wed Oct 30 20:42:09 2013 (r257396) @@ -46,7 +46,13 @@ struct inout_port { }; #define IOPORT_F_IN 0x1 #define IOPORT_F_OUT 0x2 -#define IOPORT_F_INOUT 0x3 +#define IOPORT_F_INOUT (IOPORT_F_IN | IOPORT_F_OUT) + +/* + * The following flags are used internally and must not be used by + * device models. + */ +#define IOPORT_F_DEFAULT 0x80000000 /* claimed by default handler */ #define INOUT_PORT(name, port, flags, handler) \ static struct inout_port __CONCAT(__inout_port, __LINE__) = { \ Copied: stable/10/usr.sbin/bhyve/legacy_irq.c (from r257293, head/usr.sbin/bhyve/legacy_irq.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/legacy_irq.c Wed Oct 30 20:42:09 2013 (r257396, copy of r257293, head/usr.sbin/bhyve/legacy_irq.c) @@ -0,0 +1,80 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +/* + * Used to keep track of legacy interrupt owners/requestors + */ +#define NLIRQ 16 + +static struct lirqinfo { + bool li_generic; + bool li_allocated; +} lirq[NLIRQ]; + +void +legacy_irq_init(void) +{ + + /* + * Allow ISA IRQs 5,10,11,12, and 15 to be available for generic use. + */ + lirq[5].li_generic = true; + lirq[10].li_generic = true; + lirq[11].li_generic = true; + lirq[12].li_generic = true; + lirq[15].li_generic = true; +} + +int +legacy_irq_alloc(int irq) +{ + int i; + + assert(irq < NLIRQ); + + if (irq < 0) { + for (i = 0; i < NLIRQ; i++) { + if (lirq[i].li_generic && !lirq[i].li_allocated) { + irq = i; + break; + } + } + } else { + if (lirq[irq].li_allocated) + irq = -1; + } + + if (irq >= 0) { + lirq[irq].li_allocated = true; + return (irq); + } else + return (-1); +} Copied: stable/10/usr.sbin/bhyve/legacy_irq.h (from r257293, head/usr.sbin/bhyve/legacy_irq.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/legacy_irq.h Wed Oct 30 20:42:09 2013 (r257396, copy of r257293, head/usr.sbin/bhyve/legacy_irq.h) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LEGACY_IRQ_H_ +#define _LEGACY_IRQ_H_ + +/* + * Allocate a legacy irq. The argument 'irq' can be set to -1 to allocate any + * available irq. + * + * Returns -1 on failure or the allocated irq number on success. + */ +int legacy_irq_alloc(int irq); +void legacy_irq_init(void); + +#endif Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/pci_emul.c Wed Oct 30 20:42:09 2013 (r257396) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" #include "inout.h" +#include "legacy_irq.h" #include "mem.h" #include "pci_emul.h" #include "ioapic.h" @@ -76,17 +77,6 @@ static struct slotinfo { int si_legacy; } pci_slotinfo[MAXSLOTS][MAXFUNCS]; -/* - * Used to keep track of legacy interrupt owners/requestors - */ -#define NLIRQ 16 - -static struct lirqinfo { - int li_generic; - int li_acount; - struct pci_devinst *li_owner; /* XXX should be a list */ -} lirq[NLIRQ]; - SET_DECLARE(pci_devemu_set, struct pci_devemu); static uint64_t pci_emul_iobase; @@ -682,6 +672,7 @@ pci_emul_init(struct vmctx *ctx, struct pdi->pi_bus = 0; pdi->pi_slot = slot; pdi->pi_func = func; + pdi->pi_lintr_pin = -1; pdi->pi_d = pde; snprintf(pdi->pi_name, PI_NAMESZ, "%s-pci-%d", pde->pe_emu, slot); @@ -1023,16 +1014,6 @@ init_pci(struct vmctx *ctx) pci_emul_membase32 = vm_get_lowmem_limit(ctx); pci_emul_membase64 = PCI_EMUL_MEMBASE64; - /* - * Allow ISA IRQs 5,10,11,12, and 15 to be available for - * generic use - */ - lirq[5].li_generic = 1; - lirq[10].li_generic = 1; - lirq[11].li_generic = 1; - lirq[12].li_generic = 1; - lirq[15].li_generic = 1; - for (slot = 0; slot < MAXSLOTS; slot++) { for (func = 0; func < MAXFUNCS; func++) { si = &pci_slotinfo[slot][func]; @@ -1135,40 +1116,17 @@ pci_is_legacy(struct pci_devinst *pi) return (pci_slotinfo[pi->pi_slot][pi->pi_func].si_legacy); } -static int -pci_lintr_alloc(struct pci_devinst *pi, int vec) -{ - int i; - - assert(vec < NLIRQ); - - if (vec == -1) { - for (i = 0; i < NLIRQ; i++) { - if (lirq[i].li_generic && - lirq[i].li_owner == NULL) { - vec = i; - break; - } - } - } else { - if (lirq[vec].li_owner != NULL) { - vec = -1; - } - } - assert(vec != -1); - - lirq[vec].li_owner = pi; - pi->pi_lintr_pin = vec; - - return (vec); -} - int -pci_lintr_request(struct pci_devinst *pi, int vec) +pci_lintr_request(struct pci_devinst *pi, int req) { + int irq; + + irq = legacy_irq_alloc(req); + if (irq < 0) + return (-1); - vec = pci_lintr_alloc(pi, vec); - pci_set_cfgdata8(pi, PCIR_INTLINE, vec); + pi->pi_lintr_pin = irq; + pci_set_cfgdata8(pi, PCIR_INTLINE, irq); pci_set_cfgdata8(pi, PCIR_INTPIN, 1); return (0); } @@ -1177,7 +1135,7 @@ void pci_lintr_assert(struct pci_devinst *pi) { - assert(pi->pi_lintr_pin); + assert(pi->pi_lintr_pin >= 0); ioapic_assert_pin(pi->pi_vmctx, pi->pi_lintr_pin); } @@ -1185,7 +1143,7 @@ void pci_lintr_deassert(struct pci_devinst *pi) { - assert(pi->pi_lintr_pin); + assert(pi->pi_lintr_pin >= 0); ioapic_deassert_pin(pi->pi_vmctx, pi->pi_lintr_pin); } Modified: stable/10/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.h Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/pci_emul.h Wed Oct 30 20:42:09 2013 (r257396) @@ -103,7 +103,7 @@ struct pci_devinst { struct pci_devemu *pi_d; struct vmctx *pi_vmctx; uint8_t pi_bus, pi_slot, pi_func; - uint8_t pi_lintr_pin; + int8_t pi_lintr_pin; char pi_name[PI_NAMESZ]; int pi_bar_getsize; Copied and modified: stable/10/usr.sbin/bhyve/pci_lpc.c (from r257293, head/usr.sbin/bhyve/pci_lpc.c) ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Tue Oct 29 00:18:11 2013 (r257293, copy source) +++ stable/10/usr.sbin/bhyve/pci_lpc.c Wed Oct 30 20:42:09 2013 (r257396) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Neel Natu + * Copyright (c) 2013 Tycho Nightingale * All rights reserved. * * Redistribution and use in source and binary forms, with or without Copied: stable/10/usr.sbin/bhyve/pci_lpc.h (from r257293, head/usr.sbin/bhyve/pci_lpc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/pci_lpc.h Wed Oct 30 20:42:09 2013 (r257396, copy of r257293, head/usr.sbin/bhyve/pci_lpc.h) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Neel Natu + * 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 NETAPP, INC ``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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LPC_H_ +#define _LPC_H_ + +int lpc_device_parse(const char *opt); + +#endif Modified: stable/10/usr.sbin/bhyve/pci_uart.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_uart.c Wed Oct 30 18:40:55 2013 (r257395) +++ stable/10/usr.sbin/bhyve/pci_uart.c Wed Oct 30 20:42:09 2013 (r257396) @@ -30,42 +30,12 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include "bhyverun.h" #include "pci_emul.h" -#include "mevent.h" - -#define COM1_BASE 0x3F8 -#define COM1_IRQ 4 -#define COM2_BASE 0x2F8 -#define COM2_IRQ 3 - -#define DEFAULT_RCLK 1843200 -#define DEFAULT_BAUD 9600 - -#define FCR_RX_MASK 0xC0 - -#define MCR_OUT1 0x04 -#define MCR_OUT2 0x08 - -#define MSR_DELTA_MASK 0x0f - -#ifndef REG_SCR -#define REG_SCR com_scr -#endif - -#define FIFOSZ 16 +#include "uart_emul.h" /* * Pick a PCI vid/did of a chip with a single uart at @@ -75,544 +45,82 @@ __FBSDID("$FreeBSD$"); #define COM_VENDOR 0x131f #define COM_DEV 0x2000 -static int pci_uart_stdio; /* stdio in use for i/o */ - -static int pci_uart_nldevs; /* number of legacy devices - 2 max */ - -static struct { - uint64_t baddr; - int vector; -} pci_uart_lres[] = { - { COM1_BASE, COM1_IRQ}, - { COM2_BASE, COM2_IRQ}, - { 0, 0 } -}; - -struct fifo { - uint8_t buf[FIFOSZ]; - int rindex; /* index to read from */ - int windex; /* index to write to */ - int num; /* number of characters in the fifo */ - int size; /* size of the fifo */ -}; - -struct pci_uart_softc { - struct pci_devinst *pi; - pthread_mutex_t mtx; /* protects all softc elements */ - uint8_t data; /* Data register (R/W) */ - uint8_t ier; /* Interrupt enable register (R/W) */ - uint8_t lcr; /* Line control register (R/W) */ - uint8_t mcr; /* Modem control register (R/W) */ - uint8_t lsr; /* Line status register (R/W) */ - uint8_t msr; /* Modem status register (R/W) */ - uint8_t fcr; /* FIFO control register (W) */ - uint8_t scr; /* Scratch register (R/W) */ - - uint8_t dll; /* Baudrate divisor latch LSB */ - uint8_t dlh; /* Baudrate divisor latch MSB */ - - struct fifo rxfifo; - - int opened; - int stdio; - bool thre_int_pending; /* THRE interrupt pending */ -}; - -static void pci_uart_drain(int fd, enum ev_type ev, void *arg); - -static struct termios tio_orig, tio_new; /* I/O Terminals */ - -static void -ttyclose(void) -{ - tcsetattr(STDIN_FILENO, TCSANOW, &tio_orig); -} - -static void -ttyopen(void) -{ - tcgetattr(STDIN_FILENO, &tio_orig); - - cfmakeraw(&tio_new); - tcsetattr(STDIN_FILENO, TCSANOW, &tio_new); - - atexit(ttyclose); -} - -static bool -tty_char_available(void) -{ - fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0 ) { - return (true); - } else { - return (false); - } -} - -static int -ttyread(void) -{ - char rb; - - if (tty_char_available()) { - read(STDIN_FILENO, &rb, 1); - return (rb & 0xff); - } else { - return (-1); - } -} - -static void -ttywrite(unsigned char wb) -{ - (void) write(STDIN_FILENO, &wb, 1); -} - -static void -fifo_reset(struct fifo *fifo, int size) -{ - bzero(fifo, sizeof(struct fifo)); - fifo->size = size; -} - -static int -fifo_putchar(struct fifo *fifo, uint8_t ch) -{ - - if (fifo->num < fifo->size) { - fifo->buf[fifo->windex] = ch; - fifo->windex = (fifo->windex + 1) % fifo->size; - fifo->num++; - return (0); - } else - return (-1); -} - -static int -fifo_getchar(struct fifo *fifo) -{ - int c; - - if (fifo->num > 0) { - c = fifo->buf[fifo->rindex]; - fifo->rindex = (fifo->rindex + 1) % fifo->size; - fifo->num--; - return (c); - } else - return (-1); -} - -static int -fifo_numchars(struct fifo *fifo) -{ - - return (fifo->num); -} - -static int -fifo_available(struct fifo *fifo) -{ - - return (fifo->num < fifo->size); -} - -static void -pci_uart_opentty(struct pci_uart_softc *sc) -{ - struct mevent *mev; - - assert(sc->opened == 0); - assert(sc->stdio); - - ttyopen(); - mev = mevent_add(STDIN_FILENO, EVF_READ, pci_uart_drain, sc); - assert(mev); -} - static void -pci_uart_legacy_res(uint64_t *bar, int *ivec) +pci_uart_intr_assert(void *arg) { - if (pci_uart_lres[pci_uart_nldevs].baddr != 0) { - *bar = pci_uart_lres[pci_uart_nldevs].baddr; - *ivec = pci_uart_lres[pci_uart_nldevs].vector; - pci_uart_nldevs++; - } else { - /* TODO: print warning ? */ - *bar = 0; - *ivec= -1; - } -} + struct pci_devinst *pi = arg; -/* - * The IIR returns a prioritized interrupt reason: - * - receive data available - * - transmit holding register empty - * - modem status change - * - * Return an interrupt reason if one is available. - */ -static int -pci_uart_intr_reason(struct pci_uart_softc *sc) -{ - - if ((sc->lsr & LSR_OE) != 0 && (sc->ier & IER_ERLS) != 0) - return (IIR_RLS); - else if (fifo_numchars(&sc->rxfifo) > 0 && (sc->ier & IER_ERXRDY) != 0) - return (IIR_RXTOUT); - else if (sc->thre_int_pending && (sc->ier & IER_ETXRDY) != 0) - return (IIR_TXRDY); - else if ((sc->msr & MSR_DELTA_MASK) != 0 && (sc->ier & IER_EMSC) != 0) - return (IIR_MLSC); - else - return (IIR_NOPEND); + pci_lintr_assert(pi); } static void -pci_uart_reset(struct pci_uart_softc *sc) +pci_uart_intr_deassert(void *arg) { - uint16_t divisor; + struct pci_devinst *pi = arg; - divisor = DEFAULT_RCLK / DEFAULT_BAUD / 16; - sc->dll = divisor; - sc->dlh = divisor >> 16; - - fifo_reset(&sc->rxfifo, 1); /* no fifo until enabled by software */ -} - -/* - * Toggle the COM port's intr pin depending on whether or not we have an - * interrupt condition to report to the processor. - */ -static void -pci_uart_toggle_intr(struct pci_uart_softc *sc) -{ - uint8_t intr_reason; - - intr_reason = pci_uart_intr_reason(sc); - - if (intr_reason == IIR_NOPEND) - pci_lintr_deassert(sc->pi); - else - pci_lintr_assert(sc->pi); -} - -static void -pci_uart_drain(int fd, enum ev_type ev, void *arg) -{ - struct pci_uart_softc *sc; - int ch; - - sc = arg; - - assert(fd == STDIN_FILENO); - assert(ev == EVF_READ); - - /* - * This routine is called in the context of the mevent thread - * to take out the softc lock to protect against concurrent - * access from a vCPU i/o exit - */ - pthread_mutex_lock(&sc->mtx); - - if ((sc->mcr & MCR_LOOPBACK) != 0) { - (void) ttyread(); - } else { - while (fifo_available(&sc->rxfifo) && - ((ch = ttyread()) != -1)) { - fifo_putchar(&sc->rxfifo, ch); - } - pci_uart_toggle_intr(sc); - } - - pthread_mutex_unlock(&sc->mtx); + pci_lintr_deassert(pi); } static void pci_uart_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, uint64_t offset, int size, uint64_t value) { - struct pci_uart_softc *sc; - int fifosz; - uint8_t msr; - - sc = pi->pi_arg; assert(baridx == 0); assert(size == 1); - /* Open terminal */ - if (!sc->opened && sc->stdio) { - pci_uart_opentty(sc); - sc->opened = 1; - } - - pthread_mutex_lock(&sc->mtx); - - /* - * Take care of the special case DLAB accesses first - */ - if ((sc->lcr & LCR_DLAB) != 0) { - if (offset == REG_DLL) { - sc->dll = value; - goto done; - } - - if (offset == REG_DLH) { - sc->dlh = value; - goto done; - } - } - - switch (offset) { - case REG_DATA: - if (sc->mcr & MCR_LOOPBACK) { - if (fifo_putchar(&sc->rxfifo, value) != 0) - sc->lsr |= LSR_OE; - } else if (sc->stdio) { - ttywrite(value); - } /* else drop on floor */ - sc->thre_int_pending = true; - break; - case REG_IER: - /* - * Apply mask so that bits 4-7 are 0 - * Also enables bits 0-3 only if they're 1 - */ - sc->ier = value & 0x0F; - break; - case REG_FCR: - /* - * When moving from FIFO and 16450 mode and vice versa, - * the FIFO contents are reset. - */ - if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) { - fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1; - fifo_reset(&sc->rxfifo, fifosz); - } - - /* - * The FCR_ENABLE bit must be '1' for the programming - * of other FCR bits to be effective. - */ - if ((value & FCR_ENABLE) == 0) { - sc->fcr = 0; - } else { - if ((value & FCR_RCV_RST) != 0) - fifo_reset(&sc->rxfifo, FIFOSZ); - - sc->fcr = value & - (FCR_ENABLE | FCR_DMA | FCR_RX_MASK); - } - break; - case REG_LCR: - sc->lcr = value; - break; - case REG_MCR: - /* Apply mask so that bits 5-7 are 0 */ - sc->mcr = value & 0x1F; - - msr = 0; - if (sc->mcr & MCR_LOOPBACK) { - /* - * In the loopback mode certain bits from the - * MCR are reflected back into MSR - */ - if (sc->mcr & MCR_RTS) - msr |= MSR_CTS; - if (sc->mcr & MCR_DTR) - msr |= MSR_DSR; - if (sc->mcr & MCR_OUT1) - msr |= MSR_RI; - if (sc->mcr & MCR_OUT2) - msr |= MSR_DCD; - } - - /* - * Detect if there has been any change between the - * previous and the new value of MSR. If there is - * then assert the appropriate MSR delta bit. - */ - if ((msr & MSR_CTS) ^ (sc->msr & MSR_CTS)) - sc->msr |= MSR_DCTS; - if ((msr & MSR_DSR) ^ (sc->msr & MSR_DSR)) - sc->msr |= MSR_DDSR; - if ((msr & MSR_DCD) ^ (sc->msr & MSR_DCD)) - sc->msr |= MSR_DDCD; - if ((sc->msr & MSR_RI) != 0 && (msr & MSR_RI) == 0) - sc->msr |= MSR_TERI; - - /* - * Update the value of MSR while retaining the delta - * bits. - */ - sc->msr &= MSR_DELTA_MASK; - sc->msr |= msr; - break; - case REG_LSR: - /* - * Line status register is not meant to be written to - * during normal operation. - */ - break; - case REG_MSR: - /* - * As far as I can tell MSR is a read-only register. - */ - break; - case REG_SCR: - sc->scr = value; - break; - default: - break; - } - -done: - pci_uart_toggle_intr(sc); - pthread_mutex_unlock(&sc->mtx); + uart_write(pi->pi_arg, offset, value); } uint64_t pci_uart_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, uint64_t offset, int size) { - struct pci_uart_softc *sc; - uint8_t iir, intr_reason; - uint64_t reg; - - sc = pi->pi_arg; + uint8_t val; assert(baridx == 0); assert(size == 1); - /* Open terminal */ - if (!sc->opened && sc->stdio) { - pci_uart_opentty(sc); - sc->opened = 1; - } - - pthread_mutex_lock(&sc->mtx); - - /* - * Take care of the special case DLAB accesses first - */ - if ((sc->lcr & LCR_DLAB) != 0) { - if (offset == REG_DLL) { - reg = sc->dll; - goto done; - } - - if (offset == REG_DLH) { - reg = sc->dlh; - goto done; - } - } - - switch (offset) { - case REG_DATA: - reg = fifo_getchar(&sc->rxfifo); - break; - case REG_IER: - reg = sc->ier; - break; - case REG_IIR: - iir = (sc->fcr & FCR_ENABLE) ? IIR_FIFO_MASK : 0; - - intr_reason = pci_uart_intr_reason(sc); - - /* - * Deal with side effects of reading the IIR register - */ - if (intr_reason == IIR_TXRDY) - sc->thre_int_pending = false; - - iir |= intr_reason; - - reg = iir; - break; - case REG_LCR: - reg = sc->lcr; - break; - case REG_MCR: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 21:12:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0CAC2BEC; Wed, 30 Oct 2013 21:12:28 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF1F62411; Wed, 30 Oct 2013 21:12:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ULCR5l050644; Wed, 30 Oct 2013 21:12:27 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ULCRLi050643; Wed, 30 Oct 2013 21:12:27 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201310302112.r9ULCRLi050643@svn.freebsd.org> From: Peter Grehan Date: Wed, 30 Oct 2013 21:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257397 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 21:12:28 -0000 Author: grehan Date: Wed Oct 30 21:12:27 2013 New Revision: 257397 URL: http://svnweb.freebsd.org/changeset/base/257397 Log: MFC r257092 Fix bug in the ioapic emulation for level-triggered interrupts, where a pin assertion while a source was masked would result in the interrupt being lost, with the symptom being a console hang. The condition is now recorded, and the interrupt generated when the source is unmasked. Approved by: re (glebius) Modified: stable/10/usr.sbin/bhyve/ioapic.c Directory Properties: stable/10/usr.sbin/bhyve/ (props changed) Modified: stable/10/usr.sbin/bhyve/ioapic.c ============================================================================== --- stable/10/usr.sbin/bhyve/ioapic.c Wed Oct 30 20:42:09 2013 (r257396) +++ stable/10/usr.sbin/bhyve/ioapic.c Wed Oct 30 21:12:27 2013 (r257397) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -46,34 +47,40 @@ __FBSDID("$FreeBSD$"); #include +static uint64_t ioapic_clearpend, ioapic_togglepend, ioapic_setpend; + #define IOAPIC_PADDR 0xFEC00000 #define IOREGSEL 0x00 #define IOWIN 0x10 #define REDIR_ENTRIES 16 -#define INTR_ASSERTED(ioapic, pin) ((ioapic)->pinstate[(pin)] == true) +#define INTR_ASSERTED(ioapic, pin) \ + ((ioapic)->rtbl[(pin)].pinstate == true) struct ioapic { int inited; uint32_t id; - uint64_t redtbl[REDIR_ENTRIES]; - bool pinstate[REDIR_ENTRIES]; + struct { + uint64_t reg; + bool pinstate; + bool pending; + } rtbl[REDIR_ENTRIES]; uintptr_t paddr; /* gpa where the ioapic is mapped */ uint32_t ioregsel; struct memory_region *region; + pthread_mutex_t mtx; }; static struct ioapic ioapics[1]; /* only a single ioapic for now */ -static int ioapic_region_read(struct ioapic *ioapic, uintptr_t paddr, - int size, uint64_t *data); -static int ioapic_region_write(struct ioapic *ioapic, uintptr_t paddr, - int size, uint64_t data); +static int ioapic_region_read(struct vmctx *vm, struct ioapic *ioapic, + uintptr_t paddr, int size, uint64_t *data); +static int ioapic_region_write(struct vmctx *vm, struct ioapic *ioapic, + uintptr_t paddr, int size, uint64_t data); static int ioapic_region_handler(struct vmctx *vm, int vcpu, int dir, - uintptr_t paddr, int size, uint64_t *val, - void *arg1, long arg2); + uintptr_t paddr, int size, uint64_t *val, void *arg1, long arg2); static void ioapic_set_pinstate(struct vmctx *ctx, int pin, bool newstate) @@ -84,14 +91,11 @@ ioapic_set_pinstate(struct vmctx *ctx, i ioapic = &ioapics[0]; /* assume a single ioapic */ - if (pin < 0 || pin >= REDIR_ENTRIES) - return; - /* Nothing to do if interrupt pin has not changed state */ - if (ioapic->pinstate[pin] == newstate) + if (ioapic->rtbl[pin].pinstate == newstate) return; - ioapic->pinstate[pin] = newstate; /* record it */ + ioapic->rtbl[pin].pinstate = newstate; /* record it */ /* Nothing to do if interrupt pin is deasserted */ if (!INTR_ASSERTED(ioapic, pin)) @@ -105,8 +109,8 @@ ioapic_set_pinstate(struct vmctx *ctx, i * Level-triggered sources will work so long as there is * no sharing. */ - low = ioapic->redtbl[pin]; - high = ioapic->redtbl[pin] >> 32; + low = ioapic->rtbl[pin].reg; + high = ioapic->rtbl[pin].reg >> 32; if ((low & IOART_INTMASK) == IOART_INTMCLR && (low & IOART_DESTMOD) == IOART_DESTPHY && (low & IOART_DELMOD) == IOART_DELFIXED) { @@ -124,19 +128,47 @@ ioapic_set_pinstate(struct vmctx *ctx, i vcpu++; } } + } else if ((low & IOART_INTMASK) != IOART_INTMCLR && + low & IOART_TRGRLVL) { + /* + * For level-triggered interrupts that have been + * masked, set the pending bit so that an interrupt + * will be generated on unmask and if the level is + * still asserted + */ + ioapic_setpend++; + ioapic->rtbl[pin].pending = true; } } +static void +ioapic_set_pinstate_locked(struct vmctx *ctx, int pin, bool newstate) +{ + struct ioapic *ioapic; + + if (pin < 0 || pin >= REDIR_ENTRIES) + return; + + ioapic = &ioapics[0]; + + pthread_mutex_lock(&ioapic->mtx); + ioapic_set_pinstate(ctx, pin, newstate); + pthread_mutex_unlock(&ioapic->mtx); +} + +/* + * External entry points require locking + */ void ioapic_deassert_pin(struct vmctx *ctx, int pin) { - ioapic_set_pinstate(ctx, pin, false); + ioapic_set_pinstate_locked(ctx, pin, false); } void ioapic_assert_pin(struct vmctx *ctx, int pin) { - ioapic_set_pinstate(ctx, pin, true); + ioapic_set_pinstate_locked(ctx, pin, true); } void @@ -154,9 +186,11 @@ ioapic_init(int which) bzero(ioapic, sizeof(struct ioapic)); + pthread_mutex_init(&ioapic->mtx, NULL); + /* Initialize all redirection entries to mask all interrupts */ for (i = 0; i < REDIR_ENTRIES; i++) - ioapic->redtbl[i] = 0x0001000000010000UL; + ioapic->rtbl[i].reg = 0x0001000000010000UL; ioapic->paddr = IOAPIC_PADDR; @@ -206,14 +240,15 @@ ioapic_read(struct ioapic *ioapic, uint3 else rshift = 0; - return (ioapic->redtbl[pin] >> rshift); + return (ioapic->rtbl[pin].reg >> rshift); } return (0); } static void -ioapic_write(struct ioapic *ioapic, uint32_t addr, uint32_t data) +ioapic_write(struct vmctx *vm, struct ioapic *ioapic, uint32_t addr, + uint32_t data) { int regnum, pin, lshift; @@ -241,14 +276,31 @@ ioapic_write(struct ioapic *ioapic, uint else lshift = 0; - ioapic->redtbl[pin] &= ~((uint64_t)0xffffffff << lshift); - ioapic->redtbl[pin] |= ((uint64_t)data << lshift); + ioapic->rtbl[pin].reg &= ~((uint64_t)0xffffffff << lshift); + ioapic->rtbl[pin].reg |= ((uint64_t)data << lshift); + + if (ioapic->rtbl[pin].pending && + ((ioapic->rtbl[pin].reg & IOART_INTMASK) == + IOART_INTMCLR)) { + ioapic->rtbl[pin].pending = false; + ioapic_clearpend++; + /* + * Inject the deferred level-triggered int if it is + * still asserted. Simulate by toggling the pin + * off and then on. + */ + if (ioapic->rtbl[pin].pinstate == true) { + ioapic_togglepend++; + ioapic_set_pinstate(vm, pin, false); + ioapic_set_pinstate(vm, pin, true); + } + } } } static int -ioapic_region_read(struct ioapic *ioapic, uintptr_t paddr, int size, - uint64_t *data) +ioapic_region_read(struct vmctx *vm, struct ioapic *ioapic, uintptr_t paddr, + int size, uint64_t *data) { int offset; @@ -276,8 +328,8 @@ ioapic_region_read(struct ioapic *ioapic } static int -ioapic_region_write(struct ioapic *ioapic, uintptr_t paddr, int size, - uint64_t data) +ioapic_region_write(struct vmctx *vm, struct ioapic *ioapic, uintptr_t paddr, + int size, uint64_t data) { int offset; @@ -298,14 +350,14 @@ ioapic_region_write(struct ioapic *ioapi if (offset == IOREGSEL) ioapic->ioregsel = data; else - ioapic_write(ioapic, ioapic->ioregsel, data); + ioapic_write(vm, ioapic, ioapic->ioregsel, data); return (0); } static int ioapic_region_handler(struct vmctx *vm, int vcpu, int dir, uintptr_t paddr, - int size, uint64_t *val, void *arg1, long arg2) + int size, uint64_t *val, void *arg1, long arg2) { struct ioapic *ioapic; int which; @@ -315,10 +367,12 @@ ioapic_region_handler(struct vmctx *vm, assert(ioapic == &ioapics[which]); + pthread_mutex_lock(&ioapic->mtx); if (dir == MEM_F_READ) - ioapic_region_read(ioapic, paddr, size, val); + ioapic_region_read(vm, ioapic, paddr, size, val); else - ioapic_region_write(ioapic, paddr, size, *val); + ioapic_region_write(vm, ioapic, paddr, size, *val); + pthread_mutex_unlock(&ioapic->mtx); return (0); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 21:18:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 23EBCF16; Wed, 30 Oct 2013 21:18:16 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10CA3245F; Wed, 30 Oct 2013 21:18:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ULIFlM051632; Wed, 30 Oct 2013 21:18:15 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ULIErj051622; Wed, 30 Oct 2013 21:18:14 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310302118.r9ULIErj051622@svn.freebsd.org> From: Sean Bruno Date: Wed, 30 Oct 2013 21:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257398 - head/contrib/tcp_wrappers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 21:18:16 -0000 Author: sbruno Date: Wed Oct 30 21:18:14 2013 New Revision: 257398 URL: http://svnweb.freebsd.org/changeset/base/257398 Log: Quiesce warnings by updating headerfile includes Modified: head/contrib/tcp_wrappers/clean_exit.c head/contrib/tcp_wrappers/hosts_access.c head/contrib/tcp_wrappers/options.c head/contrib/tcp_wrappers/percent_x.c head/contrib/tcp_wrappers/rfc931.c head/contrib/tcp_wrappers/shell_cmd.c head/contrib/tcp_wrappers/update.c Modified: head/contrib/tcp_wrappers/clean_exit.c ============================================================================== --- head/contrib/tcp_wrappers/clean_exit.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/clean_exit.c Wed Oct 30 21:18:14 2013 (r257398) @@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit. #endif #include +#include extern void exit(); Modified: head/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- head/contrib/tcp_wrappers/hosts_access.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/hosts_access.c Wed Oct 30 21:18:14 2013 (r257398) @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) hosts_acces #ifdef INET6 #include #endif +#include extern char *fgets(); extern int errno; Modified: head/contrib/tcp_wrappers/options.c ============================================================================== --- head/contrib/tcp_wrappers/options.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/options.c Wed Oct 30 21:18:14 2013 (r257398) @@ -50,6 +50,8 @@ static char sccsid[] = "@(#) options.c 1 #include #include #include +#include +#include #ifndef MAXPATHNAMELEN #define MAXPATHNAMELEN BUFSIZ Modified: head/contrib/tcp_wrappers/percent_x.c ============================================================================== --- head/contrib/tcp_wrappers/percent_x.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/percent_x.c Wed Oct 30 21:18:14 2013 (r257398) @@ -19,6 +19,7 @@ static char sccsid[] = "@(#) percent_x.c #include #include #include +#include extern void exit(); Modified: head/contrib/tcp_wrappers/rfc931.c ============================================================================== --- head/contrib/tcp_wrappers/rfc931.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/rfc931.c Wed Oct 30 21:18:14 2013 (r257398) @@ -25,6 +25,7 @@ static char sccsid[] = "@(#) rfc931.c 1. #include #include #include +#include #ifndef SEEK_SET #define SEEK_SET 0 Modified: head/contrib/tcp_wrappers/shell_cmd.c ============================================================================== --- head/contrib/tcp_wrappers/shell_cmd.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/shell_cmd.c Wed Oct 30 21:18:14 2013 (r257398) @@ -16,10 +16,13 @@ static char sccsid[] = "@(#) shell_cmd.c #include #include +#include #include #include #include #include +#include +#include extern void exit(); Modified: head/contrib/tcp_wrappers/update.c ============================================================================== --- head/contrib/tcp_wrappers/update.c Wed Oct 30 21:12:27 2013 (r257397) +++ head/contrib/tcp_wrappers/update.c Wed Oct 30 21:18:14 2013 (r257398) @@ -24,6 +24,7 @@ static char sccsid[] = "@(#) update.c 1. #include #include #include +#include /* Local stuff. */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 21:21:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 556D7163; Wed, 30 Oct 2013 21:21:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D800624A8; Wed, 30 Oct 2013 21:21:10 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 2D833120206; Wed, 30 Oct 2013 22:20:53 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id EC2C3CB4E; Wed, 30 Oct 2013 22:20:52 +0100 (CET) Date: Wed, 30 Oct 2013 22:20:52 +0100 From: Jilles Tjoelker To: Stefan Neudorf Subject: Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat Message-ID: <20131030212052.GA3516@stack.nl> References: <201310211646.r9LGkDl5012906@svn.freebsd.org> <20131030.86fvriud2y@bitmessage.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131030.86fvriud2y@bitmessage.ch> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 21:21:11 -0000 On Wed, Oct 30, 2013 at 02:01:57PM +0100, Stefan Neudorf wrote: > Konstantin Belousov writes: > > Author: kib > > Date: Mon Oct 21 16:46:12 2013 > > New Revision: 256850 > > URL: http://svnweb.freebsd.org/changeset/base/256850 > > Log: > > Add a resource limit for the total number of kqueues available to the > > user. Kqueue now saves the ucred of the allocating thread, to > > correctly decrement the counter on close. > > Under some specific and not real-world use scenario for kqueue, it is > > possible for the kqueues to consume memory proportional to the square > > of the number of the filedescriptors available to the process. Limit > > allows administrator to prevent the abuse. > > This is kernel-mode side of the change, with the user-mode enabling > > commit following. > > Reported and tested by: pho > > Discussed with: jmg > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Modified: > > head/bin/sh/miscbltin.c > > head/etc/login.conf > > head/lib/libc/sys/getrlimit.2 > > head/lib/libutil/login_class.3 > > head/lib/libutil/login_class.c > > head/usr.bin/limits/limits.c > > head/usr.bin/procstat/procstat_rlimit.c > kqueues limit isn't documented in sh(1) and limits(1) manpages. I can do this in the next few days. > > Modified: head/bin/sh/miscbltin.c > > ============================================================================== > > --- head/bin/sh/miscbltin.c Mon Oct 21 16:44:53 2013 (r256849) > > +++ head/bin/sh/miscbltin.c Mon Oct 21 16:46:12 2013 (r256850) > > @@ -405,6 +405,9 @@ static const struct limits limits[] = { > > #ifdef RLIMIT_NPTS > > { "pseudo-terminals", (char *)0, RLIMIT_NPTS, 1, 'p' }, > > #endif > > +#ifdef RLIMIT_KQUEUES > > + { "kqueues", (char *)0, RLIMIT_KQUEUES, 1, 'k' }, > > +#endif > > { (char *) 0, (char *)0, 0, 0, '\0' } > > }; > > > I've submitted a patch to add ulimit -k (kqueue) to zsh but the reviewer > asked me to rename -k to -K to avoid conflict with ulimit -k (posixlocks) > from DragonFly. Do you anticipate FreeBSD never adds RLIMIT_POSIXLOCKS > support or would use incompatible option switch? > http://www.zsh.org/mla/workers/2013/msg00984.html > http://gitweb.dragonflybsd.org/dragonfly.git?a=search&h=HEAD&st=commit&s=posixlocks I think dragonfly has invented its own name here. The usual name for RLIMIT_POSIXLOCKS (Linux and Solaris) is RLIMIT_LOCKS and ulimit has it under -x (bash) or -L (ksh93). It seems more appropriate for FreeBSD to follow one of those. (On the other hand, dash ulimit has it on -w.) Generally, the namespace for ulimit letters is very small so inconsistencies between shells and implementations are to be expected. Also, various shell implementations appear to have stopped caring to add new rlimits to their ulimit builtin. zsh's -N option avoids the need to modify the shell for new rlimits, but is probably too cryptic to use other than via limits -e. > > Modified: head/usr.bin/limits/limits.c > > ============================================================================== > > --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013 (r256849) > > +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013 (r256850) > This adds limits -e support only for sh, csh, tcsh. What about other > shells that already support sbsize and swapuse extensions? This can be done later; the kqueue rlimit need not be gated on it. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 21:36:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 983828AB; Wed, 30 Oct 2013 21:36:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1372585; Wed, 30 Oct 2013 21:36:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ULaGM8058240; Wed, 30 Oct 2013 21:36:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ULaF8x058235; Wed, 30 Oct 2013 21:36:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310302136.r9ULaF8x058235@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 30 Oct 2013 21:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257399 - in head: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 21:36:16 -0000 Author: jilles Date: Wed Oct 30 21:36:15 2013 New Revision: 257399 URL: http://svnweb.freebsd.org/changeset/base/257399 Log: sh: Allow trapping SIGINT/SIGQUIT after ignore because of '&'. If job control is not enabled, background jobs started with ... & ignore SIGINT and SIGQUIT so that they are not affected by such signals that are intended for the foreground job. However, this should not prevent reassigning a different action for these signals (as if the shell invocation inherited these signal actions from its parent). Austin group issue #751 Example: { trap - INT; exec sleep 10; } & wait A Ctrl+C should terminate the sleep command. Added: head/tools/regression/bin/sh/builtins/trap13.0 (contents, props changed) head/tools/regression/bin/sh/builtins/trap14.0 (contents, props changed) Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Wed Oct 30 21:18:14 2013 (r257398) +++ head/bin/sh/trap.c Wed Oct 30 21:36:15 2013 (r257399) @@ -362,10 +362,12 @@ void ignoresig(int signo) { + if (sigmode[signo] == 0) + setsignal(signo); if (sigmode[signo] != S_IGN && sigmode[signo] != S_HARD_IGN) { signal(signo, SIG_IGN); + sigmode[signo] = S_IGN; } - sigmode[signo] = S_HARD_IGN; } Added: head/tools/regression/bin/sh/builtins/trap13.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap13.0 Wed Oct 30 21:36:15 2013 (r257399) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +{ + trap 'exit 0' INT + ${SH} -c 'kill -INT $PPID' + exit 3 +} & +wait $! Added: head/tools/regression/bin/sh/builtins/trap14.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap14.0 Wed Oct 30 21:36:15 2013 (r257399) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +{ + trap - INT + ${SH} -c 'kill -INT $PPID' & + wait +} & +wait $! +r=$? +[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = INT ] From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 21:49:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CEBA7ECE; Wed, 30 Oct 2013 21:49:38 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC4A6266F; Wed, 30 Oct 2013 21:49:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ULncRl061967; Wed, 30 Oct 2013 21:49:38 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ULncU1061966; Wed, 30 Oct 2013 21:49:38 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201310302149.r9ULncU1061966@svn.freebsd.org> From: Joel Dahl Date: Wed, 30 Oct 2013 21:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257400 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 21:49:38 -0000 Author: joel (doc committer) Date: Wed Oct 30 21:49:38 2013 New Revision: 257400 URL: http://svnweb.freebsd.org/changeset/base/257400 Log: A few minor mdoc improvements. Modified: head/usr.sbin/pkg/pkg.7 Modified: head/usr.sbin/pkg/pkg.7 ============================================================================== --- head/usr.sbin/pkg/pkg.7 Wed Oct 30 21:36:15 2013 (r257399) +++ head/usr.sbin/pkg/pkg.7 Wed Oct 30 21:49:38 2013 (r257400) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm pkg -.Nd a utility for manipulating packages. +.Nd a utility for manipulating packages .Sh SYNOPSIS .Nm .Ao Ar command Ac @@ -55,8 +55,7 @@ The first time invoked, will bootstrap the real .Xr pkg 8 from a remote repository. -.Pp -.Bl -tag -width "pkg add xxxxxxx" -compact +.Bl -tag -width "pkg add xxxxxxx" .It Nm Ao Ar command Ac If .Xr pkg 8 @@ -142,6 +141,7 @@ SIGNATURE_TYPE: "none", FINGERPRINTS: "/usr/share/keys/pkg", ASSUME_ALWAYS_YES: "yes" .Ed +.Pp Reference .Sx ENVIRONMENT for each variable. @@ -246,8 +246,8 @@ Check installed packages for checksum mi Check for missing dependencies: .Dl # pkg check -d -a .Sh SEE ALSO -.Xr pkg 8 , -.Xr ports 7 +.Xr ports 7 , +.Xr pkg 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 21:52:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B72ECCA; Wed, 30 Oct 2013 21:52:31 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A35D26A7; Wed, 30 Oct 2013 21:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9ULqVZj064436; Wed, 30 Oct 2013 21:52:31 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9ULqVsT064435; Wed, 30 Oct 2013 21:52:31 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201310302152.r9ULqVsT064435@svn.freebsd.org> From: Joel Dahl Date: Wed, 30 Oct 2013 21:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257401 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 21:52:31 -0000 Author: joel (doc committer) Date: Wed Oct 30 21:52:31 2013 New Revision: 257401 URL: http://svnweb.freebsd.org/changeset/base/257401 Log: mdoc: document title should be all caps. Modified: head/share/man/man9/getenv.9 Modified: head/share/man/man9/getenv.9 ============================================================================== --- head/share/man/man9/getenv.9 Wed Oct 30 21:49:38 2013 (r257400) +++ head/share/man/man9/getenv.9 Wed Oct 30 21:52:31 2013 (r257401) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" .Dd October 22, 2013 -.Dt getenv 9 +.Dt GETENV 9 .Os .Sh NAME .Nm freeenv , From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 22:03:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB306683; Wed, 30 Oct 2013 22:03:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 988912765; Wed, 30 Oct 2013 22:03:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UM3pMR068330; Wed, 30 Oct 2013 22:03:51 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UM3pOw068329; Wed, 30 Oct 2013 22:03:51 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310302203.r9UM3pOw068329@svn.freebsd.org> From: Bryan Drewery Date: Wed, 30 Oct 2013 22:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257402 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 22:03:51 -0000 Author: bdrewery (ports committer) Date: Wed Oct 30 22:03:51 2013 New Revision: 257402 URL: http://svnweb.freebsd.org/changeset/base/257402 Log: Add forgotten pkg.7 Approved by: bapt MFC after: 2 days X-MFC-with: r257378 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 30 21:52:31 2013 (r257401) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 30 22:03:51 2013 (r257402) @@ -3610,6 +3610,7 @@ OLD_FILES+=usr/share/man/man8/tftp-proxy .if ${MK_PKGBOOTSTRAP} == no OLD_FILES+=usr/sbin/pkg +OLD_FILES+=usr/share/man/man7/pkg.7.gz .endif .if ${MK_PKGTOOLS} == no From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 22:04:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B79DF7C5; Wed, 30 Oct 2013 22:04:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5032276C; Wed, 30 Oct 2013 22:04:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UM4mJi068502; Wed, 30 Oct 2013 22:04:48 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UM4mQZ068501; Wed, 30 Oct 2013 22:04:48 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310302204.r9UM4mQZ068501@svn.freebsd.org> From: Bryan Drewery Date: Wed, 30 Oct 2013 22:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257403 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 22:04:48 -0000 Author: bdrewery (ports committer) Date: Wed Oct 30 22:04:48 2013 New Revision: 257403 URL: http://svnweb.freebsd.org/changeset/base/257403 Log: /etc/keys was moved to /usr/share/keys in r257344 Approved by: bapt MFC after: 2 days X-MFC-With: r257344 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Oct 30 22:03:51 2013 (r257402) +++ head/ObsoleteFiles.inc Wed Oct 30 22:04:48 2013 (r257403) @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20131030: /etc/keys moved to /usr/share/keys +OLD_DIRS+=etc/keys +OLD_DIRS+=etc/keys/pkg +OLD_DIRS+=etc/keys/pkg/revoked +OLD_DIRS+=etc/keys/pkg/trusted +OLD_FILES+=etc/keys/pkg/trusted/pkg.freebsd.org.2013102301 # 20131028: ng_fec(4) removed OLD_FILES+=usr/include/netgraph/ng_fec.h OLD_FILES+=usr/share/man/man4/ng_fec.4.gz From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 22:41:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D9E273F4; Wed, 30 Oct 2013 22:41:18 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C71E929A0; Wed, 30 Oct 2013 22:41:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UMfIvE081617; Wed, 30 Oct 2013 22:41:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UMfIAS081616; Wed, 30 Oct 2013 22:41:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310302241.r9UMfIAS081616@svn.freebsd.org> From: Sean Bruno Date: Wed, 30 Oct 2013 22:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257404 - head/contrib/tcp_wrappers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 22:41:18 -0000 Author: sbruno Date: Wed Oct 30 22:41:18 2013 New Revision: 257404 URL: http://svnweb.freebsd.org/changeset/base/257404 Log: Quiesce two warnings: 1. define the CODE * as const 2. restructure function to eliminate warning about exiting with no return. severity_map() never returns when it can't find an appropriate sysylog facility, and it longjmp()'s away into error code handling. Keep this behavior by stashing the facility value found during our search and checking for -1 if found. Modified: head/contrib/tcp_wrappers/options.c Modified: head/contrib/tcp_wrappers/options.c ============================================================================== --- head/contrib/tcp_wrappers/options.c Wed Oct 30 22:04:48 2013 (r257403) +++ head/contrib/tcp_wrappers/options.c Wed Oct 30 22:41:18 2013 (r257404) @@ -443,16 +443,21 @@ struct request_info *request; /* severity_map - lookup facility or severity value */ static int severity_map(table, name) -CODE *table; +const CODE *table; char *name; { - CODE *t; + const CODE *t; + int ret = -1; for (t = table; t->c_name; t++) - if (STR_EQ(t->c_name, name)) - return (t->c_val); - tcpd_jump("bad syslog facility or severity: \"%s\"", name); - /* NOTREACHED */ + if (STR_EQ(t->c_name, name)) { + ret = t->c_val; + break; + } + if (ret == -1) + tcpd_jump("bad syslog facility or severity: \"%s\"", name); + + return (ret); } /* severity_option - change logging severity for this event (Dave Mitchell) */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 22:43:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 557A858A; Wed, 30 Oct 2013 22:43:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4366629B3; Wed, 30 Oct 2013 22:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UMhfjc081956; Wed, 30 Oct 2013 22:43:41 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UMhfp9081955; Wed, 30 Oct 2013 22:43:41 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310302243.r9UMhfp9081955@svn.freebsd.org> From: Sean Bruno Date: Wed, 30 Oct 2013 22:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257405 - head/contrib/tcp_wrappers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 22:43:41 -0000 Author: sbruno Date: Wed Oct 30 22:43:40 2013 New Revision: 257405 URL: http://svnweb.freebsd.org/changeset/base/257405 Log: Quiesce warning, which could be a bug IMO, by correctly defining the host_info structure name Modified: head/contrib/tcp_wrappers/hosts_access.c Modified: head/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- head/contrib/tcp_wrappers/hosts_access.c Wed Oct 30 22:41:18 2013 (r257404) +++ head/contrib/tcp_wrappers/hosts_access.c Wed Oct 30 22:43:40 2013 (r257405) @@ -270,7 +270,7 @@ struct request_info *request; static int hostfile_match(path, host) char *path; -struct hosts_info *host; +struct host_info *host; { char tok[BUFSIZ]; int match = NO; From owner-svn-src-all@FreeBSD.ORG Wed Oct 30 22:45:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2CB1489A; Wed, 30 Oct 2013 22:45:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A26629C6; Wed, 30 Oct 2013 22:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9UMjZUJ082311; Wed, 30 Oct 2013 22:45:35 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9UMjZbJ082310; Wed, 30 Oct 2013 22:45:35 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310302245.r9UMjZbJ082310@svn.freebsd.org> From: Sean Bruno Date: Wed, 30 Oct 2013 22:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257406 - head/contrib/tcp_wrappers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 30 Oct 2013 22:45:36 -0000 Author: sbruno Date: Wed Oct 30 22:45:35 2013 New Revision: 257406 URL: http://svnweb.freebsd.org/changeset/base/257406 Log: Queisce warning about undeclared function usage. yp_get_default_domain is defined in workaround.c but is not declared in any header file. Tie the declaration to the same #define conditional used when the function is called, NETGROUP Modified: head/contrib/tcp_wrappers/hosts_access.c Modified: head/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- head/contrib/tcp_wrappers/hosts_access.c Wed Oct 30 22:43:40 2013 (r257405) +++ head/contrib/tcp_wrappers/hosts_access.c Wed Oct 30 22:45:35 2013 (r257406) @@ -103,6 +103,11 @@ static int masked_match6(); #define BUFLEN 2048 +/* definition to be used from workarounds.c */ +#ifdef NETGROUP +int yp_get_default_domain(char **); +#endif + /* hosts_access - host access control facility */ int hosts_access(request) From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 01:45:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B349F451; Thu, 31 Oct 2013 01:45:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8847423BD; Thu, 31 Oct 2013 01:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V1jtoG047134; Thu, 31 Oct 2013 01:45:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V1jtBO047133; Thu, 31 Oct 2013 01:45:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310310145.r9V1jtBO047133@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 01:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257407 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 01:45:55 -0000 Author: ian Date: Thu Oct 31 01:45:55 2013 New Revision: 257407 URL: http://svnweb.freebsd.org/changeset/base/257407 Log: Expand the list of compatible devices this driver works with. Increase the target frequency from 1 to 10 MHz because these SoCs are plenty fast enough to benefit from the extra event timer resolution. Modified: head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Wed Oct 30 22:45:35 2013 (r257406) +++ head/sys/arm/freescale/imx/imx_gpt.c Thu Oct 31 01:45:55 2013 (r257407) @@ -95,7 +95,7 @@ struct imx_gpt_softc *imx_gpt_sc = NULL; static const int imx_gpt_delay_count = 78; /* Try to divide down an available fast clock to this frequency. */ -#define TARGET_FREQUENCY 1000000 +#define TARGET_FREQUENCY 10000000 /* Don't try to set an event timer period smaller than this. */ #define MIN_ET_PERIOD 10LLU @@ -107,16 +107,26 @@ static struct resource_spec imx_gpt_spec { -1, 0 } }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-gpt", 1}, + {"fsl,imx53-gpt", 1}, + {"fsl,imx51-gpt", 1}, + {"fsl,imx31-gpt", 1}, + {"fsl,imx27-gpt", 1}, + {"fsl,imx25-gpt", 1}, + {NULL, 0} +}; + static int imx_gpt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "fsl,imx51-gpt") && - !ofw_bus_is_compatible(dev, "fsl,imx53-gpt")) - return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX GPT timer"); + return (BUS_PROBE_DEFAULT); + } - device_set_desc(dev, "Freescale i.MX GPT timer"); - return (BUS_PROBE_DEFAULT); + return (ENXIO); } static int @@ -142,10 +152,7 @@ imx_gpt_attach(device_t dev) * we're running on. Eventually we could allow selection from the fdt; * the code in this driver will cope with any clock frequency. */ - if (ofw_bus_is_compatible(dev, "fsl,imx6-gpt")) - sc->sc_clksrc = GPT_CR_CLKSRC_24M; - else - sc->sc_clksrc = GPT_CR_CLKSRC_IPG; + sc->sc_clksrc = GPT_CR_CLKSRC_IPG; ctlreg = 0; From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 01:57:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2E7E98D7; Thu, 31 Oct 2013 01:57:06 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D06C2457; Thu, 31 Oct 2013 01:57:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V1v5va050459; Thu, 31 Oct 2013 01:57:05 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V1v5Nc050456; Thu, 31 Oct 2013 01:57:05 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201310310157.r9V1v5Nc050456@svn.freebsd.org> From: Kevin Lo Date: Thu, 31 Oct 2013 01:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257408 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 01:57:06 -0000 Author: kevlo Date: Thu Oct 31 01:57:05 2013 New Revision: 257408 URL: http://svnweb.freebsd.org/changeset/base/257408 Log: Add manpage for urtwnfw, the Realtek RTL8188CU/RTL8192CU firmware module. Also fix a few nits in urtwn.4. Reviewed by: rpaulo Added: head/share/man/man4/urtwnfw.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/urtwn.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Oct 31 01:45:55 2013 (r257407) +++ head/share/man/man4/Makefile Thu Oct 31 01:57:05 2013 (r257408) @@ -523,6 +523,7 @@ MAN= aac.4 \ urio.4 \ ${_urtw.4} \ urtwn.4 \ + urtwnfw.4 \ usb.4 \ usb_quirk.4 \ uslcom.4 \ Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Thu Oct 31 01:45:55 2013 (r257407) +++ head/share/man/man4/urtwn.4 Thu Oct 31 01:57:05 2013 (r257408) @@ -1,6 +1,3 @@ -.\" $OpenBSD: urtwn.4,v 1.20 2013/05/16 10:02:59 sthen Exp $ -.\" $FreeBSD$ -.\" .\" Copyright (c) 2010 Damien Bergamini .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -15,7 +12,9 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd October 6, 2013 +.\" $FreeBSD$ +.\" +.Dd October 31, 2013 .Dt URTWN 4 .Os .Sh NAME @@ -40,6 +39,13 @@ module at boot time, place the following .Bd -literal -offset indent if_urtwn_load="YES" .Ed +.Pp +In both cases, place the following line in +.Xr loader.conf 5 +to acknowledge the firmware license (see below): +.Bd -literal -offset indent +legal.realtek.license_ack=1 +.Ed .Sh DESCRIPTION The .Nm @@ -57,6 +63,22 @@ The RTL8192CU is a highly integrated mul 802.11n adapter that combines a MAC, a 2T2R capable baseband and an RF in a single chip. It operates in the 2GHz spectrum only. +.Pp +This driver requires the firmware built with the +.Nm urtwnfw +module to work. +For the loaded firmware to be enabled for use the license at +.Pa /usr/share/doc/legal/realtek +must be agreed by adding the following line to +.Xr loader.conf 5 : +.Pp +.Dl "legal.realtek.license_ack=1" +.Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/realtek" -compact +.It Pa /usr/share/doc/legal/realtek +.Nm +firmware license +.El .Sh HARDWARE The following adapters should work: .Pp @@ -97,6 +119,7 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO +.Xr urtwnfw 4 , .Xr intro 4 , .Xr netintro 4 , .Xr usb 4 , Added: head/share/man/man4/urtwnfw.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/urtwnfw.4 Thu Oct 31 01:57:05 2013 (r257408) @@ -0,0 +1,75 @@ +.\" Copyright (c) 2013 Kevin Lo +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 31, 2013 +.Dt URTWNFW 4 +.Os +.Sh NAME +.Nm urtwnfw +.Nd "Firmware Module for Realtek Wireless driver" +.Sh SYNOPSIS +To compile this module into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device urtwnfw" +.Ed +.Pp +This will include three firmware images inside the kernel. +If you want to pick only the firmware image for your network adapter choose one +of the following: +.Bd -ragged -offset indent +.Cd "device urtwn-rtl8192cfwT" +.Cd "device urtwn-rtl8192cfwU" +.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 +urtwn-rtl8192cfwT_load="YES" +urtwn-rtl8192cfwU_load="YES" +.Ed +.Sh DESCRIPTION +This module provides access to firmware sets for the +Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU +chip based USB WiFi adapters. +It may be +statically linked into the kernel, or loaded as a module. +.Pp +For the loaded firmware to be enabled for use the license at +.Pa /usr/share/doc/legal/realtek +must be agreed to by adding the following line to +.Xr loader.conf 5 : +.Pp +.Dl "legal.realtek.license_ack=1" +.Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/realtek" -compact +.It Pa /usr/share/doc/legal/realtek +.Nm +firmware license +.El +.Sh SEE ALSO +.Xr urtwn 4 , +.Xr firmware 9 From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:00:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C743EA53; Thu, 31 Oct 2013 02:00:58 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3AFD2495; Thu, 31 Oct 2013 02:00:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V20wUE053162; Thu, 31 Oct 2013 02:00:58 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V20w78053161; Thu, 31 Oct 2013 02:00:58 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201310310200.r9V20w78053161@svn.freebsd.org> From: Kevin Lo Date: Thu, 31 Oct 2013 02:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257409 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:00:58 -0000 Author: kevlo Date: Thu Oct 31 02:00:58 2013 New Revision: 257409 URL: http://svnweb.freebsd.org/changeset/base/257409 Log: Enable DC filter in RT3071 Version E. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Oct 31 01:57:05 2013 (r257408) +++ head/sys/dev/usb/wlan/if_run.c Thu Oct 31 02:00:58 2013 (r257409) @@ -4601,10 +4601,15 @@ run_rt3070_rf_setup(struct run_softc *sc run_rt3070_rf_write(sc, 16, rf); } else if (sc->mac_ver == 0x3071) { - /* enable DC filter */ - if (sc->mac_rev >= 0x0201) + if (sc->mac_rev >= 0x0211) { + /* enable DC filter */ run_bbp_write(sc, 103, 0xc0); + /* improve power consumption */ + run_bbp_read(sc, 31, &bbp); + run_bbp_write(sc, 31, bbp & ~0x03); + } + run_bbp_read(sc, 138, &bbp); if (sc->ntxchains == 1) bbp |= 0x20; /* turn off DAC1 */ @@ -4612,12 +4617,6 @@ run_rt3070_rf_setup(struct run_softc *sc bbp &= ~0x02; /* turn off ADC1 */ run_bbp_write(sc, 138, bbp); - if (sc->mac_rev >= 0x0211) { - /* improve power consumption */ - run_bbp_read(sc, 31, &bbp); - run_bbp_write(sc, 31, bbp & ~0x03); - } - run_write(sc, RT2860_TX_SW_CFG1, 0); if (sc->mac_rev < 0x0211) { run_write(sc, RT2860_TX_SW_CFG2, From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:02:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A13ECBC4; Thu, 31 Oct 2013 02:02:14 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F42724A6; Thu, 31 Oct 2013 02:02:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V22Ebd053434; Thu, 31 Oct 2013 02:02:14 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V22EaM053433; Thu, 31 Oct 2013 02:02:14 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201310310202.r9V22EaM053433@svn.freebsd.org> From: Kevin Lo Date: Thu, 31 Oct 2013 02:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257410 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:02:14 -0000 Author: kevlo Date: Thu Oct 31 02:02:14 2013 New Revision: 257410 URL: http://svnweb.freebsd.org/changeset/base/257410 Log: Initialize BBP68 to improve rx sensitivity. Modified: head/sys/dev/usb/wlan/if_runreg.h Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Thu Oct 31 02:00:58 2013 (r257409) +++ head/sys/dev/usb/wlan/if_runreg.h Thu Oct 31 02:02:14 2013 (r257410) @@ -1027,6 +1027,7 @@ static const struct rt2860_rate { #define RT2860_DEF_BBP \ { 65, 0x2c }, \ { 66, 0x38 }, \ + { 68, 0x0b }, \ { 69, 0x12 }, \ { 70, 0x0a }, \ { 73, 0x10 }, \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:03:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C9C6CE0C; Thu, 31 Oct 2013 02:03:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E1E124B8; Thu, 31 Oct 2013 02:03:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V23UjR053916; Thu, 31 Oct 2013 02:03:30 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V23Ucc053914; Thu, 31 Oct 2013 02:03:30 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201310310203.r9V23Ucc053914@svn.freebsd.org> From: Kevin Lo Date: Thu, 31 Oct 2013 02:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257411 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:03:30 -0000 Author: kevlo Date: Thu Oct 31 02:03:30 2013 New Revision: 257411 URL: http://svnweb.freebsd.org/changeset/base/257411 Log: Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to match with the vendor driver. While here, remove unused RT2860_DEF_MAC definition. Modified: head/sys/dev/usb/wlan/if_runreg.h Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Thu Oct 31 02:02:14 2013 (r257410) +++ head/sys/dev/usb/wlan/if_runreg.h Thu Oct 31 02:03:30 2013 (r257411) @@ -958,39 +958,9 @@ static const struct rt2860_rate { /* * Default values for MAC registers; values taken from the reference driver. */ -#define RT2860_DEF_MAC \ - { RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \ - { RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \ - { RT2860_HT_BASIC_RATE, 0x00008003 }, \ - { RT2860_MAC_SYS_CTRL, 0x00000000 }, \ - { RT2860_BKOFF_SLOT_CFG, 0x00000209 }, \ - { RT2860_TX_SW_CFG0, 0x00000000 }, \ - { RT2860_TX_SW_CFG1, 0x00080606 }, \ - { RT2860_TX_LINK_CFG, 0x00001020 }, \ - { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ - { RT2860_LED_CFG, 0x7f031e46 }, \ - { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ - { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ - { RT2860_WMM_CWMAX_CFG, 0x000034aa }, \ - { RT2860_MAX_PCNT, 0x1f3fbf9f }, \ - { RT2860_TX_RTY_CFG, 0x47d01f0f }, \ - { RT2860_AUTO_RSP_CFG, 0x00000013 }, \ - { RT2860_CCK_PROT_CFG, 0x05740003 }, \ - { RT2860_OFDM_PROT_CFG, 0x05740003 }, \ - { RT2860_GF20_PROT_CFG, 0x01744004 }, \ - { RT2860_GF40_PROT_CFG, 0x03f44084 }, \ - { RT2860_MM20_PROT_CFG, 0x01744004 }, \ - { RT2860_MM40_PROT_CFG, 0x03f54084 }, \ - { RT2860_TXOP_CTRL_CFG, 0x0000583f }, \ - { RT2860_TXOP_HLDR_ET, 0x00000002 }, \ - { RT2860_TX_RTS_CFG, 0x00092b20 }, \ - { RT2860_EXP_ACK_TIME, 0x002400ca }, \ - { RT2860_XIFS_TIME_CFG, 0x33a41010 }, \ - { RT2860_PWR_PIN_CFG, 0x00000003 } - -/* XXX only a few registers differ from above, try to merge? */ #define RT2870_DEF_MAC \ { RT2860_BCN_OFFSET0, 0xf8f0e8e0 }, \ + { RT2860_BCN_OFFSET1, 0x6f77d0c8 }, \ { RT2860_LEGACY_BASIC_RATE, 0x0000013f }, \ { RT2860_HT_BASIC_RATE, 0x00008003 }, \ { RT2860_MAC_SYS_CTRL, 0x00000000 }, \ @@ -999,6 +969,7 @@ static const struct rt2860_rate { { RT2860_TX_SW_CFG1, 0x00080606 }, \ { RT2860_TX_LINK_CFG, 0x00001020 }, \ { RT2860_TX_TIMEOUT_CFG, 0x000a2090 }, \ + { RT2860_MAX_LEN_CFG, 0x00001f00 }, \ { RT2860_LED_CFG, 0x7f031e46 }, \ { RT2860_WMM_AIFSN_CFG, 0x00002273 }, \ { RT2860_WMM_CWMIN_CFG, 0x00002344 }, \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:04:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8D35F61; Thu, 31 Oct 2013 02:04:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C65B824CA; Thu, 31 Oct 2013 02:04:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V24rom054148; Thu, 31 Oct 2013 02:04:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V24r6U054147; Thu, 31 Oct 2013 02:04:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310310204.r9V24r6U054147@svn.freebsd.org> From: Adrian Chadd Date: Thu, 31 Oct 2013 02:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257412 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:04:53 -0000 Author: adrian Date: Thu Oct 31 02:04:53 2013 New Revision: 257412 URL: http://svnweb.freebsd.org/changeset/base/257412 Log: Don't treat the node as an 11n node if 11n rates are disabled. For now, the AMRR code only knows about _either_ MCS or non-MCS rates. It doesn't know how to downgrade (ie, doing 11b CCK rates if MCS0 isn't reliable.) PR: kern/183428 Modified: head/sys/net80211/ieee80211_amrr.c Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Thu Oct 31 02:03:30 2013 (r257411) +++ head/sys/net80211/ieee80211_amrr.c Thu Oct 31 02:04:53 2013 (r257412) @@ -131,6 +131,12 @@ amrr_deinit(struct ieee80211vap *vap) free(vap->iv_rs, M_80211_RATECTL); } +/* + * Return whether 11n rates are possible. + * + * Some 11n devices may return HT information but no HT rates. + * Thus, we shouldn't treat them as an 11n node. + */ static int amrr_node_is_11n(struct ieee80211_node *ni) { @@ -139,6 +145,8 @@ amrr_node_is_11n(struct ieee80211_node * return (0); if (ni->ni_chan == IEEE80211_CHAN_ANYC) return (0); + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates == 0) + return (0); return (IEEE80211_IS_CHAN_HT(ni->ni_chan)); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:11:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2D4B82CE; Thu, 31 Oct 2013 02:11:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 017E32546; Thu, 31 Oct 2013 02:11:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V2BZNW057450; Thu, 31 Oct 2013 02:11:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V2BZc0057449; Thu, 31 Oct 2013 02:11:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310310211.r9V2BZc0057449@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 02:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257413 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:11:36 -0000 Author: ian Date: Thu Oct 31 02:11:35 2013 New Revision: 257413 URL: http://svnweb.freebsd.org/changeset/base/257413 Log: Reset the timer interrupt status register at the top rather than bottom of the interrupt handler. If the event callback starts a new short timeout, the timer can fire before returning from the event callback, and clearing the interrupt status after that loses the interrupt and hangs until the counter wraps. Fixing all of this removes the need for the do-nothing loop at the top of the handler which really just waited for the counter to roll over and reach the one-shot count again. Also add a missing return(0) in the periodic timer start case. Modified: head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Thu Oct 31 02:04:53 2013 (r257412) +++ head/sys/arm/freescale/imx/imx_gpt.c Thu Oct 31 02:11:35 2013 (r257413) @@ -277,14 +277,9 @@ imx_gpt_timer_start(struct eventtimer *e WRITE4(sc, IMX_GPT_OCR2, READ4(sc, IMX_GPT_CNT) + sc->sc_period); /* Enable compare register 2 Interrupt */ SET4(sc, IMX_GPT_IR, GPT_IR_OF2); + return (0); } else if (first != 0) { ticks = ((uint32_t)et->et_frequency * first) >> 32; - - /* - * TODO: setupt second compare reg with time which will save - * us in case correct one lost, f.e. if period to short and - * setup done later than counter reach target value. - */ /* Do not disturb, otherwise event will be lost */ spinlock_enter(); /* Set expected value */ @@ -293,7 +288,6 @@ imx_gpt_timer_start(struct eventtimer *e SET4(sc, IMX_GPT_IR, GPT_IR_OF1); /* Now everybody can relax */ spinlock_exit(); - return (0); } @@ -341,27 +335,32 @@ imx_gpt_intr(void *arg) sc = (struct imx_gpt_softc *)arg; - /* Sometime we not get staus bit when interrupt arrive. Cache? */ - while (!(status = READ4(sc, IMX_GPT_SR))) - ; + status = READ4(sc, IMX_GPT_SR); + + /* + * Clear interrupt status before invoking event callbacks. The callback + * often sets up a new one-shot timer event and if the interval is short + * enough it can fire before we get out of this function. If we cleared + * at the bottom we'd miss the interrupt and hang until the clock wraps. + */ + WRITE4(sc, IMX_GPT_SR, status); + /* Handle one-shot timer events. */ if (status & GPT_IR_OF1) { if (sc->et.et_active) { sc->et.et_event_cb(&sc->et, sc->et.et_arg); } } + + /* Handle periodic timer events. */ if (status & GPT_IR_OF2) { - if (sc->et.et_active) { + if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); - /* Set expected value */ + if (sc->sc_period != 0) WRITE4(sc, IMX_GPT_OCR2, READ4(sc, IMX_GPT_CNT) + sc->sc_period); - } } - /* ACK */ - WRITE4(sc, IMX_GPT_SR, status); - return (FILTER_HANDLED); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:14:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E9D24449; Thu, 31 Oct 2013 02:14:28 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D7988255B; Thu, 31 Oct 2013 02:14:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V2ESGk058074; Thu, 31 Oct 2013 02:14:28 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V2ESLO058073; Thu, 31 Oct 2013 02:14:28 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201310310214.r9V2ESLO058073@svn.freebsd.org> From: Rui Paulo Date: Thu, 31 Oct 2013 02:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257414 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:14:29 -0000 Author: rpaulo Date: Thu Oct 31 02:14:28 2013 New Revision: 257414 URL: http://svnweb.freebsd.org/changeset/base/257414 Log: Enable USB. Modified: head/sys/arm/conf/DIGI-CCWMX53 Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Thu Oct 31 02:11:35 2013 (r257413) +++ head/sys/arm/conf/DIGI-CCWMX53 Thu Oct 31 02:14:28 2013 (r257414) @@ -65,7 +65,7 @@ options VFP # vfp/neon #options BOOTP_COMPAT #options BOOTP_NFSROOT #options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ue0 +#options BOOTP_WIRED_TO=ffec0 #options ROOTDEVNAME=\"ufs:ada0s2a\" @@ -134,13 +134,13 @@ device cd # CD device pass # Passthrough device (direct SCSI access) # USB support -#options USB_DEBUG # enable debug msgs -#device ehci # OHCI USB interface -#device usb # USB Bus (required) -#device umass # Disks/Mass storage - Requires scbus and da -#device uhid # "Human Interface Devices" +options USB_DEBUG # enable debug msgs +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" #device ukbd # Allow keyboard like HIDs to control console -#device ums +device ums # USB Ethernet, requires miibus #device miibus From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:21:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 80BEC6EC; Thu, 31 Oct 2013 02:21:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EB2425B4; Thu, 31 Oct 2013 02:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V2LnMU061277; Thu, 31 Oct 2013 02:21:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V2LnCh061276; Thu, 31 Oct 2013 02:21:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310310221.r9V2LnCh061276@svn.freebsd.org> From: Adrian Chadd Date: Thu, 31 Oct 2013 02:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257415 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:21:49 -0000 Author: adrian Date: Thu Oct 31 02:21:48 2013 New Revision: 257415 URL: http://svnweb.freebsd.org/changeset/base/257415 Log: Don't base the rate table selection based on the channel mode; it needs to check whether there are rate entries in there or not. PR: kern/183428 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Oct 31 02:14:28 2013 (r257414) +++ head/sys/dev/iwn/if_iwn.c Thu Oct 31 02:21:48 2013 (r257415) @@ -4312,6 +4312,7 @@ iwn_set_link_quality(struct iwn_softc *s struct iwn_cmd_link_quality linkq; uint8_t txant; int i, rate, txrate; + int is_11n; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -4326,15 +4327,25 @@ iwn_set_link_quality(struct iwn_softc *s linkq.ampdu_threshold = 3; linkq.ampdu_limit = htole16(4000); /* 4ms */ + /* + * Are we using 11n rates? Ensure the channel is + * 11n _and_ we have some 11n rates, or don't + * try. + */ + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates > 0) + is_11n = 1; + else + is_11n = 0; + /* Start at highest available bit-rate. */ - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + if (is_11n) txrate = ni->ni_htrates.rs_nrates - 1; else txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { uint32_t plcp; - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + if (is_11n) rate = IEEE80211_RATE_MCS | txrate; else rate = RV(rs->rs_rates[txrate]); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:27:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D6552D3F; Thu, 31 Oct 2013 02:27:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9E5E260B; Thu, 31 Oct 2013 02:27:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V2RGmE062191; Thu, 31 Oct 2013 02:27:16 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V2RGTG062190; Thu, 31 Oct 2013 02:27:16 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310310227.r9V2RGTG062190@svn.freebsd.org> From: Mark Johnston Date: Thu, 31 Oct 2013 02:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257416 - head/sys/mips/alchemy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:27:16 -0000 Author: markj Date: Thu Oct 31 02:27:16 2013 New Revision: 257416 URL: http://svnweb.freebsd.org/changeset/base/257416 Log: Fix a typo introduced in r257338. Modified: head/sys/mips/alchemy/obio.c Modified: head/sys/mips/alchemy/obio.c ============================================================================== --- head/sys/mips/alchemy/obio.c Thu Oct 31 02:21:48 2013 (r257415) +++ head/sys/mips/alchemy/obio.c Thu Oct 31 02:27:16 2013 (r257416) @@ -158,7 +158,7 @@ static int obio_probe(device_t dev) { - return (BUS_PROBE_NO_WILDCARD); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:35:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2C33323; Thu, 31 Oct 2013 02:35:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6AF267F; Thu, 31 Oct 2013 02:35:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V2Z20o065380; Thu, 31 Oct 2013 02:35:02 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V2Z1jW065363; Thu, 31 Oct 2013 02:35:01 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310310235.r9V2Z1jW065363@svn.freebsd.org> From: Mark Johnston Date: Thu, 31 Oct 2013 02:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257417 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 i386/i386 mips/mips powerpc/aim sys x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 02:35:02 -0000 Author: markj Date: Thu Oct 31 02:35:00 2013 New Revision: 257417 URL: http://svnweb.freebsd.org/changeset/base/257417 Log: Remove references to an unused fasttrap probe hook, and remove the corresponding x86 trap type. Userland DTrace probes are currently handled by the other fasttrap hooks (dtrace_pid_probe_ptr and dtrace_return_probe_ptr). Discussed with: rpaulo Modified: head/sys/amd64/amd64/trap.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/i386/i386/trap.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c head/sys/sys/dtrace_bsd.h head/sys/x86/include/trap.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/amd64/amd64/trap.c Thu Oct 31 02:35:00 2013 (r257417) @@ -114,9 +114,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -128,7 +127,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -163,7 +162,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -255,16 +253,11 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - else if (type == T_BPTFLT && + if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) goto out; Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Oct 31 02:35:00 2013 (r257417) @@ -142,7 +142,6 @@ dtrace_sync(void) } #ifdef notyet -int (*dtrace_fasttrap_probe_ptr)(struct regs *); int (*dtrace_pid_probe_ptr)(struct regs *); int (*dtrace_return_probe_ptr)(struct regs *); @@ -213,13 +212,6 @@ dtrace_user_probe(struct regs *rp, caddr rw_exit(rwp); rp->r_pc = npc; - } else if (rp->r_trapno == T_DTRACE_PROBE) { - rwp = &CPU->cpu_ft_lock; - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr != NULL) - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } else if (rp->r_trapno == T_BPTFLT) { uint8_t instr; rwp = &CPU->cpu_ft_lock; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/i386/i386/trap.c Thu Oct 31 02:35:00 2013 (r257417) @@ -123,9 +123,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -139,7 +138,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -174,8 +173,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ - }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -275,15 +272,10 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/mips/mips/trap.c Thu Oct 31 02:35:00 2013 (r257417) @@ -112,9 +112,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -639,7 +638,7 @@ trap(struct trapframe *trapframe) * function can return normally. */ /* - * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + * XXXDTRACE: add pid probe handler here (if ever) */ if (!usermode) { if (dtrace_trap_func != NULL && (*dtrace_trap_func)(trapframe, type)) Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/powerpc/aim/trap.c Thu Oct 31 02:35:00 2013 (r257417) @@ -121,9 +121,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; int (*dtrace_invop_jump_addr)(struct trapframe *); @@ -208,7 +207,7 @@ trap(struct trapframe *frame) * function can return normally. */ /* - * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + * XXXDTRACE: add pid probe handler here (if ever) */ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) return; Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/sys/dtrace_bsd.h Thu Oct 31 02:35:00 2013 (r257417) @@ -70,8 +70,6 @@ extern dtrace_invop_func_t dtrace_invop_ extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ -typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *); -extern dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; typedef int (*dtrace_pid_probe_ptr_t)(struct reg *); extern dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; typedef int (*dtrace_return_probe_ptr_t)(struct reg *); Modified: head/sys/x86/include/trap.h ============================================================================== --- head/sys/x86/include/trap.h Thu Oct 31 02:27:16 2013 (r257416) +++ head/sys/x86/include/trap.h Thu Oct 31 02:35:00 2013 (r257417) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 03:12:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 298136AC; Thu, 31 Oct 2013 03:12:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15BC92A0E; Thu, 31 Oct 2013 03:12:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V3CmCw079707; Thu, 31 Oct 2013 03:12:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V3CmXn079706; Thu, 31 Oct 2013 03:12:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310310312.r9V3CmXn079706@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 03:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257418 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 03:12:49 -0000 Author: ian Date: Thu Oct 31 03:12:48 2013 New Revision: 257418 URL: http://svnweb.freebsd.org/changeset/base/257418 Log: Don't iterate through the bits of the pending interrupt register if the whole register is zero. Most of the registers will be zero most of the time. Modified: head/sys/arm/freescale/imx/tzic.c Modified: head/sys/arm/freescale/imx/tzic.c ============================================================================== --- head/sys/arm/freescale/imx/tzic.c Thu Oct 31 02:35:00 2013 (r257417) +++ head/sys/arm/freescale/imx/tzic.c Thu Oct 31 03:12:48 2013 (r257418) @@ -163,7 +163,7 @@ arm_get_next_irq(int last_irq) for (i = 0; i < 4; i++) { pending = tzic_read_4(TZIC_PND(i)); - for (b = 0; b < 32; b++) + for (b = 0; pending != 0 && b < 32; b++) if (pending & (1 << b)) { return (i * 32 + b); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 03:23:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 990C796E; Thu, 31 Oct 2013 03:23:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 871A02AA7; Thu, 31 Oct 2013 03:23:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V3NPBt083290; Thu, 31 Oct 2013 03:23:25 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V3NPxN083289; Thu, 31 Oct 2013 03:23:25 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310310323.r9V3NPxN083289@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 03:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257419 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 03:23:25 -0000 Author: ian Date: Thu Oct 31 03:23:25 2013 New Revision: 257419 URL: http://svnweb.freebsd.org/changeset/base/257419 Log: Do not EOI an interrupt until the point after the filter handlers / before threaded handlers. It's not easy to see from the diffs of this change exactly how it accomplishes the above. The arm_mask_irq() and arm_unmask_irq() functions are, respectively, the pre_thread and post_thread hooks. Not seen in these diffs, the arm_post_filter() routine also EOIs. The post_filter routine runs after filter handlers if there will be no threaded handlers, so it just EOIs. The pre_thread routine masks the interrupt (at the controller, not the source) and EOIs. So one way or another, the EOI happens at the point where filter handlers are done. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Oct 31 03:12:48 2013 (r257418) +++ head/sys/arm/arm/gic.c Thu Oct 31 03:23:25 2013 (r257419) @@ -271,7 +271,6 @@ arm_get_next_irq(int last_irq) printf("Spurious interrupt detected [0x%08x]\n", active_irq); return -1; } - gic_c_write_4(GICC_EOIR, active_irq); return active_irq; } @@ -279,14 +278,15 @@ arm_get_next_irq(int last_irq) void arm_mask_irq(uintptr_t nb) { + gic_d_write_4(GICD_ICENABLER(nb >> 5), (1UL << (nb & 0x1F))); + gic_c_write_4(GICC_EOIR, nb); } void arm_unmask_irq(uintptr_t nb) { - gic_c_write_4(GICC_EOIR, nb); gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F))); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 03:29:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3B2F2BA2; Thu, 31 Oct 2013 03:29:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FAF52ADA; Thu, 31 Oct 2013 03:29:31 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 2658211B55; Thu, 31 Oct 2013 03:29:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 2658211B55 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 30 Oct 2013 23:29:23 -0400 From: Glen Barber To: Mark Johnston Subject: Re: svn commit: r257416 - head/sys/mips/alchemy Message-ID: <20131031032923.GK1782@glenbarber.us> References: <201310310227.r9V2RGTG062190@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UlsYxwg8UDQn+EKZ" Content-Disposition: inline In-Reply-To: <201310310227.r9V2RGTG062190@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 03:29:32 -0000 --UlsYxwg8UDQn+EKZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 31, 2013 at 02:27:16AM +0000, Mark Johnston wrote: > Author: markj > Date: Thu Oct 31 02:27:16 2013 > New Revision: 257416 > URL: http://svnweb.freebsd.org/changeset/base/257416 >=20 > Log: > Fix a typo introduced in r257338. >=20 > Modified: > head/sys/mips/alchemy/obio.c >=20 > Modified: head/sys/mips/alchemy/obio.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/alchemy/obio.c Thu Oct 31 02:21:48 2013 (r257415) > +++ head/sys/mips/alchemy/obio.c Thu Oct 31 02:27:16 2013 (r257416) > @@ -158,7 +158,7 @@ static int > obio_probe(device_t dev) > { > =20 > - return (BUS_PROBE_NO_WILDCARD); > + return (BUS_PROBE_NOWILDCARD); > } > =20 > static int FWIW, I think this (and the previous related changes) prevent me from getting close to mounting the root filesystem on the TP-WN1043ND. Specifically, with the 'return (BUS_PROBE_NOWILDCARD);', entering '?' at mountroot prompt (after sio0 is failed to be probed), I cannot view what devices contain filesystems to mount. Doing: # sed -i '' -e 's/BUS_PROBE_NOWILDCARD/0/' sys/mips/atheros/* I can at least see that flash/spi0 has *something* mountable. But, there are other issues here, yet to be determined. Glen --UlsYxwg8UDQn+EKZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJScc6TAAoJELls3eqvi17QChAP/1AJHsXVfsHBoZCjket4BMpW jWi/jjeaHjqJJxfqZnYR6qoV1v1b9atL/g0K3Z4wnDZSsWmPNec31j7N/F4+iRvO jmQHqiYejmmHZ8VgSqUPeJ+kzM7Yw0SZLzdzIKjryoagx3HpiwF0uAFVRmszJEzV D82QogY42ikPSjiKbLzEWPM1Zu6VuHnuLKqHHIYF1QfoZBgoCtEjSMxc0W2reNBv 9aDXitvteQrlaAtw35HzbY3E/0vUs17D6W04BnwDlNoau9v0RElcpbIkikyKXraI 0ZRLSRxq2CdfWfb9jex6SquOwVRNabKYKVsNGkZtOLSLFtSrXkGpOH8YV6WLh4ze XovsAm6ljxsAGfrOMpC//uiVmTVrOebhy9wAwnFJ2t164GnUefJsn2/F26aDpdrb v9/6FdiMx1eaFsW0AATmvdTrMABf+qSVIF+0G1QNfhFNanfJYVFwJjEqKLUSUpwp tGvCWiAW82XGM7h6SzOaSAqB5ksvQHdCsmuH3gVLnPRjp5kfckwP74u5/d+iNrl/ eyC9hXMTmmEPcRsWplD9kbD+5eSDzjvQyXN7+ESEGzBXiOmSd1GWumj2HH8zJn45 uslykcDg2AK3v+X8/XzPbcbQ5tIRpPXNoHJtBUt2AKSwQjQ+VTleHhOuFWwK9Mi2 Jc4C296pRMW5kv+udWFU =tjTO -----END PGP SIGNATURE----- --UlsYxwg8UDQn+EKZ-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 03:39:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C639EB4; Thu, 31 Oct 2013 03:39:02 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 475D32B5D; Thu, 31 Oct 2013 03:39:02 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed; delsp=yes Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0MVI00H00K8MW200@smtpauth4.wiscmail.wisc.edu>; Wed, 30 Oct 2013 22:39:01 -0500 (CDT) X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.10.31.33015, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from [10.0.2.100] (adsl-76-208-69-44.dsl.mdsnwi.sbcglobal.net [76.208.69.44]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0MVI001CLKSVC610@smtpauth4.wiscmail.wisc.edu>; Wed, 30 Oct 2013 22:38:57 -0500 (CDT) Message-id: <7A8C78BE-897B-4ECF-A23B-70E9EAF2681C@freebsd.org> From: Nathan Whitehorn To: Glen Barber In-reply-to: <20131031032923.GK1782@glenbarber.us> Subject: Re: svn commit: r257416 - head/sys/mips/alchemy Date: Wed, 30 Oct 2013 22:38:53 -0500 References: <201310310227.r9V2RGTG062190@svn.freebsd.org> <20131031032923.GK1782@glenbarber.us> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mark Johnston , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 03:39:02 -0000 On Oct 30, 2013, at 10:29 PM, Glen Barber wrote: > On Thu, Oct 31, 2013 at 02:27:16AM +0000, Mark Johnston wrote: >> Author: markj >> Date: Thu Oct 31 02:27:16 2013 >> New Revision: 257416 >> URL: http://svnweb.freebsd.org/changeset/base/257416 >> >> Log: >> Fix a typo introduced in r257338. >> >> Modified: >> head/sys/mips/alchemy/obio.c >> >> Modified: head/sys/mips/alchemy/obio.c >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/mips/alchemy/obio.c Thu Oct 31 02:21:48 2013 (r257415) >> +++ head/sys/mips/alchemy/obio.c Thu Oct 31 02:27:16 2013 (r257416) >> @@ -158,7 +158,7 @@ static int >> obio_probe(device_t dev) >> { >> >> - return (BUS_PROBE_NO_WILDCARD); >> + return (BUS_PROBE_NOWILDCARD); >> } >> >> static int > > FWIW, I think this (and the previous related changes) prevent me from > getting close to mounting the root filesystem on the TP-WN1043ND. > > Specifically, with the 'return (BUS_PROBE_NOWILDCARD);', entering > '?' at > mountroot prompt (after sio0 is failed to be probed), I cannot view > what > devices contain filesystems to mount. > > Doing: > > # sed -i '' -e 's/BUS_PROBE_NOWILDCARD/0/' sys/mips/atheros/* > > I can at least see that flash/spi0 has *something* mountable. But, > there are other issues here, yet to be determined. > > Glen BUS_PROBE_NOWILDCARD should be a no-op for these devices, since there shouldn't be any wildcard devices on nexus. Any chance you could post a before/after dmesg? -Nathan From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 03:48:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 396C2238; Thu, 31 Oct 2013 03:48:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 893102BD7; Thu, 31 Oct 2013 03:48:17 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 4FF2111D3D; Thu, 31 Oct 2013 03:48:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 4FF2111D3D Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 30 Oct 2013 23:48:14 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r257416 - head/sys/mips/alchemy Message-ID: <20131031034814.GL1782@glenbarber.us> References: <201310310227.r9V2RGTG062190@svn.freebsd.org> <20131031032923.GK1782@glenbarber.us> <7A8C78BE-897B-4ECF-A23B-70E9EAF2681C@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gmhhrsDozM2n+uz5" Content-Disposition: inline In-Reply-To: <7A8C78BE-897B-4ECF-A23B-70E9EAF2681C@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mark Johnston , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 03:48:18 -0000 --gmhhrsDozM2n+uz5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 30, 2013 at 10:38:53PM -0500, Nathan Whitehorn wrote: > >>- return (BUS_PROBE_NO_WILDCARD); > >>+ return (BUS_PROBE_NOWILDCARD); > >>} > >> > >>static int > > > >FWIW, I think this (and the previous related changes) prevent me from > >getting close to mounting the root filesystem on the TP-WN1043ND. > > > >Specifically, with the 'return (BUS_PROBE_NOWILDCARD);', entering '?' at > >mountroot prompt (after sio0 is failed to be probed), I cannot view what > >devices contain filesystems to mount. > > > >Doing: > > > > # sed -i '' -e 's/BUS_PROBE_NOWILDCARD/0/' sys/mips/atheros/* > > > >I can at least see that flash/spi0 has *something* mountable. But, > >there are other issues here, yet to be determined. > > > >Glen >=20 > BUS_PROBE_NOWILDCARD should be a no-op for these devices, since there > shouldn't be any wildcard devices on nexus. Any chance you could post a > before/after dmesg? I'd love to. :) But getting dmesg rigth now is near impossible, since my last successful install was from r248805, which I was greeted by this little gem: # dmesg Shared object "libkvm.so.5" not found, required by "dmesg" I'm at a loss here, but welcome to suggestions... :\ Glen --gmhhrsDozM2n+uz5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJScdL+AAoJELls3eqvi17QSSwP/1fwk6OnWUgdOhmiO3pshJ63 4ur9a7NPiR1INoDMrsxr8FrMZ9o8kZRNJYkDnCfz2GUqE6J4jHN7PTx9dPXzsWJ3 yxarPbiMLyNXgisM0v54rxc4KoKaBFG5/psKaeLUofuuElZYS8BhOMMCPwv7WUiF vEhDAkrE7K7V0/abXxnnJLH5t30dAyWpQnGTkOlqrBf+zHoIXS7gEzaGgJ1HPgb2 JziUdC06aJGScaYtI3z34h/0mF32yt1SWXJ5SzL9CYTfMqzfYRspcCq5+e4ty5wQ ssqzvSzmfMpvPmetf3MQpTgzGZdpkIXA83q+RVcMFk+nYEmjyaH5N4KQD5q7kL9c R8Zy97pyweDPHG/rFWfTmOX9i5OWsPvJ2WuLDfxq3ZMME8AtaI8Wg0Y7LY/P5lqr h4TiWl7bGbV9wSlNqkqxdgOd0upfknlVOnX4voWCYuKJJ7+91M9lnn+5WJ+mFx8E tJS9bnuUkb7HRItS1HI1zr81WLcuym0e6wLcdjiGIYm3dn1+WTFfo9/GvXDL5InF 0IE7eC6f9+QRD9pdHUMagX+khCQthwFV3MsXlZmCVfWcgNd7/RoU066Vq50b23DE Bv5yKLjTgv5XhVSZreMlNqojw554nyM6ljXsoghtQfbNW127FZz753NwMOgxTVih HfbSerFCnjG8elfxjepo =7cX5 -----END PGP SIGNATURE----- --gmhhrsDozM2n+uz5-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 05:00:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8896484; Thu, 31 Oct 2013 05:00:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAE4B2F2C; Thu, 31 Oct 2013 05:00:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V50pgJ024877; Thu, 31 Oct 2013 05:00:51 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V50pJ9024873; Thu, 31 Oct 2013 05:00:51 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201310310500.r9V50pJ9024873@svn.freebsd.org> From: Mark Johnston Date: Thu, 31 Oct 2013 05:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257420 - in head/sys/mips: adm5120 idt rmi/dev/nlge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 05:00:51 -0000 Author: markj Date: Thu Oct 31 05:00:50 2013 New Revision: 257420 URL: http://svnweb.freebsd.org/changeset/base/257420 Log: Fix some lingering build failures caused by fixing implicit inclusion of if_var.h. Also explicitly include lock.h and mutex.h in if_kr.c rather than depending on if_var.h to bring them in. Modified: head/sys/mips/adm5120/if_admsw.c head/sys/mips/idt/if_kr.c head/sys/mips/rmi/dev/nlge/if_nlge.c Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Thu Oct 31 03:23:25 2013 (r257419) +++ head/sys/mips/adm5120/if_admsw.c Thu Oct 31 05:00:50 2013 (r257420) @@ -98,6 +98,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET #include Modified: head/sys/mips/idt/if_kr.c ============================================================================== --- head/sys/mips/idt/if_kr.c Thu Oct 31 03:23:25 2013 (r257419) +++ head/sys/mips/idt/if_kr.c Thu Oct 31 05:00:50 2013 (r257420) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -50,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Oct 31 03:23:25 2013 (r257419) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Oct 31 05:00:50 2013 (r257420) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 05:13:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EFE82715; Thu, 31 Oct 2013 05:13:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DC2032F94; Thu, 31 Oct 2013 05:13:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V5DrMd029041; Thu, 31 Oct 2013 05:13:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V5DrYI029040; Thu, 31 Oct 2013 05:13:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310310513.r9V5DrYI029040@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 31 Oct 2013 05:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257421 - head/sys/dev/ipmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 05:13:54 -0000 Author: glebius Date: Thu Oct 31 05:13:53 2013 New Revision: 257421 URL: http://svnweb.freebsd.org/changeset/base/257421 Log: Provide a crutch that prevents watchdog to interrupt dumping on a box with IPMI enabled. Okay from: jhb Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Thu Oct 31 05:00:50 2013 (r257420) +++ head/sys/dev/ipmi/ipmi.c Thu Oct 31 05:13:53 2013 (r257421) @@ -647,6 +647,9 @@ ipmi_wd_event(void *arg, unsigned int cm unsigned int timeout; int e; + if (dumping) + return; + cmd &= WD_INTERVAL; if (cmd > 0 && cmd <= 63) { timeout = ((uint64_t)1 << cmd) / 1000000000; From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 05:20:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 202658DD; Thu, 31 Oct 2013 05:20:13 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2CFA2FBD; Thu, 31 Oct 2013 05:20:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V5KCmc030043; Thu, 31 Oct 2013 05:20:12 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V5KCPr030039; Thu, 31 Oct 2013 05:20:12 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310310520.r9V5KCPr030039@svn.freebsd.org> From: Neel Natu Date: Thu, 31 Oct 2013 05:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257422 - in head/sys/amd64/vmm: . intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 05:20:13 -0000 Author: neel Date: Thu Oct 31 05:20:11 2013 New Revision: 257422 URL: http://svnweb.freebsd.org/changeset/base/257422 Log: Rename the VMM_CTRx() family of macros to VCPU_CTRx() to highlight that these tracepoints are vcpu-specific. Add support for tracepoints that are global to the virtual machine - these tracepoints are called VM_CTRx(). Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_ktr.h Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Oct 31 05:13:53 2013 (r257421) +++ head/sys/amd64/vmm/intel/vmx.c Thu Oct 31 05:20:11 2013 (r257422) @@ -307,8 +307,8 @@ vmx_setjmp_rc2str(int rc) } } -#define SETJMP_TRACE(vmx, vcpu, vmxctx, regname) \ - VMM_CTR1((vmx)->vm, (vcpu), "setjmp trace " #regname " 0x%016lx", \ +#define SETJMP_TRACE(vmx, vcpu, vmxctx, regname) \ + VCPU_CTR1((vmx)->vm, (vcpu), "setjmp trace " #regname " 0x%016lx", \ (vmxctx)->regname) static void @@ -320,14 +320,14 @@ vmx_setjmp_trace(struct vmx *vmx, int vc panic("vmx_setjmp_trace: invalid vmxctx %p; should be %p", vmxctx, &vmx->ctx[vcpu]); - VMM_CTR1((vmx)->vm, (vcpu), "vmxctx = %p", vmxctx); - VMM_CTR2((vmx)->vm, (vcpu), "setjmp return code %s(%d)", + VCPU_CTR1((vmx)->vm, (vcpu), "vmxctx = %p", vmxctx); + VCPU_CTR2((vmx)->vm, (vcpu), "setjmp return code %s(%d)", vmx_setjmp_rc2str(rc), rc); host_rsp = host_rip = ~0; vmread(VMCS_HOST_RIP, &host_rip); vmread(VMCS_HOST_RSP, &host_rsp); - VMM_CTR2((vmx)->vm, (vcpu), "vmcs host_rip 0x%016lx, host_rsp 0x%016lx", + VCPU_CTR2((vmx)->vm, (vcpu), "vmcs host_rip 0x%016lx, host_rsp %#lx", host_rip, host_rsp); SETJMP_TRACE(vmx, vcpu, vmxctx, host_r15); @@ -886,7 +886,7 @@ static __inline void vmx_run_trace(struct vmx *vmx, int vcpu) { #ifdef KTR - VMM_CTR1(vmx->vm, vcpu, "Resume execution at 0x%0lx", vmcs_guest_rip()); + VCPU_CTR1(vmx->vm, vcpu, "Resume execution at %#lx", vmcs_guest_rip()); #endif } @@ -895,7 +895,7 @@ vmx_exit_trace(struct vmx *vmx, int vcpu int handled) { #ifdef KTR - VMM_CTR3(vmx->vm, vcpu, "%s %s vmexit at 0x%0lx", + VCPU_CTR3(vmx->vm, vcpu, "%s %s vmexit at 0x%0lx", handled ? "handled" : "unhandled", exit_reason_to_str(exit_reason), rip); #endif @@ -905,7 +905,7 @@ static __inline void vmx_astpending_trace(struct vmx *vmx, int vcpu, uint64_t rip) { #ifdef KTR - VMM_CTR1(vmx->vm, vcpu, "astpending vmexit at 0x%0lx", rip); + VCPU_CTR1(vmx->vm, vcpu, "astpending vmexit at 0x%0lx", rip); #endif } @@ -1054,7 +1054,7 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu if (error) panic("vmx_inject_nmi: vmwrite(intrinfo) %d", error); - VMM_CTR0(vmx->vm, vcpu, "Injecting vNMI"); + VCPU_CTR0(vmx->vm, vcpu, "Injecting vNMI"); /* Clear the request */ vm_nmi_clear(vmx->vm, vcpu); @@ -1067,7 +1067,7 @@ nmiblocked: */ vmx_set_nmi_window_exiting(vmx, vcpu); - VMM_CTR0(vmx->vm, vcpu, "Enabling NMI window exiting"); + VCPU_CTR0(vmx->vm, vcpu, "Enabling NMI window exiting"); return (1); } @@ -1133,7 +1133,7 @@ vmx_inject_interrupts(struct vmx *vmx, i /* Update the Local APIC ISR */ lapic_intr_accepted(vmx->vm, vcpu, vector); - VMM_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); + VCPU_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); return; @@ -1144,7 +1144,7 @@ cantinject: */ vmx_set_int_window_exiting(vmx, vcpu); - VMM_CTR0(vmx->vm, vcpu, "Enabling interrupt window exiting"); + VCPU_CTR0(vmx->vm, vcpu, "Enabling interrupt window exiting"); } static int @@ -1434,7 +1434,7 @@ vmx_exit_process(struct vmx *vmx, int vc case EXIT_REASON_INTR_WINDOW: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INTR_WINDOW, 1); vmx_clear_int_window_exiting(vmx, vcpu); - VMM_CTR0(vmx->vm, vcpu, "Disabling interrupt window exiting"); + VCPU_CTR0(vmx->vm, vcpu, "Disabling interrupt window exiting"); return (1); case EXIT_REASON_EXT_INTR: /* @@ -1457,7 +1457,7 @@ vmx_exit_process(struct vmx *vmx, int vc /* Exit to allow the pending virtual NMI to be injected */ vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NMI_WINDOW, 1); vmx_clear_nmi_window_exiting(vmx, vcpu); - VMM_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting"); + VCPU_CTR0(vmx->vm, vcpu, "Disabling NMI window exiting"); return (1); case EXIT_REASON_INOUT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INOUT, 1); @@ -1658,7 +1658,7 @@ vmx_run(void *arg, int vcpu, register_t if (!handled) vmm_stat_incr(vmx->vm, vcpu, VMEXIT_USERSPACE, 1); - VMM_CTR1(vmx->vm, vcpu, "goto userland: exitcode %d",vmexit->exitcode); + VCPU_CTR1(vmx->vm, vcpu, "goto userland: exitcode %d",vmexit->exitcode); /* * XXX Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Thu Oct 31 05:13:53 2013 (r257421) +++ head/sys/amd64/vmm/io/vlapic.c Thu Oct 31 05:20:11 2013 (r257422) @@ -48,10 +48,10 @@ __FBSDID("$FreeBSD$"); #include "vlapic.h" #define VLAPIC_CTR0(vlapic, format) \ - VMM_CTR0((vlapic)->vm, (vlapic)->vcpuid, format) + VCPU_CTR0((vlapic)->vm, (vlapic)->vcpuid, format) #define VLAPIC_CTR1(vlapic, format, p1) \ - VMM_CTR1((vlapic)->vm, (vlapic)->vcpuid, format, p1) + VCPU_CTR1((vlapic)->vm, (vlapic)->vcpuid, format, p1) #define VLAPIC_CTR_IRR(vlapic, msg) \ do { \ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu Oct 31 05:13:53 2013 (r257421) +++ head/sys/amd64/vmm/vmm.c Thu Oct 31 05:20:11 2013 (r257422) @@ -918,8 +918,8 @@ vm_handle_paging(struct vm *vm, int vcpu map = &vm->vmspace->vm_map; rv = vm_fault(map, vme->u.paging.gpa, ftype, VM_FAULT_NORMAL); - VMM_CTR3(vm, vcpuid, "vm_handle_paging rv = %d, gpa = %#lx, ftype = %d", - rv, vme->u.paging.gpa, ftype); + VCPU_CTR3(vm, vcpuid, "vm_handle_paging rv = %d, gpa = %#lx, " + "ftype = %d", rv, vme->u.paging.gpa, ftype); if (rv != KERN_SUCCESS) return (EFAULT); Modified: head/sys/amd64/vmm/vmm_ktr.h ============================================================================== --- head/sys/amd64/vmm/vmm_ktr.h Thu Oct 31 05:13:53 2013 (r257421) +++ head/sys/amd64/vmm/vmm_ktr.h Thu Oct 31 05:20:11 2013 (r257422) @@ -34,18 +34,30 @@ #define KTR_VMM KTR_GEN -#define VMM_CTR0(vm, vcpuid, format) \ +#define VCPU_CTR0(vm, vcpuid, format) \ CTR3(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu) -#define VMM_CTR1(vm, vcpuid, format, p1) \ +#define VCPU_CTR1(vm, vcpuid, format, p1) \ CTR4(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu, \ (p1)) -#define VMM_CTR2(vm, vcpuid, format, p1, p2) \ +#define VCPU_CTR2(vm, vcpuid, format, p1, p2) \ CTR5(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu, \ (p1), (p2)) -#define VMM_CTR3(vm, vcpuid, format, p1, p2, p3) \ +#define VCPU_CTR3(vm, vcpuid, format, p1, p2, p3) \ CTR6(KTR_VMM, "vm %s-%d(%d): " format, vm_name((vm)), (vcpuid), curcpu, \ (p1), (p2), (p3)) + +#define VM_CTR0(vm, format) \ +CTR2(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu) + +#define VM_CTR1(vm, format, p1) \ +CTR3(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu, (p1)) + +#define VM_CTR2(vm, format, p1, p2) \ +CTR4(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu, (p1), (p2)) + +#define VM_CTR3(vm, format, p1, p2, p3) \ +CTR5(KTR_VMM, "vm %s(%d): " format, vm_name((vm)), curcpu, (p1), (p2), (p3)) #endif From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 05:44:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 44F77BEB; Thu, 31 Oct 2013 05:44:47 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2258320D6; Thu, 31 Oct 2013 05:44:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V5il0q038744; Thu, 31 Oct 2013 05:44:47 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V5ijeP038738; Thu, 31 Oct 2013 05:44:45 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201310310544.r9V5ijeP038738@svn.freebsd.org> From: Neel Natu Date: Thu, 31 Oct 2013 05:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257423 - in head: share/examples/bhyve usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 05:44:47 -0000 Author: neel Date: Thu Oct 31 05:44:45 2013 New Revision: 257423 URL: http://svnweb.freebsd.org/changeset/base/257423 Log: Make the virtual ioapic available unconditionally in a bhyve virtual machine. This is in preparation for moving the ioapic device model from userspace to vmm.ko. Reviewed by: grehan Modified: head/share/examples/bhyve/vmrun.sh head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/acpi.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/mptbl.c head/usr.sbin/bhyve/mptbl.h Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Thu Oct 31 05:20:11 2013 (r257422) +++ head/share/examples/bhyve/vmrun.sh Thu Oct 31 05:44:45 2013 (r257423) @@ -173,7 +173,7 @@ while [ 1 ]; do break fi - ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P \ + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P \ -g ${gdbport} \ -s 0:0,hostbridge \ -s 1:0,lpc \ Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Thu Oct 31 05:20:11 2013 (r257422) +++ head/usr.sbin/bhyve/acpi.c Thu Oct 31 05:44:45 2013 (r257423) @@ -806,7 +806,7 @@ static struct { }; int -acpi_build(struct vmctx *ctx, int ncpu, int ioapic) +acpi_build(struct vmctx *ctx, int ncpu) { int err; int i; @@ -814,11 +814,6 @@ acpi_build(struct vmctx *ctx, int ncpu, err = 0; basl_ncpu = ncpu; - if (!ioapic) { - fprintf(stderr, "ACPI tables require an ioapic\n"); - return (EINVAL); - } - /* * For debug, allow the user to have iasl compiler output sent * to stdout rather than /dev/null Modified: head/usr.sbin/bhyve/acpi.h ============================================================================== --- head/usr.sbin/bhyve/acpi.h Thu Oct 31 05:20:11 2013 (r257422) +++ head/usr.sbin/bhyve/acpi.h Thu Oct 31 05:44:45 2013 (r257423) @@ -29,6 +29,6 @@ #ifndef _ACPI_H_ #define _ACPI_H_ -int acpi_build(struct vmctx *ctx, int ncpu, int ioapic); +int acpi_build(struct vmctx *ctx, int ncpu); #endif /* _ACPI_H_ */ Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Oct 31 05:20:11 2013 (r257422) +++ head/usr.sbin/bhyve/bhyverun.c Thu Oct 31 05:44:45 2013 (r257423) @@ -132,7 +132,6 @@ usage(int code) " -c: # cpus (default 1)\n" " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" " -H: vmexit from the guest on hlt\n" - " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" " -W: force virtio to use single-vector MSI\n" " -e: exit on unhandled I/O access\n" @@ -543,7 +542,7 @@ fbsdrun_set_capabilities(struct vmctx *c int main(int argc, char *argv[]) { - int c, error, gdb_port, err, ioapic, bvmcons; + int c, error, gdb_port, err, bvmcons; int max_vcpus; struct vmctx *ctx; uint64_t rip; @@ -553,7 +552,6 @@ main(int argc, char *argv[]) progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; - ioapic = 0; memsize = 256 * MB; while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { @@ -601,7 +599,13 @@ main(int argc, char *argv[]) guest_vmexit_on_hlt = 1; break; case 'I': - ioapic = 1; + /* + * The "-I" option was used to add an ioapic to the + * virtual machine. + * + * An ioapic is now provided unconditionally for each + * virtual machine and this option is now deprecated. + */ break; case 'P': guest_vmexit_on_pause = 1; @@ -659,8 +663,7 @@ main(int argc, char *argv[]) if (init_pci(ctx) != 0) exit(1); - if (ioapic) - ioapic_init(0); + ioapic_init(0); if (gdb_port != 0) init_dbgport(gdb_port); @@ -674,10 +677,10 @@ main(int argc, char *argv[]) /* * build the guest tables, MP etc. */ - mptable_build(ctx, guest_ncpus, ioapic); + mptable_build(ctx, guest_ncpus); if (acpi) { - error = acpi_build(ctx, guest_ncpus, ioapic); + error = acpi_build(ctx, guest_ncpus); assert(error == 0); } Modified: head/usr.sbin/bhyve/mptbl.c ============================================================================== --- head/usr.sbin/bhyve/mptbl.c Thu Oct 31 05:20:11 2013 (r257422) +++ head/usr.sbin/bhyve/mptbl.c Thu Oct 31 05:44:45 2013 (r257423) @@ -242,7 +242,7 @@ mptable_add_oemtbl(void *tbl, int tblsz) } int -mptable_build(struct vmctx *ctx, int ncpu, int ioapic) +mptable_build(struct vmctx *ctx, int ncpu) { mpcth_t mpch; bus_entry_ptr mpeb; @@ -278,12 +278,10 @@ mptable_build(struct vmctx *ctx, int ncp curraddr += sizeof(*mpeb) * MPE_NUM_BUSES; mpch->entry_count += MPE_NUM_BUSES; - if (ioapic) { - mpei = (io_apic_entry_ptr)curraddr; - mpt_build_ioapic_entries(mpei, ncpu + 1); - curraddr += sizeof(*mpei); - mpch->entry_count++; - } + mpei = (io_apic_entry_ptr)curraddr; + mpt_build_ioapic_entries(mpei, ncpu + 1); + curraddr += sizeof(*mpei); + mpch->entry_count++; mpie = (int_entry_ptr) curraddr; mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, ncpu + 1); Modified: head/usr.sbin/bhyve/mptbl.h ============================================================================== --- head/usr.sbin/bhyve/mptbl.h Thu Oct 31 05:20:11 2013 (r257422) +++ head/usr.sbin/bhyve/mptbl.h Thu Oct 31 05:44:45 2013 (r257423) @@ -29,7 +29,7 @@ #ifndef _MPTBL_H_ #define _MPTBL_H_ -int mptable_build(struct vmctx *ctx, int ncpu, int ioapic); +int mptable_build(struct vmctx *ctx, int ncpu); void mptable_add_oemtbl(void *tbl, int tblsz); #endif /* _MPTBL_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 08:22:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0BD5A53B; Thu, 31 Oct 2013 08:22:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED62228AD; Thu, 31 Oct 2013 08:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V8MTMv095175; Thu, 31 Oct 2013 08:22:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V8MT0h095174; Thu, 31 Oct 2013 08:22:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310310822.r9V8MT0h095174@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 08:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257426 - head/usr.bin/limits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 08:22:30 -0000 Author: kib Date: Thu Oct 31 08:22:29 2013 New Revision: 257426 URL: http://svnweb.freebsd.org/changeset/base/257426 Log: The limit for the swap space is spelled 'swapsize', at least since tcsh 6.17.00 import. Submitted by: Stefan Neudorf PR: bin/183480 MFC after: 1 week Modified: head/usr.bin/limits/limits.c Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Thu Oct 31 06:36:41 2013 (r257425) +++ head/usr.bin/limits/limits.c Thu Oct 31 08:22:29 2013 (r257426) @@ -125,7 +125,7 @@ static struct { { "limit%s sbsize %s", ";\n", 1 }, { "limit%s vmemoryuse %s", ";\n", 1024 }, { "limit%s pseudoterminals %s", ";\n", 1 }, - { "limit%s swapuse %s", ";\n", 1024 }, + { "limit%s swapsize %s", ";\n", 1024 }, { "limit%s kqueues %s", ";\n", 1 }, } }, @@ -160,7 +160,7 @@ static struct { { "limit%s sbsize %s", ";\n", 1 }, { "limit%s vmemoryuse %s", ";\n", 1024 }, { "limit%s pseudoterminals %s", ";\n", 1 }, - { "limit%s swapuse %s", ";\n", 1024 }, + { "limit%s swapsize %s", ";\n", 1024 }, { "limit%s kqueues %s", ";\n", 1 }, } }, From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 08:58:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9C669207; Thu, 31 Oct 2013 08:58:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88E9E2AF6; Thu, 31 Oct 2013 08:58:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V8wW7K005671; Thu, 31 Oct 2013 08:58:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V8wWnV005670; Thu, 31 Oct 2013 08:58:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310310858.r9V8wWnV005670@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 08:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257427 - head/usr.bin/limits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 08:58:32 -0000 Author: kib Date: Thu Oct 31 08:58:32 2013 New Revision: 257427 URL: http://svnweb.freebsd.org/changeset/base/257427 Log: The limit for the swap space is spelled 'swapsize', at least since tcsh 6.17.00 import. Submitted by: Stefan Neudorf PR: bin/183480 MFC after: 1 week Modified: head/usr.bin/limits/limits.c Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Thu Oct 31 08:22:29 2013 (r257426) +++ head/usr.bin/limits/limits.c Thu Oct 31 08:58:32 2013 (r257427) @@ -248,7 +248,7 @@ static struct { * to be modified accordingly! */ -#define RCS_STRING "tfdscmlunbvpw" +#define RCS_STRING "tfdscmlunbvpwk" static rlim_t resource_num(int which, int ch, const char *str); static void usage(void); @@ -287,7 +287,7 @@ main(int argc, char *argv[]) pid = -1; optarg = NULL; - while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { + while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:")) != -1) { switch(ch) { case 'a': doall = 1; @@ -544,7 +544,7 @@ usage(void) { (void)fprintf(stderr, "usage: limits [-C class|-P pid|-U user] [-eaSHBE] " - "[-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); + "[-bcdflmnstuvpwk [val]] [[name=val ...] cmd]\n"); exit(EXIT_FAILURE); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 09:03:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6C5C7428; Thu, 31 Oct 2013 09:03:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59A0B2B6C; Thu, 31 Oct 2013 09:03:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V93hGl008614; Thu, 31 Oct 2013 09:03:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V93hgm008613; Thu, 31 Oct 2013 09:03:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310310903.r9V93hgm008613@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 09:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257428 - head/usr.bin/limits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 09:03:43 -0000 Author: kib Date: Thu Oct 31 09:03:42 2013 New Revision: 257428 URL: http://svnweb.freebsd.org/changeset/base/257428 Log: Fix long line and record proper commit message for r257427: Add the '-k' option for getopt() call and usage. Submitted by: Stefan Neudorf PR: bin/183494 MFC after: 1 week Modified: head/usr.bin/limits/limits.c Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Thu Oct 31 08:58:32 2013 (r257427) +++ head/usr.bin/limits/limits.c Thu Oct 31 09:03:42 2013 (r257428) @@ -287,7 +287,8 @@ main(int argc, char *argv[]) pid = -1; optarg = NULL; - while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:")) != -1) { + while ((ch = getopt(argc, argv, + ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:")) != -1) { switch(ch) { case 'a': doall = 1; From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 09:20:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0BF749EF; Thu, 31 Oct 2013 09:20:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF6242C49; Thu, 31 Oct 2013 09:20:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V9KUu0013164; Thu, 31 Oct 2013 09:20:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V9KU3i013163; Thu, 31 Oct 2013 09:20:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310310920.r9V9KU3i013163@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 31 Oct 2013 09:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257429 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 09:20:31 -0000 Author: hselasky Date: Thu Oct 31 09:20:30 2013 New Revision: 257429 URL: http://svnweb.freebsd.org/changeset/base/257429 Log: Fix some types. Compilation for external target complains that "u_int" is not idential to "uint32_t" when defining set channel prototype functions. The WLAN channel range should be from 0 to 65535 inclusivly, and u_int should be fine for this purpose. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Oct 31 09:03:42 2013 (r257428) +++ head/sys/dev/usb/wlan/if_run.c Thu Oct 31 09:20:30 2013 (r257429) @@ -320,7 +320,7 @@ static usb_callback_t run_bulk_tx_callba static usb_callback_t run_bulk_tx_callback5; static void run_bulk_tx_callbackN(struct usb_xfer *xfer, - usb_error_t error, unsigned int index); + usb_error_t error, u_int index); static struct ieee80211vap *run_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -426,7 +426,7 @@ static int run_txrx_enable(struct run_so static void run_init(void *); static void run_init_locked(struct run_softc *); static void run_stop(void *); -static void run_delay(struct run_softc *, unsigned int); +static void run_delay(struct run_softc *, u_int); static const struct { uint16_t reg; @@ -2724,7 +2724,7 @@ run_tx_free(struct run_endpoint_queue *p } static void -run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, unsigned int index) +run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, u_int index) { struct run_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = sc->sc_ifp; @@ -3576,7 +3576,7 @@ run_select_chan_group(struct run_softc * } static void -run_rt2870_set_chan(struct run_softc *sc, uint32_t chan) +run_rt2870_set_chan(struct run_softc *sc, u_int chan) { const struct rfprog *rfprog = rt2860_rf2850; uint32_t r2, r3, r4; @@ -3631,7 +3631,7 @@ run_rt2870_set_chan(struct run_softc *sc } static void -run_rt3070_set_chan(struct run_softc *sc, uint32_t chan) +run_rt3070_set_chan(struct run_softc *sc, u_int chan) { int8_t txpow1, txpow2; uint8_t rf; @@ -3868,7 +3868,7 @@ static int run_set_chan(struct run_softc *sc, struct ieee80211_channel *c) { struct ieee80211com *ic = sc->sc_ifp->if_l2com; - uint32_t chan, group; + u_int chan, group; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) @@ -4310,7 +4310,7 @@ run_rssi2dbm(struct run_softc *sc, uint8 int delta; if (IEEE80211_IS_CHAN_5GHZ(c)) { - uint32_t chan = ieee80211_chan2ieee(ic, c); + u_int chan = ieee80211_chan2ieee(ic, c); delta = sc->rssi_5ghz[rxchain]; /* determine channel group */ @@ -4974,7 +4974,7 @@ run_stop(void *arg) } static void -run_delay(struct run_softc *sc, unsigned int ms) +run_delay(struct run_softc *sc, u_int ms) { usb_pause_mtx(mtx_owned(&sc->sc_mtx) ? &sc->sc_mtx : NULL, USB_MS_TO_TICKS(ms)); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 09:29:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8EF8BE33; Thu, 31 Oct 2013 09:29:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 637D02CFF; Thu, 31 Oct 2013 09:29:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V9TcTk016174; Thu, 31 Oct 2013 09:29:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V9TcGS016173; Thu, 31 Oct 2013 09:29:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310310929.r9V9TcGS016173@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 09:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257430 - head/usr.bin/limits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 09:29:38 -0000 Author: kib Date: Thu Oct 31 09:29:37 2013 New Revision: 257430 URL: http://svnweb.freebsd.org/changeset/base/257430 Log: Remove the dependency on procfs. Use sysctl KERN_PROC_PATHNAME and KERN_PROC_PID to obtain the parent process pathname and command, used to determine the calling shell. Submitted by: Stefan Neudorf PR: bin/183484 MFC after: 1 week Modified: head/usr.bin/limits/limits.c Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Thu Oct 31 09:20:30 2013 (r257429) +++ head/usr.bin/limits/limits.c Thu Oct 31 09:29:37 2013 (r257430) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -705,27 +706,32 @@ getshelltype(void) pid_t ppid = getppid(); if (ppid != 1) { - FILE * fp; + struct kinfo_proc kp; struct stat st; - char procdir[MAXPATHLEN], buf[128]; - int l = sprintf(procdir, "/proc/%ld/", (long)ppid); + char path[MAXPATHLEN]; char * shell = getenv("SHELL"); + int mib[4]; + size_t len; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[3] = ppid; if (shell != NULL && stat(shell, &st) != -1) { struct stat st1; - strcpy(procdir+l, "file"); - /* $SHELL is actual shell? */ - if (stat(procdir, &st1) != -1 && memcmp(&st, &st1, sizeof st) == 0) - return getshellbyname(shell); - } - strcpy(procdir+l, "status"); - if (stat(procdir, &st) == 0 && (fp = fopen(procdir, "r")) != NULL) { - char * p = fgets(buf, sizeof buf, fp)==NULL ? NULL : strtok(buf, " \t"); - fclose(fp); - if (p != NULL) - return getshellbyname(p); + mib[2] = KERN_PROC_PATHNAME; + len = sizeof(path); + if (sysctl(mib, 4, path, &len, NULL, 0) != -1) { + /* $SHELL is actual shell? */ + if (stat(path, &st1) != -1 && memcmp(&st, &st1, sizeof st) == 0) + return getshellbyname(shell); + } } + mib[2] = KERN_PROC_PID; + len = sizeof(kp); + if (sysctl(mib, 4, &kp, &len, NULL, 0) != -1) + return getshellbyname(kp.ki_comm); } return SH_SH; } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 09:41:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67129179; Thu, 31 Oct 2013 09:41:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB8692DB2; Thu, 31 Oct 2013 09:41:06 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r9V9ewHm058979; Thu, 31 Oct 2013 11:40:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r9V9ewHm058979 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r9V9ewo1058974; Thu, 31 Oct 2013 11:40:58 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 31 Oct 2013 11:40:58 +0200 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat Message-ID: <20131031094058.GH59496@kib.kiev.ua> References: <201310211646.r9LGkDl5012906@svn.freebsd.org> <20131030.86fvriud2y@bitmessage.ch> <20131030212052.GA3516@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1vEdgMWljt97yA53" Content-Disposition: inline In-Reply-To: <20131030212052.GA3516@stack.nl> User-Agent: Mutt/1.5.22 (2013-10-16) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Stefan Neudorf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 09:41:07 -0000 --1vEdgMWljt97yA53 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 30, 2013 at 10:20:52PM +0100, Jilles Tjoelker wrote: > On Wed, Oct 30, 2013 at 02:01:57PM +0100, Stefan Neudorf wrote: > > Konstantin Belousov writes: >=20 > > > Author: kib > > > Date: Mon Oct 21 16:46:12 2013 > > > New Revision: 256850 > > > URL: http://svnweb.freebsd.org/changeset/base/256850 >=20 > > > Log: > > > Add a resource limit for the total number of kqueues available to t= he > > > user. Kqueue now saves the ucred of the allocating thread, to > > > correctly decrement the counter on close. >=20 > > > Under some specific and not real-world use scenario for kqueue, it = is > > > possible for the kqueues to consume memory proportional to the squa= re > > > of the number of the filedescriptors available to the process. Lim= it > > > allows administrator to prevent the abuse. >=20 > > > This is kernel-mode side of the change, with the user-mode enabling > > > commit following. >=20 > > > Reported and tested by: pho > > > Discussed with: jmg > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 2 weeks >=20 > > > Modified: > > > head/bin/sh/miscbltin.c > > > head/etc/login.conf > > > head/lib/libc/sys/getrlimit.2 > > > head/lib/libutil/login_class.3 > > > head/lib/libutil/login_class.c > > > head/usr.bin/limits/limits.c > > > head/usr.bin/procstat/procstat_rlimit.c >=20 > > kqueues limit isn't documented in sh(1) and limits(1) manpages. >=20 > I can do this in the next few days. Thank you, appreciated. >=20 > > > Modified: head/bin/sh/miscbltin.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/bin/sh/miscbltin.c Mon Oct 21 16:44:53 2013 (r256849) > > > +++ head/bin/sh/miscbltin.c Mon Oct 21 16:46:12 2013 (r256850) > > > @@ -405,6 +405,9 @@ static const struct limits limits[] =3D { > > > #ifdef RLIMIT_NPTS > > > { "pseudo-terminals", (char *)0, RLIMIT_NPTS, 1, 'p' }, > > > #endif > > > +#ifdef RLIMIT_KQUEUES > > > + { "kqueues", (char *)0, RLIMIT_KQUEUES, 1, 'k' }, > > > +#endif > > > { (char *) 0, (char *)0, 0, 0, '\0' } > > > }; > > > =20 >=20 > > I've submitted a patch to add ulimit -k (kqueue) to zsh but the reviewer > > asked me to rename -k to -K to avoid conflict with ulimit -k (posixlock= s) > > from DragonFly. Do you anticipate FreeBSD never adds RLIMIT_POSIXLOCKS > > support or would use incompatible option switch? >=20 > > http://www.zsh.org/mla/workers/2013/msg00984.html > > http://gitweb.dragonflybsd.org/dragonfly.git?a=3Dsearch&h=3DHEAD&st=3Dc= ommit&s=3Dposixlocks >=20 > I think dragonfly has invented its own name here. The usual name for > RLIMIT_POSIXLOCKS (Linux and Solaris) is RLIMIT_LOCKS and ulimit has it > under -x (bash) or -L (ksh93). It seems more appropriate for FreeBSD to > follow one of those. (On the other hand, dash ulimit has it on -w.) The RLIMIT_LOCKS is for the fcntl(2) locks, right ? It is very strange for me, and almost misleading, to have the limit called RLIMIT_POSIXLOCKS. RLIMIT_LOCKS is not much telling as well, RLIMIT_FLOCK would be better IMHO. I agree that we better follow Linux there. >=20 > Generally, the namespace for ulimit letters is very small so > inconsistencies between shells and implementations are to be expected. > Also, various shell implementations appear to have stopped caring to add > new rlimits to their ulimit builtin. >=20 > zsh's -N option avoids the need to modify the shell > for new rlimits, but is probably too cryptic to use other than via > limits -e. >=20 > > > Modified: head/usr.bin/limits/limits.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013 (r256849) > > > +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013 (r256850) >=20 > > This adds limits -e support only for sh, csh, tcsh. What about other > > shells that already support sbsize and swapuse extensions? >=20 > This can be done later; the kqueue rlimit need not be gated on it. I definitely do not want to go over the {pd,}ksh, zsh, bash, rc and whatever else. Somebody who cares should contact the projects and propose the changes. --1vEdgMWljt97yA53 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSciWpAAoJEJDCuSvBvK1BFLUP/2+fBHUUfwTWAsa5KJ73NYlO fUgbUrCGUi5fNr5l85Jsye7sHxyXHV2MjDK8H2gu17msbig97QeT741B2VtISk3P Q7YkbVI4Pg0hVBbZGbSVnzqFDl8GIhJkuYD9ZdahDawtEteuobFEC5/VqkO9kKxR zPdVamZtD7FmOS2z6x5zYt6FxwRCOCGupXqeKhdCC+MgIgL/IggoqM7sLGyVdPwJ aI1UWZLYlMqWDGkbPKDT/O0jlqZfJ2U04ragOo+vFwy3GnXpAZFI0/qymAIBjkPk yukaVlmiQ6zO7h+kElrWBqV1Z5lgUnbrr9HrYQt5sXT5vDa39bT8W2aBQY76AWPt tedU8vUCwho9PJajDsgTKyK9mnbH/L271fsV/BLplCUK6ikAmBF5qG5hucfMQtwX FKPY+4+nHmX/rasKYzeD40tqlkbpaVPYS8R5ve1Od26TDQn4OoUaQrqMJM4KYcA7 LUfBvNl82i/P9zLfbF8kcEfX79MGqe+9TKyOJgkvU+KT4tP7Xh/00w/zO5f1i7yi QxH7axTVRh63LZulHbz+lSJHHrbcim3tMPh0dNBhDKkD7fBT8hhYcv7HVmxt0/tj 0sGIrtzusiiVR4IOmYPYahvn1z5Hn+JM8tJHUv6izBgX7JXF+uI6/2P3kUr9NoBv uG3aiX4OucZWBAGuf9FQ =gu9Y -----END PGP SIGNATURE----- --1vEdgMWljt97yA53-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 10:12:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 855EFB36; Thu, 31 Oct 2013 10:12:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 726432F62; Thu, 31 Oct 2013 10:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VACQEF031965; Thu, 31 Oct 2013 10:12:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VACQe8031964; Thu, 31 Oct 2013 10:12:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310311012.r9VACQe8031964@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 10:12:26 +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: r257432 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 10:12:26 -0000 Author: kib Date: Thu Oct 31 10:12:25 2013 New Revision: 257432 URL: http://svnweb.freebsd.org/changeset/base/257432 Log: MFC r257221: Fix typo. Approved by: re (glebius) Modified: stable/10/sys/kern/subr_param.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/kern/subr_param.c ============================================================================== --- stable/10/sys/kern/subr_param.c Thu Oct 31 09:44:48 2013 (r257431) +++ stable/10/sys/kern/subr_param.c Thu Oct 31 10:12:25 2013 (r257432) @@ -344,7 +344,7 @@ init_param2(long physpages) } /* - * Sysctl stringiying handler for kern.vm_guest. + * Sysctl stringifying handler for kern.vm_guest. */ static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 10:14:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34512CA4; Thu, 31 Oct 2013 10:14:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21E532F77; Thu, 31 Oct 2013 10:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VAECxo032289; Thu, 31 Oct 2013 10:14:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VAECgE032288; Thu, 31 Oct 2013 10:14:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310311014.r9VAECgE032288@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 10:14:12 +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: r257433 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 10:14:13 -0000 Author: kib Date: Thu Oct 31 10:14:12 2013 New Revision: 257433 URL: http://svnweb.freebsd.org/changeset/base/257433 Log: MFC r257221: Fix typo. Modified: stable/9/sys/kern/subr_param.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_param.c ============================================================================== --- stable/9/sys/kern/subr_param.c Thu Oct 31 10:12:25 2013 (r257432) +++ stable/9/sys/kern/subr_param.c Thu Oct 31 10:14:12 2013 (r257433) @@ -352,7 +352,7 @@ init_param2(long physpages) } /* - * Sysctl stringiying handler for kern.vm_guest. + * Sysctl stringifying handler for kern.vm_guest. */ static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 10:15:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 352B0DF3; Thu, 31 Oct 2013 10:15:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 227442F84; Thu, 31 Oct 2013 10:15:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VAFN3Y032609; Thu, 31 Oct 2013 10:15:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VAFMOh032608; Thu, 31 Oct 2013 10:15:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310311015.r9VAFMOh032608@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 31 Oct 2013 10:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257434 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 10:15:23 -0000 Author: kib Date: Thu Oct 31 10:15:22 2013 New Revision: 257434 URL: http://svnweb.freebsd.org/changeset/base/257434 Log: MFC r257221: Fix typo. Modified: stable/8/sys/kern/subr_param.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Thu Oct 31 10:14:12 2013 (r257433) +++ stable/8/sys/kern/subr_param.c Thu Oct 31 10:15:22 2013 (r257434) @@ -315,7 +315,7 @@ init_param3(long kmempages) } /* - * Sysctl stringiying handler for kern.vm_guest. + * Sysctl stringifying handler for kern.vm_guest. */ static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 11:03:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9DC30BD0; Thu, 31 Oct 2013 11:03:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89AB922FF; Thu, 31 Oct 2013 11:03:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VB3bdu048890; Thu, 31 Oct 2013 11:03:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VB3beU048889; Thu, 31 Oct 2013 11:03:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310311103.r9VB3beU048889@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 31 Oct 2013 11:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257435 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 11:03:37 -0000 Author: hselasky Date: Thu Oct 31 11:03:36 2013 New Revision: 257435 URL: http://svnweb.freebsd.org/changeset/base/257435 Log: Fix a potential memory leak. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Oct 31 10:15:22 2013 (r257434) +++ head/sys/dev/usb/wlan/if_run.c Thu Oct 31 11:03:36 2013 (r257435) @@ -2676,6 +2676,7 @@ tr_setup: m->m_data += 4; m->m_pkthdr.len = m->m_len -= 4; run_rx_frame(sc, m, dmalen); + m = NULL; /* don't free source buffer */ break; } @@ -2697,6 +2698,9 @@ tr_setup: m->m_pkthdr.len = m->m_len -= dmalen + 8; } + /* make sure we free the source buffer, if any */ + m_freem(m); + RUN_LOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 11:38:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2962AD25; Thu, 31 Oct 2013 11:38:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F12DC253F; Thu, 31 Oct 2013 11:38:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VBcP9L060316; Thu, 31 Oct 2013 11:38:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VBcP8v060314; Thu, 31 Oct 2013 11:38:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201310311138.r9VBcP8v060314@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 31 Oct 2013 11:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257436 - head/tools/regression/pjdfstest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 11:38:26 -0000 Author: pjd Date: Thu Oct 31 11:38:25 2013 New Revision: 257436 URL: http://svnweb.freebsd.org/changeset/base/257436 Log: Make lpathconf(2) support optional to make it compile again on Linux. Submitted by: Hashem Nasarat @riseup.net Modified: head/tools/regression/pjdfstest/Makefile head/tools/regression/pjdfstest/pjdfstest.c Modified: head/tools/regression/pjdfstest/Makefile ============================================================================== --- head/tools/regression/pjdfstest/Makefile Thu Oct 31 11:03:36 2013 (r257435) +++ head/tools/regression/pjdfstest/Makefile Thu Oct 31 11:38:25 2013 (r257436) @@ -6,7 +6,7 @@ ${PROG}: ${PROG}.c @OSTYPE=`uname`; \ CFLAGS=-D__OS_$${OSTYPE}__; \ if [ $$OSTYPE = "FreeBSD" ]; then \ - CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS -DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT -DHAS_CONNECTAT"; \ + CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS -DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT -DHAS_CONNECTAT -DHAS_LPATHCONF"; \ elif [ $$OSTYPE = "SunOS" ]; then \ CFLAGS="$$CFLAGS -DHAS_TRUNCATE64 -DHAS_STAT64"; \ CFLAGS="$$CFLAGS -lsocket"; \ Modified: head/tools/regression/pjdfstest/pjdfstest.c ============================================================================== --- head/tools/regression/pjdfstest/pjdfstest.c Thu Oct 31 11:03:36 2013 (r257435) +++ head/tools/regression/pjdfstest/pjdfstest.c Thu Oct 31 11:38:25 2013 (r257436) @@ -119,7 +119,9 @@ enum action { ACTION_FSTATAT, ACTION_PATHCONF, ACTION_FPATHCONF, +#ifdef HAS_LPATHCONF ACTION_LPATHCONF, +#endif #ifdef HAS_FREEBSD_ACL ACTION_PREPENDACL, ACTION_READACL, @@ -200,7 +202,9 @@ static struct syscall_desc syscalls[] = { "fstatat", ACTION_FSTATAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "pathconf", ACTION_PATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "fpathconf", ACTION_FPATHCONF, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, +#ifdef HAS_LPATHCONF { "lpathconf", ACTION_LPATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, +#endif #ifdef HAS_FREEBSD_ACL { "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } }, @@ -899,7 +903,9 @@ call_syscall(struct syscall_desc *scall, break; case ACTION_PATHCONF: case ACTION_FPATHCONF: +#ifdef HAS_LPATHCONF case ACTION_LPATHCONF: +#endif { long lrval; @@ -916,9 +922,11 @@ call_syscall(struct syscall_desc *scall, case ACTION_FPATHCONF: lrval = fpathconf(NUM(0), name); break; +#ifdef HAS_LPATHCONF case ACTION_LPATHCONF: lrval = lpathconf(STR(0), name); break; +#endif default: abort(); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 12:05:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F047BC1D; Thu, 31 Oct 2013 12:05:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE3F22721; Thu, 31 Oct 2013 12:05:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VC5bYp070402; Thu, 31 Oct 2013 12:05:37 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VC5b20070401; Thu, 31 Oct 2013 12:05:37 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310311205.r9VC5b20070401@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 31 Oct 2013 12:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257440 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 12:05:38 -0000 Author: bapt Date: Thu Oct 31 12:05:37 2013 New Revision: 257440 URL: http://svnweb.freebsd.org/changeset/base/257440 Log: Adjust the manpage category for the pkg bootstrap Modified: head/tools/build/options/WITHOUT_PKGBOOTSTRAP Modified: head/tools/build/options/WITHOUT_PKGBOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_PKGBOOTSTRAP Thu Oct 31 11:59:04 2013 (r257439) +++ head/tools/build/options/WITHOUT_PKGBOOTSTRAP Thu Oct 31 12:05:37 2013 (r257440) @@ -1,4 +1,4 @@ .\" $FreeBSD$ Set to not build -.Xr pkg 1 +.Xr pkg 7 bootstrap tool From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 13:00:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ED8491A1; Thu, 31 Oct 2013 13:00:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9A912A91; Thu, 31 Oct 2013 13:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VD0ajr088924; Thu, 31 Oct 2013 13:00:36 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VD0ZLg088914; Thu, 31 Oct 2013 13:00:35 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201310311300.r9VD0ZLg088914@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 31 Oct 2013 13:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257444 - in head: . etc/periodic/daily etc/periodic/security etc/periodic/weekly share/man/man5 tools/build/mk tools/build/options usr.sbin usr.sbin/pkg_install X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 13:00:37 -0000 Author: bapt Date: Thu Oct 31 13:00:35 2013 New Revision: 257444 URL: http://svnweb.freebsd.org/changeset/base/257444 Log: After around 20 years of duty it is time for pkg_install to retire Deleted: head/etc/periodic/daily/220.backup-pkgdb head/etc/periodic/daily/490.status-pkg-changes head/etc/periodic/security/460.chkportsum head/etc/periodic/weekly/400.status-pkg head/tools/build/options/WITH_PKGTOOLS head/usr.sbin/pkg_install/ Modified: head/ObsoleteFiles.inc head/etc/periodic/daily/Makefile head/etc/periodic/security/Makefile head/etc/periodic/weekly/Makefile head/share/man/man5/src.conf.5 head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Oct 31 12:59:25 2013 (r257443) +++ head/ObsoleteFiles.inc Thu Oct 31 13:00:35 2013 (r257444) @@ -38,6 +38,23 @@ # xargs -n1 | sort | uniq -d; # done +# 20131031: pkg_install has been removed +OLD_FILES+=etc/periodic/daily/220.backup-pkgdb +OLD_FILES+=etc/periodic/daily/490.status-pkg-changes +OLD_FILES+=etc/periodic/security/460.chkportsum +OLD_FILES+=etc/periodic/weekly/400.status-pkg +OLD_FILES+=usr/sbin/pkg_add +OLD_FILES+=usr/sbin/pkg_create +OLD_FILES+=usr/sbin/pkg_delete +OLD_FILES+=usr/sbin/pkg_info +OLD_FILES+=usr/sbin/pkg_updating +OLD_FILES+=usr/sbin/pkg_version +OLD_FILES+=usr/share/man/man1/pkg_add.1.gz +OLD_FILES+=usr/share/man/man1/pkg_create.1.gz +OLD_FILES+=usr/share/man/man1/pkg_delete.1.gz +OLD_FILES+=usr/share/man/man1/pkg_info.1.gz +OLD_FILES+=usr/share/man/man1/pkg_updating.1.gz +OLD_FILES+=usr/share/man/man1/pkg_version.1.gz # 20131030: /etc/keys moved to /usr/share/keys OLD_DIRS+=etc/keys OLD_DIRS+=etc/keys/pkg Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Thu Oct 31 12:59:25 2013 (r257443) +++ head/etc/periodic/daily/Makefile Thu Oct 31 13:00:35 2013 (r257444) @@ -36,11 +36,6 @@ FILES+= 130.clean-msgs FILES+= 480.status-ntpd .endif -.if ${MK_PKGTOOLS} != "no" -FILES+= 220.backup-pkgdb \ - 490.status-pkg-changes -.endif - .if ${MK_RCMDS} != "no" FILES+= 140.clean-rwho \ 430.status-rwho Modified: head/etc/periodic/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Thu Oct 31 12:59:25 2013 (r257443) +++ head/etc/periodic/security/Makefile Thu Oct 31 13:00:35 2013 (r257444) @@ -29,8 +29,4 @@ FILES+= 500.ipfwdenied \ FILES+= 520.pfdenied .endif -.if ${MK_PKGTOOLS} != "no" -FILES+= 460.chkportsum -.endif - .include Modified: head/etc/periodic/weekly/Makefile ============================================================================== --- head/etc/periodic/weekly/Makefile Thu Oct 31 12:59:25 2013 (r257443) +++ head/etc/periodic/weekly/Makefile Thu Oct 31 13:00:35 2013 (r257444) @@ -16,8 +16,4 @@ FILES+= 310.locate FILES+= 320.whatis 330.catman .endif -.if ${MK_PKGTOOLS} != "no" -FILES+= 400.status-pkg -.endif - .include Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Oct 31 12:59:25 2013 (r257443) +++ head/share/man/man5/src.conf.5 Thu Oct 31 13:00:35 2013 (r257444) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd October 25, 2013 +.Dd October 31, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -860,15 +860,10 @@ When set, it also enforces the following .Va WITHOUT_AUTHPF .El .It Va WITHOUT_PKGBOOTSTRAP -.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 238023 2012-07-02 20:26:11Z marcel +.\" $FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 257440 2013-10-31 12:05:37Z bapt Set to not build -.Xr pkg 1 +.Xr pkg 7 bootstrap tool -.It Va WITH_PKGTOOLS -.\" from FreeBSD: head/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt -Set to build -.Xr pkg_add 8 -and related programs. .It Va WITHOUT_PMC .\" from FreeBSD: head/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam Set to not build Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Oct 31 12:59:25 2013 (r257443) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Oct 31 13:00:35 2013 (r257444) @@ -3613,29 +3613,6 @@ OLD_FILES+=usr/sbin/pkg OLD_FILES+=usr/share/man/man7/pkg.7.gz .endif -.if ${MK_PKGTOOLS} == no -OLD_FILES+=etc/periodic/daily/220.backup-pkgdb -OLD_FILES+=etc/periodic/daily/490.status-pkg-changes -OLD_FILES+=etc/periodic/security/460.chkportsum -OLD_FILES+=etc/periodic/weekly/400.status-pkg -OLD_FILES+=usr/include/pkg.h -OLD_FILES+=usr/lib/libpkg.a -OLD_FILES+=usr/lib/libpkg.so -OLD_LIBS+=usr/lib/libpkg.so.0 -OLD_FILES+=usr/sbin/pkg_add -OLD_FILES+=usr/sbin/pkg_create -OLD_FILES+=usr/sbin/pkg_delete -OLD_FILES+=usr/sbin/pkg_info -OLD_FILES+=usr/sbin/pkg_updating -OLD_FILES+=usr/sbin/pkg_version -OLD_FILES+=usr/share/man/man1/pkg_add.1.gz -OLD_FILES+=usr/share/man/man1/pkg_create.1.gz -OLD_FILES+=usr/share/man/man1/pkg_delete.1.gz -OLD_FILES+=usr/share/man/man1/pkg_info.1.gz -OLD_FILES+=usr/share/man/man1/pkg_updating.1.gz -OLD_FILES+=usr/share/man/man1/pkg_version.1.gz -.endif - .if ${MK_PORTSNAP} == no OLD_FILES+=etc/portsnap.conf OLD_FILES+=usr/libexec/make_index Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Oct 31 12:59:25 2013 (r257443) +++ head/usr.sbin/Makefile Thu Oct 31 13:00:35 2013 (r257444) @@ -251,10 +251,6 @@ SUBDIR+= ftp-proxy SUBDIR+= pkg .endif -.if ${MK_PKGTOOLS} != "no" -SUBDIR+= pkg_install -.endif - # XXX MK_TOOLCHAIN? .if ${MK_PMC} != "no" SUBDIR+= pmcannotate From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 13:47:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C77A1680; Thu, 31 Oct 2013 13:47:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B45F42ECB; Thu, 31 Oct 2013 13:47:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VDle4r005669; Thu, 31 Oct 2013 13:47:40 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VDle2r005666; Thu, 31 Oct 2013 13:47:40 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311347.r9VDle2r005666@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 13:47:40 +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: r257445 - in stable/10/sys: conf dev/altera/sdcard X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 13:47:41 -0000 Author: brooks Date: Thu Oct 31 13:47:39 2013 New Revision: 257445 URL: http://svnweb.freebsd.org/changeset/base/257445 Log: MFC: r256743, r256744 MFP4: Change 227594 by brooks@brooks_zenith on 2013/04/11 17:10:14 When we fail, print the error that occurred if we are giving up or if bootverbose is set. MFP4 (driver change only): Change 231100 by brooks@brooks_zenith on 2013/07/12 21:01:31 Add a new option ALTERA_SDCARD_FAST_SIM which checks immediately for success of I/O operations rather than queuing a task. Sponsored by: DARPA/AFRL Approved by: re (glebius) Modified: stable/10/sys/conf/options stable/10/sys/dev/altera/sdcard/altera_sdcard.c stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Thu Oct 31 13:00:35 2013 (r257444) +++ stable/10/sys/conf/options Thu Oct 31 13:47:39 2013 (r257445) @@ -68,6 +68,7 @@ TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS ALQ +ALTERA_SDCARD_FAST_SIM opt_altera_sdcard.h AUDIT opt_global.h BOOTHOWTO opt_global.h BOOTVERBOSE opt_global.h Modified: stable/10/sys/dev/altera/sdcard/altera_sdcard.c ============================================================================== --- stable/10/sys/dev/altera/sdcard/altera_sdcard.c Thu Oct 31 13:00:35 2013 (r257444) +++ stable/10/sys/dev/altera/sdcard/altera_sdcard.c Thu Oct 31 13:47:39 2013 (r257445) @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_altera_sdcard.h" + #include #include #include @@ -258,6 +260,9 @@ altera_sdcard_task_io(struct altera_sdca ALTERA_SDCARD_LOCK_ASSERT(sc); KASSERT(sc->as_currentbio != NULL, ("%s: no current I/O", __func__)); +#ifdef ALTERA_SDCARD_FAST_SIM +recheck: +#endif asr = altera_sdcard_read_asr(sc); /* @@ -299,9 +304,12 @@ altera_sdcard_task_io(struct altera_sdca /* * Finally, either start the next I/O or transition to the IDLE state. */ - if (bioq_first(&sc->as_bioq) != NULL) + if (bioq_first(&sc->as_bioq) != NULL) { altera_sdcard_nextio(sc); - else +#ifdef ALTERA_SDCARD_FAST_SIM + goto recheck; +#endif + } else sc->as_state = ALTERA_SDCARD_STATE_IDLE; } @@ -398,6 +406,8 @@ altera_sdcard_start(struct altera_sdcard taskqueue_cancel_timeout(sc->as_taskqueue, &sc->as_task, NULL); altera_sdcard_nextio(sc); - taskqueue_enqueue_timeout(sc->as_taskqueue, &sc->as_task, - ALTERA_SDCARD_TIMEOUT_IO); +#ifdef ALTERA_SDCARD_FAST_SIM + altera_sdcard_task_io(sc); +#endif + altera_sdcard_task_rechedule(sc); } Modified: stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c ============================================================================== --- stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c Thu Oct 31 13:00:35 2013 (r257444) +++ stable/10/sys/dev/altera/sdcard/altera_sdcard_io.c Thu Oct 31 13:47:39 2013 (r257445) @@ -390,20 +390,23 @@ altera_sdcard_io_complete(struct altera_ break; } if (error) { + sc->as_retriesleft--; + if (sc->as_retriesleft == 0 || bootverbose) + device_printf(sc->as_dev, "%s: %s operation block %ju " + "length %ju failed; asr 0x%08x (rr1: 0x%04x)%s\n", + __func__, bp->bio_cmd == BIO_READ ? "BIO_READ" : + (bp->bio_cmd == BIO_WRITE ? "BIO_WRITE" : + "unknown"), + bp->bio_pblkno, bp->bio_bcount, asr, rr1, + sc->as_retriesleft != 0 ? " retrying" : ""); /* * This attempt experienced an error; possibly retry. */ - sc->as_retriesleft--; if (sc->as_retriesleft != 0) { sc->as_flags |= ALTERA_SDCARD_FLAG_IOERROR; altera_sdcard_io_start_internal(sc, bp); return (0); } - device_printf(sc->as_dev, "%s: %s operation block %ju length " - "%ju failed; asr 0x%08x (rr1: 0x%04x)\n", __func__, - bp->bio_cmd == BIO_READ ? "BIO_READ" : - (bp->bio_cmd == BIO_WRITE ? "BIO_WRITE" : "unknown"), - bp->bio_pblkno, bp->bio_bcount, asr, rr1); sc->as_flags &= ~ALTERA_SDCARD_FLAG_IOERROR; } else { /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 13:54:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 73DCCC51; Thu, 31 Oct 2013 13:54:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 624A52F5F; Thu, 31 Oct 2013 13:54:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VDsqsY008628; Thu, 31 Oct 2013 13:54:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VDsqwf008625; Thu, 31 Oct 2013 13:54:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310311354.r9VDsqwf008625@svn.freebsd.org> From: Adrian Chadd Date: Thu, 31 Oct 2013 13:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257446 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 13:54:52 -0000 Author: adrian Date: Thu Oct 31 13:54:51 2013 New Revision: 257446 URL: http://svnweb.freebsd.org/changeset/base/257446 Log: Allow the Arduino Leonardo to work by supporting CDC=0 devices. CDC=0 simply means "no command codes", CDC=1 means "AT command codes." There's no driver change required! It's purely to tell the application layer whether to speak AT commands or not. Things are all still serial. PR: usb/183505 Reviewed by: hps MFC after: 1 week Modified: head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Thu Oct 31 13:47:39 2013 (r257445) +++ head/sys/dev/usb/serial/umodem.c Thu Oct 31 13:54:51 2013 (r257446) @@ -128,6 +128,9 @@ static const STRUCT_USB_HOST_ID umodem_d {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), + USB_IFACE_PROTOCOL(UIPROTO_CDC_NONE)}, /* Huawei Modem class match */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Thu Oct 31 13:47:39 2013 (r257445) +++ head/sys/dev/usb/usb.h Thu Oct 31 13:54:51 2013 (r257446) @@ -441,6 +441,7 @@ typedef struct usb_interface_assoc_descr #define UISUBCLASS_ETHERNET_EMULATION_MODEL 12 #define UISUBCLASS_NETWORK_CONTROL_MODEL 13 +#define UIPROTO_CDC_NONE 0 #define UIPROTO_CDC_AT 1 #define UICLASS_HID 0x03 From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 13:54:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D1CD8C57; Thu, 31 Oct 2013 13:54:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A46A72F62; Thu, 31 Oct 2013 13:54:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VDstsb008670; Thu, 31 Oct 2013 13:54:55 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VDstuJ008669; Thu, 31 Oct 2013 13:54:55 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311354.r9VDstuJ008669@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 13:54: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: r257447 - in stable/10/sys: dev/altera/atse mips/beri X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 13:54:55 -0000 Author: brooks Date: Thu Oct 31 13:54:55 2013 New Revision: 257447 URL: http://svnweb.freebsd.org/changeset/base/257447 Log: MFC r256752, r256946 MFP4: 221483, 221567, 221568, 221670, 221677, 221678, 221800, 221801, 221804, 221805, 222004, 222006, 222055, 222820, 1135077, 1135118, 1136259 Add atse(4), a driver for the Altera Triple Speed Ethernet MegaCore. The current driver support gigabit Ethernet speeds only and works with the MegaCore only in the internal FIFO configuration in the soon to be open sourced BERI CPU configuration. MFP4: 1187103, 222076, 222057, 222051, 221799 Add atsectl, a simple utility to read and update MAC addresses stored in the default flash location on Altera DE4 boards. Typically used once when setting up a board so leaving in tools rather than inflicting on all users. To build with world add LOCAL_DIRS=tools/tools/atsectl to the make command line. Submitted by: bz Sponsored by: DARPA/AFRL Approved by: re (glebius) Added: stable/10/sys/dev/altera/atse/ - copied from r256752, head/sys/dev/altera/atse/ - copied from r257399, head/tools/tools/atsectl/ Directory Properties: stable/10/tools/tools/atsectl/ (props changed) Modified: stable/10/sys/mips/beri/files.beri Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/mips/beri/files.beri ============================================================================== --- stable/10/sys/mips/beri/files.beri Thu Oct 31 13:54:51 2013 (r257446) +++ stable/10/sys/mips/beri/files.beri Thu Oct 31 13:54:55 2013 (r257447) @@ -1,4 +1,7 @@ # $FreeBSD$ +dev/altera/atse/if_atse.c optional altera_atse +dev/altera/atse/if_atse_fdt.c optional altera_atse fdt +dev/altera/atse/if_atse_nexus.c optional altera_atse dev/altera/jtag_uart/altera_jtag_uart_cons.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_fdt.c optional altera_jtag_uart fdt From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 14:07:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1447A95E; Thu, 31 Oct 2013 14:07:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA4CE20D0; Thu, 31 Oct 2013 14:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VE70cT012643; Thu, 31 Oct 2013 14:07:00 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VE70QB012640; Thu, 31 Oct 2013 14:07:00 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311407.r9VE70QB012640@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 14:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257449 - in stable/10: . share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 14:07:01 -0000 Author: brooks Date: Thu Oct 31 14:07:00 2013 New Revision: 257449 URL: http://svnweb.freebsd.org/changeset/base/257449 Log: MFC r256915 Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows bootstrapping a copy of clang without building clang for the base system which is useful for nanobsd and similar setups. It's still probably wrong to conflate what is installed as /usr/bin/cc with the selection of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another day. Sponsored by: DARPA/AFRL Approved by: re (gjb) Modified: stable/10/Makefile.inc1 (contents, props changed) stable/10/share/mk/bsd.own.mk Directory Properties: stable/10/share/mk/ (props changed) stable/10/tools/build/options/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Oct 31 13:57:11 2013 (r257448) +++ stable/10/Makefile.inc1 Thu Oct 31 14:07:00 2013 (r257449) @@ -1381,12 +1381,10 @@ _binutils= gnu/usr.bin/binutils # If an full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" -.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") +.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && ${TARGET} != "pc98" _clang= usr.bin/clang _clang_libs= lib/clang -.endif - -.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") +.else _cc= gnu/usr.bin/cc .endif .endif Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu Oct 31 13:57:11 2013 (r257448) +++ stable/10/share/mk/bsd.own.mk Thu Oct 31 14:07:00 2013 (r257449) @@ -554,7 +554,6 @@ MK_GDB:= no .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no -MK_CLANG_IS_CC:= no .endif .if ${MK_CLANG_IS_CC} == "no" From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 14:11:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 947CCB71; Thu, 31 Oct 2013 14:11:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68101212E; Thu, 31 Oct 2013 14:11:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VEBF4K015499; Thu, 31 Oct 2013 14:11:15 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VEBFFF015498; Thu, 31 Oct 2013 14:11:15 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311411.r9VEBFFF015498@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 14:11:15 +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: r257450 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 14:11:15 -0000 Author: brooks Date: Thu Oct 31 14:11:14 2013 New Revision: 257450 URL: http://svnweb.freebsd.org/changeset/base/257450 Log: Notional MFC of r257057: Regen documentation post r257449: Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows bootstrapping a copy of clang without building clang for the base system which is useful for nanobsd and similar setups. It's still probably wrong to conflate what is installed as /usr/bin/cc with the selection of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another day. Sponsored by: DARPA/AFRL Approved by: re (gjb) Modified: stable/10/share/man/man5/src.conf.5 Directory Properties: stable/10/share/man/man5/ (props changed) Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Thu Oct 31 14:07:00 2013 (r257449) +++ stable/10/share/man/man5/src.conf.5 Thu Oct 31 14:11:14 2013 (r257450) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd October 6, 2013 +.Dd October 31, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -208,10 +208,6 @@ When set, it also enforces the following .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FULL -.It -.Va WITHOUT_CLANG_IS_CC -.It -.Va WITHOUT_LLDB .El .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru @@ -323,11 +319,7 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_FULL .It -.Va WITHOUT_CLANG_IS_CC -.It .Va WITHOUT_GROFF -.It -.Va WITHOUT_LLDB .El .It Va WITH_DEBUG_FILES .\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste @@ -910,7 +902,7 @@ This includes .Xr rsh 1 , etc. .It Va WITHOUT_RCS -.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 156932 2006-03-21 07:50:50Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb Set to not build .Xr rcs 1 and related utilities. @@ -1030,13 +1022,9 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_FULL .It -.Va WITHOUT_CLANG_IS_CC -.It .Va WITHOUT_GCC .It .Va WITHOUT_GDB -.It -.Va WITHOUT_LLDB .El .It Va WITHOUT_UNBOUND .\" from FreeBSD: head/tools/build/options/WITHOUT_UNBOUND 255597 2013-09-15 14:51:23Z des From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 14:52:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AB8D0BC; Thu, 31 Oct 2013 14:52:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A95D244A; Thu, 31 Oct 2013 14:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VEq6AO031320; Thu, 31 Oct 2013 14:52:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VEq6NL031319; Thu, 31 Oct 2013 14:52:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310311452.r9VEq6NL031319@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 14:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257452 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 14:52:06 -0000 Author: ian Date: Thu Oct 31 14:52:06 2013 New Revision: 257452 URL: http://svnweb.freebsd.org/changeset/base/257452 Log: Add support for the USB PHY on imx6 SoCs. Pretty minimal at this point, but enough to get usb host mode working. Added: head/sys/arm/freescale/imx/imx6_usbphy.c (contents, props changed) Added: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Thu Oct 31 14:52:06 2013 (r257452) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2013 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$"); + +/* + * USBPHY driver for Freescale i.MX6 family of SoCs. + */ + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +/* + * Hardware register defines. + */ +#define PWD_REG 0x0000 +#define CTRL_STATUS_REG 0x0030 +#define CTRL_SET_REG 0x0034 +#define CTRL_CLR_REG 0x0038 +#define CTRL_TOGGLE_REG 0x003c +#define CTRL_SFTRST (1 << 31) +#define CTRL_CLKGATE (1 << 30) +#define CTRL_ENUTMILEVEL3 (1 << 15) +#define CTRL_ENUTMILEVEL2 (1 << 14) + +struct usbphy_softc { + device_t dev; + struct resource *mem_res; + u_int phy_num; +}; + +static int +usbphy_detach(device_t dev) +{ + struct usbphy_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +usbphy_attach(device_t dev) +{ + struct usbphy_softc *sc; + int err, regoff, rid; + + sc = device_get_softc(dev); + err = 0; + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + /* + * XXX Totally lame way to get the unit number (but not quite as lame as + * adding an ad-hoc property to the fdt data). This works as long as + * this driver is used for imx6 only. + */ + const uint32_t PWD_PHY1_REG_PHYSADDR = 0x020c9000; + if (BUS_SPACE_PHYSADDR(sc->mem_res, 0) == PWD_PHY1_REG_PHYSADDR) { + sc->phy_num = 0; + regoff = 0; + } else { + sc->phy_num = 1; + regoff = 0x60; + } + + /* + * Based on a note in the u-boot source code, disable charger detection + * to avoid degrading the differential signaling on the DP line. Note + * that this disables (by design) both charger detection and contact + * detection, because of the screwball mix of active-high and active-low + * bits in this register. + */ + imx6_anatop_write_4(IMX6_ANALOG_USB1_CHRG_DETECT + regoff, + IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE | + IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG); + + imx6_anatop_write_4(IMX6_ANALOG_USB1_CHRG_DETECT + regoff, + IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE | + IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG); + + /* XXX Configure the overcurrent detection here. */ + + /* + * Turn on the phy clocks. + */ + imx_ccm_usbphy_enable(dev); + + /* + * Set the software reset bit, then clear both it and the clock gate bit + * to bring the device out of reset with the clock running. + */ + bus_write_4(sc->mem_res, CTRL_SET_REG, CTRL_SFTRST); + bus_write_4(sc->mem_res, CTRL_CLR_REG, CTRL_SFTRST | CTRL_CLKGATE); + + /* Power up: clear all bits in the powerdown register. */ + bus_write_4(sc->mem_res, PWD_REG, 0); + + err = 0; + +out: + + if (err != 0) + usbphy_detach(dev); + + return (err); +} + +static int +usbphy_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "fsl,imx6q-usbphy") == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 USB PHY"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t usbphy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, usbphy_probe), + DEVMETHOD(device_attach, usbphy_attach), + DEVMETHOD(device_detach, usbphy_detach), + + DEVMETHOD_END +}; + +static driver_t usbphy_driver = { + "usbphy", + usbphy_methods, + sizeof(struct usbphy_softc) +}; + +static devclass_t usbphy_devclass; + +DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0); + From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 15:04:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B94FA86B; Thu, 31 Oct 2013 15:04:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A611F2555; Thu, 31 Oct 2013 15:04:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VF4OtT035481; Thu, 31 Oct 2013 15:04:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VF4N4V035472; Thu, 31 Oct 2013 15:04:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310311504.r9VF4N4V035472@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 15:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257453 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 15:04:24 -0000 Author: ian Date: Thu Oct 31 15:04:23 2013 New Revision: 257453 URL: http://svnweb.freebsd.org/changeset/base/257453 Log: Add stubbed-out imx6 support for clocks and power management. This contains little more than a few stub functions required to keep the linker happy, but it's enough to let early imx6 development proceed. Added: head/sys/arm/freescale/imx/imx6_anatop.c (contents, props changed) head/sys/arm/freescale/imx/imx6_anatopreg.h (contents, props changed) head/sys/arm/freescale/imx/imx6_anatopvar.h (contents, props changed) head/sys/arm/freescale/imx/imx6_ccm.c (contents, props changed) head/sys/arm/freescale/imx/imx6_ccmreg.h (contents, props changed) Added: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_anatop.c Thu Oct 31 15:04:23 2013 (r257453) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 2013 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$"); + +/* + * Analog PLL and power regulator driver for Freescale i.MX6 family of SoCs. + * + * We don't really do anything with analog PLLs, but the registers for + * controlling them belong to the same block as the power regulator registers. + * Since the newbus hierarchy makes it hard for anyone other than us to get at + * them, we just export a couple public functions to allow the imx6 CCM clock + * driver to read and write those registers. + * + * We also don't do anything about power regulation yet, but when the need + * arises, this would be the place for that code to live. + * + * I have no idea where the "anatop" name comes from. It's in the standard DTS + * source describing i.MX6 SoCs, and in the linux and u-boot code which comes + * from Freescale, but it's not in the SoC manual. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +struct imx6_anatop_softc { + device_t dev; + struct resource *mem_res; +}; + +static struct imx6_anatop_softc *imx6_anatop_sc; + +uint32_t +imx6_anatop_read_4(bus_size_t offset) +{ + + return (bus_read_4(imx6_anatop_sc->mem_res, offset)); +} + +void +imx6_anatop_write_4(bus_size_t offset, uint32_t value) +{ + + bus_write_4(imx6_anatop_sc->mem_res, offset, value); +} + +static int +imx6_anatop_detach(device_t dev) +{ + struct imx6_anatop_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +imx6_anatop_attach(device_t dev) +{ + struct imx6_anatop_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + imx6_anatop_sc = sc; + err = 0; + +out: + + if (err != 0) + imx6_anatop_detach(dev); + + return (err); +} + +static int +imx6_anatop_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 Analog PLLs and Power"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t imx6_anatop_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx6_anatop_probe), + DEVMETHOD(device_attach, imx6_anatop_attach), + DEVMETHOD(device_detach, imx6_anatop_detach), + + DEVMETHOD_END +}; + +static driver_t imx6_anatop_driver = { + "imx6_anatop", + imx6_anatop_methods, + sizeof(struct imx6_anatop_softc) +}; + +static devclass_t imx6_anatop_devclass; + +DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, imx6_anatop_devclass, 0, 0); + Added: head/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_anatopreg.h Thu Oct 31 15:04:23 2013 (r257453) @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 2013 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. + * + * $FreeBSD$ + */ + +#ifndef IMX6_ANATOPREG_H +#define IMX6_ANATOPREG_H + +#define IMX6_ANALOG_CCM_PLL_ARM 0x000 +#define IMX6_ANALOG_CCM_PLL_ARM_SET 0x004 +#define IMX6_ANALOG_CCM_PLL_ARM_CLR 0x008 +#define IMX6_ANALOG_CCM_PLL_ARM_TOG 0x00C +#define IMX6_ANALOG_CCM_PLL_USB1 0x010 +#define IMX6_ANALOG_CCM_PLL_USB1_SET 0x014 +#define IMX6_ANALOG_CCM_PLL_USB1_CLR 0x018 +#define IMX6_ANALOG_CCM_PLL_USB1_TOG 0x01C +#define IMX6_ANALOG_CCM_PLL_USB_LOCK (1 << 31) +#define IMX6_ANALOG_CCM_PLL_USB_BYPASS (1 << 16) +#define IMX6_ANALOG_CCM_PLL_USB_ENABLE (1 << 13) +#define IMX6_ANALOG_CCM_PLL_USB_POWER (1 << 12) +#define IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS (1 << 6) +#define IMX6_ANALOG_CCM_PLL_USB2 0x020 +#define IMX6_ANALOG_CCM_PLL_USB2_SET 0x024 +#define IMX6_ANALOG_CCM_PLL_USB2_CLR 0x028 +#define IMX6_ANALOG_CCM_PLL_USB2_TOG 0x02C +#define IMX6_ANALOG_CCM_PLL_SYS 0x030 +#define IMX6_ANALOG_CCM_PLL_SYS_SET 0x034 +#define IMX6_ANALOG_CCM_PLL_SYS_CLR 0x038 +#define IMX6_ANALOG_CCM_PLL_SYS_TOG 0x03C +#define IMX6_ANALOG_CCM_PLL_SYS_SS 0x040 +#define IMX6_ANALOG_CCM_PLL_SYS_NUM 0x050 +#define IMX6_ANALOG_CCM_PLL_SYS_DENOM 0x060 +#define IMX6_ANALOG_CCM_PLL_AUDIO 0x070 +#define IMX6_ANALOG_CCM_PLL_AUDIO_SET 0x074 +#define IMX6_ANALOG_CCM_PLL_AUDIO_CLR 0x078 +#define IMX6_ANALOG_CCM_PLL_AUDIO_TOG 0x07C +#define IMX6_ANALOG_CCM_PLL_AUDIO_NUM 0x080 +#define IMX6_ANALOG_CCM_PLL_AUDIO_DENOM 0x090 +#define IMX6_ANALOG_CCM_PLL_VIDEO 0x0A0 +#define IMX6_ANALOG_CCM_PLL_VIDEO_SET 0x0A4 +#define IMX6_ANALOG_CCM_PLL_VIDEO_CLR 0x0A8 +#define IMX6_ANALOG_CCM_PLL_VIDEO_TOG 0x0AC +#define IMX6_ANALOG_CCM_PLL_VIDEO_NUM 0x0B0 +#define IMX6_ANALOG_CCM_PLL_VIDEO_DENOM 0x0C0 +#define IMX6_ANALOG_CCM_PLL_MLB 0x0D0 +#define IMX6_ANALOG_CCM_PLL_MLB_SET 0x0D4 +#define IMX6_ANALOG_CCM_PLL_MLB_CLR 0x0D8 +#define IMX6_ANALOG_CCM_PLL_MLB_TOG 0x0DC +#define IMX6_ANALOG_CCM_PLL_ENET 0x0E0 +#define IMX6_ANALOG_CCM_PLL_ENET_SET 0x0E4 +#define IMX6_ANALOG_CCM_PLL_ENET_CLR 0x0E8 +#define IMX6_ANALOG_CCM_PLL_ENET_TOG 0x0EC +#define IMX6_ANALOG_CCM_PFD_480 0x0F0 +#define IMX6_ANALOG_CCM_PFD_480_SET 0x0F4 +#define IMX6_ANALOG_CCM_PFD_480_CLR 0x0F8 +#define IMX6_ANALOG_CCM_PFD_480_TOG 0x0FC +#define IMX6_ANALOG_CCM_PFD_528 0x100 +#define IMX6_ANALOG_CCM_PFD_528_SET 0x104 +#define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 +#define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C +#define IMX6_ANALOG_CCM_MISC0 0x150 +#define IMX6_ANALOG_CCM_MISC0_SET 0x154 +#define IMX6_ANALOG_CCM_MISC0_CLR 0x158 +#define IMX6_ANALOG_CCM_MISC0_TOG 0x15C +#define IMX6_ANALOG_CCM_MISC2 0x170 +#define IMX6_ANALOG_CCM_MISC2_SET 0x174 +#define IMX6_ANALOG_CCM_MISC2_CLR 0x178 +#define IMX6_ANALOG_CCM_MISC2_TOG 0x17C + +#define IMX6_ANALOG_USB1_VBUS_DETECT 0x1A0 +#define IMX6_ANALOG_USB1_VBUS_DETECT_SET 0x1A4 +#define IMX6_ANALOG_USB1_VBUS_DETECT_CLR 0x1A8 +#define IMX6_ANALOG_USB1_VBUS_DETECT_TOG 0x1AC +#define IMX6_ANALOG_USB1_CHRG_DETECT 0x1B0 +#define IMX6_ANALOG_USB1_CHRG_DETECT_SET 0x1B4 +#define IMX6_ANALOG_USB1_CHRG_DETECT_CLR 0x1B8 +#define IMX6_ANALOG_USB1_CHRG_DETECT_TOG 0x1BC +#define IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE (1 << 20) /* EN_B */ +#define IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG (1 << 19) /* CHK_CHRG_B */ +#define IMX6_ANALOG_USB_CHRG_DETECT_CHK_CONTACT (1 << 18) +#define IMX6_ANALOG_USB1_VBUS_DETECT_STAT 0x1C0 +#define IMX6_ANALOG_USB1_CHRG_DETECT_STAT 0x1D0 +#define IMX6_ANALOG_USB1_MISC 0x1F0 +#define IMX6_ANALOG_USB1_MISC_SET 0x1F4 +#define IMX6_ANALOG_USB1_MISC_CLR 0x1F8 +#define IMX6_ANALOG_USB1_MISC_TOG 0x1FC +#define IMX6_ANALOG_USB2_VBUS_DETECT 0x200 +#define IMX6_ANALOG_USB2_VBUS_DETECT_SET 0x204 +#define IMX6_ANALOG_USB2_VBUS_DETECT_CLR 0x208 +#define IMX6_ANALOG_USB2_VBUS_DETECT_TOG 0x20C +#define IMX6_ANALOG_USB2_CHRG_DETECT 0x210 +#define IMX6_ANALOG_USB2_CHRG_DETECT_SET 0x214 +#define IMX6_ANALOG_USB2_CHRG_DETECT_CLR 0x218 +#define IMX6_ANALOG_USB2_CHRG_DETECT_TOG 0x21C +#define IMX6_ANALOG_USB2_VBUS_DETECT_STAT 0x220 +#define IMX6_ANALOG_USB2_CHRG_DETECT_STAT 0x230 +#define IMX6_ANALOG_USB2_MISC 0x250 +#define IMX6_ANALOG_USB2_MISC_SET 0x254 +#define IMX6_ANALOG_USB2_MISC_CLR 0x258 +#define IMX6_ANALOG_USB2_MISC_TOG 0x25C +#define IMX6_ANALOG_DIGPROG 0x260 + + + +#endif Added: head/sys/arm/freescale/imx/imx6_anatopvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_anatopvar.h Thu Oct 31 15:04:23 2013 (r257453) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2013 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. + * + * $FreeBSD$ + */ + +#ifndef IMX6_ANATOPVAR_H +#define IMX6_ANATOPVAR_H + +/* + * All registers controlling various analog aspects of the SoC (such as PLLs or + * voltage regulators or USB VBUS detection) are gathered together under the + * anatop device (because of newbus hierarchical resource management), but other + * drivers such as CMM or USBPHY need access to these registers. These + * functions let them have at the hardware directly. No effort is made by these + * functions to mediate concurrent access. + */ +uint32_t imx6_anatop_read_4(bus_size_t _offset); +void imx6_anatop_write_4(bus_size_t _offset, uint32_t _value); + +#endif Added: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_ccm.c Thu Oct 31 15:04:23 2013 (r257453) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2013 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$"); + +/* + * Clocks and power control driver for Freescale i.MX6 family of SoCs. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + + +/* XXX temp kludge for imx51_get_clock. */ +#include +#include + +struct ccm_softc { + device_t dev; + struct resource *mem_res; +}; + +static struct ccm_softc *ccm_sc; + +static inline uint32_t +RD4(struct ccm_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct ccm_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +static int +ccm_detach(device_t dev) +{ + struct ccm_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +ccm_attach(device_t dev) +{ + struct ccm_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + err = 0; + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + ccm_sc = sc; + err = 0; + +out: + + if (err != 0) + ccm_detach(dev); + + return (err); +} + +static int +ccm_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "fsl,imx6q-ccm") == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 Clock Control Module"); + + return (BUS_PROBE_DEFAULT); +} + +void +imx_ccm_usb_enable(device_t _usbdev) +{ + + /* + * For imx6, the USBOH3 clock gate is bits 0-1 of CCGR6, so no need for + * shifting and masking here, just set the low-order two bits to ALWAYS. + */ + WR4(ccm_sc, CCM_CCGR6, RD4(ccm_sc, CCM_CCGR6) | CCGR_CLK_MODE_ALWAYS); +} + +void +imx_ccm_usbphy_enable(device_t _phydev) +{ + /* + * XXX Which unit? + * Right now it's not clear how to figure from fdt data which phy unit + * we're supposed to operate on. Until this is worked out, just enable + * both PHYs. + */ +#if 0 + int phy_num, regoff; + + phy_num = 0; /* XXX */ + + switch (phy_num) { + case 0: + regoff = 0; + break; + case 1: + regoff = 0x10; + break; + default: + device_printf(ccm_sc->dev, "Bad PHY number %u,\n", + phy_num); + return; + } + + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_USB1 + regoff, + IMX6_ANALOG_CCM_PLL_USB_ENABLE | + IMX6_ANALOG_CCM_PLL_USB_POWER | + IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS); +#else + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_USB1 + 0, + IMX6_ANALOG_CCM_PLL_USB_ENABLE | + IMX6_ANALOG_CCM_PLL_USB_POWER | + IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS); + + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_USB1 + 0x10, + IMX6_ANALOG_CCM_PLL_USB_ENABLE | + IMX6_ANALOG_CCM_PLL_USB_POWER | + IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS); +#endif +} + + + + + +// XXX Fix this. This has to be here for other code to link, +// but it doesn't have to return anything useful for imx6 right now. +u_int +imx51_get_clock(enum imx51_clock clk) +{ + switch (clk) + { + case IMX51CLK_IPG_CLK_ROOT: + return 66000000; + default: + printf("imx51_get_clock() on imx6 doesn't know about clock %d\n", clk); + break; + } + return 0; +} + +static device_method_t ccm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccm_probe), + DEVMETHOD(device_attach, ccm_attach), + DEVMETHOD(device_detach, ccm_detach), + + DEVMETHOD_END +}; + +static driver_t ccm_driver = { + "ccm", + ccm_methods, + sizeof(struct ccm_softc) +}; + +static devclass_t ccm_devclass; + +DRIVER_MODULE(ccm, simplebus, ccm_driver, ccm_devclass, 0, 0); + Added: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Thu Oct 31 15:04:23 2013 (r257453) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2013 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. + * + * $FreeBSD$ + */ + +#ifndef IMX6_CCMREG_H +#define IMX6_CCMREG_H + +#define CCM_CCGR1 0x06C +#define CCM_CCGR2 0x070 +#define CCM_CCGR3 0x074 +#define CCM_CCGR4 0x078 +#define CCM_CCGR5 0x07C +#define CCM_CCGR6 0x080 +#define CCM_CMEOR 0x088 + + +#endif From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 15:27:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EA932A45; Thu, 31 Oct 2013 15:27:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D72AD2730; Thu, 31 Oct 2013 15:27:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VFRdEq043266; Thu, 31 Oct 2013 15:27:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VFRd0n043265; Thu, 31 Oct 2013 15:27:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310311527.r9VFRd0n043265@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 15:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257454 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 15:27:40 -0000 Author: ian Date: Thu Oct 31 15:27:39 2013 New Revision: 257454 URL: http://svnweb.freebsd.org/changeset/base/257454 Log: Add sdhci driver glue for imx family SoCs. This should support both uSDHC (newer SoCs) and eSDHC (older SoCs), but the eSDHC support is untested and likely to need some tweaking. Added: head/sys/arm/freescale/imx/imx_sdhci.c (contents, props changed) Added: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_sdhci.c Thu Oct 31 15:27:39 2013 (r257454) @@ -0,0 +1,704 @@ +/*- + * Copyright (c) 2013 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$"); + +/* + * SDHCI driver glue for Freescale i.MX SoC family. + * + * This supports both eSDHC (earlier SoCs) and uSDHC (more recent SoCs). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include +#include "sdhci_if.h" + +struct imx_sdhci_softc { + device_t dev; + struct resource * mem_res; + struct resource * irq_res; + void * intr_cookie; + struct sdhci_slot slot; + uint32_t baseclk_hz; + uint32_t sdclockreg_freq_bits; + uint32_t cmd_and_mode; + uint32_t r1bfix_intmask; + uint8_t r1bfix_type; + uint8_t hwtype; +}; + +#define R1BFIX_NONE 0 /* No fix needed at next interrupt. */ +#define R1BFIX_NODATA 1 /* Synthesize DATA_END for R1B w/o data. */ +#define R1BFIX_AC12 2 /* Wait for busy after auto command 12. */ + +#define HWTYPE_NONE 0 /* Hardware not recognized/supported. */ +#define HWTYPE_ESDHC 1 /* imx5x and earlier. */ +#define HWTYPE_USDHC 2 /* imx6. */ + +#define SDHC_WTMK_LVL 0x44 /* Watermark Level register. */ +#define USDHC_MIX_CONTROL 0x48 /* Mix(ed) Control register. */ +#define SDHC_VEND_SPEC 0xC0 /* Vendor-specific register. */ +#define SDHC_VEND_FRC_SDCLK_ON (1 << 8) +#define SDHC_VEND_IPGEN (1 << 11) +#define SDHC_VEND_HCKEN (1 << 12) +#define SDHC_VEND_PEREN (1 << 13) + +#define SDHC_PROT_CTRL 0x28 +#define SDHC_PROT_LED (1 << 0) +#define SDHC_PROT_WIDTH_1BIT (0 << 1) +#define SDHC_PROT_WIDTH_4BIT (1 << 1) +#define SDHC_PROT_WIDTH_8BIT (2 << 1) +#define SDHC_PROT_WIDTH_MASK (3 << 1) +#define SDHC_PROT_D3CD (1 << 3) +#define SDHC_PROT_EMODE_BIG (0 << 4) +#define SDHC_PROT_EMODE_HALF (1 << 4) +#define SDHC_PROT_EMODE_LITTLE (2 << 4) +#define SDHC_PROT_EMODE_MASK (3 << 4) +#define SDHC_PROT_SDMA (0 << 8) +#define SDHC_PROT_ADMA1 (1 << 8) +#define SDHC_PROT_ADMA2 (2 << 8) +#define SDHC_PROT_ADMA264 (3 << 8) +#define SDHC_PROT_DMA_MASK (3 << 8) +#define SDHC_PROT_CDTL (1 << 6) +#define SDHC_PROT_CDSS (1 << 7) + +#define SDHC_CLK_IPGEN (1 << 0) +#define SDHC_CLK_HCKEN (1 << 1) +#define SDHC_CLK_PEREN (1 << 2) +#define SDHC_CLK_DIVISOR_MASK 0x000000f0 +#define SDHC_CLK_DIVISOR_SHIFT 4 +#define SDHC_CLK_PRESCALE_MASK 0x0000ff00 +#define SDHC_CLK_PRESCALE_SHIFT 8 + +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-usdhc", HWTYPE_USDHC}, + {"fsl,imx6sl-usdhc", HWTYPE_USDHC}, + {"fsl,imx53-esdhc", HWTYPE_ESDHC}, + {"fsl,imx51-esdhc", HWTYPE_ESDHC}, + {NULL, HWTYPE_NONE}, +};; + +static void imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable); + +static inline uint32_t +RD4(struct imx_sdhci_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct imx_sdhci_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +static uint8_t +imx_sdhci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32, wrk32; + + /* + * Most of the things in the standard host control register are in the + * hardware's wider protocol control register, but some of the bits are + * moved around. + */ + if (off == SDHCI_HOST_CONTROL) { + wrk32 = RD4(sc, SDHC_PROT_CTRL); + val32 = wrk32 & (SDHCI_CTRL_LED | SDHCI_CTRL_CARD_DET | + SDHCI_CTRL_FORCE_CARD); + switch (wrk32 & SDHC_PROT_WIDTH_MASK) { + case SDHC_PROT_WIDTH_1BIT: + /* Value is already 0. */ + break; + case SDHC_PROT_WIDTH_4BIT: + val32 |= SDHCI_CTRL_4BITBUS; + break; + case SDHC_PROT_WIDTH_8BIT: + val32 |= SDHCI_CTRL_8BITBUS; + break; + } + switch (wrk32 & SDHC_PROT_DMA_MASK) { + case SDHC_PROT_SDMA: + /* Value is already 0. */ + break; + case SDHC_PROT_ADMA1: + /* This value is deprecated, should never appear. */ + break; + case SDHC_PROT_ADMA2: + val32 |= SDHCI_CTRL_ADMA2; + break; + case SDHC_PROT_ADMA264: + val32 |= SDHCI_CTRL_ADMA264; + break; + } + return val32; + } + + /* + * XXX can't find the bus power on/off knob. For now we have to say the + * power is always on and always set to the same voltage. + */ + if (off == SDHCI_POWER_CONTROL) { + return (SDHCI_POWER_ON | SDHCI_POWER_300); + } + + + return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xff); +} + +static uint16_t +imx_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32, wrk32; + + if (sc->hwtype == HWTYPE_USDHC) { + /* + * The USDHC hardware has nothing in the version register, but + * it's v3 compatible with all our translation code. + */ + if (off == SDHCI_HOST_VERSION) { + return (SDHCI_SPEC_300 << SDHCI_SPEC_VER_SHIFT); + } + /* + * The USDHC hardware moved the transfer mode bits to the mixed + * control register, fetch them from there. + */ + if (off == SDHCI_TRANSFER_MODE) + return (RD4(sc, USDHC_MIX_CONTROL) & 0x37); + + } else if (sc->hwtype == HWTYPE_ESDHC) { + + /* + * The ESDHC hardware has the typical 32-bit combined "command + * and mode" register that we have to cache so that command + * isn't written until after mode. On a read, just retrieve the + * cached values last written. + */ + if (off == SDHCI_TRANSFER_MODE) { + return (sc->cmd_and_mode >> 16); + } else if (off == SDHCI_COMMAND_FLAGS) { + return (sc->cmd_and_mode & 0x0000ffff); + } + } + + /* + * This hardware only manages one slot. Synthesize a slot interrupt + * status register... if there are any enabled interrupts active they + * must be coming from our one and only slot. + */ + if (off == SDHCI_SLOT_INT_STATUS) { + val32 = RD4(sc, SDHCI_INT_STATUS); + val32 &= RD4(sc, SDHCI_SIGNAL_ENABLE); + return (val32 ? 1 : 0); + } + + /* + * The clock enable bit is in the vendor register and the clock-stable + * bit is in the present state register. Transcribe them as if they + * were in the clock control register where they should be. + * XXX Is it important that we distinguish between "internal" and "card" + * clocks? Probably not; transcribe the card clock status to both bits. + */ + if (off == SDHCI_CLOCK_CONTROL) { + val32 = 0; + wrk32 = RD4(sc, SDHC_VEND_SPEC); + if (wrk32 & SDHC_VEND_FRC_SDCLK_ON) + val32 |= SDHCI_CLOCK_INT_EN | SDHCI_CLOCK_CARD_EN; + wrk32 = RD4(sc, SDHCI_PRESENT_STATE); + if (wrk32 & 0x08) + val32 |= SDHCI_CLOCK_INT_STABLE; + val32 |= sc->sdclockreg_freq_bits; + return (val32); + } + + return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xffff); +} + +static uint32_t +imx_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + /* + * The hardware leaves the base clock frequency out of the capabilities + * register; fill it in. The timeout clock is the same as the active + * output sdclock; we indicate that with a quirk setting so don't + * populate the timeout frequency bits. + * + * XXX Turn off (for now) features the hardware can do but this driver + * doesn't yet handle (1.8v, suspend/resume, etc). + */ + if (off == SDHCI_CAPABILITIES) { + val32 = RD4(sc, off); + val32 &= ~SDHCI_CAN_VDD_180; + val32 &= ~SDHCI_CAN_DO_SUSPEND; + val32 |= SDHCI_CAN_DO_8BITBUS; + val32 |= (sc->baseclk_hz / 1000000) << SDHCI_CLOCK_BASE_SHIFT; + return (val32); + } + + val32 = RD4(sc, off); + + /* + * imx_sdhci_intr() can synthesize a DATA_END interrupt following a + * command with an R1B response, mix it into the hardware status. + */ + if (off == SDHCI_INT_STATUS) { + val32 |= sc->r1bfix_intmask; + } + + return val32; +} + +static void +imx_sdhci_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + + bus_read_multi_4(sc->mem_res, off, data, count); +} + +static void +imx_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + /* + * Most of the things in the standard host control register are in the + * hardware's wider protocol control register, but some of the bits are + * moved around. + */ + if (off == SDHCI_HOST_CONTROL) { + val32 = RD4(sc, SDHC_PROT_CTRL); + val32 &= ~(SDHC_PROT_LED | SDHC_PROT_DMA_MASK | + SDHC_PROT_WIDTH_MASK | SDHC_PROT_CDTL | SDHC_PROT_CDSS); + val32 |= (val & SDHCI_CTRL_LED); + if (val & SDHCI_CTRL_8BITBUS) + val32 |= SDHC_PROT_WIDTH_8BIT; + else + val32 |= (val & SDHCI_CTRL_4BITBUS); + val32 |= (val & (SDHCI_CTRL_SDMA | SDHCI_CTRL_ADMA2)) << 4; + val32 |= (val & (SDHCI_CTRL_CARD_DET | SDHCI_CTRL_FORCE_CARD)); + WR4(sc, SDHC_PROT_CTRL, val32); + return; + } + + /* XXX I can't find the bus power on/off knob; do nothing. */ + if (off == SDHCI_POWER_CONTROL) { + return; + } + + val32 = RD4(sc, off & ~3); + val32 &= ~(0xff << (off & 3) * 8); + val32 |= (val << (off & 3) * 8); + + WR4(sc, off & ~3, val32); +} + +static void +imx_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + /* The USDHC hardware moved the transfer mode bits to mixed control. */ + if (sc->hwtype == HWTYPE_USDHC) { + if (off == SDHCI_TRANSFER_MODE) { + val32 = RD4(sc, USDHC_MIX_CONTROL); + val32 &= ~0x3f; + val32 |= val & 0x37; + // XXX acmd23 not supported here (or by sdhci driver) + WR4(sc, USDHC_MIX_CONTROL, val32); + return; + } + } + + /* + * The clock control stuff is complex enough to have its own routine + * that can both change speeds and en/disable the clock output. Also, + * save the register bits in SDHCI format so that we can play them back + * in the read2 routine without complex decoding. + */ + if (off == SDHCI_CLOCK_CONTROL) { + sc->sdclockreg_freq_bits = val & 0xffc0; + if (val & SDHCI_CLOCK_CARD_EN) { + imx_sdhc_set_clock(sc, true); + } else { + imx_sdhc_set_clock(sc, false); + } + } + + /* + * Figure out whether we need to check the DAT0 line for busy status at + * interrupt time. The controller should be doing this, but for some + * reason it doesn't. There are two cases: + * - R1B response with no data transfer should generate a DATA_END (aka + * TRANSFER_COMPLETE) interrupt after waiting for busy, but if + * there's no data transfer there's no DATA_END interrupt. This is + * documented; they seem to think it's a feature. + * - R1B response after Auto-CMD12 appears to not work, even though + * there's a control bit for it (bit 3) in the vendor register. + * When we're starting a command that needs a manual DAT0 line check at + * interrupt time, we leave ourselves a note in r1bfix_type so that we + * can do the extra work in imx_sdhci_intr(). + */ + if (off == SDHCI_COMMAND_FLAGS) { + if (val & SDHCI_CMD_DATA) { + const uint32_t MBAUTOCMD = SDHCI_TRNS_ACMD12 | SDHCI_TRNS_MULTI; + val32 = RD4(sc, USDHC_MIX_CONTROL); + if ((val32 & MBAUTOCMD) == MBAUTOCMD) + sc->r1bfix_type = R1BFIX_AC12; + } else { + if ((val & SDHCI_CMD_RESP_MASK) == SDHCI_CMD_RESP_SHORT_BUSY) { + WR4(sc, SDHCI_INT_ENABLE, slot->intmask | SDHCI_INT_RESPONSE); + WR4(sc, SDHCI_SIGNAL_ENABLE, slot->intmask | SDHCI_INT_RESPONSE); + sc->r1bfix_type = R1BFIX_NODATA; + } + } + } + + val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3) * 8); + val32 |= ((val & 0xffff) << (off & 3) * 8); + WR4(sc, off & ~3, val32); +} + +static void +imx_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + + /* Clear synthesized interrupts, then pass the value to the hardware. */ + if (off == SDHCI_INT_STATUS) { + sc->r1bfix_intmask &= ~val; + } + + WR4(sc, off, val); +} + +static void +imx_sdhci_write_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + + bus_write_multi_4(sc->mem_res, off, data, count); +} + +static void +imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable) +{ + uint32_t divisor, enable_bits, enable_reg, freq, prescale, val32; + + if (sc->hwtype == HWTYPE_ESDHC) { + divisor = (sc->sdclockreg_freq_bits >> SDHCI_DIVIDER_SHIFT) & + SDHCI_DIVIDER_MASK; + enable_reg = SDHCI_CLOCK_CONTROL; + enable_bits = SDHC_CLK_IPGEN | SDHC_CLK_HCKEN | + SDHC_CLK_PEREN; + } else { + divisor = (sc->sdclockreg_freq_bits >> SDHCI_DIVIDER_SHIFT) & + SDHCI_DIVIDER_MASK; + divisor |= ((sc->sdclockreg_freq_bits >> + SDHCI_DIVIDER_HI_SHIFT) & + SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_MASK_LEN; + enable_reg = SDHCI_CLOCK_CONTROL; + enable_bits = SDHC_VEND_IPGEN | SDHC_VEND_HCKEN | + SDHC_VEND_PEREN; + } + + WR4(sc, SDHC_VEND_SPEC, + RD4(sc, SDHC_VEND_SPEC) & ~SDHC_VEND_FRC_SDCLK_ON); + WR4(sc, enable_reg, RD4(sc, enable_reg) & ~enable_bits); + + if (!enable) + return; + + if (divisor == 0) + freq = sc->baseclk_hz; + else + freq = sc->baseclk_hz / (2 * divisor); + + for (prescale = 2; prescale < freq / prescale / 16;) + prescale <<= 1; + + for (divisor = 1; freq < freq / prescale / divisor;) + ++divisor; + + prescale >>= 1; + divisor -= 1; + + val32 = RD4(sc, SDHCI_CLOCK_CONTROL); + val32 &= ~SDHC_CLK_DIVISOR_MASK; + val32 |= divisor << SDHC_CLK_DIVISOR_SHIFT; + val32 &= ~SDHC_CLK_PRESCALE_MASK; + val32 |= prescale << SDHC_CLK_PRESCALE_SHIFT; + WR4(sc, SDHCI_CLOCK_CONTROL, val32); + + WR4(sc, enable_reg, RD4(sc, enable_reg) | enable_bits); + WR4(sc, SDHC_VEND_SPEC, + RD4(sc, SDHC_VEND_SPEC) | SDHC_VEND_FRC_SDCLK_ON); +} + +static void +imx_sdhci_intr(void *arg) +{ + struct imx_sdhci_softc *sc = arg; + uint32_t intmask; + + intmask = RD4(sc, SDHCI_INT_STATUS); + + /* + * Manually check the DAT0 line for R1B response types that the + * controller fails to handle properly. + * + * To do the NODATA fix, when the RESPONSE (COMMAND_COMPLETE) interrupt + * occurs, we have to wait for the DAT0 line to be released, then + * synthesize a DATA_END (TRANSFER_COMPLETE) interrupt, which we do by + * storing SDHCI_INT_DATA_END into a variable that gets ORed into the + * return value when the SDHCI_INT_STATUS register is read. + * + * For the AC12 fix, when the DATA_END interrupt occurs we wait for the + * DAT0 line to be released, and the waiting is all the fix we need. + */ + if ((sc->r1bfix_type == R1BFIX_NODATA && + (intmask & SDHCI_INT_RESPONSE)) || + (sc->r1bfix_type == R1BFIX_AC12 && + (intmask & SDHCI_INT_DATA_END))) { + uint32_t count; + count = 0; + /* XXX use a callout or something instead of busy-waiting. */ + while (count < 250000 && + (RD4(sc, SDHCI_PRESENT_STATE) & SDHCI_DAT_ACTIVE)) { + ++count; + DELAY(1); + } + if (count >= 250000) + sc->r1bfix_intmask = SDHCI_INT_DATA_TIMEOUT; + else if (sc->r1bfix_type == R1BFIX_NODATA) + sc->r1bfix_intmask = SDHCI_INT_DATA_END; + sc->r1bfix_type = R1BFIX_NONE; + } + + sdhci_generic_intr(&sc->slot); +} + +static int +imx_sdhci_get_ro(device_t bus, device_t child) +{ + + return (false); +} + +static int +imx_sdhci_detach(device_t dev) +{ + + return (EBUSY); +} + +static int +imx_sdhci_attach(device_t dev) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + int rid, err; + + sc->dev = dev; + + if (ofw_bus_is_compatible(dev, "fsl,imx51-esdhc")) { + sc->hwtype = HWTYPE_ESDHC; + } else if (ofw_bus_is_compatible(dev, "fsl,imx-usdhc")) { + sc->hwtype = HWTYPE_USDHC; + } else { + panic("Impossible: not compatible in imx_sdhci_attach()"); + } + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + err = ENXIO; + goto fail; + } + + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->irq_res) { + device_printf(dev, "cannot allocate interrupt\n"); + err = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, imx_sdhci_intr, sc, &sc->intr_cookie)) { + device_printf(dev, "cannot setup interrupt handler\n"); + err = ENXIO; + goto fail; + } + + sc->slot.quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; + + /* + * DMA is not really broken, I just haven't implemented it yet. + */ + sc->slot.quirks |= SDHCI_QUIRK_BROKEN_DMA; + + /* + * Set the buffer watermark level to 128 words (512 bytes) for both read + * and write. The hardware has a restriction that when the read or + * write ready status is asserted, that means you can read exactly the + * number of words set in the watermark register before you have to + * re-check the status and potentially wait for more data. The main + * sdhci driver provides no hook for doing status checking on less than + * a full block boundary, so we set the watermark level to be a full + * block. Reads and writes where the block size is less than the + * watermark size will work correctly too, no need to change the + * watermark for different size blocks. However, 128 is the maximum + * allowed for the watermark, so PIO is limitted to 512 byte blocks + * (which works fine for SD cards, may be a problem for SDIO some day). + * + * XXX need named constants for this stuff. + */ + WR4(sc, SDHC_WTMK_LVL, 0x08800880); + + /* XXX get imx6 clock frequency from CCM */ + if (sc->hwtype == HWTYPE_USDHC) { + sc->baseclk_hz = 200000000; + } else if (sc->hwtype == HWTYPE_ESDHC) { + sc->baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); + } + + sdhci_init_slot(dev, &sc->slot, 0); + + bus_generic_probe(dev); + bus_generic_attach(dev); + + sdhci_start_slot(&sc->slot); + + return (0); + +fail: + if (sc->intr_cookie) + bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie); + if (sc->irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + if (sc->mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (err); +} + +static int +imx_sdhci_probe(device_t dev) +{ + + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case HWTYPE_ESDHC: + device_set_desc(dev, "Freescale eSDHC controller"); + return (BUS_PROBE_DEFAULT); + case HWTYPE_USDHC: + device_set_desc(dev, "Freescale uSDHC controller"); + return (BUS_PROBE_DEFAULT); + default: + break; + } + return (ENXIO); +} + +static device_method_t imx_sdhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx_sdhci_probe), + DEVMETHOD(device_attach, imx_sdhci_attach), + DEVMETHOD(device_detach, imx_sdhci_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + DEVMETHOD(bus_print_child, bus_generic_print_child), + + /* MMC bridge interface */ + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, imx_sdhci_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, imx_sdhci_read_1), + DEVMETHOD(sdhci_read_2, imx_sdhci_read_2), + DEVMETHOD(sdhci_read_4, imx_sdhci_read_4), + DEVMETHOD(sdhci_read_multi_4, imx_sdhci_read_multi_4), + DEVMETHOD(sdhci_write_1, imx_sdhci_write_1), + DEVMETHOD(sdhci_write_2, imx_sdhci_write_2), + DEVMETHOD(sdhci_write_4, imx_sdhci_write_4), + DEVMETHOD(sdhci_write_multi_4, imx_sdhci_write_multi_4), + + { 0, 0 } +}; + +static devclass_t imx_sdhci_devclass; + +static driver_t imx_sdhci_driver = { + "sdhci_imx", + imx_sdhci_methods, + sizeof(struct imx_sdhci_softc), +}; + +DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); +MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); + From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 15:46:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 35942948; Thu, 31 Oct 2013 15:46:11 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2319028DF; Thu, 31 Oct 2013 15:46:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VFkBXm049845; Thu, 31 Oct 2013 15:46:11 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VFkAIb049844; Thu, 31 Oct 2013 15:46:10 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201310311546.r9VFkAIb049844@svn.freebsd.org> From: Andre Oppermann Date: Thu, 31 Oct 2013 15:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257455 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 15:46:11 -0000 Author: andre Date: Thu Oct 31 15:46:10 2013 New Revision: 257455 URL: http://svnweb.freebsd.org/changeset/base/257455 Log: Make struct ifnet readable and comprehensible again by grouping and ordering related variables, fields and locks next to each other. Add more comments to variables. Over time 'ifnet' has accumlated a lot of additional pointers and functionality in an unstructured way making it quite hard to read and understand while obfuscating relationships between fields and variables. Quantify the structure size and how bloated it has become. This is only a mechanical change in preparation for upcoming work to make ifnet opaque to drivers and to separate out the interface queuing. Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Oct 31 15:27:39 2013 (r257454) +++ head/sys/net/if_var.h Thu Oct 31 15:46:10 2013 (r257455) @@ -96,19 +96,42 @@ VNET_DECLARE(struct pfil_head, link_pfil /* * Structure defining a network interface. * - * (Would like to call this struct ``if'', but C isn't PL/1.) + * Size ILP32: 592 (approx) + * LP64: 1048 (approx) */ - struct ifnet { + /* General book keeping of interface lists. */ + TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */ + LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ + TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ + /* protected by if_addr_lock */ + u_char if_alloctype; /* if_type at time of allocation */ + + /* Driver and protocol specific information that remains stable. */ void *if_softc; /* pointer to driver state */ + void *if_llsoftc; /* link layer softc */ void *if_l2com; /* pointer to protocol bits */ - struct vnet *if_vnet; /* pointer to network stack instance */ - TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */ - char if_xname[IFNAMSIZ]; /* external name (name + unit) */ const char *if_dname; /* driver name */ int if_dunit; /* unit or IF_DUNIT_NONE */ + u_short if_index; /* numeric abbreviation for this if */ + short if_index_reserved; /* spare space to grow if_index */ + char if_xname[IFNAMSIZ]; /* external name (name + unit) */ + char *if_description; /* interface description */ + + /* Variable fields that are touched by the stack and drivers. */ + int if_flags; /* up/down, broadcast, etc. */ + int if_capabilities; /* interface features & capabilities */ + int if_capenable; /* enabled features & capabilities */ + void *if_linkmib; /* link-type-specific MIB data */ + size_t if_linkmiblen; /* length of above data */ + int if_drv_flags; /* driver-managed status flags */ u_int if_refcount; /* reference count */ - struct ifaddrhead if_addrhead; /* linked list of addresses per if */ + struct ifaltq if_snd; /* output queue (includes altq) */ + struct if_data if_data; /* type information and statistics */ + struct task if_linktask; /* task for link change events */ + + /* Addresses of different protocol families assigned to this if. */ + struct rwlock if_addr_lock; /* lock to protect address lists */ /* * if_addrhead is the list of all addresses associated to * an interface. @@ -119,21 +142,29 @@ struct ifnet { * However, access to the AF_LINK address through this * field is deprecated. Use if_addr or ifaddr_byindex() instead. */ - int if_pcount; /* number of promiscuous listeners */ - struct carp_if *if_carp; /* carp interface structure */ - struct bpf_if *if_bpf; /* packet filter structure */ - u_short if_index; /* numeric abbreviation for this if */ - short if_index_reserved; /* spare space to grow if_index */ - struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */ - int if_flags; /* up/down, broadcast, etc. */ - int if_capabilities; /* interface features & capabilities */ - int if_capenable; /* enabled features & capabilities */ - void *if_linkmib; /* link-type-specific MIB data */ - size_t if_linkmiblen; /* length of above data */ - struct if_data if_data; + struct ifaddrhead if_addrhead; /* linked list of addresses per if */ struct ifmultihead if_multiaddrs; /* multicast addresses configured */ int if_amcount; /* number of all-multicast requests */ -/* procedure handles */ + struct ifaddr *if_addr; /* pointer to link-level address */ + const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ + struct rwlock if_afdata_lock; + void *if_afdata[AF_MAX]; + int if_afdata_initialized; + + /* Additional features hung off the interface. */ + u_int if_fib; /* interface FIB */ + struct vnet *if_vnet; /* pointer to network stack instance */ + struct vnet *if_home_vnet; /* where this ifnet originates from */ + struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */ + struct bpf_if *if_bpf; /* packet filter structure */ + int if_pcount; /* number of promiscuous listeners */ + void *if_bridge; /* bridge glue */ + void *if_lagg; /* lagg glue */ + void *if_pf_kif; /* pf glue */ + struct carp_if *if_carp; /* carp interface structure */ + struct label *if_label; /* interface MAC label */ + + /* Various procedures of the layer2 encapsulation and drivers. */ int (*if_output) /* output routine (enqueue) */ (struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); @@ -153,39 +184,12 @@ struct ifnet { (struct ifnet *, struct mbuf *); void (*if_reassign) /* reassign to vnet routine */ (struct ifnet *, struct vnet *, char *); - struct vnet *if_home_vnet; /* where this ifnet originates from */ - struct ifaddr *if_addr; /* pointer to link-level address */ - void *if_llsoftc; /* link layer softc */ - int if_drv_flags; /* driver-managed status flags */ - struct ifaltq if_snd; /* output queue (includes altq) */ - const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ - - void *if_bridge; /* bridge glue */ - - struct label *if_label; /* interface MAC label */ - - /* these are only used by IPv6 */ - void *if_unused[2]; - void *if_afdata[AF_MAX]; - int if_afdata_initialized; - struct rwlock if_afdata_lock; - struct task if_linktask; /* task for link change events */ - struct rwlock if_addr_lock; /* lock to protect address lists */ - - LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ - TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ - /* protected by if_addr_lock */ - void *if_pf_kif; - void *if_lagg; /* lagg glue */ - char *if_description; /* interface description */ - u_int if_fib; /* interface FIB */ - u_char if_alloctype; /* if_type at time of allocation */ + /* Stuff that's only temporary and doesn't belong here. */ u_int if_hw_tsomax; /* tso burst length limit, the minimum * is (IP_MAXPACKET / 8). * XXXAO: Have to find a better place * for it eventually. */ - /* * Spare fields are added so that we can modify sensitive data * structures without changing the kernel binary interface, and must @@ -193,6 +197,7 @@ struct ifnet { */ char if_cspare[3]; int if_ispare[4]; + void *if_unused[2]; void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; @@ -521,5 +526,4 @@ void if_deregister_com_alloc(u_char type LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) #endif /* _KERNEL */ - #endif /* !_NET_IF_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 16:16:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7AF00100; Thu, 31 Oct 2013 16:16:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6618D2BD9; Thu, 31 Oct 2013 16:16:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VGGsjj060673; Thu, 31 Oct 2013 16:16:54 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VGGrmm060666; Thu, 31 Oct 2013 16:16:53 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311616.r9VGGrmm060666@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 16:16:53 +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: r257456 - in stable/10: share/man/man4 sys/conf sys/dev/isf sys/mips/conf usr.sbin usr.sbin/isfctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 16:16:54 -0000 Author: brooks Date: Thu Oct 31 16:16:52 2013 New Revision: 257456 URL: http://svnweb.freebsd.org/changeset/base/257456 Log: MFC r256865 Remove the isf(4) driver. It was created by accident and is subset of the cfi(4) driver. It remained in the tree longer than would be ideal due to the time required to bring cfi(4) to feature parity. Sponsored by: DARPA/AFRL Approved by: re (gjb) Deleted: stable/10/share/man/man4/isf.4 stable/10/sys/dev/isf/ stable/10/usr.sbin/isfctl/ Modified: stable/10/share/man/man4/Makefile stable/10/sys/conf/files stable/10/sys/mips/conf/BERI_DE4.hints stable/10/sys/mips/conf/BERI_DE4_MDROOT stable/10/sys/mips/conf/BERI_DE4_SDROOT stable/10/usr.sbin/Makefile Directory Properties: stable/10/share/man/man4/ (props changed) stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) stable/10/usr.sbin/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Oct 31 15:46:10 2013 (r257455) +++ stable/10/share/man/man4/Makefile Thu Oct 31 16:16:52 2013 (r257456) @@ -195,7 +195,6 @@ MAN= aac.4 \ ipwfw.4 \ isci.4 \ iscsi_initiator.4 \ - isf.4 \ isp.4 \ ispfw.4 \ iwi.4 \ Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Oct 31 15:46:10 2013 (r257455) +++ stable/10/sys/conf/files Thu Oct 31 16:16:52 2013 (r257456) @@ -1539,9 +1539,6 @@ dev/iscsi_initiator/isc_cam.c optional i dev/iscsi_initiator/isc_soc.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_subr.c optional iscsi_initiator scbus -dev/isf/isf.c optional isf -dev/isf/isf_fdt.c optional isf fdt -dev/isf/isf_nexus.c optional isf dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Modified: stable/10/sys/mips/conf/BERI_DE4.hints ============================================================================== --- stable/10/sys/mips/conf/BERI_DE4.hints Thu Oct 31 15:46:10 2013 (r257455) +++ stable/10/sys/mips/conf/BERI_DE4.hints Thu Oct 31 16:16:52 2013 (r257456) @@ -55,7 +55,6 @@ hint.altera_avgen.0.devname="berirom" # # Expose the DE4 flash via an Avalon "generic" device. -# This is incompatible with the isf(4) driver. # #hint.altera_avgen.0.at="nexus0" #hint.altera_avgen.0.maddr=0x74000000 @@ -74,38 +73,3 @@ hint.altera_avgen.0.msize=2 hint.altera_avgen.0.width=1 hint.altera_avgen.0.fileio="r" hint.altera_avgen.0.devname="de4bsw" - -# -# General Intel StrataFlash driver -# -hint.isf.0.at="nexus0" -hint.isf.0.maddr=0x74000000 -hint.isf.0.msize=0x2000000 -hint.isf.1.at="nexus0" -hint.isf.1.maddr=0x76000000 -hint.isf.1.msize=0x2000000 - -# Reserved configuration blocks. Don't touch. -hint.map.0.at="isf0" -hint.map.0.start=0x00000000 -hint.map.0.end=0x00020000 -hint.map.0.name="config" -hint.map.0.readonly=1 - -# Hardwired location of bitfile -hint.map.1.at="isf0" -hint.map.1.start=0x00020000 -hint.map.1.end=0x01820000 -hint.map.1.name="fpga" - -# Kernel on first chip -hint.map.2.at="isf0" -hint.map.2.start=0x01820000 -hint.map.2.end=0x02000000 -hint.map.2.name="reserved" - -# The second chip -hint.map.3.at="isf1" -hint.map.3.start=0x00000000 -hint.map.3.end=0x02000000 -hint.map.3.name="kernel" Modified: stable/10/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_DE4_MDROOT Thu Oct 31 15:46:10 2013 (r257455) +++ stable/10/sys/mips/conf/BERI_DE4_MDROOT Thu Oct 31 16:16:52 2013 (r257456) @@ -26,5 +26,4 @@ device altera_sdcard device terasic_de4led device terasic_mtl -device isf device sc Modified: stable/10/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_DE4_SDROOT Thu Oct 31 15:46:10 2013 (r257455) +++ stable/10/sys/mips/conf/BERI_DE4_SDROOT Thu Oct 31 16:16:52 2013 (r257456) @@ -20,5 +20,4 @@ device altera_sdcard device terasic_de4led device terasic_mtl -device isf device sc Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Thu Oct 31 15:46:10 2013 (r257455) +++ stable/10/usr.sbin/Makefile Thu Oct 31 16:16:52 2013 (r257456) @@ -37,7 +37,6 @@ SUBDIR= adduser \ inetd \ iostat \ iscsid \ - isfctl \ kldxref \ mailwrapper \ makefs \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 16:18:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 467222C4; Thu, 31 Oct 2013 16:18:38 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24A3B2BF8; Thu, 31 Oct 2013 16:18:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VGIcEp060910; Thu, 31 Oct 2013 16:18:38 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VGIbNa060905; Thu, 31 Oct 2013 16:18:37 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311618.r9VGIbNa060905@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 16:18: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: r257457 - in stable/10/sys: conf dev/fdt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 16:18:38 -0000 Author: brooks Date: Thu Oct 31 16:18:36 2013 New Revision: 257457 URL: http://svnweb.freebsd.org/changeset/base/257457 Log: MFC r256861: MFP4: 223121 (FDT infrastructure portion) Implement support for interrupt-parent nodes in simplebus. The current implementation requires that device declarations have an interrupt-parent node and that it point to a device that has registered itself as a interrupt controller in fdt_ic_list_head and implements the fdt_ic interface. Sponsored by: DARPA/AFRL Approved by: re (gjb) Added: - copied unchanged from r256861, head/sys/dev/fdt/fdt_ic_if.m Directory Properties: stable/10/sys/dev/fdt/fdt_ic_if.m (props changed) Modified: stable/10/sys/conf/files stable/10/sys/dev/fdt/fdt_common.c stable/10/sys/dev/fdt/fdt_common.h stable/10/sys/dev/fdt/simplebus.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Oct 31 16:16:52 2013 (r257456) +++ stable/10/sys/conf/files Thu Oct 31 16:18:36 2013 (r257457) @@ -1400,6 +1400,7 @@ dev/exca/exca.c optional cbb dev/fatm/if_fatm.c optional fatm pci dev/fb/splash.c optional splash dev/fdt/fdt_common.c optional fdt +dev/fdt/fdt_ic_if.m optional fdt dev/fdt/fdt_pci.c optional fdt pci dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ Modified: stable/10/sys/dev/fdt/fdt_common.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.c Thu Oct 31 16:16:52 2013 (r257456) +++ stable/10/sys/dev/fdt/fdt_common.c Thu Oct 31 16:18:36 2013 (r257457) @@ -63,6 +63,8 @@ vm_paddr_t fdt_immr_pa; vm_offset_t fdt_immr_va; vm_offset_t fdt_immr_size; +struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head); + int fdt_get_range(phandle_t node, int range_id, u_long *base, u_long *size) { Modified: stable/10/sys/dev/fdt/fdt_common.h ============================================================================== --- stable/10/sys/dev/fdt/fdt_common.h Thu Oct 31 16:16:52 2013 (r257456) +++ stable/10/sys/dev/fdt/fdt_common.h Thu Oct 31 16:18:36 2013 (r257457) @@ -70,6 +70,13 @@ struct fdt_fixup_entry { }; extern struct fdt_fixup_entry fdt_fixup_table[]; +extern SLIST_HEAD(fdt_ic_list, fdt_ic) fdt_ic_list_head; +struct fdt_ic { + SLIST_ENTRY(fdt_ic) fdt_ics; + ihandle_t iph; + device_t dev; +}; + extern vm_paddr_t fdt_immr_pa; extern vm_offset_t fdt_immr_va; extern vm_offset_t fdt_immr_size; Copied: stable/10/sys/dev/fdt/fdt_ic_if.m (from r256861, head/sys/dev/fdt/fdt_ic_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/fdt/fdt_ic_if.m Thu Oct 31 16:18:36 2013 (r257457, copy of r256861, head/sys/dev/fdt/fdt_ic_if.m) @@ -0,0 +1,266 @@ +#- +# Copyright (c) 2013 SRI International +# Copyright (c) 1998-2004 Doug Rabson +# 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 + +/** + * @defgroup FST_IC fdt_ic - KObj methods for interrupt controllers + * @brief A set of methods required device drivers that are interrupt + * controllers. Derived from sys/kern/bus_if.m. + * @{ + */ +INTERFACE fdt_ic; + +/** + * @brief Allocate an interrupt resource + * + * This method is called by child devices of an interrupt controller to + * allocate an interrup. The meaning of the resource-ID field varies + * from bus to bus and is opaque to the interrupt controller. If a + * resource was allocated and the caller did not use the RF_ACTIVE + * to specify that it should be activated immediately, the caller is + * responsible for calling FDT_IC_ACTIVATE_INTR() when it actually uses + * the interupt. + * + * @param _dev the interrupt-parent device of @p _child + * @param _child the device which is requesting an allocation + * @param _rid a pointer to the resource identifier + * @param _irq interrupt source to allocate + * @param _flags any extra flags to control the resource + * allocation - see @c RF_XXX flags in + * for details + * + * @returns the interrupt which was allocated or @c NULL if no + * resource could be allocated + */ +METHOD struct resource * alloc_intr { + device_t _dev; + device_t _child; + int *_rid; + u_long _irq; + u_int _flags; +}; + +/** + * @brief Activate an interrupt + * + * Activate an interrupt previously allocated with FDT_IC_ALLOC_INTR(). + * + * @param _dev the parent device of @p _child + * @param _r interrupt to activate + */ +METHOD int activate_intr { + device_t _dev; + struct resource *_r; +}; + +/** + * @brief Deactivate an interrupt + * + * Deactivate a resource previously allocated with FDT_IC_ALLOC_INTR(). + * + * @param _dev the parent device of @p _child + * @param _r the interrupt to deactivate + */ +METHOD int deactivate_intr { + device_t _dev; + struct resource *_r; +}; + +/** + * @brief Release an interrupt + * + * Free an interupt allocated by the FDT_IC_ALLOC_INTR. + * + * @param _dev the parent device of @p _child + * @param _r the resource to release + */ +METHOD int release_intr { + device_t _dev; + struct resource *_res; +}; + +/** + * @brief Install an interrupt handler + * + * This method is used to associate an interrupt handler function with + * an irq resource. When the interrupt triggers, the function @p _intr + * will be called with the value of @p _arg as its single + * argument. The value returned in @p *_cookiep is used to cancel the + * interrupt handler - the caller should save this value to use in a + * future call to FDT_IC_TEARDOWN_INTR(). + * + * @param _dev the interrupt-parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + * @param _flags a set of bits from enum intr_type specifying + * the class of interrupt + * @param _intr the function to call when the interrupt + * triggers + * @param _arg a value to use as the single argument in calls + * to @p _intr + * @param _cookiep a pointer to a location to recieve a cookie + * value that may be used to remove the interrupt + * handler + */ +METHOD int setup_intr { + device_t _dev; + device_t _child; + struct resource *_irq; + int _flags; + driver_filter_t *_filter; + driver_intr_t *_intr; + void *_arg; + void **_cookiep; +}; + +/** + * @brief Uninstall an interrupt handler + * + * This method is used to disassociate an interrupt handler function + * with an irq resource. The value of @p _cookie must be the value + * returned from a previous call to FDT_IC_SETUP_INTR(). + * + * @param _dev the interrupt-parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + * @param _cookie the cookie value returned when the interrupt + * was originally registered + */ +METHOD int teardown_intr { + device_t _dev; + device_t _child; + struct resource *_irq; + void *_cookie; +}; + +/** + * @brief Allow drivers to request that an interrupt be bound to a specific + * CPU. + * + * @param _dev the interrupt-parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + * @param _cpu the CPU to bind the interrupt to + */ +METHOD int bind_intr { + device_t _dev; + device_t _child; + struct resource *_irq; + int _cpu; +}; + +/** + * @brief Allow drivers to specify the trigger mode and polarity + * of the specified interrupt. + * + * @param _dev the interrupt-parent device + * @param _irq the interrupt number to modify + * @param _trig the trigger mode required + * @param _pol the interrupt polarity required + */ +METHOD int config_intr { + device_t _dev; + int _irq; + enum intr_trigger _trig; + enum intr_polarity _pol; +}; + +/** + * @brief Allow drivers to associate a description with an active + * interrupt handler. + * + * @param _dev the interrupt-parent device of @p _child + * @param _child the device which allocated the resource + * @param _irq the resource representing the interrupt + * @param _cookie the cookie value returned when the interrupt + * was originally registered + * @param _descr the description to associate with the interrupt + */ +METHOD int describe_intr { + device_t _dev; + device_t _child; + struct resource *_irq; + void *_cookie; + const char *_descr; +}; + +/** + * @brief Notify an ic that specified child's IRQ should be remapped. + * + * @param _dev the interrupt-parent device + * @param _child the child device + * @param _irq the irq number + */ +METHOD int remap_intr { + device_t _dev; + device_t _child; + u_int _irq; +}; + +/** + * @brief Enable an IPI source. + * + * @param _dev the interrupt controller + * @param _tid the thread ID (relative to the interrupt controller) + * to enable IPIs for + * @param _ipi_irq hardware IRQ to send IPIs to + */ +METHOD void setup_ipi { + device_t _dev; + u_int _tid; + u_int _irq; +}; + +/** + * @brief Send an IPI to the specified thread. + * + * @param _dev the interrupt controller + * @param _tid the thread ID (relative to the interrupt controller) + * to send IPIs to + */ +METHOD void send_ipi { + device_t _dev; + u_int _tid; +}; + +/** + * @brief Clear the IPI on the specfied thread. Only call with the + * local hardware thread or interrupts may be lost! + * + * @param _dev the interrupt controller + * @param _tid the thread ID (relative to the interrupt controller) + * to clear the IPI on + */ +METHOD void clear_ipi { + device_t _dev; + u_int _tid; +}; Modified: stable/10/sys/dev/fdt/simplebus.c ============================================================================== --- stable/10/sys/dev/fdt/simplebus.c Thu Oct 31 16:16:52 2013 (r257456) +++ stable/10/sys/dev/fdt/simplebus.c Thu Oct 31 16:18:36 2013 (r257457) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include "fdt_common.h" +#include "fdt_ic_if.h" #include "ofw_bus_if.h" #ifdef DEBUG @@ -80,9 +81,18 @@ static int simplebus_attach(device_t); static int simplebus_print_child(device_t, device_t); static int simplebus_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); +static int simplebus_teardown_intr(device_t, device_t, struct resource *, + void *); +static int simplebus_activate_resource(device_t, device_t, int, int, + struct resource *); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +static int simplebus_deactivate_resource(device_t, device_t, int, int, + struct resource *); +static int simplebus_release_resource(device_t, device_t, int, int, + struct resource *); +static device_t simplebus_get_interrupt_parent(device_t); static struct resource_list *simplebus_get_resource_list(device_t, device_t); static ofw_bus_get_devinfo_t simplebus_get_devinfo; @@ -102,11 +112,11 @@ static device_method_t simplebus_methods /* Bus interface */ DEVMETHOD(bus_print_child, simplebus_print_child), DEVMETHOD(bus_alloc_resource, simplebus_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, simplebus_release_resource), + DEVMETHOD(bus_activate_resource, simplebus_activate_resource), + DEVMETHOD(bus_deactivate_resource, simplebus_deactivate_resource), DEVMETHOD(bus_setup_intr, simplebus_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_teardown_intr, simplebus_teardown_intr), DEVMETHOD(bus_get_resource_list, simplebus_get_resource_list), /* OFW bus interface */ @@ -217,6 +227,7 @@ simplebus_attach(device_t dev) static int simplebus_print_child(device_t dev, device_t child) { + device_t ip; struct simplebus_devinfo *di; struct resource_list *rl; int rv; @@ -228,6 +239,8 @@ simplebus_print_child(device_t dev, devi rv += bus_print_child_header(dev, child); rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + if ((ip = simplebus_get_interrupt_parent(child)) != NULL) + rv += printf(" (%s)", device_get_nameunit(ip)); rv += bus_print_child_footer(dev, child); return (rv); @@ -237,6 +250,7 @@ static struct resource * simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { + device_t ic; struct simplebus_devinfo *di; struct resource_list_entry *rle; @@ -263,10 +277,53 @@ simplebus_alloc_resource(device_t bus, d count = rle->count; } + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return(FDT_IC_ALLOC_INTR(ic, child, rid, start, flags)); + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, count, flags)); } +static int +simplebus_activate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + device_t ic; + + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_ACTIVATE_INTR(ic, r)); + + return (bus_generic_activate_resource(dev, child, type, rid, r)); +} + +static int +simplebus_deactivate_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + device_t ic; + + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_DEACTIVATE_INTR(ic, r)); + + return (bus_generic_deactivate_resource(dev, child, type, rid, r)); +} + +static int +simplebus_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + device_t ic; + + if (type == SYS_RES_IRQ && + (ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_RELEASE_INTR(ic, r)); + + return (bus_generic_release_resource(dev, child, type, rid, r)); +} + static struct resource_list * simplebus_get_resource_list(device_t bus, device_t child) { @@ -276,15 +333,45 @@ simplebus_get_resource_list(device_t bus return (&di->di_res); } +static device_t +simplebus_get_interrupt_parent(device_t dev) +{ + struct simplebus_devinfo *di; + struct fdt_ic *ic; + device_t ip; + ihandle_t iph; + phandle_t ph; + + ip = NULL; + + di = device_get_ivars(dev); + if (di == NULL) + return (NULL); + + if (OF_getprop(di->di_ofw.obd_node, "interrupt-parent", &iph, + sizeof(iph)) > 0) { + iph = fdt32_to_cpu(iph); + ph = OF_instance_to_package(iph); + SLIST_FOREACH(ic, &fdt_ic_list_head, fdt_ics) { + if (ic->iph == ph) { + ip = ic->dev; + break; + } + } + } + return (ip); +} + static int simplebus_setup_intr(device_t bus, device_t child, struct resource *res, int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) { struct simplebus_devinfo *di; + device_t ic; enum intr_trigger trig; enum intr_polarity pol; - int error, rid; + int error, irq, rid; di = device_get_ivars(child); if (di == NULL) @@ -297,20 +384,41 @@ simplebus_setup_intr(device_t bus, devic if (rid >= DI_MAX_INTR_NUM) return (ENOENT); + ic = simplebus_get_interrupt_parent(child); + trig = di->di_intr_sl[rid].trig; pol = di->di_intr_sl[rid].pol; if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) { - error = bus_generic_config_intr(bus, rman_get_start(res), - trig, pol); + irq = rman_get_start(res); + if (ic != NULL) + error = FDT_IC_CONFIG_INTR(ic, irq, trig, pol); + else + error = bus_generic_config_intr(bus, irq, trig, pol); if (error) return (error); } - error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand, - arg, cookiep); + if (ic != NULL) + error = FDT_IC_SETUP_INTR(ic, child, res, flags, filter, + ihand, arg, cookiep); + else + error = bus_generic_setup_intr(bus, child, res, flags, filter, + ihand, arg, cookiep); return (error); } +static int +simplebus_teardown_intr(device_t bus, device_t child, struct resource *res, + void *cookie) +{ + device_t ic; + + if ((ic = simplebus_get_interrupt_parent(child)) != NULL) + return (FDT_IC_TEARDOWN_INTR(ic, child, res, cookie)); + + return (bus_generic_teardown_intr(bus, child, res, cookie)); +} + static const struct ofw_bus_devinfo * simplebus_get_devinfo(device_t bus, device_t child) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 17:56:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE0FF69C; Thu, 31 Oct 2013 17:56:27 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB35923FF; Thu, 31 Oct 2013 17:56:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VHuRvW093774; Thu, 31 Oct 2013 17:56:27 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VHuRbV093773; Thu, 31 Oct 2013 17:56:27 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311756.r9VHuRbV093773@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 17:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257459 - stable/10/gnu/usr.bin/binutils/ld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 17:56:27 -0000 Author: brooks Date: Thu Oct 31 17:56:27 2013 New Revision: 257459 URL: http://svnweb.freebsd.org/changeset/base/257459 Log: MFC r257268: Enable the --sysroot=/foo option in ld by always building with a sysroot defined. When not building as a cross linker, the sysroot is set to "/". Exp-run by: bdrewery (ports/183206) Approved by: re (gjb) Modified: stable/10/gnu/usr.bin/binutils/ld/Makefile Directory Properties: stable/10/gnu/usr.bin/binutils/ (props changed) Modified: stable/10/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- stable/10/gnu/usr.bin/binutils/ld/Makefile Thu Oct 31 17:33:29 2013 (r257458) +++ stable/10/gnu/usr.bin/binutils/ld/Makefile Thu Oct 31 17:56:27 2013 (r257459) @@ -31,7 +31,7 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\" CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\" CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\" +CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\" CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\" CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 18:01:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7407C9DC; Thu, 31 Oct 2013 18:01:55 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id DB8F6248C; Thu, 31 Oct 2013 18:01:54 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 3BA457300A; Thu, 31 Oct 2013 19:03:36 +0100 (CET) Date: Thu, 31 Oct 2013 19:03:36 +0100 From: Luigi Rizzo To: Andre Oppermann Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131031180336.GA62132@onelab2.iet.unipi.it> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310311546.r9VFkAIb049844@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 18:01:55 -0000 On Thu, Oct 31, 2013 at 03:46:10PM +0000, Andre Oppermann wrote: > Author: andre > Date: Thu Oct 31 15:46:10 2013 > New Revision: 257455 > URL: http://svnweb.freebsd.org/changeset/base/257455 > > Log: > Make struct ifnet readable and comprehensible again by grouping > and ordering related variables, fields and locks next to each > other. Add more comments to variables. > Over time 'ifnet' has accumlated a lot of additional pointers and > functionality in an unstructured way making it quite hard to read > and understand while obfuscating relationships between fields and > variables. > > Quantify the structure size and how bloated it has become. > > This is only a mechanical change in preparation for upcoming > work to make ifnet opaque to drivers and to separate out the > interface queuing. as you do the above I think it would make sense to replace all int/short/long with fixed-size fields as appropriate (and large enough) to make it easier to reason about things such as 'how many flags can i stuff into a field'. The "large enough" part refers to two things: - bitfields containing flags or capabilities have a tendency to overflow (not just in freebsd, linux has the same) requiring KBI changes. We should probably go for 64 bits unless there are compelling space reasons (not for ifnet). - it is useful if certain opaque fields (flow ids, cookies...) can store pointers. Once again, make them at least 64 bit helps cheers luigi > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/net/if_var.h > > Modified: head/sys/net/if_var.h > ============================================================================== > --- head/sys/net/if_var.h Thu Oct 31 15:27:39 2013 (r257454) > +++ head/sys/net/if_var.h Thu Oct 31 15:46:10 2013 (r257455) > @@ -96,19 +96,42 @@ VNET_DECLARE(struct pfil_head, link_pfil > /* > * Structure defining a network interface. > * > - * (Would like to call this struct ``if'', but C isn't PL/1.) > + * Size ILP32: 592 (approx) > + * LP64: 1048 (approx) > */ > - > struct ifnet { > + /* General book keeping of interface lists. */ > + TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */ > + LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ > + TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ > + /* protected by if_addr_lock */ > + u_char if_alloctype; /* if_type at time of allocation */ > + > + /* Driver and protocol specific information that remains stable. */ > void *if_softc; /* pointer to driver state */ > + void *if_llsoftc; /* link layer softc */ > void *if_l2com; /* pointer to protocol bits */ > - struct vnet *if_vnet; /* pointer to network stack instance */ > - TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */ > - char if_xname[IFNAMSIZ]; /* external name (name + unit) */ > const char *if_dname; /* driver name */ > int if_dunit; /* unit or IF_DUNIT_NONE */ > + u_short if_index; /* numeric abbreviation for this if */ > + short if_index_reserved; /* spare space to grow if_index */ > + char if_xname[IFNAMSIZ]; /* external name (name + unit) */ > + char *if_description; /* interface description */ > + > + /* Variable fields that are touched by the stack and drivers. */ > + int if_flags; /* up/down, broadcast, etc. */ > + int if_capabilities; /* interface features & capabilities */ > + int if_capenable; /* enabled features & capabilities */ > + void *if_linkmib; /* link-type-specific MIB data */ > + size_t if_linkmiblen; /* length of above data */ > + int if_drv_flags; /* driver-managed status flags */ > u_int if_refcount; /* reference count */ > - struct ifaddrhead if_addrhead; /* linked list of addresses per if */ > + struct ifaltq if_snd; /* output queue (includes altq) */ > + struct if_data if_data; /* type information and statistics */ > + struct task if_linktask; /* task for link change events */ > + > + /* Addresses of different protocol families assigned to this if. */ > + struct rwlock if_addr_lock; /* lock to protect address lists */ > /* > * if_addrhead is the list of all addresses associated to > * an interface. > @@ -119,21 +142,29 @@ struct ifnet { > * However, access to the AF_LINK address through this > * field is deprecated. Use if_addr or ifaddr_byindex() instead. > */ > - int if_pcount; /* number of promiscuous listeners */ > - struct carp_if *if_carp; /* carp interface structure */ > - struct bpf_if *if_bpf; /* packet filter structure */ > - u_short if_index; /* numeric abbreviation for this if */ > - short if_index_reserved; /* spare space to grow if_index */ > - struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */ > - int if_flags; /* up/down, broadcast, etc. */ > - int if_capabilities; /* interface features & capabilities */ > - int if_capenable; /* enabled features & capabilities */ > - void *if_linkmib; /* link-type-specific MIB data */ > - size_t if_linkmiblen; /* length of above data */ > - struct if_data if_data; > + struct ifaddrhead if_addrhead; /* linked list of addresses per if */ > struct ifmultihead if_multiaddrs; /* multicast addresses configured */ > int if_amcount; /* number of all-multicast requests */ > -/* procedure handles */ > + struct ifaddr *if_addr; /* pointer to link-level address */ > + const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ > + struct rwlock if_afdata_lock; > + void *if_afdata[AF_MAX]; > + int if_afdata_initialized; > + > + /* Additional features hung off the interface. */ > + u_int if_fib; /* interface FIB */ > + struct vnet *if_vnet; /* pointer to network stack instance */ > + struct vnet *if_home_vnet; /* where this ifnet originates from */ > + struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */ > + struct bpf_if *if_bpf; /* packet filter structure */ > + int if_pcount; /* number of promiscuous listeners */ > + void *if_bridge; /* bridge glue */ > + void *if_lagg; /* lagg glue */ > + void *if_pf_kif; /* pf glue */ > + struct carp_if *if_carp; /* carp interface structure */ > + struct label *if_label; /* interface MAC label */ > + > + /* Various procedures of the layer2 encapsulation and drivers. */ > int (*if_output) /* output routine (enqueue) */ > (struct ifnet *, struct mbuf *, const struct sockaddr *, > struct route *); > @@ -153,39 +184,12 @@ struct ifnet { > (struct ifnet *, struct mbuf *); > void (*if_reassign) /* reassign to vnet routine */ > (struct ifnet *, struct vnet *, char *); > - struct vnet *if_home_vnet; /* where this ifnet originates from */ > - struct ifaddr *if_addr; /* pointer to link-level address */ > - void *if_llsoftc; /* link layer softc */ > - int if_drv_flags; /* driver-managed status flags */ > - struct ifaltq if_snd; /* output queue (includes altq) */ > - const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */ > - > - void *if_bridge; /* bridge glue */ > - > - struct label *if_label; /* interface MAC label */ > - > - /* these are only used by IPv6 */ > - void *if_unused[2]; > - void *if_afdata[AF_MAX]; > - int if_afdata_initialized; > - struct rwlock if_afdata_lock; > - struct task if_linktask; /* task for link change events */ > - struct rwlock if_addr_lock; /* lock to protect address lists */ > - > - LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ > - TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ > - /* protected by if_addr_lock */ > - void *if_pf_kif; > - void *if_lagg; /* lagg glue */ > - char *if_description; /* interface description */ > - u_int if_fib; /* interface FIB */ > - u_char if_alloctype; /* if_type at time of allocation */ > > + /* Stuff that's only temporary and doesn't belong here. */ > u_int if_hw_tsomax; /* tso burst length limit, the minimum > * is (IP_MAXPACKET / 8). > * XXXAO: Have to find a better place > * for it eventually. */ > - > /* > * Spare fields are added so that we can modify sensitive data > * structures without changing the kernel binary interface, and must > @@ -193,6 +197,7 @@ struct ifnet { > */ > char if_cspare[3]; > int if_ispare[4]; > + void *if_unused[2]; > void *if_pspare[8]; /* 1 netmap, 7 TDB */ > }; > > @@ -521,5 +526,4 @@ void if_deregister_com_alloc(u_char type > LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) > > #endif /* _KERNEL */ > - > #endif /* !_NET_IF_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 18:06:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C8A80E39; Thu, 31 Oct 2013 18:06:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B9C624EB; Thu, 31 Oct 2013 18:06:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VI6XSh097347; Thu, 31 Oct 2013 18:06:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VI6XKS097343; Thu, 31 Oct 2013 18:06:33 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311806.r9VI6XKS097343@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 18:06:33 +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: r257460 - in stable/10: . share/mk tools/build/options X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 18:06:33 -0000 Author: brooks Date: Thu Oct 31 18:06:32 2013 New Revision: 257460 URL: http://svnweb.freebsd.org/changeset/base/257460 Log: MFC r257138: Switch the default mtree to nmtree our new NetBSD derived mtree. Exp-runs by: bdrewery (ports/182438) Sponsored by: DARPA/AFRL Approved by: re (gjb) Added: stable/10/tools/build/options/WITHOUT_NMTREE - copied unchanged from r257138, head/tools/build/options/WITHOUT_NMTREE Deleted: stable/10/tools/build/options/WITH_NMTREE Modified: stable/10/UPDATING (contents, props changed) stable/10/share/mk/bsd.own.mk Directory Properties: stable/10/share/mk/ (props changed) stable/10/tools/build/options/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Oct 31 17:56:27 2013 (r257459) +++ stable/10/UPDATING Thu Oct 31 18:06:32 2013 (r257460) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20131031: + The default version of mtree is nmtree which is obtained from + NetBSD. The output is generally the same, but may vary + slightly. If you found you need identical output adding + "-F freebsd9" to the command line should do the trick. For the + time being, the old mtree is available as fmtree. + 20131014: libbsdyml has been renamed to libyaml and moved to /usr/lib/private. This will break ports-mgmt/pkg. Rebuild the port, or upgrade to pkg Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu Oct 31 17:56:27 2013 (r257459) +++ stable/10/share/mk/bsd.own.mk Thu Oct 31 18:06:32 2013 (r257460) @@ -320,6 +320,7 @@ __DEFAULT_YES_OPTIONS = \ NIS \ NLS \ NLS_CATALOGS \ + NMTREE \ NS_CACHING \ NTP \ OPENSSH \ @@ -370,7 +371,6 @@ __DEFAULT_NO_OPTIONS = \ LIBICONV_COMPAT \ INSTALL_AS_USER \ LLDB \ - NMTREE \ NAND \ OFED \ OPENSSH_NONE_CIPHER \ Copied: stable/10/tools/build/options/WITHOUT_NMTREE (from r257138, head/tools/build/options/WITHOUT_NMTREE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_NMTREE Thu Oct 31 18:06:32 2013 (r257460, copy of r257138, head/tools/build/options/WITHOUT_NMTREE) @@ -0,0 +1,9 @@ +.\" $FreeBSD$ +Set to install +.Xr fmtree 8 +as +.Xr mtree 8 . +By default +.Xr nmtree 8 +is installed as +.Xr mtree 8 . From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 18:11:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56995394; Thu, 31 Oct 2013 18:11:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 440E02597; Thu, 31 Oct 2013 18:11:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VIBp5G000348; Thu, 31 Oct 2013 18:11:51 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VIBpUb000347; Thu, 31 Oct 2013 18:11:51 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201310311811.r9VIBpUb000347@svn.freebsd.org> From: Brooks Davis Date: Thu, 31 Oct 2013 18:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257461 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 18:11:51 -0000 Author: brooks Date: Thu Oct 31 18:11:50 2013 New Revision: 257461 URL: http://svnweb.freebsd.org/changeset/base/257461 Log: Notional MFC of r257139: Regerate after r257460 swapped the default to WITH_NMTREE. Approved by: re (gjb) Modified: stable/10/share/man/man5/src.conf.5 Directory Properties: stable/10/share/man/man5/ (props changed) Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Thu Oct 31 18:06:32 2013 (r257460) +++ stable/10/share/man/man5/src.conf.5 Thu Oct 31 18:11:50 2013 (r257461) @@ -764,14 +764,14 @@ Set to not build NLS catalogs. .\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . -.It Va WITH_NMTREE -.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245435 2013-01-14 20:38:32Z brooks +.It Va WITHOUT_NMTREE +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_NMTREE 257460 2013-10-31 18:06:32Z brooks Set to install -.Xr nmtree 8 +.Xr fmtree 8 as .Xr mtree 8 . By default -.Xr fmtree 8 +.Xr nmtree 8 is installed as .Xr mtree 8 . .It Va WITHOUT_NS_CACHING From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 18:44:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 537F6305; Thu, 31 Oct 2013 18:44:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 269E927D0; Thu, 31 Oct 2013 18:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VIigNq010709; Thu, 31 Oct 2013 18:44:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VIifYs010702; Thu, 31 Oct 2013 18:44:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201310311844.r9VIifYs010702@svn.freebsd.org> From: Ed Maste Date: Thu, 31 Oct 2013 18:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257462 - head/lib/libz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 18:44:42 -0000 Author: emaste Date: Thu Oct 31 18:44:40 2013 New Revision: 257462 URL: http://svnweb.freebsd.org/changeset/base/257462 Log: Fix up FreeBSD tag for files not from a vendor branch Unexpand the tag, remove the fbsd:nokeywords property and add the svn:keywords property. This should eliminate the gratuituous diffs that appear on these files in projects branches. Sponsored by: The FreeBSD Foundation Modified: head/lib/libz/FREEBSD-upgrade (contents, props changed) head/lib/libz/Makefile (contents, props changed) head/lib/libz/Symbol.map (contents, props changed) head/lib/libz/Versions.def (contents, props changed) head/lib/libz/zopen.c (contents, props changed) Modified: head/lib/libz/FREEBSD-upgrade ============================================================================== --- head/lib/libz/FREEBSD-upgrade Thu Oct 31 18:11:50 2013 (r257461) +++ head/lib/libz/FREEBSD-upgrade Thu Oct 31 18:44:40 2013 (r257462) @@ -1,4 +1,4 @@ -$FreeBSD: head/lib/libz/FREEBSD-upgrade 146082 2005-05-11 03:50:50Z kientzle $ +$FreeBSD$ ZLib 1.2.2 Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Thu Oct 31 18:11:50 2013 (r257461) +++ head/lib/libz/Makefile Thu Oct 31 18:44:40 2013 (r257462) @@ -1,5 +1,5 @@ # -# $FreeBSD: head/lib/libz/Makefile 232263 2012-02-28 18:30:18Z dim $ +# $FreeBSD$ # LIB= z Modified: head/lib/libz/Symbol.map ============================================================================== --- head/lib/libz/Symbol.map Thu Oct 31 18:11:50 2013 (r257461) +++ head/lib/libz/Symbol.map Thu Oct 31 18:44:40 2013 (r257462) @@ -1,5 +1,5 @@ /* - * $FreeBSD: head/lib/libz/Symbol.map 206709 2010-04-16 20:07:24Z delphij $ + * $FreeBSD$ */ ZLIB_1.2.7.1 { Modified: head/lib/libz/Versions.def ============================================================================== --- head/lib/libz/Versions.def Thu Oct 31 18:11:50 2013 (r257461) +++ head/lib/libz/Versions.def Thu Oct 31 18:44:40 2013 (r257462) @@ -1,4 +1,4 @@ -# $FreeBSD: head/lib/libz/Versions.def 205486 2010-03-22 22:12:27Z delphij $ +# $FreeBSD$ ZLIB_1.2.4.0 { }; Modified: head/lib/libz/zopen.c ============================================================================== --- head/lib/libz/zopen.c Thu Oct 31 18:11:50 2013 (r257461) +++ head/lib/libz/zopen.c Thu Oct 31 18:44:40 2013 (r257462) @@ -3,7 +3,7 @@ */ #include -__FBSDID("$FreeBSD: head/lib/libz/zopen.c 84228 2001-09-30 22:39:00Z dillon $"); +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 18:53:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D29563B; Thu, 31 Oct 2013 18:53:14 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0ED284F; Thu, 31 Oct 2013 18:53:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VIrEtC013760; Thu, 31 Oct 2013 18:53:14 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VIrEPU013759; Thu, 31 Oct 2013 18:53:14 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310311853.r9VIrEPU013759@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Oct 2013 18:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257463 - head/contrib/binutils/binutils X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 18:53:14 -0000 Author: sbruno Date: Thu Oct 31 18:53:13 2013 New Revision: 257463 URL: http://svnweb.freebsd.org/changeset/base/257463 Log: Queisce warning about attempting to add char * together and use explicit array indexing to indicate what is meant to be done Modified: head/contrib/binutils/binutils/readelf.c Modified: head/contrib/binutils/binutils/readelf.c ============================================================================== --- head/contrib/binutils/binutils/readelf.c Thu Oct 31 18:44:40 2013 (r257462) +++ head/contrib/binutils/binutils/readelf.c Thu Oct 31 18:53:13 2013 (r257463) @@ -7118,7 +7118,7 @@ process_symbol_table (FILE *file) n = print_vma (si, DEC_5); if (n < 5) - fputs (" " + n, stdout); + fputs (&" "[n], stdout); printf (" %3lu: ", hn); print_vma (psym->st_value, LONG_HEX); putchar (' '); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 18:53:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6D8E678E; Thu, 31 Oct 2013 18:53:40 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48E772856; Thu, 31 Oct 2013 18:53:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VIreuM013832; Thu, 31 Oct 2013 18:53:40 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VIreRs013831; Thu, 31 Oct 2013 18:53:40 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310311853.r9VIreRs013831@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Oct 2013 18:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257464 - head/contrib/binutils/opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 18:53:40 -0000 Author: sbruno Date: Thu Oct 31 18:53:39 2013 New Revision: 257464 URL: http://svnweb.freebsd.org/changeset/base/257464 Log: Queisce warning about attempting to add char * together and use explicit array indexing to indicate what is meant to be done Modified: head/contrib/binutils/opcodes/i386-dis.c Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Thu Oct 31 18:53:13 2013 (r257463) +++ head/contrib/binutils/opcodes/i386-dis.c Thu Oct 31 18:53:39 2013 (r257464) @@ -3474,7 +3474,7 @@ static bfd_vma start_pc; * The function returns the length of this instruction in bytes. */ -static char intel_syntax; +static int intel_syntax; static char open_char; static char close_char; static char separator_char; @@ -3547,7 +3547,7 @@ print_insn (bfd_vma pc, disassemble_info else address_mode = mode_32bit; - if (intel_syntax == (char) -1) + if (intel_syntax == -1) intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax || info->mach == bfd_mach_x86_64_intel_syntax); @@ -4326,7 +4326,7 @@ dofloat (int sizeflag) static void OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED) { - oappend ("%st" + intel_syntax); + oappend (&"%st"[intel_syntax]); } static void @@ -4677,32 +4677,32 @@ append_seg (void) if (prefixes & PREFIX_CS) { used_prefixes |= PREFIX_CS; - oappend ("%cs:" + intel_syntax); + oappend (&"%cs:"[intel_syntax]); } if (prefixes & PREFIX_DS) { used_prefixes |= PREFIX_DS; - oappend ("%ds:" + intel_syntax); + oappend (&"%ds:"[intel_syntax]); } if (prefixes & PREFIX_SS) { used_prefixes |= PREFIX_SS; - oappend ("%ss:" + intel_syntax); + oappend (&"%ss:"[intel_syntax]); } if (prefixes & PREFIX_ES) { used_prefixes |= PREFIX_ES; - oappend ("%es:" + intel_syntax); + oappend (&"%es:"[intel_syntax]); } if (prefixes & PREFIX_FS) { used_prefixes |= PREFIX_FS; - oappend ("%fs:" + intel_syntax); + oappend (&"%fs:"[intel_syntax]); } if (prefixes & PREFIX_GS) { used_prefixes |= PREFIX_GS; - oappend ("%gs:" + intel_syntax); + oappend (&"%gs:"[intel_syntax]); } } @@ -5474,7 +5474,7 @@ OP_I (int bytemode, int sizeflag) op &= mask; scratchbuf[0] = '$'; print_operand_value (scratchbuf + 1, 1, op); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); scratchbuf[0] = '\0'; } @@ -5525,7 +5525,7 @@ OP_I64 (int bytemode, int sizeflag) op &= mask; scratchbuf[0] = '$'; print_operand_value (scratchbuf + 1, 1, op); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); scratchbuf[0] = '\0'; } @@ -5575,7 +5575,7 @@ OP_sI (int bytemode, int sizeflag) scratchbuf[0] = '$'; print_operand_value (scratchbuf + 1, 1, op); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5755,7 +5755,7 @@ OP_ESreg (int code, int sizeflag) intel_operand_size (b_mode, sizeflag); } } - oappend ("%es:" + intel_syntax); + oappend (&"%es:"[intel_syntax]); ptr_reg (code, sizeflag); } @@ -5805,7 +5805,7 @@ OP_C (int dummy ATTRIBUTE_UNUSED, int si add = 8; } sprintf (scratchbuf, "%%cr%d", modrm.reg + add); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5826,7 +5826,7 @@ static void OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED) { sprintf (scratchbuf, "%%tr%d", modrm.reg); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5852,7 +5852,7 @@ OP_MMX (int bytemode ATTRIBUTE_UNUSED, i } else sprintf (scratchbuf, "%%mm%d", modrm.reg); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5863,7 +5863,7 @@ OP_XMM (int bytemode ATTRIBUTE_UNUSED, i if (rex & REX_R) add = 8; sprintf (scratchbuf, "%%xmm%d", modrm.reg + add); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5895,7 +5895,7 @@ OP_EM (int bytemode, int sizeflag) } else sprintf (scratchbuf, "%%mm%d", modrm.rm); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } /* cvt* are the only instructions in sse2 which have @@ -5922,7 +5922,7 @@ OP_EMC (int bytemode, int sizeflag) codep++; used_prefixes |= (prefixes & PREFIX_DATA); sprintf (scratchbuf, "%%mm%d", modrm.rm); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5930,7 +5930,7 @@ OP_MXC (int bytemode ATTRIBUTE_UNUSED, i { used_prefixes |= (prefixes & PREFIX_DATA); sprintf (scratchbuf, "%%mm%d", modrm.reg); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -5950,7 +5950,7 @@ OP_EX (int bytemode, int sizeflag) MODRM_CHECK; codep++; sprintf (scratchbuf, "%%xmm%d", modrm.rm + add); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void @@ -6547,7 +6547,7 @@ static void XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED) { sprintf (scratchbuf, "%%xmm%d", reg); - oappend (scratchbuf + intel_syntax); + oappend (&scratchbuf[intel_syntax]); } static void From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 19:09:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40DB5198 for ; Thu, 31 Oct 2013 19:09:18 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5824296F for ; Thu, 31 Oct 2013 19:09:17 +0000 (UTC) Received: (qmail 81027 invoked from network); 31 Oct 2013 19:39:25 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2013 19:39:25 -0000 Message-ID: <5272AAC4.4030700@freebsd.org> Date: Thu, 31 Oct 2013 20:08:52 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Luigi Rizzo Subject: Re: svn commit: r257455 - head/sys/net References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> In-Reply-To: <20131031180336.GA62132@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 19:09:18 -0000 On 31.10.2013 19:03, Luigi Rizzo wrote: > On Thu, Oct 31, 2013 at 03:46:10PM +0000, Andre Oppermann wrote: >> Author: andre >> Date: Thu Oct 31 15:46:10 2013 >> New Revision: 257455 >> URL: http://svnweb.freebsd.org/changeset/base/257455 >> >> Log: >> Make struct ifnet readable and comprehensible again by grouping >> and ordering related variables, fields and locks next to each >> other. Add more comments to variables. > > >> Over time 'ifnet' has accumlated a lot of additional pointers and >> functionality in an unstructured way making it quite hard to read >> and understand while obfuscating relationships between fields and >> variables. >> >> Quantify the structure size and how bloated it has become. >> >> This is only a mechanical change in preparation for upcoming >> work to make ifnet opaque to drivers and to separate out the >> interface queuing. > > as you do the above I think it would make sense to replace > all int/short/long with fixed-size fields as appropriate > (and large enough) to make it easier to reason about things > such as 'how many flags can i stuff into a field'. > > The "large enough" part refers to two things: > - bitfields containing flags or capabilities have a tendency > to overflow (not just in freebsd, linux has the same) > requiring KBI changes. We should probably go for 64 bits > unless there are compelling space reasons (not for ifnet). Gleb will handle most of that and it is going to be part of the making ifnet opaque to drivers. > - it is useful if certain opaque fields (flow ids, cookies...) > can store pointers. Once again, make them at least 64 bit helps A number of mbuf header fields have this property now. :) -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 19:27:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E651A95C; Thu, 31 Oct 2013 19:27:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE6D52AFF; Thu, 31 Oct 2013 19:27:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B8649B91A; Thu, 31 Oct 2013 15:27:11 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r257376 - head/usr.bin/netstat Date: Thu, 31 Oct 2013 14:02:56 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201310300813.r9U8DhT5078297@svn.freebsd.org> In-Reply-To: <201310300813.r9U8DhT5078297@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201310311402.56097.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 31 Oct 2013 15:27:11 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 19:27:13 -0000 On Wednesday, October 30, 2013 4:13:43 am Gleb Smirnoff wrote: > Author: glebius > Date: Wed Oct 30 08:13:42 2013 > New Revision: 257376 > URL: http://svnweb.freebsd.org/changeset/base/257376 > > Log: > 'netstat -i' no longer supports working on a vmcore. Please remove it from crashinfo then. It would be nice to avoid breaking the commands in crashinfo unnecessarily when possible. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 19:27:35 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 35CA5BF7; Thu, 31 Oct 2013 19:27:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCE382B20; Thu, 31 Oct 2013 19:27:34 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Vbxtw-0006Mx-Du; Thu, 31 Oct 2013 19:27:28 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9VJRPpt055963; Thu, 31 Oct 2013 13:27:25 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX191gGP2cWm/TwcHs47pwYOk Subject: Re: svn commit: r257455 - head/sys/net From: Ian Lepore To: Andre Oppermann In-Reply-To: <5272AAC4.4030700@freebsd.org> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Thu, 31 Oct 2013 13:27:25 -0600 Message-ID: <1383247645.31172.29.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 19:27:35 -0000 On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote: > On 31.10.2013 19:03, Luigi Rizzo wrote: > > On Thu, Oct 31, 2013 at 03:46:10PM +0000, Andre Oppermann wrote: > >> Author: andre > >> Date: Thu Oct 31 15:46:10 2013 > >> New Revision: 257455 > >> URL: http://svnweb.freebsd.org/changeset/base/257455 > >> > >> Log: > >> Make struct ifnet readable and comprehensible again by grouping > >> and ordering related variables, fields and locks next to each > >> other. Add more comments to variables. > > > > > >> Over time 'ifnet' has accumlated a lot of additional pointers and > >> functionality in an unstructured way making it quite hard to read > >> and understand while obfuscating relationships between fields and > >> variables. > >> > >> Quantify the structure size and how bloated it has become. > >> > >> This is only a mechanical change in preparation for upcoming > >> work to make ifnet opaque to drivers and to separate out the > >> interface queuing. > > > > as you do the above I think it would make sense to replace > > all int/short/long with fixed-size fields as appropriate > > (and large enough) to make it easier to reason about things > > such as 'how many flags can i stuff into a field'. > > > > The "large enough" part refers to two things: > > - bitfields containing flags or capabilities have a tendency > > to overflow (not just in freebsd, linux has the same) > > requiring KBI changes. We should probably go for 64 bits > > unless there are compelling space reasons (not for ifnet). > > Gleb will handle most of that and it is going to be part of the making > ifnet opaque to drivers. > > > - it is useful if certain opaque fields (flow ids, cookies...) > > can store pointers. Once again, make them at least 64 bit helps > > A number of mbuf header fields have this property now. :) > Is there any chance all this reworking might get us to a position where the protocol header in an mbuf doesn't have to be 32-bit aligned anymore? We pay a pretty heavy price for that requirement in the drivers of the least capable hardware we support, the systems that have the least horsepower to spare to make an extra copy of each packet to realign it. -- Ian From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 19:55:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB7C5E9C; Thu, 31 Oct 2013 19:55:36 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A86362D52; Thu, 31 Oct 2013 19:55:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VJtaLS035193; Thu, 31 Oct 2013 19:55:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VJtaiE035192; Thu, 31 Oct 2013 19:55:36 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310311955.r9VJtaiE035192@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 31 Oct 2013 19:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257465 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 19:55:36 -0000 Author: trociny Date: Thu Oct 31 19:55:36 2013 New Revision: 257465 URL: http://svnweb.freebsd.org/changeset/base/257465 Log: Add myself as a ports committer Approved by: bdrewery (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Oct 31 18:53:39 2013 (r257464) +++ head/share/misc/committers-ports.dot Thu Oct 31 19:55:36 2013 (r257465) @@ -207,6 +207,7 @@ tmclaugh [label="Tom McLaughlin\ntmclaug tota [label="TAKATSU Tomonari\ntota@FreeBSD.org\n2009/03/30"] trasz [label="Edward Tomasz Napierala\ntrasz@FreeBSD.org\n2007/04/12"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2004/07/06"] +trociny [label="Mikolaj Golub\ntrociny@FreeBSD.org\n2013/10/17"] uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] vg [label="Veniamin Gvozdikov\nvg@FreeBSD.org\n2013/06/11"] @@ -246,6 +247,7 @@ avilla -> jhale avilla -> rakuco bdrewery -> dbn +bdrewery -> trociny bapt -> bdrewery bapt -> eadler From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:03:15 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CAC7E300; Thu, 31 Oct 2013 20:03:15 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 898932DEE; Thu, 31 Oct 2013 20:03:15 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 06CED7300A; Thu, 31 Oct 2013 21:05:03 +0100 (CET) Date: Thu, 31 Oct 2013 21:05:03 +0100 From: Luigi Rizzo To: Ian Lepore Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131031200502.GB83212@onelab2.iet.unipi.it> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1383247645.31172.29.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:03:15 -0000 On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: ... > Is there any chance all this reworking might get us to a position where > the protocol header in an mbuf doesn't have to be 32-bit aligned > anymore? We pay a pretty heavy price for that requirement in the > drivers of the least capable hardware we support, the systems that have > the least horsepower to spare to make an extra copy of each packet to > realign it. So are you suggesting to use some 'copy_unaligned_32()' function/macro to access 32-bit protocol fields in the network stack ? (16-bit entries should not be an issue) cheers luigi From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:04:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3186248F; Thu, 31 Oct 2013 20:04:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1009D2DFB; Thu, 31 Oct 2013 20:04:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VK40ox038595; Thu, 31 Oct 2013 20:04:00 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VK40mL038585; Thu, 31 Oct 2013 20:04:00 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310312004.r9VK40mL038585@svn.freebsd.org> From: Sean Bruno Date: Thu, 31 Oct 2013 20:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257466 - in head/contrib/libpcap: . bpf/net pcap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:04:01 -0000 Author: sbruno Date: Thu Oct 31 20:03:59 2013 New Revision: 257466 URL: http://svnweb.freebsd.org/changeset/base/257466 Log: Integrate github revision 0446821e49224c6a29be28760cc9c4cc14f56d8a as suggested by upstream https://github.com/the-tcpdump-group/libpcap/issues/327 Quiesce assignment warnings by use of const Modified: head/contrib/libpcap/bpf/net/bpf_filter.c head/contrib/libpcap/bpf_dump.c head/contrib/libpcap/bpf_image.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/pcap.h Modified: head/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- head/contrib/libpcap/bpf/net/bpf_filter.c Thu Oct 31 19:55:36 2013 (r257465) +++ head/contrib/libpcap/bpf/net/bpf_filter.c Thu Oct 31 20:03:59 2013 (r257466) @@ -209,8 +209,8 @@ m_xhalf(m, k, err) */ u_int bpf_filter(pc, p, wirelen, buflen) - register struct bpf_insn *pc; - register u_char *p; + register const struct bpf_insn *pc; + register const u_char *p; u_int wirelen; register u_int buflen; { Modified: head/contrib/libpcap/bpf_dump.c ============================================================================== --- head/contrib/libpcap/bpf_dump.c Thu Oct 31 19:55:36 2013 (r257465) +++ head/contrib/libpcap/bpf_dump.c Thu Oct 31 20:03:59 2013 (r257466) @@ -31,7 +31,7 @@ static const char rcsid[] _U_ = #include void -bpf_dump(struct bpf_program *p, int option) +bpf_dump(const struct bpf_program *p, int option) { const struct bpf_insn *insn; int i; Modified: head/contrib/libpcap/bpf_image.c ============================================================================== --- head/contrib/libpcap/bpf_image.c Thu Oct 31 19:55:36 2013 (r257465) +++ head/contrib/libpcap/bpf_image.c Thu Oct 31 20:03:59 2013 (r257466) @@ -53,7 +53,7 @@ static const char rcsid[] _U_ = char * bpf_image(p, n) - struct bpf_insn *p; + const struct bpf_insn *p; int n; { int v; Modified: head/contrib/libpcap/pcap/bpf.h ============================================================================== --- head/contrib/libpcap/pcap/bpf.h Thu Oct 31 19:55:36 2013 (r257465) +++ head/contrib/libpcap/pcap/bpf.h Thu Oct 31 20:03:59 2013 (r257466) @@ -1285,7 +1285,7 @@ struct bpf_insn { #if __STDC__ || defined(__cplusplus) extern int bpf_validate(const struct bpf_insn *, int); -extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); +extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); #else extern int bpf_validate(); extern u_int bpf_filter(); Modified: head/contrib/libpcap/pcap/pcap.h ============================================================================== --- head/contrib/libpcap/pcap/pcap.h Thu Oct 31 19:55:36 2013 (r257465) +++ head/contrib/libpcap/pcap/pcap.h Thu Oct 31 20:03:59 2013 (r257466) @@ -409,11 +409,11 @@ const char *pcap_lib_version(void); * declared when we build pcap-bpf.c. */ #ifndef __NetBSD__ -u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); +u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); #endif int bpf_validate(const struct bpf_insn *f, int len); -char *bpf_image(struct bpf_insn *, int); -void bpf_dump(struct bpf_program *, int); +char *bpf_image(const struct bpf_insn *, int); +void bpf_dump(const struct bpf_program *, int); #if defined(WIN32) From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:15:18 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38446BC0; Thu, 31 Oct 2013 20:15:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD9B2EF9; Thu, 31 Oct 2013 20:15:17 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Vbye7-000Dae-FP; Thu, 31 Oct 2013 20:15:11 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9VKF8nB056001; Thu, 31 Oct 2013 14:15:08 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/81FNDHYA5VaNUVeHPedmI Subject: Re: svn commit: r257455 - head/sys/net From: Ian Lepore To: Luigi Rizzo In-Reply-To: <20131031200502.GB83212@onelab2.iet.unipi.it> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> Content-Type: text/plain; charset="us-ascii" Date: Thu, 31 Oct 2013 14:15:08 -0600 Message-ID: <1383250508.31172.38.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:15:18 -0000 On Thu, 2013-10-31 at 21:05 +0100, Luigi Rizzo wrote: > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: > ... > > Is there any chance all this reworking might get us to a position where > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > anymore? We pay a pretty heavy price for that requirement in the > > drivers of the least capable hardware we support, the systems that have > > the least horsepower to spare to make an extra copy of each packet to > > realign it. > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to > access 32-bit protocol fields in the network stack ? > (16-bit entries should not be an issue) > > cheers > luigi Or if not that (I have no idea how frequently those fields are accessed and what the performance penalty would be on systems moving a LOT of packets), then a compromise might be a flag the driver can set to say it may provide unaligned incoming packets. Then we could have common code at just one place in the network stack to split the mbuf and realign-copy just the protocol header part to a new mbuf and attach it to the front of the chain. That would minimize both duplicated code and the amount of data that has to be copied, and would put knowledge like "how big is the protocol header that needs copying?" in a place that knows more about protocols. I know pretty much nothing about what happens in the network stack after I feed a packet to if_input(), so maybe this is all impractical. But I also know that ARM systems with strict alignment constraints spend a lot of time copying the entire contents of every incoming packet to realign it, and it would be a lot better if they were able to DMA directly into an mbuf cluster that can handed up the stack. Even if "copy the entire packet" is the only thing if_input() could do, there might still be some benefit in having one common piece of code for it. -- Ian From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:30:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 844EA209; Thu, 31 Oct 2013 20:30:27 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70FB5200E; Thu, 31 Oct 2013 20:30:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKURuj047823; Thu, 31 Oct 2013 20:30:27 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKURdB047822; Thu, 31 Oct 2013 20:30:27 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310312030.r9VKURdB047822@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 31 Oct 2013 20:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257468 - stable/10/sbin/hastd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:30:27 -0000 Author: trociny Date: Thu Oct 31 20:30:26 2013 New Revision: 257468 URL: http://svnweb.freebsd.org/changeset/base/257468 Log: MFC r257154: Merging local and remote bitmaps must be protected by hr_amp lock. This is believed to fix hastd crashes, which might occur during synchronization, triggered by the failed assertion: Assertion failed: (amp->am_memtab[ext] > 0), function activemap_write_complete, file activemap.c, line 351. Approved by: re (glebius) Modified: stable/10/sbin/hastd/primary.c Directory Properties: stable/10/sbin/hastd/ (props changed) Modified: stable/10/sbin/hastd/primary.c ============================================================================== --- stable/10/sbin/hastd/primary.c Thu Oct 31 20:12:37 2013 (r257467) +++ stable/10/sbin/hastd/primary.c Thu Oct 31 20:30:26 2013 (r257468) @@ -781,6 +781,7 @@ init_remote(struct hast_resource *res, s free(map); goto close; } + mtx_lock(&res->hr_amp_lock); /* * Merge local and remote bitmaps. */ @@ -790,7 +791,6 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ - mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:30:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A553335F; Thu, 31 Oct 2013 20:30:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9271C2018; Thu, 31 Oct 2013 20:30:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKUuiW048439; Thu, 31 Oct 2013 20:30:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKUugj048438; Thu, 31 Oct 2013 20:30:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310312030.r9VKUugj048438@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 31 Oct 2013 20:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257469 - head/usr.sbin/crashinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:30:56 -0000 Author: glebius Date: Thu Oct 31 20:30:56 2013 New Revision: 257469 URL: http://svnweb.freebsd.org/changeset/base/257469 Log: Remove 'netstat -i' from crashinfo, as this no longer is supported. Modified: head/usr.sbin/crashinfo/crashinfo.sh Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Thu Oct 31 20:30:26 2013 (r257468) +++ head/usr.sbin/crashinfo/crashinfo.sh Thu Oct 31 20:30:56 2013 (r257469) @@ -268,12 +268,6 @@ netstat -M $VMCORE -N $KERNEL -m echo echo "------------------------------------------------------------------------" -echo "netstat -idW" -echo -netstat -M $VMCORE -N $KERNEL -idW -echo - -echo "------------------------------------------------------------------------" echo "netstat -anr" echo netstat -M $VMCORE -N $KERNEL -anr From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:31:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3867A499; Thu, 31 Oct 2013 20:31:17 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 250012022; Thu, 31 Oct 2013 20:31:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKVHor048537; Thu, 31 Oct 2013 20:31:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKVHSS048536; Thu, 31 Oct 2013 20:31:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310312031.r9VKVHSS048536@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 31 Oct 2013 20:31:16 +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: r257470 - stable/9/sbin/hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:31:17 -0000 Author: trociny Date: Thu Oct 31 20:31:16 2013 New Revision: 257470 URL: http://svnweb.freebsd.org/changeset/base/257470 Log: MFC r257154: Merging local and remote bitmaps must be protected by hr_amp lock. This is believed to fix hastd crashes, which might occur during synchronization, triggered by the failed assertion: Assertion failed: (amp->am_memtab[ext] > 0), function activemap_write_complete, file activemap.c, line 351. Modified: stable/9/sbin/hastd/primary.c Directory Properties: stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastd/primary.c ============================================================================== --- stable/9/sbin/hastd/primary.c Thu Oct 31 20:30:56 2013 (r257469) +++ stable/9/sbin/hastd/primary.c Thu Oct 31 20:31:16 2013 (r257470) @@ -781,6 +781,7 @@ init_remote(struct hast_resource *res, s free(map); goto close; } + mtx_lock(&res->hr_amp_lock); /* * Merge local and remote bitmaps. */ @@ -790,7 +791,6 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ - mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:32:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 030E1601; Thu, 31 Oct 2013 20:32:12 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3DA3205C; Thu, 31 Oct 2013 20:32:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKWBie048754; Thu, 31 Oct 2013 20:32:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKWBCk048753; Thu, 31 Oct 2013 20:32:11 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310312032.r9VKWBCk048753@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 31 Oct 2013 20:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r257471 - stable/8/sbin/hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:32:12 -0000 Author: trociny Date: Thu Oct 31 20:32:11 2013 New Revision: 257471 URL: http://svnweb.freebsd.org/changeset/base/257471 Log: MFC r257154: Merging local and remote bitmaps must be protected by hr_amp lock. This is believed to fix hastd crashes, which might occur during synchronization, triggered by the failed assertion: Assertion failed: (amp->am_memtab[ext] > 0), function activemap_write_complete, file activemap.c, line 351. Modified: stable/8/sbin/hastd/primary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Thu Oct 31 20:31:16 2013 (r257470) +++ stable/8/sbin/hastd/primary.c Thu Oct 31 20:32:11 2013 (r257471) @@ -781,6 +781,7 @@ init_remote(struct hast_resource *res, s free(map); goto close; } + mtx_lock(&res->hr_amp_lock); /* * Merge local and remote bitmaps. */ @@ -790,7 +791,6 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ - mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:33:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2DE72771; Thu, 31 Oct 2013 20:33:22 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1CE206C; Thu, 31 Oct 2013 20:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKXLit048956; Thu, 31 Oct 2013 20:33:21 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKXLdV048955; Thu, 31 Oct 2013 20:33:21 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201310312033.r9VKXLdV048955@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 31 Oct 2013 20:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257472 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:33:22 -0000 Author: emax Date: Thu Oct 31 20:33:21 2013 New Revision: 257472 URL: http://svnweb.freebsd.org/changeset/base/257472 Log: Rate limit (to once per minute) "Listen queue overflow" message in sonewconn(). Reviewed by: scottl, lstewart Obtained from: Netflix, Inc MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Oct 31 20:32:11 2013 (r257471) +++ head/sys/kern/uipc_socket.c Thu Oct 31 20:33:21 2013 (r257472) @@ -486,6 +486,10 @@ SYSCTL_INT(_regression, OID_AUTO, sonewc struct socket * sonewconn(struct socket *head, int connstatus) { + static struct timeval lastover; + static struct timeval overinterval = { 60, 0 }; + static int overcount; + struct socket *so; int over; @@ -497,9 +501,17 @@ sonewconn(struct socket *head, int conns #else if (over) { #endif - log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " - "%i already in queue awaiting acceptance\n", - __func__, head->so_pcb, head->so_qlen); + overcount++; + + if (ratecheck(&lastover, &overinterval)) { + log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " + "%i already in queue awaiting acceptance " + "(%d occurrences)\n", + __func__, head->so_pcb, head->so_qlen, overcount); + + overcount = 0; + } + return (NULL); } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:42:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 93C16AE8; Thu, 31 Oct 2013 20:42:48 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F21C210A; Thu, 31 Oct 2013 20:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VKgmc1052202; Thu, 31 Oct 2013 20:42:48 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VKgmoT052201; Thu, 31 Oct 2013 20:42:48 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201310312042.r9VKgmoT052201@svn.freebsd.org> From: Andreas Tobler Date: Thu, 31 Oct 2013 20:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257473 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:42:48 -0000 Author: andreast Date: Thu Oct 31 20:42:47 2013 New Revision: 257473 URL: http://svnweb.freebsd.org/changeset/base/257473 Log: Ouch, do the shift properly. An uin64_t needs the right postfix when shifting. Modified: head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Thu Oct 31 20:33:21 2013 (r257472) +++ head/sys/powerpc/pseries/mmu_phyp.c Thu Oct 31 20:42:47 2013 (r257473) @@ -166,7 +166,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t } } moea64_large_page_shift = shift; - moea64_large_page_size = 1 << shift; + moea64_large_page_size = 1ULL << shift; } moea64_mid_bootstrap(mmup, kernelstart, kernelend); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 20:49:18 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2BB2FAE; Thu, 31 Oct 2013 20:49:17 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEC66217B; Thu, 31 Oct 2013 20:49:17 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r9VKnGTB057450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Oct 2013 13:49:17 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r9VKnGCW057449; Thu, 31 Oct 2013 13:49:16 -0700 (PDT) (envelope-from jmg) Date: Thu, 31 Oct 2013 13:49:16 -0700 From: John-Mark Gurney To: Luigi Rizzo Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131031204916.GF58155@funkthat.com> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131031200502.GB83212@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 31 Oct 2013 13:49:17 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 20:49:18 -0000 Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100: > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: > ... > > Is there any chance all this reworking might get us to a position where > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > anymore? We pay a pretty heavy price for that requirement in the > > drivers of the least capable hardware we support, the systems that have > > the least horsepower to spare to make an extra copy of each packet to > > realign it. > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to > access 32-bit protocol fields in the network stack ? > (16-bit entries should not be an issue) my idea has been to make a change to the various ip/tcp/udp layers that is dependant upon __NO_STRICT_ALIGNMENT and if we do require strict alignment to copy the header to a stack buffer to align the data... Apparently someone started work on this and created IP_HDR_ALIGNED_P, though it's apparently only used in if_bridge, and why it's necessary, I'm not sure... I know ARMv4 takes a serious performance hit because of this... Often the machines that doesn't support unaligned accesses also have bad DMA engines that can't do DMA to two byte boundaries forcing us to copy the packet by using bounce pages... I haven't audited AVILA to see if it has the issue, but I know that the TS-7200 port I was working on has this issue... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 21:11:53 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0606E9D; Thu, 31 Oct 2013 21:11:53 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 55B9F23BA; Thu, 31 Oct 2013 21:11:50 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 80A3B7300A; Thu, 31 Oct 2013 22:13:37 +0100 (CET) Date: Thu, 31 Oct 2013 22:13:37 +0100 From: Luigi Rizzo To: John-Mark Gurney Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131031211337.GA83561@onelab2.iet.unipi.it> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> <20131031204916.GF58155@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131031204916.GF58155@funkthat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 21:11:53 -0000 On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote: > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100: > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: > > ... > > > Is there any chance all this reworking might get us to a position where > > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > > anymore? We pay a pretty heavy price for that requirement in the > > > drivers of the least capable hardware we support, the systems that have > > > the least horsepower to spare to make an extra copy of each packet to > > > realign it. > > > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to > > access 32-bit protocol fields in the network stack ? > > (16-bit entries should not be an issue) > > my idea has been to make a change to the various ip/tcp/udp layers > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require > strict alignment to copy the header to a stack buffer to align the > data... I'd rather use accessors functions/macros to read/write the unaligned headers so we can hide the #ifdefs in only one place. The copy to a stack buffer is probably useful even for readability regardless of alignment (i do this in ipfw so i parse the packet only once, and those values are used often), but we should be careful to keep the copy in sync with the original in places where those headers are modified (NAT, ipfw fwd, maybe somewhere else ?) cheers luigi From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:14:59 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 91182ACB; Thu, 31 Oct 2013 22:14:59 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF2227BE; Thu, 31 Oct 2013 22:14:59 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r9VMEwJm058737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Oct 2013 15:14:58 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r9VMEvYL058735; Thu, 31 Oct 2013 15:14:57 -0700 (PDT) (envelope-from jmg) Date: Thu, 31 Oct 2013 15:14:57 -0700 From: John-Mark Gurney To: Luigi Rizzo Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131031221457.GG58155@funkthat.com> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> <20131031204916.GF58155@funkthat.com> <20131031211337.GA83561@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131031211337.GA83561@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 31 Oct 2013 15:14:58 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:14:59 -0000 Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100: > On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote: > > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100: > > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: > > > ... > > > > Is there any chance all this reworking might get us to a position where > > > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > > > anymore? We pay a pretty heavy price for that requirement in the > > > > drivers of the least capable hardware we support, the systems that have > > > > the least horsepower to spare to make an extra copy of each packet to > > > > realign it. > > > > > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to > > > access 32-bit protocol fields in the network stack ? > > > (16-bit entries should not be an issue) > > > > my idea has been to make a change to the various ip/tcp/udp layers > > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require > > strict alignment to copy the header to a stack buffer to align the > > data... > > I'd rather use accessors functions/macros to read/write > the unaligned headers so we can hide the #ifdefs in only > one place. I am/was trying to prevent massive code curn... > The copy to a stack buffer is probably useful even for readability Oh, I also realized I left out another part of it... void ip_input(struct mbuf *m) { #ifndef __NO_STRICT_ALIGNMENT struct ip tmpip; #endif struct ip *ip = NULL; #ifndef __NO_STRICT_ALIGNMENT bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip); ip = &tmpip; #else ip = mtod(m, struct ip *); #endif } > regardless of alignment (i do this in ipfw so i parse the > packet only once, and those values are used often), > but we should be careful to keep the copy in > sync with the original in places where those headers are modified > (NAT, ipfw fwd, maybe somewhere else ?) If you modify the packet, you need to be careful to write back the data when needed, i.e. passing the mbuf to another layer or returning.. But that isn't anything too different than other functions... Looks like I'll have to revive my TS-7200 port for testing as npe on AVILA apparently can handle the slightly odd alignment... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:17:30 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76D14EEA for ; Thu, 31 Oct 2013 22:17:30 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAE0B2805 for ; Thu, 31 Oct 2013 22:17:29 +0000 (UTC) Received: (qmail 81700 invoked from network); 31 Oct 2013 22:47:36 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2013 22:47:36 -0000 Message-ID: <5272D6E0.8050709@freebsd.org> Date: Thu, 31 Oct 2013 23:17:04 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r257455 - head/sys/net References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> In-Reply-To: <1383247645.31172.29.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:17:30 -0000 On 31.10.2013 20:27, Ian Lepore wrote: > On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote: >> On 31.10.2013 19:03, Luigi Rizzo wrote: >>> On Thu, Oct 31, 2013 at 03:46:10PM +0000, Andre Oppermann wrote: >>>> Author: andre >>>> Date: Thu Oct 31 15:46:10 2013 >>>> New Revision: 257455 >>>> URL: http://svnweb.freebsd.org/changeset/base/257455 >>>> >>>> Log: >>>> Make struct ifnet readable and comprehensible again by grouping >>>> and ordering related variables, fields and locks next to each >>>> other. Add more comments to variables. >>> >>> >>>> Over time 'ifnet' has accumlated a lot of additional pointers and >>>> functionality in an unstructured way making it quite hard to read >>>> and understand while obfuscating relationships between fields and >>>> variables. >>>> >>>> Quantify the structure size and how bloated it has become. >>>> >>>> This is only a mechanical change in preparation for upcoming >>>> work to make ifnet opaque to drivers and to separate out the >>>> interface queuing. >>> >>> as you do the above I think it would make sense to replace >>> all int/short/long with fixed-size fields as appropriate >>> (and large enough) to make it easier to reason about things >>> such as 'how many flags can i stuff into a field'. >>> >>> The "large enough" part refers to two things: >>> - bitfields containing flags or capabilities have a tendency >>> to overflow (not just in freebsd, linux has the same) >>> requiring KBI changes. We should probably go for 64 bits >>> unless there are compelling space reasons (not for ifnet). >> >> Gleb will handle most of that and it is going to be part of the making >> ifnet opaque to drivers. >> >>> - it is useful if certain opaque fields (flow ids, cookies...) >>> can store pointers. Once again, make them at least 64 bit helps >> >> A number of mbuf header fields have this property now. :) > > Is there any chance all this reworking might get us to a position where > the protocol header in an mbuf doesn't have to be 32-bit aligned > anymore? We pay a pretty heavy price for that requirement in the > drivers of the least capable hardware we support, the systems that have > the least horsepower to spare to make an extra copy of each packet to > realign it. That's a totally different issue. Here we're talking about kernel structures including the fields in struct mbuf. It is totally not related to any payload packet headers inside the mbuf data section. The problem you're complaining about is the epic design mistake of the ethernet header neither being a power of two nor divisible by 4 or 8 bytes. It is a ridiculous 14 bytes. Many DMA engines are capable of starting on any byte. Some (popular) are not. If they are, the start of the payload can be by shifted by two so that the IP headers are 32bit aligned in memory. If that is not possible either the payload has to be copy-aligned or direct payload to structure casting must be disallowed, or indirected through a macro. -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:29:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C979F442 for ; Thu, 31 Oct 2013 22:29:31 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B01728B4 for ; Thu, 31 Oct 2013 22:29:30 +0000 (UTC) Received: (qmail 81738 invoked from network); 31 Oct 2013 22:59:37 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2013 22:59:37 -0000 Message-ID: <5272D9B2.2060907@freebsd.org> Date: Thu, 31 Oct 2013 23:29:06 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Ian Lepore , Luigi Rizzo Subject: Re: svn commit: r257455 - head/sys/net References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> <1383250508.31172.38.camel@revolution.hippie.lan> In-Reply-To: <1383250508.31172.38.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:29:31 -0000 On 31.10.2013 21:15, Ian Lepore wrote: > On Thu, 2013-10-31 at 21:05 +0100, Luigi Rizzo wrote: >> On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: >> ... >>> Is there any chance all this reworking might get us to a position where >>> the protocol header in an mbuf doesn't have to be 32-bit aligned >>> anymore? We pay a pretty heavy price for that requirement in the >>> drivers of the least capable hardware we support, the systems that have >>> the least horsepower to spare to make an extra copy of each packet to >>> realign it. >> >> So are you suggesting to use some 'copy_unaligned_32()' function/macro to >> access 32-bit protocol fields in the network stack ? >> (16-bit entries should not be an issue) >> >> cheers >> luigi > > Or if not that (I have no idea how frequently those fields are accessed > and what the performance penalty would be on systems moving a LOT of > packets), then a compromise might be a flag the driver can set to say it > may provide unaligned incoming packets. Then we could have common code > at just one place in the network stack to split the mbuf and > realign-copy just the protocol header part to a new mbuf and attach it > to the front of the chain. That would minimize both duplicated code and > the amount of data that has to be copied, and would put knowledge like > "how big is the protocol header that needs copying?" in a place that > knows more about protocols. This is a sensible idea and in fact how some of the drivers already do it internally for strict alignment architectures. > I know pretty much nothing about what happens in the network stack after > I feed a packet to if_input(), so maybe this is all impractical. But I > also know that ARM systems with strict alignment constraints spend a lot > of time copying the entire contents of every incoming packet to realign > it, and it would be a lot better if they were able to DMA directly into > an mbuf cluster that can handed up the stack. Even if "copy the entire > packet" is the only thing if_input() could do, there might still be some > benefit in having one common piece of code for it. We have tons of protocols using direct structure casting into the mbuf payload. Changing them all would be a huge task and in many cases also change the way the code is structured. -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:32:48 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 220A15DF; Thu, 31 Oct 2013 22:32:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6F8C2903; Thu, 31 Oct 2013 22:32:47 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Vc0nG-000J7d-NU; Thu, 31 Oct 2013 22:32:46 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9VMWi23056163; Thu, 31 Oct 2013 16:32:44 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/aHUM40nmY/Jh2abkI+/mf Subject: Re: svn commit: r257455 - head/sys/net From: Ian Lepore To: Andre Oppermann In-Reply-To: <5272D6E0.8050709@freebsd.org> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <5272D6E0.8050709@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Thu, 31 Oct 2013 16:32:43 -0600 Message-ID: <1383258763.31172.46.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:32:48 -0000 On Thu, 2013-10-31 at 23:17 +0100, Andre Oppermann wrote: > On 31.10.2013 20:27, Ian Lepore wrote: > > On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote: > >> On 31.10.2013 19:03, Luigi Rizzo wrote: > >>> On Thu, Oct 31, 2013 at 03:46:10PM +0000, Andre Oppermann wrote: > >>>> Author: andre > >>>> Date: Thu Oct 31 15:46:10 2013 > >>>> New Revision: 257455 > >>>> URL: http://svnweb.freebsd.org/changeset/base/257455 > >>>> > >>>> Log: > >>>> Make struct ifnet readable and comprehensible again by grouping > >>>> and ordering related variables, fields and locks next to each > >>>> other. Add more comments to variables. > >>> > >>> > >>>> Over time 'ifnet' has accumlated a lot of additional pointers and > >>>> functionality in an unstructured way making it quite hard to read > >>>> and understand while obfuscating relationships between fields and > >>>> variables. > >>>> > >>>> Quantify the structure size and how bloated it has become. > >>>> > >>>> This is only a mechanical change in preparation for upcoming > >>>> work to make ifnet opaque to drivers and to separate out the > >>>> interface queuing. > >>> > >>> as you do the above I think it would make sense to replace > >>> all int/short/long with fixed-size fields as appropriate > >>> (and large enough) to make it easier to reason about things > >>> such as 'how many flags can i stuff into a field'. > >>> > >>> The "large enough" part refers to two things: > >>> - bitfields containing flags or capabilities have a tendency > >>> to overflow (not just in freebsd, linux has the same) > >>> requiring KBI changes. We should probably go for 64 bits > >>> unless there are compelling space reasons (not for ifnet). > >> > >> Gleb will handle most of that and it is going to be part of the making > >> ifnet opaque to drivers. > >> > >>> - it is useful if certain opaque fields (flow ids, cookies...) > >>> can store pointers. Once again, make them at least 64 bit helps > >> > >> A number of mbuf header fields have this property now. :) > > > > Is there any chance all this reworking might get us to a position where > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > anymore? We pay a pretty heavy price for that requirement in the > > drivers of the least capable hardware we support, the systems that have > > the least horsepower to spare to make an extra copy of each packet to > > realign it. > > That's a totally different issue. Here we're talking about kernel > structures including the fields in struct mbuf. It is totally not > related to any payload packet headers inside the mbuf data section. > Of course it is. The nature of my message was purely "As long as we're doing big changes...". > The problem you're complaining about is the epic design mistake of > the ethernet header neither being a power of two nor divisible by > 4 or 8 bytes. It is a ridiculous 14 bytes. > Indeed. > Many DMA engines are capable of starting on any byte. Some (popular) > are not. If they are, the start of the payload can be by shifted by > two so that the IP headers are 32bit aligned in memory. If that is > not possible either the payload has to be copy-aligned or direct > payload to structure casting must be disallowed, or indirected through > a macro. > I know of only one modern ARM SoC that's able to DMA network packets on a 2-byte boundary (actually even it requires a 4-byte boundary, but it's willing to stuff the first 16 bits with zeroes and offset everything that follows accordingly). I'm sure there are others, but it's the exception rather than the rule. -- Ian From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:36:01 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4A041833 for ; Thu, 31 Oct 2013 22:36:01 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 91B342920 for ; Thu, 31 Oct 2013 22:36:00 +0000 (UTC) Received: (qmail 81786 invoked from network); 31 Oct 2013 23:06:07 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2013 23:06:07 -0000 Message-ID: <5272DB37.6010801@freebsd.org> Date: Thu, 31 Oct 2013 23:35:35 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: John-Mark Gurney , Luigi Rizzo Subject: Re: svn commit: r257455 - head/sys/net References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> <20131031204916.GF58155@funkthat.com> <20131031211337.GA83561@onelab2.iet.unipi.it> <20131031221457.GG58155@funkthat.com> In-Reply-To: <20131031221457.GG58155@funkthat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:36:01 -0000 On 31.10.2013 23:14, John-Mark Gurney wrote: > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100: >> On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote: >>> Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100: >>>> On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: >>>> ... >>>>> Is there any chance all this reworking might get us to a position where >>>>> the protocol header in an mbuf doesn't have to be 32-bit aligned >>>>> anymore? We pay a pretty heavy price for that requirement in the >>>>> drivers of the least capable hardware we support, the systems that have >>>>> the least horsepower to spare to make an extra copy of each packet to >>>>> realign it. >>>> >>>> So are you suggesting to use some 'copy_unaligned_32()' function/macro to >>>> access 32-bit protocol fields in the network stack ? >>>> (16-bit entries should not be an issue) >>> >>> my idea has been to make a change to the various ip/tcp/udp layers >>> that is dependant upon __NO_STRICT_ALIGNMENT and if we do require >>> strict alignment to copy the header to a stack buffer to align the >>> data... >> >> I'd rather use accessors functions/macros to read/write >> the unaligned headers so we can hide the #ifdefs in only >> one place. > > I am/was trying to prevent massive code curn... > >> The copy to a stack buffer is probably useful even for readability > > Oh, I also realized I left out another part of it... > > void > ip_input(struct mbuf *m) > { > #ifndef __NO_STRICT_ALIGNMENT > struct ip tmpip; > #endif > struct ip *ip = NULL; > > #ifndef __NO_STRICT_ALIGNMENT > bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip); > ip = &tmpip; > #else > ip = mtod(m, struct ip *); > #endif Still massive code churn for all protocols above layer 3. > } >> regardless of alignment (i do this in ipfw so i parse the >> packet only once, and those values are used often), >> but we should be careful to keep the copy in >> sync with the original in places where those headers are modified >> (NAT, ipfw fwd, maybe somewhere else ?) > > If you modify the packet, you need to be careful to write back the > data when needed, i.e. passing the mbuf to another layer or > returning.. But that isn't anything too different than other > functions... Since the beginning and continuing the direct structure casting has been the way to access protocol data. Completely changing this would be a very big change requiring a throughout audit of the kernel. > Looks like I'll have to revive my TS-7200 port for testing as npe on > AVILA apparently can handle the slightly odd alignment... Architectures that have trouble with unaligned access should only be used with RX DMA engines that can 16bit align their writes. ;) Then it's only a call to m_adj before the mbuf is mapped into the RX ring and you're good. -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:39:21 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 19BD99AC; Thu, 31 Oct 2013 22:39:21 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id CB21B2943; Thu, 31 Oct 2013 22:39:18 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 15C6E7300A; Thu, 31 Oct 2013 23:41:06 +0100 (CET) Date: Thu, 31 Oct 2013 23:41:06 +0100 From: Luigi Rizzo To: John-Mark Gurney Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131031224106.GA84783@onelab2.iet.unipi.it> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> <20131031204916.GF58155@funkthat.com> <20131031211337.GA83561@onelab2.iet.unipi.it> <20131031221457.GG58155@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131031221457.GG58155@funkthat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:39:21 -0000 On Thu, Oct 31, 2013 at 03:14:57PM -0700, John-Mark Gurney wrote: > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100: > > On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote: > > > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100: > > > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: > > > > ... > > > > > Is there any chance all this reworking might get us to a position where > > > > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > > > > anymore? We pay a pretty heavy price for that requirement in the > > > > > drivers of the least capable hardware we support, the systems that have > > > > > the least horsepower to spare to make an extra copy of each packet to > > > > > realign it. > > > > > > > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to > > > > access 32-bit protocol fields in the network stack ? > > > > (16-bit entries should not be an issue) > > > > > > my idea has been to make a change to the various ip/tcp/udp layers > > > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require > > > strict alignment to copy the header to a stack buffer to align the > > > data... > > > > I'd rather use accessors functions/macros to read/write > > the unaligned headers so we can hide the #ifdefs in only > > one place. > > I am/was trying to prevent massive code curn... > > > The copy to a stack buffer is probably useful even for readability > > Oh, I also realized I left out another part of it... > > void > ip_input(struct mbuf *m) > { > #ifndef __NO_STRICT_ALIGNMENT > struct ip tmpip; > #endif > struct ip *ip = NULL; > > #ifndef __NO_STRICT_ALIGNMENT > bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip); > ip = &tmpip; > #else > ip = mtod(m, struct ip *); > #endif this is exactly what we shold NOT do. Apart from the source bloat from conditional blocks, easily someone will try to use ip to point to options (which are not copied), etc etc. Just copy the header unconditionally, or probably just the source and destination IP which under normal assumptions (14 byte mac header) are the only ones where alignment breaks. Then of course options will have similar problems. This is why I think we should use accessors if we want to solve this problem. cheers luigi From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:42:06 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1BABFB87 for ; Thu, 31 Oct 2013 22:42:06 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA8E2992 for ; Thu, 31 Oct 2013 22:42:05 +0000 (UTC) Received: (qmail 81813 invoked from network); 31 Oct 2013 23:12:12 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2013 23:12:12 -0000 Message-ID: <5272DCA4.8040209@freebsd.org> Date: Thu, 31 Oct 2013 23:41:40 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r257455 - head/sys/net References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <5272D6E0.8050709@freebsd.org> <1383258763.31172.46.camel@revolution.hippie.lan> In-Reply-To: <1383258763.31172.46.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:42:06 -0000 On 31.10.2013 23:32, Ian Lepore wrote: > On Thu, 2013-10-31 at 23:17 +0100, Andre Oppermann wrote: >> On 31.10.2013 20:27, Ian Lepore wrote: >>> On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote: >>>> On 31.10.2013 19:03, Luigi Rizzo wrote: >>>>> On Thu, Oct 31, 2013 at 03:46:10PM +0000, Andre Oppermann wrote: >>>>>> Author: andre >>>>>> Date: Thu Oct 31 15:46:10 2013 >>>>>> New Revision: 257455 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/257455 >>>>>> >>>>>> Log: >>>>>> Make struct ifnet readable and comprehensible again by grouping >>>>>> and ordering related variables, fields and locks next to each >>>>>> other. Add more comments to variables. >>>>> >>>>> >>>>>> Over time 'ifnet' has accumlated a lot of additional pointers and >>>>>> functionality in an unstructured way making it quite hard to read >>>>>> and understand while obfuscating relationships between fields and >>>>>> variables. >>>>>> >>>>>> Quantify the structure size and how bloated it has become. >>>>>> >>>>>> This is only a mechanical change in preparation for upcoming >>>>>> work to make ifnet opaque to drivers and to separate out the >>>>>> interface queuing. >>>>> >>>>> as you do the above I think it would make sense to replace >>>>> all int/short/long with fixed-size fields as appropriate >>>>> (and large enough) to make it easier to reason about things >>>>> such as 'how many flags can i stuff into a field'. >>>>> >>>>> The "large enough" part refers to two things: >>>>> - bitfields containing flags or capabilities have a tendency >>>>> to overflow (not just in freebsd, linux has the same) >>>>> requiring KBI changes. We should probably go for 64 bits >>>>> unless there are compelling space reasons (not for ifnet). >>>> >>>> Gleb will handle most of that and it is going to be part of the making >>>> ifnet opaque to drivers. >>>> >>>>> - it is useful if certain opaque fields (flow ids, cookies...) >>>>> can store pointers. Once again, make them at least 64 bit helps >>>> >>>> A number of mbuf header fields have this property now. :) >>> >>> Is there any chance all this reworking might get us to a position where >>> the protocol header in an mbuf doesn't have to be 32-bit aligned >>> anymore? We pay a pretty heavy price for that requirement in the >>> drivers of the least capable hardware we support, the systems that have >>> the least horsepower to spare to make an extra copy of each packet to >>> realign it. >> >> That's a totally different issue. Here we're talking about kernel >> structures including the fields in struct mbuf. It is totally not >> related to any payload packet headers inside the mbuf data section. >> > > Of course it is. The nature of my message was purely "As long as we're > doing big changes...". It's in a totally different area, but agreed on the big changes thing. ;) >> The problem you're complaining about is the epic design mistake of >> the ethernet header neither being a power of two nor divisible by >> 4 or 8 bytes. It is a ridiculous 14 bytes. >> > > Indeed. > >> Many DMA engines are capable of starting on any byte. Some (popular) >> are not. If they are, the start of the payload can be by shifted by >> two so that the IP headers are 32bit aligned in memory. If that is >> not possible either the payload has to be copy-aligned or direct >> payload to structure casting must be disallowed, or indirected through >> a macro. >> > > I know of only one modern ARM SoC that's able to DMA network packets on > a 2-byte boundary (actually even it requires a 4-byte boundary, but it's > willing to stuff the first 16 bits with zeroes and offset everything > that follows accordingly). I'm sure there are others, but it's the > exception rather than the rule. Talk about foot shooting. I'm afraid that packet copying may still be the least evil option in the grand scheme of things. IIRC ARM64 will be able to do misaligned accesses with only a small performance penalty, like x86/AMD64. -- Andre From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 22:46:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 61D16D06; Thu, 31 Oct 2013 22:46:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F29A29AB; Thu, 31 Oct 2013 22:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VMk4M5093824; Thu, 31 Oct 2013 22:46:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VMk4kn093823; Thu, 31 Oct 2013 22:46:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201310312246.r9VMk4kn093823@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 31 Oct 2013 22:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257475 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 22:46:04 -0000 Author: marcel Date: Thu Oct 31 22:46:03 2013 New Revision: 257475 URL: http://svnweb.freebsd.org/changeset/base/257475 Log: Respect the kern.smp.disabled tunable. When we're scanning the MADT in ia64_probe_sapics(), we also create PCPU structures for any Local SAPICs we encounter. When SMP is disabled, this leaves us with partially setup PCPU structures, which typically results in panics when we're iterating over CPUs. When SMP is disabled, we now prevent the creation of the PCPU structures. Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 21:16:47 2013 (r257474) +++ head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 22:46:03 2013 (r257475) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); extern uint64_t bdata[]; +extern int smp_disabled; + MALLOC_DEFINE(M_SMP, "SMP", "SMP related allocations"); void ia64_ap_startup(void); @@ -294,6 +296,9 @@ cpu_mp_add(u_int acpi_id, u_int id, u_in void *dpcpu; u_int cpuid, sapic_id; + if (smp_disabled) + return; + sapic_id = SAPIC_ID_SET(id, eid); cpuid = (IA64_LID_GET_SAPIC_ID(ia64_get_lid()) == sapic_id) ? 0 : smp_cpus++; From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 23:05:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 370F2FDA; Thu, 31 Oct 2013 23:05:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 244B02A84; Thu, 31 Oct 2013 23:05:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VN56h9000533; Thu, 31 Oct 2013 23:05:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VN55Vp000532; Thu, 31 Oct 2013 23:05:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310312305.r9VN55Vp000532@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 23:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257476 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 23:05:06 -0000 Author: ian Date: Thu Oct 31 23:05:05 2013 New Revision: 257476 URL: http://svnweb.freebsd.org/changeset/base/257476 Log: Revamp the SoC identity numbering scheme to be more in line with the way Freescale numbers the chips in the ID registers. Modified: head/sys/arm/freescale/imx/imx_machdep.h Modified: head/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.h Thu Oct 31 22:46:03 2013 (r257475) +++ head/sys/arm/freescale/imx/imx_machdep.h Thu Oct 31 23:05:05 2013 (r257476) @@ -36,24 +36,27 @@ void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz); void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__)); +/* From here down, routines are implemented in imxNN_machdep.c. */ + /* * SoC identity. + * According to the documentation, there is such a thing as an i.MX6 Dual + * (non-lite flavor). However, Freescale doesn't seem to have assigned it a + * number in their code for determining the SoC type in u-boot. + * + * To-do: put silicon revision numbers into the low-order bits somewhere. */ -#define IMXSOC_51 0x05000100 -#define IMXSOC_53 0x05000300 -#define IMXSOC_6S 0x06000010 -#define IMXSOC_6SL 0x06000011 -#define IMXSOC_6D 0x06000020 -#define IMXSOC_6DL 0x06000021 -#define IMXSOC_6Q 0x06000040 -#define IMXSOC_6QL 0x06000041 -#define IMXSOC_FAMSHIFT 24 +#define IMXSOC_51 0x51000000 +#define IMXSOC_53 0x53000000 +#define IMXSOC_6SL 0x60000000 +#define IMXSOC_6DL 0x61000000 +#define IMXSOC_6S 0x62000000 +#define IMXSOC_6Q 0x63000000 +#define IMXSOC_FAMSHIFT 28 u_int imx_soc_type(void); u_int imx_soc_family(void); -/* From here down, routines are implemented in imxNN_machdep.c. */ - void imx_devmap_init(void); /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 23:06:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0A37F1A5; Thu, 31 Oct 2013 23:06:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA62B2A8D; Thu, 31 Oct 2013 23:06:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VN65h2000714; Thu, 31 Oct 2013 23:06:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VN65AQ000708; Thu, 31 Oct 2013 23:06:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201310312306.r9VN65AQ000708@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 31 Oct 2013 23:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257477 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 23:06:06 -0000 Author: marcel Date: Thu Oct 31 23:06:04 2013 New Revision: 257477 URL: http://svnweb.freebsd.org/changeset/base/257477 Log: Purge the translation cache of APs before we unleash them. To that end, make pmap_invalidate_all() global and have it only handle the local CPU -- i.e. no rendezvous. We do not use pmap_invalidate_all other than during initialization. Note that the BSP already purges its TC -- it was missing for APs only. Nonetheless, this so far seems to eliminate random problems. Modified: head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/ia64/pmap.c head/sys/ia64/include/pmap.h Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 23:05:05 2013 (r257476) +++ head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 23:06:04 2013 (r257477) @@ -240,6 +240,8 @@ ia64_ap_startup(void) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); PCPU_SET(curthread, PCPU_GET(idlethread)); + pmap_invalidate_all(); + atomic_add_int(&ia64_ap_state.as_awake, 1); while (!smp_started) cpu_spinwait(); Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Oct 31 23:05:05 2013 (r257476) +++ head/sys/ia64/ia64/pmap.c Thu Oct 31 23:06:04 2013 (r257477) @@ -262,7 +262,6 @@ static vm_page_t pmap_pv_reclaim(pmap_t static void pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot); static void pmap_free_pte(struct ia64_lpte *pte, vm_offset_t va); -static void pmap_invalidate_all(void); static int pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va, pv_entry_t pv, int freepte); static int pmap_remove_vhpt(vm_offset_t va); @@ -537,13 +536,12 @@ pmap_invalidate_page(vm_offset_t va) critical_exit(); } -static void -pmap_invalidate_all_1(void *arg) +void +pmap_invalidate_all(void) { uint64_t addr; int i, j; - critical_enter(); addr = pmap_ptc_e_base; for (i = 0; i < pmap_ptc_e_count1; i++) { for (j = 0; j < pmap_ptc_e_count2; j++) { @@ -552,20 +550,7 @@ pmap_invalidate_all_1(void *arg) } addr += pmap_ptc_e_stride1; } - critical_exit(); -} - -static void -pmap_invalidate_all(void) -{ - -#ifdef SMP - if (mp_ncpus > 1) { - smp_rendezvous(NULL, pmap_invalidate_all_1, NULL, NULL); - return; - } -#endif - pmap_invalidate_all_1(NULL); + ia64_srlz_i(); } static uint32_t Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Thu Oct 31 23:05:05 2013 (r257476) +++ head/sys/ia64/include/pmap.h Thu Oct 31 23:06:04 2013 (r257477) @@ -122,6 +122,7 @@ extern int pmap_vhpt_log2size; vm_offset_t pmap_alloc_vhpt(void); void pmap_bootstrap(void); +void pmap_invalidate_all(void); void pmap_kenter(vm_offset_t va, vm_offset_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 23:08:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A70F321; Thu, 31 Oct 2013 23:08:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47BAD2AA5; Thu, 31 Oct 2013 23:08:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VN8V25001105; Thu, 31 Oct 2013 23:08:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VN8VGR001104; Thu, 31 Oct 2013 23:08:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310312308.r9VN8VGR001104@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 23:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257478 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 23:08:31 -0000 Author: ian Date: Thu Oct 31 23:08:30 2013 New Revision: 257478 URL: http://svnweb.freebsd.org/changeset/base/257478 Log: Add definitions for the register and data that describes the SoC type. This isn't in the chip reference manuals, it was found in u-boot and various old mailing list threads. Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatopreg.h Thu Oct 31 23:06:04 2013 (r257477) +++ head/sys/arm/freescale/imx/imx6_anatopreg.h Thu Oct 31 23:08:30 2013 (r257478) @@ -122,7 +122,9 @@ #define IMX6_ANALOG_USB2_MISC_CLR 0x258 #define IMX6_ANALOG_USB2_MISC_TOG 0x25C #define IMX6_ANALOG_DIGPROG 0x260 - - +#define IMX6_ANALOG_DIGPROG_SL 0x280 +#define IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT 16 +#define IMX6_ANALOG_DIGPROG_SOCTYPE_MASK \ + (0xff << IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) #endif From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 23:57:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55E1716F; Thu, 31 Oct 2013 23:57:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A6E72D3A; Thu, 31 Oct 2013 23:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9VNvXGc020360; Thu, 31 Oct 2013 23:57:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9VNvXbL020358; Thu, 31 Oct 2013 23:57:33 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201310312357.r9VNvXbL020358@svn.freebsd.org> From: Ian Lepore Date: Thu, 31 Oct 2013 23:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257480 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 31 Oct 2013 23:57:36 -0000 Author: ian Date: Thu Oct 31 23:57:33 2013 New Revision: 257480 URL: http://svnweb.freebsd.org/changeset/base/257480 Log: Convert the if/else list of compatible devices to the table-driven ofw_bus_search_compatible() routine. In addition to converting existing strings to table entries, also add compat strings for the whole imx family. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Thu Oct 31 23:39:31 2013 (r257479) +++ head/sys/dev/uart/uart_bus_fdt.c Thu Oct 31 23:57:33 2013 (r257480) @@ -61,6 +61,30 @@ static driver_t uart_fdt_driver = { sizeof(struct uart_softc), }; +/* + * Compatible devices. Keep this sorted in most- to least-specific order first, + * alphabetical second. That is, "zwie,ns16550" should appear before "ns16550" + * on the theory that the zwie driver knows how to make better use of the + * hardware than the generic driver. Likewise with chips within a family, the + * highest-numbers / most recent models should probably appear earlier. + */ +static struct ofw_compat_data compat_data[] = { + {"arm,pl011", (uintptr_t)&uart_pl011_class}, + {"cadence,uart", (uintptr_t)&uart_cdnc_class}, + {"exynos", (uintptr_t)&uart_s3c2410_class}, + {"fsl,imx6q-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx53-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx51-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx31-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx27-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx25-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx21-uart", (uintptr_t)&uart_imx_class}, + {"lpc,uart", (uintptr_t)&uart_lpc_class}, + {"ti,ns16550", (uintptr_t)&uart_ti8250_class}, + {"ns16550", (uintptr_t)&uart_ns8250_class}, + {NULL, (uintptr_t)NULL}, +}; + static int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { @@ -99,25 +123,16 @@ uart_fdt_probe(device_t dev) phandle_t node; pcell_t clock, shift; int err; + const struct ofw_compat_data * cd; sc = device_get_softc(dev); - if (ofw_bus_is_compatible(dev, "lpc,uart")) - sc->sc_class = &uart_lpc_class; - else if (ofw_bus_is_compatible(dev, "fsl,imx-uart")) - sc->sc_class = &uart_imx_class; - else if (ofw_bus_is_compatible(dev, "arm,pl011")) - sc->sc_class = &uart_pl011_class; - else if (ofw_bus_is_compatible(dev, "exynos")) - sc->sc_class = &uart_s3c2410_class; - else if (ofw_bus_is_compatible(dev, "cadence,uart")) - sc->sc_class = &uart_cdnc_class; - else if (ofw_bus_is_compatible(dev, "ti,ns16550")) - sc->sc_class = &uart_ti8250_class; - else if (ofw_bus_is_compatible(dev, "ns16550")) - sc->sc_class = &uart_ns8250_class; - else + + cd = ofw_bus_search_compatible(dev, compat_data); + if (cd->ocd_data == (uintptr_t)NULL) return (ENXIO); + sc->sc_class = (struct uart_class *)cd->ocd_data; + node = ofw_bus_get_node(dev); if ((err = uart_fdt_get_clock(node, &clock)) != 0) From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 00:14:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D831F58D; Fri, 1 Nov 2013 00:14:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C59822DFA; Fri, 1 Nov 2013 00:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA10EFC3027889; Fri, 1 Nov 2013 00:14:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA10EFDs027888; Fri, 1 Nov 2013 00:14:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311010014.rA10EFDs027888@svn.freebsd.org> From: Alexander Motin Date: Fri, 1 Nov 2013 00:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257482 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 00:14:15 -0000 Author: mav Date: Fri Nov 1 00:14:15 2013 New Revision: 257482 URL: http://svnweb.freebsd.org/changeset/base/257482 Log: Fix lock recursion, triggered by `smartctl -a /dev/adaX`. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Oct 31 23:58:31 2013 (r257481) +++ head/sys/cam/cam_xpt.c Fri Nov 1 00:14:15 2013 (r257482) @@ -2200,7 +2200,7 @@ xptperiphtraverse(struct cam_ed *device, for (; periph != NULL; periph = next_periph) { retval = tr_func(periph, arg); if (retval == 0) { - cam_periph_release(periph); + cam_periph_release_locked(periph); break; } xpt_lock_buses(); From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 00:21:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C52DF752; Fri, 1 Nov 2013 00:21:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A38062E48; Fri, 1 Nov 2013 00:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA10LAvV030824; Fri, 1 Nov 2013 00:21:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA10L94c030820; Fri, 1 Nov 2013 00:21:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311010021.rA10L94c030820@svn.freebsd.org> From: Ian Lepore Date: Fri, 1 Nov 2013 00:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257483 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 00:21:10 -0000 Author: ian Date: Fri Nov 1 00:21:09 2013 New Revision: 257483 URL: http://svnweb.freebsd.org/changeset/base/257483 Log: Add the Soc- / machine-dependent parts of imx6 support. Added: head/sys/arm/freescale/imx/files.imx6 (contents, props changed) head/sys/arm/freescale/imx/imx6_machdep.c (contents, props changed) head/sys/arm/freescale/imx/imx6_pl310.c (contents, props changed) head/sys/arm/freescale/imx/std.imx6 (contents, props changed) Added: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/files.imx6 Fri Nov 1 00:21:09 2013 (r257483) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# +# Standard ARM support. +# +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_armv7.S standard +arm/arm/irq_dispatch.S standard +kern/kern_clocksource.c standard + +# +# Standard imx6 devices and support. +# +arm/arm/gic.c standard +arm/arm/pl310.c standard +arm/freescale/imx/bus_space.c standard +arm/freescale/imx/common.c standard +arm/freescale/imx/imx6_anatop.c standard +arm/freescale/imx/imx6_ccm.c standard +arm/freescale/imx/imx6_machdep.c standard +arm/freescale/imx/imx6_pl310.c standard +arm/freescale/imx/imx_machdep.c standard +arm/freescale/imx/imx_gpt.c standard + +# +# Optional devices. +# +arm/freescale/imx/imx_sdhci.c optional sdhci + +arm/freescale/imx/imx_wdog.c optional imxwdt + +dev/ffec/if_ffec.c optional ffec + +dev/uart/uart_dev_imx.c optional uart + +dev/usb/controller/ehci_imx.c optional ehci +arm/freescale/imx/imx6_usbphy.c optional ehci + +# +# Low-level serial console for debugging early kernel startup. +# +#arm/freescale/imx/console.c standard + +# +# Not ready yet... +# +#arm/freescale/imx/imx51_iomux.c optional iomux +#arm/freescale/imx/imx51_gpio.c optional gpio +#dev/ata/chipsets/ata-fsl.c optional imxata +#arm/freescale/imx/i2c.c optional fsliic +#dev/ofw/ofw_iicbus.c optional fsliic +#arm/freescale/imx/imx51_ipuv3.c optional sc + Added: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_machdep.c Fri Nov 1 00:21:09 2013 (r257483) @@ -0,0 +1,164 @@ +/*- + * Copyright (c) 2013 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 "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* + * Set up static device mappings. Note that for imx this is called from + * initarm_lastaddr() so that it can return the lowest address used for static + * device mapping, maximizing kva space. + * + * This attempts to cover the most-used devices with 1MB section mappings, which + * is good for performance (uses fewer TLB entries for device access). + * + * ARMMP covers the interrupt controller, MPCore timers, global timer, and the + * L2 cache controller. Most of the 1MB range is unused reserved space. + * + * AIPS1/AIPS2 cover most of the on-chip devices such as uart, spi, i2c, etc. + * + * Notably not mapped right now are HDMI, GPU, and other devices below ARMMP in + * the memory map. When we get support for graphics it might make sense to + * static map some of that area. Be careful with other things in that area such + * as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory. + */ +void +imx_devmap_init(void) +{ + const uint32_t IMX6_ARMMP_PHYS = 0x00a00000; + const uint32_t IMX6_ARMMP_SIZE = 0x00100000; + const uint32_t IMX6_AIPS1_PHYS = 0x02000000; + const uint32_t IMX6_AIPS1_SIZE = 0x00100000; + const uint32_t IMX6_AIPS2_PHYS = 0x02100000; + const uint32_t IMX6_AIPS2_SIZE = 0x00100000; + + imx_devmap_addentry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); + imx_devmap_addentry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); + imx_devmap_addentry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); +} + +void +cpu_reset(void) +{ + const uint32_t IMX6_WDOG_CR_PHYS = 0x020bc000; + + imx_wdog_cpu_reset(IMX6_WDOG_CR_PHYS); +} + +/* + * Determine what flavor of imx6 we're running on. + * + * This code is based on the way u-boot does it. Information found on the web + * indicates that Freescale themselves were the original source of this logic, + * including the strange check for number of CPUs in the SCU configuration + * register, which is apparently needed on some revisions of the SOLO. + * + * According to the documentation, there is such a thing as an i.MX6 Dual + * (non-lite flavor). However, Freescale doesn't seem to have assigned it a + * number or provided any logic to handle it in their detection code. + * + * Note that the ANALOG_DIGPROG and SCU configuration registers are not + * documented in the chip reference manual. (SCU configuration is mentioned, + * but not mapped out in detail.) I think the bottom two bits of the scu config + * register may be ncpu-1. + * + * This hasn't been tested yet on a dual[-lite]. + * + * On a solo: + * digprog = 0x00610001 + * hwsoc = 0x00000062 + * scu config = 0x00000500 + * On a quad: + * digprog = 0x00630002 + * hwsoc = 0x00000063 + * scu config = 0x00005503 + */ +u_int imx_soc_type() +{ + const struct pmap_devmap *pd; + uint32_t digprog, hwsoc; + uint32_t *pcr; + const uint32_t HWSOC_MX6SL = 0x60; + const uint32_t HWSOC_MX6DL = 0x61; + const uint32_t HWSOC_MX6SOLO = 0x62; + const uint32_t HWSOC_MX6Q = 0x63; + const vm_offset_t SCU_CONFIG_PHYSADDR = 0x00a00004; + + digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG_SL); + hwsoc = (digprog >> IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) & + IMX6_ANALOG_DIGPROG_SOCTYPE_MASK; + + if (hwsoc != HWSOC_MX6SL) { + digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG); + hwsoc = (digprog & IMX6_ANALOG_DIGPROG_SOCTYPE_MASK) >> + IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT; + /*printf("digprog = 0x%08x\n", digprog);*/ + if (hwsoc == HWSOC_MX6DL) { + pd = pmap_devmap_find_pa(SCU_CONFIG_PHYSADDR, 4); + if (pd != NULL) { + pcr = (uint32_t *)(pd->pd_va + + (SCU_CONFIG_PHYSADDR - pd->pd_pa)); + /*printf("scu config = 0x%08x\n", *pcr);*/ + if ((*pcr & 0x03) == 0) { + hwsoc = HWSOC_MX6SOLO; + } + } + } + } + /* printf("hwsoc 0x%08x\n", hwsoc); */ + + switch (hwsoc) { + case HWSOC_MX6SL: + return (IMXSOC_6SL); + case HWSOC_MX6SOLO: + return (IMXSOC_6S); + case HWSOC_MX6DL: + return (IMXSOC_6DL); + case HWSOC_MX6Q : + return (IMXSOC_6Q); + default: + printf("imx_soc_type: Don't understand hwsoc 0x%02x, " + "digprog 0x%08x; assuming IMXSOC_6Q\n", hwsoc, digprog); + break; + } + + return (IMXSOC_6Q); +} + Added: head/sys/arm/freescale/imx/imx6_pl310.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_pl310.c Fri Nov 1 00:21:09 2013 (r257483) @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2012 Olivier Houchard. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The machine-dependent part of the arm/pl310 driver for imx6 SoCs. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +void +platform_pl310_init(struct pl310_softc *sc) +{ + uint32_t aux, prefetch; + + aux = pl310_read4(sc, PL310_AUX_CTRL); + prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); + + if (bootverbose) { + device_printf(sc->sc_dev, "Early BRESP response: %s\n", + (aux & AUX_CTRL_EARLY_BRESP) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (aux & AUX_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (aux & AUX_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", + (aux & AUX_CTRL_NS_INT_CTRL) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", + (aux & AUX_CTRL_NS_LOCKDOWN) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Share override: %s\n", + (aux & AUX_CTRL_SHARE_OVERRIDE) ? "enabled" : "disabled"); + + device_printf(sc->sc_dev, "Double linefil: %s\n", + (prefetch & PREFETCH_CTRL_DL) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", + (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Prefetch drop: %s\n", + (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Incr double Linefill: %s\n", + (prefetch & PREFETCH_CTRL_INCR_DL) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", + (prefetch & PREFETCH_CTRL_NOTSAMEID) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Prefetch offset: %d\n", + (prefetch & PREFETCH_CTRL_OFFSET_MASK)); + } +} + +void +platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) +{ + + pl310_write4(sc, PL310_CTRL, val); +} + +void +platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) +{ + + pl310_write4(sc, PL310_DEBUG_CTRL, val); +} + Added: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/std.imx6 Fri Nov 1 00:21:09 2013 (r257483) @@ -0,0 +1,15 @@ +# $FreeBSD$ +machine arm armv6 +cpu CPU_CORTEXA +makeoptions ARM_LITTLE_ENDIAN +options ARM_L2_PIPT + +options KERNVIRTADDR = 0xc2000000 +makeoptions KERNVIRTADDR = 0xc2000000 +options KERNPHYSADDR = 0x12000000 +makeoptions KERNPHYSADDR = 0x12000000 +options PHYSADDR = 0x10000000 +options STARTUP_PAGETABLE_ADDR = 0x11f00000 + +files "../freescale/imx/files.imx6" + From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 00:21:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A045F8AC; Fri, 1 Nov 2013 00:21:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 751F72E51; Fri, 1 Nov 2013 00:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA10LdAN030903; Fri, 1 Nov 2013 00:21:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA10Ld3R030902; Fri, 1 Nov 2013 00:21:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201311010021.rA10Ld3R030902@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 1 Nov 2013 00:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257484 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 00:21:39 -0000 Author: marcel Date: Fri Nov 1 00:21:38 2013 New Revision: 257484 URL: http://svnweb.freebsd.org/changeset/base/257484 Log: The PAL_PTCE_INFO function returns the counts and strides of the outer and inner loop as 32-bit integers mux'd in 64-bit return values. Change our data types for the count and stride to match and simplify/adjust accordingly. Note that with this change the defaults of the ptc.e parameters have changed. Since all hardware is supposed to support the PAL call, there should be no impact. Even ski is unaffected, because the TC is re-initialized without considering the virtual address. So, as long as we call ptc.e at least once, we're good. That's what the new defaults do. Most processor implementations need but a single ptc.e to purge the entire TC anyway... Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Fri Nov 1 00:21:09 2013 (r257483) +++ head/sys/ia64/ia64/pmap.c Fri Nov 1 00:21:38 2013 (r257484) @@ -195,12 +195,12 @@ extern struct ia64_lpte ***ia64_kptdir; vm_offset_t kernel_vm_end; -/* Values for ptc.e. XXX values for SKI. */ -static uint64_t pmap_ptc_e_base = 0x100000000; -static uint64_t pmap_ptc_e_count1 = 3; -static uint64_t pmap_ptc_e_count2 = 2; -static uint64_t pmap_ptc_e_stride1 = 0x2000; -static uint64_t pmap_ptc_e_stride2 = 0x100000000; +/* Defaults for ptc.e. */ +static uint64_t pmap_ptc_e_base = 0; +static uint32_t pmap_ptc_e_count1 = 1; +static uint32_t pmap_ptc_e_count2 = 1; +static uint32_t pmap_ptc_e_stride1 = 0; +static uint32_t pmap_ptc_e_stride2 = 0; struct mtx pmap_ptc_mutex; @@ -324,12 +324,12 @@ pmap_bootstrap() panic("Can't configure ptc.e parameters"); pmap_ptc_e_base = res.pal_result[0]; pmap_ptc_e_count1 = res.pal_result[1] >> 32; - pmap_ptc_e_count2 = res.pal_result[1] & ((1L<<32) - 1); + pmap_ptc_e_count2 = res.pal_result[1]; pmap_ptc_e_stride1 = res.pal_result[2] >> 32; - pmap_ptc_e_stride2 = res.pal_result[2] & ((1L<<32) - 1); + pmap_ptc_e_stride2 = res.pal_result[2]; if (bootverbose) - printf("ptc.e base=0x%lx, count1=%ld, count2=%ld, " - "stride1=0x%lx, stride2=0x%lx\n", + printf("ptc.e base=0x%lx, count1=%u, count2=%u, " + "stride1=0x%x, stride2=0x%x\n", pmap_ptc_e_base, pmap_ptc_e_count1, pmap_ptc_e_count2, From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 00:32:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 343D2B55; Fri, 1 Nov 2013 00:32:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21B3C2ECE; Fri, 1 Nov 2013 00:32:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA10WQBl034263; Fri, 1 Nov 2013 00:32:26 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA10WQJb034262; Fri, 1 Nov 2013 00:32:26 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201311010032.rA10WQJb034262@svn.freebsd.org> From: Sean Bruno Date: Fri, 1 Nov 2013 00:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257485 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 00:32:27 -0000 Author: sbruno Date: Fri Nov 1 00:32:26 2013 New Revision: 257485 URL: http://svnweb.freebsd.org/changeset/base/257485 Log: Install include files for netpfil/pf when requested by the Makefile Reviewed by: glebius Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Fri Nov 1 00:21:38 2013 (r257484) +++ head/include/Makefile Fri Nov 1 00:32:26 2013 (r257485) @@ -195,6 +195,11 @@ copies: ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/netinet .endif +.if ${MK_PF} != "no" + cd ${.CURDIR}/../sys/netpfil/pf; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ + ${DESTDIR}${INCLUDEDIR}/netpfil/pf +.endif cd ${.CURDIR}/../sys/crypto; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ ${DESTDIR}${INCLUDEDIR}/crypto From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 00:45:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26061DA7; Fri, 1 Nov 2013 00:45:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 131532F52; Fri, 1 Nov 2013 00:45:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA10j9UY037825; Fri, 1 Nov 2013 00:45:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA10j8t4037819; Fri, 1 Nov 2013 00:45:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311010045.rA10j8t4037819@svn.freebsd.org> From: Ian Lepore Date: Fri, 1 Nov 2013 00:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257486 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 00:45:09 -0000 Author: ian Date: Fri Nov 1 00:45:08 2013 New Revision: 257486 URL: http://svnweb.freebsd.org/changeset/base/257486 Log: Add dts source for imx6 SoCs and for Wandboard boards. The imx6.dtsi is incomplete, but has enough to support devices that work right now. Eventually it will need to be split into several files that account for the differences between SoCs in the imx6 family. The board config for Wandboard Dual is untested. Solo and Quad work, but one one core is turned on for the quad right now (baby steps). Added: head/sys/boot/fdt/dts/imx6.dtsi (contents, props changed) head/sys/boot/fdt/dts/wandboard-dual.dts (contents, props changed) head/sys/boot/fdt/dts/wandboard-quad.dts (contents, props changed) head/sys/boot/fdt/dts/wandboard-solo.dts (contents, props changed) Added: head/sys/boot/fdt/dts/imx6.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/imx6.dtsi Fri Nov 1 00:45:08 2013 (r257486) @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2012 The FreeBSD Foundation + * 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. + * + * Freescale i.MX6 Common Device Tree Source. + * There are enough differences between the Solo, Dual, Quad, and *-lite + * flavors of this SoC that eventually we will need a finer-grained breakdown + * of some of this stuff. For now this file works for all of them. I think. + * + * $FreeBSD$ + */ + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,MCIMX6"; + reg = <0x0>; + d-cache-line-size = <32>; + i-cache-line-size = <32>; + d-cache-size = <0x8000>; + i-cache-size = <0x8000>; + /* TODO: describe L2 cache also */ + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + }; + + aliases { + soc = &SOC; + }; + + SOC: soc@00000000 { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + ranges = <0x00000000 0x00000000 0x10000000>; + + gic: generic-interrupt-controller@00a00100 { + compatible = "arm,gic"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0x00a01000 0x00001000 + 0x00a00100 0x00000100>; + }; + + l2-cache@00a02000 { + compatible = "arm,pl310-cache", "arm,pl310"; + reg = <0xa02000 0x1000>; + interrupts = <124>; + cache-level = <0x2>; + interrupt-parent = < &gic >; + }; + + aips@02000000 { /* AIPS1 */ + compatible = "fsl,aips-bus", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + reg = <0x02000000 0x00100000>; + ranges; + + /* Required by many devices, so better to stay first */ + clks: ccm@020c4000 { + compatible = "fsl,imx6q-ccm"; + reg = <0x020c4000 0x4000>; + interrupts = <119 120>; + }; + + anatop: anatop@020c8000 { + compatible = "fsl,imx6q-anatop"; + reg = <0x020c8000 0x1000>; + } + + gpt: timer@02098000 { + compatible = "fsl,imx6q-gpt", "fsl,imx51-gpt"; + reg = <0x02098000 0x4000>; + interrupt-parent = <&gic>; interrupts = <87>; + }; + +// iomux@73fa8000 { +// compatible = "fsl,imx51-iomux"; +// reg = <0x73fa8000 0x4000>; +// interrupt-parent = <&gic>; interrupts = <7>; +// status = "disabled"; +// }; + +// /* +// * GPIO modules moved up - to have it attached for +// * drivers which rely on GPIO +// */ +// gpio1: gpio@0209C000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x0209C000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <50 51 42 43 44 45 46 47 48 49>; +// /* TODO: use <> also */ +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; +// +// gpio2: gpio@020A0000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x020A0000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <52 53>; +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; +// +// gpio3: gpio@020A4000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x020A4000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <54 55>; +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; +// +// gpio4: gpio@020A8000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x020A8000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <56 57>; +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; + + uart1: serial@02020000 { + compatible = "fsl,imx6q-uart"; + reg = <0x02020000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <58>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart2: serial@021e8000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021e8000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <59>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart3: serial@021ec000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021ec000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <60>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart4: serial@021f0000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021f0000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <61>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart5: serial@021f4000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021f4000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <62>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + usbphy1: usbphy@020c9000 { + compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + reg = <0x020c9000 0x1000>; + interrupts = <44>; + status = "disabled"; + }; + + usbphy2: usbphy@020ca000 { + compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + reg = <0x020ca000 0x1000>; + interrupts = <45>; + status = "disabled"; + }; + + }; + + aips@02100000 { /* AIPS2 */ + compatible = "fsl,aips-bus", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + reg = <0x02100000 0x00100000>; + ranges; + + fec1: ethernet@02188000 { + compatible = "fsl,imx6q-fec"; + reg = <0x02188000 0x4000>; + interrupts = <150 151>; + status = "disabled"; + }; + + usbotg1: usb@02184000 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184000 0x200>; + interrupts = <75>; + fsl,usbphy = <&usbphy1>; + fsl,usbmisc = <&usbmisc 0>; + status = "disabled"; + }; + + usbh1: usb@02184200 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184200 0x200>; + interrupts = <72>; + fsl,usbphy = <&usbphy2>; + fsl,usbmisc = <&usbmisc 1>; + status = "disabled"; + }; + + usbh2: usb@02184400 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184400 0x200>; + interrupts = <73>; + fsl,usbmisc = <&usbmisc 2>; + status = "disabled"; + }; + + usbh3: usb@02184600 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184600 0x200>; + interrupts = <74>; + fsl,usbmisc = <&usbmisc 3>; + status = "disabled"; + }; + + usbmisc: usbmisc@02184800 { + #index-cells = <1>; + compatible = "fsl,imx6q-usbmisc"; + reg = <0x02184800 0x200>; + // Not disabled on purpose. + }; + + usdhc1: usdhc@02190000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x02190000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <54>; + bus-width = <0x4>; + status ="disabled"; + }; + + usdhc2: usdhc@02194000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x02194000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <55>; + bus-width = <0x4>; + status ="disabled"; + }; + + usdhc3: usdhc@02198000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x02198000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <56>; + bus-width = <0x4>; + status ="disabled"; + }; + + usdhc4: usdhc@0219c000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x0219c000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <57>; + bus-width = <0x4>; + status ="disabled"; + }; + }; + }; +}; Added: head/sys/boot/fdt/dts/wandboard-dual.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/wandboard-dual.dts Fri Nov 1 00:45:08 2013 (r257486) @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013 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. + * + * Wandboard Dual. + * + * $FreeBSD$ + */ + +/dts-v1/; +/include/ "imx6.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + + model = "Wandboard Dual"; + compatible = "wand,imx6d-wandboard", "fsl,imx6d"; + + memory { + reg = <0x10000000 0x40000000>; /* RAM 1GB */ + }; + + SOC: soc@00000000 { + aips@02000000 { /* AIPS1 */ +// iomux@73fa8000 { status = "disabled"; }; +// gpio@0209C000 { status = "disabled"; }; +// gpio@020A0000 { status = "disabled"; }; +// gpio@020A4000 { status = "disabled"; }; +// gpio@020A8000 { status = "disabled"; }; + console:serial@02020000 { status = "okay"; }; + serial@021e8000 { status = "disabled"; }; + serial@021ec000 { status = "disabled"; }; + serial@021f0000 { status = "disabled"; }; + serial@021f4000 { status = "disabled"; }; + usbphy@020c9000 { status = "okay"; }; + usbphy@020ca000 { status = "okay"; }; + }; + aips@02100000 { /* AIPS2 */ + ethernet@02188000 { + status = "okay"; + phy-mode = "rgmii"; + phy-disable-preamble; + }; + usb@02184000 { status = "okay"; }; + usb@02184200 { status = "okay"; }; + usb@02184400 { status = "disabled"; }; + usb@02184600 { status = "disabled"; }; + usdhc@02190000 { status = "disabled"; }; + usdhc@02194000 { status = "okay"; }; + usdhc@02198000 { status = "okay"; }; + usdhc@0219c000 { status = "disabled"; }; + }; + }; + + chosen { + stdin = &console; + stdout = &console; + }; +}; Added: head/sys/boot/fdt/dts/wandboard-quad.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/wandboard-quad.dts Fri Nov 1 00:45:08 2013 (r257486) @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013 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. + * + * Wandboard Quad. + * + * $FreeBSD$ + */ + +/dts-v1/; +/include/ "imx6.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + + model = "Wandboard Quad"; + compatible = "wand,imx6q-wandboard", "fsl,imx6q"; + + memory { + reg = <0x10000000 0x80000000>; /* RAM 2GB */ + }; + + SOC: soc@00000000 { + aips@02000000 { /* AIPS1 */ +// iomux@73fa8000 { status = "disabled"; }; +// gpio@0209C000 { status = "disabled"; }; +// gpio@020A0000 { status = "disabled"; }; +// gpio@020A4000 { status = "disabled"; }; +// gpio@020A8000 { status = "disabled"; }; + console:serial@02020000 { status = "okay"; }; + serial@021e8000 { status = "disabled"; }; + serial@021ec000 { status = "disabled"; }; + serial@021f0000 { status = "disabled"; }; + serial@021f4000 { status = "disabled"; }; + usbphy@020c9000 { status = "okay"; }; + usbphy@020ca000 { status = "okay"; }; + }; + aips@02100000 { /* AIPS2 */ + ethernet@02188000 { + status = "okay"; + phy-mode = "rgmii"; + phy-disable-preamble; + }; + usb@02184000 { status = "okay"; }; + usb@02184200 { status = "okay"; }; + usb@02184400 { status = "disabled"; }; + usb@02184600 { status = "disabled"; }; + usdhc@02190000 { status = "disabled"; }; + usdhc@02194000 { status = "okay"; }; + usdhc@02198000 { status = "okay"; }; + usdhc@0219c000 { status = "disabled"; }; + }; + }; + + chosen { + stdin = &console; + stdout = &console; + }; +}; Added: head/sys/boot/fdt/dts/wandboard-solo.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/wandboard-solo.dts Fri Nov 1 00:45:08 2013 (r257486) @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013 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. + * + * Wandboard Solo. + * + * $FreeBSD$ + */ + +/dts-v1/; +/include/ "imx6.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + + model = "Wandboard Solo"; + compatible = "wand,imx6s-wandboard", "fsl,imx6s"; + + memory { + reg = <0x10000000 0x20000000>; /* RAM 512M */ + }; + + SOC: soc@00000000 { + aips@02000000 { /* AIPS1 */ +// iomux@73fa8000 { status = "disabled"; }; +// gpio@0209C000 { status = "disabled"; }; +// gpio@020A0000 { status = "disabled"; }; +// gpio@020A4000 { status = "disabled"; }; +// gpio@020A8000 { status = "disabled"; }; + console:serial@02020000 { status = "okay"; }; + serial@021e8000 { status = "disabled"; }; + serial@021ec000 { status = "disabled"; }; + serial@021f0000 { status = "disabled"; }; + serial@021f4000 { status = "disabled"; }; + usbphy@020c9000 { status = "okay"; }; + usbphy@020ca000 { status = "okay"; }; + }; + aips@02100000 { /* AIPS2 */ + ethernet@02188000 { + status = "okay"; + phy-mode = "rgmii"; + phy-disable-preamble; + }; + usb@02184000 { status = "okay"; }; + usb@02184200 { status = "okay"; }; + usb@02184400 { status = "disabled"; }; + usb@02184600 { status = "disabled"; }; + usdhc@02190000 { status = "disabled"; }; + usdhc@02194000 { status = "okay"; }; + usdhc@02198000 { status = "okay"; }; + usdhc@0219c000 { status = "disabled"; }; + }; + }; + + chosen { + stdin = &console; + stdout = &console; + }; +}; From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 01:02:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E80DE388; Fri, 1 Nov 2013 01:02:28 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com [IPv6:2a00:1450:4010:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C89062022; Fri, 1 Nov 2013 01:02:27 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id ep20so2964890lab.3 for ; Thu, 31 Oct 2013 18:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=LZ/rNFolJYVGTqUn/AoWEiwVczYfr19p7jNvx4RyDZ8=; b=IW6wBUvKQRflJFtN4DL1zAop1mgXaovBr5QSHMqpblKxLJFODnsNxBXLhg3UFZWCkf 9pXxMF16ieWkofqn7k5Z1mZiIuHZ4ZwsLw/PbNG1g3SwK46NvyIjBzb2c9PnsdQOG0ES zFyQa3TR+b7XYpWaN1I1VPD3yLViWimRcqfEU3qGiGLO0Och8cIwhhQS7ONVFZU9GTF7 FFD0B3SJ4S7HMB2f5oVlN5QVOqqJgHLh8KO0nCNAdlTAUi4etk4I5myrGoEX2816rpnS d3GFbBbrOLiTHoZJ4Jp41UxgSrIVdmJmdbG9Cp0eTyMSWkJVaLt2BW1+Yj05v7I5Y5PH Cx6A== MIME-Version: 1.0 X-Received: by 10.112.52.33 with SMTP id q1mr234052lbo.30.1383267745571; Thu, 31 Oct 2013 18:02:25 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.23.35 with HTTP; Thu, 31 Oct 2013 18:02:25 -0700 (PDT) Date: Thu, 31 Oct 2013 18:02:25 -0700 X-Google-Sender-Auth: 0fgkHYpiRsCtfEwasdl1yyFHOGw Message-ID: Subject: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld From: Luigi Rizzo To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 01:02:29 -0000 as per the subject, after this commit building head on stable/9 fails with the error below: ===> lib/libpam/modules/pam_krb5 (all) make: don't know how to make /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. Stop reverting the commit fixes the build. Any idea how this can be fixed ? thanks luigi On Mon, Oct 28, 2013 at 12:56 PM, Brooks Davis wrote: > Author: brooks > Date: Mon Oct 28 19:56:46 2013 > New Revision: 257268 > URL: http://svnweb.freebsd.org/changeset/base/257268 > > Log: > Enable the --sysroot=/foo option in ld by always building with a sysroot > defined. When not building as a cross linker, the sysroot is set to "/". > > Exp-run by: bdrewery (ports/183206) > MFC after: 3 days > > Modified: > head/gnu/usr.bin/binutils/ld/Makefile > > Modified: head/gnu/usr.bin/binutils/ld/Makefile > > ============================================================================== > --- head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:46:01 2013 > (r257267) > +++ head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:56:46 2013 > (r257268) > @@ -31,7 +31,7 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\" > CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\" > CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" > CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" > -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\" > +CFLAGS+= -DBINDIR=\"${BINDIR}\" > -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\" > CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\" > CFLAGS+= -D_GNU_SOURCE > CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+------------------------------- From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 01:32:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B7CE99A6; Fri, 1 Nov 2013 01:32:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B27C219E; Fri, 1 Nov 2013 01:32:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA11W2P9054179; Fri, 1 Nov 2013 01:32:02 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA11W17l054176; Fri, 1 Nov 2013 01:32:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201311010132.rA11W17l054176@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 1 Nov 2013 01:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257487 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 01:32:02 -0000 Author: marcel Date: Fri Nov 1 01:32:01 2013 New Revision: 257487 URL: http://svnweb.freebsd.org/changeset/base/257487 Log: Use LOG2_ID_PAGE_SIZE again for the identity mapping in regions 6 & 7. Make the default translation size the same as the PBVM page size to avoid inserting overlapping translations in the TC. That generally is very bad. Modified: head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/include/param.h Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Fri Nov 1 00:45:08 2013 (r257486) +++ head/sys/ia64/ia64/machdep.c Fri Nov 1 01:32:01 2013 (r257487) @@ -716,8 +716,8 @@ ia64_init(void) * handlers. Here we just make sure that they have the largest * possible page size to minimise TLB usage. */ - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2)); ia64_srlz_d(); /* Initialize/setup physical memory datastructures */ Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Fri Nov 1 00:45:08 2013 (r257486) +++ head/sys/ia64/ia64/mp_machdep.c Fri Nov 1 01:32:01 2013 (r257487) @@ -208,8 +208,8 @@ ia64_ap_startup(void) ia64_ap_state.as_trace = 0x100; ia64_set_rr(IA64_RR_BASE(5), (5 << 8) | (PAGE_SHIFT << 2) | 1); - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2)); ia64_srlz_d(); pcpup = ia64_ap_state.as_pcpu; Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Fri Nov 1 00:45:08 2013 (r257486) +++ head/sys/ia64/include/param.h Fri Nov 1 01:32:01 2013 (r257487) @@ -105,6 +105,11 @@ #endif #define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ +/* The default size of identity mappings in region 6 & 7. */ +#ifndef LOG2_ID_PAGE_SIZE +#define LOG2_ID_PAGE_SIZE 16 +#endif + /* * Mach derived conversion macros */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 02:04:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4D4E2E90; Fri, 1 Nov 2013 02:04:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39DF222FA; Fri, 1 Nov 2013 02:04:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1246qr064307; Fri, 1 Nov 2013 02:04:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1245Ed064303; Fri, 1 Nov 2013 02:04:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311010204.rA1245Ed064303@svn.freebsd.org> From: Ian Lepore Date: Fri, 1 Nov 2013 02:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257489 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 02:04:06 -0000 Author: ian Date: Fri Nov 1 02:04:05 2013 New Revision: 257489 URL: http://svnweb.freebsd.org/changeset/base/257489 Log: Kernel config for Wandboard. Added: head/sys/arm/conf/WANDBOARD-COMMON (contents, props changed) head/sys/arm/conf/WANDBOARD-DUAL (contents, props changed) head/sys/arm/conf/WANDBOARD-QUAD (contents, props changed) head/sys/arm/conf/WANDBOARD-SOLO (contents, props changed) Added: head/sys/arm/conf/WANDBOARD-COMMON ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/WANDBOARD-COMMON Fri Nov 1 02:04:05 2013 (r257489) @@ -0,0 +1,155 @@ +# Kernel configuration for Wandboard +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "../freescale/imx/std.imx6" + +options HZ=250 # Scheduling quantum is 4 milliseconds. +options SCHED_4BSD # 4BSD scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +#options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # TMP Memory Filesystem +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support use KDB_TRACE, for interactive use DDB. +#options KDB_TRACE # Print a stack trace for a panic. +options DDB # Support DDB. +# For full debugger support use this instead: +#options GDB # Support remote GDB. +# Other debugging options... +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options ALT_BREAK_TO_DEBUGGER # Use to enter debugger. +#options DEBUG +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles + +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module +device ether # Ethernet support +device miibus # Required for ethernet + +# Serial (COM) ports +device uart # Multi-uart driver + +#device iomux # IO Multiplexor + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +#options USB_DEBUG # enable debug msgs +options USB_HOST_ALIGN=32 # Required for ARM, set to cache line size. +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +device u3g # USB modems + +# USB Ethernet, requires miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs + +# Watchdog timer. +# WARNING: can't be disabled!!! +#device imxwdt # Watchdog + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + +# NOTE: serial console will be disabled if syscons enabled +# Uncomment following lines for framebuffer/syscons support +# Wandboard has no video console support yet. +#device sc +#device kbdmux +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 +#device ukbd # Allow keyboard like HIDs to control console +#device ums + +# required for netbooting +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 + +# U-Boot stuff lives on slice 1, FreeBSD on slice 2. +options ROOTDEVNAME=\"ufs:mmcsd0s2a\" + +#device fsliic # Freescale i2c/iic (not ready yet) +#device iic # iic protocol +#device iicbus # iic bus + +device sdhci # SD controller +device mmc # SD/MMC protocol +device mmcsd # SDCard disk device + +device ffec # Freescale Fast Ethernet Controller + Added: head/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/WANDBOARD-DUAL Fri Nov 1 02:04:05 2013 (r257489) @@ -0,0 +1,27 @@ +# Kernel configuration for Wandboard-Dual +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include WANDBOARD-COMMON +ident WANDBOARD-DUAL + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=wandboard-dual.dts + Added: head/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/WANDBOARD-QUAD Fri Nov 1 02:04:05 2013 (r257489) @@ -0,0 +1,27 @@ +# Kernel configuration for Wandboard-Quad +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include WANDBOARD-COMMON +ident WANDBOARD-QUAD + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=wandboard-quad.dts + Added: head/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/WANDBOARD-SOLO Fri Nov 1 02:04:05 2013 (r257489) @@ -0,0 +1,27 @@ +# Kernel configuration for Wandboard-Solo +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include WANDBOARD-COMMON +ident WANDBOARD-SOLO + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=wandboard-solo.dts + From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 02:09:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 06291C2; Fri, 1 Nov 2013 02:09:28 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35266231C; Fri, 1 Nov 2013 02:09:26 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id rA129Ppr033039; Thu, 31 Oct 2013 21:09:25 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id rA129Ova033038; Thu, 31 Oct 2013 21:09:24 -0500 (CDT) (envelope-from brooks) Date: Thu, 31 Oct 2013 21:09:24 -0500 From: Brooks Davis To: Luigi Rizzo Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101020924.GB32951@lor.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 02:09:28 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote: > as per the subject, after this commit building head on stable/9 > fails with the error below: >=20 > =3D=3D=3D> lib/libpam/modules/pam_krb5 (all) > make: don't know how to make > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd1= 0/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. > Stop >=20 > reverting the commit fixes the build. >=20 > Any idea how this can be fixed ? I just built world and kernel with a freshly checked out head on ref9-amd64 so I supect something in your environment. This change should only impact the installed copy of ld which would have no effect on a 9-stable system. Any portion of the build system using a version effected by this change is broken since only the cross build version should be used and that one will have it's own sysroot value as always it always has. -- Brooks > On Mon, Oct 28, 2013 at 12:56 PM, Brooks Davis wrote: >=20 > > Author: brooks > > Date: Mon Oct 28 19:56:46 2013 > > New Revision: 257268 > > URL: http://svnweb.freebsd.org/changeset/base/257268 > > > > Log: > > Enable the --sysroot=3D/foo option in ld by always building with a sy= sroot > > defined. When not building as a cross linker, the sysroot is set to "= /". > > > > Exp-run by: bdrewery (ports/183206) > > MFC after: 3 days > > > > Modified: > > head/gnu/usr.bin/binutils/ld/Makefile > > > > Modified: head/gnu/usr.bin/binutils/ld/Makefile > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:46:01 2013 > > (r257267) > > +++ head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:56:46 2013 > > (r257268) > > @@ -31,7 +31,7 @@ CFLAGS+=3D -DTARGET=3D\"${TARGET_TUPLE}\" > > CFLAGS+=3D -DDEFAULT_EMULATION=3D\"${NATIVE_EMULATION}\" > > CFLAGS+=3D -DSCRIPTDIR=3D\"${TOOLS_PREFIX}/usr/libdata\" > > CFLAGS+=3D -DBFD_VERSION_STRING=3D\"${VERSION}\" > > -CFLAGS+=3D -DBINDIR=3D\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=3D\"${TOOLS_P= REFIX}\" > > +CFLAGS+=3D -DBINDIR=3D\"${BINDIR}\" > > -DTARGET_SYSTEM_ROOT=3D\"${TOOLS_PREFIX:U/}\" > > CFLAGS+=3D -DTOOLBINDIR=3D\"${TOOLS_PREFIX}/${BINDIR}/libexec\" > > CFLAGS+=3D -D_GNU_SOURCE > > CFLAGS+=3D -I${SRCDIR}/ld -I${SRCDIR}/bfd > > >=20 >=20 >=20 > --=20 > -----------------------------------------+------------------------------- > Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione > http://www.iet.unipi.it/~luigi/ . Universita` di Pisa > TEL +39-050-2211611 . via Diotisalvi 2 > Mobile +39-338-6809875 . 56122 PISA (Italy) > -----------------------------------------+------------------------------- --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFScw1SXY6L6fI4GtQRAlNNAJ45PSt6mSeRcZoa1pjMLULSVOZIsQCeJcxZ K842w8bgut0Uhk9FPK+Uo9o= =vNiu -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 02:24:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B3BDF442 for ; Fri, 1 Nov 2013 02:24:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 95B5F23D0 for ; Fri, 1 Nov 2013 02:24:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rA12O0ps002225 for ; Fri, 1 Nov 2013 02:24:00 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rA12O0xL002220 for svn-src-all@freebsd.org; Fri, 1 Nov 2013 02:24:00 GMT (envelope-from bdrewery) Received: (qmail 4338 invoked from network); 31 Oct 2013 21:23:58 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 31 Oct 2013 21:23:58 -0500 Message-ID: <527310B6.5070700@FreeBSD.org> Date: Thu, 31 Oct 2013 21:23:50 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Luigi Rizzo , Brooks Davis Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld References: In-Reply-To: X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9eDMxavVmD2lNFx75tdc6v1nC9tgGuXiJ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 02:24:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9eDMxavVmD2lNFx75tdc6v1nC9tgGuXiJ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 10/31/2013 8:02 PM, Luigi Rizzo wrote: > as per the subject, after this commit building head on stable/9 > fails with the error below: >=20 > =3D=3D=3D> lib/libpam/modules/pam_krb5 (all) > make: don't know how to make > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bs= d10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. I see errors in libkrb5 with -j32 quite often lately. Are you building with high -j? > Stop >=20 > reverting the commit fixes the build. >=20 > Any idea how this can be fixed ? >=20 > thanks > luigi >=20 >=20 > On Mon, Oct 28, 2013 at 12:56 PM, Brooks Davis wro= te: >=20 >> Author: brooks >> Date: Mon Oct 28 19:56:46 2013 >> New Revision: 257268 >> URL: http://svnweb.freebsd.org/changeset/base/257268 >> >> Log: >> Enable the --sysroot=3D/foo option in ld by always building with a s= ysroot >> defined. When not building as a cross linker, the sysroot is set to = "/". >> >> Exp-run by: bdrewery (ports/183206) >> MFC after: 3 days >> >> Modified: >> head/gnu/usr.bin/binutils/ld/Makefile >> >> Modified: head/gnu/usr.bin/binutils/ld/Makefile >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:46:01 20= 13 >> (r257267) >> +++ head/gnu/usr.bin/binutils/ld/Makefile Mon Oct 28 19:56:46 20= 13 >> (r257268) >> @@ -31,7 +31,7 @@ CFLAGS+=3D -DTARGET=3D\"${TARGET_TUPLE}\" >> CFLAGS+=3D -DDEFAULT_EMULATION=3D\"${NATIVE_EMULATION}\" >> CFLAGS+=3D -DSCRIPTDIR=3D\"${TOOLS_PREFIX}/usr/libdata\" >> CFLAGS+=3D -DBFD_VERSION_STRING=3D\"${VERSION}\" >> -CFLAGS+=3D -DBINDIR=3D\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=3D\"${TOOLS_= PREFIX}\" >> +CFLAGS+=3D -DBINDIR=3D\"${BINDIR}\" >> -DTARGET_SYSTEM_ROOT=3D\"${TOOLS_PREFIX:U/}\" >> CFLAGS+=3D -DTOOLBINDIR=3D\"${TOOLS_PREFIX}/${BINDIR}/libexec\" >> CFLAGS+=3D -D_GNU_SOURCE >> CFLAGS+=3D -I${SRCDIR}/ld -I${SRCDIR}/bfd >> >=20 >=20 >=20 --=20 Regards, Bryan Drewery --9eDMxavVmD2lNFx75tdc6v1nC9tgGuXiJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJScxC2AAoJEDXXcbtuRpfP5yYH/3lFyLekIXBKhPEG/2XyvDsr UNNqJLqjz8rjyd03oXZenMxRWU9m4zSRJk0dSXgKVrKX+Bb3tUMrNn4skPZcudUV McyyeUswg6X6aGmyS6bOK+VMi7xrauYZ4q7etoyJldYI/5SX7a6gh7reZEk1OxpG TX8fKReT9ht8zSjkaBstdZVnj6Zu06l4gt/6f0n8zO6Uz35m9LlHQwhgXwuMw9OS 2aOWdDg1fdg0WlsR3fe+q3spanbgFjToN408k2L+hF55wNxs5lgE8x3R2UIE9hiN cB0qan6M68UIlTeSR+u+DxN/PZcez5bRM6Js3tcsXQQss9xr1tg8+tTIG/GQtDU= =zsfn -----END PGP SIGNATURE----- --9eDMxavVmD2lNFx75tdc6v1nC9tgGuXiJ-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 03:19:31 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 14822862; Fri, 1 Nov 2013 03:19:31 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E274826FE; Fri, 1 Nov 2013 03:19:30 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rA13JTJq062484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Oct 2013 20:19:30 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rA13JSKw062483; Thu, 31 Oct 2013 20:19:28 -0700 (PDT) (envelope-from jmg) Date: Thu, 31 Oct 2013 20:19:28 -0700 From: John-Mark Gurney To: Luigi Rizzo Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131101031928.GH58155@funkthat.com> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <20131031200502.GB83212@onelab2.iet.unipi.it> <20131031204916.GF58155@funkthat.com> <20131031211337.GA83561@onelab2.iet.unipi.it> <20131031221457.GG58155@funkthat.com> <20131031224106.GA84783@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131031224106.GA84783@onelab2.iet.unipi.it> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 31 Oct 2013 20:19:30 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 03:19:31 -0000 Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 23:41 +0100: > On Thu, Oct 31, 2013 at 03:14:57PM -0700, John-Mark Gurney wrote: > > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100: > > > On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote: > > > > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100: > > > > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote: > > > > > ... > > > > > > Is there any chance all this reworking might get us to a position where > > > > > > the protocol header in an mbuf doesn't have to be 32-bit aligned > > > > > > anymore? We pay a pretty heavy price for that requirement in the > > > > > > drivers of the least capable hardware we support, the systems that have > > > > > > the least horsepower to spare to make an extra copy of each packet to > > > > > > realign it. > > > > > > > > > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to > > > > > access 32-bit protocol fields in the network stack ? > > > > > (16-bit entries should not be an issue) > > > > > > > > my idea has been to make a change to the various ip/tcp/udp layers > > > > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require > > > > strict alignment to copy the header to a stack buffer to align the > > > > data... > > > > > > I'd rather use accessors functions/macros to read/write > > > the unaligned headers so we can hide the #ifdefs in only > > > one place. > > > > I am/was trying to prevent massive code curn... > > > > > The copy to a stack buffer is probably useful even for readability > > > > Oh, I also realized I left out another part of it... > > > > void > > ip_input(struct mbuf *m) > > { > > #ifndef __NO_STRICT_ALIGNMENT > > struct ip tmpip; > > #endif > > struct ip *ip = NULL; > > > > #ifndef __NO_STRICT_ALIGNMENT > > bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip); > > ip = &tmpip; > > #else > > ip = mtod(m, struct ip *); > > #endif > > this is exactly what we shold NOT do. > Apart from the source bloat from conditional blocks, > easily someone will try to use ip to point to options > (which are not copied), etc etc. > > Just copy the header unconditionally, or probably just the > source and destination IP which under normal assumptions > (14 byte mac header) are the only ones where alignment breaks. > Then of course options will have similar problems. > > This is why I think we should use accessors if we want > to solve this problem. Can we get those accessors in ASAP and start requiring new code to use them? The longer we wait, the bigger the work when it happens, and longer that people will put it off... I've been waiting for 5+ years for this (and time to work on it)... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 03:22:43 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76B8BA4D; Fri, 1 Nov 2013 03:22:43 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFBD2743; Fri, 1 Nov 2013 03:22:42 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rA13Mg3v062564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Oct 2013 20:22:42 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rA13MgQS062563; Thu, 31 Oct 2013 20:22:42 -0700 (PDT) (envelope-from jmg) Date: Thu, 31 Oct 2013 20:22:42 -0700 From: John-Mark Gurney To: Andre Oppermann Subject: Re: svn commit: r257455 - head/sys/net Message-ID: <20131101032242.GI58155@funkthat.com> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <5272D6E0.8050709@freebsd.org> <1383258763.31172.46.camel@revolution.hippie.lan> <5272DCA4.8040209@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5272DCA4.8040209@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 31 Oct 2013 20:22:42 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 03:22:43 -0000 Andre Oppermann wrote this message on Thu, Oct 31, 2013 at 23:41 +0100: > >I know of only one modern ARM SoC that's able to DMA network packets on > >a 2-byte boundary (actually even it requires a 4-byte boundary, but it's > >willing to stuff the first 16 bits with zeroes and offset everything > >that follows accordingly). I'm sure there are others, but it's the > >exception rather than the rule. > > Talk about foot shooting. I'm afraid that packet copying may still be > the least evil option in the grand scheme of things. IIRC ARM64 will > be able to do misaligned accesses with only a small performance penalty, > like x86/AMD64. LOL. Really? You really want to say that it's fine for embeded systems to loose around half their network performance because we can't make this change? Because we can't be bothered to handle the code the correct way? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 03:50:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76A96547; Fri, 1 Nov 2013 03:50:12 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3806C288B; Fri, 1 Nov 2013 03:50:11 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id F01B87300A; Fri, 1 Nov 2013 04:51:58 +0100 (CET) Date: Fri, 1 Nov 2013 04:51:58 +0100 From: Luigi Rizzo To: Brooks Davis Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101035158.GA85866@onelab2.iet.unipi.it> References: <20131101020924.GB32951@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131101020924.GB32951@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 03:50:12 -0000 On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote: > On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote: > > as per the subject, after this commit building head on stable/9 > > fails with the error below: > > > > ===> lib/libpam/modules/pam_krb5 (all) > > make: don't know how to make > > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. > > Stop > > > > reverting the commit fixes the build. > > > > Any idea how this can be fixed ? > > I just built world and kernel with a freshly checked out head on > ref9-amd64 so I supect something in your environment. This change > should only impact the installed copy of ld which would have no effect > on a 9-stable system. Any portion of the build system using a version > effected by this change is broken since only the cross build version > should be used and that one will have it's own sysroot value as always > it always has. i do not understand the last sentence, but i am going to try on ref9-amd64 just in case. Were you building it with CLANG by chance ? If it matters i get the errors when i start the build with a stock 'make' (which on 9.2 i believe is FreeBSD's make), using -j 4 and WITHOUT_CLANG=yes (and related options) I will try both with and without CLANG and with/without -j, and it is going to take a while of course... cheers luigi From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 04:58:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 57BAC238; Fri, 1 Nov 2013 04:58:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6B422C1F; Fri, 1 Nov 2013 04:58:17 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id e9so2226134qcy.39 for ; Thu, 31 Oct 2013 21:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=6CUCdOmSM9+3Zs8PaFwRCt6jSD8CKVOH1Zo73sx4+gw=; b=BIFzAkCa28Qqtj0zFO7AFLk/87KlnlmK7f8sW9fHoMbdeVI8vzmLtigTHCPmuwBEns ku1iJGL7Ki9wrz1qFSIhTq71O8cjVqx+HOjm1/lzt0LpnOl3o3o/jW71mTS8XFoBbpsC CP2zkaMxN3BVxmr9HZovY0plKPobLE+tUjv28wfVIUchOioooQASOIwzMxSVnTjbni42 lyfl/4GsNeN4J/jsDsNudeVBBxwU51WD6GjbwFov5JznOBw7lyV6RkHzFSFx2gdFAIAw ftMuH5EoZBI4vdAgAeMfBcoib0GTMapPDY8FGGQIZAQ+Cimsyu6BkxesxufntyFuYntZ 9oEw== MIME-Version: 1.0 X-Received: by 10.224.129.74 with SMTP id n10mr1458699qas.92.1383281897034; Thu, 31 Oct 2013 21:58:17 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Thu, 31 Oct 2013 21:58:16 -0700 (PDT) In-Reply-To: <20131101032242.GI58155@funkthat.com> References: <201310311546.r9VFkAIb049844@svn.freebsd.org> <20131031180336.GA62132@onelab2.iet.unipi.it> <5272AAC4.4030700@freebsd.org> <1383247645.31172.29.camel@revolution.hippie.lan> <5272D6E0.8050709@freebsd.org> <1383258763.31172.46.camel@revolution.hippie.lan> <5272DCA4.8040209@freebsd.org> <20131101032242.GI58155@funkthat.com> Date: Thu, 31 Oct 2013 21:58:16 -0700 X-Google-Sender-Auth: cgNctpOTWTeF1e5T5lhFyhf_rJ4 Message-ID: Subject: Re: svn commit: r257455 - head/sys/net From: Adrian Chadd To: John-Mark Gurney Content-Type: text/plain; charset=ISO-8859-1 Cc: "src-committers@freebsd.org" , Andre Oppermann , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Luigi Rizzo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 04:58:18 -0000 On 31 October 2013 20:22, John-Mark Gurney wrote: > Andre Oppermann wrote this message on Thu, Oct 31, 2013 at 23:41 +0100: >> >I know of only one modern ARM SoC that's able to DMA network packets on >> >a 2-byte boundary (actually even it requires a 4-byte boundary, but it's >> >willing to stuff the first 16 bits with zeroes and offset everything >> >that follows accordingly). I'm sure there are others, but it's the >> >exception rather than the rule. >> >> Talk about foot shooting. I'm afraid that packet copying may still be >> the least evil option in the grand scheme of things. IIRC ARM64 will >> be able to do misaligned accesses with only a small performance penalty, >> like x86/AMD64. > > LOL. > > Really? You really want to say that it's fine for embeded systems to > loose around half their network performance because we can't make this > change? Because we can't be bothered to handle the code the correct > way? We can talk about this some more down the road. There's .. more complicated crap going on here. Mostly due to pulling parts of packets apart and gluing them back together in weird and odd ways. All that encapsulation, decapsulation and re-encapsulation going on means that we won't really be able to always correctly align things in the "best" way for these embedded platforms. So, let's table that as a requirement and start drafting up ways to try and address this. Sneaking in some stack hack to try and make it work for one particular specific code path is not (entirely) enough :) -a From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 05:03:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40A5A4B7; Fri, 1 Nov 2013 05:03:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED622C79; Fri, 1 Nov 2013 05:03:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA153mak026319; Fri, 1 Nov 2013 05:03:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA153mvT026318; Fri, 1 Nov 2013 05:03:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201311010503.rA153mvT026318@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 1 Nov 2013 05:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257490 - head/sys/dev/msk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 05:03:48 -0000 Author: yongari Date: Fri Nov 1 05:03:47 2013 New Revision: 257490 URL: http://svnweb.freebsd.org/changeset/base/257490 Log: Perform media change after setting IFF_DRV_RUNNING flag. Without it, driver would ignore the first link state update if controller already established a link. Reported by: bsam Tested by: bsam Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Nov 1 02:04:05 2013 (r257489) +++ head/sys/dev/msk/if_msk.c Fri Nov 1 05:03:47 2013 (r257490) @@ -4071,12 +4071,12 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, B0_IMSK, sc->msk_intrmask); CSR_READ_4(sc, B0_IMSK); - sc_if->msk_flags &= ~MSK_FLAG_LINK; - mii_mediachg(mii); - ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + sc_if->msk_flags &= ~MSK_FLAG_LINK; + mii_mediachg(mii); + callout_reset(&sc_if->msk_tick_ch, hz, msk_tick, sc_if); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:16:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6C2ABBDF; Fri, 1 Nov 2013 06:16:55 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB42211F; Fri, 1 Nov 2013 06:16:54 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id CC9757300A; Fri, 1 Nov 2013 07:18:42 +0100 (CET) Date: Fri, 1 Nov 2013 07:18:42 +0100 From: Luigi Rizzo To: Brooks Davis Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101061842.GA8911@onelab2.iet.unipi.it> References: <20131101020924.GB32951@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131101020924.GB32951@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:16:55 -0000 On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote: > On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote: > > as per the subject, after this commit building head on stable/9 > > fails with the error below: > > > > ===> lib/libpam/modules/pam_krb5 (all) > > make: don't know how to make > > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. > > Stop > > > > reverting the commit fixes the build. > > > > Any idea how this can be fixed ? > > I just built world and kernel with a freshly checked out head on > ref9-amd64 so I supect something in your environment. This change > should only impact the installed copy of ld which would have no effect > on a 9-stable system. Any portion of the build system using a version > effected by this change is broken since only the cross build version > should be used and that one will have it's own sysroot value as always > it always has. ok so what happens is the following (trying to build HEAD on 9.2, both amd64) - WITHOUT_CLANG and related options: "make toolchain" fails with the error on krb5 "make buildworld" works, and a subsequent "make toolchain" also works - without options (so compiling CLANG) "make toolchain" fails with the error below building shared library libc.so.7 /usr/bin/ld: this linker was not configured to use sysroots cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [libc.so.7] Error code 1 1 error *** [all] Error code 2 1 error "make toolchain" on an empty tree used to work until before this commit, and does work if i revert this single change So does this mean that 'toolchain' now has some prerequisites ? cheers luigi From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:26:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 37B74DF6; Fri, 1 Nov 2013 06:26:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 171662184; Fri, 1 Nov 2013 06:26:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA16QbEZ053224; Fri, 1 Nov 2013 06:26:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA16QbJQ053223; Fri, 1 Nov 2013 06:26:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010626.rA16QbJQ053223@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 06:26: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: r257491 - stable/10/sys/dev/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:26:38 -0000 Author: kib Date: Fri Nov 1 06:26:37 2013 New Revision: 257491 URL: http://svnweb.freebsd.org/changeset/base/257491 Log: MFC r256670: Rewrite RDRAND support: Remove the excessive memory accesses to temporary buffer. Streamline the assembly and unify it between i386 and amd64. Approved by: re (glebius) Modified: stable/10/sys/dev/random/ivy.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/random/ivy.c ============================================================================== --- stable/10/sys/dev/random/ivy.c Fri Nov 1 05:03:47 2013 (r257490) +++ stable/10/sys/dev/random/ivy.c Fri Nov 1 06:26:37 2013 (r257491) @@ -1,8 +1,12 @@ /*- + * Copyright (c) 2013 The FreeBSD Foundation * Copyright (c) 2013 David E. O'Brien * Copyright (c) 2012 Konstantin Belousov * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -58,26 +62,25 @@ static struct random_hardware_source ran }; static inline int -ivy_rng_store(uint64_t *tmp) +ivy_rng_store(long *buf) { #ifdef __GNUCLIKE_ASM - uint32_t count; + long tmp; + int retry; + retry = RETRY_COUNT; __asm __volatile( -#ifdef __amd64__ - "rdrand\t%%rax\n\t" - "jnc\t1f\n\t" - "movq\t%%rax,%1\n\t" - "movl\t$8,%%eax\n" -#else /* i386 */ - "rdrand\t%%eax\n\t" - "jnc\t1f\n\t" - "movl\t%%eax,%1\n\t" - "movl\t$4,%%eax\n" -#endif - "1:\n" /* %eax is cleared by processor on failure */ - : "=a" (count), "=g" (*tmp) : "a" (0) : "cc"); - return (count); + "1:\n\t" + "rdrand %2\n\t" /* read randomness into tmp */ + "jb 2f\n\t" /* CF is set on success, exit retry loop */ + "dec %0\n\t" /* otherwise, retry-- */ + "jne 1b\n\t" /* and loop if retries are not exhausted */ + "jmp 3f\n" /* failure, retry is 0, used as return value */ + "2:\n\t" + "mov %2,%1\n\t" /* *buf = tmp */ + "3:" + : "+q" (retry), "=m" (*buf), "=q" (tmp) : : "cc"); + return (retry); #else /* __GNUCLIKE_ASM */ return (0); #endif @@ -86,23 +89,13 @@ ivy_rng_store(uint64_t *tmp) static int random_ivy_read(void *buf, int c) { - uint8_t *b; - int count, ret, retry; - uint64_t tmp; - - b = buf; - for (count = c; count > 0; count -= ret) { - for (retry = 0; retry < RETRY_COUNT; retry++) { - ret = ivy_rng_store(&tmp); - if (ret != 0) - break; - } - if (ret == 0) + long *b; + int count; + + KASSERT(c % sizeof(long) == 0, ("partial read %d", c)); + for (b = buf, count = c; count > 0; count -= sizeof(long), b++) { + if (ivy_rng_store(b) == 0) break; - if (ret > count) - ret = count; - memcpy(b, &tmp, ret); - b += ret; } return (c - count); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:29:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 66776F8A; Fri, 1 Nov 2013 06:29:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 455A32198; Fri, 1 Nov 2013 06:29:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA16Tdux053574; Fri, 1 Nov 2013 06:29:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA16TdOI053573; Fri, 1 Nov 2013 06:29:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010629.rA16TdOI053573@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 06:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257492 - stable/10/sys/x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:29:39 -0000 Author: kib Date: Fri Nov 1 06:29:38 2013 New Revision: 257492 URL: http://svnweb.freebsd.org/changeset/base/257492 Log: MFC r257069: Add ddb 'show ioapic' and 'show all ioapics' commands. Approved by: re (glebius) Modified: stable/10/sys/x86/x86/io_apic.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/x86/x86/io_apic.c ============================================================================== --- stable/10/sys/x86/x86/io_apic.c Fri Nov 1 06:26:37 2013 (r257491) +++ stable/10/sys/x86/x86/io_apic.c Fri Nov 1 06:29:38 2013 (r257492) @@ -922,3 +922,99 @@ DEFINE_CLASS_0(apic, apic_driver, apic_m static devclass_t apic_devclass; DRIVER_MODULE(apic, nexus, apic_driver, apic_devclass, 0, 0); + +#include "opt_ddb.h" + +#ifdef DDB +#include + +static const char * +ioapic_delivery_mode(uint32_t mode) +{ + + switch (mode) { + case IOART_DELFIXED: + return ("fixed"); + case IOART_DELLOPRI: + return ("lowestpri"); + case IOART_DELSMI: + return ("SMI"); + case IOART_DELRSV1: + return ("rsrvd1"); + case IOART_DELNMI: + return ("NMI"); + case IOART_DELINIT: + return ("INIT"); + case IOART_DELRSV2: + return ("rsrvd2"); + case IOART_DELEXINT: + return ("ExtINT"); + default: + return (""); + } +} + +static u_int +db_ioapic_read(volatile ioapic_t *apic, int reg) +{ + + apic->ioregsel = reg; + return (apic->iowin); +} + +static void +db_show_ioapic_one(volatile ioapic_t *io_addr) +{ + uint32_t r, lo, hi; + int mre, i; + + r = db_ioapic_read(io_addr, IOAPIC_VER); + mre = (r & IOART_VER_MAXREDIR) >> MAXREDIRSHIFT; + db_printf("Id 0x%08x Ver 0x%02x MRE %d\n", + db_ioapic_read(io_addr, IOAPIC_ID), r & IOART_VER_VERSION, mre); + for (i = 0; i < mre; i++) { + lo = db_ioapic_read(io_addr, IOAPIC_REDTBL_LO(i)); + hi = db_ioapic_read(io_addr, IOAPIC_REDTBL_HI(i)); + db_printf(" pin %d Dest %s/%x %smasked Trig %s RemoteIRR %d " + "Polarity %s Status %s DeliveryMode %s Vec %d\n", i, + (lo & IOART_DESTMOD) == IOART_DESTLOG ? "log" : "phy", + (hi & IOART_DEST) >> 24, + (lo & IOART_INTMASK) == IOART_INTMSET ? "" : "not", + (lo & IOART_TRGRMOD) == IOART_TRGRLVL ? "lvl" : "edge", + (lo & IOART_REM_IRR) == IOART_REM_IRR ? 1 : 0, + (lo & IOART_INTPOL) == IOART_INTALO ? "low" : "high", + (lo & IOART_DELIVS) == IOART_DELIVS ? "pend" : "idle", + ioapic_delivery_mode(lo & IOART_DELMOD), + (lo & IOART_INTVEC)); + } +} + +DB_SHOW_COMMAND(ioapic, db_show_ioapic) +{ + struct ioapic *ioapic; + int idx, i; + + if (!have_addr) { + db_printf("usage: show ioapic index\n"); + return; + } + + idx = (int)addr; + i = 0; + STAILQ_FOREACH(ioapic, &ioapic_list, io_next) { + if (idx == i) { + db_show_ioapic_one(ioapic->io_addr); + break; + } + i++; + } +} + +DB_SHOW_ALL_COMMAND(ioapics, db_show_all_ioapics) +{ + struct ioapic *ioapic; + + STAILQ_FOREACH(ioapic, &ioapic_list, io_next) + db_show_ioapic_one(ioapic->io_addr); +} +#endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:31:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5D70319; Fri, 1 Nov 2013 06:31:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C35F821D2; Fri, 1 Nov 2013 06:31:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA16V2GV055922; Fri, 1 Nov 2013 06:31:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA16V2e2055917; Fri, 1 Nov 2013 06:31:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010631.rA16V2e2055917@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 06:31: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: r257493 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:31:02 -0000 Author: kib Date: Fri Nov 1 06:31:02 2013 New Revision: 257493 URL: http://svnweb.freebsd.org/changeset/base/257493 Log: MFC r257070: Move the PCI_DMA_BOUNDARY definition into the pcivar.h. Approved by: re (glebius) Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Fri Nov 1 06:29:38 2013 (r257492) +++ stable/10/sys/dev/pci/pci.c Fri Nov 1 06:31:02 2013 (r257493) @@ -70,10 +70,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "pci_if.h" -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) -#define PCI_DMA_BOUNDARY 0x100000000 -#endif - #define PCIR_IS_BIOS(cfg, reg) \ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Fri Nov 1 06:29:38 2013 (r257492) +++ stable/10/sys/dev/pci/pcivar.h Fri Nov 1 06:31:02 2013 (r257493) @@ -499,6 +499,15 @@ void pci_restore_state(device_t dev); void pci_save_state(device_t dev); int pci_set_max_read_req(device_t dev, int size); + +#ifdef BUS_SPACE_MAXADDR +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#define PCI_DMA_BOUNDARY 0x100000000 +#else +#define PCI_DMA_BOUNDARY 0 +#endif +#endif + #endif /* _SYS_BUS_H_ */ /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:32:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0CECA452; Fri, 1 Nov 2013 06:32:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF1B121DF; Fri, 1 Nov 2013 06:32:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA16WGx9056095; Fri, 1 Nov 2013 06:32:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA16WGRS056094; Fri, 1 Nov 2013 06:32:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010632.rA16WGRS056094@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 06:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257494 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:32:17 -0000 Author: kib Date: Fri Nov 1 06:32:16 2013 New Revision: 257494 URL: http://svnweb.freebsd.org/changeset/base/257494 Log: MFC r257071: Add some definitions for the bits in root control and status PCIe cap registers. Approved by: re (glebius) Modified: stable/10/sys/dev/pci/pcireg.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/pci/pcireg.h ============================================================================== --- stable/10/sys/dev/pci/pcireg.h Fri Nov 1 06:31:02 2013 (r257493) +++ stable/10/sys/dev/pci/pcireg.h Fri Nov 1 06:32:16 2013 (r257494) @@ -762,8 +762,17 @@ #define PCIEM_SLOT_STA_EIS 0x0080 #define PCIEM_SLOT_STA_DLLSC 0x0100 #define PCIER_ROOT_CTL 0x1c +#define PCIEM_ROOT_CTL_SERR_CORR 0x0001 +#define PCIEM_ROOT_CTL_SERR_NONFATAL 0x0002 +#define PCIEM_ROOT_CTL_SERR_FATAL 0x0004 +#define PCIEM_ROOT_CTL_PME 0x0008 +#define PCIEM_ROOT_CTL_CRS_VIS 0x0010 #define PCIER_ROOT_CAP 0x1e +#define PCIEM_ROOT_CAP_CRS_VIS 0x0001 #define PCIER_ROOT_STA 0x20 +#define PCIEM_ROOT_STA_PME_REQID_MASK 0x0000ffff +#define PCIEM_ROOT_STA_PME_STATUS 0x00010000 +#define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:33:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 580C3581; Fri, 1 Nov 2013 06:33:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 469C021E8; Fri, 1 Nov 2013 06:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA16XItL056298; Fri, 1 Nov 2013 06:33:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA16XHud056296; Fri, 1 Nov 2013 06:33:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010633.rA16XHud056296@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 06:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r257495 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:33:18 -0000 Author: kib Date: Fri Nov 1 06:33:17 2013 New Revision: 257495 URL: http://svnweb.freebsd.org/changeset/base/257495 Log: MFC r257072: Make pci_get_dma_tag() non-static. Approved by: re (glebius) Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_private.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Fri Nov 1 06:32:16 2013 (r257494) +++ stable/10/sys/dev/pci/pci.c Fri Nov 1 06:33:17 2013 (r257495) @@ -96,7 +96,6 @@ static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); static char *pci_describe_device(device_t dev); -static bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); static int pci_modevent(module_t mod, int what, void *arg); static void pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg); Modified: stable/10/sys/dev/pci/pci_private.h ============================================================================== --- stable/10/sys/dev/pci/pci_private.h Fri Nov 1 06:32:16 2013 (r257494) +++ stable/10/sys/dev/pci/pci_private.h Fri Nov 1 06:33:17 2013 (r257495) @@ -116,6 +116,7 @@ int pci_child_pnpinfo_str_method(device int pci_assign_interrupt_method(device_t dev, device_t child); int pci_resume(device_t dev); int pci_suspend(device_t dev); +bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); /** Restore the config register state. The state must be previously * saved with pci_cfg_save. However, the pci bus driver takes care of From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 06:56:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4114ED11; Fri, 1 Nov 2013 06:56:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2126B2320; Fri, 1 Nov 2013 06:56:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA16uS5l062960; Fri, 1 Nov 2013 06:56:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA16uSf5062959; Fri, 1 Nov 2013 06:56:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010656.rA16uSf5062959@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 06:56:28 +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: r257496 - stable/9/sys/x86/x86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 06:56:29 -0000 Author: kib Date: Fri Nov 1 06:56:28 2013 New Revision: 257496 URL: http://svnweb.freebsd.org/changeset/base/257496 Log: MFC r257069: Add ddb 'show ioapic' and 'show all ioapics' commands. Modified: stable/9/sys/x86/x86/io_apic.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/x86/io_apic.c ============================================================================== --- stable/9/sys/x86/x86/io_apic.c Fri Nov 1 06:33:17 2013 (r257495) +++ stable/9/sys/x86/x86/io_apic.c Fri Nov 1 06:56:28 2013 (r257496) @@ -922,3 +922,99 @@ DEFINE_CLASS_0(apic, apic_driver, apic_m static devclass_t apic_devclass; DRIVER_MODULE(apic, nexus, apic_driver, apic_devclass, 0, 0); + +#include "opt_ddb.h" + +#ifdef DDB +#include + +static const char * +ioapic_delivery_mode(uint32_t mode) +{ + + switch (mode) { + case IOART_DELFIXED: + return ("fixed"); + case IOART_DELLOPRI: + return ("lowestpri"); + case IOART_DELSMI: + return ("SMI"); + case IOART_DELRSV1: + return ("rsrvd1"); + case IOART_DELNMI: + return ("NMI"); + case IOART_DELINIT: + return ("INIT"); + case IOART_DELRSV2: + return ("rsrvd2"); + case IOART_DELEXINT: + return ("ExtINT"); + default: + return (""); + } +} + +static u_int +db_ioapic_read(volatile ioapic_t *apic, int reg) +{ + + apic->ioregsel = reg; + return (apic->iowin); +} + +static void +db_show_ioapic_one(volatile ioapic_t *io_addr) +{ + uint32_t r, lo, hi; + int mre, i; + + r = db_ioapic_read(io_addr, IOAPIC_VER); + mre = (r & IOART_VER_MAXREDIR) >> MAXREDIRSHIFT; + db_printf("Id 0x%08x Ver 0x%02x MRE %d\n", + db_ioapic_read(io_addr, IOAPIC_ID), r & IOART_VER_VERSION, mre); + for (i = 0; i < mre; i++) { + lo = db_ioapic_read(io_addr, IOAPIC_REDTBL_LO(i)); + hi = db_ioapic_read(io_addr, IOAPIC_REDTBL_HI(i)); + db_printf(" pin %d Dest %s/%x %smasked Trig %s RemoteIRR %d " + "Polarity %s Status %s DeliveryMode %s Vec %d\n", i, + (lo & IOART_DESTMOD) == IOART_DESTLOG ? "log" : "phy", + (hi & IOART_DEST) >> 24, + (lo & IOART_INTMASK) == IOART_INTMSET ? "" : "not", + (lo & IOART_TRGRMOD) == IOART_TRGRLVL ? "lvl" : "edge", + (lo & IOART_REM_IRR) == IOART_REM_IRR ? 1 : 0, + (lo & IOART_INTPOL) == IOART_INTALO ? "low" : "high", + (lo & IOART_DELIVS) == IOART_DELIVS ? "pend" : "idle", + ioapic_delivery_mode(lo & IOART_DELMOD), + (lo & IOART_INTVEC)); + } +} + +DB_SHOW_COMMAND(ioapic, db_show_ioapic) +{ + struct ioapic *ioapic; + int idx, i; + + if (!have_addr) { + db_printf("usage: show ioapic index\n"); + return; + } + + idx = (int)addr; + i = 0; + STAILQ_FOREACH(ioapic, &ioapic_list, io_next) { + if (idx == i) { + db_show_ioapic_one(ioapic->io_addr); + break; + } + i++; + } +} + +DB_SHOW_ALL_COMMAND(ioapics, db_show_all_ioapics) +{ + struct ioapic *ioapic; + + STAILQ_FOREACH(ioapic, &ioapic_list, io_next) + db_show_ioapic_one(ioapic->io_addr); +} +#endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 07:03:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E7E17F99; Fri, 1 Nov 2013 07:03:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D61312384; Fri, 1 Nov 2013 07:03:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA173igF066228; Fri, 1 Nov 2013 07:03:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA173i99066227; Fri, 1 Nov 2013 07:03:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311010703.rA173i99066227@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 07:03:44 +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: r257497 - stable/9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 07:03:45 -0000 Author: kib Date: Fri Nov 1 07:03:44 2013 New Revision: 257497 URL: http://svnweb.freebsd.org/changeset/base/257497 Log: MFC r257071: Add some definitions for the bits in root control and status PCIe cap registers. Modified: stable/9/sys/dev/pci/pcireg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pci/pcireg.h ============================================================================== --- stable/9/sys/dev/pci/pcireg.h Fri Nov 1 06:56:28 2013 (r257496) +++ stable/9/sys/dev/pci/pcireg.h Fri Nov 1 07:03:44 2013 (r257497) @@ -752,8 +752,17 @@ #define PCIEM_SLOT_STA_EIS 0x0080 #define PCIEM_SLOT_STA_DLLSC 0x0100 #define PCIER_ROOT_CTL 0x1c +#define PCIEM_ROOT_CTL_SERR_CORR 0x0001 +#define PCIEM_ROOT_CTL_SERR_NONFATAL 0x0002 +#define PCIEM_ROOT_CTL_SERR_FATAL 0x0004 +#define PCIEM_ROOT_CTL_PME 0x0008 +#define PCIEM_ROOT_CTL_CRS_VIS 0x0010 #define PCIER_ROOT_CAP 0x1e +#define PCIEM_ROOT_CAP_CRS_VIS 0x0001 #define PCIER_ROOT_STA 0x20 +#define PCIEM_ROOT_STA_PME_REQID_MASK 0x0000ffff +#define PCIEM_ROOT_STA_PME_STATUS 0x00010000 +#define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 10:01:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45CFB498; Fri, 1 Nov 2013 10:01:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19EA82DC8; Fri, 1 Nov 2013 10:01:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1A1veA025620; Fri, 1 Nov 2013 10:01:57 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1A1vFf025618; Fri, 1 Nov 2013 10:01:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311011001.rA1A1vFf025618@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 1 Nov 2013 10:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257498 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 10:01:58 -0000 Author: glebius Date: Fri Nov 1 10:01:57 2013 New Revision: 257498 URL: http://svnweb.freebsd.org/changeset/base/257498 Log: prison_check_ip4() can take const arguments. Modified: head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Nov 1 07:03:44 2013 (r257497) +++ head/sys/kern/kern_jail.c Fri Nov 1 10:01:57 2013 (r257498) @@ -135,7 +135,7 @@ static void prison_racct_modify(struct p static void prison_racct_detach(struct prison *pr); #endif #ifdef INET -static int _prison_check_ip4(struct prison *pr, struct in_addr *ia); +static int _prison_check_ip4(const struct prison *, const struct in_addr *); static int prison_restrict_ip4(struct prison *pr, struct in_addr *newip4); #endif #ifdef INET6 @@ -2930,7 +2930,7 @@ prison_remote_ip4(struct ucred *cred, st * doesn't allow IPv4. Address passed in in NBO. */ static int -_prison_check_ip4(struct prison *pr, struct in_addr *ia) +_prison_check_ip4(const struct prison *pr, const struct in_addr *ia) { int i, a, z, d; @@ -2960,7 +2960,7 @@ _prison_check_ip4(struct prison *pr, str } int -prison_check_ip4(struct ucred *cred, struct in_addr *ia) +prison_check_ip4(const struct ucred *cred, const struct in_addr *ia) { struct prison *pr; int error; Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Fri Nov 1 07:03:44 2013 (r257497) +++ head/sys/sys/jail.h Fri Nov 1 10:01:57 2013 (r257498) @@ -384,7 +384,7 @@ int prison_equal_ip4(struct prison *, st int prison_get_ip4(struct ucred *cred, struct in_addr *ia); int prison_local_ip4(struct ucred *cred, struct in_addr *ia); int prison_remote_ip4(struct ucred *cred, struct in_addr *ia); -int prison_check_ip4(struct ucred *cred, struct in_addr *ia); +int prison_check_ip4(const struct ucred *, const struct in_addr *); int prison_saddrsel_ip4(struct ucred *, struct in_addr *); #ifdef INET6 int prison_equal_ip6(struct prison *, struct prison *); From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 10:18:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 48623C9C; Fri, 1 Nov 2013 10:18:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3604D2EDE; Fri, 1 Nov 2013 10:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1AIg9V030151; Fri, 1 Nov 2013 10:18:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1AIfSG030147; Fri, 1 Nov 2013 10:18:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311011018.rA1AIfSG030147@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 1 Nov 2013 10:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257499 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 10:18:42 -0000 Author: glebius Date: Fri Nov 1 10:18:41 2013 New Revision: 257499 URL: http://svnweb.freebsd.org/changeset/base/257499 Log: Cleanup in_ifscrub(), which is just an entry to in_scrubprefix(). Modified: head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet/in_var.h head/sys/netinet/raw_ip.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Nov 1 10:01:57 2013 (r257498) +++ head/sys/netinet/if_ether.c Fri Nov 1 10:18:41 2013 (r257499) @@ -142,7 +142,7 @@ static const struct netisr_handler arp_n #ifdef AF_INET /* - * called by in_ifscrub to remove entry from the table when + * called by in_scrubprefix() to remove entry from the table when * the interface goes away */ void Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Nov 1 10:01:57 2013 (r257498) +++ head/sys/netinet/in.c Fri Nov 1 10:18:41 2013 (r257499) @@ -488,7 +488,7 @@ in_control(struct socket *so, u_long cmd * is the same as before, then the call is * un-necessarily executed here. */ - in_ifscrub(ifp, ia, LLE_STATIC); + in_scrubprefix(ia, LLE_STATIC); ia->ia_sockmask = ifra->ifra_mask; ia->ia_sockmask.sin_family = AF_INET; ia->ia_subnetmask = @@ -497,7 +497,7 @@ in_control(struct socket *so, u_long cmd } if ((ifp->if_flags & IFF_POINTOPOINT) && (ifra->ifra_dstaddr.sin_family == AF_INET)) { - in_ifscrub(ifp, ia, LLE_STATIC); + in_scrubprefix(ia, LLE_STATIC); ia->ia_dstaddr = ifra->ifra_dstaddr; maskIsNew = 1; /* We lie; but the effect's the same */ } @@ -523,9 +523,9 @@ in_control(struct socket *so, u_long cmd case SIOCDIFADDR: /* - * in_ifscrub kills the interface route. + * in_scrubprefix() kills the interface route. */ - in_ifscrub(ifp, ia, LLE_STATIC); + in_scrubprefix(ia, LLE_STATIC); /* * in_ifadown gets rid of all the rest of @@ -771,16 +771,6 @@ in_lifaddr_ioctl(struct socket *so, u_lo } /* - * Delete any existing route for an interface. - */ -void -in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia, u_int flags) -{ - - in_scrubprefix(ia, flags); -} - -/* * Initialize an interface's internet address * and routing table entry. */ Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Fri Nov 1 10:01:57 2013 (r257498) +++ head/sys/netinet/in_var.h Fri Nov 1 10:18:41 2013 (r257499) @@ -412,7 +412,6 @@ int in_addprefix(struct in_ifaddr *, int int in_scrubprefix(struct in_ifaddr *, u_int); void ip_input(struct mbuf *); int in_ifadown(struct ifaddr *ifa, int); -void in_ifscrub(struct ifnet *, struct in_ifaddr *, u_int); struct mbuf *ip_fastforward(struct mbuf *); void *in_domifattach(struct ifnet *); void in_domifdetach(struct ifnet *, void *); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri Nov 1 10:01:57 2013 (r257498) +++ head/sys/netinet/raw_ip.c Fri Nov 1 10:18:41 2013 (r257499) @@ -736,9 +736,9 @@ rip_ctlinput(int cmd, struct sockaddr *s ifa_ref(&ia->ia_ifa); IN_IFADDR_RUNLOCK(); /* - * in_ifscrub kills the interface route. + * in_scrubprefix() kills the interface route. */ - in_ifscrub(ia->ia_ifp, ia, 0); + in_scrubprefix(ia, 0); /* * in_ifadown gets rid of all the rest of the * routes. This is not quite the right thing From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 10:29:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF6941ED; Fri, 1 Nov 2013 10:29:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD4992F7D; Fri, 1 Nov 2013 10:29:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1ATBBn033469; Fri, 1 Nov 2013 10:29:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1ATBkY033466; Fri, 1 Nov 2013 10:29:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311011029.rA1ATBkY033466@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 1 Nov 2013 10:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257500 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 10:29:11 -0000 Author: glebius Date: Fri Nov 1 10:29:10 2013 New Revision: 257500 URL: http://svnweb.freebsd.org/changeset/base/257500 Log: in_ifadown() can be void. Modified: head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Fri Nov 1 10:18:41 2013 (r257499) +++ head/sys/netinet/in_rmx.c Fri Nov 1 10:29:10 2013 (r257500) @@ -433,15 +433,15 @@ in_ifadownkill(struct radix_node *rn, vo return 0; } -int +void in_ifadown(struct ifaddr *ifa, int delete) { struct in_ifadown_arg arg; struct radix_node_head *rnh; int fibnum; - if (ifa->ifa_addr->sa_family != AF_INET) - return 1; + KASSERT(ifa->ifa_addr->sa_family == AF_INET, + ("%s: wrong family", __func__)); for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { rnh = rt_tables_get_rnh(fibnum, AF_INET); @@ -452,7 +452,6 @@ in_ifadown(struct ifaddr *ifa, int delet RADIX_NODE_HEAD_UNLOCK(rnh); ifa->ifa_flags &= ~IFA_ROUTE; /* XXXlocking? */ } - return 0; } /* Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Fri Nov 1 10:18:41 2013 (r257499) +++ head/sys/netinet/in_var.h Fri Nov 1 10:29:10 2013 (r257500) @@ -411,7 +411,7 @@ void in_rtqdrain(void); int in_addprefix(struct in_ifaddr *, int); int in_scrubprefix(struct in_ifaddr *, u_int); void ip_input(struct mbuf *); -int in_ifadown(struct ifaddr *ifa, int); +void in_ifadown(struct ifaddr *ifa, int); struct mbuf *ip_fastforward(struct mbuf *); void *in_domifattach(struct ifnet *); void in_domifdetach(struct ifnet *, void *); From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 10:32:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1BE0A654; Fri, 1 Nov 2013 10:32:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E64A22002; Fri, 1 Nov 2013 10:32:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1AWX2w036082; Fri, 1 Nov 2013 10:32:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1AWX92036081; Fri, 1 Nov 2013 10:32:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311011032.rA1AWX92036081@svn.freebsd.org> From: Alexander Motin Date: Fri, 1 Nov 2013 10:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257501 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 10:32:34 -0000 Author: mav Date: Fri Nov 1 10:32:33 2013 New Revision: 257501 URL: http://svnweb.freebsd.org/changeset/base/257501 Log: Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not allocate memory and so not require sleepable environment. getenv() has already used on-stack temporary storage, so just use it more rationally. getenv_string() receives buffer as argument, so don't need another one. Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Fri Nov 1 10:29:10 2013 (r257500) +++ head/sys/kern/kern_environment.c Fri Nov 1 10:32:33 2013 (r257501) @@ -315,20 +315,12 @@ char * getenv(const char *name) { char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1]; - char *ret, *cp; - int len; + char *ret; if (dynamic_kenv) { - mtx_lock(&kenv_lock); - cp = _getenv_dynamic(name, NULL); - if (cp != NULL) { - strcpy(buf, cp); - mtx_unlock(&kenv_lock); - len = strlen(buf) + 1; - ret = malloc(len, M_KENV, M_WAITOK); - strcpy(ret, buf); + if (getenv_string(name, buf, sizeof(buf))) { + ret = strdup(buf, M_KENV); } else { - mtx_unlock(&kenv_lock); ret = NULL; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "getenv"); @@ -458,15 +450,20 @@ unsetenv(const char *name) int getenv_string(const char *name, char *data, int size) { - char *tmp; + char *cp; - tmp = getenv(name); - if (tmp != NULL) { - strlcpy(data, tmp, size); - freeenv(tmp); - return (1); - } else - return (0); + if (dynamic_kenv) { + mtx_lock(&kenv_lock); + cp = _getenv_dynamic(name, NULL); + if (cp != NULL) + strlcpy(data, cp, size); + mtx_unlock(&kenv_lock); + } else { + cp = _getenv_static(name); + if (cp != NULL) + strlcpy(data, cp, size); + } + return (cp != NULL); } /* @@ -535,18 +532,15 @@ getenv_ulong(const char *name, unsigned int getenv_quad(const char *name, quad_t *data) { - char *value; + char value[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1]; char *vtp; quad_t iv; - value = getenv(name); - if (value == NULL) + if (!getenv_string(name, value, sizeof(value))) return (0); iv = strtoq(value, &vtp, 0); - if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) { - freeenv(value); + if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) return (0); - } switch (vtp[0]) { case 't': case 'T': iv *= 1024; @@ -559,11 +553,9 @@ getenv_quad(const char *name, quad_t *da case '\0': break; default: - freeenv(value); return (0); } *data = iv; - freeenv(value); return (1); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 10:42:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8686FD9F; Fri, 1 Nov 2013 10:42:33 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7251A210C; Fri, 1 Nov 2013 10:42:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1AgXFU039364; Fri, 1 Nov 2013 10:42:33 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1AgX0k039363; Fri, 1 Nov 2013 10:42:33 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311011042.rA1AgX0k039363@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 1 Nov 2013 10:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257502 - head/usr.bin/limits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 10:42:33 -0000 Author: pluknet Date: Fri Nov 1 10:42:32 2013 New Revision: 257502 URL: http://svnweb.freebsd.org/changeset/base/257502 Log: Remove the dependency on procfs. Reviewed by: kib MFC after: 1 week X-MFC with: r257430 Modified: head/usr.bin/limits/limits.1 Modified: head/usr.bin/limits/limits.1 ============================================================================== --- head/usr.bin/limits/limits.1 Fri Nov 1 10:32:33 2013 (r257501) +++ head/usr.bin/limits/limits.1 Fri Nov 1 10:42:32 2013 (r257502) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2012 +.Dd October 31, 2013 .Dt LIMITS 1 .Os .Sh NAME @@ -87,9 +87,6 @@ Like the previous usage, it outputs thes output, except that it will emit them in .Ic eval format, suitable for the calling shell. -The calling shell is determined by examining the entries in the -.Pa /proc -file system for the parent process. If the shell is known (i.e., it is one of .Nm sh , csh , bash , tcsh , ksh , pdksh or @@ -386,21 +383,6 @@ utility does not handle commands with eq signs in their names, for obvious reasons. .Pp -When eval output is selected, the -.Pa /proc -file system must be installed -and mounted for the shell to be correctly determined, and therefore -output syntax correct for the running shell. -The default output is valid for -.Xr sh 1 , -so this means that any -usage of -.Nm -in eval mode prior mounting -.Pa /proc -may only occur in standard bourne -shell scripts. -.Pp The .Nm utility makes no effort to ensure that resource settings emitted or displayed From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 11:28:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D9CB2651; Fri, 1 Nov 2013 11:28:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C7BDC2413; Fri, 1 Nov 2013 11:28:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1BSuWZ054149; Fri, 1 Nov 2013 11:28:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1BSulV054148; Fri, 1 Nov 2013 11:28:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201311011128.rA1BSulV054148@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 1 Nov 2013 11:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257504 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 11:28:56 -0000 Author: jilles Date: Fri Nov 1 11:28:56 2013 New Revision: 257504 URL: http://svnweb.freebsd.org/changeset/base/257504 Log: sh: Reorder union node to reduce its size on 64-bit platforms. Modified: head/bin/sh/nodetypes Modified: head/bin/sh/nodetypes ============================================================================== --- head/bin/sh/nodetypes Fri Nov 1 11:02:59 2013 (r257503) +++ head/bin/sh/nodetypes Fri Nov 1 11:28:56 2013 (r257504) @@ -118,16 +118,16 @@ NFROMTO nfile # fd<> fname NAPPEND nfile # fd>> fname NCLOBBER nfile # fd>| fname type int - next nodeptr # next redirection in list fd int # file descriptor being redirected + next nodeptr # next redirection in list fname nodeptr # file name, in a NARG node expfname temp char *expfname # actual file name NTOFD ndup # fd<&dupfd NFROMFD ndup # fd>&dupfd type int - next nodeptr # next redirection in list fd int # file descriptor being redirected + next nodeptr # next redirection in list dupfd int # file descriptor to duplicate vname nodeptr # file name if fd>&$var @@ -135,8 +135,8 @@ NFROMFD ndup # fd>&dupfd NHERE nhere # fd<<\! NXHERE nhere # fd< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0245B1A for ; Fri, 1 Nov 2013 12:15:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1A7E276F for ; Fri, 1 Nov 2013 12:15:27 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1CFRj9046051 for ; Fri, 1 Nov 2013 12:15:27 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rA1CFQhG046045 for svn-src-all@freebsd.org; Fri, 1 Nov 2013 12:15:26 GMT (envelope-from bdrewery) Received: (qmail 96826 invoked from network); 1 Nov 2013 07:15:17 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 1 Nov 2013 07:15:17 -0500 Message-ID: <52739B4C.9090007@FreeBSD.org> Date: Fri, 01 Nov 2013 07:15:08 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Luigi Rizzo , Brooks Davis Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld References: <20131101020924.GB32951@lor.one-eyed-alien.net> <20131101061842.GA8911@onelab2.iet.unipi.it> In-Reply-To: <20131101061842.GA8911@onelab2.iet.unipi.it> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XrsitPWbIgEkJMoTU0Een5m9vpm80mxgb" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 12:15:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XrsitPWbIgEkJMoTU0Een5m9vpm80mxgb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 11/1/2013 1:18 AM, Luigi Rizzo wrote: > On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote: >> On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote: >>> as per the subject, after this commit building head on stable/9 >>> fails with the error below: >>> >>> =3D=3D=3D> lib/libpam/modules/pam_krb5 (all) >>> make: don't know how to make >>> /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/= bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. >>> Stop >>> >>> reverting the commit fixes the build. >>> >>> Any idea how this can be fixed ? >> >> I just built world and kernel with a freshly checked out head on >> ref9-amd64 so I supect something in your environment. This change >> should only impact the installed copy of ld which would have no effect= >> on a 9-stable system. Any portion of the build system using a version= >> effected by this change is broken since only the cross build version >> should be used and that one will have it's own sysroot value as always= >> it always has. >=20 > ok so what happens is the following (trying to build HEAD on 9.2, both = amd64) >=20 > - WITHOUT_CLANG and related options: > "make toolchain" fails with the error on krb5 > "make buildworld" works, and a subsequent > "make toolchain" also works >=20 > - without options (so compiling CLANG) >=20 > "make toolchain" fails with the error below >=20 > building shared library libc.so.7 > /usr/bin/ld: this linker was not configured to use sysroots > cc: error: linker command failed with exit code 1 (use -v to see in= vocation) Are you using ccache? I've seen this error with that before r257268. > *** [libc.so.7] Error code 1 > 1 error > *** [all] Error code 2 > 1 error >=20 >=20 > "make toolchain" on an empty tree used to work until before this commit= , > and does work if i revert this single change >=20 > So does this mean that 'toolchain' now has some prerequisites ? >=20 > cheers > luigi > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >=20 --=20 Regards, Bryan Drewery --XrsitPWbIgEkJMoTU0Een5m9vpm80mxgb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSc5tNAAoJEDXXcbtuRpfPcboH/0CozDCAOvtW+K+RRoHhxZQd TbEFeK/DW9OvQidwUK+ufWFEEqbxz5A3tJ9fJiDZ9myDkhH+H3bHjPFj9uAQngMf 3w2loKdDYnCxmB2huyXhc/rhzxKaarAqFMb3lszBKgFnhG9C0COzmBcIx3wOJzX4 dGh7FvYiPrIZf/VZr+pEn/Fgd17gM4kHsSocmDyAgEXHWekug8cA2ewFdK/Y91aF wgkfqbonlu5rH5SGptkx2W8V+NjrDSyFgZs57VOyZAUxP1M95Ao2pyjXOCqaqbgF 1ycBcZQQRgss+PBgSh/U1tTyOyslScl+7GD+/I3G+SMXN3FMGsKEaXjb2v3RdwA= =kgxj -----END PGP SIGNATURE----- --XrsitPWbIgEkJMoTU0Een5m9vpm80mxgb-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 12:37:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A52D64CB; Fri, 1 Nov 2013 12:37:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 929B528B4; Fri, 1 Nov 2013 12:37:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1CbbKv077405; Fri, 1 Nov 2013 12:37:37 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1Cbbxc077403; Fri, 1 Nov 2013 12:37:37 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201311011237.rA1Cbbxc077403@svn.freebsd.org> From: Bryan Drewery Date: Fri, 1 Nov 2013 12:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257505 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 12:37:37 -0000 Author: bdrewery (ports committer) Date: Fri Nov 1 12:37:36 2013 New Revision: 257505 URL: http://svnweb.freebsd.org/changeset/base/257505 Log: Add -f support to 'pkg bootstrap' and 'pkg add' to force installation of pkg(8) even if already installed. This is useful if you somehow messup pkg(8) and need to reinstall from remote with it already being registered in the pkg(8) /var/db/pkg database. Also add some sanity checks to 'pkg add'. Approved by: bapt MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.7 head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.7 ============================================================================== --- head/usr.sbin/pkg/pkg.7 Fri Nov 1 11:28:56 2013 (r257504) +++ head/usr.sbin/pkg/pkg.7 Fri Nov 1 12:37:36 2013 (r257505) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2013 +.Dd November 1, 2013 .Dt PKG 7 .Os .Sh NAME @@ -35,11 +35,13 @@ .Ao Ar command Ac .Nm add +.Op Fl f .Ao Pa pkg.txz Ac .Nm .Fl N .Nm bootstrap +.Op Fl f .Sh DESCRIPTION .Nm is the package management tool. @@ -55,7 +57,7 @@ The first time invoked, will bootstrap the real .Xr pkg 8 from a remote repository. -.Bl -tag -width "pkg add xxxxxxx" +.Bl -tag -width "pkg bootstrap" .It Nm Ao Ar command Ac If .Xr pkg 8 @@ -63,7 +65,7 @@ is not installed yet, it will be fetched installed, and then have the original command forwarded to it. If already installed, the command requested will be forwarded to the real .Xr pkg 8 . -.It Nm Li add Ao Pa pkg.txz Ac +.It Nm Li add Oo Fl f Oc Ao Pa pkg.txz Ac Install .Xr pkg 8 from a local package instead of fetching from remote. @@ -72,16 +74,26 @@ If a file exists and signature checking is enabled, then the signature will be verified before installing the package. +If the +.Fl f +flag is specified, then +.Xr pkg 8 +will be installed regardless if it is already installed. .It Nm Fl N Do not bootstrap, just determine if .Xr pkg 8 is actually installed or not. Returns 0 and the number of packages installed if it is, otherwise 1. -.It Nm Li bootstrap +.It Nm Li bootstrap Op Fl f Attempt to bootstrap and do not forward anything to .Xr pkg 8 after it is installed. +If the +.Fl f +flag is specified, then +.Xr pkg 8 +will be fetched and installed regardless if it is already installed. .El .Sh CONFIGURATION Configuration varies in whether it is in a repository configuration file Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Nov 1 11:28:56 2013 (r257504) +++ head/usr.sbin/pkg/pkg.c Fri Nov 1 12:37:36 2013 (r257505) @@ -135,7 +135,7 @@ cleanup: } static int -install_pkg_static(const char *path, const char *pkgpath) +install_pkg_static(const char *path, const char *pkgpath, bool force) { int pstat; pid_t pid; @@ -144,7 +144,12 @@ install_pkg_static(const char *path, con case -1: return (-1); case 0: - execl(path, "pkg-static", "add", pkgpath, (char *)NULL); + if (force) + execl(path, "pkg-static", "add", "-f", pkgpath, + (char *)NULL); + else + execl(path, "pkg-static", "add", pkgpath, + (char *)NULL); _exit(1); default: break; @@ -740,7 +745,7 @@ cleanup: } static int -bootstrap_pkg(void) +bootstrap_pkg(bool force) { FILE *config; int fd_pkg, fd_sig; @@ -801,7 +806,7 @@ bootstrap_pkg(void) } if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0) - ret = install_pkg_static(pkgstatic, tmppkg); + ret = install_pkg_static(pkgstatic, tmppkg, force); snprintf(conf, MAXPATHLEN, "%s/etc/pkg.conf", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); @@ -866,7 +871,7 @@ pkg_query_yes_no(void) } static int -bootstrap_pkg_local(const char *pkgpath) +bootstrap_pkg_local(const char *pkgpath, bool force) { char path[MAXPATHLEN]; char pkgstatic[MAXPATHLEN]; @@ -898,7 +903,7 @@ bootstrap_pkg_local(const char *pkgpath) } if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0) - ret = install_pkg_static(pkgstatic, pkgpath); + ret = install_pkg_static(pkgstatic, pkgpath, force); cleanup: close(fd_pkg); @@ -912,12 +917,24 @@ int main(__unused int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; - bool yes = false; + const char *pkgarg; + bool bootstrap_only, force, yes; + + bootstrap_only = false; + force = false; + pkgarg = NULL; + yes = false; snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); - if (access(pkgpath, X_OK) == -1) { + if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) { + bootstrap_only = true; + if (argc == 3 && strcmp(argv[2], "-f") == 0) + force = true; + } + + if ((bootstrap_only && force) || access(pkgpath, X_OK) == -1) { /* * To allow 'pkg -N' to be used as a reliable test for whether * a system is configured to use pkg, don't bootstrap pkg @@ -928,9 +945,21 @@ main(__unused int argc, char *argv[]) config_init(); - if (argc > 2 && strcmp(argv[1], "add") == 0 && - access(argv[2], R_OK) == 0) { - if (bootstrap_pkg_local(argv[2]) != 0) + if (argc > 1 && strcmp(argv[1], "add") == 0) { + if (argc > 2 && strcmp(argv[2], "-f") == 0) { + force = true; + pkgarg = argv[3]; + } else + pkgarg = argv[2]; + if (pkgarg == NULL) { + fprintf(stderr, "Path to pkg.txz required\n"); + exit(EXIT_FAILURE); + } + if (access(pkgarg, R_OK) == -1) { + fprintf(stderr, "No such file: %s\n", pkgarg); + exit(EXIT_FAILURE); + } + if (bootstrap_pkg_local(pkgarg, force) != 0) exit(EXIT_FAILURE); exit(EXIT_SUCCESS); } @@ -948,18 +977,15 @@ main(__unused int argc, char *argv[]) if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } - if (bootstrap_pkg() != 0) + if (bootstrap_pkg(force) != 0) exit(EXIT_FAILURE); config_finish(); - if (argv[1] != NULL && strcmp(argv[1], "bootstrap") == 0) + if (bootstrap_only) exit(EXIT_SUCCESS); - } else { - if (argv[1] != NULL && strcmp(argv[1], "bootstrap") == 0) { - printf("pkg already bootstrapped at %s\n", - pkgpath); - exit(EXIT_SUCCESS); - } + } else if (bootstrap_only) { + printf("pkg already bootstrapped at %s\n", pkgpath); + exit(EXIT_SUCCESS); } execv(pkgpath, argv); From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 13:57:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 53EBFCE8; Fri, 1 Nov 2013 13:57:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27B712E54; Fri, 1 Nov 2013 13:57:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1DvVbf005153; Fri, 1 Nov 2013 13:57:31 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1DvULe005151; Fri, 1 Nov 2013 13:57:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201311011357.rA1DvULe005151@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 1 Nov 2013 13:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257506 - in head: bin/sh usr.bin/limits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 13:57:31 -0000 Author: jilles Date: Fri Nov 1 13:57:30 2013 New Revision: 257506 URL: http://svnweb.freebsd.org/changeset/base/257506 Log: sh(1),limits(1): Document kqueues (-k) rlimit. Modified: head/bin/sh/sh.1 head/usr.bin/limits/limits.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Nov 1 12:37:36 2013 (r257505) +++ head/bin/sh/sh.1 Fri Nov 1 13:57:30 2013 (r257506) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 14, 2013 +.Dd November 1, 2013 .Dt SH 1 .Os .Sh NAME @@ -2551,7 +2551,7 @@ and not found. For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed. -.It Ic ulimit Oo Fl HSabcdflmnpstuvw Oc Op Ar limit +.It Ic ulimit Oo Fl HSabcdfklmnpstuvw Oc Op Ar limit Set or display resource limits (see .Xr getrlimit 2 ) . If @@ -2598,6 +2598,11 @@ The maximal size of core dump files, in The maximal size of the data segment of a process, in kilobytes. .It Fl f Ar filesize The maximal size of a file, in 512-byte blocks. +.It Fl k Ar kqueues +The maximal number of kqueues +(see +.Xr kqueue 2 ) +for this user ID. .It Fl l Ar lockedmem The maximal size of memory that can be locked by a process, in kilobytes. Modified: head/usr.bin/limits/limits.1 ============================================================================== --- head/usr.bin/limits/limits.1 Fri Nov 1 12:37:36 2013 (r257505) +++ head/usr.bin/limits/limits.1 Fri Nov 1 13:57:30 2013 (r257506) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2013 +.Dd November 1, 2013 .Dt LIMITS 1 .Os .Sh NAME @@ -30,11 +30,11 @@ .Op Fl C Ar class | Fl P Ar pid | Fl U Ar user .Op Fl SHB .Op Fl ea -.Op Fl bcdflmnstuvpw Op Ar val +.Op Fl bcdfklmnstuvpw Op Ar val .Nm .Op Fl C Ar class | Fl U Ar user .Op Fl SHB -.Op Fl bcdflmnstuvpw Op Ar val +.Op Fl bcdfklmnstuvpw Op Ar val .Op Fl E .Oo .Op Ar name Ns = Ns Ar value ... @@ -207,6 +207,10 @@ resource limit. Select or set the .Va filesize resource limit. +.It Fl k Op Ar val +Select or set the +.Va kqueues +resource limit. .It Fl l Op Ar val Select or set the .Va memorylocked From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 15:35:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A00176CF; Fri, 1 Nov 2013 15:35:09 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 5BEB624E3; Fri, 1 Nov 2013 15:35:06 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 40E607300A; Fri, 1 Nov 2013 16:36:55 +0100 (CET) Date: Fri, 1 Nov 2013 16:36:55 +0100 From: Luigi Rizzo To: Bryan Drewery Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101153655.GA32901@onelab2.iet.unipi.it> References: <20131101020924.GB32951@lor.one-eyed-alien.net> <20131101061842.GA8911@onelab2.iet.unipi.it> <52739B4C.9090007@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52739B4C.9090007@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 15:35:09 -0000 On Fri, Nov 01, 2013 at 07:15:08AM -0500, Bryan Drewery wrote: > On 11/1/2013 1:18 AM, Luigi Rizzo wrote: ... > > ok so what happens is the following (trying to build HEAD on 9.2, both amd64) > > > > - WITHOUT_CLANG and related options: > > "make toolchain" fails with the error on krb5 > > "make buildworld" works, and a subsequent > > "make toolchain" also works > > > > - without options (so compiling CLANG) > > > > "make toolchain" fails with the error below > > > > building shared library libc.so.7 > > /usr/bin/ld: this linker was not configured to use sysroots > > cc: error: linker command failed with exit code 1 (use -v to see invocation) > > Are you using ccache? I've seen this error with that before r257268. no ccache, and even disabling parallel make (I am using -j 4) does not seem to affect the behaviour cheers luigi > > *** [libc.so.7] Error code 1 > > 1 error > > *** [all] Error code 2 > > 1 error > > > > > > "make toolchain" on an empty tree used to work until before this commit, > > and does work if i revert this single change > > > > So does this mean that 'toolchain' now has some prerequisites ? > > > > cheers > > luigi > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > > -- > Regards, > Bryan Drewery > From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 15:54:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1564FF3B; Fri, 1 Nov 2013 15:54:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00BAE25F3; Fri, 1 Nov 2013 15:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1Fsv8h046945; Fri, 1 Nov 2013 15:54:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1FsvcC046944; Fri, 1 Nov 2013 15:54:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311011554.rA1FsvcC046944@svn.freebsd.org> From: Glen Barber Date: Fri, 1 Nov 2013 15:54:57 +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: r257507 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 15:54:58 -0000 Author: gjb Date: Fri Nov 1 15:54:57 2013 New Revision: 257507 URL: http://svnweb.freebsd.org/changeset/base/257507 Log: MFC r256540, r256544: r256540 (dteske): Add loader.conf(5) entries to import bootpool after boot when using full-disk encryption and ZFS. r256544 (dteske): Fix loader.conf(5) entries from r256540. Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/usr.sbin/bsdinstall/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Fri Nov 1 13:57:30 2013 (r257506) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Fri Nov 1 15:54:57 2013 (r257507) @@ -802,7 +802,7 @@ zfs_create_boot() zpool set cachefile=$BSDINSTALL_CHROOT/boot/zfs/zpool.cache \ "$poolname" || return $FAILURE - # Last, but not least... add required lines to rc.conf(5) + # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination echo 'zfs_enable="YES"' > $BSDINSTALL_TMPETC/rc.conf.zfs || return $FAILURE @@ -812,6 +812,14 @@ zfs_create_boot() # We're all done unless we should go on to do encryption [ "$ZFSBOOT_GELI_ENCRYPTION" ] || return $SUCCESS + # Some additional GELI requirements for loader.conf(5) + echo 'zpool_cache_load="YES"' \ + >> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + echo 'zpool_cache_type="/boot/zfs/zpool.cache"' \ + >> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + echo 'zpool_cache_name="/boot/zfs/zpool.cache"' \ + >> $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + # # Configure geli(8)-based encryption # From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 16:03:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B58554AE; Fri, 1 Nov 2013 16:03:38 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2A87268A; Fri, 1 Nov 2013 16:03:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1G3ccg050420; Fri, 1 Nov 2013 16:03:38 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1G3cIm050419; Fri, 1 Nov 2013 16:03:38 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201311011603.rA1G3cIm050419@svn.freebsd.org> From: Jeremie Le Hen Date: Fri, 1 Nov 2013 16:03: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: r257508 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 16:03:38 -0000 Author: jlh Date: Fri Nov 1 16:03:38 2013 New Revision: 257508 URL: http://svnweb.freebsd.org/changeset/base/257508 Log: MFC r257361: Fix compatibility function for old daily_status_security_${name}_enable variables. PR: conf/183137 MFC r257364: Fix indentation. Approved by: re (gjb) Modified: stable/10/etc/defaults/periodic.conf Directory Properties: stable/10/etc/ (props changed) Modified: stable/10/etc/defaults/periodic.conf ============================================================================== --- stable/10/etc/defaults/periodic.conf Fri Nov 1 15:54:57 2013 (r257507) +++ stable/10/etc/defaults/periodic.conf Fri Nov 1 16:03:38 2013 (r257508) @@ -319,7 +319,7 @@ if [ -z "${source_periodic_confs_defined security_daily_compat_var() { local var=$1 dailyvar value - dailyvar=daily_status_security${#status_security} + dailyvar=daily_status_security${var#security_status} periodvar=${var%enable}period eval value=\"\$$dailyvar\" [ -z "$value" ] && return @@ -331,7 +331,7 @@ if [ -z "${source_periodic_confs_defined $periodvar=daily ;; *) - $var="$value" + eval $var=\"$value\" ;; esac } From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 16:48:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8AD29860; Fri, 1 Nov 2013 16:48:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77EF929A4; Fri, 1 Nov 2013 16:48:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1GmVUh064253; Fri, 1 Nov 2013 16:48:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1GmV4j064252; Fri, 1 Nov 2013 16:48:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201311011648.rA1GmV4j064252@svn.freebsd.org> From: Glen Barber Date: Fri, 1 Nov 2013 16:48:31 +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: r257509 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 16:48:31 -0000 Author: gjb Date: Fri Nov 1 16:48:30 2013 New Revision: 257509 URL: http://svnweb.freebsd.org/changeset/base/257509 Log: MFC r257329 (nyan): Fix build, both clang and gcc are required on pc98. Approved by: re (kib) Sponsored by: The FreeBSD Foundation Modified: stable/10/Makefile.inc1 (contents, props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Nov 1 16:03:38 2013 (r257508) +++ stable/10/Makefile.inc1 Fri Nov 1 16:48:30 2013 (r257509) @@ -1381,12 +1381,17 @@ _binutils= gnu/usr.bin/binutils # If an full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" -.if (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") && ${TARGET} != "pc98" +.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" _clang= usr.bin/clang _clang_libs= lib/clang .else _cc= gnu/usr.bin/cc .endif + +# The boot2 for pc98 requires gcc. +.if ${TARGET} == "pc98" +_cc= gnu/usr.bin/cc +.endif .endif cross-tools: .MAKE From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 17:16:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1D5534C3; Fri, 1 Nov 2013 17:16:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A9FC2B3E; Fri, 1 Nov 2013 17:16:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1HGiQ6074698; Fri, 1 Nov 2013 17:16:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1HGidv074697; Fri, 1 Nov 2013 17:16:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311011716.rA1HGidv074697@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 17:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257511 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 17:16:45 -0000 Author: kib Date: Fri Nov 1 17:16:44 2013 New Revision: 257511 URL: http://svnweb.freebsd.org/changeset/base/257511 Log: Return BUS_PROBE_NOWILDCARD from the DMAR probe method. Confirmed by: nwhitehorn MFC after: 1 month Modified: head/sys/x86/iommu/intel_drv.c Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Fri Nov 1 17:12:45 2013 (r257510) +++ head/sys/x86/iommu/intel_drv.c Fri Nov 1 17:16:44 2013 (r257511) @@ -217,7 +217,7 @@ dmar_probe(device_t dev) if (acpi_get_handle(dev) != NULL) return (ENXIO); device_set_desc(dev, "DMA remap"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static void From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 17:38:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0A24F16; Fri, 1 Nov 2013 17:38:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B6B62C8A; Fri, 1 Nov 2013 17:38:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1HcsVK081329; Fri, 1 Nov 2013 17:38:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1HcqKP081319; Fri, 1 Nov 2013 17:38:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311011738.rA1HcqKP081319@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Nov 2013 17:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257512 - in head/sys: conf x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 17:38:54 -0000 Author: kib Date: Fri Nov 1 17:38:52 2013 New Revision: 257512 URL: http://svnweb.freebsd.org/changeset/base/257512 Log: Add support for queued invalidation. Right now, the semaphore write is scheduled after each batch, which is not optimal and must be tuned. Discussed with: alc Tested by: pho MFC after: 1 month Added: head/sys/x86/iommu/intel_qi.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_gas.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_reg.h head/sys/x86/iommu/intel_utils.c Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/conf/files.amd64 Fri Nov 1 17:38:52 2013 (r257512) @@ -537,6 +537,7 @@ x86/iommu/intel_drv.c optional acpi acp x86/iommu/intel_fault.c optional acpi acpi_dmar pci x86/iommu/intel_gas.c optional acpi acpi_dmar pci x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci +x86/iommu/intel_qi.c optional acpi acpi_dmar pci x86/iommu/intel_quirks.c optional acpi acpi_dmar pci x86/iommu/intel_utils.c optional acpi acpi_dmar pci x86/isa/atpic.c optional atpic isa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/conf/files.i386 Fri Nov 1 17:38:52 2013 (r257512) @@ -560,6 +560,7 @@ x86/iommu/intel_drv.c optional acpi acp x86/iommu/intel_fault.c optional acpi acpi_dmar pci x86/iommu/intel_gas.c optional acpi acpi_dmar pci x86/iommu/intel_idpgtbl.c optional acpi acpi_dmar pci +x86/iommu/intel_qi.c optional acpi acpi_dmar pci x86/iommu/intel_quirks.c optional acpi acpi_dmar pci x86/iommu/intel_utils.c optional acpi acpi_dmar pci x86/isa/atpic.c optional atpic Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/x86/iommu/intel_ctx.c Fri Nov 1 17:38:52 2013 (r257512) @@ -385,17 +385,29 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * negative TLB entries. */ if ((dmar->hw_cap & DMAR_CAP_CM) != 0 || enable) { - error = dmar_inv_ctx_glob(dmar); - if (error == 0 && - (dmar->hw_ecap & DMAR_ECAP_DI) != 0) - error = dmar_inv_iotlb_glob(dmar); - if (error != 0) { - dmar_free_ctx_locked(dmar, ctx); - TD_PINNED_ASSERT; - return (NULL); + if (dmar->qi_enabled) { + dmar_qi_invalidate_ctx_glob_locked(dmar); + if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) + dmar_qi_invalidate_iotlb_glob_locked(dmar); + } else { + error = dmar_inv_ctx_glob(dmar); + if (error == 0 && + (dmar->hw_ecap & DMAR_ECAP_DI) != 0) + error = dmar_inv_iotlb_glob(dmar); + if (error != 0) { + dmar_free_ctx_locked(dmar, ctx); + TD_PINNED_ASSERT; + return (NULL); + } } } - if (enable && !rmrr_init) { + + /* + * The dmar lock was potentially dropped between check for the + * empty context list and now. Recheck the state of GCMD_TE + * to avoid unneeded command. + */ + if (enable && !rmrr_init && (dmar->hw_gcmd & DMAR_GCMD_TE) == 0) { error = dmar_enable_translation(dmar); if (error != 0) { dmar_free_ctx_locked(dmar, ctx); @@ -469,8 +481,12 @@ dmar_free_ctx_locked(struct dmar_unit *d dmar_pte_clear(&ctxp->ctx1); ctxp->ctx2 = 0; dmar_inv_ctx_glob(dmar); - if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) - dmar_inv_iotlb_glob(dmar); + if ((dmar->hw_ecap & DMAR_ECAP_DI) != 0) { + if (dmar->qi_enabled) + dmar_qi_invalidate_iotlb_glob_locked(dmar); + else + dmar_inv_iotlb_glob(dmar); + } LIST_REMOVE(ctx, link); DMAR_UNLOCK(dmar); @@ -512,24 +528,86 @@ dmar_find_ctx_locked(struct dmar_unit *d } void +dmar_ctx_free_entry(struct dmar_map_entry *entry, bool free) +{ + struct dmar_ctx *ctx; + + ctx = entry->ctx; + DMAR_CTX_LOCK(ctx); + if ((entry->flags & DMAR_MAP_ENTRY_RMRR) != 0) + dmar_gas_free_region(ctx, entry); + else + dmar_gas_free_space(ctx, entry); + DMAR_CTX_UNLOCK(ctx); + if (free) + dmar_gas_free_entry(ctx, entry); + else + entry->flags = 0; +} + +void +dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free) +{ + struct dmar_unit *unit; + + unit = entry->ctx->dmar; + if (unit->qi_enabled) { + DMAR_LOCK(unit); + dmar_qi_invalidate_locked(entry->ctx, entry->start, + entry->end - entry->start, &entry->gseq); + if (!free) + entry->flags |= DMAR_MAP_ENTRY_QI_NF; + TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); + DMAR_UNLOCK(unit); + } else { + ctx_flush_iotlb_sync(entry->ctx, entry->start, entry->end - + entry->start); + dmar_ctx_free_entry(entry, free); + } +} + +void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep) { - struct dmar_map_entry *entry; + struct dmar_unit *unit; + struct dmar_map_entry *entry, *entry1; + struct dmar_qi_genseq gseq; int error; - while ((entry = TAILQ_FIRST(entries)) != NULL) { + unit = ctx->dmar; + + TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & DMAR_MAP_ENTRY_MAP) != 0, ("not mapped entry %p %p", ctx, entry)); - TAILQ_REMOVE(entries, entry, dmamap_link); error = ctx_unmap_buf(ctx, entry->start, entry->end - entry->start, cansleep ? DMAR_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", ctx, error)); - DMAR_CTX_LOCK(ctx); - dmar_gas_free_space(ctx, entry); - DMAR_CTX_UNLOCK(ctx); - dmar_gas_free_entry(ctx, entry); + if (!unit->qi_enabled) { + ctx_flush_iotlb_sync(ctx, entry->start, + entry->end - entry->start); + TAILQ_REMOVE(entries, entry, dmamap_link); + dmar_ctx_free_entry(entry, true); + } + } + if (TAILQ_EMPTY(entries)) + return; + + KASSERT(unit->qi_enabled, ("loaded entry left")); + DMAR_LOCK(unit); + TAILQ_FOREACH(entry, entries, dmamap_link) { + entry->gseq.gen = 0; + entry->gseq.seq = 0; + dmar_qi_invalidate_locked(ctx, entry->start, entry->end - + entry->start, TAILQ_NEXT(entry, dmamap_link) == NULL ? + &gseq : NULL); + } + TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { + entry->gseq = gseq; + TAILQ_REMOVE(entries, entry, dmamap_link); + TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); } + DMAR_UNLOCK(unit); } static void Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/x86/iommu/intel_dmar.h Fri Nov 1 17:38:52 2013 (r257512) @@ -37,6 +37,11 @@ typedef uint64_t dmar_haddr_t; /* Guest or bus address, before translation. */ typedef uint64_t dmar_gaddr_t; +struct dmar_qi_genseq { + u_int gen; + uint32_t seq; +}; + struct dmar_map_entry { dmar_gaddr_t start; dmar_gaddr_t end; @@ -48,6 +53,8 @@ struct dmar_map_entry { RB_ENTRY(dmar_map_entry) rb_entry; /* Links for ctx entries */ TAILQ_ENTRY(dmar_map_entry) unroll_link; /* Link for unroll after dmamap_load failure */ + struct dmar_ctx *ctx; + struct dmar_qi_genseq gseq; }; RB_HEAD(dmar_gas_entries_tree, dmar_map_entry); @@ -60,6 +67,7 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar #define DMAR_MAP_ENTRY_MAP 0x0004 /* Busdma created, linked by dmamap_link */ #define DMAR_MAP_ENTRY_UNMAPPED 0x0010 /* No backing pages */ +#define DMAR_MAP_ENTRY_QI_NF 0x0020 /* qi task, do not free entry */ #define DMAR_MAP_ENTRY_READ 0x1000 /* Read permitted */ #define DMAR_MAP_ENTRY_WRITE 0x2000 /* Write permitted */ #define DMAR_MAP_ENTRY_SNOOP 0x4000 /* Snoop */ @@ -113,6 +121,24 @@ struct dmar_ctx { #define DMAR_CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->lock) #define DMAR_CTX_ASSERT_LOCKED(ctx) mtx_assert(&(ctx)->lock, MA_OWNED) +struct dmar_msi_data { + int irq; + int irq_rid; + struct resource *irq_res; + void *intr_handle; + int (*handler)(void *); + int msi_data_reg; + int msi_addr_reg; + int msi_uaddr_reg; + void (*enable_intr)(struct dmar_unit *); + void (*disable_intr)(struct dmar_unit *); + const char *name; +}; + +#define DMAR_INTR_FAULT 0 +#define DMAR_INTR_QI 1 +#define DMAR_INTR_TOTAL 2 + struct dmar_unit { device_t dev; int unit; @@ -122,10 +148,8 @@ struct dmar_unit { /* Resources */ int reg_rid; struct resource *regs; - int irq; - int irq_rid; - struct resource *irq_res; - void *intr_handle; + + struct dmar_msi_data intrs[DMAR_INTR_TOTAL]; /* Hardware registers cache */ uint32_t hw_ver; @@ -149,6 +173,25 @@ struct dmar_unit { struct task fault_task; struct taskqueue *fault_taskqueue; + /* QI */ + int qi_enabled; + vm_offset_t inv_queue; + vm_size_t inv_queue_size; + uint32_t inv_queue_avail; + uint32_t inv_queue_tail; + volatile uint32_t inv_waitd_seq_hw; /* hw writes there on wait + descr completion */ + uint64_t inv_waitd_seq_hw_phys; + uint32_t inv_waitd_seq; /* next sequence number to use for wait descr */ + u_int inv_waitd_gen; /* seq number generation AKA seq overflows */ + u_int inv_seq_waiters; /* count of waiters for seq */ + u_int inv_queue_full; /* informational counter */ + + /* Delayed freeing of map entries queue processing */ + struct dmar_map_entries_tailq tlb_flush_entries; + struct task qi_task; + struct taskqueue *qi_taskqueue; + /* Busdma delayed map load */ struct task dmamap_load_task; TAILQ_HEAD(, bus_dmamap_dmar) delayed_maps; @@ -164,6 +207,7 @@ struct dmar_unit { #define DMAR_FAULT_ASSERT_LOCKED(dmar) mtx_assert(&(dmar)->fault_lock, MA_OWNED) #define DMAR_IS_COHERENT(dmar) (((dmar)->hw_ecap & DMAR_ECAP_C) != 0) +#define DMAR_HAS_QI(dmar) (((dmar)->hw_ecap & DMAR_ECAP_QI) != 0) /* Barrier ids */ #define DMAR_BARRIER_RMRR 0 @@ -180,6 +224,8 @@ vm_pindex_t pglvl_max_pages(int pglvl); int ctx_is_sp_lvl(struct dmar_ctx *ctx, int lvl); dmar_gaddr_t pglvl_page_size(int total_pglvl, int lvl); dmar_gaddr_t ctx_page_size(struct dmar_ctx *ctx, int lvl); +int calc_am(struct dmar_unit *unit, dmar_gaddr_t base, dmar_gaddr_t size, + dmar_gaddr_t *isizep); struct vm_page *dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags); void dmar_pgfree(vm_object_t obj, vm_pindex_t idx, int flags); void *dmar_map_pgtbl(vm_object_t obj, vm_pindex_t idx, int flags, @@ -191,21 +237,33 @@ int dmar_inv_iotlb_glob(struct dmar_unit int dmar_flush_write_bufs(struct dmar_unit *unit); int dmar_enable_translation(struct dmar_unit *unit); int dmar_disable_translation(struct dmar_unit *unit); -void dmar_enable_intr(struct dmar_unit *unit); -void dmar_disable_intr(struct dmar_unit *unit); bool dmar_barrier_enter(struct dmar_unit *dmar, u_int barrier_id); void dmar_barrier_exit(struct dmar_unit *dmar, u_int barrier_id); -int dmar_intr(void *arg); +int dmar_fault_intr(void *arg); +void dmar_enable_fault_intr(struct dmar_unit *unit); +void dmar_disable_fault_intr(struct dmar_unit *unit); int dmar_init_fault_log(struct dmar_unit *unit); void dmar_fini_fault_log(struct dmar_unit *unit); +int dmar_qi_intr(void *arg); +void dmar_enable_qi_intr(struct dmar_unit *unit); +void dmar_disable_qi_intr(struct dmar_unit *unit); +int dmar_init_qi(struct dmar_unit *unit); +void dmar_fini_qi(struct dmar_unit *unit); +void dmar_qi_invalidate_locked(struct dmar_ctx *ctx, dmar_gaddr_t start, + dmar_gaddr_t size, struct dmar_qi_genseq *pseq); +void dmar_qi_invalidate_ctx_glob_locked(struct dmar_unit *unit); +void dmar_qi_invalidate_iotlb_glob_locked(struct dmar_unit *unit); + vm_object_t ctx_get_idmap_pgtbl(struct dmar_ctx *ctx, dmar_gaddr_t maxaddr); void put_idmap_pgtbl(vm_object_t obj); int ctx_map_buf(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags); int ctx_unmap_buf(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, int flags); +void ctx_flush_iotlb_sync(struct dmar_ctx *ctx, dmar_gaddr_t base, + dmar_gaddr_t size); int ctx_alloc_pgtbl(struct dmar_ctx *ctx); void ctx_free_pgtbl(struct dmar_ctx *ctx); @@ -217,8 +275,10 @@ void dmar_free_ctx_locked(struct dmar_un void dmar_free_ctx(struct dmar_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, int slot, int func); +void dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free); void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep); +void dmar_ctx_free_entry(struct dmar_map_entry *entry, bool free); int dmar_init_busdma(struct dmar_unit *unit); void dmar_fini_busdma(struct dmar_unit *unit); @@ -231,6 +291,7 @@ void dmar_gas_free_space(struct dmar_ctx int dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common, dmar_gaddr_t size, u_int eflags, u_int flags, vm_page_t *ma, struct dmar_map_entry **res); +void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry); int dmar_gas_map_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma); int dmar_gas_reserve_region(struct dmar_ctx *ctx, dmar_gaddr_t start, Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/x86/iommu/intel_drv.c Fri Nov 1 17:38:52 2013 (r257512) @@ -71,8 +71,9 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #endif -#define DMAR_REG_RID 1 -#define DMAR_IRQ_RID 0 +#define DMAR_FAULT_IRQ_RID 0 +#define DMAR_QI_IRQ_RID 1 +#define DMAR_REG_RID 2 static devclass_t dmar_devclass; static device_t *dmar_devs; @@ -221,20 +222,31 @@ dmar_probe(device_t dev) } static void +dmar_release_intr(device_t dev, struct dmar_unit *unit, int idx) +{ + struct dmar_msi_data *dmd; + + dmd = &unit->intrs[idx]; + if (dmd->irq == -1) + return; + bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); + bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); + bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); + PCIB_RELEASE_MSIX(device_get_parent(device_get_parent(dev)), + dev, dmd->irq); + dmd->irq = -1; +} + +static void dmar_release_resources(device_t dev, struct dmar_unit *unit) { + int i; dmar_fini_busdma(unit); + dmar_fini_qi(unit); dmar_fini_fault_log(unit); - if (unit->irq != -1) { - bus_teardown_intr(dev, unit->irq_res, unit->intr_handle); - bus_release_resource(dev, SYS_RES_IRQ, unit->irq_rid, - unit->irq_res); - bus_delete_resource(dev, SYS_RES_IRQ, unit->irq_rid); - PCIB_RELEASE_MSIX(device_get_parent(device_get_parent(dev)), - dev, unit->irq); - unit->irq = -1; - } + for (i = 0; i < DMAR_INTR_TOTAL; i++) + dmar_release_intr(dev, unit, i); if (unit->regs != NULL) { bus_deactivate_resource(dev, SYS_RES_MEMORY, unit->reg_rid, unit->regs); @@ -253,62 +265,66 @@ dmar_release_resources(device_t dev, str } static int -dmar_alloc_irq(device_t dev, struct dmar_unit *unit) +dmar_alloc_irq(device_t dev, struct dmar_unit *unit, int idx) { device_t pcib; + struct dmar_msi_data *dmd; uint64_t msi_addr; uint32_t msi_data; int error; + dmd = &unit->intrs[idx]; pcib = device_get_parent(device_get_parent(dev)); /* Really not pcib */ - error = PCIB_ALLOC_MSIX(pcib, dev, &unit->irq); + error = PCIB_ALLOC_MSIX(pcib, dev, &dmd->irq); if (error != 0) { - device_printf(dev, "cannot allocate fault interrupt, %d\n", - error); + device_printf(dev, "cannot allocate %s interrupt, %d\n", + dmd->name, error); goto err1; } - unit->irq_rid = DMAR_IRQ_RID; - error = bus_set_resource(dev, SYS_RES_IRQ, unit->irq_rid, unit->irq, - 1); + error = bus_set_resource(dev, SYS_RES_IRQ, dmd->irq_rid, + dmd->irq, 1); if (error != 0) { - device_printf(dev, "cannot set interrupt resource, %d\n", - error); + device_printf(dev, "cannot set %s interrupt resource, %d\n", + dmd->name, error); goto err2; } - unit->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &unit->irq_rid, RF_ACTIVE); - if (unit->irq_res == NULL) { - device_printf(dev, "cannot map fault interrupt\n"); + dmd->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &dmd->irq_rid, RF_ACTIVE); + if (dmd->irq_res == NULL) { + device_printf(dev, + "cannot allocate resource for %s interrupt\n", dmd->name); error = ENXIO; goto err3; } - error = bus_setup_intr(dev, unit->irq_res, INTR_TYPE_MISC, - dmar_intr, NULL, unit, &unit->intr_handle); + error = bus_setup_intr(dev, dmd->irq_res, INTR_TYPE_MISC, + dmd->handler, NULL, unit, &dmd->intr_handle); if (error != 0) { - device_printf(dev, "cannot setup fault interrupt, %d\n", error); + device_printf(dev, "cannot setup %s interrupt, %d\n", + dmd->name, error); goto err4; } - bus_describe_intr(dev, unit->irq_res, unit->intr_handle, "fault"); - error = PCIB_MAP_MSI(pcib, dev, unit->irq, &msi_addr, &msi_data); + bus_describe_intr(dev, dmd->irq_res, dmd->intr_handle, dmd->name); + error = PCIB_MAP_MSI(pcib, dev, dmd->irq, &msi_addr, &msi_data); if (error != 0) { - device_printf(dev, "cannot map interrupt, %d\n", error); + device_printf(dev, "cannot map %s interrupt, %d\n", + dmd->name, error); goto err5; } - dmar_write4(unit, DMAR_FEDATA_REG, msi_data); - dmar_write4(unit, DMAR_FEADDR_REG, msi_addr); + dmar_write4(unit, dmd->msi_data_reg, msi_data); + dmar_write4(unit, dmd->msi_addr_reg, msi_addr); /* Only for xAPIC mode */ - dmar_write4(unit, DMAR_FEUADDR_REG, msi_addr >> 32); + dmar_write4(unit, dmd->msi_uaddr_reg, msi_addr >> 32); return (0); err5: - bus_teardown_intr(dev, unit->irq_res, unit->intr_handle); + bus_teardown_intr(dev, dmd->irq_res, dmd->intr_handle); err4: - bus_release_resource(dev, SYS_RES_IRQ, unit->irq_rid, unit->irq_res); + bus_release_resource(dev, SYS_RES_IRQ, dmd->irq_rid, dmd->irq_res); err3: - bus_delete_resource(dev, SYS_RES_IRQ, unit->irq_rid); + bus_delete_resource(dev, SYS_RES_IRQ, dmd->irq_rid); err2: - PCIB_RELEASE_MSIX(pcib, dev, unit->irq); - unit->irq = -1; + PCIB_RELEASE_MSIX(pcib, dev, dmd->irq); + dmd->irq = -1; err1: return (error); } @@ -318,23 +334,31 @@ static int dmar_remap_intr(device_t dev, device_t child, u_int irq) { struct dmar_unit *unit; + struct dmar_msi_data *dmd; uint64_t msi_addr; uint32_t msi_data; - int error; + int i, error; unit = device_get_softc(dev); - if (irq != unit->irq) - return (ENOENT); - error = PCIB_MAP_MSI(device_get_parent(device_get_parent(dev)), dev, - irq, &msi_addr, &msi_data); - if (error != 0) - return (error); - dmar_disable_intr(unit); - dmar_write4(unit, DMAR_FEDATA_REG, msi_data); - dmar_write4(unit, DMAR_FEADDR_REG, msi_addr); - dmar_write4(unit, DMAR_FEUADDR_REG, msi_addr >> 32); - dmar_enable_intr(unit); - return (0); + for (i = 0; i < DMAR_INTR_TOTAL; i++) { + dmd = &unit->intrs[i]; + if (irq == dmd->irq) { + error = PCIB_MAP_MSI(device_get_parent( + device_get_parent(dev)), + dev, irq, &msi_addr, &msi_data); + if (error != 0) + return (error); + DMAR_LOCK(unit); + (dmd->disable_intr)(unit); + dmar_write4(unit, dmd->msi_data_reg, msi_data); + dmar_write4(unit, dmd->msi_addr_reg, msi_addr); + dmar_write4(unit, dmd->msi_uaddr_reg, msi_addr >> 32); + (dmd->enable_intr)(unit); + DMAR_UNLOCK(unit); + return (0); + } + } + return (ENOENT); } #endif @@ -372,7 +396,7 @@ dmar_attach(device_t dev) { struct dmar_unit *unit; ACPI_DMAR_HARDWARE_UNIT *dmaru; - int error; + int i, error; unit = device_get_softc(dev); unit->dev = dev; @@ -380,7 +404,6 @@ dmar_attach(device_t dev) dmaru = dmar_find_by_index(unit->unit); if (dmaru == NULL) return (EINVAL); - unit->irq = -1; unit->segment = dmaru->Segment; unit->base = dmaru->Address; unit->reg_rid = DMAR_REG_RID; @@ -397,11 +420,38 @@ dmar_attach(device_t dev) dmar_print_caps(dev, unit, dmaru); dmar_quirks_post_ident(unit); - error = dmar_alloc_irq(dev, unit); + for (i = 0; i < DMAR_INTR_TOTAL; i++) + unit->intrs[i].irq = -1; + + unit->intrs[DMAR_INTR_FAULT].name = "fault"; + unit->intrs[DMAR_INTR_FAULT].irq_rid = DMAR_FAULT_IRQ_RID; + unit->intrs[DMAR_INTR_FAULT].handler = dmar_fault_intr; + unit->intrs[DMAR_INTR_FAULT].msi_data_reg = DMAR_FEDATA_REG; + unit->intrs[DMAR_INTR_FAULT].msi_addr_reg = DMAR_FEADDR_REG; + unit->intrs[DMAR_INTR_FAULT].msi_uaddr_reg = DMAR_FEUADDR_REG; + unit->intrs[DMAR_INTR_FAULT].enable_intr = dmar_enable_fault_intr; + unit->intrs[DMAR_INTR_FAULT].disable_intr = dmar_disable_fault_intr; + error = dmar_alloc_irq(dev, unit, DMAR_INTR_FAULT); if (error != 0) { dmar_release_resources(dev, unit); return (error); } + if (DMAR_HAS_QI(unit)) { + unit->intrs[DMAR_INTR_QI].name = "qi"; + unit->intrs[DMAR_INTR_QI].irq_rid = DMAR_QI_IRQ_RID; + unit->intrs[DMAR_INTR_QI].handler = dmar_qi_intr; + unit->intrs[DMAR_INTR_QI].msi_data_reg = DMAR_IEDATA_REG; + unit->intrs[DMAR_INTR_QI].msi_addr_reg = DMAR_IEADDR_REG; + unit->intrs[DMAR_INTR_QI].msi_uaddr_reg = DMAR_IEUADDR_REG; + unit->intrs[DMAR_INTR_QI].enable_intr = dmar_enable_qi_intr; + unit->intrs[DMAR_INTR_QI].disable_intr = dmar_disable_qi_intr; + error = dmar_alloc_irq(dev, unit, DMAR_INTR_QI); + if (error != 0) { + dmar_release_resources(dev, unit); + return (error); + } + } + mtx_init(&unit->lock, "dmarhw", NULL, MTX_DEF); unit->domids = new_unrhdr(0, dmar_nd2mask(DMAR_CAP_ND(unit->hw_cap)), &unit->lock); @@ -453,6 +503,11 @@ dmar_attach(device_t dev) dmar_release_resources(dev, unit); return (error); } + error = dmar_init_qi(unit); + if (error != 0) { + dmar_release_resources(dev, unit); + return (error); + } error = dmar_init_busdma(unit); if (error != 0) { dmar_release_resources(dev, unit); @@ -1058,6 +1113,33 @@ dmar_print_one(int idx, bool show_ctxs, (uintmax_t)dmar_read8(unit, frir), (uintmax_t)dmar_read8(unit, frir + 8)); } + if (DMAR_HAS_QI(unit)) { + db_printf("ied 0x%x iea 0x%x ieua 0x%x\n", + dmar_read4(unit, DMAR_IEDATA_REG), + dmar_read4(unit, DMAR_IEADDR_REG), + dmar_read4(unit, DMAR_IEUADDR_REG)); + if (unit->qi_enabled) { + db_printf("qi is enabled: queue @0x%jx (IQA 0x%jx) " + "size 0x%jx\n" + " head 0x%x tail 0x%x avail 0x%x status 0x%x ctrl 0x%x\n" + " hw compl 0x%x@%p/phys@%jx next seq 0x%x gen 0x%x\n", + (uintmax_t)unit->inv_queue, + (uintmax_t)dmar_read8(unit, DMAR_IQA_REG), + (uintmax_t)unit->inv_queue_size, + dmar_read4(unit, DMAR_IQH_REG), + dmar_read4(unit, DMAR_IQT_REG), + unit->inv_queue_avail, + dmar_read4(unit, DMAR_ICS_REG), + dmar_read4(unit, DMAR_IECTL_REG), + unit->inv_waitd_seq_hw, + &unit->inv_waitd_seq_hw, + (uintmax_t)unit->inv_waitd_seq_hw_phys, + unit->inv_waitd_seq, + unit->inv_waitd_gen); + } else { + db_printf("qi is disabled\n"); + } + } if (show_ctxs) { db_printf("contexts:\n"); LIST_FOREACH(ctx, &unit->contexts, link) { Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/x86/iommu/intel_fault.c Fri Nov 1 17:38:52 2013 (r257512) @@ -85,7 +85,7 @@ dmar_fault_next(struct dmar_unit *unit, } static void -dmar_intr_clear(struct dmar_unit *unit, uint32_t fsts) +dmar_fault_intr_clear(struct dmar_unit *unit, uint32_t fsts) { uint32_t clear; @@ -117,7 +117,7 @@ dmar_intr_clear(struct dmar_unit *unit, } int -dmar_intr(void *arg) +dmar_fault_intr(void *arg) { struct dmar_unit *unit; uint64_t fault_rec[2]; @@ -128,7 +128,7 @@ dmar_intr(void *arg) unit = arg; enqueue = false; fsts = dmar_read4(unit, DMAR_FSTS_REG); - dmar_intr_clear(unit, fsts); + dmar_fault_intr_clear(unit, fsts); if ((fsts & DMAR_FSTS_PPF) == 0) goto done; @@ -263,9 +263,11 @@ dmar_init_fault_log(struct dmar_unit *un taskqueue_start_threads(&unit->fault_taskqueue, 1, PI_AV, "dmar%d fault taskq", unit->unit); - dmar_disable_intr(unit); + DMAR_LOCK(unit); + dmar_disable_fault_intr(unit); dmar_clear_faults(unit); - dmar_enable_intr(unit); + dmar_enable_fault_intr(unit); + DMAR_UNLOCK(unit); return (0); } @@ -274,16 +276,40 @@ void dmar_fini_fault_log(struct dmar_unit *unit) { - dmar_disable_intr(unit); + DMAR_LOCK(unit); + dmar_disable_fault_intr(unit); + DMAR_UNLOCK(unit); if (unit->fault_taskqueue == NULL) return; taskqueue_drain(unit->fault_taskqueue, &unit->fault_task); taskqueue_free(unit->fault_taskqueue); + unit->fault_taskqueue = NULL; mtx_destroy(&unit->fault_lock); free(unit->fault_log, M_DEVBUF); unit->fault_log = NULL; unit->fault_log_head = unit->fault_log_tail = 0; } + +void +dmar_enable_fault_intr(struct dmar_unit *unit) +{ + uint32_t fectl; + + DMAR_ASSERT_LOCKED(unit); + fectl = dmar_read4(unit, DMAR_FECTL_REG); + fectl &= ~DMAR_FECTL_IM; + dmar_write4(unit, DMAR_FECTL_REG, fectl); +} + +void +dmar_disable_fault_intr(struct dmar_unit *unit) +{ + uint32_t fectl; + + DMAR_ASSERT_LOCKED(unit); + fectl = dmar_read4(unit, DMAR_FECTL_REG); + dmar_write4(unit, DMAR_FECTL_REG, fectl | DMAR_FECTL_IM); +} Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/x86/iommu/intel_gas.c Fri Nov 1 17:38:52 2013 (r257512) @@ -92,8 +92,10 @@ dmar_gas_alloc_entry(struct dmar_ctx *ct res = uma_zalloc(dmar_map_entry_zone, ((flags & DMAR_PGF_WAITOK) != 0 ? M_WAITOK : M_NOWAIT) | M_ZERO); - if (res != NULL) + if (res != NULL) { + res->ctx = ctx; atomic_add_int(&ctx->entries_cnt, 1); + } return (res); } @@ -101,6 +103,9 @@ void dmar_gas_free_entry(struct dmar_ctx *ctx, struct dmar_map_entry *entry) { + KASSERT(ctx == entry->ctx, + ("mismatched free ctx %p entry %p entry->ctx %p", ctx, + entry, entry->ctx)); atomic_subtract_int(&ctx->entries_cnt, 1); uma_zfree(dmar_map_entry_zone, entry); } @@ -170,6 +175,9 @@ dmar_gas_check_free(struct dmar_ctx *ctx dmar_gaddr_t v; RB_FOREACH(entry, dmar_gas_entries_tree, &ctx->rb_root) { + KASSERT(ctx == entry->ctx, + ("mismatched free ctx %p entry %p entry->ctx %p", ctx, + entry, entry->ctx)); next = RB_NEXT(dmar_gas_entries_tree, &ctx->rb_root, entry); if (next == NULL) { MPASS(entry->free_after == ctx->end - entry->end); @@ -583,7 +591,7 @@ dmar_gas_free_space(struct dmar_ctx *ctx #endif } -static void +void dmar_gas_free_region(struct dmar_ctx *ctx, struct dmar_map_entry *entry) { struct dmar_map_entry *next, *prev; @@ -644,10 +652,7 @@ dmar_gas_map(struct dmar_ctx *ctx, const ((eflags & DMAR_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0), (flags & DMAR_GM_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); if (error == ENOMEM) { - DMAR_CTX_LOCK(ctx); - dmar_gas_free_space(ctx, entry); - DMAR_CTX_UNLOCK(ctx); - dmar_gas_free_entry(ctx, entry); + dmar_ctx_unload_entry(entry, true); return (error); } KASSERT(error == 0, @@ -689,10 +694,7 @@ dmar_gas_map_region(struct dmar_ctx *ctx ((eflags & DMAR_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0), (flags & DMAR_GM_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); if (error == ENOMEM) { - DMAR_CTX_LOCK(ctx); - dmar_gas_free_region(ctx, entry); - DMAR_CTX_UNLOCK(ctx); - entry->flags = 0; + dmar_ctx_unload_entry(entry, false); return (error); } KASSERT(error == 0, Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Fri Nov 1 17:16:44 2013 (r257511) +++ head/sys/x86/iommu/intel_idpgtbl.c Fri Nov 1 17:38:52 2013 (r257512) @@ -67,8 +67,6 @@ __FBSDID("$FreeBSD$"); static int ctx_unmap_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, int flags); -static void ctx_flush_iotlb(struct dmar_ctx *ctx, dmar_gaddr_t base, - dmar_gaddr_t size, int flags); /* * The cache of the identity mapping page tables for the DMARs. Using @@ -412,7 +410,6 @@ static int ctx_map_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags) { - struct dmar_unit *unit; dmar_pte_t *pte; struct sf_buf *sf; dmar_gaddr_t pg_sz, base1, size1; @@ -482,17 +479,6 @@ ctx_map_buf_locked(struct dmar_ctx *ctx, } if (sf != NULL) dmar_unmap_pgtbl(sf, DMAR_IS_COHERENT(ctx->dmar)); - DMAR_CTX_PGUNLOCK(ctx); - unit = ctx->dmar; - if ((unit->hw_cap & DMAR_CAP_CM) != 0) - ctx_flush_iotlb(ctx, base1, size1, flags); - else if ((unit->hw_cap & DMAR_CAP_RWBF) != 0) { - /* See 11.1 Write Buffer Flushing. */ - DMAR_LOCK(unit); - dmar_flush_write_bufs(unit); - DMAR_UNLOCK(unit); - } - TD_PINNED_ASSERT; return (0); } @@ -501,6 +487,10 @@ int ctx_map_buf(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags) { + struct dmar_unit *unit; + int error; + + unit = ctx->dmar; KASSERT((ctx->flags & DMAR_CTX_IDMAP) == 0, ("modifying idmap pagetable ctx %p", ctx)); @@ -527,17 +517,30 @@ ctx_map_buf(struct dmar_ctx *ctx, dmar_g DMAR_PTE_TM)) == 0, ("invalid pte flags %jx", (uintmax_t)pflags)); KASSERT((pflags & DMAR_PTE_SNP) == 0 || - (ctx->dmar->hw_ecap & DMAR_ECAP_SC) != 0, + (unit->hw_ecap & DMAR_ECAP_SC) != 0, ("PTE_SNP for dmar without snoop control %p %jx", ctx, (uintmax_t)pflags)); KASSERT((pflags & DMAR_PTE_TM) == 0 || - (ctx->dmar->hw_ecap & DMAR_ECAP_DI) != 0, + (unit->hw_ecap & DMAR_ECAP_DI) != 0, ("PTE_TM for dmar without DIOTLB %p %jx", ctx, (uintmax_t)pflags)); KASSERT((flags & ~DMAR_PGF_WAITOK) == 0, ("invalid flags %x", flags)); DMAR_CTX_PGLOCK(ctx); - return (ctx_map_buf_locked(ctx, base, size, ma, pflags, flags)); + error = ctx_map_buf_locked(ctx, base, size, ma, pflags, flags); + DMAR_CTX_PGUNLOCK(ctx); + if (error != 0) + return (error); + + if ((unit->hw_cap & DMAR_CAP_CM) != 0) + ctx_flush_iotlb_sync(ctx, base, size); + else if ((unit->hw_cap & DMAR_CAP_RWBF) != 0) { + /* See 11.1 Write Buffer Flushing. */ + DMAR_LOCK(unit); + dmar_flush_write_bufs(unit); + DMAR_UNLOCK(unit); + } + return (0); } static void ctx_unmap_clear_pte(struct dmar_ctx *ctx, dmar_gaddr_t base, @@ -646,8 +649,6 @@ ctx_unmap_buf_locked(struct dmar_ctx *ct } if (sf != NULL) dmar_unmap_pgtbl(sf, DMAR_IS_COHERENT(ctx->dmar)); - DMAR_CTX_PGUNLOCK(ctx); - ctx_flush_iotlb(ctx, base1, size1, flags); /* * See 11.1 Write Buffer Flushing for an explanation why RWBF * can be ignored there. @@ -661,9 +662,12 @@ int ctx_unmap_buf(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, int flags) { + int error; DMAR_CTX_PGLOCK(ctx); - return (ctx_unmap_buf_locked(ctx, base, size, flags)); + error = ctx_unmap_buf_locked(ctx, base, size, flags); + DMAR_CTX_PGUNLOCK(ctx); + return (error); } int @@ -730,13 +734,8 @@ ctx_wait_iotlb_flush(struct dmar_unit *u return (iotlbr); } -/* - * flags is only intended for PGF_WAITOK, to disallow queued - * invalidation. - */ -static void -ctx_flush_iotlb(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, - int flags) +void +ctx_flush_iotlb_sync(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size) { struct dmar_unit *unit; dmar_gaddr_t isize; @@ -744,20 +743,8 @@ ctx_flush_iotlb(struct dmar_ctx *ctx, dm int am, iro; unit = ctx->dmar; -#if 0 - if ((unit->hw_ecap & DMAR_ECAP_QI) != 0 && - (flags & DMAR_PGF_WAITOK) != 0) { - /* - * XXXKIB: There, a queued invalidation interface - * could be used. But since queued and registered - * interfaces cannot be used simultaneously, and we - * must use sleep-less (i.e. register) interface when - * DMAR_PGF_WAITOK is not specified, only register - * interface is suitable. - */ - return; - } -#endif + KASSERT(!unit->qi_enabled, ("dmar%d: sync iotlb flush call", + unit->unit)); iro = DMAR_ECAP_IRO(unit->hw_ecap) * 16; DMAR_LOCK(unit); if ((unit->hw_cap & DMAR_CAP_PSI) == 0 || size > 2 * 1024 * 1024) { @@ -769,13 +756,7 @@ ctx_flush_iotlb(struct dmar_ctx *ctx, dm (uintmax_t)iotlbr)); } else { for (; size > 0; base += isize, size -= isize) { - for (am = DMAR_CAP_MAMV(unit->hw_cap);; am--) { - isize = 1ULL << (am + DMAR_PAGE_SHIFT); - if ((base & (isize - 1)) == 0 && size >= isize) - break; - if (am == 0) - break; - } + am = calc_am(unit, base, size, &isize); dmar_write8(unit, iro, base | am); iotlbr = ctx_wait_iotlb_flush(unit, DMAR_IOTLB_IIRG_PAGE | DMAR_IOTLB_DID(ctx->domain), Added: head/sys/x86/iommu/intel_qi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/iommu/intel_qi.c Fri Nov 1 17:38:52 2013 (r257512) @@ -0,0 +1,414 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 17:39:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B0C15106; Fri, 1 Nov 2013 17:39:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CAB02C94; Fri, 1 Nov 2013 17:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1HdxRk081476; Fri, 1 Nov 2013 17:39:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1Hdxuw081475; Fri, 1 Nov 2013 17:39:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201311011739.rA1Hdxuw081475@svn.freebsd.org> From: Xin LI Date: Fri, 1 Nov 2013 17:39:59 +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: r257513 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 17:39:59 -0000 Author: delphij Date: Fri Nov 1 17:39:59 2013 New Revision: 257513 URL: http://svnweb.freebsd.org/changeset/base/257513 Log: MFC r257369: Don't reference pointer before testing whether it is NULL. Submitted by: Clement Lecigne Reviewed by: grehan Approved by: re (kib) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/dev/hyperv/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Nov 1 17:38:52 2013 (r257512) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Nov 1 17:39:59 2013 (r257513) @@ -621,13 +621,15 @@ netvsc_recv(struct hv_device *device_ctx { hn_softc_t *sc = (hn_softc_t *)device_get_softc(device_ctx->device); struct mbuf *m_new; - struct ifnet *ifp = sc->hn_ifp; + struct ifnet *ifp; int size; int i; if (sc == NULL) { return (0); /* TODO: KYS how can this be! */ } + + ifp = sc->hn_ifp; ifp = sc->arpcom.ac_ifp; From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 18:29:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CEC8DBB; Fri, 1 Nov 2013 18:29:28 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4C132F30; Fri, 1 Nov 2013 18:29:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1ITRFg098297; Fri, 1 Nov 2013 18:29:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1ITRjm098296; Fri, 1 Nov 2013 18:29:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311011829.rA1ITRjm098296@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 1 Nov 2013 18:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257514 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 18:29:28 -0000 Author: luigi Date: Fri Nov 1 18:29:27 2013 New Revision: 257514 URL: http://svnweb.freebsd.org/changeset/base/257514 Log: small cleanup for building picobsd-head without CLANG. Note that svn 257268 gnu/usr.bin/binutils/ld/Makefile seems to break the "toolchain" target when building HEAD on RELENG_9, so until this is solved you may want to svn update -r 257267 gnu/usr.bin/binutils/ld/Makefile before building picobsd Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri Nov 1 17:39:59 2013 (r257513) +++ head/release/picobsd/build/picobsd Fri Nov 1 18:29:27 2013 (r257514) @@ -166,12 +166,6 @@ create_includes_and_libraries2() { # opt log "create_includes_and_libraries2() for ${SRC} $1" if [ ${OSVERSION} -ge 600000 ] ; then no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" - #no="$no -DWITHOUT_CLANG -DMALLOC_PRODUCTION" - # XXX 20131001 see if clang fixes the build - export WITHOUT_CLANG=YES - export WITHOUT_ICONV=YES - export WITH_GCC=YES - export WITH_GNUCXX=YES no="$no -DMALLOC_PRODUCTION" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" @@ -981,15 +975,16 @@ set_build_parameters() { export MAKEOBJDIRPREFIX=${l_objtree} export TARGET_ARCH=${o_arch} TARGET=${o_arch} # XXX 20131001 see if CLANG fixes the build - # XXX export WITHOUT_CLANG_IS_CC=1 - export WITHOUT_CLANG=YES - export WITHOUT_ICONV=YES - export WITH_GCC=YES - export WITH_GNUCXX=YES + export WITHOUT_CLANG_IS_CC=yes + export WITH_GCC=yes + export WITH_GNUCXX=yes + export WITHOUT_CLANG=yes + export WITHOUT_ICONV=yes # XXX why change machine_arch ? #-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m` # export CWARNFLAGS="-Wextra -Wno-sign-compare -Wno-missing-field-initializers" + # XXX BINMAKE does not really exist anymore eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" [ "$BINMAKE" = "" ] && \ eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V SUB_MAKE`\"" From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 18:42:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8CF785A5; Fri, 1 Nov 2013 18:42:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 796FB2062; Fri, 1 Nov 2013 18:42:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1Ig485004201; Fri, 1 Nov 2013 18:42:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1Ig3WS004198; Fri, 1 Nov 2013 18:42:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311011842.rA1Ig3WS004198@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 1 Nov 2013 18:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257515 - in head/sys/dev/xen: netback netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 18:42:04 -0000 Author: glebius Date: Fri Nov 1 18:42:03 2013 New Revision: 257515 URL: http://svnweb.freebsd.org/changeset/base/257515 Log: Somehow fix LINT-NOIP. Modified: head/sys/dev/xen/netback/netback.c head/sys/dev/xen/netback/netback_unit_tests.c head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Fri Nov 1 18:29:27 2013 (r257514) +++ head/sys/dev/xen/netback/netback.c Fri Nov 1 18:42:03 2013 (r257515) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * from this FreeBSD domain to other domains. */ #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_global.h" #include "opt_sctp.h" @@ -184,7 +185,6 @@ static int xnb_rxpkt2gnttab(const struct static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt, const gnttab_copy_table gnttab, int n_entries, netif_rx_back_ring_t *ring); -static void xnb_add_mbuf_cksum(struct mbuf *mbufc); static void xnb_stop(struct xnb_softc*); static int xnb_ioctl(struct ifnet*, u_long, caddr_t); static void xnb_start_locked(struct ifnet*); @@ -195,6 +195,9 @@ static void xnb_ifinit(void*); static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS); static int xnb_dump_rings(SYSCTL_HANDLER_ARGS); #endif +#if defined(INET) || defined(INET6) +static void xnb_add_mbuf_cksum(struct mbuf *mbufc); +#endif /*------------------------------ Data Structures -----------------------------*/ @@ -1779,7 +1782,9 @@ xnb_update_mbufc(struct mbuf *mbufc, con } mbufc->m_pkthdr.len = total_size; +#if defined(INET) || defined(INET6) xnb_add_mbuf_cksum(mbufc); +#endif } /** @@ -2122,6 +2127,7 @@ xnb_rxpkt2rsp(const struct xnb_pkt *pkt, return n_responses; } +#if defined(INET) || defined(INET6) /** * Add IP, TCP, and/or UDP checksums to every mbuf in a chain. The first mbuf * in the chain must start with a struct ether_header. @@ -2176,6 +2182,7 @@ xnb_add_mbuf_cksum(struct mbuf *mbufc) break; } } +#endif /* INET || INET6 */ static void xnb_stop(struct xnb_softc *xnb) Modified: head/sys/dev/xen/netback/netback_unit_tests.c ============================================================================== --- head/sys/dev/xen/netback/netback_unit_tests.c Fri Nov 1 18:29:27 2013 (r257514) +++ head/sys/dev/xen/netback/netback_unit_tests.c Fri Nov 1 18:42:03 2013 (r257515) @@ -104,10 +104,6 @@ struct test_fixture { typedef struct test_fixture test_fixture_t; -static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, - uint16_t ip_id, uint16_t ip_p, - uint16_t ip_off, uint16_t ip_sum); -static void xnb_fill_tcp(struct mbuf *m); static int xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags); static int xnb_unit_test_runner(test_fixture_t const tests[], int ntests, char *buffer, size_t buflen); @@ -163,17 +159,24 @@ static testcase_t xnb_rxpkt2rsp_extra; static testcase_t xnb_rxpkt2rsp_2short; static testcase_t xnb_rxpkt2rsp_2slots; static testcase_t xnb_rxpkt2rsp_copyerror; +static testcase_t xnb_sscanf_llu; +static testcase_t xnb_sscanf_lld; +static testcase_t xnb_sscanf_hhu; +static testcase_t xnb_sscanf_hhd; +static testcase_t xnb_sscanf_hhn; + +#if defined(INET) || defined(INET6) /* TODO: add test cases for xnb_add_mbuf_cksum for IPV6 tcp and udp */ static testcase_t xnb_add_mbuf_cksum_arp; static testcase_t xnb_add_mbuf_cksum_tcp; static testcase_t xnb_add_mbuf_cksum_udp; static testcase_t xnb_add_mbuf_cksum_icmp; static testcase_t xnb_add_mbuf_cksum_tcp_swcksum; -static testcase_t xnb_sscanf_llu; -static testcase_t xnb_sscanf_lld; -static testcase_t xnb_sscanf_hhu; -static testcase_t xnb_sscanf_hhd; -static testcase_t xnb_sscanf_hhn; +static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, + uint16_t ip_id, uint16_t ip_p, + uint16_t ip_off, uint16_t ip_sum); +static void xnb_fill_tcp(struct mbuf *m); +#endif /* INET || INET6 */ /** Private data used by unit tests */ static struct { @@ -307,11 +310,13 @@ xnb_unit_test_main(SYSCTL_HANDLER_ARGS) {setup_pvt_data, xnb_rxpkt2rsp_2short, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_2slots, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_copyerror, teardown_pvt_data}, +#if defined(INET) || defined(INET6) {null_setup, xnb_add_mbuf_cksum_arp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_icmp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp_swcksum, null_teardown}, {null_setup, xnb_add_mbuf_cksum_udp, null_teardown}, +#endif {null_setup, xnb_sscanf_hhd, null_teardown}, {null_setup, xnb_sscanf_hhu, null_teardown}, {null_setup, xnb_sscanf_lld, null_teardown}, @@ -2066,6 +2071,7 @@ xnb_rxpkt2rsp_copyerror(char *buffer, si safe_m_freem(&mbuf); } +#if defined(INET) || defined(INET6) /** * xnb_add_mbuf_cksum on an ARP request packet */ @@ -2430,6 +2436,7 @@ xnb_add_mbuf_cksum_tcp_swcksum(char *buf m_freem(mbufc); } +#endif /* INET || INET6 */ /** * sscanf on unsigned chars Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Nov 1 18:29:27 2013 (r257514) +++ head/sys/dev/xen/netfront/netfront.c Fri Nov 1 18:42:03 2013 (r257515) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -964,7 +965,7 @@ static void xn_rxeof(struct netfront_info *np) { struct ifnet *ifp; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) struct lro_ctrl *lro = &np->xn_lro; struct lro_entry *queued; #endif @@ -1061,7 +1062,7 @@ xn_rxeof(struct netfront_info *np) * Do we really need to drop the rx lock? */ XN_RX_UNLOCK(np); -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* Use LRO if possible */ if ((ifp->if_capenable & IFCAP_LRO) == 0 || lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) { @@ -1079,7 +1080,7 @@ xn_rxeof(struct netfront_info *np) np->rx.rsp_cons = i; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* * Flush any outstanding LRO work */ @@ -2002,14 +2003,14 @@ xn_configure_features(struct netfront_in int err; err = 0; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 70000 && (defined(INET) || defined(INET6)) if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0) tcp_lro_free(&np->xn_lro); #endif np->xn_ifp->if_capenable = np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4); np->xn_ifp->if_hwassist &= ~CSUM_TSO; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) { err = tcp_lro_init(&np->xn_lro); if (err) { From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 18:55:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 52FEAA84; Fri, 1 Nov 2013 18:55:57 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDA2210A; Fri, 1 Nov 2013 18:55:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1ItvTC008129; Fri, 1 Nov 2013 18:55:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1ItvWv008128; Fri, 1 Nov 2013 18:55:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201311011855.rA1ItvWv008128@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 1 Nov 2013 18:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257516 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 18:55:57 -0000 Author: pluknet Date: Fri Nov 1 18:55:56 2013 New Revision: 257516 URL: http://svnweb.freebsd.org/changeset/base/257516 Log: OpenBSD 5.4 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Nov 1 18:42:03 2013 (r257515) +++ head/share/misc/bsd-family-tree Fri Nov 1 18:55:56 2013 (r257516) @@ -283,7 +283,7 @@ FreeBSD 5.2 | | | | | | | | | | FreeBSD | | NetBSD 6.1.2 | | | 9.2 Mac OS X | | | - | 10.9 | | | + | 10.9 | OpenBSD 5.4 | | | | | | | | | | | | | | | | @@ -602,6 +602,7 @@ FreeBSD 9.2 2013-09-30 [FBD] NetBSD 6.0.3 2013-09-30 [NBD] NetBSD 6.1.2 2013-09-30 [NBD] Mac OS X 10.9 2013-10-22 [APL] +OpenBSD 5.4 2013-11-01 [OBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 19:22:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EACD4228; Fri, 1 Nov 2013 19:22:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C83FE22B1; Fri, 1 Nov 2013 19:22:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1JM7qV017948; Fri, 1 Nov 2013 19:22:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1JM7uv017945; Fri, 1 Nov 2013 19:22:07 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311011922.rA1JM7uv017945@svn.freebsd.org> From: Ian Lepore Date: Fri, 1 Nov 2013 19:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257518 - in head/sys: arm/ti boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 19:22:08 -0000 Author: ian Date: Fri Nov 1 19:22:06 2013 New Revision: 257518 URL: http://svnweb.freebsd.org/changeset/base/257518 Log: TI sdhci driver improvements, mostly related to fdt data... Use the published compatible strings (our own invention, "ti,mmchs" is still accepted as well, for now). Don't blindly turn on 8-bit bus mode, because even though the conroller supports it, the board has to be wired appropriately as well. Use the published property (bus-width=) and honor all the valid values (1,4,8). The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts. The mmchs controller can inherently do both 1.8v and 3.0v on the first device and 1.8v only on other devices, unless an external transceiver is used. Set the voltage automatically for the first device and honor the published fdt property (ti,dualvolt) for other devices. Thanks go to Ilya Bakulin for figuring out the voltage compatibility stuff. Modified: head/sys/arm/ti/ti_sdhci.c head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone-black.dts Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Nov 1 19:19:47 2013 (r257517) +++ head/sys/arm/ti/ti_sdhci.c Fri Nov 1 19:22:06 2013 (r257518) @@ -75,6 +75,21 @@ struct ti_sdhci_softc { }; /* + * Table of supported FDT compat strings. + * + * Note that "ti,mmchs" is our own invention, and should be phased out in favor + * of the documented names. + * + * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the am335x. + */ +static struct ofw_compat_data compat_data[] = { + {"ti,omap3-hsmmc", 1}, + {"ti,omap4-hsmmc", 1}, + {"ti,mmchs", 1}, + {NULL, 0}, +}; + +/* * The MMCHS hardware has a few control and status registers at the beginning of * the device's memory map, followed by the standard sdhci register block. * Different SoCs have the register blocks at different offsets from the @@ -93,6 +108,10 @@ struct ti_sdhci_softc { #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) +#define MMCHS_SD_CAPA 0x240 +#define MMCHS_SD_CAPA_VS18 (1 << 26) +#define MMCHS_SD_CAPA_VS30 (1 << 25) +#define MMCHS_SD_CAPA_VS33 (1 << 24) static inline uint32_t ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off) @@ -320,6 +339,7 @@ ti_sdhci_hw_init(device_t dev) { struct ti_sdhci_softc *sc = device_get_softc(dev); clk_ident_t clk; + uint32_t regval; unsigned long timeout; /* Enable the controller and interface/functional clocks */ @@ -357,6 +377,21 @@ ti_sdhci_hw_init(device_t dev) DELAY(100); } + /* + * The attach() routine has examined fdt data and set flags in + * slot.host.caps to reflect what voltages we can handle. Set those + * values in the CAPA register. The manual says that these values can + * only be set once, "before initialization" whatever that means, and + * that they survive a reset. So maybe doing this will be a no-op if + * u-boot has already initialized the hardware. + */ + regval = ti_mmchs_read_4(sc, MMCHS_SD_CAPA); + if (sc->slot.host.caps & MMC_OCR_LOW_VOLTAGE) + regval |= MMCHS_SD_CAPA_VS18; + if (sc->slot.host.caps & (MMC_OCR_290_300 | MMC_OCR_300_310)) + regval |= MMCHS_SD_CAPA_VS30; + ti_mmchs_write_4(sc, MMCHS_SD_CAPA, regval); + /* Set initial host configuration (1-bit, std speed, pwr off). */ ti_sdhci_write_1(dev, NULL, SDHCI_HOST_CONTROL, 0); ti_sdhci_write_1(dev, NULL, SDHCI_POWER_CONTROL, 0); @@ -378,7 +413,8 @@ ti_sdhci_attach(device_t dev) /* * Get the MMCHS device id from FDT. If it's not there use the newbus * unit number (which will work as long as the devices are in order and - * none are skipped in the fdt). + * none are skipped in the fdt). Note that this is a property we made + * up and added in freebsd, it doesn't exist in the published bindings. */ node = ofw_bus_get_node(dev); if ((OF_getprop(node, "mmchs-device-id", &prop, sizeof(prop))) <= 0) { @@ -388,7 +424,23 @@ ti_sdhci_attach(device_t dev) } else sc->mmchs_device_id = fdt32_to_cpu(prop); - /* See if we've got a GPIO-based write detect pin. */ + /* + * The hardware can inherently do dual-voltage (1p8v, 3p0v) on the first + * device, and only 1p8v on other devices unless an external transceiver + * is used. The only way we could know about a transceiver is fdt data. + * Note that we have to do this before calling ti_sdhci_hw_init() so + * that it can set the right values in the CAPA register, which can only + * be done once and never reset. + */ + sc->slot.host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + if (sc->mmchs_device_id == 0 || OF_hasprop(node, "ti,dual-volt")) { + sc->slot.host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + } + + /* + * See if we've got a GPIO-based write detect pin. This is not the + * standard documented property for this, we added it in freebsd. + */ if ((OF_getprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) sc->wp_gpio_pin = 0xffffffff; else @@ -406,10 +458,6 @@ ti_sdhci_attach(device_t dev) /* * Set the offset from the device's memory start to the MMCHS registers. - * - * XXX A better way to handle this would be to have separate memory - * resources for the sdhci registers and the mmchs registers. That - * requires changing everyone's DTS files. */ if (ti_chip() == CHIP_OMAP_3) sc->mmchs_reg_off = OMAP3_MMCHS_REG_OFFSET; @@ -482,14 +530,34 @@ ti_sdhci_attach(device_t dev) */ sc->slot.quirks |= SDHCI_QUIRK_BROKEN_DMA; - /* Set up the hardware and go. */ + /* + * Set up the hardware and go. Note that this sets many of the + * slot.host.* fields, so we have to do this before overriding any of + * those values based on fdt data, below. + */ sdhci_init_slot(dev, &sc->slot, 0); /* - * The SDHCI controller doesn't realize it, but we support 8-bit even - * though we're not a v3.0 controller. Advertise the ability. - */ - sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + * The SDHCI controller doesn't realize it, but we can support 8-bit + * even though we're not a v3.0 controller. If there's an fdt bus-width + * property, honor it. + */ + if (OF_getencprop(node, "bus-width", &prop, sizeof(prop)) > 0) { + sc->slot.host.caps &= ~(MMC_CAP_4_BIT_DATA | + MMC_CAP_8_BIT_DATA); + switch (prop) { + case 1: + break; + case 4: + sc->slot.host.caps |= MMC_CAP_4_BIT_DATA; + break; + case 8: + sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + break; + default: + device_printf(dev, "Bad bus-width value %u\n", prop); + } + } bus_generic_probe(dev); bus_generic_attach(dev); @@ -513,13 +581,12 @@ static int ti_sdhci_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "ti,mmchs")) { - return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "TI MMCHS (SDHCI 2.0)"); + return (BUS_PROBE_DEFAULT); } - device_set_desc(dev, "TI MMCHS (SDHCI 2.0)"); - - return (BUS_PROBE_DEFAULT); + return (ENXIO); } static device_method_t ti_sdhci_methods[] = { Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Fri Nov 1 19:19:47 2013 (r257517) +++ head/sys/boot/fdt/dts/am335x.dtsi Fri Nov 1 19:22:06 2013 (r257518) @@ -163,16 +163,17 @@ }; mmchs0@48060000 { - compatible = "ti,mmchs"; + compatible = "ti,omap3-hsmmc", "ti,mmchs"; reg =<0x48060000 0x1000 >; interrupts = <64>; interrupt-parent = <&AINTC>; mmchs-device-id = <0>; mmchs-wp-gpio-pin = <0xffffffff>; + ti,dual-volt; }; mmchs1@481D8000 { - compatible = "ti,mmchs"; + compatible = "ti,omap3-hsmmc", "ti,mmchs"; reg =<0x481D8000 0x1000 >; interrupts = <28>; interrupt-parent = <&AINTC>; Modified: head/sys/boot/fdt/dts/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone-black.dts Fri Nov 1 19:19:47 2013 (r257517) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Fri Nov 1 19:22:06 2013 (r257518) @@ -134,6 +134,7 @@ }; mmchs1@481D8000 { + bus-width = <8>; status = "okay"; }; From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 19:29:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B55A1520; Fri, 1 Nov 2013 19:29:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A27ED2306; Fri, 1 Nov 2013 19:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1JTx3C018795; Fri, 1 Nov 2013 19:29:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1JTxKv018794; Fri, 1 Nov 2013 19:29:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311011929.rA1JTxKv018794@svn.freebsd.org> From: Ian Lepore Date: Fri, 1 Nov 2013 19:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257519 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 19:29:59 -0000 Author: ian Date: Fri Nov 1 19:29:59 2013 New Revision: 257519 URL: http://svnweb.freebsd.org/changeset/base/257519 Log: The ability to do 8-bit implies 4-bit capability too. Rearrange the cases and add a fallthrough comment to make that happen. Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Nov 1 19:22:06 2013 (r257518) +++ head/sys/arm/ti/ti_sdhci.c Fri Nov 1 19:29:59 2013 (r257519) @@ -546,16 +546,17 @@ ti_sdhci_attach(device_t dev) sc->slot.host.caps &= ~(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); switch (prop) { - case 1: - break; + case 8: + sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + /* FALLTHROUGH */ case 4: sc->slot.host.caps |= MMC_CAP_4_BIT_DATA; break; - case 8: - sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + case 1: break; default: device_printf(dev, "Bad bus-width value %u\n", prop); + break; } } From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 20:28:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F005BA0A; Fri, 1 Nov 2013 20:28:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC8B9266D; Fri, 1 Nov 2013 20:28:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1KSEB4038640; Fri, 1 Nov 2013 20:28:14 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1KSEwR038637; Fri, 1 Nov 2013 20:28:14 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311012028.rA1KSEwR038637@svn.freebsd.org> From: Brooks Davis Date: Fri, 1 Nov 2013 20:28:14 +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: r257522 - in stable/10/sys: dev/fdt mips/beri X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 20:28:15 -0000 Author: brooks Date: Fri Nov 1 20:28:13 2013 New Revision: 257522 URL: http://svnweb.freebsd.org/changeset/base/257522 Log: MFC r256911, r256936 MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693, 230523, 1123614 Implement a driver for Robert Norton's PIC as an FDT interrupt controller. Devices whose interrupt-parent property points to a beripic device will have their interrupt allocation, activation, and setup operations routed through the IC rather than down the traditional bus hierarchy. This driver largely abstracts the underlying CPU away allowing the PIC to be implemented on CPU's other than BERI. Due to insufficient abstractions a small amount of MIPS specific code is currently required in fdt_mips.c and to implement counters. Sponsored by: DARPA/AFRL Approved by: re (gjb) Added: stable/10/sys/mips/beri/beri_pic.c - copied, changed from r256911, head/sys/mips/beri/beri_pic.c Modified: stable/10/sys/dev/fdt/fdt_mips.c stable/10/sys/mips/beri/files.beri Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/dev/fdt/fdt_mips.c ============================================================================== --- stable/10/sys/dev/fdt/fdt_mips.c Fri Nov 1 19:50:30 2013 (r257521) +++ stable/10/sys/dev/fdt/fdt_mips.c Fri Nov 1 20:28:13 2013 (r257522) @@ -68,7 +68,26 @@ fdt_pic_decode_mips4k_cp0(phandle_t node return (0); } +/* + * CHERI PIC decoder. + */ +static int +fdt_pic_decode_beri(phandle_t node, pcell_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "sri-cambridge,beri-pic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + fdt_pic_decode_t fdt_pic_table[] = { &fdt_pic_decode_mips4k_cp0, + &fdt_pic_decode_beri, NULL }; Copied and modified: stable/10/sys/mips/beri/beri_pic.c (from r256911, head/sys/mips/beri/beri_pic.c) ============================================================================== --- head/sys/mips/beri/beri_pic.c Tue Oct 22 15:29:59 2013 (r256911, copy source) +++ stable/10/sys/mips/beri/beri_pic.c Fri Nov 1 20:28:13 2013 (r257522) @@ -646,15 +646,9 @@ beripic_send_ipi(device_t ic, u_int tid) KASSERT(tid < sc->bp_nsoft, ("tid (%d) too large\n", tid)); - printf("sending ipi to %d soft intrs %jx\n", tid, - bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8)); - bit = 1ULL << (tid % 64); bus_space_write_8(sc->bp_set_bst, sc->bp_set_bsh, (BP_FIRST_SOFT / 8) + (tid / 64), bit); - - printf("sent ipi to %d soft intrs %jx\n", tid, - bus_space_read_8(sc->bp_read_bst, sc->bp_read_bsh, 8)); } static void Modified: stable/10/sys/mips/beri/files.beri ============================================================================== --- stable/10/sys/mips/beri/files.beri Fri Nov 1 19:50:30 2013 (r257521) +++ stable/10/sys/mips/beri/files.beri Fri Nov 1 20:28:13 2013 (r257522) @@ -17,5 +17,6 @@ dev/terasic/mtl/terasic_mtl_reg.c option dev/terasic/mtl/terasic_mtl_syscons.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_text.c optional terasic_mtl mips/beri/beri_machdep.c standard +mips/beri/beri_pic.c optional fdt mips/mips/intr_machdep.c standard mips/mips/tick.c standard From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 20:30:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 272AEB52; Fri, 1 Nov 2013 20:30:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1231226A1; Fri, 1 Nov 2013 20:30:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1KUJhx038986; Fri, 1 Nov 2013 20:30:19 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1KUJme038985; Fri, 1 Nov 2013 20:30:19 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311012030.rA1KUJme038985@svn.freebsd.org> From: Brooks Davis Date: Fri, 1 Nov 2013 20:30: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: r257523 - stable/10/sys/mips/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 20:30:20 -0000 Author: brooks Date: Fri Nov 1 20:30:19 2013 New Revision: 257523 URL: http://svnweb.freebsd.org/changeset/base/257523 Log: MFC r256934, r256963, r256972, r257017 MFP4: Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 16:05:30 FreeBSD/mips stores page-table entries in a near-identical format to MIPS TLB entries -- only it overrides certain "reserved" bits in the MIPS-defined EntryLo register to hold software-defined bits (swbits) to avoid significantly increasing the page table memory footprint. On n32 and n64, these bits were (a) colliding with MIPS64r2 physical memory extensions and (b) being improperly cleared. Attempt to fix both of these problems by pushing swbits further along 64-bit EntryLo registers into the reserved space, and improving consistency between C-based and assembly-based clearing of swbits -- in particular, to use the same definition. This should stop swbits from leaking into TLB entries -- while ignored by most current MIPS hardware, this would cause a problem with (much) larger physical memory sizes, and also leads to confusing hardware-level tracing as physical addresses contain unexpected (and inconsistent) higher bits. Discussed with: imp, jmallett Change 1187301 by brooks@brooks_zenith on 2013/10/23 14:40:10 Loop back the initial commit of 221534 to HEAD. Correct its implementation for mips32. Sponsored by: DARPA/AFRL Approved by: re (gjb) Modified: stable/10/sys/mips/include/pte.h Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/mips/include/pte.h ============================================================================== --- stable/10/sys/mips/include/pte.h Fri Nov 1 20:28:13 2013 (r257522) +++ stable/10/sys/mips/include/pte.h Fri Nov 1 20:30:19 2013 (r257523) @@ -56,19 +56,30 @@ typedef pt_entry_t *pd_entry_t; #define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << TLBMASK_SHIFT) /* - * PFN for EntryLo register. Upper bits are 0, which is to say that - * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is - * 64 bit though it can be referred to in 32-bits providing 3 software - * bits safely. We use it as 64 bits to get many software bits, and - * god knows what else.) are unacknowledged by hardware. They may be - * written as anything, but otherwise they have as much meaning as - * other 0 fields. + * FreeBSD/mips page-table entries take a near-identical format to MIPS TLB + * entries, each consisting of two 32-bit or 64-bit values ("EntryHi" and + * "EntryLo"). MIPS4k and MIPS64 both define certain bits in TLB entries as + * reserved, and these must be zero-filled by software. We overload these + * bits in PTE entries to hold PTE_ flags such as RO, W, and MANAGED. + * However, we must mask these out when writing to TLB entries to ensure that + * they do not become visible to hardware -- especially on MIPS64r2 which has + * an extended physical memory space. + * + * When using n64 and n32, shift software-defined bits into the MIPS64r2 + * reserved range, which runs from bit 55 ... 63. In other configurations + * (32-bit MIPS4k and compatible), shift them out to bits 29 ... 31. + * + * NOTE: This means that for 32-bit use of CP0, we aren't able to set the top + * bit of PFN to a non-zero value, as software is using it! This physical + * memory size limit may not be sufficiently enforced elsewhere. */ #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ -#define TLBLO_SWBITS_SHIFT (34) +#define TLBLO_SWBITS_SHIFT (55) +#define TLBLO_SWBITS_CLEAR_SHIFT (9) #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL #else #define TLBLO_SWBITS_SHIFT (29) +#define TLBLO_SWBITS_CLEAR_SHIFT (3) #define TLBLO_PFN_MASK (0x1FFFFFC0) #endif #define TLBLO_PFN_SHIFT (6) @@ -133,6 +144,9 @@ typedef pt_entry_t *pd_entry_t; * listen to requests to write to it. * W: Wired. ??? * MANAGED:Managed. This PTE maps a managed page. + * + * These bits should not be written into the TLB, so must first be masked out + * explicitly in C, or using CLEAR_PTE_SWBITS() in assembly. */ #define PTE_RO ((pt_entry_t)0x01 << TLBLO_SWBITS_SHIFT) #define PTE_W ((pt_entry_t)0x02 << TLBLO_SWBITS_SHIFT) @@ -162,7 +176,7 @@ typedef pt_entry_t *pd_entry_t; #define PTESIZE 4 #define PTE_L lw #define PTE_MTC0 mtc0 -#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 high bits */ +#define CLEAR_PTE_SWBITS(r) LONG_SLL r, TLBLO_SWBITS_CLEAR_SHIFT; LONG_SRL r, TLBLO_SWBITS_CLEAR_SHIFT /* remove swbits */ #endif /* defined(__mips_n64) || defined(__mips_n32) */ #if defined(__mips_n64) From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 20:33:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 15D70D7D; Fri, 1 Nov 2013 20:33:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01E7E26BC; Fri, 1 Nov 2013 20:33:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1KXUJm041494; Fri, 1 Nov 2013 20:33:30 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1KXU4C041492; Fri, 1 Nov 2013 20:33:30 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311012033.rA1KXU4C041492@svn.freebsd.org> From: Brooks Davis Date: Fri, 1 Nov 2013 20:33:30 +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: r257524 - in stable/10/sys: conf dev/cfi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 20:33:31 -0000 Author: brooks Date: Fri Nov 1 20:33:30 2013 New Revision: 257524 URL: http://svnweb.freebsd.org/changeset/base/257524 Log: MFC r256753 MFP4: 1136252 Add an option ATSE_CFI_HACK to allow memory mapped CFI devices to have their address range allocated sharable so that atse(4) can find it's Ethernet address in the expected location. We intend to remove this hack once the BERI platform has a loader. Sponsored by: DARPA/AFRL Approved by: re (gjb) Modified: stable/10/sys/conf/options stable/10/sys/dev/cfi/cfi_core.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Fri Nov 1 20:30:19 2013 (r257523) +++ stable/10/sys/conf/options Fri Nov 1 20:33:30 2013 (r257524) @@ -69,6 +69,7 @@ TEXTDUMP_VERBOSE opt_ddb.h ADAPTIVE_LOCKMGRS ALQ ALTERA_SDCARD_FAST_SIM opt_altera_sdcard.h +ATSE_CFI_HACK opt_cfi.h AUDIT opt_global.h BOOTHOWTO opt_global.h BOOTVERBOSE opt_global.h Modified: stable/10/sys/dev/cfi/cfi_core.c ============================================================================== --- stable/10/sys/dev/cfi/cfi_core.c Fri Nov 1 20:30:19 2013 (r257523) +++ stable/10/sys/dev/cfi/cfi_core.c Fri Nov 1 20:33:30 2013 (r257524) @@ -281,7 +281,11 @@ cfi_attach(device_t dev) sc->sc_rid = 0; sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, +#ifndef ATSE_CFI_HACK RF_ACTIVE); +#else + RF_ACTIVE | RF_SHAREABLE); +#endif if (sc->sc_res == NULL) return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 20:48:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BC887187; Fri, 1 Nov 2013 20:48:57 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9B72765; Fri, 1 Nov 2013 20:48:56 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id rA1Kmn6V044955; Fri, 1 Nov 2013 15:48:49 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id rA1Kmmjm044954; Fri, 1 Nov 2013 15:48:48 -0500 (CDT) (envelope-from brooks) Date: Fri, 1 Nov 2013 15:48:48 -0500 From: Brooks Davis To: Luigi Rizzo Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101204848.GA44088@lor.one-eyed-alien.net> References: <20131101020924.GB32951@lor.one-eyed-alien.net> <20131101061842.GA8911@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: <20131101061842.GA8911@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 20:48:57 -0000 --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 01, 2013 at 07:18:42AM +0100, Luigi Rizzo wrote: > On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote: > > On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote: > > > as per the subject, after this commit building head on stable/9 > > > fails with the error below: > > >=20 > > > =3D=3D=3D> lib/libpam/modules/pam_krb5 (all) > > > make: don't know how to make > > > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/= bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a. > > > Stop > > >=20 > > > reverting the commit fixes the build. > > >=20 > > > Any idea how this can be fixed ? > >=20 > > I just built world and kernel with a freshly checked out head on > > ref9-amd64 so I supect something in your environment. This change > > should only impact the installed copy of ld which would have no effect > > on a 9-stable system. Any portion of the build system using a version > > effected by this change is broken since only the cross build version > > should be used and that one will have it's own sysroot value as always > > it always has. >=20 > ok so what happens is the following (trying to build HEAD on 9.2, both am= d64) >=20 > - WITHOUT_CLANG and related options: > "make toolchain" fails with the error on krb5 > "make buildworld" works, and a subsequent > "make toolchain" also works >=20 > - without options (so compiling CLANG) >=20 > "make toolchain" fails with the error below >=20 > building shared library libc.so.7 > /usr/bin/ld: this linker was not configured to use sysroots > cc: error: linker command failed with exit code 1 (use -v to see invo= cation) > *** [libc.so.7] Error code 1 > 1 error > *** [all] Error code 2 > 1 error >=20 >=20 > "make toolchain" on an empty tree used to work until before this commit, > and does work if i revert this single change >=20 > So does this mean that 'toolchain' now has some prerequisites ? I think I've found it. I tried the last one first since it was the most bizzare and about 40 lines up there was fairly obvious error output that told me what was wrong. The issue is that the :U modifer I used is a bmake feature and that the toolchain target doesn't bootstrap bmake (or perhaps doesn't do it early enough). I plan to commit a workaround for this particular case, but we probably need to alter the toolchain and kernel-toolchain targets to bootstrap bmake on older systems or we'll run into this again with some future change somewhere else. -- Brooks --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFSdBOtXY6L6fI4GtQRAkj2AKCsabaZH+l1M9UOmJX+OuWFO21bPwCgrDGc qfDP7kOh1rTaVhsTiatxlzw= =Ovuw -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 20:53:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C9715336; Fri, 1 Nov 2013 20:53:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5D8127B0; Fri, 1 Nov 2013 20:53:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1KroEf047852; Fri, 1 Nov 2013 20:53:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1KrnFp047846; Fri, 1 Nov 2013 20:53:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201311012053.rA1KrnFp047846@svn.freebsd.org> From: Adrian Chadd Date: Fri, 1 Nov 2013 20:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257525 - in head/sys: dev/random net sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 20:53:51 -0000 Author: adrian Date: Fri Nov 1 20:53:49 2013 New Revision: 257525 URL: http://svnweb.freebsd.org/changeset/base/257525 Log: Convert the random entropy harvesting code to use a const void * pointer rather than just void *. Then, as part of this, convert a couple of mbuf m->m_data accesses to mtod(m, const void *). Reviewed by: markm Approved by: security-officer (delphij) Sponsored by: Netflix, Inc. Modified: head/sys/dev/random/harvest.c head/sys/net/bpf.c head/sys/net/if_ethersubr.c head/sys/net/if_tun.c head/sys/sys/random.h Modified: head/sys/dev/random/harvest.c ============================================================================== --- head/sys/dev/random/harvest.c Fri Nov 1 20:33:30 2013 (r257524) +++ head/sys/dev/random/harvest.c Fri Nov 1 20:53:49 2013 (r257525) @@ -86,7 +86,7 @@ randomdev_deinit_harvester(void) * read which can be quite expensive. */ void -random_harvest(void *entropy, u_int count, u_int bits, enum esource origin) +random_harvest(const void *entropy, u_int count, u_int bits, enum esource origin) { if (reap_func) (*reap_func)(get_cyclecount(), entropy, count, bits, origin); Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Fri Nov 1 20:33:30 2013 (r257524) +++ head/sys/net/bpf.c Fri Nov 1 20:53:49 2013 (r257525) @@ -577,7 +577,7 @@ bpf_movein(struct uio *uio, int linktype goto bad; } } - bcopy(m->m_data, sockp->sa_data, hlen); + bcopy(mtod(m, const void *), sockp->sa_data, hlen); } *hdrlen = hlen; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Nov 1 20:33:30 2013 (r257524) +++ head/sys/net/if_ethersubr.c Fri Nov 1 20:53:49 2013 (r257525) @@ -642,7 +642,7 @@ ether_input_internal(struct ifnet *ifp, } if (harvest.ethernet) - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_ETHER); + random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_ETHER); ether_demux(ifp, m); CURVNET_RESTORE(); Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Fri Nov 1 20:33:30 2013 (r257524) +++ head/sys/net/if_tun.c Fri Nov 1 20:53:49 2013 (r257525) @@ -919,7 +919,7 @@ tunwrite(struct cdev *dev, struct uio *u return (EAFNOSUPPORT); } if (harvest.point_to_point) - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN); + random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_TUN); ifp->if_ibytes += m->m_pkthdr.len; ifp->if_ipackets++; CURVNET_SET(ifp->if_vnet); Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Fri Nov 1 20:33:30 2013 (r257524) +++ head/sys/sys/random.h Fri Nov 1 20:53:49 2013 (r257525) @@ -58,7 +58,7 @@ enum esource { RANDOM_PURE_RNDTEST, ENTROPYSOURCE }; -void random_harvest(void *, u_int, u_int, enum esource); +void random_harvest(const void *, u_int, u_int, enum esource); /* Allow the sysadmin to select the broad category of * entropy types to harvest From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 21:15:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 340FE952; Fri, 1 Nov 2013 21:15:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11A4328D5; Fri, 1 Nov 2013 21:15:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1LFg87055436; Fri, 1 Nov 2013 21:15:42 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1LFeVd055423; Fri, 1 Nov 2013 21:15:40 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311012115.rA1LFeVd055423@svn.freebsd.org> From: Brooks Davis Date: Fri, 1 Nov 2013 21:15:40 +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: r257527 - in stable/10/sys: boot/fdt/dts mips/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 21:15:42 -0000 Author: brooks Date: Fri Nov 1 21:15:39 2013 New Revision: 257527 URL: http://svnweb.freebsd.org/changeset/base/257527 Log: MFC r256912, r256931, r256977 Sync BERI kernel configs with P4: Switch the majority of device configuration to FDT from hints. Add BERI_*_BASE configs to reduce duplication in the MDROOT and SDROOT kernels. Add NFS and GSSAPI support by default. Enable ATSE_CFI_HACK in BERI configs, stable MAC addresses are useful. BERI_SIM.hint is no longer used, remove it. Sponsored by: DARPA/AFRL Approved by: re (delphij) Added: stable/10/sys/boot/fdt/dts/beri-sim.dts - copied unchanged from r256912, head/sys/boot/fdt/dts/beri-sim.dts stable/10/sys/boot/fdt/dts/beripad-de4.dts - copied unchanged from r256912, head/sys/boot/fdt/dts/beripad-de4.dts stable/10/sys/mips/conf/BERI_DE4_BASE - copied, changed from r256912, head/sys/mips/conf/BERI_DE4_BASE stable/10/sys/mips/conf/BERI_SIM_BASE - copied unchanged from r256912, head/sys/mips/conf/BERI_SIM_BASE stable/10/sys/mips/conf/BERI_SIM_SDROOT - copied unchanged from r256912, head/sys/mips/conf/BERI_SIM_SDROOT Deleted: stable/10/sys/mips/conf/BERI_SIM.hints Modified: stable/10/sys/mips/conf/BERI_DE4.hints stable/10/sys/mips/conf/BERI_DE4_MDROOT stable/10/sys/mips/conf/BERI_DE4_SDROOT stable/10/sys/mips/conf/BERI_SIM_MDROOT stable/10/sys/mips/conf/BERI_TEMPLATE Directory Properties: stable/10/sys/ (props changed) stable/10/sys/boot/ (props changed) Copied: stable/10/sys/boot/fdt/dts/beri-sim.dts (from r256912, head/sys/boot/fdt/dts/beri-sim.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/beri-sim.dts Fri Nov 1 21:15:39 2013 (r257527, copy of r256912, head/sys/boot/fdt/dts/beri-sim.dts) @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * Copyright (c) 2013 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/* + * Device names here have been largely made up on the spot, especially for the + * "compatible" strings, and might want to be revised. + * + * For now, use 32-bit addressing as our Avalon bus is 32-bit. However, in + * the future, we should likely change to 64-bit. + */ + +/ { + model = "SRI/Cambridge BERI simulation"; + compatible = "sri-cambridge,beri-sim"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <1>; + + /* + * Secondary CPUs all start disabled and use the + * spin-table enable method. cpu-release-addr must be + * specified for each cpu other than cpu@0. Values of + * cpu-release-addr grow down from 0x100000 (kernel). + */ + status = "disabled"; + enable-method = "spin-table"; + + cpu@0 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <0>; + status = "okay"; + }; + +/* + cpu@1 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <1>; + // XXX: should we need cached prefix? + cpu-release-addr = <0xffffffff 0x800fffe0>; + }; +*/ + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + /* + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips,mips4k"; + ranges = <>; + + memory { + device_type = "memory"; + reg = <0x0 0x4000000>; // 64M at 0x0 + }; + + beripic: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = <0 1 2 3 4>; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + }; + + serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f000000 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic>; + }; + + serial@7f001000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f001000 0x40>; + }; + + serial@7f002000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f002000 0x40>; + }; + + sdcard@7f008000 { + compatible = "altera,sdcard_11_2011"; + reg = <0x7f008000 0x400>; + }; + + avgen@0x7f00a000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00a000 0x14>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "berirom"; + }; + }; +}; Copied: stable/10/sys/boot/fdt/dts/beripad-de4.dts (from r256912, head/sys/boot/fdt/dts/beripad-de4.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/beripad-de4.dts Fri Nov 1 21:15:39 2013 (r257527, copy of r256912, head/sys/boot/fdt/dts/beripad-de4.dts) @@ -0,0 +1,266 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * Copyright (c) 2013 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/* + * Device names here have been largely made up on the spot, especially for the + * "compatible" strings, and might want to be revised. + * + * For now, use 32-bit addressing as our Avalon bus is 32-bit. However, in + * the future, we should likely change to 64-bit. + */ + +/ { + model = "SRI/Cambridge BeriPad (DE4)"; + compatible = "sri-cambridge,beripad-de4"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <1>; + + /* + * Secondary CPUs all start disabled and use the + * spin-table enable method. cpu-release-addr must be + * specified for each cpu other than cpu@0. Values of + * cpu-release-addr grow down from 0x100000 (kernel). + */ + status = "disabled"; + enable-method = "spin-table"; + + cpu@0 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <0>; + status = "okay"; + }; + +/* + cpu@1 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <1>; + // XXX: should we need cached prefix? + cpu-release-addr = <0xffffffff 0x800fffe0>; + }; +*/ + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + /* + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips,mips4k"; + ranges = <>; + + memory { + device_type = "memory"; + reg = <0x0 0x40000000>; // 1G at 0x0 + }; + + beripic: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = <0 1 2 3 4>; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + }; + + serial@7f002100 { + compatible = "ns16550"; + reg = <0x7f002100 0x20>; + reg-shift = <2>; + clock-frequency = <50000000>; + interrupts = <6>; + interrupt-parent = <&beripic>; + }; + + serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f000000 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic>; + }; + + serial@7f001000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f001000 0x40>; + }; + + serial@7f002000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f002000 0x40>; + }; + + sdcard@7f008000 { + compatible = "altera,sdcard_11_2011"; + reg = <0x7f008000 0x400>; + }; + + led@7f006000 { + compatible = "sri-cambridge,de4led"; + reg = <0x7f006000 0x1>; + }; + + /* + * XXX-BZ keep flash before ethernet so that atse can read the + * Ethernet addresses for now. + */ + flash@74000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x74000000 0x4000000>; + + /* Board configuration */ + partition@0 { + reg = <0x0 0x20000>; + label = "config"; + }; + + /* Power up FPGA image */ + partition@20000 { + reg = <0x20000 0xc00000>; + label = "fpga0"; + }; + + /* Secondary FPGA image (on RE_CONFIGn button) */ + partition@C20000 { + reg = <0xc20000 0xc00000>; + label = "fpga1"; + }; + + /* Space for operating system use */ + partition@1820000 { + reg = <0x1820000 0x027c0000>; + label = "os"; + }; + + /* Second stage bootloader */ + parition@3fe0000 { + reg = <0x3fe0000 0x20000>; + label = "boot"; + }; + }; + + ethernet@7f007000 { + compatible = "altera,atse"; + // MAC, RX+RXC, TX+TXC. + reg = <0x7f007000 0x400 + 0x7f007500 0x8 + 0x7f007520 0x20 + 0x7f007400 0x8 + 0x7f007420 0x20>; + // RX, TX + interrupts = <1 2>; + interrupt-parent = <&beripic>; + }; + + ethernet@7f005000 { + compatible = "altera,atse"; + // MAC, RX+RXC, TX+TXC. + reg = <0x7f005000 0x400 + 0x7f005500 0x8 + 0x7f005520 0x20 + 0x7f005400 0x8 + 0x7f005420 0x20>; + // RX, TX + interrupts = <11 12>; + interrupt-parent = <&beripic>; + }; + + touchscreen@70400000 { + compatible = "sri-cambridge,mtl"; + reg = <0x70400000 0x1000 + 0x70000000 0x177000 + 0x70177000 0x2000>; + }; + + usb@0x7f100000 { + compatible = "philips,isp1761"; + reg = <0x7f100000 0x40000 + 0x7f140000 0x4>; + // IRQ 4 is DC, IRQ 5 is HC. + interrupts = <4 5>; + interrupt-parent = <&beripic>; + }; + + avgen@0x7f009000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f009000 0x2>; + sri-cambridge,width = <1>; + sri-cambridge,fileio = "r"; + sri-cambridge,devname = "de4bsw"; + }; + + avgen@0x7f00a000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00a000 0x14>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "berirom"; + }; + + avgen@0x7f00c000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00c000 0x8>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "de4tempfan"; + }; + + avgen@0x7f100000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f100000 0x40000>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "r"; + sri-cambridge,devname = "usbmem"; + }; + + }; +}; Modified: stable/10/sys/mips/conf/BERI_DE4.hints ============================================================================== --- stable/10/sys/mips/conf/BERI_DE4.hints Fri Nov 1 21:10:44 2013 (r257526) +++ stable/10/sys/mips/conf/BERI_DE4.hints Fri Nov 1 21:15:39 2013 (r257527) @@ -1,75 +1,26 @@ # $FreeBSD$ -# -# Altera JTAG UARTs configured for console, debugging, and data putput on the -# Terasic DE-4. -# -hint.altera_jtag_uart.0.at="nexus0" -hint.altera_jtag_uart.0.maddr=0x7f000000 -hint.altera_jtag_uart.0.msize=0x40 -hint.altera_jtag_uart.0.irq=0 +# Hardwired location of bitfile +hint.map.0.at="cfid0s.fpga0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00c00000 +hint.map.0.name="fpga" + +# Kernel on the second chip +hint.map.1.at="cfid0s.os" +hint.map.1.start=0x007e0000 +hint.map.1.end=0x01fe0000 +hint.map.1.name="kernel" + +# Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations +# configured from fdt(4) but PHYs are still described in here. +# Currently configured for individual tse_mac cores. +hint.e1000phy.0.at="miibus0" +hint.e1000phy.0.phyno=0 +hint.e1000phy.1.at="miibus0" +hint.e1000phy.1.phyno=0 +hint.e1000phy.2.at="miibus0" +hint.e1000phy.2.phyno=0 +hint.e1000phy.3.at="miibus0" +hint.e1000phy.3.phyno=0 -hint.altera_jtag_uart.1.at="nexus0" -hint.altera_jtag_uart.1.maddr=0x7f001000 -hint.altera_jtag_uart.1.msize=0x40 - -hint.altera_jtag_uart.2.at="nexus0" -hint.altera_jtag_uart.2.maddr=0x7f002000 -hint.altera_jtag_uart.2.msize=0x40 - -# -# On-board DE4 and tPad SD Card IP core -# -hint.altera_sdcardc.0.at="nexus0" -hint.altera_sdcardc.0.maddr=0x7f008000 -hint.altera_sdcardc.0.msize=0x400 - -# -# On-board DE4 8-element LED -# -hint.terasic_de4led.0.at="nexus0" -hint.terasic_de4led.0.maddr=0x7f006000 -hint.terasic_de4led.0.msize=1 -hint.terasic_de4led.0.de4led_0_cmd="f9" - -# -# Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. -# -hint.terasic_mtl.0.at="nexus0" -hint.terasic_mtl.0.reg_maddr=0x70400000 -hint.terasic_mtl.0.reg_msize=0x1000 -hint.terasic_mtl.0.pixel_maddr=0x70000000 -hint.terasic_mtl.0.pixel_msize=0x177000 -hint.terasic_mtl.0.text_maddr=0x70177000 -hint.terasic_mtl.0.text_msize=0x2000 - -# -# BERI Hardware Version ROM -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7F00A000 -hint.altera_avgen.0.msize=20 -hint.altera_avgen.0.width=4 -hint.altera_avgen.0.fileio="rw" -hint.altera_avgen.0.devname="berirom" - -# -# Expose the DE4 flash via an Avalon "generic" device. -# -#hint.altera_avgen.0.at="nexus0" -#hint.altera_avgen.0.maddr=0x74000000 -#hint.altera_avgen.0.msize=0x4000000 -#hint.altera_avgen.0.width=2 -#hint.altera_avgen.0.fileio="rw" -#hint.altera_avgen.0.mmapio="rwx" -#hint.altera_avgen.0.devname="de4flash" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7f009000 -hint.altera_avgen.0.msize=2 -hint.altera_avgen.0.width=1 -hint.altera_avgen.0.fileio="r" -hint.altera_avgen.0.devname="de4bsw" Copied and modified: stable/10/sys/mips/conf/BERI_DE4_BASE (from r256912, head/sys/mips/conf/BERI_DE4_BASE) ============================================================================== --- head/sys/mips/conf/BERI_DE4_BASE Tue Oct 22 15:45:31 2013 (r256912, copy source) +++ stable/10/sys/mips/conf/BERI_DE4_BASE Fri Nov 1 21:15:39 2013 (r257527) @@ -32,6 +32,7 @@ device bpf device cfi device cfid options CFI_SUPPORT_STRATAFLASH +options ATSE_CFI_HACK device sc device uart Modified: stable/10/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_DE4_MDROOT Fri Nov 1 21:10:44 2013 (r257526) +++ stable/10/sys/mips/conf/BERI_DE4_MDROOT Fri Nov 1 21:15:39 2013 (r257527) @@ -1,29 +1,19 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC # Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD$ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_MDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - # # This kernel configuration uses an embedded 8MB memory root file system. # Adjust the following path based on local requirements. # options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 +options MD_ROOT_SIZE=26112 # 25.5MB options ROOTDEVNAME=\"ufs:md0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device sc Modified: stable/10/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_DE4_SDROOT Fri Nov 1 21:10:44 2013 (r257526) +++ stable/10/sys/mips/conf/BERI_DE4_SDROOT Fri Nov 1 21:15:39 2013 (r257527) @@ -1,23 +1,16 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_SDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD$ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_SDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - -options ROOTDEVNAME=\"ufs:altera_sdcard0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device sc +# +# This kernel expects to find its root filesystem on the SD Card. +# +options ROOTDEVNAME=\"ufs:/dev/altera_sdcard0\" Copied: stable/10/sys/mips/conf/BERI_SIM_BASE (from r256912, head/sys/mips/conf/BERI_SIM_BASE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/mips/conf/BERI_SIM_BASE Fri Nov 1 21:15:39 2013 (r257527, copy of r256912, head/sys/mips/conf/BERI_SIM_BASE) @@ -0,0 +1,19 @@ +# +# BERI_SIM_BASE -- Base kernel for the SRI/Cambridge "BERI" (Bluespec +# Extensible RISC Implementation) FPGA soft core, as configured for +# simulation. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beri-sim.dts + +options ALTERA_SDCARD_FAST_SIM + +device altera_avgen +device altera_jtag_uart +device altera_sdcard Modified: stable/10/sys/mips/conf/BERI_SIM_MDROOT ============================================================================== --- stable/10/sys/mips/conf/BERI_SIM_MDROOT Fri Nov 1 21:10:44 2013 (r257526) +++ stable/10/sys/mips/conf/BERI_SIM_MDROOT Fri Nov 1 21:15:39 2013 (r257527) @@ -1,24 +1,18 @@ # -# BERI_SIM -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured for simulation. +# BERI_SIM_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured for simulation. # # $FreeBSD$ # -include "BERI_TEMPLATE" +include "BERI_SIM_BASE" ident BERI_SIM_MDROOT -hints "BERI_SIM.hints" #Default places to look for devices. - # -# This kernel configuration uses an embedded 8MB memory root file system. +# This kernel configuration uses an embedded memory root file system. # Adjust the following path based on local requirements. # options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 +options MD_ROOT_SIZE=26112 # 25.5MB options ROOTDEVNAME=\"ufs:md0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard Copied: stable/10/sys/mips/conf/BERI_SIM_SDROOT (from r256912, head/sys/mips/conf/BERI_SIM_SDROOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/mips/conf/BERI_SIM_SDROOT Fri Nov 1 21:15:39 2013 (r257527, copy of r256912, head/sys/mips/conf/BERI_SIM_SDROOT) @@ -0,0 +1,15 @@ +# +# BERI_SIM_SDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured for simulation. +# +# $FreeBSD$ +# + +include "BERI_SIM_BASE" + +ident BERI_SIM_SDROOT + +# +# This kernel expects to find its root filesystem on the SD Card. +# +options ROOTDEVNAME=\"ufs:/dev/altera_sdcard0\" Modified: stable/10/sys/mips/conf/BERI_TEMPLATE ============================================================================== --- stable/10/sys/mips/conf/BERI_TEMPLATE Fri Nov 1 21:10:44 2013 (r257526) +++ stable/10/sys/mips/conf/BERI_TEMPLATE Fri Nov 1 21:15:39 2013 (r257527) @@ -39,7 +39,9 @@ options FFS #Berkeley Fast Filesystem options INET options INET6 +options KGSSAPI options NFSCL +options NFSLOCKD options NFS_ROOT # Debugging for use in -current @@ -49,10 +51,11 @@ options INVARIANT_SUPPORT #Extra sanity #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device geom_map - -device md +device crypto +device cryptodev device ether +device geom_map device loop +device md device random device snp From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 21:17:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E09A7A94; Fri, 1 Nov 2013 21:17:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC52928E5; Fri, 1 Nov 2013 21:17:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1LHkA3055692; Fri, 1 Nov 2013 21:17:46 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1LHkG9055688; Fri, 1 Nov 2013 21:17:46 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311012117.rA1LHkG9055688@svn.freebsd.org> From: Brooks Davis Date: Fri, 1 Nov 2013 21:17:46 +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: r257528 - in stable/10/sys: conf mips/beri mips/include mips/mips X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 21:17:47 -0000 Author: brooks Date: Fri Nov 1 21:17:45 2013 New Revision: 257528 URL: http://svnweb.freebsd.org/changeset/base/257528 Log: MFC r256935 MFP4: Change 228019 by bz@bz_zenith on 2013/04/23 13:55:30 Add kernel side support for large TLB on BERI/CHERI. Modelled similar to NLM Sponsored by: DAPRA/AFRL Approved by: re (delphij) Modified: stable/10/sys/conf/options.mips stable/10/sys/mips/beri/std.beri stable/10/sys/mips/include/cpufunc.h stable/10/sys/mips/mips/cpu.c Directory Properties: stable/10/sys/ (props changed) stable/10/sys/conf/ (props changed) Modified: stable/10/sys/conf/options.mips ============================================================================== --- stable/10/sys/conf/options.mips Fri Nov 1 21:15:39 2013 (r257527) +++ stable/10/sys/conf/options.mips Fri Nov 1 21:17:45 2013 (r257528) @@ -81,6 +81,11 @@ OCTEON_VENDOR_GEFES opt_cvmx.h OCTEON_BOARD_CAPK_0100ND opt_cvmx.h # +# Options specific to the BERI platform. +# +BERI_LARGE_TLB opt_global.h + +# # Options that control the Atheros SoC peripherals # ARGE_DEBUG opt_arge.h Modified: stable/10/sys/mips/beri/std.beri ============================================================================== --- stable/10/sys/mips/beri/std.beri Fri Nov 1 21:15:39 2013 (r257527) +++ stable/10/sys/mips/beri/std.beri Fri Nov 1 21:17:45 2013 (r257528) @@ -2,3 +2,5 @@ files "../beri/files.beri" cpu CPU_MIPS4KC + +options BERI_LARGE_TLB Modified: stable/10/sys/mips/include/cpufunc.h ============================================================================== --- stable/10/sys/mips/include/cpufunc.h Fri Nov 1 21:15:39 2013 (r257527) +++ stable/10/sys/mips/include/cpufunc.h Fri Nov 1 21:17:45 2013 (r257528) @@ -242,8 +242,13 @@ MIPS_RW32_COP0_SEL(config3, MIPS_COP_0_C #ifdef CPU_CNMIPS MIPS_RW32_COP0_SEL(config4, MIPS_COP_0_CONFIG, 4); #endif -#ifdef CPU_NLM +#ifdef BERI_LARGE_TLB +MIPS_RW32_COP0_SEL(config5, MIPS_COP_0_CONFIG, 5); +#endif +#if defined(CPU_NLM) || defined(BERI_LARGE_TLB) MIPS_RW32_COP0_SEL(config6, MIPS_COP_0_CONFIG, 6); +#endif +#ifdef CPU_NLM MIPS_RW32_COP0_SEL(config7, MIPS_COP_0_CONFIG, 7); #endif MIPS_RW32_COP0(count, MIPS_COP_0_COUNT); Modified: stable/10/sys/mips/mips/cpu.c ============================================================================== --- stable/10/sys/mips/mips/cpu.c Fri Nov 1 21:15:39 2013 (r257527) +++ stable/10/sys/mips/mips/cpu.c Fri Nov 1 21:17:45 2013 (r257528) @@ -99,17 +99,29 @@ mips_get_identity(struct mips_cpuinfo *c /* Learn TLB size and L1 cache geometry. */ cfg1 = mips_rd_config1(); -#ifndef CPU_NLM - cpuinfo->tlb_nentries = - ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1; -#else + +#if defined(CPU_NLM) /* Account for Extended TLB entries in XLP */ tmp = mips_rd_config6(); cpuinfo->tlb_nentries = ((tmp >> 16) & 0xffff) + 1; +#elif defined(BERI_LARGE_TLB) + /* Check if we support extended TLB entries and if so activate. */ + tmp = mips_rd_config5(); +#define BERI_CP5_LTLB_SUPPORTED 0x1 + if (tmp & BERI_CP5_LTLB_SUPPORTED) { + /* See how many extra TLB entries we have. */ + tmp = mips_rd_config6(); + cpuinfo->tlb_nentries = (tmp >> 16) + 1; + /* Activate the extended entries. */ + mips_wr_config6(tmp|0x4); + } else +#endif +#if !defined(CPU_NLM) + cpuinfo->tlb_nentries = + ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1; #endif - - /* Add extended TLB size information from config4. */ #if defined(CPU_CNMIPS) + /* Add extended TLB size information from config4. */ cfg4 = mips_rd_config4(); if ((cfg4 & MIPS_CONFIG4_MMUEXTDEF) == MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT) cpuinfo->tlb_nentries += (cfg4 & MIPS_CONFIG4_MMUSIZEEXT) * 0x40; @@ -124,8 +136,8 @@ mips_get_identity(struct mips_cpuinfo *c 1 << (((cfg1 & MIPS_CONFIG1_IS_MASK) >> MIPS_CONFIG1_IS_SHIFT) + 6); } -#ifndef CPU_CNMIPS /* L1 data cache. */ +#ifndef CPU_CNMIPS tmp = (cfg1 & MIPS_CONFIG1_DL_MASK) >> MIPS_CONFIG1_DL_SHIFT; if (tmp != 0) { cpuinfo->l1.dc_linesize = 1 << (tmp + 1); From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 21:21:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0866BC36; Fri, 1 Nov 2013 21:21:17 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E63022922; Fri, 1 Nov 2013 21:21:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1LLGvN058185; Fri, 1 Nov 2013 21:21:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1LLFCd058167; Fri, 1 Nov 2013 21:21:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311012121.rA1LLFCd058167@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 1 Nov 2013 21:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257529 - in head: share/man/man4 sys/conf sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 21:21:17 -0000 Author: luigi Date: Fri Nov 1 21:21:14 2013 New Revision: 257529 URL: http://svnweb.freebsd.org/changeset/base/257529 Log: update to the latest netmap snapshot. This includes the following: - use separate memory regions for VALE ports - locking fixes - some simplifications in the NIC-specific routines - performance improvements for the VALE switch - some new features in the pkt-gen test program - documentation updates There are small API changes that require programs to be recompiled (NETMAP_API has been bumped so you will detect old binaries at runtime). In particular: - struct netmap_slot now is 16 bytes to support an extra pointer, which may save one data copy when using VALE ports or VMs; - the struct netmap_if has two extra fields; MFC after: 3 days Modified: head/share/man/man4/netmap.4 head/sys/conf/files head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/re/if_re.c head/sys/net/netmap.h head/tools/tools/netmap/nm_util.c head/tools/tools/netmap/pkt-gen.c Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Fri Nov 1 21:17:45 2013 (r257528) +++ head/share/man/man4/netmap.4 Fri Nov 1 21:21:14 2013 (r257529) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa +.\" Copyright (c) 2011-2013 Matteo Landi, Luigi Rizzo, Universita` di Pisa .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -21,14 +21,13 @@ .\" 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 document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" .\" $FreeBSD$ -.\" $Id: netmap.4 11563 2012-08-02 08:59:12Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ .\" -.Dd September 23, 2013 +.Dd October 18, 2013 .Dt NETMAP 4 .Os .Sh NAME @@ -38,101 +37,230 @@ .Cd device netmap .Sh DESCRIPTION .Nm -is a framework for fast and safe access to network devices -(reaching 14.88 Mpps at less than 1 GHz). -.Nm -uses memory mapped buffers and metadata -(buffer indexes and lengths) to communicate with the kernel, -which is in charge of validating information through -.Pa ioctl() -and -.Pa select()/poll(). +is a framework for extremely fast and efficient packet I/O +(reaching 14.88 Mpps with a single core at less than 1 GHz) +for both userspace and kernel clients. +Userspace clients can use the netmap API +to send and receive raw packets through physical interfaces +or ports of the +.Xr VALE 4 +switch. +.Pp +.Nm VALE +is a very fast (reaching 20 Mpps per port) +and modular software switch, +implemented within the kernel, which can interconnect +virtual ports, physical devices, and the native host stack. +.Pp +.Nm +uses a memory mapped region to share packet buffers, +descriptors and queues with the kernel. +Simple +.Pa ioctl()s +are used to bind interfaces/ports to file descriptors and +implement non-blocking I/O, whereas blocking I/O uses +.Pa select()/poll() . .Nm can exploit the parallelism in multiqueue devices and multicore systems. .Pp +For the best performance, +.Nm +requires explicit support in device drivers; +a generic emulation layer is available to implement the .Nm -requires explicit support in device drivers. -For a list of supported devices, see the end of this manual page. -.Sh OPERATION +API on top of unmodified device drivers, +at the price of reduced performance +(but still better than what can be achieved with +sockets or BPF/pcap). +.Pp +For a list of devices with native .Nm -clients must first open the +support, see the end of this manual page. +.Pp +.Sh OPERATION - THE NETMAP API +.Nm +clients must first .Pa open("/dev/netmap") , and then issue an -.Pa ioctl(...,NIOCREGIF,...) -to bind the file descriptor to a network device. -.Pp -When a device is put in +.Pa ioctl(fd, NIOCREGIF, (struct nmreq *)arg) +to bind the file descriptor to a specific interface or port. .Nm -mode, its data path is disconnected from the host stack. -The processes owning the file descriptor -can exchange packets with the device, or with the host stack, -through an mmapped memory region that contains pre-allocated -buffers and metadata. +has multiple modes of operation controlled by the +content of the +.Pa struct nmreq +passed to the +.Pa ioctl() . +In particular, the +.Em nr_name +field specifies whether the client operates on a physical network +interface or on a port of a +.Nm VALE +switch, as indicated below. Additional fields in the +.Pa struct nmreq +control the details of operation. +.Pp +.Bl -tag -width XXXX +.It Dv Interface name (e.g. 'em0', 'eth1', ... ) +The data path of the interface is disconnected from the host stack. +Depending on additional arguments, +the file descriptor is bound to the NIC (one or all queues), +or to the host stack. +.It Dv valeXXX:YYY (arbitrary XXX and YYY) +The file descriptor is bound to port YYY of a VALE switch called XXX, +where XXX and YYY are arbitrary alphanumeric strings. +The string cannot exceed IFNAMSIZ characters, and YYY cannot +matching the name of any existing interface. +.Pp +The switch and the port are created if not existing. +.It Dv valeXXX:ifname (ifname is an existing interface) +Flags in the argument control whether the physical interface +(and optionally the corrisponding host stack endpoint) +are connected or disconnected from the VALE switch named XXX. .Pp +In this case the +.Pa ioctl() +is used only for configuring the VALE switch, typically through the +.Nm vale-ctl +command. +The file descriptor cannot be used for I/O, and should be +.Pa close()d +after issuing the +.Pa ioctl(). +.El +.Pp +The binding can be removed (and the interface returns to +regular operation, or the virtual port destroyed) with a +.Pa close() +on the file descriptor. +.Pp +The processes owning the file descriptor can then +.Pa mmap() +the memory region that contains pre-allocated +buffers, descriptors and queues, and use them to +read/write raw packets. Non blocking I/O is done with special .Pa ioctl()'s , whereas the file descriptor can be passed to .Pa select()/poll() to be notified about incoming packet or available transmit buffers. -.Ss Data structures -All data structures for all devices in +.Ss DATA STRUCTURES +The data structures in the mmapped memory are described below +(see +.Xr sys/net/netmap.h +for reference). +All physical devices operating in .Nm -mode are in a memory -region shared by the kernel and all processes -who open +mode use the same memory region, +shared by the kernel and all processes who own .Pa /dev/netmap +descriptors bound to those devices (NOTE: visibility may be restricted in future implementations). +Virtual ports instead use separate memory regions, +shared only with the kernel. +.Pp All references between the shared data structure are relative (offsets or indexes). Some macros help converting them into actual pointers. -.Pp -The data structures in shared memory are the following: .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) indicates the number of rings supported by an interface, their sizes, and the offsets of the .Pa netmap_rings associated to the interface. -The offset of a +.Pp .Pa struct netmap_if -in the shared memory region is indicated by the +is at offset .Pa nr_offset +in the shared memory region is indicated by the field in the structure returned by the .Pa NIOCREGIF (see below). .Bd -literal struct netmap_if { - char ni_name[IFNAMSIZ]; /* name of the interface. */ - const u_int ni_num_queues; /* number of hw ring pairs */ - const ssize_t ring_ofs[]; /* offset of tx and rx rings */ + char ni_name[IFNAMSIZ]; /* name of the interface. */ + const u_int ni_version; /* API version */ + const u_int ni_rx_rings; /* number of rx ring pairs */ + const u_int ni_tx_rings; /* if 0, same as ni_rx_rings */ + const ssize_t ring_ofs[]; /* offset of tx and rx rings */ }; .Ed .It Dv struct netmap_ring (one per ring) -contains the index of the current read or write slot (cur), -the number of slots available for reception or transmission (avail), +Contains the positions in the transmit and receive rings to +synchronize the kernel and the application, and an array of .Pa slots describing the buffers. -There is one ring pair for each of the N hardware ring pairs -supported by the card (numbered 0..N-1), plus -one ring pair (numbered N) for packets from/to the host stack. +'reserved' is used in receive rings to tell the kernel the +number of slots after 'cur' that are still in usr +indicates how many slots starting from 'cur' +the +.Pp +Each physical interface has one +.Pa netmap_ring +for each hardware transmit and receive ring, +plus one extra transmit and one receive structure +that connect to the host stack. .Bd -literal struct netmap_ring { - const ssize_t buf_ofs; - const uint32_t num_slots; /* number of slots in the ring. */ - uint32_t avail; /* number of usable slots */ - uint32_t cur; /* 'current' index for the user side */ - uint32_t reserved; /* not refilled before current */ + const ssize_t buf_ofs; /* see details */ + const uint32_t num_slots; /* number of slots in the ring */ + uint32_t avail; /* number of usable slots */ + uint32_t cur; /* 'current' read/write index */ + uint32_t reserved; /* not refilled before current */ const uint16_t nr_buf_size; - uint16_t flags; - struct netmap_slot slot[0]; /* array of slots. */ + uint16_t flags; +#define NR_TIMESTAMP 0x0002 /* set timestamp on *sync() */ +#define NR_FORWARD 0x0004 /* enable NS_FORWARD for ring */ +#define NR_RX_TSTMP 0x0008 /* set rx timestamp in slots */ + struct timeval ts; + struct netmap_slot slot[0]; /* array of slots */ } .Ed +.Pp +In transmit rings, after a system call 'cur' indicates +the first slot that can be used for transmissions, +and 'avail' reports how many of them are available. +Before the next netmap-related system call on the file +descriptor, the application should fill buffers and +slots with data, and update 'cur' and 'avail' +accordingly, as shown in the figure below: +.Bd -literal + + cur + |----- avail ---| (after syscall) + v + TX [*****aaaaaaaaaaaaaaaaa**] + TX [*****TTTTTaaaaaaaaaaaa**] + ^ + |-- avail --| (before syscall) + cur +.Ed + +In receive rings, after a system call 'cur' indicates +the first slot that contains a valid packet, +and 'avail' reports how many of them are available. +Before the next netmap-related system call on the file +descriptor, the application can process buffers and +release them to the kernel updating +'cur' and 'avail' accordingly, as shown in the figure below. +Receive rings have an additional field called 'reserved' +to indicate how many buffers before 'cur' are still +under processing and cannot be released. +.Bd -literal + cur + |-res-|-- avail --| (after syscall) + v + RX [**rrrrrrRRRRRRRRRRRR******] + RX [**...........rrrrRRR******] + |res|--|flags >> 8) & 0xff) + uint64_t ptr; /* buffer address (indirect buffers) */ }; .Ed +The flags control how the the buffer associated to the slot +should be managed. .It Dv packet buffers -are fixed size (approximately 2k) buffers allocated by the kernel +are normally fixed size (2 Kbyte) buffers allocated by the kernel that contain packet data. Buffers addresses are computed through macros. .El .Pp +.Bl -tag -width XXX Some macros support the access to objects in the shared memory -region. In particular: -.Bd -literal -struct netmap_if *nifp; -struct netmap_ring *txring = NETMAP_TXRING(nifp, i); -struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); -int i = txring->slot[txring->cur].buf_idx; -char *buf = NETMAP_BUF(txring, i); -.Ed +region. In particular, +.It NETMAP_TXRING(nifp, i) +.It NETMAP_RXRING(nifp, i) +return the address of the i-th transmit and receive ring, +respectively, whereas +.It NETMAP_BUF(ring, buf_idx) +returns the address of the buffer with index buf_idx +(which can be part of any ring for the given interface). +.El +.Pp +Normally, buffers are associated to slots when interfaces are bound, +and one packet is fully contained in a single buffer. +Clients can however modify the mapping using the +following flags: +.Ss FLAGS +.Bl -tag -width XXX +.It NS_BUF_CHANGED +indicates that the buf_idx in the slot has changed. +This can be useful if the client wants to implement +some form of zero-copy forwarding (e.g. by passing buffers +from an input interface to an output interface), or +needs to process packets out of order. +.Pp +The flag MUST be used whenever the buffer index is changed. +.It NS_REPORT +indicates that we want to be woken up when this buffer +has been transmitted. This reduces performance but insures +a prompt notification when a buffer has been sent. +Normally, +.Nm +notifies transmit completions in batches, hence signals +can be delayed indefinitely. However, we need such notifications +before closing a descriptor. +.It NS_FORWARD +When the device is open in 'transparent' mode, +the client can mark slots in receive rings with this flag. +For all marked slots, marked packets are forwarded to +the other endpoint at the next system call, thus restoring +(in a selective way) the connection between the NIC and the +host stack. +.It NS_NO_LEARN +tells the forwarding code that the SRC MAC address for this +packet should not be used in the learning bridge +.It NS_INDIRECT +indicates that the packet's payload is not in the netmap +supplied buffer, but in a user-supplied buffer whose +user virtual address is in the 'ptr' field of the slot. +The size can reach 65535 bytes. +.Em This is only supported on the transmit ring of virtual ports +.It NS_MOREFRAG +indicates that the packet continues with subsequent buffers; +the last buffer in a packet must have the flag clear. +The maximum length of a chain is 64 buffers. +.Em This is only supported on virtual ports +.It ns_ctr +on receive rings, contains the number of remaining buffers +in a packet, including this one. +Slots with a value greater than 1 also have NS_MOREFRAG set. +The length refers to the individual buffer, there is no +field for the total length +XXX maybe put it in the ptr field ? +.Pp +On transmit rings, if NS_DST is set, it is passed to the lookup +function, which can use it e.g. as the index of the destination +port instead of doing an address lookup. +.El .Sh IOCTLS .Nm supports some ioctl() to synchronize the state of the rings @@ -166,13 +365,13 @@ between the kernel and the user processe to query and configure the interface. The former do not require any argument, whereas the latter use a -.Pa struct netmap_req +.Pa struct nmreq defined as follows: .Bd -literal struct nmreq { char nr_name[IFNAMSIZ]; uint32_t nr_version; /* API version */ -#define NETMAP_API 3 /* current version */ +#define NETMAP_API 4 /* current version */ uint32_t nr_offset; /* nifp offset in the shared region */ uint32_t nr_memsize; /* size of the shared region */ uint32_t nr_tx_slots; /* slots in tx rings */ @@ -184,8 +383,14 @@ struct nmreq { #define NETMAP_SW_RING 0x2000 /* we process the sw ring */ #define NETMAP_NO_TX_POLL 0x1000 /* no gratuitous txsync on poll */ #define NETMAP_RING_MASK 0xfff /* the actual ring number */ - uint16_t spare1; - uint32_t spare2[4]; + uint16_t nr_cmd; +#define NETMAP_BDG_ATTACH 1 /* attach the NIC */ +#define NETMAP_BDG_DETACH 2 /* detach the NIC */ +#define NETMAP_BDG_LOOKUP_REG 3 /* register lookup function */ +#define NETMAP_BDG_LIST 4 /* get bridge's info */ + uint16_t nr_arg1; + uint16_t nr_arg2; + uint32_t spare2[3]; }; .Ed @@ -200,15 +405,27 @@ command codes below are defined in and are: .Bl -tag -width XXXX .It Dv NIOCGINFO -returns information about the interface named in nr_name. -On return, nr_memsize indicates the size of the shared netmap -memory region (this is device-independent), -nr_tx_slots and nr_rx_slots indicates how many buffers are in a -transmit and receive ring, -nr_tx_rings and nr_rx_rings indicates the number of transmit -and receive rings supported by the hardware. -.Pp -If the device does not support netmap, the ioctl returns EINVAL. +returns EINVAL if the named device does not support netmap. +Otherwise, it returns 0 and (advisory) information +about the interface. +Note that all the information below can change before the +interface is actually put in netmap mode. +.Pp +.Pa nr_memsize +indicates the size of the netmap +memory region. Physical devices all share the same memory region, +whereas VALE ports may have independent regions for each port. +These sizes can be set through system-wise sysctl variables. +.Pa nr_tx_slots, nr_rx_slots +indicate the size of transmit and receive rings. +.Pa nr_tx_rings, nr_rx_rings +indicate the number of transmit +and receive rings. +Both ring number and sizes may be configured at runtime +using interface-specific functions (e.g. +.Pa sysctl +or +.Pa ethtool . .It Dv NIOCREGIF puts the interface named in nr_name into netmap mode, disconnecting it from the host stack, and/or defines which rings are controlled @@ -243,8 +460,11 @@ or the send queue is full. .Pa NIOCREGIF can be used multiple times to change the association of a file descriptor to a ring pair, always within the same device. -.It Dv NIOCUNREGIF -brings an interface back to normal mode. +.Pp +When registering a virtual interface that is dynamically created to a +.Xr vale 4 +switch, we can specify the desired number of rings (1 by default, +and currently up to 16) on it using nr_tx_rings and nr_rx_rings fields. .It Dv NIOCTXSYNC tells the hardware of new packets to transmit, and updates the number of slots available for transmission. @@ -255,10 +475,20 @@ packets. .Sh SYSTEM CALLS .Nm uses -.Nm select +.Xr select 2 and -.Nm poll -to wake up processes when significant events occur. +.Xr poll 2 +to wake up processes when significant events occur, and +.Xr mmap 2 +to map memory. +.Pp +Applications may need to create threads and bind them to +specific cores to improve performance, using standard +OS primitives, see +.Xr pthread 3 . +In particular, +.Xr pthread_setaffinity_np 3 +may be of use. .Sh EXAMPLES The following code implements a traffic generator .Pp @@ -272,10 +502,10 @@ struct nmreq nmr; fd = open("/dev/netmap", O_RDWR); bzero(&nmr, sizeof(nmr)); strcpy(nmr.nr_name, "ix0"); -nmr.nr_version = NETMAP_API; -ioctl(fd, NIOCREG, &nmr); +nmr.nm_version = NETMAP_API; +ioctl(fd, NIOCREGIF, &nmr); p = mmap(0, nmr.nr_memsize, fd); -nifp = NETMAP_IF(p, nmr.offset); +nifp = NETMAP_IF(p, nmr.nr_offset); ring = NETMAP_TXRING(nifp, 0); fds.fd = fd; fds.events = POLLOUT; @@ -312,13 +542,17 @@ Usenix ATC'12, June 2012, Boston .An -nosplit The .Nm -framework has been designed and implemented at the +framework has been originally designed and implemented at the Universita` di Pisa in 2011 by .An Luigi Rizzo , -with help from +and further extended with help from .An Matteo Landi , .An Gaetano Catalli , -.An Giuseppe Lettieri . +.An Giuseppe Lettieri , +.An Vincenzo Maffione . .Pp .Nm -has been funded by the European Commission within FP7 Project CHANGE (257422). +and +.Nm VALE +have been funded by the European Commission within FP7 Projects +CHANGE (257422) and OPENLAB (287581). Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/conf/files Fri Nov 1 21:21:14 2013 (r257529) @@ -1881,6 +1881,8 @@ dev/nand/nfc_if.m optional nand dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/netmap/netmap.c optional netmap +dev/netmap/netmap_mem2.c optional netmap +# compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nge/if_nge.c optional nge dev/nxge/if_nxge.c optional nxge \ compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/e1000/if_em.c Fri Nov 1 21:21:14 2013 (r257529) @@ -3836,8 +3836,7 @@ em_txeof(struct tx_ring *txr) EM_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (netmap_tx_irq(ifp, txr->me | - (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT))) + if (netmap_tx_irq(ifp, txr->me)) return; #endif /* DEV_NETMAP */ @@ -4101,7 +4100,7 @@ em_setup_receive_ring(struct rx_ring *rx sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); bzero((void *)rxr->rx_base, rsize); #ifdef DEV_NETMAP - slot = netmap_reset(na, NR_RX, 0, 0); + slot = netmap_reset(na, NR_RX, rxr->me, 0); #endif /* @@ -4433,8 +4432,10 @@ em_rxeof(struct rx_ring *rxr, int count, EM_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + if (netmap_rx_irq(ifp, rxr->me, &processed)) { + EM_RX_UNLOCK(rxr); return (FALSE); + } #endif /* DEV_NETMAP */ for (i = rxr->next_to_check, processed = 0; count != 0;) { Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/e1000/if_igb.c Fri Nov 1 21:21:14 2013 (r257529) @@ -3962,8 +3962,7 @@ igb_txeof(struct tx_ring *txr) mtx_assert(&txr->tx_mtx, MA_OWNED); #ifdef DEV_NETMAP - if (netmap_tx_irq(ifp, txr->me | - (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) + if (netmap_tx_irq(ifp, txr->me)) return (FALSE); #endif /* DEV_NETMAP */ @@ -4829,8 +4828,10 @@ igb_rxeof(struct igb_queue *que, int cou BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); #ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + if (netmap_rx_irq(ifp, rxr->me, &processed)) { + IGB_RX_UNLOCK(rxr); return (FALSE); + } #endif /* DEV_NETMAP */ /* Main clean loop */ Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/e1000/if_lem.c Fri Nov 1 21:21:14 2013 (r257529) @@ -2986,7 +2986,7 @@ lem_txeof(struct adapter *adapter) EM_TX_LOCK_ASSERT(adapter); #ifdef DEV_NETMAP - if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) + if (netmap_tx_irq(ifp, 0)) return; #endif /* DEV_NETMAP */ if (adapter->num_tx_desc_avail == adapter->num_tx_desc) @@ -3455,8 +3455,10 @@ lem_rxeof(struct adapter *adapter, int c BUS_DMASYNC_POSTREAD); #ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, 0 | NETMAP_LOCKED_ENTER, &rx_sent)) + if (netmap_rx_irq(ifp, 0, &rx_sent)) { + EM_RX_UNLOCK(adapter); return (FALSE); + } #endif /* DEV_NETMAP */ if (!((current_desc->status) & E1000_RXD_STAT_DD)) { Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/e1000/if_lem.h Fri Nov 1 21:21:14 2013 (r257529) @@ -265,6 +265,13 @@ #define PICOSECS_PER_TICK 20833 #define TSYNC_PORT 319 /* UDP port for the protocol */ +#ifdef NIC_PARAVIRT +#define E1000_PARA_SUBDEV 0x1101 /* special id */ +#define E1000_CSBAL 0x02830 /* csb phys. addr. low */ +#define E1000_CSBAH 0x02834 /* csb phys. addr. hi */ +#include +#endif /* NIC_PARAVIRT */ + /* * Bus dma allocation structure used by * e1000_dma_malloc and e1000_dma_free. @@ -437,6 +444,26 @@ struct adapter { boolean_t pcix_82544; boolean_t in_detach; +#ifdef NIC_SEND_COMBINING + /* 0 = idle; 1xxxx int-pending; 3xxxx int + d pending + tdt */ +#define MIT_PENDING_INT 0x10000 /* pending interrupt */ +#define MIT_PENDING_TDT 0x30000 /* both intr and tdt write are pending */ + uint32_t shadow_tdt; + uint32_t sc_enable; +#endif /* NIC_SEND_COMBINING */ +#ifdef BATCH_DISPATCH + uint32_t batch_enable; +#endif /* BATCH_DISPATCH */ + +#ifdef NIC_PARAVIRT + struct em_dma_alloc csb_mem; /* phys address */ + struct paravirt_csb *csb; /* virtual addr */ + uint32_t rx_retries; /* optimize rx loop */ + uint32_t tdt_csb_count;// XXX stat + uint32_t tdt_reg_count;// XXX stat + uint32_t tdt_int_count;// XXX stat + uint32_t guest_need_kick_count;// XXX stat +#endif /* NIC_PARAVIRT */ struct e1000_hw_stats stats; }; Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/ixgbe/ixgbe.c Fri Nov 1 21:21:14 2013 (r257529) @@ -3621,16 +3621,11 @@ ixgbe_txeof(struct tx_ring *txr) * means the user thread should not be woken up); * - the driver ignores tx interrupts unless netmap_mitigate=0 * or the slot has the DD bit set. - * - * When the driver has separate locks, we need to - * release and re-acquire txlock to avoid deadlocks. - * XXX see if we can find a better way. */ if (!netmap_mitigate || (kring->nr_kflags < kring->nkr_num_slots && txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) { - netmap_tx_irq(ifp, txr->me | - (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)); + netmap_tx_irq(ifp, txr->me); } return; } @@ -4422,8 +4417,10 @@ ixgbe_rxeof(struct ix_queue *que) #ifdef DEV_NETMAP /* Same as the txeof routine: wakeup clients on intr. */ - if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + if (netmap_rx_irq(ifp, rxr->me, &processed)) { + IXGBE_RX_UNLOCK(rxr); return (FALSE); + } #endif /* DEV_NETMAP */ for (i = rxr->next_to_check; count != 0;) { Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/netmap/if_em_netmap.h Fri Nov 1 21:21:14 2013 (r257529) @@ -43,35 +43,6 @@ static void em_netmap_block_tasks(struct static void em_netmap_unblock_tasks(struct adapter *); -static void -em_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid) -{ - struct adapter *adapter = ifp->if_softc; - - ASSERT(queueid < adapter->num_queues); - switch (what) { - case NETMAP_CORE_LOCK: - EM_CORE_LOCK(adapter); - break; - case NETMAP_CORE_UNLOCK: - EM_CORE_UNLOCK(adapter); - break; - case NETMAP_TX_LOCK: - EM_TX_LOCK(&adapter->tx_rings[queueid]); - break; - case NETMAP_TX_UNLOCK: - EM_TX_UNLOCK(&adapter->tx_rings[queueid]); - break; - case NETMAP_RX_LOCK: - EM_RX_LOCK(&adapter->rx_rings[queueid]); - break; - case NETMAP_RX_UNLOCK: - EM_RX_UNLOCK(&adapter->rx_rings[queueid]); - break; - } -} - - // XXX do we need to block/unblock the tasks ? static void em_netmap_block_tasks(struct adapter *adapter) @@ -137,7 +108,7 @@ em_netmap_reg(struct ifnet *ifp, int ono ifp->if_capenable |= IFCAP_NETMAP; na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_start; + ifp->if_transmit = netmap_transmit; em_init_locked(adapter); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { @@ -160,7 +131,7 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) +em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) { struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; @@ -176,8 +147,6 @@ em_netmap_txsync(struct ifnet *ifp, u_in if (k > lim) return netmap_ring_reinit(kring); - if (do_lock) - EM_TX_LOCK(txr); bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); @@ -202,8 +171,6 @@ em_netmap_txsync(struct ifnet *ifp, u_in u_int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - if (do_lock) - EM_TX_UNLOCK(txr); return netmap_ring_reinit(kring); } @@ -252,8 +219,6 @@ em_netmap_txsync(struct ifnet *ifp, u_in /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; - if (do_lock) - EM_TX_UNLOCK(txr); return 0; } @@ -262,7 +227,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in * Reconcile kernel and user view of the receive ring. */ static int -em_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) +em_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int flags) { struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; @@ -270,16 +235,13 @@ em_netmap_rxsync(struct ifnet *ifp, u_in struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int j, l, n, lim = kring->nkr_num_slots - 1; - int force_update = do_lock || kring->nr_kflags & NKR_PENDINTR; + int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; u_int k = ring->cur, resvd = ring->reserved; k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); - if (do_lock) - EM_RX_LOCK(rxr); - /* XXX check sync modes */ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -334,8 +296,6 @@ em_netmap_rxsync(struct ifnet *ifp, u_in void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) { /* bad buf */ - if (do_lock) - EM_RX_UNLOCK(rxr); return netmap_ring_reinit(kring); } @@ -364,8 +324,6 @@ em_netmap_rxsync(struct ifnet *ifp, u_in } /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail - resvd; - if (do_lock) - EM_RX_UNLOCK(rxr); return 0; } @@ -378,12 +336,11 @@ em_netmap_attach(struct adapter *adapter bzero(&na, sizeof(na)); na.ifp = adapter->ifp; - na.separate_locks = 1; + na.na_flags = NAF_BDG_MAYSLEEP; na.num_tx_desc = adapter->num_tx_desc; na.num_rx_desc = adapter->num_rx_desc; na.nm_txsync = em_netmap_txsync; na.nm_rxsync = em_netmap_rxsync; - na.nm_lock = em_netmap_lock_wrapper; na.nm_register = em_netmap_reg; netmap_attach(&na, adapter->num_queues); } Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Fri Nov 1 21:17:45 2013 (r257528) +++ head/sys/dev/netmap/if_igb_netmap.h Fri Nov 1 21:21:14 2013 (r257529) @@ -39,38 +39,6 @@ /* - * wrapper to export locks to the generic code - */ -static void -igb_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid) -{ - struct adapter *adapter = ifp->if_softc; - - ASSERT(queueid < adapter->num_queues); - switch (what) { - case NETMAP_CORE_LOCK: - IGB_CORE_LOCK(adapter); - break; - case NETMAP_CORE_UNLOCK: - IGB_CORE_UNLOCK(adapter); - break; - case NETMAP_TX_LOCK: - IGB_TX_LOCK(&adapter->tx_rings[queueid]); - break; - case NETMAP_TX_UNLOCK: - IGB_TX_UNLOCK(&adapter->tx_rings[queueid]); - break; - case NETMAP_RX_LOCK: - IGB_RX_LOCK(&adapter->rx_rings[queueid]); - break; - case NETMAP_RX_UNLOCK: - IGB_RX_UNLOCK(&adapter->rx_rings[queueid]); - break; - } -} - - -/* * register-unregister routine */ static int @@ -92,7 +60,7 @@ igb_netmap_reg(struct ifnet *ifp, int on ifp->if_capenable |= IFCAP_NETMAP; na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_start; + ifp->if_transmit = netmap_transmit; igb_init_locked(adapter); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) == 0) { @@ -114,7 +82,7 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) +igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int flags) { struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; @@ -130,8 +98,6 @@ igb_netmap_txsync(struct ifnet *ifp, u_i if (k > lim) return netmap_ring_reinit(kring); - if (do_lock) - IGB_TX_LOCK(txr); bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); @@ -153,6 +119,13 @@ igb_netmap_txsync(struct ifnet *ifp, u_i /* curr is the current slot in the nic ring */ union e1000_adv_tx_desc *curr = (union e1000_adv_tx_desc *)&txr->tx_base[l]; +#ifndef IGB_MEDIA_RESET +/* at the same time as IGB_MEDIA_RESET was defined, the + * tx buffer descriptor was renamed, so use this to revert + * back to the old name. + */ +#define igb_tx_buf igb_tx_buffer +#endif struct igb_tx_buf *txbuf = &txr->tx_buffers[l]; int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? @@ -162,8 +135,6 @@ igb_netmap_txsync(struct ifnet *ifp, u_i u_int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { - if (do_lock) - IGB_TX_UNLOCK(txr); return netmap_ring_reinit(kring); } @@ -223,8 +194,6 @@ igb_netmap_txsync(struct ifnet *ifp, u_i /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; - if (do_lock) - IGB_TX_UNLOCK(txr); return 0; } @@ -233,7 +202,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i * Reconcile kernel and user view of the receive ring. */ static int -igb_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) +igb_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int flags) { struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; @@ -241,16 +210,13 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; u_int j, l, n, lim = kring->nkr_num_slots - 1; - int force_update = do_lock || kring->nr_kflags & NKR_PENDINTR; + int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; u_int k = ring->cur, resvd = ring->reserved; k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); - if (do_lock) - IGB_RX_LOCK(rxr); - /* XXX check sync modes */ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -303,8 +269,6 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) { /* bad buf */ - if (do_lock) - IGB_RX_UNLOCK(rxr); return netmap_ring_reinit(kring); } @@ -332,8 +296,6 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i } /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail - resvd; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 21:31:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9A9E81A4; Fri, 1 Nov 2013 21:31:13 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 59E7C29BE; Fri, 1 Nov 2013 21:31:13 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 8A18E7300A; Fri, 1 Nov 2013 22:32:54 +0100 (CET) Date: Fri, 1 Nov 2013 22:32:54 +0100 From: Luigi Rizzo To: Brooks Davis Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101213254.GA35505@onelab2.iet.unipi.it> References: <20131101020924.GB32951@lor.one-eyed-alien.net> <20131101061842.GA8911@onelab2.iet.unipi.it> <20131101204848.GA44088@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131101204848.GA44088@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 21:31:13 -0000 On Fri, Nov 01, 2013 at 03:48:48PM -0500, Brooks Davis wrote: > On Fri, Nov 01, 2013 at 07:18:42AM +0100, Luigi Rizzo wrote: ... > > ok so what happens is the following (trying to build HEAD on 9.2, both amd64) > > > > - WITHOUT_CLANG and related options: > > "make toolchain" fails with the error on krb5 > > "make buildworld" works, and a subsequent > > "make toolchain" also works > > > > - without options (so compiling CLANG) > > > > "make toolchain" fails with the error below > > > > building shared library libc.so.7 > > /usr/bin/ld: this linker was not configured to use sysroots > > cc: error: linker command failed with exit code 1 (use -v to see invocation) > > *** [libc.so.7] Error code 1 > > 1 error > > *** [all] Error code 2 > > 1 error > > > > > > "make toolchain" on an empty tree used to work until before this commit, > > and does work if i revert this single change > > > > So does this mean that 'toolchain' now has some prerequisites ? > > I think I've found it. I tried the last one first since it was the most > bizzare and about 40 lines up there was fairly obvious error output that > told me what was wrong. The issue is that the :U modifer I used is a > bmake feature and that the toolchain target doesn't bootstrap bmake (or > perhaps doesn't do it early enough). I plan to commit a workaround for > this particular case, but we probably need to alter the toolchain and > kernel-toolchain targets to bootstrap bmake on older systems or we'll > run into this again with some future change somewhere else. yes, bootstrapping bmake early seems a future-proof way to handle this. Thanks a lot for following up cheers luigi From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 22:03:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C472EC95; Fri, 1 Nov 2013 22:03:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B16E22B69; Fri, 1 Nov 2013 22:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1M3KlT072010; Fri, 1 Nov 2013 22:03:20 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1M3KBK072009; Fri, 1 Nov 2013 22:03:20 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201311012203.rA1M3KBK072009@svn.freebsd.org> From: Brooks Davis Date: Fri, 1 Nov 2013 22:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257530 - head/gnu/usr.bin/binutils/ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 22:03:20 -0000 Author: brooks Date: Fri Nov 1 22:03:20 2013 New Revision: 257530 URL: http://svnweb.freebsd.org/changeset/base/257530 Log: Reimplement r257525 such that it work with the historic FreeBSD make implementation. This fixes the toolchain and kernel-toolchain targets when building from older FreeBSD versions where make is fmake. Reported by: luigi Sponsored by: DARPA/AFRL MFC after: 3 days Modified: head/gnu/usr.bin/binutils/ld/Makefile Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Fri Nov 1 21:21:14 2013 (r257529) +++ head/gnu/usr.bin/binutils/ld/Makefile Fri Nov 1 22:03:20 2013 (r257530) @@ -31,7 +31,12 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\" CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\" CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\" CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\" -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\" +CFLAGS+= -DBINDIR=\"${BINDIR}\" +.if defined(TOOLS_PREFIX) +CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\" +.else +CFLAGS+= -DTARGET_SYSTEM_ROOT=\"/\" +.endif CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\" CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 22:05:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A5D6DFB; Fri, 1 Nov 2013 22:05:30 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47A762B80; Fri, 1 Nov 2013 22:05:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1M5Ual072367; Fri, 1 Nov 2013 22:05:30 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1M5UP3072366; Fri, 1 Nov 2013 22:05:30 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201311012205.rA1M5UP3072366@svn.freebsd.org> From: Jim Harris Date: Fri, 1 Nov 2013 22:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257531 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 22:05:30 -0000 Author: jimharris Date: Fri Nov 1 22:05:29 2013 New Revision: 257531 URL: http://svnweb.freebsd.org/changeset/base/257531 Log: Do not exit with error status after printing data for perftest. Sponsored by: Intel Reported by: Joe Golio MFC after: 3 days Modified: head/sbin/nvmecontrol/perftest.c Modified: head/sbin/nvmecontrol/perftest.c ============================================================================== --- head/sbin/nvmecontrol/perftest.c Fri Nov 1 22:03:20 2013 (r257530) +++ head/sbin/nvmecontrol/perftest.c Fri Nov 1 22:05:29 2013 (r257531) @@ -64,8 +64,6 @@ print_perftest(struct nvme_io_test *io_t for (i = 0; i < io_test->num_threads; i++) printf("\t%3d: %8ju IO/s\n", i, (uintmax_t)io_test->io_completed[i]/io_test->time); - - exit(1); } static void From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 22:15:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 94FEB25D; Fri, 1 Nov 2013 22:15:36 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F54D2C25; Fri, 1 Nov 2013 22:15:35 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id rA1MFYP8045518; Fri, 1 Nov 2013 17:15:34 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id rA1MFWVx045517; Fri, 1 Nov 2013 17:15:32 -0500 (CDT) (envelope-from brooks) Date: Fri, 1 Nov 2013 17:15:32 -0500 From: Brooks Davis To: Luigi Rizzo Subject: Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld Message-ID: <20131101221532.GA45336@lor.one-eyed-alien.net> References: <20131101020924.GB32951@lor.one-eyed-alien.net> <20131101061842.GA8911@onelab2.iet.unipi.it> <20131101204848.GA44088@lor.one-eyed-alien.net> <20131101213254.GA35505@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <20131101213254.GA35505@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 22:15:36 -0000 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 01, 2013 at 10:32:54PM +0100, Luigi Rizzo wrote: > On Fri, Nov 01, 2013 at 03:48:48PM -0500, Brooks Davis wrote: > > On Fri, Nov 01, 2013 at 07:18:42AM +0100, Luigi Rizzo wrote: > ... > > > ok so what happens is the following (trying to build HEAD on 9.2, bot= h amd64) > > >=20 > > > - WITHOUT_CLANG and related options: > > > "make toolchain" fails with the error on krb5 > > > "make buildworld" works, and a subsequent > > > "make toolchain" also works > > >=20 > > > - without options (so compiling CLANG) > > >=20 > > > "make toolchain" fails with the error below > > >=20 > > > building shared library libc.so.7 > > > /usr/bin/ld: this linker was not configured to use sysroots > > > cc: error: linker command failed with exit code 1 (use -v to see = invocation) > > > *** [libc.so.7] Error code 1 > > > 1 error > > > *** [all] Error code 2 > > > 1 error > > >=20 > > >=20 > > > "make toolchain" on an empty tree used to work until before this comm= it, > > > and does work if i revert this single change > > >=20 > > > So does this mean that 'toolchain' now has some prerequisites ? > >=20 > > I think I've found it. I tried the last one first since it was the most > > bizzare and about 40 lines up there was fairly obvious error output that > > told me what was wrong. The issue is that the :U modifer I used is a > > bmake feature and that the toolchain target doesn't bootstrap bmake (or > > perhaps doesn't do it early enough). I plan to commit a workaround for > > this particular case, but we probably need to alter the toolchain and > > kernel-toolchain targets to bootstrap bmake on older systems or we'll > > run into this again with some future change somewhere else. >=20 > yes, bootstrapping bmake early seems a future-proof way to handle this. I've committed a workaround for HEAD that I'll MFC soon on the basis that we in theory have infrastructure to support WITHOUT_BMAKE. (In practice WITHOUT_BMAKE is broken and corrupts your object tree with a make that fails until manually deleted.) We should decide if it should be fixed or removed before 10 goes out. -- Brooks --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFSdCgDXY6L6fI4GtQRAvDXAKCkZxL0EQcEOxqQvSO7b10wumtomwCfSaUw kgz/yVP/BsEQScrPrcMidsY= =pXvM -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 22:38:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 59AD66F1; Fri, 1 Nov 2013 22:38:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46F952D54; Fri, 1 Nov 2013 22:38:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1McxGf084684; Fri, 1 Nov 2013 22:38:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1Mcx6S084683; Fri, 1 Nov 2013 22:38:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201311012238.rA1Mcx6S084683@svn.freebsd.org> From: Adrian Chadd Date: Fri, 1 Nov 2013 22:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257532 - head/tools/tools/ath/athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 22:38:59 -0000 Author: adrian Date: Fri Nov 1 22:38:58 2013 New Revision: 257532 URL: http://svnweb.freebsd.org/changeset/base/257532 Log: Fix this build for clang. Modified: head/tools/tools/ath/athstats/Makefile Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Fri Nov 1 22:05:29 2013 (r257531) +++ head/tools/tools/ath/athstats/Makefile Fri Nov 1 22:38:58 2013 (r257532) @@ -1,12 +1,16 @@ # $FreeBSD$ +NO_MAN=1 + +.include + .PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal PROG= athstats # Because of a clang preprocessor parser limitation causing this # to not compile, use gcc for now. -CC= gcc +#CC= gcc SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h @@ -17,6 +21,10 @@ CLEANFILES+= opt_ah.h CFLAGS+=-DATH_SUPPORT_ANI CFLAGS+=-DATH_SUPPORT_TDMA +.if (${COMPILER_TYPE} == "clang") +CFLAGS+=-fbracket-depth=512 +.endif + opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h From owner-svn-src-all@FreeBSD.ORG Fri Nov 1 23:30:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 87B80819; Fri, 1 Nov 2013 23:30:55 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59FE02082; Fri, 1 Nov 2013 23:30:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA1NUtEU004385; Fri, 1 Nov 2013 23:30:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA1NUtS6004383; Fri, 1 Nov 2013 23:30:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201311012330.rA1NUtS6004383@svn.freebsd.org> From: Jim Harris Date: Fri, 1 Nov 2013 23:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257534 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 01 Nov 2013 23:30:55 -0000 Author: jimharris Date: Fri Nov 1 23:30:54 2013 New Revision: 257534 URL: http://svnweb.freebsd.org/changeset/base/257534 Log: Create a unique unit number for each controller and namespace cdev. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Fri Nov 1 22:55:11 2013 (r257533) +++ head/sys/dev/nvme/nvme_ctrlr.c Fri Nov 1 23:30:54 2013 (r257534) @@ -1150,8 +1150,8 @@ intx: if (status != 0) return (status); - ctrlr->cdev = make_dev(&nvme_ctrlr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "nvme%d", device_get_unit(dev)); + ctrlr->cdev = make_dev(&nvme_ctrlr_cdevsw, device_get_unit(dev), + UID_ROOT, GID_WHEEL, 0600, "nvme%d", device_get_unit(dev)); if (ctrlr->cdev == NULL) return (ENXIO); Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Fri Nov 1 22:55:11 2013 (r257533) +++ head/sys/dev/nvme/nvme_ns.c Fri Nov 1 23:30:54 2013 (r257534) @@ -492,6 +492,7 @@ nvme_ns_construct(struct nvme_namespace struct nvme_controller *ctrlr) { struct nvme_completion_poll_status status; + int unit; ns->ctrlr = ctrlr; ns->id = id; @@ -553,6 +554,12 @@ nvme_ns_construct(struct nvme_namespace if (ns->cdev != NULL) return (0); + /* + * Namespace IDs start at 1, so we need to subtract 1 to create a + * correct unit number. + */ + unit = device_get_unit(ctrlr->dev) * NVME_MAX_NAMESPACES + ns->id - 1; + /* * MAKEDEV_ETERNAL was added in r210923, for cdevs that will never * be destroyed. This avoids refcounting on the cdev object. @@ -560,11 +567,11 @@ nvme_ns_construct(struct nvme_namespace * surprise removal nor namespace deletion. */ #ifdef MAKEDEV_ETERNAL_KLD - ns->cdev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &nvme_ns_cdevsw, 0, + ns->cdev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &nvme_ns_cdevsw, unit, NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d", device_get_unit(ctrlr->dev), ns->id); #else - ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, 0, + ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, unit, NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d", device_get_unit(ctrlr->dev), ns->id); #endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 00:11:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1CEB8608; Sat, 2 Nov 2013 00:11:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 090532245; Sat, 2 Nov 2013 00:11:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA20BcCf020171; Sat, 2 Nov 2013 00:11:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA20BchL020170; Sat, 2 Nov 2013 00:11:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201311020011.rA20BchL020170@svn.freebsd.org> From: Adrian Chadd Date: Sat, 2 Nov 2013 00:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257535 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 00:11:39 -0000 Author: adrian Date: Sat Nov 2 00:11:38 2013 New Revision: 257535 URL: http://svnweb.freebsd.org/changeset/base/257535 Log: Teach the netgraph code to use a const char * pointer too. Pointy hat to: adrian Modified: head/sys/netgraph/ng_iface.c Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Nov 1 23:30:54 2013 (r257534) +++ head/sys/netgraph/ng_iface.c Sat Nov 2 00:11:38 2013 (r257535) @@ -776,7 +776,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite return (EAFNOSUPPORT); } if (harvest.point_to_point) - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); + random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_NG); M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return (0); From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 00:54:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C775D69; Sat, 2 Nov 2013 00:54:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B36142569; Sat, 2 Nov 2013 00:54:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA20slq4033571; Sat, 2 Nov 2013 00:54:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA20slwE033570; Sat, 2 Nov 2013 00:54:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311020054.rA20slwE033570@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 2 Nov 2013 00:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257537 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 00:54:47 -0000 Author: luigi Date: Sat Nov 2 00:54:47 2013 New Revision: 257537 URL: http://svnweb.freebsd.org/changeset/base/257537 Log: add missing file from previous netmap update... Added: head/sys/dev/netmap/netmap_mem2.h (contents, props changed) Added: head/sys/dev/netmap/netmap_mem2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/netmap_mem2.h Sat Nov 2 00:54:47 2013 (r257537) @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2012-2013 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. 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$ + * + * (New) memory allocator for netmap + */ + +/* + * This allocator creates three memory pools: + * nm_if_pool for the struct netmap_if + * nm_ring_pool for the struct netmap_ring + * nm_buf_pool for the packet buffers. + * + * that contain netmap objects. Each pool is made of a number of clusters, + * multiple of a page size, each containing an integer number of objects. + * The clusters are contiguous in user space but not in the kernel. + * Only nm_buf_pool needs to be dma-able, + * but for convenience use the same type of allocator for all. + * + * Once mapped, the three pools are exported to userspace + * as a contiguous block, starting from nm_if_pool. Each + * cluster (and pool) is an integral number of pages. + * [ . . . ][ . . . . . .][ . . . . . . . . . .] + * nm_if nm_ring nm_buf + * + * The userspace areas contain offsets of the objects in userspace. + * When (at init time) we write these offsets, we find out the index + * of the object, and from there locate the offset from the beginning + * of the region. + * + * The invididual allocators manage a pool of memory for objects of + * the same size. + * The pool is split into smaller clusters, whose size is a + * multiple of the page size. The cluster size is chosen + * to minimize the waste for a given max cluster size + * (we do it by brute force, as we have relatively few objects + * per cluster). + * + * Objects are aligned to the cache line (64 bytes) rounding up object + * sizes when needed. A bitmap contains the state of each object. + * Allocation scans the bitmap; this is done only on attach, so we are not + * too worried about performance + * + * For each allocator we can define (thorugh sysctl) the size and + * number of each object. Memory is allocated at the first use of a + * netmap file descriptor, and can be freed when all such descriptors + * have been released (including unmapping the memory). + * If memory is scarce, the system tries to get as much as possible + * and the sysctl values reflect the actual allocation. + * Together with desired values, the sysctl export also absolute + * min and maximum values that cannot be overridden. + * + * struct netmap_if: + * variable size, max 16 bytes per ring pair plus some fixed amount. + * 1024 bytes should be large enough in practice. + * + * In the worst case we have one netmap_if per ring in the system. + * + * struct netmap_ring + * variable size, 8 byte per slot plus some fixed amount. + * Rings can be large (e.g. 4k slots, or >32Kbytes). + * We default to 36 KB (9 pages), and a few hundred rings. + * + * struct netmap_buffer + * The more the better, both because fast interfaces tend to have + * many slots, and because we may want to use buffers to store + * packets in userspace avoiding copies. + * Must contain a full frame (eg 1518, or more for vlans, jumbo + * frames etc.) plus be nicely aligned, plus some NICs restrict + * the size to multiple of 1K or so. Default to 2K + */ +#ifndef _NET_NETMAP_MEM2_H_ +#define _NET_NETMAP_MEM2_H_ + + +#define NETMAP_BUF_MAX_NUM 20*4096*2 /* large machine */ + +#define NETMAP_POOL_MAX_NAMSZ 32 + + +enum { + NETMAP_IF_POOL = 0, + NETMAP_RING_POOL, + NETMAP_BUF_POOL, + NETMAP_POOLS_NR +}; + + +struct netmap_obj_params { + u_int size; + u_int num; +}; +struct netmap_obj_pool { + char name[NETMAP_POOL_MAX_NAMSZ]; /* name of the allocator */ + + /* ---------------------------------------------------*/ + /* these are only meaningful if the pool is finalized */ + /* (see 'finalized' field in netmap_mem_d) */ + u_int objtotal; /* actual total number of objects. */ + u_int memtotal; /* actual total memory space */ + u_int numclusters; /* actual number of clusters */ + + u_int objfree; /* number of free objects. */ + + struct lut_entry *lut; /* virt,phys addresses, objtotal entries */ + uint32_t *bitmap; /* one bit per buffer, 1 means free */ + uint32_t bitmap_slots; /* number of uint32 entries in bitmap */ + /* ---------------------------------------------------*/ + + /* limits */ + u_int objminsize; /* minimum object size */ + u_int objmaxsize; /* maximum object size */ + u_int nummin; /* minimum number of objects */ + u_int nummax; /* maximum number of objects */ + + /* these are changed only by config */ + u_int _objtotal; /* total number of objects */ + u_int _objsize; /* object size */ + u_int _clustsize; /* cluster size */ + u_int _clustentries; /* objects per cluster */ + u_int _numclusters; /* number of clusters */ + + /* requested values */ + u_int r_objtotal; + u_int r_objsize; +}; + +#ifdef linux +// XXX a mtx would suffice here 20130415 lr +#define NMA_LOCK_T struct semaphore +#else /* !linux */ +#define NMA_LOCK_T struct mtx +#endif /* linux */ + +typedef int (*netmap_mem_config_t)(struct netmap_mem_d*); +typedef int (*netmap_mem_finalize_t)(struct netmap_mem_d*); +typedef void (*netmap_mem_deref_t)(struct netmap_mem_d*); + + +/* We implement two kinds of netmap_mem_d structures: + * + * - global: used by hardware NICS; + * + * - private: used by VALE ports. + * + * In both cases, the netmap_mem_d structure has the same lifetime as the + * netmap_adapter of the corresponding NIC or port. It is the responsibility of + * the client code to delete the private allocator when the associated + * netmap_adapter is freed (this is implemented by the NAF_MEM_OWNER flag in + * netmap.c). The 'refcount' field counts the number of active users of the + * structure. The global allocator uses this information to prevent/allow + * reconfiguration. The private allocators release all their memory when there + * are no active users. By 'active user' we mean an existing netmap_priv + * structure holding a reference to the allocator. + */ +struct netmap_mem_d { + NMA_LOCK_T nm_mtx; /* protect the allocator */ + u_int nm_totalsize; /* shorthand */ + + u_int flags; +#define NETMAP_MEM_FINALIZED 0x1 /* preallocation done */ +#define NETMAP_MEM_PRIVATE 0x2 /* uses private address space */ + int lasterr; /* last error for curr config */ + int refcount; /* existing priv structures */ + /* the three allocators */ + struct netmap_obj_pool pools[NETMAP_POOLS_NR]; + + netmap_mem_config_t config; + netmap_mem_finalize_t finalize; + netmap_mem_deref_t deref; +}; + +extern struct netmap_mem_d nm_mem; + +vm_paddr_t netmap_mem_ofstophys(struct netmap_mem_d *, vm_ooffset_t); +int netmap_mem_finalize(struct netmap_mem_d *); +int netmap_mem_init(void); +void netmap_mem_fini(void); +struct netmap_if * netmap_mem_if_new(const char *, struct netmap_adapter *); +void netmap_mem_if_delete(struct netmap_adapter *na, struct netmap_if *nifp); +void netmap_mem_deref(struct netmap_mem_d *); +int netmap_mem_get_info(struct netmap_mem_d *nm_mem, u_int *size, u_int *memflags); +ssize_t netmap_mem_if_offset(struct netmap_mem_d *nm_mem, const void *vaddr); +struct netmap_mem_d* + netmap_mem_private_new(const char *name, u_int txr, u_int txd, u_int rxr, u_int rxd); +void netmap_mem_private_delete(struct netmap_mem_d *nm_mem); + +#define NETMAP_BDG_BUF_SIZE(n) ((n)->pools[NETMAP_BUF_POOL]._objsize) + + + +#endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 01:16:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B7B79C69; Sat, 2 Nov 2013 01:16:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B1032676; Sat, 2 Nov 2013 01:16:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA21GArx041002; Sat, 2 Nov 2013 01:16:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA21GALI041001; Sat, 2 Nov 2013 01:16:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201311020116.rA21GALI041001@svn.freebsd.org> From: Xin LI Date: Sat, 2 Nov 2013 01:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257539 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 01:16:10 -0000 Author: delphij Date: Sat Nov 2 01:16:10 2013 New Revision: 257539 URL: http://svnweb.freebsd.org/changeset/base/257539 Log: When zero'ing out a buffer, make sure we are using right size. Without this change, in the worst but unlikely case scenario, certain administrative operations, including change of configuration, set or delete key from a GEOM ELI provider, may leave potentially sensitive information in buffer allocated from kernel memory. We believe that it is not possible to actively exploit these issues, nor does it impact the security of normal usage of GEOM ELI providers when these operations are not performed after system boot. Security: possible sensitive information disclosure Submitted by: Clement Lecigne MFC after: 3 days Modified: head/sys/geom/eli/g_eli_ctl.c Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Sat Nov 2 01:03:14 2013 (r257538) +++ head/sys/geom/eli/g_eli_ctl.c Sat Nov 2 01:16:10 2013 (r257539) @@ -471,7 +471,7 @@ g_eli_ctl_configure(struct gctl_req *req prov, error); } bzero(&md, sizeof(md)); - bzero(sector, sizeof(sector)); + bzero(sector, pp->sectorsize); free(sector, M_ELI); } } @@ -562,7 +562,7 @@ g_eli_ctl_setkey(struct gctl_req *req, s /* Encrypt Master Key with the new key. */ error = g_eli_mkey_encrypt(md.md_ealgo, key, md.md_keylen, mkeydst); - bzero(key, sizeof(key)); + bzero(key, keysize); if (error != 0) { bzero(&md, sizeof(md)); gctl_error(req, "Cannot encrypt Master Key (error=%d).", error); @@ -575,7 +575,7 @@ g_eli_ctl_setkey(struct gctl_req *req, s bzero(&md, sizeof(md)); error = g_write_data(cp, pp->mediasize - pp->sectorsize, sector, pp->sectorsize); - bzero(sector, sizeof(sector)); + bzero(sector, pp->sectorsize); free(sector, M_ELI); if (error != 0) { gctl_error(req, "Cannot store metadata on %s (error=%d).", @@ -691,7 +691,7 @@ g_eli_ctl_delkey(struct gctl_req *req, s (void)g_io_flush(cp); } bzero(&md, sizeof(md)); - bzero(sector, sizeof(sector)); + bzero(sector, pp->sectorsize); free(sector, M_ELI); if (*all) G_ELI_DEBUG(1, "All keys removed from %s.", pp->name); From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 02:38:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 29D46868; Sat, 2 Nov 2013 02:38:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 149DF2964; Sat, 2 Nov 2013 02:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA22cXui067709; Sat, 2 Nov 2013 02:38:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA22cWpv067702; Sat, 2 Nov 2013 02:38:32 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201311020238.rA22cWpv067702@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 2 Nov 2013 02:38:32 +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: r257540 - in stable/10: usr.bin/iscsictl usr.sbin/ctladm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 02:38:33 -0000 Author: trasz Date: Sat Nov 2 02:38:32 2013 New Revision: 257540 URL: http://svnweb.freebsd.org/changeset/base/257540 Log: MFC r257379: Rename '-h' option to '-p', and use "portal" instead of "host" or "address", in order to be consistent with iSCSI terminology. Besides, calling the option '-h' was just wrong. This changes usage for newly added iscsictl(8), and two newly added subcommands to ctladm(8). This breaks POLA between CURRENT and 10, but since 10.0 has not been released yet, it's still ok to do. MFC r257380: Bump .Dd after r257379. Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/iscsictl/iscsictl.8 stable/10/usr.bin/iscsictl/iscsictl.c stable/10/usr.sbin/ctladm/ctladm.8 stable/10/usr.sbin/ctladm/ctladm.c Directory Properties: stable/10/usr.bin/iscsictl/ (props changed) stable/10/usr.sbin/ctladm/ (props changed) Modified: stable/10/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.8 Sat Nov 2 01:16:10 2013 (r257539) +++ stable/10/usr.bin/iscsictl/iscsictl.8 Sat Nov 2 02:38:32 2013 (r257540) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd October 30, 2013 .Dt ISCSICTL 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm .Fl A -.Fl h Ar host Fl t Ar target Op Fl u Ar user Fl s Ar secret +.Fl p Ar portal Fl t Ar target Op Fl u Ar user Fl s Ar secret .Nm .Fl A .Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret @@ -48,7 +48,7 @@ .Fl n Ar nickname Op Fl c Ar path .Nm .Fl R -.Op Fl h Ar host +.Op Fl p Ar portal .Op Fl t Ar target .Nm .Fl R @@ -84,10 +84,10 @@ Target host name or address used for Sen When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, and the temporary discovery sesion will be removed. -.It Fl h -Target host name or address for statically defined targets. .It Fl n The "nickname" of session defined in the configuration file. +.It Fl p +Target portal - host name or address - for statically defined targets. .It Fl t Target name. .It Fl v @@ -133,7 +133,7 @@ The utility exits 0 on success, and >0 if an error occurs. .Sh EXAMPLES Attach to target qn.2012-06.com.example:target0, served by 192.168.1.1: -.Dl Nm Fl A Fl t Ar qn.2012-06.com.example:target0 Fl h Ar 192.168.1.1 +.Dl Nm Fl A Fl t Ar qn.2012-06.com.example:target0 Fl p Ar 192.168.1.1 .Pp Disconnect all iSCSI sessions: .Dl Nm Fl Ra Modified: stable/10/usr.bin/iscsictl/iscsictl.c ============================================================================== --- stable/10/usr.bin/iscsictl/iscsictl.c Sat Nov 2 01:16:10 2013 (r257539) +++ stable/10/usr.bin/iscsictl/iscsictl.c Sat Nov 2 02:38:32 2013 (r257540) @@ -410,48 +410,48 @@ kernel_list(int iscsi_fd, const struct t state = &states[i]; conf = &state->iss_conf; - printf("Session ID: %d\n", state->iss_id); - printf("Initiator name: %s\n", conf->isc_initiator); - printf("Initiator addr: %s\n", + printf("Session ID: %d\n", state->iss_id); + printf("Initiator name: %s\n", conf->isc_initiator); + printf("Initiator portal: %s\n", conf->isc_initiator_addr); - printf("Initiator alias: %s\n", + printf("Initiator alias: %s\n", conf->isc_initiator_alias); - printf("Target name: %s\n", conf->isc_target); - printf("Target addr: %s\n", + printf("Target name: %s\n", conf->isc_target); + printf("Target portal: %s\n", conf->isc_target_addr); - printf("Target alias: %s\n", + printf("Target alias: %s\n", state->iss_target_alias); - printf("User: %s\n", conf->isc_user); - printf("Secret: %s\n", conf->isc_secret); - printf("Mutual user: %s\n", + printf("User: %s\n", conf->isc_user); + printf("Secret: %s\n", conf->isc_secret); + printf("Mutual user: %s\n", conf->isc_mutual_user); - printf("Mutual secret: %s\n", + printf("Mutual secret : %s\n", conf->isc_mutual_secret); - printf("Session type: %s\n", + printf("Session type: %s\n", conf->isc_discovery ? "Discovery" : "Normal"); - printf("Session state: %s\n", + printf("Session state: %s\n", state->iss_connected ? "Connected" : "Disconnected"); - printf("Failure reason: %s\n", state->iss_reason); - printf("Header digest: %s\n", + printf("Failure reason: %s\n", state->iss_reason); + printf("Header digest: %s\n", state->iss_header_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - printf("Data digest: %s\n", + printf("Data digest: %s\n", state->iss_data_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - printf("DataSegmentLen: %d\n", + printf("DataSegmentLen: %d\n", state->iss_max_data_segment_length); - printf("ImmediateData: %s\n", + printf("ImmediateData: %s\n", state->iss_immediate_data ? "Yes" : "No"); - printf("iSER (RDMA): %s\n", + printf("iSER (RDMA): %s\n", conf->isc_iser ? "Yes" : "No"); - printf("Device nodes: "); + printf("Device nodes: "); print_periphs(state->iss_id); printf("\n\n"); } } else { printf("%-36s %-16s %s\n", - "Target name", "Target addr", "State"); + "Target name", "Target portal", "State"); for (i = 0; i < isl.isl_nentries; i++) { state = &states[i]; conf = &state->iss_conf; @@ -483,13 +483,13 @@ static void usage(void) { - fprintf(stderr, "usage: iscsictl -A -h host -t target " + fprintf(stderr, "usage: iscsictl -A -p portal -t target " "[-u user -s secret]\n"); fprintf(stderr, " iscsictl -A -d discovery-host " "[-u user -s secret]\n"); fprintf(stderr, " iscsictl -A -a [-c path]\n"); fprintf(stderr, " iscsictl -A -n nickname [-c path]\n"); - fprintf(stderr, " iscsictl -R [-h host] [-t target]\n"); + fprintf(stderr, " iscsictl -R [-p portal] [-t target]\n"); fprintf(stderr, " iscsictl -R -a\n"); fprintf(stderr, " iscsictl -R -n nickname [-c path]\n"); fprintf(stderr, " iscsictl -L [-v]\n"); @@ -519,7 +519,7 @@ main(int argc, char **argv) struct conf *conf; struct target *targ; - while ((ch = getopt(argc, argv, "ARLac:d:n:h:t:u:s:v")) != -1) { + while ((ch = getopt(argc, argv, "ARLac:d:n:p:t:u:s:v")) != -1) { switch (ch) { case 'A': Aflag = 1; @@ -542,7 +542,7 @@ main(int argc, char **argv) case 'n': nickname = optarg; break; - case 'h': + case 'p': host = optarg; break; case 't': @@ -579,7 +579,7 @@ main(int argc, char **argv) if (Aflag != 0) { if (aflag != 0) { if (host != NULL) - errx(1, "-a and -h and mutually exclusive"); + errx(1, "-a and -p and mutually exclusive"); if (target != NULL) errx(1, "-a and -t and mutually exclusive"); if (user != NULL) @@ -592,7 +592,7 @@ main(int argc, char **argv) errx(1, "-a and -d and mutually exclusive"); } else if (nickname != NULL) { if (host != NULL) - errx(1, "-n and -h and mutually exclusive"); + errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); if (user != NULL) @@ -603,17 +603,17 @@ main(int argc, char **argv) errx(1, "-n and -d and mutually exclusive"); } else if (discovery_host != NULL) { if (host != NULL) - errx(1, "-d and -h and mutually exclusive"); + errx(1, "-d and -p and mutually exclusive"); if (target != NULL) errx(1, "-d and -t and mutually exclusive"); } else { if (target == NULL && host == NULL) - errx(1, "must specify -a, -n or -t/-h"); + errx(1, "must specify -a, -n or -t/-p"); if (target != NULL && host == NULL) - errx(1, "-t must always be used with -h"); + errx(1, "-t must always be used with -p"); if (host != NULL && target == NULL) - errx(1, "-h must always be used with -t"); + errx(1, "-p must always be used with -t"); } if (user != NULL && secret == NULL) @@ -634,24 +634,24 @@ main(int argc, char **argv) if (aflag != 0) { if (host != NULL) - errx(1, "-a and -h and mutually exclusive"); + errx(1, "-a and -p and mutually exclusive"); if (target != NULL) errx(1, "-a and -t and mutually exclusive"); if (nickname != NULL) errx(1, "-a and -n and mutually exclusive"); } else if (nickname != NULL) { if (host != NULL) - errx(1, "-n and -h and mutually exclusive"); + errx(1, "-n and -p and mutually exclusive"); if (target != NULL) errx(1, "-n and -t and mutually exclusive"); } else if (host != NULL) { if (target != NULL) - errx(1, "-h and -t and mutually exclusive"); + errx(1, "-p and -t and mutually exclusive"); } else if (target != NULL) { if (host != NULL) - errx(1, "-t and -h and mutually exclusive"); + errx(1, "-t and -p and mutually exclusive"); } else - errx(1, "must specify either-a, -n, -t, or -h"); + errx(1, "must specify either -a, -n, -t, or -p"); if (vflag != 0) errx(1, "-v cannot be used with -R"); @@ -660,7 +660,7 @@ main(int argc, char **argv) assert(Lflag != 0); if (host != NULL) - errx(1, "-L and -h and mutually exclusive"); + errx(1, "-L and -p and mutually exclusive"); if (target != NULL) errx(1, "-L and -t and mutually exclusive"); if (user != NULL) Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Sat Nov 2 01:16:10 2013 (r257539) +++ stable/10/usr.sbin/ctladm/ctladm.8 Sat Nov 2 02:38:32 2013 (r257540) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd April 2, 2013 +.Dd October 30, 2013 .Dt CTLADM 8 .Os .Sh NAME @@ -202,10 +202,10 @@ .Op Fl x .Nm .Ic islogout -.Aq Fl a | Fl h Ar host | Fl c Ar connection-id | Fl i Ar name +.Aq Fl a | Fl c Ar connection-id | Fl i Ar name | Fl p Ar portal .Nm .Ic isterminate -.Aq Fl a | Fl h Ar host | Fl c Ar connection-id | Fl i Ar name +.Aq Fl a | Fl c Ar connection-id | Fl i Ar name | Fl p Ar portal .Nm .Ic help .Sh DESCRIPTION @@ -909,24 +909,24 @@ Ask the initiator to log out iSCSI conne .Bl -tag -width 11n .It Fl a Log out all connections. -.It Fl h -Specify initiator IP address. .It Fl c Specify connection ID. .It Fl i Specify initiator name. +.It Fl p +Specify initiator portal (hostname or IP address). .El .It Ic isterminate Forcibly terminate iSCSI connections matching criteria. .Bl -tag -width 11n .It Fl a Terminate all connections. -.It Fl h -Specify initiator IP address. .It Fl c Specify connection ID. .It Fl i Specify initiator name. +.It Fl p +Specify initiator portal (hostname or IP address). .El .It Ic help Display Modified: stable/10/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.c Sat Nov 2 01:16:10 2013 (r257539) +++ stable/10/usr.sbin/ctladm/ctladm.c Sat Nov 2 02:38:32 2013 (r257540) @@ -184,8 +184,8 @@ static struct ctladm_opts option_table[] {"inject", CTLADM_CMD_ERR_INJECT, CTLADM_ARG_NEED_TL, "cd:i:p:r:s:"}, {"inquiry", CTLADM_CMD_INQUIRY, CTLADM_ARG_NEED_TL, NULL}, {"islist", CTLADM_CMD_ISLIST, CTLADM_ARG_NONE, "vx"}, - {"islogout", CTLADM_CMD_ISLOGOUT, CTLADM_ARG_NONE, "ah:c:i:"}, - {"isterminate", CTLADM_CMD_ISTERMINATE, CTLADM_ARG_NONE, "ah:c:i:"}, + {"islogout", CTLADM_CMD_ISLOGOUT, CTLADM_ARG_NONE, "ac:i:p:"}, + {"isterminate", CTLADM_CMD_ISTERMINATE, CTLADM_ARG_NONE, "ac:i:p:"}, {"lunlist", CTLADM_CMD_LUNLIST, CTLADM_ARG_NONE, NULL}, {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:s:"}, @@ -3633,21 +3633,21 @@ retry: if (verbose != 0) { STAILQ_FOREACH(conn, &islist.conn_list, links) { - printf("Session ID: %d\n", conn->connection_id); - printf("Initiator name: %s\n", conn->initiator); - printf("Initiator addr: %s\n", conn->initiator_addr); - printf("Initiator alias: %s\n", conn->initiator_alias); - printf("Target name: %s\n", conn->target); - printf("Target alias: %s\n", conn->target_alias); - printf("Header digest: %s\n", conn->header_digest); - printf("Data digest: %s\n", conn->data_digest); - printf("DataSegmentLen: %s\n", conn->max_data_segment_length); - printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No"); - printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No"); + printf("Session ID: %d\n", conn->connection_id); + printf("Initiator name: %s\n", conn->initiator); + printf("Initiator portal: %s\n", conn->initiator_addr); + printf("Initiator alias: %s\n", conn->initiator_alias); + printf("Target name: %s\n", conn->target); + printf("Target alias: %s\n", conn->target_alias); + printf("Header digest: %s\n", conn->header_digest); + printf("Data digest: %s\n", conn->data_digest); + printf("DataSegmentLen: %s\n", conn->max_data_segment_length); + printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No"); + printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No"); printf("\n"); } } else { - printf("%4s %-16s %-36s %-36s\n", "ID", "Address", "Initiator name", + printf("%4s %-16s %-36s %-36s\n", "ID", "Portal", "Initiator name", "Target name"); STAILQ_FOREACH(conn, &islist.conn_list, links) { printf("%4u %-16s %-36s %-36s\n", @@ -3675,12 +3675,6 @@ cctl_islogout(int fd, int argc, char **a all = 1; nargs++; break; - case 'h': - initiator_addr = strdup(optarg); - if (initiator_addr == NULL) - err(1, "%s: strdup", __func__); - nargs++; - break; case 'c': connection_id = strtoul(optarg, NULL, 0); nargs++; @@ -3691,16 +3685,22 @@ cctl_islogout(int fd, int argc, char **a err(1, "%s: strdup", __func__); nargs++; break; + case 'p': + initiator_addr = strdup(optarg); + if (initiator_addr == NULL) + err(1, "%s: strdup", __func__); + nargs++; + break; default: break; } } if (nargs == 0) - errx(1, "%s: either -a, -h, -c, or -i must be specified", + errx(1, "%s: either -a, -c, -i, or -p must be specified", __func__); if (nargs > 1) - errx(1, "%s: only one of -a, -h, -c, or -i may be specified", + errx(1, "%s: only one of -a, -c, -i, or -p may be specified", __func__); bzero(&req, sizeof(req)); @@ -3748,12 +3748,6 @@ cctl_isterminate(int fd, int argc, char all = 1; nargs++; break; - case 'h': - initiator_addr = strdup(optarg); - if (initiator_addr == NULL) - err(1, "%s: strdup", __func__); - nargs++; - break; case 'c': connection_id = strtoul(optarg, NULL, 0); nargs++; @@ -3764,16 +3758,22 @@ cctl_isterminate(int fd, int argc, char err(1, "%s: strdup", __func__); nargs++; break; + case 'p': + initiator_addr = strdup(optarg); + if (initiator_addr == NULL) + err(1, "%s: strdup", __func__); + nargs++; + break; default: break; } } if (nargs == 0) - errx(1, "%s: either -a, -h, -c, or -i must be specified", + errx(1, "%s: either -a, -c, -i, or -p must be specified", __func__); if (nargs > 1) - errx(1, "%s: only one of -a, -h, -c, or -i may be specified", + errx(1, "%s: only one of -a, -c, -i, or -p may be specified", __func__); bzero(&req, sizeof(req)); @@ -4121,8 +4121,8 @@ usage(int error) " ctladm port <-l | -o | [-w wwnn][-W wwpn]>\n" " [-p targ_port] [-t port_type] [-q] [-x]\n" " ctladm islist [-v | -x]\n" -" ctladm islogout <-A | -a addr | -c connection-id | -n name>\n" -" ctladm isterminate <-A | -a addr | -c connection-id | -n name>\n" +" ctladm islogout <-a | -c connection-id | -i name | -p portal>\n" +" ctladm isterminate <-a | -c connection-id | -i name | -p portal>\n" " ctladm dumpooa\n" " ctladm dumpstructs\n" " ctladm help\n" From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 05:22:23 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C046EDC9; Sat, 2 Nov 2013 05:22:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 8401D2184; Sat, 2 Nov 2013 05:22:23 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id ABCBFD41E16; Sat, 2 Nov 2013 16:22:13 +1100 (EST) Date: Sat, 2 Nov 2013 16:22:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Adrian Chadd Subject: Re: svn commit: r257535 - head/sys/netgraph In-Reply-To: <201311020011.rA20BchL020170@svn.freebsd.org> Message-ID: <20131102151309.A1102@besplex.bde.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=EA1U1QKjvecA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=STxCta6Vch0A:10 a=5QIHI7fnYl3m6JV1XdwA:9 a=oWUZixYzURRpJlRl:21 a=pUqxu9-Ujg5mhHLm:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 05:22:23 -0000 On Sat, 2 Nov 2013, Adrian Chadd wrote: > Log: > Teach the netgraph code to use a const char * pointer too. This actually fixes a much larger bug that was apparently accidentally exposed by new const poisoning and new smaller type bugs. > Pointy hat to: adrian Outpointed by the previous bug. > Modified: head/sys/netgraph/ng_iface.c > ============================================================================== > --- head/sys/netgraph/ng_iface.c Fri Nov 1 23:30:54 2013 (r257534) > +++ head/sys/netgraph/ng_iface.c Sat Nov 2 00:11:38 2013 (r257535) > @@ -776,7 +776,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite > return (EAFNOSUPPORT); > } > if (harvest.point_to_point) > - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); '&(m->m_data)' is not just a pair of style bugs. It gives address of the pointer (somewhere in the mbuf header), not the address of pointed- to data, so the randomness was almost null. The style bugs are excessive parentheses and chumminess with the implementation (non-use of the accessor function mtod()). > + random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_NG); Presumably you really do want to harvest the pointed-to data and there are at least 12 bytes of it, so the semantic fix isn't backwards or a buffer overrun. > M_SETFIB(m, ifp->if_fib); > netisr_dispatch(isr, m); > return (0); const poisoning sometimes exposes garbage pointers accidentally. It seems to take a new design error (random_harvest() taking a const char * instead of a const void *) for this bug to be detected. random_harvest() used to take a void * arg and the garbage pointer was automatically converted to that. Conversion to const void * would be just as automatic. The log message says const char * but the code says const void *. The latter is correct, at least mtod() is used, since the mtod() API unfortunately requires naming a type and const void * is the best type to use here. Then futher conversions apparently occur: if there is actually a const char * anywhere, it is wrong, and if we convert this const void * to it then we must convert to const u_char * to actually access the data It is best for intermediate conversions to only go through const void * and not expand the old design error of making them go through caddr_t (for m_data). Bruce From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 05:53:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA743232; Sat, 2 Nov 2013 05:53:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x22a.google.com (mail-qe0-x22a.google.com [IPv6:2607:f8b0:400d:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38895229B; Sat, 2 Nov 2013 05:53:28 +0000 (UTC) Received: by mail-qe0-f42.google.com with SMTP id gc15so3091213qeb.29 for ; Fri, 01 Nov 2013 22:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tZ7UBKWXg7OCKLk7eEXgmDqvNXv2QLN6Jg88y81JQoY=; b=aW8M3oFc1HD27SEsFdcXzIATTlsKLgYMKKph3bJsYrWf6RtEORjWMfwlvMLsAatwrA VssjjghC0TD8E0GlXo52Euc82MTW6LMad9SnZ7tVSXYBtKdXNoDd9QiFOIJrA1QBWRze h7riirLVzB15NstXBhZKipDH2vQfjREnI0KldgUYn0TvceeEaGc4sGiAgR2Ax6EMEy71 MHykQD/Cw9Y4cKYFPXUDCDsmhANeaeOd/JpQTTOhiG2w9ab67B+ujj9X3Jj33srX7W82 u0XuC3LtsUSXo537NBM1l+G9y6U67BsNuh0fCOV2KnwlphTGqKa8poX0wSeLmsq9Kb85 RIUA== MIME-Version: 1.0 X-Received: by 10.224.55.80 with SMTP id t16mr151379qag.106.1383371607473; Fri, 01 Nov 2013 22:53:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Fri, 1 Nov 2013 22:53:27 -0700 (PDT) In-Reply-To: <20131102151309.A1102@besplex.bde.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> Date: Fri, 1 Nov 2013 22:53:27 -0700 X-Google-Sender-Auth: ZIAPvzuNc4eorAPqzlZIX3ju758 Message-ID: Subject: Re: svn commit: r257535 - head/sys/netgraph From: Adrian Chadd To: Bruce Evans , Mark Murray Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 05:53:28 -0000 Hm! A good question! On 1 November 2013 22:22, Bruce Evans wrote: >> if (harvest.point_to_point) >> - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); > > > '&(m->m_data)' is not just a pair of style bugs. It gives address of > the pointer (somewhere in the mbuf header), not the address of pointed- > to data, so the randomness was almost null. The style bugs are > excessive parentheses and chumminess with the implementation (non-use > of the accessor function mtod()). > > >> + random_harvest(mtod(m, const void *), 12, 2, >> RANDOM_NET_NG); > > > Presumably you really do want to harvest the pointed-to data and there > are at least 12 bytes of it, so the semantic fix isn't backwards or a > buffer overrun. > Mark - did you initially mean the address of the mbuf m_data pointer, or the data payload itself? -adrian From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 06:45:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A878F7C8; Sat, 2 Nov 2013 06:45:43 +0000 (UTC) (envelope-from BM-2cXppXU4T67w7j6NCir9T1WdzBHmFgBnLj@bitmessage.ch) Received: from mail.bitmessage.ch (mail.bitmessage.ch [146.228.112.252]) by mx1.freebsd.org (Postfix) with SMTP id BC52D248A; Sat, 2 Nov 2013 06:45:42 +0000 (UTC) dkim-signature: v=1; a=rsa-sha256; d=bitmessage.ch; s=mail; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:In-Reply-To:References; bh=JWEfrmlb85MA5AH+Zys7gnZLZpUUSJBS71ceqLSY8Tc=; b=ZrDcxjamvzMatQDDDNGfDkB3vn+akDYg2xMNa1MB7CpEloUWYxgjRcZQLuuFxVLYMwAd2aXYUOvjOiM36bNkQvEdyU+Zm5QY8XcRnE9V1OuGfSGtGrLc+NmqsnmYjjp0yCB0iQ9x6d8rlhi5JE5qJFzCTgJae9BTqwN5Mrp4j3w= Received: from nil ([127.0.0.1]) by mail.bitmessage.ch ; Sat, 2 Nov 2013 07:44:57 +0100 From: Stefan Neudorf To: Konstantin Belousov Subject: Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat In-Reply-To: <20131031094058.GH59496@kib.kiev.ua> (Konstantin Belousov's message of "Thu, 31 Oct 2013 11:40:58 +0200") Date: Sat, 02 Nov 2013 07:43:52 +0100 Message-ID: <20131102.868ux75mmv@bitmessage.ch> References: <201310211646.r9LGkDl5012906@svn.freebsd.org> <20131030.86fvriud2y@bitmessage.ch> <20131030212052.GA3516@stack.nl> <20131031094058.GH59496@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 06:45:43 -0000 Konstantin Belousov writes: > On Wed, Oct 30, 2013 at 10:20:52PM +0100, Jilles Tjoelker wrote: > >> On Wed, Oct 30, 2013 at 02:01:57PM +0100, Stefan Neudorf wrote: >> > Konstantin Belousov writes: >> > > Modified: head/usr.bin/limits/limits.c >> > > ============================================================================== >> > > --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013 >> > > (r256849) >> > > +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013 >> > > (r256850) >> >> > This adds limits -e support only for sh, csh, tcsh. What about other >> > shells that already support sbsize and swapuse extensions? >> >> This can be done later; the kqueue rlimit need not be gated on it. > > I definitely do not want to go over the {pd,}ksh, zsh, bash, rc and > whatever else. Somebody who cares should contact the projects and > propose the changes. Ah, you didn't catch my hint. There's no kqueues rlimit in contrib/tcsh. I've submitted one upstream but it'd take some time before the next release appears and we can update. http://mx.gw.com/pipermail/tcsh-bugs/2013-October/000844.html Same for zsh which also has csh-like rlimits. http://sourceforge.net/p/zsh/code/ci/790a4fe From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 07:59:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B08CF260; Sat, 2 Nov 2013 07:59:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40CA42774; Sat, 2 Nov 2013 07:59:44 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rA27xRY5081970; Sat, 2 Nov 2013 09:59:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rA27xRY5081970 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rA27xRHi081969; Sat, 2 Nov 2013 09:59:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 2 Nov 2013 09:59:27 +0200 From: Konstantin Belousov To: Stefan Neudorf Subject: Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat Message-ID: <20131102075927.GA59496@kib.kiev.ua> References: <201310211646.r9LGkDl5012906@svn.freebsd.org> <20131030.86fvriud2y@bitmessage.ch> <20131030212052.GA3516@stack.nl> <20131031094058.GH59496@kib.kiev.ua> <20131102.868ux75mmv@bitmessage.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hTyD2MSx3HZlTIuF" Content-Disposition: inline In-Reply-To: <20131102.868ux75mmv@bitmessage.ch> User-Agent: Mutt/1.5.22 (2013-10-16) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 07:59:44 -0000 --hTyD2MSx3HZlTIuF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 02, 2013 at 07:43:52AM +0100, Stefan Neudorf wrote: > Konstantin Belousov writes: >=20 > > On Wed, Oct 30, 2013 at 10:20:52PM +0100, Jilles Tjoelker wrote: > > > >> On Wed, Oct 30, 2013 at 02:01:57PM +0100, Stefan Neudorf wrote: > >> > Konstantin Belousov writes: > >> > > Modified: head/usr.bin/limits/limits.c > >> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > >> > > --- head/usr.bin/limits/limits.c Mon Oct 21 16:44:53 2013 > >> > > (r256849) > >> > > +++ head/usr.bin/limits/limits.c Mon Oct 21 16:46:12 2013 > >> > > (r256850) > >>=20 > >> > This adds limits -e support only for sh, csh, tcsh. What about other > >> > shells that already support sbsize and swapuse extensions? > >>=20 > >> This can be done later; the kqueue rlimit need not be gated on it. > > > > I definitely do not want to go over the {pd,}ksh, zsh, bash, rc and > > whatever else. Somebody who cares should contact the projects and > > propose the changes. >=20 > Ah, you didn't catch my hint. There's no kqueues rlimit in contrib/tcsh. > I've submitted one upstream but it'd take some time before the next > release appears and we can update. >=20 > http://mx.gw.com/pipermail/tcsh-bugs/2013-October/000844.html I can just apply the upstream patch to our contrib/tcsh, without waiting for import of new version. Can you point me to the way to get the commit which was referenced in the mail above ? >=20 > Same for zsh which also has csh-like rlimits. >=20 > http://sourceforge.net/p/zsh/code/ci/790a4fe --hTyD2MSx3HZlTIuF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSdLDeAAoJEJDCuSvBvK1B8dUP/0mbrvmg0CxI/J9Qryhiw9HQ RnOK1BjfmvTGcz3/GupxP7i3HIIPBdNy4Ebj//1+GSVRv5cbYG6bU2KgZYpPAXxk N8lLawIsPNtVry2VY+MXfAWholHU8skyJgVQFhhwpvybkeY8fSLNkHI1i216kTyM Kcymdla+Pqv+wn2ADYAsIuAkhg3NdlMDhAD2PsqC/D9DdbWShJeXLpx2hNKWXoFW rMGvh14fxNUhRZU25s9AG/vrWeKUqFGpMr47FmiS5E3HzoSIfLrcRk56bHCFag21 rIyJvB55XhT/GQ1KxPVCSdOUqg6usvvJROL/Wq4RmyJ7J5BmKQoSH7m9prKq6UPf DdaSiF2XKnQabXP9JEYLRJt6xVcu3Fcto0Ig9IWeqU6eqh9XaGW6AfrLQJ+IerVv kkt3jKV7eOW0gwrdCWfj9yqAiA+GimZ7Qcj1AbaGK/RGl47cxxJZIO9bLrlyCE21 T84UV1uxrUwmhJdegrk5JLdJhgR/SFA95pvTvME5eDb0U94/46lXW7aMsqOeOge6 8zMOtsHea68Tt6fgFj8SgVCdRZnKaZ97pSsE5oJEDIOfzVwGIpI2ldnnAO5WwJXt c6nsPkA6TJy5ZopPzPttuW5HAqzg3lhZqpel6075U05TMsHeQh+s2swn4ay+fKA1 bb1s8OMEJwGPqg7BUy0y =Bt7E -----END PGP SIGNATURE----- --hTyD2MSx3HZlTIuF-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 09:16:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2DEE8FCD; Sat, 2 Nov 2013 09:16:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C3042A5E; Sat, 2 Nov 2013 09:16:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA29GBgq002266; Sat, 2 Nov 2013 09:16:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA29GBg7002263; Sat, 2 Nov 2013 09:16:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311020916.rA29GBg7002263@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 2 Nov 2013 09:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257541 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 09:16:12 -0000 Author: kib Date: Sat Nov 2 09:16:11 2013 New Revision: 257541 URL: http://svnweb.freebsd.org/changeset/base/257541 Log: Fix several issues with the busdma(9) KPI use in the e1000 drivers. The problems do not affect bouncing busdma in a visible way, but are critical for the dmar backend. - The bus_dmamap_create(9) is not documented to take BUS_DMA_NOWAIT flag. - Unload descriptor map after receive. - Do not reset descriptor map to NULL, bus_dmamap_load(9) requires valid map, and also this leaks the map. Reported and tested by: pho Approved by: jfv Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Nov 2 02:38:32 2013 (r257540) +++ head/sys/dev/e1000/if_em.c Sat Nov 2 09:16:11 2013 (r257541) @@ -4059,8 +4059,7 @@ em_allocate_receive_buffers(struct rx_ri rxbuf = rxr->rx_buffers; for (int i = 0; i < adapter->num_rx_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->rxtag, BUS_DMA_NOWAIT, - &rxbuf->map); + error = bus_dmamap_create(rxr->rxtag, 0, &rxbuf->map); if (error) { device_printf(dev, "%s: bus_dmamap_create failed: %d\n", __func__, error); @@ -4467,6 +4466,7 @@ em_rxeof(struct rx_ring *rxr, int count, em_rx_discard(rxr, i); goto next_desc; } + bus_dmamap_unload(rxr->rxtag, rxr->rx_buffers[i].map); /* Assign correct length to the current fragment */ mp = rxr->rx_buffers[i].m_head; @@ -4553,6 +4553,8 @@ em_rx_discard(struct rx_ring *rxr, int i struct em_buffer *rbuf; rbuf = &rxr->rx_buffers[i]; + bus_dmamap_unload(rxr->rxtag, rbuf->map); + /* Free any previous pieces */ if (rxr->fmp != NULL) { rxr->fmp->m_flags |= M_PKTHDR; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Nov 2 02:38:32 2013 (r257540) +++ head/sys/dev/e1000/if_igb.c Sat Nov 2 09:16:11 2013 (r257541) @@ -3996,7 +3996,6 @@ igb_txeof(struct tx_ring *txr) buf->map); m_freem(buf->m_head); buf->m_head = NULL; - buf->map = NULL; } buf->eop = NULL; ++txr->tx_avail; @@ -4022,7 +4021,6 @@ igb_txeof(struct tx_ring *txr) buf->map); m_freem(buf->m_head); buf->m_head = NULL; - buf->map = NULL; } ++txr->tx_avail; buf->eop = NULL; @@ -4230,15 +4228,13 @@ igb_allocate_receive_buffers(struct rx_r for (i = 0; i < adapter->num_rx_desc; i++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->htag, - BUS_DMA_NOWAIT, &rxbuf->hmap); + error = bus_dmamap_create(rxr->htag, 0, &rxbuf->hmap); if (error) { device_printf(dev, "Unable to create RX head DMA maps\n"); goto fail; } - error = bus_dmamap_create(rxr->ptag, - BUS_DMA_NOWAIT, &rxbuf->pmap); + error = bus_dmamap_create(rxr->ptag, 0, &rxbuf->pmap); if (error) { device_printf(dev, "Unable to create RX packet DMA maps\n"); @@ -4758,11 +4754,13 @@ igb_rx_discard(struct rx_ring *rxr, int if (rbuf->m_head) { m_free(rbuf->m_head); rbuf->m_head = NULL; + bus_dmamap_unload(rxr->htag, rbuf->hmap); } if (rbuf->m_pack) { m_free(rbuf->m_pack); rbuf->m_pack = NULL; + bus_dmamap_unload(rxr->ptag, rbuf->pmap); } return; @@ -4887,6 +4885,7 @@ igb_rxeof(struct igb_queue *que, int cou ** case only the first header is valid. */ if (rxr->hdr_split && rxr->fmp == NULL) { + bus_dmamap_unload(rxr->htag, rxbuf->hmap); hlen = (hdr & E1000_RXDADV_HDRBUFLEN_MASK) >> E1000_RXDADV_HDRBUFLEN_SHIFT; if (hlen > IGB_HDR_BUF) @@ -4919,6 +4918,7 @@ igb_rxeof(struct igb_queue *que, int cou /* clear buf info for refresh */ rxbuf->m_pack = NULL; } + bus_dmamap_unload(rxr->ptag, rxbuf->pmap); ++processed; /* So we know when to refresh */ Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Sat Nov 2 02:38:32 2013 (r257540) +++ head/sys/dev/e1000/if_lem.c Sat Nov 2 09:16:11 2013 (r257541) @@ -3183,8 +3183,7 @@ lem_allocate_receive_structures(struct a } /* Create the spare map (used by getbuf) */ - error = bus_dmamap_create(adapter->rxtag, BUS_DMA_NOWAIT, - &adapter->rx_sparemap); + error = bus_dmamap_create(adapter->rxtag, 0, &adapter->rx_sparemap); if (error) { device_printf(dev, "%s: bus_dmamap_create failed: %d\n", __func__, error); @@ -3193,8 +3192,7 @@ lem_allocate_receive_structures(struct a rx_buffer = adapter->rx_buffer_area; for (i = 0; i < adapter->num_rx_desc; i++, rx_buffer++) { - error = bus_dmamap_create(adapter->rxtag, BUS_DMA_NOWAIT, - &rx_buffer->map); + error = bus_dmamap_create(adapter->rxtag, 0, &rx_buffer->map); if (error) { device_printf(dev, "%s: bus_dmamap_create failed: %d\n", __func__, error); From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 09:32:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1BFC645C; Sat, 2 Nov 2013 09:32:59 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D38302B1A; Sat, 2 Nov 2013 09:32:58 +0000 (UTC) Received: from [2001:470:9174:1:c021:148:e570:f34] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VcXZe-000130-Dx; Sat, 02 Nov 2013 09:32:55 +0000 Subject: Re: svn commit: r257535 - head/sys/netgraph Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Content-Type: multipart/signed; boundary="Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: Date: Sat, 2 Nov 2013 09:32:45 +0000 Message-Id: <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1816) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 09:32:59 -0000 --Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 2 Nov 2013, at 05:53, Adrian Chadd wrote: > Hm! A good question! >=20 > On 1 November 2013 22:22, Bruce Evans wrote: >=20 >>> if (harvest.point_to_point) >>> - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); >>=20 >>=20 >> '&(m->m_data)' is not just a pair of style bugs. It gives address of >> the pointer (somewhere in the mbuf header), not the address of = pointed- >> to data, so the randomness was almost null. The style bugs are >> excessive parentheses and chumminess with the implementation (non-use >> of the accessor function mtod()). >>=20 >>=20 >>> + random_harvest(mtod(m, const void *), 12, 2, >>> RANDOM_NET_NG); >>=20 >>=20 >> Presumably you really do want to harvest the pointed-to data and = there >> are at least 12 bytes of it, so the semantic fix isn't backwards or a >> buffer overrun. >>=20 >=20 >=20 > Mark - did you initially mean the address of the mbuf m_data pointer, > or the data payload itself? As Bruce says - the address of payload data itself. We don=92t have = 12-byte pointers in FreeBSD. :-) M --=20 Mark R V Murray --Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUnTGwt58vKOKE6LNAQpBTAQAkGQL2BwjbjUAOqhUGilLE6caZuz40QmX kdHOrG3tyrVxQDVWbbkDEACpQ7ih9R4fsGPL/nA24KcS1N8bYKwXPrN3axGYfLMA OLgi5rX3yP4yw51rctQVUee6zCoLDeb36afL//h1JtQDIUg01e85PAQieNASyAG/ 73om+84TZe8= =a0EQ -----END PGP SIGNATURE----- --Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 09:44:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ABB487AC; Sat, 2 Nov 2013 09:44:47 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C47B2B7E; Sat, 2 Nov 2013 09:44:47 +0000 (UTC) Received: from [2001:470:9174:1:c021:148:e570:f34] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1VcXl3-00013d-V2; Sat, 02 Nov 2013 09:44:46 +0000 Content-Type: multipart/signed; boundary="Apple-Mail=_199210A0-8E49-4AAA-A47D-DC2B5E5743B7"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: svn commit: r257535 - head/sys/netgraph From: Mark R V Murray In-Reply-To: <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> Date: Sat, 2 Nov 2013 09:44:33 +0000 Message-Id: <0FD2B8FA-7DD7-4626-95F6-BB64B648E81A@grondar.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> To: Mark Robert Vaughan Murray X-Mailer: Apple Mail (2.1816) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 09:44:47 -0000 --Apple-Mail=_199210A0-8E49-4AAA-A47D-DC2B5E5743B7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 2 Nov 2013, at 09:32, Mark R V Murray wrote: >> Mark - did you initially mean the address of the mbuf m_data pointer, >> or the data payload itself? >=20 > As Bruce says - the address of payload data itself. We don=92t have = 12-byte pointers in FreeBSD. :-) Cancel that. The address passed must be the address of the m_data field in the mbuf = structure. The harvested data is 12 bytes from that address forward, so = not the data pointed to by that m_data pointer but the pointer value = itself and some following junk too. M --=20 Mark R V Murray --Apple-Mail=_199210A0-8E49-4AAA-A47D-DC2B5E5743B7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUnTJh958vKOKE6LNAQpT2AP+MV+RCbJpd+3f4QAZnnZIv1Nb6yNxaxUS RE/31m66asSazJIDPnyeGMVxSddFbxeuzantjIzdkIZr/VfnnS/rxey8MUdNdW0l Pq9HJuudfYwJ+RBWXoNnGtaj9CJL/Wd8ErtBjCwAlM+m7o/boktpykyUE9oILw5q CdD2ss9lpGg= =IsJ9 -----END PGP SIGNATURE----- --Apple-Mail=_199210A0-8E49-4AAA-A47D-DC2B5E5743B7-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 10:49:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B11C298; Sat, 2 Nov 2013 10:49:48 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38A652DDC; Sat, 2 Nov 2013 10:49:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2AnmcG032271; Sat, 2 Nov 2013 10:49:48 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2AnmYh032270; Sat, 2 Nov 2013 10:49:48 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201311021049.rA2AnmYh032270@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 2 Nov 2013 10:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257542 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 10:49:48 -0000 Author: alfred Date: Sat Nov 2 10:49:47 2013 New Revision: 257542 URL: http://svnweb.freebsd.org/changeset/base/257542 Log: Fix API mismatch exposed by lagg. When destroying a lagg the driver tries to restore the old mac and fails due to API mismatch Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Nov 2 09:16:11 2013 (r257541) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Sat Nov 2 10:49:47 2013 (r257542) @@ -633,8 +633,8 @@ int mlx4_en_start_port(struct net_device en_dbg(DRV, priv, "Setting mac for port %d\n", priv->port); err = mlx4_register_mac(mdev->dev, priv->port, mlx4_en_mac_to_u64(IF_LLADDR(dev))); - if (err) { - en_err(priv, "Failed setting port mac\n"); + if (err < 0) { + en_err(priv, "Failed setting port mac err=%d\n", err); goto tx_err; } mdev->mac_removed[priv->port] = 0; From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 11:37:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2AA87CB9; Sat, 2 Nov 2013 11:37:17 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1846F2017; Sat, 2 Nov 2013 11:37:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2BbGtR048675; Sat, 2 Nov 2013 11:37:16 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2BbGTv048674; Sat, 2 Nov 2013 11:37:16 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201311021137.rA2BbGTv048674@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 2 Nov 2013 11:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257543 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 11:37:17 -0000 Author: alfred Date: Sat Nov 2 11:37:16 2013 New Revision: 257543 URL: http://svnweb.freebsd.org/changeset/base/257543 Log: Add device ID for 'Sanoxy 802.11N' usb Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sat Nov 2 10:49:47 2013 (r257542) +++ head/sys/dev/usb/wlan/if_urtwn.c Sat Nov 2 11:37:16 2013 (r257543) @@ -139,6 +139,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(REALTEK, RTL8191CU), URTWN_DEV(REALTEK, RTL8192CE), URTWN_DEV(REALTEK, RTL8192CU), + URTWN_DEV(REALTEK, RTL8188CU_0), URTWN_DEV(SITECOMEU, RTL8188CU_1), URTWN_DEV(SITECOMEU, RTL8188CU_2), URTWN_DEV(SITECOMEU, RTL8192CU), From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 14:48:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E9426F9B; Sat, 2 Nov 2013 14:48:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8679F287F; Sat, 2 Nov 2013 14:48:25 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id w8so90306qac.13 for ; Sat, 02 Nov 2013 07:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=y7uSeDCYZ0+sqXQ0J68CVuCB4BsFAYByt6Y+L3e9Zs8=; b=bFhi4YiXeBoh6bukYlWHztI/BvU15pzr2Qzwf7ojCWtRRa8bbQ8Gq/GDw8xlnVCFNu 1Dc3ZCI55jAKEQmGyVti3BeVwq2jRu1GnOvIhgu6CMsVlYMA/HtCD54IkizHI7ZBhkU/ N4wRg386nbXuzUwpBrWoxm/Qow2YjjE+rG9szDnjdamDQmbSoO9IShqJkXvNr+b963SH xUGLeYE3xQc7zcPlngNW4OmMO2zLiXVP7Aoze96SngkXB8EdOEWkmeh7q0ILfzzHfh+L VRVT+84wjOuzEdobZcm9OEU53tzinvFRk3STvJpP6I0HNf2VJAYwwUk/LXfHzWg8XlOA jncw== MIME-Version: 1.0 X-Received: by 10.224.36.201 with SMTP id u9mr10744890qad.76.1383403704298; Sat, 02 Nov 2013 07:48:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 2 Nov 2013 07:48:24 -0700 (PDT) In-Reply-To: <0FD2B8FA-7DD7-4626-95F6-BB64B648E81A@grondar.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> <0FD2B8FA-7DD7-4626-95F6-BB64B648E81A@grondar.org> Date: Sat, 2 Nov 2013 07:48:24 -0700 X-Google-Sender-Auth: arhzHXhazCA4ispK3-b74wYsDDQ Message-ID: Subject: Re: svn commit: r257535 - head/sys/netgraph From: Adrian Chadd To: Mark R V Murray Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 14:48:26 -0000 Okay. I'll go and re-fix things. Thanks, -a On 2 November 2013 02:44, Mark R V Murray wrote: > > On 2 Nov 2013, at 09:32, Mark R V Murray wrote: >>> Mark - did you initially mean the address of the mbuf m_data pointer, >>> or the data payload itself? >> >> As Bruce says - the address of payload data itself. We don=92t have 12-b= yte pointers in FreeBSD. :-) > > Cancel that. > > The address passed must be the address of the m_data field in the mbuf st= ructure. The harvested data is 12 bytes from that address forward, so not t= he data pointed to by that m_data pointer but the pointer value itself and = some following junk too. > > M > -- > Mark R V Murray > From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 15:13:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A1FC6769; Sat, 2 Nov 2013 15:13:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 765782989; Sat, 2 Nov 2013 15:13:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2FD3K7024367; Sat, 2 Nov 2013 15:13:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2FD2OZ024364; Sat, 2 Nov 2013 15:13:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201311021513.rA2FD2OZ024364@svn.freebsd.org> From: Adrian Chadd Date: Sat, 2 Nov 2013 15:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257548 - in head/sys: net netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 15:13:03 -0000 Author: adrian Date: Sat Nov 2 15:13:02 2013 New Revision: 257548 URL: http://svnweb.freebsd.org/changeset/base/257548 Log: Restore the entropy gathering from the m_data pointer value, not the m_data payload. After talking with markm/bde, this is what markm actually intended. Modified: head/sys/net/if_ethersubr.c head/sys/net/if_tun.c head/sys/netgraph/ng_iface.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sat Nov 2 14:20:29 2013 (r257547) +++ head/sys/net/if_ethersubr.c Sat Nov 2 15:13:02 2013 (r257548) @@ -642,7 +642,7 @@ ether_input_internal(struct ifnet *ifp, } if (harvest.ethernet) - random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_ETHER); + random_harvest(&(m->m_data), 12, 2, RANDOM_NET_ETHER); ether_demux(ifp, m); CURVNET_RESTORE(); Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Sat Nov 2 14:20:29 2013 (r257547) +++ head/sys/net/if_tun.c Sat Nov 2 15:13:02 2013 (r257548) @@ -919,7 +919,7 @@ tunwrite(struct cdev *dev, struct uio *u return (EAFNOSUPPORT); } if (harvest.point_to_point) - random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_TUN); + random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN); ifp->if_ibytes += m->m_pkthdr.len; ifp->if_ipackets++; CURVNET_SET(ifp->if_vnet); Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Sat Nov 2 14:20:29 2013 (r257547) +++ head/sys/netgraph/ng_iface.c Sat Nov 2 15:13:02 2013 (r257548) @@ -776,7 +776,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite return (EAFNOSUPPORT); } if (harvest.point_to_point) - random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_NG); + random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); M_SETFIB(m, ifp->if_fib); netisr_dispatch(isr, m); return (0); From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 17:08:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 71B4A266; Sat, 2 Nov 2013 17:08:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6902E89; Sat, 2 Nov 2013 17:08:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2H8L8a062397; Sat, 2 Nov 2013 17:08:21 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2H8LoJ062396; Sat, 2 Nov 2013 17:08:21 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201311021708.rA2H8LoJ062396@svn.freebsd.org> From: Alan Cox Date: Sat, 2 Nov 2013 17:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257549 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 17:08:21 -0000 Author: alc Date: Sat Nov 2 17:08:20 2013 New Revision: 257549 URL: http://svnweb.freebsd.org/changeset/base/257549 Log: Don't create a distinct free page pool for segregating allocations that are accessed through the direct map unless the kernel configuration actually includes a direct map. Only a few configurations do, and for the rest the unnecessary free page pool is a small pessimization. Tested by: zbb MFC after: 6 weeks Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Sat Nov 2 15:13:02 2013 (r257548) +++ head/sys/arm/include/vmparam.h Sat Nov 2 17:08:20 2013 (r257549) @@ -82,15 +82,21 @@ #define VM_PHYSSEG_DENSE /* - * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool - * from which physical pages are allocated and VM_FREEPOOL_DIRECT is - * the pool from which physical pages for small UMA objects are - * allocated. + * Create two or three free page pools depending on the existence of a direct + * map: VM_FREEPOOL_DEFAULT is the default pool from which physical pages are + * allocated, and VM_FREEPOOL_DIRECT is the pool from which physical pages for + * small UMA objects are allocated. */ +#ifdef ARM_USE_SMALL_ALLOC #define VM_NFREEPOOL 3 #define VM_FREEPOOL_CACHE 2 -#define VM_FREEPOOL_DEFAULT 0 #define VM_FREEPOOL_DIRECT 1 +#else +#define VM_NFREEPOOL 2 +#define VM_FREEPOOL_CACHE 1 +#define VM_FREEPOOL_DIRECT 0 +#endif +#define VM_FREEPOOL_DEFAULT 0 /* * we support 2 free lists: From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 18:03:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 00FFC98C; Sat, 2 Nov 2013 18:03:21 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E258220FB; Sat, 2 Nov 2013 18:03:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2I3Lva082803; Sat, 2 Nov 2013 18:03:21 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2I3LNF082802; Sat, 2 Nov 2013 18:03:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201311021803.rA2I3LNF082802@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 2 Nov 2013 18:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257550 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 18:03:22 -0000 Author: luigi Date: Sat Nov 2 18:03:21 2013 New Revision: 257550 URL: http://svnweb.freebsd.org/changeset/base/257550 Log: circumvent a couple of warnings: - on line 2550 intentionally overriding a const qualifier - on line 3219 intentionally converting uint64_t to a pointer Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sat Nov 2 17:08:20 2013 (r257549) +++ head/sys/dev/netmap/netmap.c Sat Nov 2 18:03:21 2013 (r257550) @@ -2547,7 +2547,7 @@ netmap_ioctl(struct cdev *dev, u_long cm } if (memflags & NETMAP_MEM_PRIVATE) { nmr->nr_ringid |= NETMAP_PRIV_MEM; - *(uint32_t *)&nifp->ni_flags |= NI_PRIV_MEM; + *(uint32_t *)(uintptr_t)&nifp->ni_flags |= NI_PRIV_MEM; } nmr->nr_offset = netmap_mem_if_offset(na->nm_mem, nifp); } while (0); @@ -3216,7 +3216,7 @@ nm_bdg_preflush(struct netmap_adapter *n /* this slot goes into a list so initialize the link field */ ft[ft_i].ft_next = NM_FT_NULL; buf = ft[ft_i].ft_buf = (slot->flags & NS_INDIRECT) ? - (void *)slot->ptr : BDG_NMB(na->nm_mem, slot); + (void *)(uintptr_t)slot->ptr : BDG_NMB(na->nm_mem, slot); prefetch(buf); ++ft_i; if (slot->flags & NS_MOREFRAG) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 20:12:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1D78FE5C; Sat, 2 Nov 2013 20:12:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09FAB26B3; Sat, 2 Nov 2013 20:12:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2KCKjd027027; Sat, 2 Nov 2013 20:12:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2KCJvG027015; Sat, 2 Nov 2013 20:12:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201311022012.rA2KCJvG027015@svn.freebsd.org> From: Michael Tuexen Date: Sat, 2 Nov 2013 20:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257555 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 20:12:21 -0000 Author: tuexen Date: Sat Nov 2 20:12:19 2013 New Revision: 257555 URL: http://svnweb.freebsd.org/changeset/base/257555 Log: Changes from upstream to improve compilation when INET or INET6 or none of them is defined. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sat Nov 2 20:06:17 2013 (r257554) +++ head/sys/netinet/sctp_asconf.c Sat Nov 2 20:12:19 2013 (r257555) @@ -150,7 +150,12 @@ sctp_process_asconf_add_ip(struct sockad struct mbuf *m_reply = NULL; struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; - uint16_t param_type, param_length, aparam_length; + uint16_t param_type, aparam_length; + +#if defined(INET) || defined(INET6) + uint16_t param_length; + +#endif struct sockaddr *sa; int zero_address = 0; int bad_address = 0; @@ -169,8 +174,9 @@ sctp_process_asconf_add_ip(struct sockad aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); +#if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); - +#endif sa = (struct sockaddr *)&sa_store; switch (param_type) { #ifdef INET @@ -298,7 +304,12 @@ sctp_process_asconf_delete_ip(struct soc struct mbuf *m_reply = NULL; struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; - uint16_t param_type, param_length, aparam_length; + uint16_t param_type, aparam_length; + +#if defined(INET) || defined(INET6) + uint16_t param_length; + +#endif struct sockaddr *sa; int zero_address = 0; int result; @@ -317,8 +328,9 @@ sctp_process_asconf_delete_ip(struct soc aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); +#if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); - +#endif sa = (struct sockaddr *)&sa_store; switch (param_type) { #ifdef INET @@ -427,7 +439,12 @@ sctp_process_asconf_set_primary(struct s struct mbuf *m_reply = NULL; struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; - uint16_t param_type, param_length, aparam_length; + uint16_t param_type, aparam_length; + +#if defined(INET) || defined(INET6) + uint16_t param_length; + +#endif struct sockaddr *sa; int zero_address = 0; @@ -445,8 +462,9 @@ sctp_process_asconf_set_primary(struct s aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); +#if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); - +#endif sa = (struct sockaddr *)&sa_store; switch (param_type) { #ifdef INET @@ -860,10 +878,12 @@ sctp_asconf_addr_match(struct sctp_ascon static uint32_t sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa) { +#if defined(INET) || defined(INET6) uint16_t param_type, param_length; param_type = ntohs(ph->param_type); param_length = ntohs(ph->param_length); +#endif switch (sa->sa_family) { #ifdef INET6 case AF_INET6: @@ -874,7 +894,7 @@ sctp_addr_match(struct sctp_paramhdr *ph v6addr = (struct sctp_ipv6addr_param *)ph; if ((param_type == SCTP_IPV6_ADDRESS) && - param_length == sizeof(struct sctp_ipv6addr_param) && + (param_length == sizeof(struct sctp_ipv6addr_param)) && (memcmp(&v6addr->addr, &sin6->sin6_addr, sizeof(struct in6_addr)) == 0)) { return (1); @@ -890,7 +910,7 @@ sctp_addr_match(struct sctp_paramhdr *ph v4addr = (struct sctp_ipv4addr_param *)ph; if ((param_type == SCTP_IPV4_ADDRESS) && - param_length == sizeof(struct sctp_ipv4addr_param) && + (param_length == sizeof(struct sctp_ipv4addr_param)) && (memcmp(&v4addr->addr, &sin->sin_addr, sizeof(struct in_addr)) == 0)) { return (1); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Nov 2 20:06:17 2013 (r257554) +++ head/sys/netinet/sctp_output.c Sat Nov 2 20:12:19 2013 (r257555) @@ -1937,10 +1937,13 @@ sctp_is_address_in_scope(struct sctp_ifa static struct mbuf * sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t * len) { +#if defined(INET) || defined(INET6) struct sctp_paramhdr *parmh; struct mbuf *mret; uint16_t plen; +#endif + switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: @@ -1955,6 +1958,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st default: return (m); } +#if defined(INET) || defined(INET6) if (M_TRAILINGSPACE(m) >= plen) { /* easy side we just drop it on the end */ parmh = (struct sctp_paramhdr *)(SCTP_BUF_AT(m, SCTP_BUF_LEN(m))); @@ -2015,6 +2019,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st *len += plen; } return (mret); +#endif } @@ -3855,8 +3860,11 @@ sctp_lowlevel_chunk_output(struct sctp_i struct sctphdr *sctphdr; int packet_length; int ret; + +#if defined(INET) || defined(INET6) uint32_t vrf_id; +#endif #if defined(INET) || defined(INET6) struct mbuf *o_pak; sctp_route_t *ro = NULL; @@ -3875,12 +3883,13 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_m_freem(m); return (EFAULT); } +#if defined(INET) || defined(INET6) if (stcb) { vrf_id = stcb->asoc.vrf_id; } else { vrf_id = inp->def_vrf_id; } - +#endif /* fill in the HMAC digest for any AUTH chunk in the packet */ if ((auth != NULL) && (stcb != NULL)) { sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); @@ -10798,8 +10807,12 @@ sctp_send_resp_msg(struct sockaddr *src, struct sctphdr *shout; struct sctp_chunkhdr *ch; struct udphdr *udp; - int len, cause_len, padding_len, ret; + int len, cause_len, padding_len; +#if defined(INET) || defined(INET6) + int ret; + +#endif #ifdef INET struct sockaddr_in *src_sin, *dst_sin; struct ip *ip; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Nov 2 20:06:17 2013 (r257554) +++ head/sys/netinet/sctp_pcb.c Sat Nov 2 20:12:19 2013 (r257555) @@ -827,18 +827,30 @@ out_now: static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { - int loopback_scope, ipv4_local_scope, local_scope, site_scope; - int ipv4_addr_legal, ipv6_addr_legal; + int loopback_scope; + +#if defined(INET) + int ipv4_local_scope, ipv4_addr_legal; + +#endif +#if defined(INET6) + int local_scope, site_scope, ipv6_addr_legal; + +#endif struct sctp_vrf *vrf; struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; loopback_scope = stcb->asoc.scope.loopback_scope; +#if defined(INET) ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; +#endif +#if defined(INET6) local_scope = stcb->asoc.scope.local_scope; site_scope = stcb->asoc.scope.site_scope; - ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; +#endif SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); @@ -1971,8 +1983,13 @@ sctp_findassociation_special_addr(struct struct sockaddr *dst) { struct sctp_paramhdr *phdr, parm_buf; + +#if defined(INET) || defined(INET6) struct sctp_tcb *stcb; - uint32_t ptype, plen; + uint16_t ptype; + +#endif + uint16_t plen; #ifdef INET struct sockaddr_in sin4; @@ -1996,13 +2013,14 @@ sctp_findassociation_special_addr(struct sin6.sin6_port = sh->src_port; #endif - stcb = NULL; offset += sizeof(struct sctp_init_chunk); phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); while (phdr != NULL) { /* now we must see if we want the parameter */ +#if defined(INET) || defined(INET6) ptype = ntohs(phdr->param_type); +#endif plen = ntohs(phdr->param_length); if (plen == 0) { break; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Nov 2 20:06:17 2013 (r257554) +++ head/sys/netinet/sctp_usrreq.c Sat Nov 2 20:12:19 2013 (r257555) @@ -1120,9 +1120,17 @@ sctp_fill_up_addresses_vrf(struct sctp_i { struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; - int loopback_scope, ipv4_local_scope, local_scope, site_scope; size_t actual; - int ipv4_addr_legal, ipv6_addr_legal; + int loopback_scope; + +#if defined(INET) + int ipv4_local_scope, ipv4_addr_legal; + +#endif +#if defined(INET6) + int local_scope, site_scope, ipv6_addr_legal; + +#endif struct sctp_vrf *vrf; actual = 0; @@ -1132,27 +1140,43 @@ sctp_fill_up_addresses_vrf(struct sctp_i if (stcb) { /* Turn on all the appropriate scope */ loopback_scope = stcb->asoc.scope.loopback_scope; +#if defined(INET) ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; +#endif +#if defined(INET6) local_scope = stcb->asoc.scope.local_scope; site_scope = stcb->asoc.scope.site_scope; - ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; +#endif } else { /* Use generic values for endpoints. */ loopback_scope = 1; +#if defined(INET) ipv4_local_scope = 1; +#endif +#if defined(INET6) local_scope = 1; site_scope = 1; +#endif if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { +#if defined(INET6) ipv6_addr_legal = 1; +#endif +#if defined(INET) if (SCTP_IPV6_V6ONLY(inp)) { ipv4_addr_legal = 0; } else { ipv4_addr_legal = 1; } +#endif } else { +#if defined(INET6) ipv6_addr_legal = 0; +#endif +#if defined(INET) ipv4_addr_legal = 1; +#endif } } vrf = sctp_find_vrf(vrf_id); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Nov 2 20:06:17 2013 (r257554) +++ head/sys/netinet/sctputil.c Sat Nov 2 20:12:19 2013 (r257555) @@ -6612,8 +6612,16 @@ sctp_bindx_delete_address(struct sctp_in int sctp_local_addr_count(struct sctp_tcb *stcb) { - int loopback_scope, ipv4_local_scope, local_scope, site_scope; - int ipv4_addr_legal, ipv6_addr_legal; + int loopback_scope; + +#if defined(INET) + int ipv4_local_scope, ipv4_addr_legal; + +#endif +#if defined (INET6) + int local_scope, site_scope, ipv6_addr_legal; + +#endif struct sctp_vrf *vrf; struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; @@ -6621,11 +6629,15 @@ sctp_local_addr_count(struct sctp_tcb *s /* Turn on all the appropriate scopes */ loopback_scope = stcb->asoc.scope.loopback_scope; +#if defined(INET) ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; +#endif +#if defined(INET6) local_scope = stcb->asoc.scope.local_scope; site_scope = stcb->asoc.scope.site_scope; - ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; +#endif SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); if (vrf == NULL) { Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat Nov 2 20:06:17 2013 (r257554) +++ head/sys/netinet6/sctp6_usrreq.c Sat Nov 2 20:12:19 2013 (r257555) @@ -839,16 +839,18 @@ sctp6_connect(struct socket *so, struct uint32_t vrf_id; int error = 0; struct sctp_inpcb *inp; - struct in6pcb *inp6; struct sctp_tcb *stcb; #ifdef INET + struct in6pcb *inp6; struct sockaddr_in6 *sin6; struct sockaddr_storage ss; #endif +#ifdef INET inp6 = (struct in6pcb *)so->so_pcb; +#endif inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET); From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 20:14:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C871CFA8; Sat, 2 Nov 2013 20:14:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B57F926C3; Sat, 2 Nov 2013 20:14:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2KEeLX027428; Sat, 2 Nov 2013 20:14:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2KEeRu027425; Sat, 2 Nov 2013 20:14:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311022014.rA2KEeRu027425@svn.freebsd.org> From: Ian Lepore Date: Sat, 2 Nov 2013 20:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257556 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 20:14:41 -0000 Author: ian Date: Sat Nov 2 20:14:39 2013 New Revision: 257556 URL: http://svnweb.freebsd.org/changeset/base/257556 Log: Arrange for uart_cpu_fdt's probe() routine to use the same table of compat strings as uart_bus_fdt's probe(). The bus code uses ofw_bus_search_compatible() and that's not an option in cpu (console) code -- it runs way before the ofw routines are usable. So the console probe has its own loop to search the table, but now at least there's only one table to be maintained when new devices are added. Modified: head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Sat Nov 2 20:12:19 2013 (r257555) +++ head/sys/dev/uart/uart.h Sat Nov 2 20:14:39 2013 (r257556) @@ -76,6 +76,11 @@ extern struct uart_class uart_pl011_clas extern struct uart_class uart_cdnc_class __attribute__((weak)); extern struct uart_class uart_ti8250_class __attribute__((weak)); +#ifdef FDT +struct ofw_compat_data; +extern const struct ofw_compat_data *uart_fdt_compat_data; +#endif + #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); #endif Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sat Nov 2 20:12:19 2013 (r257555) +++ head/sys/dev/uart/uart_bus_fdt.c Sat Nov 2 20:14:39 2013 (r257556) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -85,6 +87,9 @@ static struct ofw_compat_data compat_dat {NULL, (uintptr_t)NULL}, }; +/* Export the compat_data table for use by the uart_cpu_fdt.c probe routine. */ +const struct ofw_compat_data *uart_fdt_compat_data = compat_data; + static int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Sat Nov 2 20:12:19 2013 (r257555) +++ head/sys/dev/uart/uart_cpu_fdt.c Sat Nov 2 20:14:39 2013 (r257556) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -118,6 +120,7 @@ uart_cpu_getdev(int devtype, struct uart const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", "stdin-path", "stdin", NULL}; const char **name; + const struct ofw_compat_data *cd; struct uart_class *class; phandle_t node, chosen; pcell_t shift, br, rclk; @@ -166,22 +169,13 @@ uart_cpu_getdev(int devtype, struct uart /* * Finalize configuration. */ - if (fdt_is_compatible(node, "fsl,imx-uart")) - class = &uart_imx_class; - else if (fdt_is_compatible(node, "quicc")) - class = &uart_quicc_class; - else if (fdt_is_compatible(node, "lpc")) - class = &uart_lpc_class; - else if (fdt_is_compatible(node, "arm,pl011")) - class = &uart_pl011_class; - else if (fdt_is_compatible(node, "exynos")) - class = &uart_s3c2410_class; - else if (fdt_is_compatible(node, "cadence,uart")) - class = &uart_cdnc_class; - else if (fdt_is_compatible(node, "ti,ns16550")) - class = &uart_ti8250_class; - else if (fdt_is_compatible(node, "ns16550")) - class = &uart_ns8250_class; + for (cd = uart_fdt_compat_data; cd->ocd_str != NULL; ++cd) { + if (fdt_is_compatible(node, cd->ocd_str)) + break; + } + if (cd->ocd_str == NULL) + return (ENXIO); + class = (struct uart_class *)cd->ocd_data; di->bas.chan = 0; di->bas.regshft = (u_int)shift; From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 21:07:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C7DD393E; Sat, 2 Nov 2013 21:07:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3A8328D7; Sat, 2 Nov 2013 21:07:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2L7dhU044411; Sat, 2 Nov 2013 21:07:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2L7dOJ044410; Sat, 2 Nov 2013 21:07:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311022107.rA2L7dOJ044410@svn.freebsd.org> From: Ian Lepore Date: Sat, 2 Nov 2013 21:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257557 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 21:07:39 -0000 Author: ian Date: Sat Nov 2 21:07:39 2013 New Revision: 257557 URL: http://svnweb.freebsd.org/changeset/base/257557 Log: Add a missing register definition. Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatopreg.h Sat Nov 2 20:14:39 2013 (r257556) +++ head/sys/arm/freescale/imx/imx6_anatopreg.h Sat Nov 2 21:07:39 2013 (r257557) @@ -81,6 +81,17 @@ #define IMX6_ANALOG_CCM_PFD_528_SET 0x104 #define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 #define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C +#define IMX6_ANALOG_PMU_REG_CORE 0x140 +#define IMX6_ANALOG_PMU_REG2_TARG_SHIFT 18 +#define IMX6_ANALOG_PMU_REG2_TARG_MASK \ + (0x1f << IMX6_ANALOG_PMU_REG2_TARG_SHIFT) +#define IMX6_ANALOG_PMU_REG1_TARG_SHIFT 9 +#define IMX6_ANALOG_PMU_REG1_TARG_MASK \ + (0x1f << IMX6_ANALOG_PMU_REG1_TARG_SHIFT) +#define IMX6_ANALOG_PMU_REG0_TARG_SHIFT 0 +#define IMX6_ANALOG_PMU_REG0_TARG_MASK \ + (0x1f << IMX6_ANALOG_PMU_REG0_TARG_SHIFT) + #define IMX6_ANALOG_CCM_MISC0 0x150 #define IMX6_ANALOG_CCM_MISC0_SET 0x154 #define IMX6_ANALOG_CCM_MISC0_CLR 0x158 From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 21:17:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 06766AEA; Sat, 2 Nov 2013 21:17:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B695F2929; Sat, 2 Nov 2013 21:17:30 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 0AE0B359314; Sat, 2 Nov 2013 22:17:28 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id D4EDFCB4E; Sat, 2 Nov 2013 22:17:27 +0100 (CET) Date: Sat, 2 Nov 2013 22:17:27 +0100 From: Jilles Tjoelker To: Konstantin Belousov Subject: Re: svn commit: r256849 - in head/sys: kern sys Message-ID: <20131102211727.GA160@stack.nl> References: <201310211644.r9LGirtR012470@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201310211644.r9LGirtR012470@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 21:17:31 -0000 On Mon, Oct 21, 2013 at 04:44:53PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Oct 21 16:44:53 2013 > New Revision: 256849 > URL: http://svnweb.freebsd.org/changeset/base/256849 > Log: > Add a resource limit for the total number of kqueues available to the > user. Kqueue now saves the ucred of the allocating thread, to > correctly decrement the counter on close. > Under some specific and not real-world use scenario for kqueue, it is > possible for the kqueues to consume memory proportional to the square > of the number of the filedescriptors available to the process. Limit > allows administrator to prevent the abuse. > This is kernel-mode side of the change, with the user-mode enabling > commit following. > Reported and tested by: pho > Discussed with: jmg > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > [snip] > + if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td->td_proc, > + RLIMIT_KQUEUES))) { > + PROC_UNLOCK(p); > + crfree(cred); > + return (EMFILE); > + } Perhaps this error should be [ENOMEM] instead of [EMFILE] as it is unrelated to the number of file descriptors in the process. This error is already listed in the kqueue(2) man page but appears to be not generated. The rlimit can then be mentioned in the man page. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 21:39:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 20FEB9B; Sat, 2 Nov 2013 21:39:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B28E829EE; Sat, 2 Nov 2013 21:39:24 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rA2LdJ4Q053254; Sat, 2 Nov 2013 23:39:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rA2LdJ4Q053254 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rA2LdJTi053253; Sat, 2 Nov 2013 23:39:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 2 Nov 2013 23:39:19 +0200 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: svn commit: r256849 - in head/sys: kern sys Message-ID: <20131102213919.GD59496@kib.kiev.ua> References: <201310211644.r9LGirtR012470@svn.freebsd.org> <20131102211727.GA160@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cHOhevsz5PKyTXvv" Content-Disposition: inline In-Reply-To: <20131102211727.GA160@stack.nl> User-Agent: Mutt/1.5.22 (2013-10-16) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 21:39:25 -0000 --cHOhevsz5PKyTXvv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 02, 2013 at 10:17:27PM +0100, Jilles Tjoelker wrote: > On Mon, Oct 21, 2013 at 04:44:53PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Oct 21 16:44:53 2013 > > New Revision: 256849 > > URL: http://svnweb.freebsd.org/changeset/base/256849 >=20 > > Log: > > Add a resource limit for the total number of kqueues available to the > > user. Kqueue now saves the ucred of the allocating thread, to > > correctly decrement the counter on close. >=20 > > Under some specific and not real-world use scenario for kqueue, it is > > possible for the kqueues to consume memory proportional to the square > > of the number of the filedescriptors available to the process. Limit > > allows administrator to prevent the abuse. >=20 > > This is kernel-mode side of the change, with the user-mode enabling > > commit following. >=20 > > Reported and tested by: pho > > Discussed with: jmg > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks >=20 > > [snip] > > + if (!chgkqcnt(cred->cr_ruidinfo, 1, lim_cur(td->td_proc, > > + RLIMIT_KQUEUES))) { > > + PROC_UNLOCK(p); > > + crfree(cred); > > + return (EMFILE); > > + } >=20 > Perhaps this error should be [ENOMEM] instead of [EMFILE] as it is > unrelated to the number of file descriptors in the process. This error > is already listed in the kqueue(2) man page but appears to be not > generated. The rlimit can then be mentioned in the man page. This is reasonable. Would you make the change yourself, please ? --cHOhevsz5PKyTXvv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSdXEGAAoJEJDCuSvBvK1B7OoQAJCXgPt+T1ptva5Aq+xe6y8W uKUBETXreFebMPHE58SwZdFT7m8rF2RTw+uhlC+vhqZQim64j7yUydAn/CWuJ6D+ UL7BvBiUHwtsdXzfBcGw87LYaPtBxEctjU2k9yIJe0b74fj8E7erXkAMExnovf47 VFj+/4IjE3QDf4alyfDxU1051BBARcLQKmY76wUNqxFvNLr8ladeNbiJC4t9fx7i J+p8TpXI0K7bh+u6sxxgtAQd3OtJ6b9DqDrK0Sr1LrLVZVBoCJXnrnMxvl6csNyU K/W4c7gBH4XXnm3icm0maxq/e4x+ITqNup6KQ3mxEQXYlb8Bs0HfqbjnNRIfaIUC e/cXDFUg6rfqKdnIxGWHsTmf6SY3ngmSsOuKdmKhJPLlubGwWJJUxVqY3Clflbnc 6QzrZDW6EOiOdHbQfTb+NLiRYjz/ervxtUyX51vy6ADhBawI83wHmY72tQIZetEy oWv+f7Ah1uJCuolOjV0QPj1XXIfWR1WDpI7kV4UDCnMcCQsgW25ODZnqqM3NG5os jmS0x0nNgbC5CZma0f+JLTOpv6OBr3XWaKwA6Qs25Vwki2+7GNecSvAVGKPSye11 16g6VTZlKvOi01sg9LhY5mpbB+Y22LznYYHqhkKlTflKPFK/iKrS/W7E/648vCvT 11FNs2P0kUAwQkeb9Ab9 =TNae -----END PGP SIGNATURE----- --cHOhevsz5PKyTXvv-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 22:18:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38875692; Sat, 2 Nov 2013 22:18:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25CB52B66; Sat, 2 Nov 2013 22:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2MIgJM068128; Sat, 2 Nov 2013 22:18:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2MIgkJ068127; Sat, 2 Nov 2013 22:18:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201311022218.rA2MIgkJ068127@svn.freebsd.org> From: Rui Paulo Date: Sat, 2 Nov 2013 22:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r257560 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 22:18:42 -0000 Author: rpaulo Date: Sat Nov 2 22:18:41 2013 New Revision: 257560 URL: http://svnweb.freebsd.org/changeset/base/257560 Log: Please welcome Julio Merino as a new src committer. Julio will work on the FreeBSD testing framework: ATF/Kyua. I'll be his mentor. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sat Nov 2 21:48:59 2013 (r257559) +++ svnadmin/conf/access Sat Nov 2 22:18:41 2013 (r257560) @@ -118,6 +118,7 @@ jkim jlh jmallett jmg +jmmv joerg freebsd-devel@uriah.heep.sax.de jonathan jpaetzel From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 22:28:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 07563C07; Sat, 2 Nov 2013 22:28:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B87BC2BDB; Sat, 2 Nov 2013 22:28:18 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C03A1D6181D; Sun, 3 Nov 2013 09:28:07 +1100 (EST) Date: Sun, 3 Nov 2013 09:28:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark R V Murray Subject: Re: svn commit: r257535 - head/sys/netgraph In-Reply-To: <0FD2B8FA-7DD7-4626-95F6-BB64B648E81A@grondar.org> Message-ID: <20131103091238.S1004@besplex.bde.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> <0FD2B8FA-7DD7-4626-95F6-BB64B648E81A@grondar.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-544104390-1383431285=:1004" X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=EA1U1QKjvecA:10 a=JzwRw_2MAAAA:8 a=STxCta6Vch0A:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=DRvN8B8JAAAA:8 a=9j6LB6fuknZSyTMdaW4A:9 a=vZvdZrFbaY7RkCWN:21 a=1qT48Fj1BhkfAluS:21 a=45ClL6m2LaAA:10 a=iROX_XsaM_QA:10 Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 22:28:19 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-544104390-1383431285=:1004 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 2 Nov 2013, Mark R V Murray wrote: > On 2 Nov 2013, at 09:32, Mark R V Murray wrote: >>> Mark - did you initially mean the address of the mbuf m_data pointer, >>> or the data payload itself? >> >> As Bruce says - the address of payload data itself. We don=92t have 12-b= yte pointers in FreeBSD. :-) > > Cancel that. > > The address passed must be the address of the m_data field in the mbuf st= ructure. The harvested data is 12 bytes from that address forward, so not t= he data pointed to by that m_data pointer but the pointer value itself and = some following junk too. Is that really worth using? The mbuf data pointer is only slightly more random than the mbuf pointer (equally non-random if the data is in the mbuf). The bytes following it are even less random. I think the mbuf pointer usually points to an IP header. 12 bytes gives everything except the source and destination addresses. 20 would cover those too. There can't be buffer overruns in practice, even with a much larger size since small buffers go in the mbuf. In the mbuf header starting at the data pointer, there are always 16 bytes in the header alone, and many more after the header. On 32-bit systems, the header has 2 more bytes in mh_type after the 12 followed by 2 bytes of unnamed padding. The padding might be random but is more likely to be always 0. 16 altogether. On 64-bit systems, the header has 4 more bytes in mh_flags after the 12, then 2+2 for mh_type and padding as above, then 4 more of unnamed padding. 24 altogether. So why 12? Bruce --0-544104390-1383431285=:1004-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 22:36:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8C9F6EBF; Sat, 2 Nov 2013 22:36:13 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEAA2C46; Sat, 2 Nov 2013 22:36:13 +0000 (UTC) Received: from [2001:470:9174:1:d5dd:fe5d:5b9d:33d2] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Vcjnb-0001kN-J7; Sat, 02 Nov 2013 22:36:11 +0000 Subject: Re: svn commit: r257535 - head/sys/netgraph Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4008F7B3-6AF9-4838-9C8C-F213184AB203"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: <20131103091238.S1004@besplex.bde.org> Date: Sat, 2 Nov 2013 22:35:59 +0000 Message-Id: <38F2745D-B252-495E-96D3-B4139165AB95@grondar.org> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> <0FD2B8FA-7DD7-4626-95F6-BB64B648E81A@grondar.org> <20131103091238.S1004@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1816) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 22:36:13 -0000 --Apple-Mail=_4008F7B3-6AF9-4838-9C8C-F213184AB203 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 2 Nov 2013, at 22:28, Bruce Evans wrote: > On Sat, 2 Nov 2013, Mark R V Murray wrote: >=20 >> On 2 Nov 2013, at 09:32, Mark R V Murray wrote: >>>> Mark - did you initially mean the address of the mbuf m_data = pointer, >>>> or the data payload itself? >>>=20 >>> As Bruce says - the address of payload data itself. We don=92t have = 12-byte pointers in FreeBSD. :-) >>=20 >> Cancel that. >>=20 >> The address passed must be the address of the m_data field in the = mbuf structure. The harvested data is 12 bytes from that address = forward, so not the data pointed to by that m_data pointer but the = pointer value itself and some following junk too. >=20 > Is that really worth using? Yes. Most of the value comes from the timing. The 12 bytes we snatch on = the way past are opportunistic, and hopefully cheap due to being = in-cache. M --=20 --=20 Mark R V Murray --Apple-Mail=_4008F7B3-6AF9-4838-9C8C-F213184AB203 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUnV+Vd58vKOKE6LNAQrciQP+PtQA6vKGhlaBYJ+6HdXWzwaXhEHn+/1l TQ8h6YGGFJ17BHjP9e2QoxYgp1zByXUF8C3DkdXezGj+TbnTjN4I+7udoV9jdKV0 64/4N1SpuVcwzks6h+OW1j5/7eC/Xy8vT59XreF6wplfZxU8ODbPFwFRXUgCBdvo AihilNgqooE= =KV+c -----END PGP SIGNATURE----- --Apple-Mail=_4008F7B3-6AF9-4838-9C8C-F213184AB203-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 2 22:44:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AAE163EF; Sat, 2 Nov 2013 22:44:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96F072CD4; Sat, 2 Nov 2013 22:44:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA2MiZb2077588; Sat, 2 Nov 2013 22:44:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA2MiZeQ077587; Sat, 2 Nov 2013 22:44:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201311022244.rA2MiZeQ077587@svn.freebsd.org> From: Ian Lepore Date: Sat, 2 Nov 2013 22:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257561 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 02 Nov 2013 22:44:35 -0000 Author: ian Date: Sat Nov 2 22:44:35 2013 New Revision: 257561 URL: http://svnweb.freebsd.org/changeset/base/257561 Log: Bugfix: the attach routine needs to use the same table of fdt compat strings that the probe routine used. Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Sat Nov 2 22:18:41 2013 (r257560) +++ head/sys/arm/freescale/imx/imx_sdhci.c Sat Nov 2 22:44:35 2013 (r257561) @@ -558,13 +558,9 @@ imx_sdhci_attach(device_t dev) sc->dev = dev; - if (ofw_bus_is_compatible(dev, "fsl,imx51-esdhc")) { - sc->hwtype = HWTYPE_ESDHC; - } else if (ofw_bus_is_compatible(dev, "fsl,imx-usdhc")) { - sc->hwtype = HWTYPE_USDHC; - } else { + sc->hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (sc->hwtype == HWTYPE_NONE) panic("Impossible: not compatible in imx_sdhci_attach()"); - } rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,