From owner-svn-src-all@freebsd.org Sun Apr 1 00:22:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EF98F6B3BA; Sun, 1 Apr 2018 00:22:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF0AC7EBBB; Sun, 1 Apr 2018 00:22:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A71091F204; Sun, 1 Apr 2018 00:22:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w310Mphn024400; Sun, 1 Apr 2018 00:22:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w310Mp8t024399; Sun, 1 Apr 2018 00:22:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804010022.w310Mp8t024399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 1 Apr 2018 00:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331857 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 00:22:52 -0000 Author: kevans Date: Sun Apr 1 00:22:51 2018 New Revision: 331857 URL: https://svnweb.freebsd.org/changeset/base/331857 Log: lualoader: Simplify some expressions - No need for a 'goto' when our entire loop body is then wrapped in a conditional. - No need to leave commented out prints laying around - If an expression is clearly going to be either nil or an expression that isn't likely to be a boolean, we might as well use `or` to specify a default value for the expression. e.g. `loader.getenv(...) or "no"` Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Mar 31 23:50:20 2018 (r331856) +++ head/stand/lua/config.lua Sun Apr 1 00:22:51 2018 (r331857) @@ -205,10 +205,7 @@ local function loadModule(mod, silent) local status = true local pstatus for k, v in pairs(mod) do - if v.load == nil then - goto continue - end - if v.load:lower() == "yes" then + if v.load ~= nil and v.load:lower() == "yes" then local str = "load " if v.flags ~= nil then str = str .. v.flags .. " " @@ -247,12 +244,7 @@ local function loadModule(mod, silent) status = status and pstatus end --- else --- if not silent then --- print("Skipping module '". . k .. "'") --- end end - ::continue:: end return status @@ -272,11 +264,8 @@ local function readFile(name, silent) -- We might have read in the whole file, this won't be needed any more. io.close(f) - if text == nil then - if not silent then - print(MSG_FAILREADCFG:format(name)) - end - return nil + if text == nil and not silent then + print(MSG_FAILREADCFG:format(name)) end return text end @@ -322,11 +311,7 @@ config.verbose = false -- The first item in every carousel is always the default item. function config.getCarouselIndex(id) - local val = carousel_choices[id] - if val == nil then - return 1 - end - return val + return carousel_choices[id] or 1 end function config.setCarouselIndex(id, idx) @@ -498,10 +483,7 @@ function config.load(file) -- Cache the provided module_path at load time for later use config.module_path = loader.getenv("module_path") - local verbose = loader.getenv("verbose_loading") - if verbose == nil then - verbose = "no" - end + local verbose = loader.getenv("verbose_loading") or "no" config.verbose = verbose:lower() == "yes" end From owner-svn-src-all@freebsd.org Sun Apr 1 00:25:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AA40F6B750; Sun, 1 Apr 2018 00:25:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4908D7EDC6; Sun, 1 Apr 2018 00:25:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40ECE1F209; Sun, 1 Apr 2018 00:25:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w310PmTS024618; Sun, 1 Apr 2018 00:25:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w310PmWn024616; Sun, 1 Apr 2018 00:25:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804010025.w310PmWn024616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Apr 2018 00:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331858 - head/sys/dev/firewire X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/firewire X-SVN-Commit-Revision: 331858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 00:25:48 -0000 Author: imp Date: Sun Apr 1 00:25:47 2018 New Revision: 331858 URL: https://svnweb.freebsd.org/changeset/base/331858 Log: The Uninorth ID was really for Uninorth 2. Submitted by: Sevan Janiyan Differential Revision: https://reviews.freebsd.org/D14919 Modified: head/sys/dev/firewire/fwohci_pci.c head/sys/dev/firewire/fwohcireg.h Modified: head/sys/dev/firewire/fwohci_pci.c ============================================================================== --- head/sys/dev/firewire/fwohci_pci.c Sun Apr 1 00:22:51 2018 (r331857) +++ head/sys/dev/firewire/fwohci_pci.c Sun Apr 1 00:25:47 2018 (r331858) @@ -171,8 +171,8 @@ fwohci_pci_probe(device_t dev) device_set_desc(dev, "Apple Pangea"); return BUS_PROBE_DEFAULT; } - if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH)) { - device_set_desc(dev, "Apple UniNorth"); + if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH2)) { + device_set_desc(dev, "Apple UniNorth 2"); return BUS_PROBE_DEFAULT; } if (id == (FW_VENDORID_LUCENT | FW_DEVICE_FW322)) { Modified: head/sys/dev/firewire/fwohcireg.h ============================================================================== --- head/sys/dev/firewire/fwohcireg.h Sun Apr 1 00:22:51 2018 (r331857) +++ head/sys/dev/firewire/fwohcireg.h Sun Apr 1 00:25:47 2018 (r331858) @@ -74,7 +74,7 @@ #define FW_DEVICE_R5C551 (0x0551 << 16) #define FW_DEVICE_R5C552 (0x0552 << 16) #define FW_DEVICE_PANGEA (0x0030 << 16) -#define FW_DEVICE_UNINORTH (0x0031 << 16) +#define FW_DEVICE_UNINORTH2 (0x0031 << 16) #define FW_DEVICE_AIC5800 (0x5800 << 16) #define FW_DEVICE_FW322 (0x5811 << 16) #define FW_DEVICE_7007 (0x7007 << 16) From owner-svn-src-all@freebsd.org Sun Apr 1 01:07:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A62F6E620; Sun, 1 Apr 2018 01:07:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB1CD80815; Sun, 1 Apr 2018 01:07:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC5F21F8BE; Sun, 1 Apr 2018 01:07:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3117GJP045775; Sun, 1 Apr 2018 01:07:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3117Gt6045768; Sun, 1 Apr 2018 01:07:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804010107.w3117Gt6045768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 1 Apr 2018 01:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331859 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 01:07:17 -0000 Author: kevans Date: Sun Apr 1 01:07:15 2018 New Revision: 331859 URL: https://svnweb.freebsd.org/changeset/base/331859 Log: lualoader: Split logodefs out into logo-* files This commit splits all of the logodefs/graphics out into their own own files and provides a method for these files to register their logodefs with the drawer. Graphics are now loaded on demand if they don't exist in the current set of logodefs. The drawer module becomes a little easier to navigate through without all of the graphics mixed in. It's also easy to do one-off graphics like the 9.2 Die Hard tribute by dteske@ without adding even more to our memory requirements. Added: head/stand/lua/logo-beastie.lua (contents, props changed) head/stand/lua/logo-beastiebw.lua (contents, props changed) head/stand/lua/logo-fbsdbw.lua (contents, props changed) head/stand/lua/logo-orb.lua (contents, props changed) head/stand/lua/logo-orbbw.lua (contents, props changed) Modified: head/stand/lua/Makefile head/stand/lua/drawer.lua Modified: head/stand/lua/Makefile ============================================================================== --- head/stand/lua/Makefile Sun Apr 1 00:25:47 2018 (r331858) +++ head/stand/lua/Makefile Sun Apr 1 01:07:15 2018 (r331859) @@ -10,6 +10,11 @@ FILES= cli.lua \ drawer.lua \ hook.lua \ loader.lua \ + logo-beastie.lua \ + logo-beastiebw.lua \ + logo-fbsdbw.lua \ + logo-orb.lua \ + logo-orbbw.lua \ menu.lua \ password.lua \ screen.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Apr 1 00:25:47 2018 (r331858) +++ head/stand/lua/drawer.lua Sun Apr 1 01:07:15 2018 (r331859) @@ -36,12 +36,7 @@ local screen = require("screen") local drawer = {} -local fbsd_logo -local beastie_color -local beastie -local fbsd_logo_v -local orb_color -local orb +local fbsd_brand local none local function menuEntryName(drawing_menu, entry) @@ -56,7 +51,20 @@ local function menuEntryName(drawing_menu, entry) return entry.name end -fbsd_logo = { +local function getLogodef(logo) + -- Look it up + local logodef = drawer.logodefs[logo] + + -- Try to pull it in + if logodef == nil then + try_include('logo-' .. logo) + logodef = drawer.logodefs[logo] + end + + return logodef +end + +fbsd_brand = { " ______ ____ _____ _____ ", " | ____| | _ \\ / ____| __ \\ ", " | |___ _ __ ___ ___ | |_) | (___ | | | |", @@ -65,103 +73,6 @@ fbsd_logo = { " | | | | | | || | | |", " |_| |_| \\___|\\___||____/|_____/|_____/ " } - -beastie_color = { -" \027[31m, ,", -" /( )`", -" \\ \\___ / |", -" /- \027[37m_\027[31m `-/ '", -" (\027[37m/\\/ \\\027[31m \\ /\\", -" \027[37m/ / |\027[31m ` \\", -" \027[34mO O \027[37m) \027[31m/ |", -" \027[37m`-^--'\027[31m`< '", -" (_.) _ ) /", -" `.___/` /", -" `-----' /", -" \027[33m<----.\027[31m __ / __ \\", -" \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", -" \027[33m<----'\027[31m `--' `.__,' \\", -" | |", -" \\ / /\\", -" \027[36m______\027[31m( (_ / \\______/", -" \027[36m,' ,-----' |", -" `--{__________)\027[37m" -} - -beastie = { -" , ,", -" /( )`", -" \\ \\___ / |", -" /- _ `-/ '", -" (/\\/ \\ \\ /\\", -" / / | ` \\", -" O O ) / |", -" `-^--'`< '", -" (_.) _ ) /", -" `.___/` /", -" `-----' /", -" <----. __ / __ \\", -" <----|====O)))==) \\) /====|", -" <----' `--' `.__,' \\", -" | |", -" \\ / /\\", -" ______( (_ / \\______/", -" ,' ,-----' |", -" `--{__________)" -} - -fbsd_logo_v = { -" ______", -" | ____| __ ___ ___ ", -" | |__ | '__/ _ \\/ _ \\", -" | __|| | | __/ __/", -" | | | | | | |", -" |_| |_| \\___|\\___|", -" ____ _____ _____", -" | _ \\ / ____| __ \\", -" | |_) | (___ | | | |", -" | _ < \\___ \\| | | |", -" | |_) |____) | |__| |", -" | | | |", -" |____/|_____/|_____/" -} - -orb_color = { -" \027[31m``` \027[31;1m`\027[31m", -" s` `.....---...\027[31;1m....--.``` -/\027[31m", -" +o .--` \027[31;1m/y:` +.\027[31m", -" yo`:. \027[31;1m:o `+-\027[31m", -" y/ \027[31;1m-/` -o/\027[31m", -" .- \027[31;1m::/sy+:.\027[31m", -" / \027[31;1m`-- /\027[31m", -" `: \027[31;1m:`\027[31m", -" `: \027[31;1m:`\027[31m", -" / \027[31;1m/\027[31m", -" .- \027[31;1m-.\027[31m", -" -- \027[31;1m-.\027[31m", -" `:` \027[31;1m`:`", -" \027[31;1m.-- `--.", -" .---.....----.\027[37m" -} - -orb = { -" ``` `", -" s` `.....---.......--.``` -/", -" +o .--` /y:` +.", -" yo`:. :o `+-", -" y/ -/` -o/", -" .- ::/sy+:.", -" / `-- /", -" `: :`", -" `: :`", -" / /", -" .- -.", -" -- -.", -" `:` `:`", -" .-- `--.", -" .---.....----." -} - none = {""} -- Module exports @@ -205,42 +116,30 @@ drawer.branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid -- keys are: graphic (table depicting graphic) ["fbsd"] = { - graphic = fbsd_logo, + graphic = fbsd_brand, }, ["none"] = { graphic = none, }, } +function drawer.addBrand(name, def) + drawer.branddefs[name] = def +end + +function drawer.addLogo(name, def) + drawer.logodefs[name] = def +end + drawer.logodefs = { -- Indexed by valid values for loader_logo in loader.conf(5). Valid keys -- are: requires_color (boolean), graphic (table depicting graphic), and -- shift (table containing x and y). - ["beastie"] = { - requires_color = true, - graphic = beastie_color, - }, - ["beastiebw"] = { - graphic = beastie, - }, - ["fbsdbw"] = { - graphic = fbsd_logo_v, - shift = {x = 5, y = 4}, - }, - ["orb"] = { - requires_color = true, - graphic = orb_color, - shift = {x = 2, y = 4}, - }, - ["orbbw"] = { - graphic = orb, - shift = {x = 2, y = 4}, - }, ["tribute"] = { - graphic = fbsd_logo, + graphic = fbsd_brand, }, ["tributebw"] = { - graphic = fbsd_logo, + graphic = fbsd_brand, }, ["none"] = { graphic = none, @@ -413,10 +312,8 @@ function drawer.drawbrand() local y = tonumber(loader.getenv("loader_brand_y")) or drawer.brand_position.y - local graphic = drawer.branddefs[loader.getenv("loader_brand")] - if graphic == nil then - graphic = fbsd_logo - end + local graphic = drawer.branddefs[loader.getenv("loader_brand")] or + fbsd_brand x = x + drawer.shift.x y = y + drawer.shift.y @@ -432,16 +329,15 @@ function drawer.drawlogo() local logo = loader.getenv("loader_logo") local colored = color.isEnabled() - -- Lookup - local logodef = drawer.logodefs[logo] + local logodef = getLogodef(logo) if logodef == nil or logodef.graphic == nil or (not colored and logodef.requires_color) then -- Choose a sensible default if colored then - logodef = drawer.logodefs["orb"] + logodef = getLogodef("orb") else - logodef = drawer.logodefs["orbbw"] + logodef = getLogodef("orbbw") end end Added: head/stand/lua/logo-beastie.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/logo-beastie.lua Sun Apr 1 01:07:15 2018 (r331859) @@ -0,0 +1,60 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +local drawer = require("drawer") + +local beastie_color = { +" \027[31m, ,", +" /( )`", +" \\ \\___ / |", +" /- \027[37m_\027[31m `-/ '", +" (\027[37m/\\/ \\\027[31m \\ /\\", +" \027[37m/ / |\027[31m ` \\", +" \027[34mO O \027[37m) \027[31m/ |", +" \027[37m`-^--'\027[31m`< '", +" (_.) _ ) /", +" `.___/` /", +" `-----' /", +" \027[33m<----.\027[31m __ / __ \\", +" \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", +" \027[33m<----'\027[31m `--' `.__,' \\", +" | |", +" \\ / /\\", +" \027[36m______\027[31m( (_ / \\______/", +" \027[36m,' ,-----' |", +" `--{__________)\027[37m" +} + +drawer.addLogo("beastie", { + requires_color = true, + graphic = beastie_color, +}) + +return true Added: head/stand/lua/logo-beastiebw.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/logo-beastiebw.lua Sun Apr 1 01:07:15 2018 (r331859) @@ -0,0 +1,59 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +local drawer = require("drawer") + +local beastiebw = { +" , ,", +" /( )`", +" \\ \\___ / |", +" /- _ `-/ '", +" (/\\/ \\ \\ /\\", +" / / | ` \\", +" O O ) / |", +" `-^--'`< '", +" (_.) _ ) /", +" `.___/` /", +" `-----' /", +" <----. __ / __ \\", +" <----|====O)))==) \\) /====|", +" <----' `--' `.__,' \\", +" | |", +" \\ / /\\", +" ______( (_ / \\______/", +" ,' ,-----' |", +" `--{__________)" +} + +drawer.addLogo("beastiebw", { + graphic = beastiebw, +}) + +return true Added: head/stand/lua/logo-fbsdbw.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/logo-fbsdbw.lua Sun Apr 1 01:07:15 2018 (r331859) @@ -0,0 +1,54 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +local drawer = require("drawer") + +local fbsd_logo = { +" ______", +" | ____| __ ___ ___ ", +" | |__ | '__/ _ \\/ _ \\", +" | __|| | | __/ __/", +" | | | | | | |", +" |_| |_| \\___|\\___|", +" ____ _____ _____", +" | _ \\ / ____| __ \\", +" | |_) | (___ | | | |", +" | _ < \\___ \\| | | |", +" | |_) |____) | |__| |", +" | | | |", +" |____/|_____/|_____/" +} + +drawer.addLogo("fbsdbw", { + graphic = fbsd_logo, + shift = {x = 5, y = 4}, +}) + +return true Added: head/stand/lua/logo-orb.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/logo-orb.lua Sun Apr 1 01:07:15 2018 (r331859) @@ -0,0 +1,57 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +local drawer = require("drawer") + +local orb_color = { +" \027[31m``` \027[31;1m`\027[31m", +" s` `.....---...\027[31;1m....--.``` -/\027[31m", +" +o .--` \027[31;1m/y:` +.\027[31m", +" yo`:. \027[31;1m:o `+-\027[31m", +" y/ \027[31;1m-/` -o/\027[31m", +" .- \027[31;1m::/sy+:.\027[31m", +" / \027[31;1m`-- /\027[31m", +" `: \027[31;1m:`\027[31m", +" `: \027[31;1m:`\027[31m", +" / \027[31;1m/\027[31m", +" .- \027[31;1m-.\027[31m", +" -- \027[31;1m-.\027[31m", +" `:` \027[31;1m`:`", +" \027[31;1m.-- `--.", +" .---.....----.\027[37m" +} + +drawer.addLogo("orb", { + requires_color = true, + graphic = orb_color, + shift = {x = 2, y = 4}, +}) + +return true Added: head/stand/lua/logo-orbbw.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/lua/logo-orbbw.lua Sun Apr 1 01:07:15 2018 (r331859) @@ -0,0 +1,56 @@ +-- +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright (c) 2018 Kyle Evans +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +local drawer = require("drawer") + +local orbbw = { +" ``` `", +" s` `.....---.......--.``` -/", +" +o .--` /y:` +.", +" yo`:. :o `+-", +" y/ -/` -o/", +" .- ::/sy+:.", +" / `-- /", +" `: :`", +" `: :`", +" / /", +" .- -.", +" -- -.", +" `:` `:`", +" .-- `--.", +" .---.....----." +} + +drawer.addLogo("orbbw", { + graphic = orbbw, + shift = {x = 2, y = 4}, +}) + +return true From owner-svn-src-all@freebsd.org Sun Apr 1 01:21:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD52CF6F782; Sun, 1 Apr 2018 01:21:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9003F81153; Sun, 1 Apr 2018 01:21:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AF1B1FB24; Sun, 1 Apr 2018 01:21:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w311L0Q8052986; Sun, 1 Apr 2018 01:21:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w311L09Y052985; Sun, 1 Apr 2018 01:21:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804010121.w311L09Y052985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 1 Apr 2018 01:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331860 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 01:21:01 -0000 Author: kevans Date: Sun Apr 1 01:21:00 2018 New Revision: 331860 URL: https://svnweb.freebsd.org/changeset/base/331860 Log: lualoader: Don't try to lookup a nil logo Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Apr 1 01:07:15 2018 (r331859) +++ head/stand/lua/drawer.lua Sun Apr 1 01:21:00 2018 (r331860) @@ -52,6 +52,9 @@ local function menuEntryName(drawing_menu, entry) end local function getLogodef(logo) + if logo == nil then + return nil + end -- Look it up local logodef = drawer.logodefs[logo] From owner-svn-src-all@freebsd.org Sun Apr 1 02:27:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50FA0F73941 for ; Sun, 1 Apr 2018 02:27:08 +0000 (UTC) (envelope-from bounce-1968090_HTML-1005741347-71033161-219971-1@bounce.herbalifeindependentdistributormail.com) Received: from mta.herbalifeindependentdistributormail.com (mta.herbalifeindependentdistributormail.com [66.231.82.211]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1ED83716 for ; Sun, 1 Apr 2018 02:27:06 +0000 (UTC) (envelope-from bounce-1968090_HTML-1005741347-71033161-219971-1@bounce.herbalifeindependentdistributormail.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=200608; d=herbalifeindependentdistributormail.com; h=From:Sender:To:Subject:Date:List-Unsubscribe:MIME-Version:List-ID:Message-ID:Content-Type; i=Herbalife@HerbalifeIndependentDistributorMail.com; bh=fFLrkyKzybGy2WQ2Jik+UpXBPrM=; b=NUOXvKKLQL2W9Ub3UDSrTLxrQtafOx0vfj+D09G3f0238RuvpFhHlwKKzepSPqVHnbo58q640NxN MK4eWHn8l9KyVFdVcp65C4rcgMewRzcV4cWnn4L/NAZ89i8WkgQSFIbIB0VWlwgwoOIMU6D0aVwN 64iPNW8ojKX9aBHZKFs= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=200608; d=herbalifeindependentdistributormail.com; b=Tk1Xuji+TgIl81ohD9V6pkzdHuZIFWjyi/cH+7jzTGUmFICuAPk7AA894FABhogGSYN6XoWgCd0X 2uAXje8OxTe3vPnU7y9i+ySOKdSFnUPDrK6gGgFIIkkrUtMHXxJNSEOPOmuLTjRenWdpJSUJKIRo 3AgoPqBmAjt7bayIVqg=; Received: by mta.herbalifeindependentdistributormail.com id ho11nm163hs1 for ; Sat, 31 Mar 2018 20:11:36 -0600 (envelope-from ) From: "ROOSEVELT & MAFE VARGAS" Sender: "Herbalife Independent Distributor" To: Subject: 44% off in any Herbalife order - only 2 hours more! act now Date: Sat, 31 Mar 2018 20:11:36 -0600 MIME-Version: 1.0 X-CSA-Complaints: whitelistcomplaints@eco.de x-job: 219971_71033161 Message-ID: <1f4af7fb-2c22-483e-92be-4b1bccf88f38@xtinmta1141.xt.local> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2018 02:27:08 -0000
BUY HERBALIFE , ANY ORDER OF  $150 OR MORE
TONIGH AT 44%OFF USE COUPON "ENDOFMONTH"
SHOP NOW
To view this email as a web page, click http://view.herbalifeindependentdistributormail.com/?qs=94a56eba7d217fb28e62bcb66b8cc9de52751e42baeb2e6dde4d2f1158e1d74842862ed61e401cf0a43208d904d9b8e3e8203c48da34e1eae188d5ee90ee22c70e8a9a801ac62ca34080081bb8e1ebb945e635ecca2b722b here. If you do not wish to receive further emails from this person, please https://www.myherbalife.com/Notifications/OptOut?eu=xhECoTTssCY%3d&mi=bQQrToPAuWU%3d Unsubscribe or copy and paste the following link into your browser: https://www.myherbalife.com/Notifications/OptOut?eu=xhECoTTssCY%3d&mi=bQQrToPAuWU%3d This email was sent by: www.Herbalvida 2152 Whisper Lakes Blvd Orlando, FL, 32837, US From owner-svn-src-all@freebsd.org Sun Apr 1 04:50:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41662F7B77E; Sun, 1 Apr 2018 04:50:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E500D68FBC; Sun, 1 Apr 2018 04:50:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0ED8220E4; Sun, 1 Apr 2018 04:50:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w314o5hP061951; Sun, 1 Apr 2018 04:50:05 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w314o5s2061947; Sun, 1 Apr 2018 04:50:05 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201804010450.w314o5s2061947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 1 Apr 2018 04:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331863 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 04:50:06 -0000 Author: jeff Date: Sun Apr 1 04:50:05 2018 New Revision: 331863 URL: https://svnweb.freebsd.org/changeset/base/331863 Log: Add a uma cache of free pages in the DEFAULT freepool. This gives us per-cpu alloc and free of pages. The cache is filled with as few trips to the phys allocator as possible by the use of a new vm_phys_alloc_npages() function which allocates as many as N pages. This code was originally by markj with the import function rewritten by me. Reviewed by: markj, kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14905 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_pagequeue.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Apr 1 04:47:05 2018 (r331862) +++ head/sys/vm/vm_page.c Sun Apr 1 04:50:05 2018 (r331863) @@ -186,6 +186,9 @@ static int vm_page_reclaim_run(int req_class, int doma vm_page_t m_run, vm_paddr_t high); static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, int req); +static int vm_page_import(void *arg, void **store, int cnt, int domain, + int flags); +static void vm_page_release(void *arg, void **store, int cnt); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); @@ -199,6 +202,32 @@ vm_page_init(void *dummy) VM_ALLOC_NORMAL | VM_ALLOC_WIRED); } +/* + * The cache page zone is initialized later since we need to be able to allocate + * pages before UMA is fully initialized. + */ +static void +vm_page_init_cache_zones(void *dummy __unused) +{ + struct vm_domain *vmd; + int i; + + for (i = 0; i < vm_ndomains; i++) { + vmd = VM_DOMAIN(i); + /* + * Don't allow the page cache to take up more than .25% of + * memory. + */ + if (vmd->vmd_page_count / 400 < 256 * mp_ncpus) + continue; + vmd->vmd_pgcache = uma_zcache_create("vm pgcache", + sizeof(struct vm_page), NULL, NULL, NULL, NULL, + vm_page_import, vm_page_release, vmd, + UMA_ZONE_NOBUCKETCACHE | UMA_ZONE_MAXBUCKET | UMA_ZONE_VM); + } +} +SYSINIT(vm_page2, SI_SUB_VM_CONF, SI_ORDER_ANY, vm_page_init_cache_zones, NULL); + /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */ #if PAGE_SIZE == 32768 #ifdef CTASSERT @@ -1753,6 +1782,11 @@ again: } #endif vmd = VM_DOMAIN(domain); + if (object != NULL && vmd->vmd_pgcache != NULL) { + m = uma_zalloc(vmd->vmd_pgcache, M_NOWAIT); + if (m != NULL) + goto found; + } if (vm_domain_allocate(vmd, req, 1)) { /* * If not, allocate it from the free page queues. @@ -1783,9 +1817,7 @@ again: */ KASSERT(m != NULL, ("missing page")); -#if VM_NRESERVLEVEL > 0 found: -#endif vm_page_alloc_check(m); /* @@ -2150,6 +2182,52 @@ again: return (m); } +static int +vm_page_import(void *arg, void **store, int cnt, int domain, int flags) +{ + struct vm_domain *vmd; + vm_page_t m; + int i, j, n; + + vmd = arg; + /* Only import if we can bring in a full bucket. */ + if (cnt == 1 || !vm_domain_allocate(vmd, VM_ALLOC_NORMAL, cnt)) + return (0); + domain = vmd->vmd_domain; + n = 64; /* Starting stride, arbitrary. */ + vm_domain_free_lock(vmd); + for (i = 0; i < cnt; i+=n) { + n = vm_phys_alloc_npages(domain, VM_FREELIST_DEFAULT, &m, + MIN(n, cnt-i)); + if (n == 0) + break; + for (j = 0; j < n; j++) + store[i+j] = m++; + } + vm_domain_free_unlock(vmd); + if (cnt != i) + vm_domain_freecnt_inc(vmd, cnt - i); + + return (i); +} + +static void +vm_page_release(void *arg, void **store, int cnt) +{ + struct vm_domain *vmd; + vm_page_t m; + int i; + + vmd = arg; + vm_domain_free_lock(vmd); + for (i = 0; i < cnt; i++) { + m = (vm_page_t)store[i]; + vm_phys_free_pages(m, 0); + } + vm_domain_free_unlock(vmd); + vm_domain_freecnt_inc(vmd, cnt); +} + #define VPSC_ANY 0 /* No restrictions. */ #define VPSC_NORESERV 1 /* Skip reservations; implies VPSC_NOSUPER. */ #define VPSC_NOSUPER 2 /* Skip superpages. */ @@ -3222,7 +3300,12 @@ vm_page_free_toq(vm_page_t m) if (!vm_page_free_prep(m, false)) return; + vmd = vm_pagequeue_domain(m); + if (m->pool == VM_FREEPOOL_DEFAULT && vmd->vmd_pgcache != NULL) { + uma_zfree(vmd->vmd_pgcache, m); + return; + } vm_domain_free_lock(vmd); vm_phys_free_pages(m, 0); vm_domain_free_unlock(vmd); @@ -3243,22 +3326,17 @@ void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) { vm_page_t m; - struct pglist pgl; int count; if (SLIST_EMPTY(free)) return; count = 0; - TAILQ_INIT(&pgl); while ((m = SLIST_FIRST(free)) != NULL) { count++; SLIST_REMOVE_HEAD(free, plinks.s.ss); - if (vm_page_free_prep(m, false)) - TAILQ_INSERT_TAIL(&pgl, m, listq); + vm_page_free_toq(m); } - - vm_page_free_phys_pglist(&pgl); if (update_wire_count) vm_wire_sub(count); Modified: head/sys/vm/vm_pagequeue.h ============================================================================== --- head/sys/vm/vm_pagequeue.h Sun Apr 1 04:47:05 2018 (r331862) +++ head/sys/vm/vm_pagequeue.h Sun Apr 1 04:50:05 2018 (r331863) @@ -74,6 +74,7 @@ struct vm_pagequeue { } __aligned(CACHE_LINE_SIZE); #include +#include struct sysctl_oid; /* @@ -92,6 +93,7 @@ struct vm_domain { struct vm_pagequeue vmd_pagequeues[PQ_COUNT]; struct mtx_padalign vmd_free_mtx; struct mtx_padalign vmd_pageout_mtx; + uma_zone_t vmd_pgcache; /* (c) page free cache. */ struct vmem *vmd_kernel_arena; /* (c) per-domain kva arena. */ u_int vmd_domain; /* (c) Domain number. */ u_int vmd_page_count; /* (c) Total page count. */ Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sun Apr 1 04:47:05 2018 (r331862) +++ head/sys/vm/vm_phys.c Sun Apr 1 04:50:05 2018 (r331863) @@ -624,6 +624,26 @@ vm_phys_alloc_pages(int domain, int pool, int order) return (NULL); } +int +vm_phys_alloc_npages(int domain, int pool, vm_page_t *mp, int cnt) +{ + vm_page_t m; + int order, freelist; + + for (freelist = 0; freelist < VM_NFREELIST; freelist++) { + for (order = fls(cnt) -1; order >= 0; order--) { + m = vm_phys_alloc_freelist_pages(domain, freelist, + pool, order); + if (m != NULL) { + *mp = m; + return (1 << order); + } + } + } + *mp = NULL; + return (0); +} + /* * Allocate a contiguous, power of two-sized set of physical pages from the * specified free list. The free list must be specified using one of the Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Sun Apr 1 04:47:05 2018 (r331862) +++ head/sys/vm/vm_phys.h Sun Apr 1 04:50:05 2018 (r331863) @@ -78,6 +78,7 @@ vm_page_t vm_phys_alloc_contig(int domain, u_long npag vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); +int vm_phys_alloc_npages(int domain, int pool, vm_page_t *m, int cnt); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); From owner-svn-src-all@freebsd.org Sun Apr 1 04:47:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82AACF7B5FE; Sun, 1 Apr 2018 04:47:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36E5D68E57; Sun, 1 Apr 2018 04:47:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31AFC220DD; Sun, 1 Apr 2018 04:47:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w314l5JX061724; Sun, 1 Apr 2018 04:47:05 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w314l5oV061722; Sun, 1 Apr 2018 04:47:05 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201804010447.w314l5oV061722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 1 Apr 2018 04:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331862 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 04:47:06 -0000 Author: jeff Date: Sun Apr 1 04:47:05 2018 New Revision: 331862 URL: https://svnweb.freebsd.org/changeset/base/331862 Log: Add the flag ZONE_NOBUCKETCACHE. This flag instructions UMA not to keep a cache of fully populated buckets. This will be used in a follow-on commit. The flag idea was originally from markj. Reviewed by: markj, kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sun Apr 1 04:11:38 2018 (r331861) +++ head/sys/vm/uma.h Sun Apr 1 04:47:05 2018 (r331862) @@ -286,6 +286,10 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * NUMA aware Zone. Implements a best * effort first-touch policy. */ +#define UMA_ZONE_NOBUCKETCACHE 0x20000 /* + * Don't cache full buckets. Limit + * UMA to per-cpu state. + */ /* * These flags are shared between the keg and zone. In zones wishing to add Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Apr 1 04:11:38 2018 (r331861) +++ head/sys/vm/uma_core.c Sun Apr 1 04:47:05 2018 (r331862) @@ -2965,7 +2965,13 @@ zfree_start: /* ub_cnt is pointing to the last free item */ KASSERT(bucket->ub_cnt != 0, ("uma_zfree: Attempting to insert an empty bucket onto the full list.\n")); - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) { + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + goto zfree_restart; + } else + LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); } /* From owner-svn-src-all@freebsd.org Sun Apr 1 15:21:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB3A3F54534; Sun, 1 Apr 2018 15:21:33 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay109.isp.belgacom.be (mailrelay109.isp.belgacom.be [195.238.20.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E255670BEE; Sun, 1 Apr 2018 15:21:32 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3A0wNu8xb3wnBflsk9nNoXYbT/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZrsWybnLW6fgltlLVR4KTs6sC17KN9fi4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQpFiCazbL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+?= =?us-ascii?q?RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPC?= =?us-ascii?q?TQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhz?= =?us-ascii?q?sGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJWSJPAp2y?= =?us-ascii?q?YZYMAeUDM+ZXoJXyqVQVoBuiBwSgGP/jxiNUinPo26AxzuQvERvB3AwlB98Arn?= =?us-ascii?q?XUrNfxNKwPT+21y67IzS7dYPNTwzj97pPIeQ0mrPGQXLJwc87RxFIvGQPfkFqf?= =?us-ascii?q?t5HoMS6b2OgXtGib9eVgWPuphmU6pQ9xpT2vyd0tionPno8VxErE+jtnz4kuPt?= =?us-ascii?q?23VVR3Ydm+EJtfsSyRKoh4Qts6TmxrpSo20KMKtJGmcCQQ1pgr2wDTZ+aaf4WI?= =?us-ascii?q?7B/uUvuaLy1ii3J/Yr2/gg6/8U2nyuLhSMa5yE1Kri9ZktnUsXANygDT5tCHSv?= =?us-ascii?q?Rj+keh3i6C1wPJ5eFAIEA0kLTUK4QmwrIqipoTsEbDHivslErqi6+WcV4k9fat?= =?us-ascii?q?6+v9ZLXmvYWQN4huigHxKqgum8q/DvokMgUWXGWX5P6w2KPs8EHkWrlGkOE6nr?= =?us-ascii?q?fDvJzHJckWqLa1AwpP3YYi7xa/AS2m0NMdnXQfMFJFeRCHj4zyNlHAOvD3E+mw?= =?us-ascii?q?jE+3kDh23fzGOafhAprVInjZjLjhZap961JbyAcr1tBf+ZRUBqgaIPLpRkD9rd?= =?us-ascii?q?zYAQEjPAOp2OvnBs992Z0AVm2UGa+WLbnesViS5uIgO+OMfpMauC7hK/g54P7j?= =?us-ascii?q?lWQ5mUEbfaWwxpsXcmy3Eu18LEWdZXrhmdkBEX0UsQUgV+Pqk0CNXSRUZ3aoUK?= =?us-ascii?q?I2/is7B56+DYffWoCth6SM3DyhHpJKf2xJFleMEXLtd4WFR/cMdDydItV6kjEf?= =?us-ascii?q?W7ihUZEu2g+1uw/h1rVrNO3U+jcXtZj7zth6+/XTlQ0u9TxzF8md1nuCT3t3nm?= =?us-ascii?q?MKXDI20rp/rlJjxViYyqh3nuZUFdtJ5/NGAU8GMsv5xvZ5Q/L1WgTaYtCPAAKj?= =?us-ascii?q?S8+lAxkfVN886eQiJUFnFIPxoArE2n+WAr0R35eMA4c596vaxDClO8d/z17ozq?= =?us-ascii?q?QspWIKBMxVOjv11eZE6wHPCtuRwA2inKGwePFZhXaV+Q=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AlCgBH+MBa/5nK8VFcFgYBAQEEAQEKA?= =?us-ascii?q?QGDQlMObxUTjDqMIgEBgXMxAV2SU4F6LoRhAoQkIjUXAQIBAQEBAQECAWoogjc?= =?us-ascii?q?kAYJIAQEBAwEnExwjBQsLFAQJJQ8qHgYThQUMC7AFM4g6giYFiXSDXDSKQwKXO?= =?us-ascii?q?giFUYhSZYtdiRWIDR4DM4FSTTAIgn2QTz0wjX4BAQ?= X-IPAS-Result: =?us-ascii?q?A2AlCgBH+MBa/5nK8VFcFgYBAQEEAQEKAQGDQlMObxUTjDq?= =?us-ascii?q?MIgEBgXMxAV2SU4F6LoRhAoQkIjUXAQIBAQEBAQECAWoogjckAYJIAQEBAwEnE?= =?us-ascii?q?xwjBQsLFAQJJQ8qHgYThQUMC7AFM4g6giYFiXSDXDSKQwKXOgiFUYhSZYtdiRW?= =?us-ascii?q?IDR4DM4FSTTAIgn2QTz0wjX4BAQ?= Received: from 153.202-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.202.153]) by relay.skynet.be with ESMTP; 01 Apr 2018 17:20:22 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w31FKMBb001214; Sun, 1 Apr 2018 17:20:22 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sun, 1 Apr 2018 17:20:21 +0200 From: Tijl Coosemans To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331732 - head/sys/vm Message-ID: <20180401172021.27852803@kalimero.tijl.coosemans.org> In-Reply-To: <20180331225432.GB1440@raichu> References: <201803291427.w2TEReA3024929@repo.freebsd.org> <20180331202118.5401ed2a@kalimero.tijl.coosemans.org> <20180331225432.GB1440@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2018 15:21:33 -0000 On Sat, 31 Mar 2018 18:54:32 -0400 Mark Johnston wrote: > On Sat, Mar 31, 2018 at 08:21:18PM +0200, Tijl Coosemans wrote: > > On Thu, 29 Mar 2018 14:27:40 +0000 (UTC) Mark Johnston wrote: > > > Author: markj > > > Date: Thu Mar 29 14:27:40 2018 > > > New Revision: 331732 > > > URL: https://svnweb.freebsd.org/changeset/base/331732 > > > > > > Log: > > > Fix the background laundering mechanism after r329882. > > > > > > Rather than using the number of inactive queue scans as a metric for > > > how many clean pages are being freed by the page daemon, have the > > > page daemon keep a running counter of the number of pages it has freed, > > > and have the laundry thread use that when computing the background > > > laundering threshold. > > > [...] > > > > I'm seeing big processes being killed with an "out of swap space" message > > even though there's still plenty of swap available. It seems to be fixed > > by making this division round upwards: > > > > if (target == 0 && ndirty * isqrt((nfreed + > > (vmd->vmd_free_target - vmd->vmd_free_min) - 1) / > > (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { > > > > I don't know where this formula comes from, so I don't know if this > > change is correct. > > Hm, that's somewhat surprising. This code shouldn't be executing in > situations where the OOM kill logic is invoked (i.e., memory pressure > plus a shortage of clean pages in the inactive queue). > > How much RAM does the system have? Could you collect "sysctl vm" output > around the time of an OOM kill? 1GiB RAM. I've sampled sysctl vm every 5s from the moment the process starts swapping until it is killed and uploaded that to https://people.freebsd.org/~tijl/sysctl/ > I'm wondering if the higher inactive queue scan frequency after r329882 > might be responsible: OOM kills are performed after vm.pageout_oom_seq > back-to-back scans fail to reclaim any pages. Does your problem persist > if you increase the value of that sysctl, say to 60? This didn't help. From owner-svn-src-all@freebsd.org Sun Apr 1 16:27:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D553FF6B161; Sun, 1 Apr 2018 16:27:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6932273154; Sun, 1 Apr 2018 16:27:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x22f.google.com with SMTP id z7-v6so6056035iti.1; Sun, 01 Apr 2018 09:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Vf8ECtNNzS7niZZwchCI2WHgQiiVRqlPExyjlatX878=; b=SAFHR4PNGWQSwYEeDmD+HG6RyMv0aqTCglkPe7WQD2AQp+xWDe2IG1GF4cAhxjmFM8 DRJJzfqQmQv0/4IFVFizIh81VVKyUq9wwc3v5SBmhFZGkFuvyi7zvsJDzGRnugEY0HmF ioVWSu4JclDN+6DgDwOEA6Ps6nEtNoNAIGQj9WV/g/qmpnFUo8+YKHqjMKNetjmTEu7L jukMy4EbeQiQSchDCoij9FtGaf3NfbdSeqYsZ66GZ3rzO3MpAc2GXIkSljt+fnK74sEV sDCTBarzvNDn/cUwBR3BqhuHZQDkRknh05dWpX7sUEYmSDAutmD8w6FV+8759nk+++Uo rtsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Vf8ECtNNzS7niZZwchCI2WHgQiiVRqlPExyjlatX878=; b=pbpEQXN7FV2XgWGxzUfD9oqFgN+fqEI6cGftSxooGQacU0a8x9jrZ5+zomnkCFkpPw +8nIvkZbDk0LI4p5F4oVZD3V9+PEdul5ZmLA2g0lfcOsWBj3jOH1mj9wnMQK9YCgBJ13 OVru4MHpKHL+a9fIq9DZC1t+GWCDpdIWWmbgPT4yJUDb5tuY0icJ1oNkWpsp6vo3P5qt hnsRykpk4smZA8btb9ertFv/b6VRQ/Vn/431wADg8SbbzhnbTC8lf1yqP9nKg4PHpCrV 1ETx+8Fl0YHk+KJmRrGghiW2svhU6yXvjfAAdddzjjAG4blt6cRGbSVAYrqR4WzYwu+W UrNQ== X-Gm-Message-State: AElRT7HOQNUsdN+o4j3yKzaZ3kcoDd73454MibyDToDpripu7ZzAv2ue 7fg3lUs/SaaRSm2gFf9Su3B5tQ== X-Google-Smtp-Source: AIpwx4+RWKXISgA6Cn6b6jjsG4ahtUWWjrRGxQvUb7e1KblfXrh5y4FDGpaoJmm9MBywQKSmtKCx8g== X-Received: by 2002:a24:7f46:: with SMTP id r67-v6mr9489409itc.127.1522600026347; Sun, 01 Apr 2018 09:27:06 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-76-83.dsl.bell.ca. [174.88.76.83]) by smtp.gmail.com with ESMTPSA id l7sm7053993ioe.50.2018.04.01.09.27.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Apr 2018 09:27:05 -0700 (PDT) Sender: Mark Johnston Date: Sun, 1 Apr 2018 12:27:03 -0400 From: Mark Johnston To: Tijl Coosemans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331732 - head/sys/vm Message-ID: <20180401162703.GD1440@raichu> References: <201803291427.w2TEReA3024929@repo.freebsd.org> <20180331202118.5401ed2a@kalimero.tijl.coosemans.org> <20180331225432.GB1440@raichu> <20180401172021.27852803@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180401172021.27852803@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 16:27:08 -0000 On Sun, Apr 01, 2018 at 05:20:21PM +0200, Tijl Coosemans wrote: > On Sat, 31 Mar 2018 18:54:32 -0400 Mark Johnston wrote: > > On Sat, Mar 31, 2018 at 08:21:18PM +0200, Tijl Coosemans wrote: > > > On Thu, 29 Mar 2018 14:27:40 +0000 (UTC) Mark Johnston wrote: > > > > Author: markj > > > > Date: Thu Mar 29 14:27:40 2018 > > > > New Revision: 331732 > > > > URL: https://svnweb.freebsd.org/changeset/base/331732 > > > > > > > > Log: > > > > Fix the background laundering mechanism after r329882. > > > > > > > > Rather than using the number of inactive queue scans as a metric for > > > > how many clean pages are being freed by the page daemon, have the > > > > page daemon keep a running counter of the number of pages it has freed, > > > > and have the laundry thread use that when computing the background > > > > laundering threshold. > > > > [...] > > > > > > I'm seeing big processes being killed with an "out of swap space" message > > > even though there's still plenty of swap available. It seems to be fixed > > > by making this division round upwards: > > > > > > if (target == 0 && ndirty * isqrt((nfreed + > > > (vmd->vmd_free_target - vmd->vmd_free_min) - 1) / > > > (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { > > > > > > I don't know where this formula comes from, so I don't know if this > > > change is correct. > > > > Hm, that's somewhat surprising. This code shouldn't be executing in > > situations where the OOM kill logic is invoked (i.e., memory pressure > > plus a shortage of clean pages in the inactive queue). > > > > How much RAM does the system have? Could you collect "sysctl vm" output > > around the time of an OOM kill? > > 1GiB RAM. I've sampled sysctl vm every 5s from the moment the process > starts swapping until it is killed and uploaded that to > https://people.freebsd.org/~tijl/sysctl/ Thank you. Now I agree with your change. Would you like to commit it? I can take care of it if you prefer. There is still a deeper problem here after r329882 in that the shortfall laundering mechanism is not kicking in before the OOM killer. The problem is that the PID controller may produce a positive output even when the error is negative; this is seen in 22.txt, the last capture before the OOM kill. Because the error is negative (i.e., v_free_count > v_free_target), we will not attempt to launder pages in shortfall mode. The positive output means that the page daemon is repeatedly scanning the (completely depleted) inactive queue, but since the laundering mechanism is failing to produce clean pages, there is nothing to reclaim and so we eventually invoke the OOM killer. I'm not yet sure how best to address this, but your change is probably sufficient to mitigate the problem in general and also corrects an unintentional behaviour change in my commit. From owner-svn-src-all@freebsd.org Sun Apr 1 16:42:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 626D1F6C608; Sun, 1 Apr 2018 16:42:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 150F673E76; Sun, 1 Apr 2018 16:42:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F9B3175E; Sun, 1 Apr 2018 16:42:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w31GgDXf037411; Sun, 1 Apr 2018 16:42:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w31GgDXV037410; Sun, 1 Apr 2018 16:42:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804011642.w31GgDXV037410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 1 Apr 2018 16:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331866 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 331866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 16:42:14 -0000 Author: markj Date: Sun Apr 1 16:42:13 2018 New Revision: 331866 URL: https://svnweb.freebsd.org/changeset/base/331866 Log: MFC r317567 (by cem): x86 MCA: Fix a deadlock in MCA exception processing Modified: stable/11/sys/x86/x86/mca.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mca.c ============================================================================== --- stable/11/sys/x86/x86/mca.c Sun Apr 1 07:49:48 2018 (r331865) +++ stable/11/sys/x86/x86/mca.c Sun Apr 1 16:42:13 2018 (r331866) @@ -653,7 +653,7 @@ amd_thresholding_update(enum scan_mode mode, int bank, * count of the number of valid MC records found. */ static int -mca_scan(enum scan_mode mode) +mca_scan(enum scan_mode mode, int *recoverablep) { struct mca_record rec; uint64_t mcg_cap, ucmask; @@ -704,7 +704,9 @@ mca_scan(enum scan_mode mode) } if (mode == POLLED) mca_fill_freelist(); - return (mode == MCE ? recoverable : count); + if (recoverablep != NULL) + *recoverablep = recoverable; + return (count); } /* @@ -726,7 +728,7 @@ mca_scan_cpus(void *context, int pending) CPU_FOREACH(cpu) { sched_bind(td, cpu); thread_unlock(td); - count += mca_scan(POLLED); + count += mca_scan(POLLED, NULL); thread_lock(td); sched_unbind(td); } @@ -1150,7 +1152,7 @@ void mca_intr(void) { uint64_t mcg_status; - int old_count, recoverable; + int recoverable, count; if (!(cpu_feature & CPUID_MCA)) { /* @@ -1164,20 +1166,18 @@ mca_intr(void) } /* Scan the banks and check for any non-recoverable errors. */ - old_count = mca_count; - recoverable = mca_scan(MCE); + count = mca_scan(MCE, &recoverable); mcg_status = rdmsr(MSR_MCG_STATUS); if (!(mcg_status & MCG_STATUS_RIPV)) recoverable = 0; if (!recoverable) { /* - * Wait for at least one error to be logged before - * panic'ing. Some errors will assert a machine check - * on all CPUs, but only certain CPUs will find a valid - * bank to log. + * Only panic if the error was detected local to this CPU. + * Some errors will assert a machine check on all CPUs, but + * only certain CPUs will find a valid bank to log. */ - while (mca_count == old_count) + while (count == 0) cpu_spinwait(); panic("Unrecoverable machine check exception"); @@ -1199,7 +1199,7 @@ cmc_intr(void) * Serialize MCA bank scanning to prevent collisions from * sibling threads. */ - count = mca_scan(CMCI); + count = mca_scan(CMCI, NULL); /* If we found anything, log them to the console. */ if (count != 0) { From owner-svn-src-all@freebsd.org Sun Apr 1 16:43:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B865F6C893; Sun, 1 Apr 2018 16:43:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 014FE74035; Sun, 1 Apr 2018 16:43:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F06A5177A; Sun, 1 Apr 2018 16:43:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w31GhU2J037513; Sun, 1 Apr 2018 16:43:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w31GhU3h037512; Sun, 1 Apr 2018 16:43:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804011643.w31GhU3h037512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 1 Apr 2018 16:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331867 - stable/11/sys/netsmb X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/netsmb X-SVN-Commit-Revision: 331867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 16:43:31 -0000 Author: markj Date: Sun Apr 1 16:43:30 2018 New Revision: 331867 URL: https://svnweb.freebsd.org/changeset/base/331867 Log: MFC r324102 (by cem): netsmb: Fix buggy/racy smb_strdupin() PR: 222687 Modified: stable/11/sys/netsmb/smb_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netsmb/smb_subr.c ============================================================================== --- stable/11/sys/netsmb/smb_subr.c Sun Apr 1 16:42:13 2018 (r331866) +++ stable/11/sys/netsmb/smb_subr.c Sun Apr 1 16:43:30 2018 (r331867) @@ -110,22 +110,11 @@ smb_strdup(const char *s) char * smb_strdupin(char *s, size_t maxlen) { - char *p, bt; + char *p; int error; - size_t len; - len = 0; - for (p = s; ;p++) { - if (copyin(p, &bt, 1)) - return NULL; - len++; - if (maxlen && len > maxlen) - return NULL; - if (bt == 0) - break; - } - p = malloc(len, M_SMBSTR, M_WAITOK); - error = copyin(s, p, len); + p = malloc(maxlen + 1, M_SMBSTR, M_WAITOK); + error = copyinstr(s, p, maxlen + 1, NULL); if (error) { free(p, M_SMBSTR); return (NULL); From owner-svn-src-all@freebsd.org Sun Apr 1 16:47:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C93F6CCCB; Sun, 1 Apr 2018 16:47:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83BEF74243; Sun, 1 Apr 2018 16:47:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id e79so15705396ioi.7; Sun, 01 Apr 2018 09:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=nquRhfarP/58yEdGynEUzJtdfXrRdKyGr07a9XzhQ64=; b=E/lrCtKSd4p32BQtTYFhid31a6aCaubAJnyhc0dyZrUmKL08SYifkvl2xwzd9Ya9jU d8N9kVF3Yc6anwQ1eFJS+7YOGxkKuecyEqFqViy5/7158LnvOhscYr9VO+5JprmjZcZk 4xU9IKxJ7UWH8iQFisHrgAW7tGFt84FaQvq1yOx2HdFL6I2TU3EmFBrcWZK5u5HHD2JE LptwJkp9B6iEbxMV9Kkj+d3OR33TrFvrUFCkJGWPrH8+CMa0AroIb4bvLQw4IoEUe/zM eXpdOjik4hBj+v5ihTKJKECy8PRGOO4hE7b+iS1x0jhH43oauGr6/m8zYY5e49QkbZNM OhOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=nquRhfarP/58yEdGynEUzJtdfXrRdKyGr07a9XzhQ64=; b=axVegnNUTnAZzML8LUaHU++RdyXbSreivAdR12dXVQtFb9nXuInRXhD7CGS96M35Bt vdb+DMVjtwcG/oTV7nlEdtCJurA/CHooUzhnJ25R39TO6penWEaIObtGVm29Bx7KJvcN CXt2rjM0Dm4bS9v4SFpbneZgZTpZt1IdFcfMluomy2lRzFWIrBqs4cWyCb475IP5UyHO NPbFfH/pvKAGak1Jd+Ua5b79htf62qEK00uYJhcbck6joGIqXfoOT8G9dJMIzXgAOKm6 kCMuHIV3ZXdxCAslcRBxtSOrBEwmQZhKghU3tcQb2QGjb+HkWJckynjsFmRHa6Dpypop 56yA== X-Gm-Message-State: ALQs6tDUBfv2ZxBSoki5TRMiNGEdU0T0G1spoLWkmEj5kbo/Wds9huMN Eg5S+b6XaSP7Q7mPh1H9Ogp1YaZ7 X-Google-Smtp-Source: AIpwx4+zcCsnkh3oUoNltxUULO25VDgbJutN+gu5PCTWekHzB3ezthWkdstWcthKemVsIJNOxXlAbg== X-Received: by 10.107.146.67 with SMTP id u64mr5273352iod.144.1522601260745; Sun, 01 Apr 2018 09:47:40 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-76-83.dsl.bell.ca. [174.88.76.83]) by smtp.gmail.com with ESMTPSA id 79-v6sm4429341itm.11.2018.04.01.09.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Apr 2018 09:47:40 -0700 (PDT) Sender: Mark Johnston Date: Sun, 1 Apr 2018 12:47:35 -0400 From: Mark Johnston To: Harry Schmalzbauer Cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, glebius@FreeBSD.org Subject: Re: svn commit: r324508 - head/sys/kern Message-ID: <20180401164726.GA953@raichu> References: <201710102221.v9AML554015782@repo.freebsd.org> <5ABF55FC.6030102@omnilan.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ABF55FC.6030102@omnilan.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 16:47:42 -0000 On Sat, Mar 31, 2018 at 11:33:48AM +0200, Harry Schmalzbauer wrote: > Bezüglich Sean Bruno's Nachricht vom 11.10.2017 00:21 (localtime): > > Author: sbruno > > Date: Tue Oct 10 22:21:05 2017 > > New Revision: 324508 > > URL: https://svnweb.freebsd.org/changeset/base/324508 > > > > Log: > > match sendfile() error handling to send(). > > > > Sendfile() should match the error checking order of send() which > > is currently: > > > > SBS_CANTSENDMORE > > so_error > > SS_ISCONNECTED > > > > Submitted by: Jason Eggleston > > Reviewed by: glebius > > MFC after: 2 weeks > > Sponsored by: Limelight Networks > > Differential Revision: https://reviews.freebsd.org/D12633 > > > > Modified: > > head/sys/kern/kern_sendfile.c > > > > I'm still applying this one locally to stable/11. > Is it going to be MFCd before 11.2? > > There are a view more candidates: > https://svnweb.freebsd.org/base?view=revision&revision=324601 along with > r324448 > https://svnweb.freebsd.org/base?view=revision&revision=327596 > https://svnweb.freebsd.org/base?view=revision&revision=328977 > These were flagged for MFC with expired defer time. > And tomorrow this one was supposed to be MFCd also: > https://svnweb.freebsd.org/base?view=revision&revision=331130 I think r324446 and r324448 need to be MFCed before most of these can go in. I MFCed the other commits (r317567, r324508) that you asked about in other threads. From owner-svn-src-all@freebsd.org Sun Apr 1 16:53:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C713F6D400; Sun, 1 Apr 2018 16:53:22 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay108.isp.belgacom.be (mailrelay108.isp.belgacom.be [195.238.20.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4FC74738; Sun, 1 Apr 2018 16:53:20 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AMn70IRQ8VBISfbMnBBoSsEyaY9psv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa6zbRyN2/xhgRfzUJnB7Loc0qyK6/umATRIyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+?= =?us-ascii?q?KPjrFY7OlcS30P2594HObwlSizexfb1/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf?= =?us-ascii?q?5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbD?= =?us-ascii?q?VwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4rx1QxH0li?= =?us-ascii?q?gIKz858HnWisNuiqJbvAmhrAF7z4LNfY2ZKOZycqbbcNgHR2ROQ9xRWjRPDI28?= =?us-ascii?q?cYUBEukPMuRWr4byu1QAogCzBRWuCe/z1jNEmmP60bM83u88EQ/GxgsgH9cWvX?= =?us-ascii?q?rKrdX1NqMSWv2rwanPyjXDdO1Z2TLn54jOaRAqvPaBXa5xccrTzUkiDAPLjk+O?= =?us-ascii?q?poP7Ij6by+oDv3Kc7+p6WuKikmgqoBx/rDiow8cjkIjJhoQNx1DK7yV23pg6Ks?= =?us-ascii?q?ajSEFme9KkF4FQty6cOoBrQc0iW3lltSUnxrEcp5K2czUGxI45yxLDdfCLaZWE?= =?us-ascii?q?7xLtWeuXPDx2nmhqeKiliBa36UWgz+r8WdSq31tStSpFl8XMtmgK1xzO9siLUv?= =?us-ascii?q?t98Vml2TaIzw3T6ftLIUQ1lareNZEh2LkwmoAPsUTCHC/2nF/6g7ORdkUj4ein?= =?us-ascii?q?9eHnba/gpp+HLYN0jRv+Mqs2lsy+B+Q3LBQOUnCY9OihzrHv40L0TKhQgvEojq?= =?us-ascii?q?XVrorWKdkbq6O3GwNV15ws6xe7DzeoytQYmnwHIUpZeBKGjYjpP0rDIP7iDfih?= =?us-ascii?q?nVujiyxryO3cMr3mGJXNIWDPkK39crZl905c1A0zwMhE55JKDLENOenzWlXtu9?= =?us-ascii?q?DBDh82LRa7zPv8BdVzzIMRR3yADbSCMKzPq1OI4fgvI+aUbo8PpDn9M+Ql5+Lp?= =?us-ascii?q?jXIhgl8dY6+p0YIMaHCiAvtqOl+WYX7ogtoaH2cKpBQxQ/Lxh12ZTDFffXGyX7?= =?us-ascii?q?gz5jsjEoKpEZ/DRpyxgLyGxCq7BYdWaXxfBl+QFnfocoCEW/YQaCKOPMBhiCcE?= =?us-ascii?q?WKOvS487yx6hqhT1y6F6IebO/S0Yr53j3sBv5+LPjREy6SB0D8OF3mGIVW50hG?= =?us-ascii?q?AIRz0t0aBxu0xy1EmM3rNjg/NFD9BT4OlJUghpfaLbmslzEdO6eAXBeMyVT1Du?= =?us-ascii?q?FtCvGzIzZvwrztIkWGo7HM+t2EPtxS2vVoMUlbjDL5sz6a/Z1n7qb5JhynTC/I?= =?us-ascii?q?c7glQMeecJMnep0P0svzPPDpLExh3K352hcr4RiWuUrD+O?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CcCADXDMFa/5nK8VFdFgYBAQEEAQEKA?= =?us-ascii?q?QGDQlMObxUTjDqMIgEBgXMxAV2SU4F6LoRhAoQkIjYWAQIBAQEBAQECAWoogjc?= =?us-ascii?q?kAYJJAQUnExwjEAsUBAklDyoeBhOFEQuwKDOIOoImBYl0gxRINIpDApc6CIVRi?= =?us-ascii?q?FJlVoNZhy6JFYgNIwEwgVJNMAiCfZBPPTCOAAEB?= X-IPAS-Result: =?us-ascii?q?A2CcCADXDMFa/5nK8VFdFgYBAQEEAQEKAQGDQlMObxUTjDq?= =?us-ascii?q?MIgEBgXMxAV2SU4F6LoRhAoQkIjYWAQIBAQEBAQECAWoogjckAYJJAQUnExwjE?= =?us-ascii?q?AsUBAklDyoeBhOFEQuwKDOIOoImBYl0gxRINIpDApc6CIVRiFJlVoNZhy6JFYg?= =?us-ascii?q?NIwEwgVJNMAiCfZBPPTCOAAEB?= Received: from 153.202-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.202.153]) by relay.skynet.be with ESMTP; 01 Apr 2018 18:52:10 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w31GqA15001530; Sun, 1 Apr 2018 18:52:10 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sun, 1 Apr 2018 18:52:09 +0200 From: Tijl Coosemans To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331732 - head/sys/vm Message-ID: <20180401185209.17f65d95@kalimero.tijl.coosemans.org> In-Reply-To: <20180401162703.GD1440@raichu> References: <201803291427.w2TEReA3024929@repo.freebsd.org> <20180331202118.5401ed2a@kalimero.tijl.coosemans.org> <20180331225432.GB1440@raichu> <20180401172021.27852803@kalimero.tijl.coosemans.org> <20180401162703.GD1440@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2018 16:53:22 -0000 On Sun, 1 Apr 2018 12:27:03 -0400 Mark Johnston wrote: > On Sun, Apr 01, 2018 at 05:20:21PM +0200, Tijl Coosemans wrote: >> On Sat, 31 Mar 2018 18:54:32 -0400 Mark Johnston wrote: >>> On Sat, Mar 31, 2018 at 08:21:18PM +0200, Tijl Coosemans wrote: >>>> On Thu, 29 Mar 2018 14:27:40 +0000 (UTC) Mark Johnston wrote: >>>>> Author: markj >>>>> Date: Thu Mar 29 14:27:40 2018 >>>>> New Revision: 331732 >>>>> URL: https://svnweb.freebsd.org/changeset/base/331732 >>>>> >>>>> Log: >>>>> Fix the background laundering mechanism after r329882. >>>>> >>>>> Rather than using the number of inactive queue scans as a metric for >>>>> how many clean pages are being freed by the page daemon, have the >>>>> page daemon keep a running counter of the number of pages it has freed, >>>>> and have the laundry thread use that when computing the background >>>>> laundering threshold. >>>>> [...] >>>> >>>> I'm seeing big processes being killed with an "out of swap space" message >>>> even though there's still plenty of swap available. It seems to be fixed >>>> by making this division round upwards: >>>> >>>> if (target == 0 && ndirty * isqrt((nfreed + >>>> (vmd->vmd_free_target - vmd->vmd_free_min) - 1) / >>>> (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { >>>> >>>> I don't know where this formula comes from, so I don't know if this >>>> change is correct. >>> >>> Hm, that's somewhat surprising. This code shouldn't be executing in >>> situations where the OOM kill logic is invoked (i.e., memory pressure >>> plus a shortage of clean pages in the inactive queue). >>> >>> How much RAM does the system have? Could you collect "sysctl vm" output >>> around the time of an OOM kill? >> >> 1GiB RAM. I've sampled sysctl vm every 5s from the moment the process >> starts swapping until it is killed and uploaded that to >> https://people.freebsd.org/~tijl/sysctl/ > > Thank you. Now I agree with your change. Would you like to commit it? > I can take care of it if you prefer. Please go ahead. You can probably write a better commit log. From owner-svn-src-all@freebsd.org Sun Apr 1 18:22:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E073F72C3D; Sun, 1 Apr 2018 18:22:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2B0477D68; Sun, 1 Apr 2018 18:22:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C46FF27DF; Sun, 1 Apr 2018 18:22:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w31IMO0X085506; Sun, 1 Apr 2018 18:22:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w31IMOeI085501; Sun, 1 Apr 2018 18:22:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804011822.w31IMOeI085501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 1 Apr 2018 18:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331868 - in head/sys/modules: i2c/iicbus i2c/isl spi/at45d spi/mx25l spi/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules: i2c/iicbus i2c/isl spi/at45d spi/mx25l spi/spibus X-SVN-Commit-Revision: 331868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 18:22:25 -0000 Author: ian Date: Sun Apr 1 18:22:24 2018 New Revision: 331868 URL: https://svnweb.freebsd.org/changeset/base/331868 Log: Add opt_platform.h for several modules that have #ifdef FDT in the source. Submitted by: Andre Albsmeier Modified: head/sys/modules/i2c/iicbus/Makefile head/sys/modules/i2c/isl/Makefile head/sys/modules/spi/at45d/Makefile head/sys/modules/spi/mx25l/Makefile head/sys/modules/spi/spibus/Makefile Modified: head/sys/modules/i2c/iicbus/Makefile ============================================================================== --- head/sys/modules/i2c/iicbus/Makefile Sun Apr 1 16:43:30 2018 (r331867) +++ head/sys/modules/i2c/iicbus/Makefile Sun Apr 1 18:22:24 2018 (r331868) @@ -13,6 +13,7 @@ SRCS= \ iicbus_if.h \ iiconf.c \ iiconf.h \ + opt_platform.h \ .if !empty(OPT_FDT) SRCS+= ofw_iicbus.c ofw_bus_if.h Modified: head/sys/modules/i2c/isl/Makefile ============================================================================== --- head/sys/modules/i2c/isl/Makefile Sun Apr 1 16:43:30 2018 (r331867) +++ head/sys/modules/i2c/isl/Makefile Sun Apr 1 18:22:24 2018 (r331868) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/isl KMOD = isl -SRCS = isl.c device_if.h bus_if.h iicbus_if.h +SRCS = isl.c device_if.h bus_if.h iicbus_if.h opt_platform.h .include Modified: head/sys/modules/spi/at45d/Makefile ============================================================================== --- head/sys/modules/spi/at45d/Makefile Sun Apr 1 16:43:30 2018 (r331867) +++ head/sys/modules/spi/at45d/Makefile Sun Apr 1 18:22:24 2018 (r331868) @@ -9,6 +9,7 @@ SRCS= at45d.c SRCS+= \ bus_if.h \ device_if.h \ + opt_platform.h \ spibus_if.h \ .if !empty(OPT_FDT) Modified: head/sys/modules/spi/mx25l/Makefile ============================================================================== --- head/sys/modules/spi/mx25l/Makefile Sun Apr 1 16:43:30 2018 (r331867) +++ head/sys/modules/spi/mx25l/Makefile Sun Apr 1 18:22:24 2018 (r331868) @@ -9,6 +9,7 @@ SRCS= mx25l.c SRCS+= \ bus_if.h \ device_if.h \ + opt_platform.h \ spibus_if.h \ .if !empty(OPT_FDT) Modified: head/sys/modules/spi/spibus/Makefile ============================================================================== --- head/sys/modules/spi/spibus/Makefile Sun Apr 1 16:43:30 2018 (r331867) +++ head/sys/modules/spi/spibus/Makefile Sun Apr 1 18:22:24 2018 (r331868) @@ -13,6 +13,7 @@ SRCS+= ofw_spibus.c ofw_bus_if.h SRCS+= \ bus_if.h \ device_if.h \ + opt_platform.h \ spibus_if.c \ spibus_if.h \ From owner-svn-src-all@freebsd.org Sun Apr 1 18:53:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F8E0F7476E; Sun, 1 Apr 2018 18:53:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E988378E63; Sun, 1 Apr 2018 18:53:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E46DD2CCC; Sun, 1 Apr 2018 18:53:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w31IrR9D003324; Sun, 1 Apr 2018 18:53:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w31IrR5X003323; Sun, 1 Apr 2018 18:53:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804011853.w31IrR5X003323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 1 Apr 2018 18:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331869 - head/sys/dev/nxge X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/nxge X-SVN-Commit-Revision: 331869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 18:53:28 -0000 Author: ian Date: Sun Apr 1 18:53:27 2018 New Revision: 331869 URL: https://svnweb.freebsd.org/changeset/base/331869 Log: Fix the build on arches with default unsigned char. Capture the fubyte() return value in an int as well as the char, and test the full int value for fubyte() failure. Modified: head/sys/dev/nxge/if_nxge.c Modified: head/sys/dev/nxge/if_nxge.c ============================================================================== --- head/sys/dev/nxge/if_nxge.c Sun Apr 1 18:22:24 2018 (r331868) +++ head/sys/dev/nxge/if_nxge.c Sun Apr 1 18:53:27 2018 (r331869) @@ -1366,12 +1366,13 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre xge_hal_status_e status = XGE_HAL_OK; char cmd, mode; void *info = NULL; - int retValue = EINVAL; + int retValue; - cmd = fubyte(ifr_data_get_ptr(ifreqp)); - if (cmd == -1) + cmd = retValue = fubyte(ifr_data_get_ptr(ifreqp)); + if (retValue == -1) return (EFAULT); + retValue = EINVAL; switch(cmd) { case XGE_QUERY_STATS: mtx_lock(&lldev->mtx_drv); From owner-svn-src-all@freebsd.org Sun Apr 1 19:35:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C989F76C62 for ; Sun, 1 Apr 2018 19:35:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 910B67A3D4 for ; Sun, 1 Apr 2018 19:35:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: e24ccfc7-35e3-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e24ccfc7-35e3-11e8-91c6-33ffc249f3e8; Sun, 01 Apr 2018 19:35:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w31JZjf3076285; Sun, 1 Apr 2018 13:35:45 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1522611345.49673.175.camel@freebsd.org> Subject: Re: svn commit: r327954 - in head/sys: amd64/conf conf dev/acpica vm x86/acpica From: Ian Lepore To: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 01 Apr 2018 13:35:45 -0600 In-Reply-To: <201801140336.w0E3a3xv010728@repo.freebsd.org> References: <201801140336.w0E3a3xv010728@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2018 19:35:53 -0000 On Sun, 2018-01-14 at 03:36 +0000, Jeff Roberson wrote: > Author: jeff > Date: Sun Jan 14 03:36:03 2018 > New Revision: 327954 > URL: https://svnweb.freebsd.org/changeset/base/327954 > > Log: >   Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config > option NUMA. >    >   Sponsored by: Netflix, Dell/EMC Isilon >   Discussed with: jhb It turns out this breaks building powerpc lint kernels. It shakes out like this... makeLINT.mk copies sys/conf/NOTES into the generated LINT config (I guess on the theory that things documented in NOTES are supported by all arches). So option NUMA is present on powerpc, but the powerpc vmparam.h doesn't define VM_LEVEL_0_ORDER so the build fails. (Mips also doesn't define that, but it has no lint kernel build at all right now.) It could be fixed in vm_domainset.c with: -#ifdef NUMA +#if defined(NUMA) && defined(VM_LEVEL_0_ORDER) but there may be some better way to fix it, I don't know that much about this stuff. -- Ian From owner-svn-src-all@freebsd.org Sun Apr 1 22:59:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B39F81C9C; Sun, 1 Apr 2018 22:59:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E057182164; Sun, 1 Apr 2018 22:59:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAE7A57C7; Sun, 1 Apr 2018 22:59:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w31MxrYL024057; Sun, 1 Apr 2018 22:59:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w31MxrCX024055; Sun, 1 Apr 2018 22:59:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804012259.w31MxrCX024055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 1 Apr 2018 22:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331870 - stable/11/sys/dev/ispfw X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ispfw X-SVN-Commit-Revision: 331870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 01 Apr 2018 22:59:54 -0000 Author: mav Date: Sun Apr 1 22:59:53 2018 New Revision: 331870 URL: https://svnweb.freebsd.org/changeset/base/331870 Log: MFC r330292: Update QLogic ISP 24xx/25xx chips firmware to 8.07.00. Modified: stable/11/sys/dev/ispfw/asm_2400.h stable/11/sys/dev/ispfw/asm_2500.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ispfw/asm_2400.h ============================================================================== --- stable/11/sys/dev/ispfw/asm_2400.h Sun Apr 1 18:53:27 2018 (r331869) +++ stable/11/sys/dev/ispfw/asm_2400.h Sun Apr 1 22:59:53 2018 (r331870) @@ -25,23 +25,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Firmware Version 7.03.00 (Apr 14, 2014) + * Firmware Version 8.07.00 (2017) */ #ifdef ISP_2400 static const uint32_t isp_2400_risc_code[] = { - 0x0401f195, 0x00112000, 0x00100000, 0x0000c798, - 0x00000007, 0x00000003, 0x00000000, 0x00009496, + 0x0401f1be, 0x00112000, 0x00100000, 0x0000c79b, + 0x00000008, 0x00000007, 0x00000000, 0x00009496, 0x00000003, 0x00000000, 0x20434f50, 0x59524947, - 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, + 0x48542032, 0x30313720, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32347878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, + 0x56657273, 0x696f6e20, 0x2020382e, 0x30372e30, 0x30202024, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x42001800, 0x0010014c, 0x42002000, 0x0010e36f, + 0x42001800, 0x0010014c, 0x42002000, 0x0010e377, 0x500c0800, 0x800c1800, 0x500c1000, 0x800c1800, 0x54042000, 0x80102000, 0x80040800, 0x80081040, 0x040207fc, 0x500c0800, 0x800409c0, 0x040207f6, @@ -124,759 +124,771 @@ static const uint32_t isp_2400_risc_code[] = { 0x00006150, 0x00000010, 0x00006170, 0x00000010, 0x00006190, 0x00000010, 0x000061b0, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00100000, 0x00100000, 0x0000c798, - 0xffffffff, 0x00112004, 0x00020000, 0x00000c50, - 0xffffffff, 0x00112c54, 0x0010fd00, 0x00001b58, - 0xffffffff, 0x001147ac, 0x0000c000, 0x000008b1, - 0x00ffffff, 0x0011505d, 0x00008000, 0x00000696, + 0x00000000, 0x00100000, 0x00100000, 0x0000c79b, + 0xffffffff, 0x00112004, 0x00020000, 0x00001083, + 0xffffffff, 0x00113087, 0x0010fd00, 0x00001b72, + 0xffffffff, 0x00114bf9, 0x0000c000, 0x000008e2, + 0x00ffffff, 0x001154db, 0x00008000, 0x0000069e, 0x00ffffff, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x4203f000, 0x00021fff, 0x40000000, - 0x4203e000, 0x90000100, 0x40000000, 0x42000800, - 0x00020c51, 0x4202f000, 0x00000000, 0x42000000, - 0x00007023, 0x50000000, 0x8c000500, 0x04020003, - 0x42000800, 0x00020000, 0x45780800, 0x80040800, - 0x82040580, 0x00022000, 0x040207fc, 0x4178a000, - 0x4200a800, 0x0010c798, 0x42000800, 0x0010fd00, - 0x40540000, 0x8004b480, 0x0201f800, 0x0010c5e6, - 0x0401fade, 0x0401fa0a, 0x4803c856, 0x42000000, - 0x00001000, 0x50000000, 0x82000480, 0x24320002, - 0x0402000d, 0x0201f800, 0x0010c62d, 0x04000008, - 0x42000800, 0x00007a17, 0x50040000, 0x8c00050e, - 0x04020003, 0x8400054e, 0x44000800, 0x4a030000, - 0x00000000, 0x4a03c020, 0x00000004, 0x4203e000, - 0x6000000f, 0x4a0370e8, 0x00000003, 0x4a0378e8, - 0x00000003, 0x59e00023, 0x8c000500, 0x04020027, - 0x42002800, 0x0010017d, 0x58140800, 0x4817c857, - 0x4807c857, 0x800409c0, 0x0400000b, 0x58142002, - 0x4813c857, 0x58141003, 0x4c140000, 0x0401faaa, - 0x5c002800, 0x0402002a, 0x82142c00, 0x00000004, - 0x0401f7f2, 0x42002800, 0x0010017d, 0x5814a000, - 0x4817c857, 0x4853c857, 0x8050a1c0, 0x0400000f, - 0x4c140000, 0x5814a801, 0x4857c857, 0x40500000, - 0x80540480, 0x04000005, 0x5814b002, 0x485bc857, - 0x0201f800, 0x0010c5dd, 0x5c002800, 0x82142c00, - 0x00000004, 0x0401f7ee, 0x42002800, 0x0010017d, - 0x58140801, 0x4817c857, 0x4807c857, 0x800409c0, - 0x04000018, 0x58142002, 0x4813c857, 0x58141003, - 0x4c140000, 0x0401fa84, 0x04020005, 0x5c002800, - 0x82142c00, 0x00000004, 0x0401f7f2, 0x4803c856, - 0x4a03c020, 0x00004010, 0x4a03c011, 0x40100011, - 0x04006000, 0x4203e000, 0x40000000, 0x4a03c017, - 0x00000000, 0x4203e000, 0x30000001, 0x0401f000, - 0x4803c856, 0x0201f800, 0x0010fd04, 0x0401fb0b, - 0x4a03c014, 0x001c001c, 0x42002000, 0x00111858, - 0x0201f800, 0x0010c5ee, 0x42000000, 0x00001000, - 0x50000000, 0x82000480, 0x24220001, 0x04000908, + 0x00000000, 0x00000006, 0x00000009, 0x0000000c, + 0x0000000f, 0x00000012, 0x00000000, 0x00000000, + 0x0000000c, 0x00000000, 0x00000000, 0x00000000, + 0x00100199, 0x00100198, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00100199, 0x00100198, + 0x00100195, 0x00100199, 0x00100198, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00100199, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00100199, 0x00100199, + 0x00100199, 0x00000000, 0x00100199, 0x00000000, + 0x00000000, 0x00000000, 0x4203f000, 0x00021fff, + 0x40000000, 0x4203e000, 0x90000100, 0x40000000, + 0x42000800, 0x00021084, 0x4202f000, 0x00000000, + 0x42000000, 0x00007023, 0x50000000, 0x8c000500, + 0x04020003, 0x42000800, 0x00020000, 0x45780800, + 0x80040800, 0x82040580, 0x00022000, 0x040207fc, + 0x4178a000, 0x4200a800, 0x0010c79b, 0x42000800, + 0x0010fd00, 0x40540000, 0x8004b480, 0x0201f800, + 0x0010c5e7, 0x0401fadb, 0x0401fa14, 0x4803c856, 0x42000000, 0x00001000, 0x50000000, 0x82000480, - 0x24320001, 0x04000902, 0x59c40000, 0x82000500, - 0xffff0000, 0x80000120, 0x82000580, 0x00002422, - 0x04020005, 0x59a8007e, 0x84000540, 0x4803507e, - 0x0401f00a, 0x59e00003, 0x82000500, 0x00030000, - 0x82000580, 0x00010000, 0x04020004, 0x59a8007e, - 0x84000542, 0x4803507e, 0x4c140000, 0x0201f800, - 0x0010bd98, 0x5c002800, 0x42000800, 0x00001100, - 0x42001800, 0x00000100, 0x82141480, 0x0017ffff, - 0x0402100d, 0x42000800, 0x00000900, 0x82141480, - 0x0013ffff, 0x04021008, 0x42000800, 0x00000240, - 0x42001800, 0x00000040, 0x82141480, 0x0011ffff, - 0x040018d7, 0x48075013, 0x480f5257, 0x42001000, - 0x0000002c, 0x0201f800, 0x00106fe1, 0x82040c00, - 0x00111d44, 0x4807500b, 0x4a03c810, 0x00100000, - 0x4a03c811, 0x0010c798, 0x4a03c812, 0x0010fd00, - 0x4a03c813, 0x00111857, 0x4a03c829, 0x00000004, - 0x59e40001, 0x82000540, 0x0003403f, 0x4803c801, - 0x42001000, 0x0000001c, 0x0401f9fa, 0x4202c000, - 0x00111d44, 0x59aab00b, 0x59aaa00b, 0x59aaa80b, - 0x59aac813, 0x49675056, 0x59a8000b, 0x4803500c, - 0x0401fadd, 0x0201f800, 0x00108242, 0x0401faed, - 0x0401fb3d, 0x0201f800, 0x00101ab2, 0x0201f800, - 0x0010133c, 0x0201f800, 0x00100691, 0x0201f800, - 0x00100d6b, 0x0201f800, 0x00107023, 0x0401f85c, - 0x0201f800, 0x001022a6, 0x0201f800, 0x0010576d, - 0x0201f800, 0x00104f33, 0x0201f800, 0x00106abc, - 0x0201f800, 0x001067bd, 0x0201f800, 0x001013e1, - 0x0201f800, 0x00101243, 0x4203e000, 0xf0000001, - 0x0201f800, 0x0010c72c, 0x4a03c018, 0x00000000, - 0x4203e000, 0x20000511, 0x4203e000, 0x50010000, - 0x4a03c020, 0x00000000, 0x04027010, 0x59e00020, - 0x82000580, 0x00000002, 0x0402000c, 0x4a03c020, - 0x00004000, 0x4a03c011, 0x40000010, 0x04006000, - 0x4203e000, 0x40000000, 0x4a03c017, 0x00000000, - 0x4203e000, 0x30000001, 0x4202d800, 0x00000000, - 0x4203e000, 0xb0600000, 0x59a80082, 0x4003f800, - 0x0201f000, 0x00020004, 0x4df00000, 0x4203e000, - 0x50000000, 0x416c0000, 0x82000c80, 0x00000008, - 0x0402186b, 0x0c01f804, 0x5c03e000, 0x0201f000, - 0x00020008, 0x001002d2, 0x00111729, 0x001114e2, - 0x001002d1, 0x001114ae, 0x001002d1, 0x001002d1, - 0x001002e4, 0x0401f85e, 0x42000800, 0x0010d115, - 0x5804001e, 0x8c000500, 0x0400000d, 0x84000500, - 0x4800081e, 0x4202d800, 0x00000004, 0x0401f983, - 0x49f3c857, 0x5c000800, 0x5c000000, 0x82000540, - 0x00003e00, 0x4c000000, 0x4c040000, 0x1c01f000, - 0x4a038805, 0x000000f0, 0x1c01f000, 0x4a03504e, - 0x00000007, 0x4a03504f, 0x00000003, 0x4a035050, - 0x00000000, 0x4a035051, 0x00009496, 0x0201f800, - 0x00105706, 0x4a035421, 0x0000ffff, 0x4a035015, - 0x00ffffff, 0x0201f800, 0x00109f94, 0x4a035025, - 0x20200000, 0x4a035026, 0x88000200, 0x4a035027, - 0x00ff001f, 0x4a035028, 0x000007d0, 0x4a035029, - 0x80000000, 0x4a03502a, 0x00000200, 0x4a03502b, - 0x00ff0000, 0x4a03502c, 0x00010000, 0x4a035033, - 0x514c4f47, 0x4a035034, 0x49432020, 0x1c01f000, - 0x4d440000, 0x417a8800, 0x4c5c0000, 0x4178b800, - 0x0201f800, 0x00020353, 0x04020005, 0x0201f800, - 0x00104b75, 0x04020002, 0x805cb800, 0x81468800, - 0x83440580, 0x000007f0, 0x040207f6, 0x405c0800, - 0x5c00b800, 0x5c028800, 0x1c01f000, 0x4803c857, + 0x24320002, 0x0402000d, 0x0201f800, 0x0010c62e, + 0x04000008, 0x42000800, 0x00007a17, 0x50040000, + 0x8c00050e, 0x04020003, 0x8400054e, 0x44000800, + 0x4a030000, 0x00000000, 0x4a03c020, 0x00000004, + 0x4203e000, 0x6000000f, 0x4a0370e8, 0x00000003, + 0x4a0378e8, 0x00000003, 0x59e00023, 0x8c000500, + 0x04020027, 0x42002800, 0x0010017d, 0x58140800, + 0x4817c857, 0x4807c857, 0x800409c0, 0x0400000b, + 0x58142002, 0x4813c857, 0x58141003, 0x4c140000, + 0x0401faa7, 0x5c002800, 0x0402002a, 0x82142c00, + 0x00000004, 0x0401f7f2, 0x42002800, 0x0010017d, + 0x5814a000, 0x4817c857, 0x4853c857, 0x8050a1c0, + 0x0400000f, 0x4c140000, 0x5814a801, 0x4857c857, + 0x40500000, 0x80540480, 0x04000005, 0x5814b002, + 0x485bc857, 0x0201f800, 0x0010c5de, 0x5c002800, + 0x82142c00, 0x00000004, 0x0401f7ee, 0x42002800, + 0x0010017d, 0x58140801, 0x4817c857, 0x4807c857, + 0x800409c0, 0x04000018, 0x58142002, 0x4813c857, + 0x58141003, 0x4c140000, 0x0401fa81, 0x04020005, + 0x5c002800, 0x82142c00, 0x00000004, 0x0401f7f2, + 0x4803c856, 0x4a03c020, 0x00004010, 0x4a03c011, + 0x40100011, 0x04006000, 0x4203e000, 0x40000000, + 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, + 0x0401f000, 0x4803c856, 0x0201f800, 0x0010fd04, + 0x0401fb08, 0x4a03c014, 0x001c001c, 0x42002000, + 0x00111872, 0x0201f800, 0x0010c5ef, 0x42000000, + 0x00001000, 0x50000000, 0x82000480, 0x24220001, + 0x0400090b, 0x42000000, 0x00001000, 0x50000000, + 0x82000480, 0x24320001, 0x04000905, 0x59c40000, + 0x82000500, 0xffff0000, 0x80000120, 0x82000580, + 0x00002422, 0x04020005, 0x59a8007f, 0x84000540, + 0x4803507f, 0x0401f00a, 0x59e00003, 0x82000500, + 0x00030000, 0x82000580, 0x00010000, 0x04020004, + 0x59a8007f, 0x84000542, 0x4803507f, 0x4c140000, + 0x0201f800, 0x0010bd94, 0x5c002800, 0x42000800, + 0x00001100, 0x42001800, 0x00000100, 0x82141480, + 0x0017ffff, 0x0402100d, 0x42000800, 0x00000900, + 0x82141480, 0x0013ffff, 0x04021008, 0x42000800, + 0x00000240, 0x42001800, 0x00000040, 0x82141480, + 0x0011ffff, 0x040018da, 0x48075013, 0x480f5257, + 0x42001000, 0x0000002c, 0x0201f800, 0x00107213, + 0x82040c00, 0x00111d64, 0x4807500b, 0x4a03c810, + 0x00100000, 0x4a03c811, 0x0010c79b, 0x4a03c812, + 0x0010fd00, 0x4a03c813, 0x00111871, 0x4a03c829, + 0x00000004, 0x59e40001, 0x82000540, 0x0003403f, + 0x4803c801, 0x42001000, 0x0000001c, 0x0401f9f7, + 0x4202c000, 0x00111d64, 0x59aab00b, 0x59aaa00b, + 0x59aaa80b, 0x59aac813, 0x49675056, 0x59a8000b, + 0x4803500c, 0x0401fada, 0x0201f800, 0x00108133, + 0x0401faea, 0x0401fb3a, 0x0201f800, 0x00101ad5, + 0x0201f800, 0x0010134e, 0x0201f800, 0x001006b3, + 0x0201f800, 0x00100d9b, 0x0201f800, 0x00107255, + 0x0401f85d, 0x0201f800, 0x001022f2, 0x0201f800, + 0x001058cc, 0x0201f800, 0x00105081, 0x0201f800, + 0x00106ce1, 0x0201f800, 0x001069d7, 0x0201f800, + 0x001013f3, 0x0201f800, 0x00101255, 0x4203e000, + 0xf0000001, 0x0201f800, 0x0010c72f, 0x4a03c018, + 0x00000000, 0x4203e000, 0x20000511, 0x4203e000, + 0x50010000, 0x04006000, 0x4a03c020, 0x00000000, + 0x04027010, 0x59e00020, 0x82000580, 0x00000002, + 0x0402000c, 0x4a03c020, 0x00004000, 0x4a03c011, + 0x40000010, 0x04006000, 0x4203e000, 0x40000000, + 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, + 0x4202d800, 0x00000000, 0x4203e000, 0xb0600000, + 0x59a80083, 0x4003f800, 0x0201f000, 0x00020004, + 0x4df00000, 0x4203e000, 0x50000000, 0x416c0000, + 0x82000c80, 0x00000008, 0x0402186d, 0x0c01f804, + 0x5c03e000, 0x0201f000, 0x00020008, 0x001002fc, + 0x00111743, 0x001114fc, 0x001002fb, 0x001114c8, + 0x001002fb, 0x001002fb, 0x0010030e, 0x0401f860, + 0x42000800, 0x0010d117, 0x5804001e, 0x8c000500, + 0x0400000d, 0x84000500, 0x4800081e, 0x4202d800, + 0x00000004, 0x0401f97f, 0x49f3c857, 0x5c000800, + 0x5c000000, 0x82000540, 0x00003e00, 0x4c000000, + 0x4c040000, 0x1c01f000, 0x4a038805, 0x000000f0, + 0x1c01f000, 0x4a03504e, 0x00000008, 0x4a03504f, + 0x00000007, 0x4a035050, 0x00000000, 0x4a035051, + 0x00009496, 0x0201f800, 0x00105866, 0x4a035421, + 0x0000ffff, 0x4a035015, 0x00ffffff, 0x0201f800, + 0x00109eef, 0x4a035025, 0x20200000, 0x4a035026, + 0x88000200, 0x4a035027, 0x00ff001f, 0x4a035028, + 0x000007d0, 0x4a035029, 0x80000000, 0x4a03502a, + 0x00000200, 0x4a03502b, 0x00ff0000, 0x4a03502c, + 0x00010000, 0x4a035033, 0x514c4f47, 0x4a035034, + 0x49432020, 0x1c01f000, 0x4d340000, 0x4d440000, + 0x417a8800, 0x4c5c0000, 0x4178b800, 0x0201f800, + 0x00020356, 0x04020005, 0x0201f800, 0x00104cb5, + 0x04020002, 0x805cb800, 0x81468800, 0x83440580, + 0x000007f0, 0x040207f6, 0x405c0800, 0x5c00b800, + 0x5c028800, 0x5c026800, 0x1c01f000, 0x4803c857, 0x5c000000, 0x4c000000, 0x4803c857, 0x0401f80c, 0x485fc857, 0x4203e000, 0x50000000, 0x5c000000, - 0x4d780000, 0x4200b800, 0x00008002, 0x0401f009, + 0x4d780000, 0x4200b800, 0x00008002, 0x0401f00a, 0x486bc857, 0x486fc857, 0x4873c857, 0x485fc857, - 0x4203e000, 0x50000000, 0x4200b800, 0x00008002, - 0x04006000, 0x4c000000, 0x4c040000, 0x59bc00ea, - 0x4803c857, 0x82000500, 0x00000007, 0x82000580, - 0x00000001, 0x04020005, 0x42000800, 0x00000000, - 0x0201f800, 0x001071c9, 0x59b800ea, 0x4803c857, - 0x4a0370e8, 0x00000004, 0x5c000800, 0x4807c025, - 0x80040920, 0x4807c026, 0x5c000000, 0x4803c023, - 0x80000120, 0x4803c024, 0x5c000000, 0x4803c857, - 0x4803c021, 0x80000120, 0x4803c022, 0x41f80000, - 0x4803c029, 0x80000120, 0x4803c02a, 0x41780800, - 0x59a80006, 0x8c000504, 0x04000004, 0x8d0e1d2e, - 0x04000002, 0x84040d48, 0x4807c027, 0x42000000, - 0x00001000, 0x50000000, 0x82000480, 0x24320001, - 0x4803c857, 0x0400104b, 0x0201f800, 0x0010c62d, - 0x04000046, 0x42000800, 0x0010ebce, 0x46000800, - 0xfaceface, 0x80040800, 0x4c080000, 0x4c0c0000, - 0x42001000, 0x00007a00, 0x58080013, 0x44000800, - 0x80040800, 0x58080019, 0x44000800, 0x80040800, - 0x5808001a, 0x44000800, 0x80040800, 0x5808001b, - 0x44000800, 0x80040800, 0x5808001c, 0x44000800, - 0x80040800, 0x5808001f, 0x44000800, 0x80040800, - 0x42001000, 0x00007a40, 0x42001800, 0x0000000b, - 0x50080000, 0x44000800, 0x80081000, 0x80040800, - 0x800c1840, 0x040207fb, 0x42001800, 0x00000003, - 0x42001000, 0x00007b00, 0x480c1003, 0x58080005, - 0x44000800, 0x80040800, 0x800c1840, 0x040217fb, - 0x42001000, 0x00007c00, 0x58080002, 0x44000800, - 0x80040800, 0x58080003, 0x44000800, 0x80040800, - 0x58080020, 0x44000800, 0x80040800, 0x58080021, - 0x44000800, 0x80040800, 0x58080022, 0x44000800, - 0x80040800, 0x58080023, 0x44000800, 0x80040800, - 0x5c001800, 0x5c001000, 0x4a030000, 0x00000000, - 0x485fc020, 0x905cb9c0, 0x825cbd40, 0x00000012, - 0x485fc011, 0x4203e000, 0x40000000, 0x4202d800, - 0x00000005, 0x4a03c017, 0x00000000, 0x4203e000, - 0x30000001, 0x0401f847, 0x0401f7ff, 0x42000000, - 0x00000004, 0x0401f80c, 0x4a03c855, 0x0001eb5a, - 0x59e40001, 0x82000540, 0x00000700, 0x4803c801, - 0x42000000, 0x0010d5d7, 0x49780003, 0x49780004, - 0x1c01f000, 0x42000800, 0x0010d5d9, 0x44000800, - 0x59e40801, 0x82041500, 0xfff3c0ff, 0x480bc801, - 0x8c040d24, 0x0400000c, 0x4c000000, 0x59e41052, - 0x59e40054, 0x800000d4, 0x82000400, 0x0010ebea, - 0x80081480, 0x480bc853, 0x4a03c800, 0x00000040, - 0x5c000000, 0x4a03c850, 0x0010ebea, 0x800000d4, - 0x82002400, 0x0010ebe9, 0x4813c851, 0x4a03c853, - 0x00000400, 0x42000000, 0x0010ebea, 0x82001400, - 0x00001000, 0x45780000, 0x80000000, 0x80081d80, - 0x040207fd, 0x4807c801, 0x1c01f000, 0x42002000, - 0x0010d5d7, 0x59e41801, 0x58100c01, 0x82040500, - 0x00003800, 0x820c1d00, 0xffffc7ff, 0x800c1d40, - 0x480fc801, 0x1c01f000, 0x5c036000, 0x4db00000, - 0x49b3c857, 0x4803c857, 0x1c01f000, 0x1c01f000, - 0x59a80067, 0x8c000530, 0x040207fe, 0x4c080000, - 0x42001000, 0x00000004, 0x0401f862, 0x5c001000, - 0x4201d000, 0x00028b0a, 0x0201f800, 0x001069c8, - 0x4c080000, 0x42001000, 0x00000008, 0x0401f859, - 0x5c001000, 0x4201d000, 0x00028b0a, 0x0201f800, - 0x001069c8, 0x4c080000, 0x42001000, 0x00000010, - 0x0401f850, 0x5c001000, 0x4201d000, 0x00028b0a, - 0x0201f800, 0x001069c8, 0x0401f7e2, 0x8c00050c, - 0x59a80867, 0x04020003, 0x84040d30, 0x0401f006, - 0x84040d70, 0x48075067, 0x42001000, 0x00000000, - 0x0401f040, 0x48075067, 0x836c0500, 0x00000007, - 0x0c01f001, 0x0010046b, 0x00100451, 0x00100451, - 0x00100439, 0x0010045e, 0x00100451, 0x00100451, - 0x0010045e, 0x59a8007e, 0x8c000502, 0x04020013, - 0x59c40801, 0x82040d00, 0x00018000, 0x82040580, - 0x00010000, 0x0400000a, 0x82040580, 0x00008000, - 0x04000004, 0x42001000, 0x42004000, 0x0401f006, - 0x42001000, 0x22002000, 0x0401f003, 0x42001000, - 0x12001000, 0x0401f025, 0x42001000, 0x00001004, - 0x0401f022, 0x59a8007e, 0x8c000502, 0x04020008, - 0x59a80067, 0x8c000534, 0x04020004, 0x42001000, - 0x74057005, 0x0401f819, 0x1c01f000, 0x42001000, - 0x00002008, 0x0401f7fc, 0x59a80067, 0x8c000534, - 0x0402000a, 0x59a8007e, 0x8c000502, 0x04000004, - 0x42001000, 0x24052005, 0x0401f00c, 0x42001000, - 0x74057005, 0x0401f009, 0x1c01f000, 0x1c01f000, - 0x82081500, 0x0000001c, 0x82081540, 0x001c0000, - 0x480bc013, 0x1c01f000, 0x59a80067, 0x8c000530, - 0x04000002, 0x84081570, 0x480b5067, 0x8c000530, - 0x04020005, 0x82081500, 0x00007000, 0x80081114, - 0x0401fff0, 0x1c01f000, 0x40001800, 0x800c18c2, - 0x800c0400, 0x800c18c6, 0x800c0400, 0x800c18c2, - 0x800c0400, 0x800c190e, 0x800c0400, 0x80000112, - 0x1c01f000, 0x41780000, 0x50041800, 0x800c0400, - 0x80040800, 0x80102040, 0x040207fc, 0x80080500, - 0x80000540, 0x1c01f000, 0x4202f000, 0x00000000, - 0x41780000, 0x41780800, 0x41781000, 0x41781800, - 0x41782000, 0x41782800, 0x41783000, 0x41783800, - 0x41784000, 0x41784800, 0x41785000, 0x41785800, - 0x41786000, 0x41786800, 0x41787000, 0x41787800, - 0x41788000, 0x41788800, 0x41789000, 0x41789800, - 0x4178a000, 0x4178a800, 0x4178b000, 0x4178b800, - 0x4178c000, 0x4178c800, 0x4178d000, 0x4178d800, - 0x4178e000, 0x4178e800, 0x4178f000, 0x4178f800, - 0x41790000, 0x41790800, 0x41791000, 0x41791800, - 0x41792000, 0x41792800, 0x41793000, 0x41793800, - 0x41794000, 0x41794800, 0x41795000, 0x41795800, - 0x41796000, 0x41796800, 0x41797000, 0x41797800, - 0x41798000, 0x41798800, 0x42019000, 0x0010d1a5, - 0x42019800, 0x0010d17b, 0x4179a000, 0x4179a800, - 0x4179b000, 0x4179b800, 0x4179c800, 0x4179c000, - 0x4179d000, 0x4179d800, 0x4179e000, 0x4179e800, - 0x4179f000, 0x4179f800, 0x417a0000, 0x417a0800, - 0x417a1000, 0x417a1800, 0x417a2000, 0x42022800, - 0x00006100, 0x417a3000, 0x417a3800, 0x417a4000, - 0x417a4800, 0x417a5000, 0x417a5800, 0x417a6000, - 0x417a6800, 0x417a7000, 0x417a7800, 0x417a8000, - 0x417a8800, 0x417a9000, 0x417a9800, 0x417ae800, - 0x417af800, 0x42030000, 0x00007c00, 0x42031000, - 0x0010d476, 0x42031800, 0x0000bf1d, 0x42032000, - 0x0000bf32, 0x42032800, 0x0010d43e, 0x42033000, - 0x00020c5a, 0x42034000, 0x0010d115, 0x42033800, - 0x0010d134, 0x42034800, 0x0010d1b4, 0x42035000, - 0x0010d080, 0x42035800, 0x0010c880, 0x42030800, - 0x0010d176, 0x417b6000, 0x42036800, 0x00006f00, - 0x4203c800, 0x00003000, 0x42037000, 0x0000ff00, - 0x42037800, 0x0000bf00, 0x42038000, 0x00007700, - 0x42038800, 0x00004000, 0x42039000, 0x00006000, - 0x42039800, 0x0010e906, 0x4203a000, 0x00007600, - 0x4203a800, 0x00007400, 0x4203b000, 0x00007200, - 0x4203b800, 0x00007100, 0x4203c000, 0x00007000, - 0x4203d000, 0x00000000, 0x4203e800, 0x000201ba, - 0x417bd800, 0x1c01f000, 0x42000800, 0x00100000, - 0x50040000, 0x4c000000, 0x42000000, 0x0000aaaa, - 0x44000800, 0x42001800, 0x00005555, 0x42002000, - 0x00010000, 0x82102400, 0x00010000, 0x40100000, - 0x80042c00, 0x440c2800, 0x42003000, 0x0000000a, - 0x80183040, 0x040207ff, 0x50140000, 0x800c0580, - 0x04020004, 0x50040000, 0x800c0580, 0x040207f2, - 0x5c000000, 0x44000800, 0x80142840, 0x4817c861, - 0x4817500a, 0x1c01f000, 0x40681800, 0x59a8081f, - 0x800409c0, 0x04020008, 0x49781c0c, 0x4a001a0c, - 0x00000002, 0x4a001804, 0x00000007, 0x59a80015, - 0x48001805, 0x4c0c0000, 0x0401fdba, 0x5c001800, - 0x800409c0, 0x04020002, 0x80040800, 0x48041806, - 0x1c01f000, 0x4200b000, 0x00000080, 0x59a80086, - 0x8c00053e, 0x04000003, 0x4200b000, 0x00000040, - 0x42024800, 0x0010d5ef, 0x42000000, 0x0010db6f, - 0x48024809, 0x82000400, 0x00000010, 0x83264c00, - 0x0000000b, 0x8058b040, 0x040207fa, 0x1c01f000, - 0x59a8080c, 0x4006d000, 0x4202b800, 0x00000001, - 0x59a8180a, 0x480fc857, 0x82041400, 0x00000015, - 0x82082400, 0x00000015, 0x40100000, 0x800c0480, - 0x04001006, 0x44080800, 0x40080800, 0x40101000, - 0x815eb800, 0x0401f7f7, 0x45780800, 0x495f5020, - 0x1c01f000, 0x0401f803, 0x412d8800, 0x1c01f000, - 0x835c0480, 0x00000104, 0x0400100a, 0x496bc857, - 0x815eb840, 0x416a5800, 0x592ed000, 0x497a5800, - 0x497a5801, 0x497a5805, 0x812e59c0, 0x1c01f000, - 0x42000000, 0x0010d52b, 0x0201f800, 0x0010c50a, - 0x417a5800, 0x0401f7f9, 0x0401f803, 0x412d8800, - 0x1c01f000, 0x815eb840, 0x04001009, 0x416a5800, - 0x492fc857, 0x592ed000, 0x497a5800, 0x497a5801, - 0x497a5805, 0x812e59c0, 0x1c01f000, 0x42000000, - 0x0010d52b, 0x0201f800, 0x0010c50a, 0x417ab800, - 0x417a5800, 0x0401f7f8, 0x492fc857, 0x496a5800, - 0x412ed000, 0x815eb800, 0x59c80000, 0x82000540, - 0x00001200, 0x48039000, 0x1c01f000, 0x492fc857, - 0x812e59c0, 0x04000007, 0x592c0001, 0x497a5801, - 0x4c000000, 0x0401fff1, 0x5c025800, 0x0401f7f9, - 0x1c01f000, 0x4807c856, 0x42007000, 0x00020c51, - 0x4a007000, 0x00000000, 0x59e00003, 0x82000540, - 0x00008080, 0x4803c003, 0x4a03b805, 0x90000001, - 0x59dc0006, 0x4a03b805, 0x70000000, 0x59dc0006, + 0x496fc857, 0x4203e000, 0x50000000, 0x4200b800, + 0x00008002, 0x4c000000, 0x04006000, 0x4c040000, + 0x59bc00ea, 0x4803c857, 0x82000500, 0x00000007, + 0x82000580, 0x00000001, 0x04020005, 0x42000800, + 0x00000000, 0x0201f800, 0x00020c3d, 0x59b800ea, + 0x4803c857, 0x4a0370e8, 0x00000004, 0x5c000800, + 0x4807c025, 0x80040920, 0x4807c026, 0x5c000000, + 0x4803c023, 0x80000120, 0x4803c024, 0x5c000000, + 0x4803c857, 0x4803c021, 0x80000120, 0x4803c022, + 0x41f80000, 0x4803c029, 0x80000120, 0x4803c02a, + 0x41780800, 0x59a80006, 0x8c000504, 0x04000004, + 0x8d0e1d2e, 0x04000002, 0x84040d48, 0x4807c027, + 0x59a80062, 0x8c00050a, 0x04000004, 0x84040d4a, + 0x4807c857, 0x4807c027, 0x42000000, 0x00001000, + 0x50000000, 0x82000480, 0x24320001, 0x4803c857, + 0x0400104b, 0x0201f800, 0x0010c62e, 0x04000046, + 0x42000800, 0x0010ebd6, 0x46000800, 0xfaceface, + 0x80040800, 0x4c080000, 0x4c0c0000, 0x42001000, + 0x00007a00, 0x58080013, 0x44000800, 0x80040800, + 0x58080019, 0x44000800, 0x80040800, 0x5808001a, + 0x44000800, 0x80040800, 0x5808001b, 0x44000800, + 0x80040800, 0x5808001c, 0x44000800, 0x80040800, + 0x5808001f, 0x44000800, 0x80040800, 0x42001000, + 0x00007a40, 0x42001800, 0x0000000b, 0x50080000, + 0x44000800, 0x80081000, 0x80040800, 0x800c1840, + 0x040207fb, 0x42001800, 0x00000003, 0x42001000, + 0x00007b00, 0x480c1003, 0x58080005, 0x44000800, + 0x80040800, 0x800c1840, 0x040217fb, 0x42001000, + 0x00007c00, 0x58080002, 0x44000800, 0x80040800, + 0x58080003, 0x44000800, 0x80040800, 0x58080020, + 0x44000800, 0x80040800, 0x58080021, 0x44000800, + 0x80040800, 0x58080022, 0x44000800, 0x80040800, + 0x58080023, 0x44000800, 0x80040800, 0x5c001800, + 0x5c001000, 0x4a030000, 0x00000000, 0x485fc020, + 0x905cb9c0, 0x825cbd40, 0x00000012, 0x485fc011, + 0x4203e000, 0x40000000, 0x4202d800, 0x00000005, + 0x4a03c017, 0x00000000, 0x4203e000, 0x30000001, + 0x0401f83a, 0x0401f7ff, 0x42000000, 0x00000004, + 0x0401f80c, 0x4a03c855, 0x0001eb5a, 0x59e40001, + 0x82000540, 0x00000700, 0x4803c801, 0x42000000, + 0x0010d5df, 0x49780003, 0x49780004, 0x1c01f000, + 0x42000800, 0x0010d5e1, 0x44000800, 0x59e40801, + 0x82041500, 0xfff3c0ff, 0x480bc801, 0x4a03c850, + 0x0010ebf2, 0x800000d4, 0x82002400, 0x0010ebf1, + 0x4813c851, 0x4a03c853, 0x00000400, 0x42000000, + 0x0010ebf2, 0x82001400, 0x00001000, 0x45780000, + 0x80000000, 0x80081d80, 0x040207fd, 0x4807c801, + 0x1c01f000, 0x42002000, 0x0010d5df, 0x59e41801, + 0x58100c01, 0x82040500, 0x00003800, 0x820c1d00, + 0xffffc7ff, 0x800c1d40, 0x480fc801, 0x1c01f000, + 0x5c036000, 0x4db00000, 0x49b3c857, 0x4803c857, + 0x1c01f000, 0x1c01f000, 0x59a80068, 0x8c000530, + 0x040207fe, 0x4c080000, 0x42001000, 0x00000004, + 0x0401f862, 0x5c001000, 0x4201d000, 0x00028b0a, + 0x0201f800, 0x00106bed, 0x4c080000, 0x42001000, + 0x00000008, 0x0401f859, 0x5c001000, 0x4201d000, + 0x00028b0a, 0x0201f800, 0x00106bed, 0x4c080000, + 0x42001000, 0x00000010, 0x0401f850, 0x5c001000, + 0x4201d000, 0x00028b0a, 0x0201f800, 0x00106bed, + 0x0401f7e2, 0x8c00050c, 0x59a80868, 0x04020003, + 0x84040d30, 0x0401f006, 0x84040d70, 0x48075068, + 0x42001000, 0x00000000, 0x0401f040, 0x48075068, + 0x836c0500, 0x00000007, 0x0c01f001, 0x00100491, + 0x00100477, 0x00100477, 0x0010045f, 0x00100484, + 0x00100477, 0x00100477, 0x00100484, 0x59a8007f, + 0x8c000502, 0x04020013, 0x59c40801, 0x82040d00, + 0x00018000, 0x82040580, 0x00010000, 0x0400000a, + 0x82040580, 0x00008000, 0x04000004, 0x42001000, + 0x42004000, 0x0401f006, 0x42001000, 0x22002000, + 0x0401f003, 0x42001000, 0x12001000, 0x0401f025, + 0x42001000, 0x00001004, 0x0401f022, 0x59a8007f, + 0x8c000502, 0x04020008, 0x59a80068, 0x8c000534, + 0x04020004, 0x42001000, 0x74057005, 0x0401f819, + 0x1c01f000, 0x42001000, 0x00002008, 0x0401f7fc, + 0x59a80068, 0x8c000534, 0x0402000a, 0x59a8007f, + 0x8c000502, 0x04000004, 0x42001000, 0x24052005, + 0x0401f00c, 0x42001000, 0x74057005, 0x0401f009, + 0x1c01f000, 0x1c01f000, 0x82081500, 0x0000001c, + 0x82081540, 0x001c0000, 0x480bc013, 0x1c01f000, + 0x59a80068, 0x8c000530, 0x04000002, 0x84081570, + 0x480b5068, 0x8c000530, 0x04020005, 0x82081500, + 0x00007000, 0x80081114, 0x0401fff0, 0x1c01f000, + 0x40001800, 0x800c18c2, 0x800c0400, 0x800c18c6, + 0x800c0400, 0x800c18c2, 0x800c0400, 0x800c190e, + 0x800c0400, 0x80000112, 0x1c01f000, 0x41780000, + 0x50041800, 0x800c0400, 0x80040800, 0x80102040, + 0x040207fc, 0x80080500, 0x80000540, 0x1c01f000, + 0x4202f000, 0x00000000, 0x41780000, 0x41780800, + 0x41781000, 0x41781800, 0x41782000, 0x41782800, + 0x41783000, 0x41783800, 0x41784000, 0x41784800, + 0x41785000, 0x41785800, 0x41786000, 0x41786800, + 0x41787000, 0x41787800, 0x41788000, 0x41788800, + 0x41789000, 0x41789800, 0x4178a000, 0x4178a800, + 0x4178b000, 0x4178b800, 0x4178c000, 0x4178c800, + 0x4178d000, 0x4178d800, 0x4178e000, 0x4178e800, + 0x4178f000, 0x4178f800, 0x41790000, 0x41790800, + 0x41791000, 0x41791800, 0x41792000, 0x41792800, + 0x41793000, 0x41793800, 0x41794000, 0x41794800, + 0x41795000, 0x41795800, 0x41796000, 0x41796800, + 0x41797000, 0x41797800, 0x41798000, 0x41798800, + 0x42019000, 0x0010d1a7, 0x42019800, 0x0010d17d, + 0x4179a000, 0x4179a800, 0x4179b000, 0x4179b800, + 0x4179c800, 0x4179c000, 0x4179d000, 0x4179d800, + 0x4179e000, 0x4179e800, 0x4179f000, 0x4179f800, + 0x417a0000, 0x417a0800, 0x417a1000, 0x417a1800, + 0x417a2000, 0x42022800, 0x00006100, 0x417a3000, + 0x417a3800, 0x417a4000, 0x417a4800, 0x417a5000, + 0x417a5800, 0x417a6000, 0x417a6800, 0x417a7000, + 0x417a7800, 0x417a8000, 0x417a8800, 0x417a9000, + 0x417a9800, 0x417ae800, 0x417af800, 0x42030000, + 0x00007c00, 0x42031000, 0x0010d47b, 0x42031800, + 0x0000bf1d, 0x42032000, 0x0000bf32, 0x42032800, + 0x0010d440, 0x42033000, 0x0002108d, 0x42034000, + 0x0010d117, 0x42033800, 0x0010d136, 0x42034800, + 0x0010d1b6, 0x42035000, 0x0010d080, 0x42035800, + 0x0010c880, 0x42030800, 0x0010d178, 0x417b6000, + 0x42036800, 0x00006f00, 0x4203c800, 0x00003000, + 0x42037000, 0x0000ff00, 0x42037800, 0x0000bf00, + 0x42038000, 0x00007700, 0x42038800, 0x00004000, + 0x42039000, 0x00006000, 0x42039800, 0x0010e90e, + 0x4203a000, 0x00007600, 0x4203a800, 0x00007400, + 0x4203b000, 0x00007200, 0x4203b800, 0x00007100, + 0x4203c000, 0x00007000, 0x4203d000, 0x00000000, + 0x4203e800, 0x000201bd, 0x417bd800, 0x1c01f000, + 0x42000800, 0x00100000, 0x50040000, 0x4c000000, + 0x42000000, 0x0000aaaa, 0x44000800, 0x42001800, + 0x00005555, 0x42002000, 0x00010000, 0x82102400, + 0x00010000, 0x40100000, 0x80042c00, 0x440c2800, + 0x42003000, 0x0000000a, 0x80183040, 0x040207ff, + 0x50140000, 0x800c0580, 0x04020004, 0x50040000, + 0x800c0580, 0x040207f2, 0x5c000000, 0x44000800, + 0x80142840, 0x4817c861, 0x4817500a, 0x1c01f000, + 0x40681800, 0x59a8081f, 0x800409c0, 0x04020008, + 0x49781c0c, 0x4a001a0c, 0x00000002, 0x4a001804, + 0x00000007, 0x59a80015, 0x48001805, 0x4c0c0000, + 0x0401fdbe, 0x5c001800, 0x800409c0, 0x04020002, + 0x80040800, 0x48041806, 0x1c01f000, 0x4200b000, + 0x00000080, 0x59a80087, 0x8c00053e, 0x04000003, + 0x4200b000, 0x00000040, 0x42024800, 0x0010d5f7, + 0x42000000, 0x0010db77, 0x48024809, 0x82000400, + 0x00000010, 0x83264c00, 0x0000000b, 0x8058b040, + 0x040207fa, 0x1c01f000, 0x59a8080c, 0x4006d000, + 0x4202b800, 0x00000001, 0x59a8180a, 0x480fc857, + 0x82041400, 0x00000015, 0x82082400, 0x00000015, + 0x40100000, 0x800c0480, 0x04001006, 0x44080800, + 0x40080800, 0x40101000, 0x815eb800, 0x0401f7f7, + 0x45780800, 0x495f5020, 0x1c01f000, 0x0401f803, + 0x412d8800, 0x1c01f000, 0x835c0480, 0x00000104, + 0x0400100a, 0x496bc857, 0x815eb840, 0x416a5800, + 0x592ed000, 0x497a5800, 0x497a5801, 0x497a5805, + 0x812e59c0, 0x1c01f000, 0x42000000, 0x0010d52f, + 0x0201f800, 0x0010c50c, 0x417a5800, 0x0401f7f9, + 0x0401f803, 0x412d8800, 0x1c01f000, 0x815eb840, + 0x04001009, 0x416a5800, 0x492fc857, 0x592ed000, + 0x497a5800, 0x497a5801, 0x497a5805, 0x812e59c0, + 0x1c01f000, 0x42000000, 0x0010d52f, 0x0201f800, + 0x0010c50c, 0x417ab800, 0x417a5800, 0x0401f7f8, + 0x492fc857, 0x496a5800, 0x412ed000, 0x815eb800, + 0x59c80000, 0x82000540, 0x00001200, 0x48039000, + 0x1c01f000, 0x492fc857, 0x812e59c0, 0x04000007, + 0x592c0001, 0x497a5801, 0x4c000000, 0x0401fff1, + 0x5c025800, 0x0401f7f9, 0x1c01f000, 0x4807c856, + 0x42007000, 0x00021084, 0x4a007000, 0x00000000, + 0x59e00003, 0x82000540, 0x00008080, 0x4803c003, + 0x4a03b805, 0x90000001, 0x59dc0006, 0x4a03b805, + 0x70000000, 0x59dc0006, 0x4a03b805, 0x30000000, + 0x59dc0006, 0x4a03b805, 0x80000000, 0x4200b000, + 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, - 0x80000000, 0x4200b000, 0x00000020, 0x497bb807, - 0x8058b040, 0x040207fe, 0x4a03b805, 0x30000000, - 0x59dc0006, 0x4a03b805, 0x60000001, 0x59dc0006, - 0x4a03b805, 0x70000001, 0x59dc0006, 0x4a03b805, - 0x30000002, 0x4200b000, 0x00000020, 0x497bb807, - 0x8058b040, 0x040207fe, 0x4a03b805, 0x30000000, - 0x59dc0006, 0x4a03b805, 0x60000001, 0x4803c856, - 0x0401ffad, 0x04000d42, 0x42001000, 0x0010d471, - 0x452c1000, 0x4a025801, 0x00000001, 0x4a025802, - 0x00000100, 0x4a025808, 0x001078f8, 0x497a5809, - 0x497a580a, 0x497a580b, 0x0401ff9f, 0x04000d34, - 0x42001000, 0x0010d472, 0x452c1000, 0x4a025801, - 0x00000000, 0x4a025802, 0x00000100, 0x4a025808, - 0x0010105c, 0x497a5803, 0x497a5806, 0x497a5807, - 0x497a5809, 0x59a8007e, 0x8c000500, 0x04000006, - 0x4a03b805, 0xe0000001, 0x59dc0006, 0x8c000522, - 0x040007fc, 0x1c01f000, 0x40681000, 0x0201f800, - 0x00020017, 0x1c01f000, 0x42001000, 0x00020027, - 0x0201f800, 0x0010687a, 0x0201f800, 0x0010a07e, - 0x58380807, 0x42002000, 0x00000001, 0x58040801, - 0x800409c0, 0x04000003, 0x80102000, 0x0401f7fc, - 0x0201f800, 0x0010b9e9, 0x04020011, 0x42000000, - 0x0010d493, 0x0201f800, 0x0010c50a, 0x0201f800, - 0x0010a096, 0x42000800, 0x00000001, 0x42001000, - 0x00020027, 0x0201f800, 0x00106844, 0x42007000, - 0x00020c51, 0x0201f000, 0x00020031, 0x4a03b805, - 0x30000002, 0x59dc0006, 0x4807b800, 0x480bb801, - 0x42007000, 0x00020c51, 0x4a007002, 0x00000040, - 0x480c7008, 0x58380007, 0x82000400, 0x00000005, - 0x48007003, 0x4a007000, 0x00000003, 0x4803b803, - 0x0201f000, 0x00020051, 0x58380802, 0x42001000, - 0x0000ff00, 0x82040480, 0x0000ff00, 0x04021003, - 0x40041000, 0x80000580, 0x48007002, 0x480bb802, - 0x59dc0006, 0x4a03b805, 0x10000000, 0x1c01f000, - 0x4a03b805, 0x30000001, 0x58386001, 0x58301008, - 0x4807c857, 0x4803c857, 0x4833c857, 0x4a006002, - 0x00000200, 0x4a007000, 0x00000000, 0x800811c0, - 0x02000000, 0x0002002d, 0x0201f000, 0x00020093, - 0x59dc0006, 0x8c000520, 0x0400000a, 0x02004800, - 0x000209db, 0x59dc0006, 0x82000500, 0x00006000, - 0x04000004, 0x82000580, 0x00006000, 0x040207f8, - 0x1c01f000, 0x41781800, 0x58382005, 0x40300000, - 0x80100580, 0x04000007, 0x40101800, 0x58102000, - 0x801021c0, 0x040207fa, 0x4803c856, 0x0401f011, - 0x4833c857, 0x58302000, 0x49786000, 0x800c19c0, - 0x04020008, 0x801021c0, 0x04000003, 0x48107005, - 0x0401f008, 0x49787005, 0x49787004, 0x0401f005, - 0x48101800, 0x801021c0, 0x04020002, 0x480c7004, - 0x1c01f000, 0x4803c856, 0x4dc00000, 0x42007000, - 0x0010d474, 0x4a007400, 0x00000000, 0x49787001, - 0x42038000, 0x00007720, 0x4a038006, 0x60000001, - 0x4a038009, 0xf4f60000, 0x42038000, 0x00007700, + 0x60000001, 0x59dc0006, 0x4a03b805, 0x70000001, + 0x59dc0006, 0x4a03b805, 0x30000002, 0x4200b000, + 0x00000020, 0x497bb807, 0x8058b040, 0x040207fe, + 0x4a03b805, 0x30000000, 0x59dc0006, 0x4a03b805, + 0x60000001, 0x4803c856, 0x0401ffad, 0x04000d48, + 0x42001000, 0x0010d476, 0x452c1000, 0x4a025801, + 0x00000001, 0x4a025802, 0x00000100, 0x4a025808, + 0x00107839, 0x497a5809, 0x497a580a, 0x497a580b, + 0x0401ff9f, 0x04000d3a, 0x42001000, 0x0010d477, + 0x452c1000, 0x4a025801, 0x00000000, 0x4a025802, + 0x00000100, 0x4a025808, 0x00101064, 0x497a5803, + 0x497a5806, 0x497a5807, 0x497a5809, 0x59a8007f, + 0x8c000500, 0x04000006, 0x4a03b805, 0xe0000001, + 0x59dc0006, 0x8c000522, 0x040007fc, 0x1c01f000, + 0x40681000, 0x0201f800, 0x00020020, 0x1c01f000, + 0x42001000, 0x00020030, 0x0201f800, 0x00106a97, + 0x0201f800, 0x00109fd9, 0x58380807, 0x42002000, + 0x00000001, 0x58040801, 0x800409c0, 0x04000003, + 0x80102000, 0x0401f7fc, 0x0201f800, 0x0010b9d3, + 0x0402000d, 0x0201f800, 0x00109ff1, 0x42000800, + 0x00000001, 0x42001000, 0x00020030, 0x0201f800, + 0x00106a61, 0x42007000, 0x00021084, 0x0201f000, + 0x0002003a, 0x4a03b805, 0x30000002, 0x59dc0006, + 0x4807b800, 0x480bb801, 0x42007000, 0x00021084, + 0x4a007002, 0x00000040, 0x480c7008, 0x58380007, + 0x82000400, 0x00000005, 0x48007003, 0x4a007000, + 0x00000003, 0x4803b803, 0x0201f000, 0x0002005a, + 0x58380802, 0x42001000, 0x0000ff00, 0x82040480, + 0x0000ff00, 0x04021003, 0x40041000, 0x80000580, + 0x48007002, 0x480bb802, 0x59dc0006, 0x4a03b805, + 0x10000000, 0x1c01f000, 0x4a03b805, 0x30000001, + 0x58386001, 0x58301008, 0x4807c857, 0x4803c857, + 0x4833c857, 0x4a006002, 0x00000200, 0x4a007000, + 0x00000000, 0x800811c0, 0x02000000, 0x00020036, + 0x0201f000, 0x0002009c, 0x59dc0006, 0x8c000520, + 0x0400000a, 0x02004800, 0x00020a23, 0x59dc0006, + 0x82000500, 0x00006000, 0x04000004, 0x82000580, + 0x00006000, 0x040207f8, 0x1c01f000, 0x41781800, + 0x58382005, 0x40300000, 0x80100580, 0x04000007, + 0x40101800, 0x58102000, 0x801021c0, 0x040207fa, + 0x4803c856, 0x0401f011, 0x4833c857, 0x58302000, + 0x49786000, 0x800c19c0, 0x04020008, 0x801021c0, + 0x04000003, 0x48107005, 0x0401f008, 0x49787005, + 0x49787004, 0x0401f005, 0x48101800, 0x801021c0, + 0x04020002, 0x480c7004, 0x1c01f000, 0x4803c856, + 0x4dc00000, 0x42007000, 0x0010d479, 0x4a007400, + 0x00000000, 0x49787001, 0x42038000, 0x00007720, 0x4a038006, 0x60000001, 0x4a038009, 0xf4f60000, - 0x4a03c822, 0x00000010, 0x4a0370e8, 0x00000000, - 0x0401f809, 0x4a0370e9, 0x00003a0f, 0x4a0370e8, - 0x00000000, 0x4a0370e8, 0x00000001, 0x5c038000, - 0x1c01f000, 0x4c5c0000, 0x4178b800, 0x0401f80a, - 0x5c00b800, 0x1c01f000, 0x4803c856, 0x4c5c0000, - 0x825cbd40, 0x00000001, 0x0401f803, 0x5c00b800, - 0x1c01f000, 0x4803c856, 0x4dc00000, 0x4c500000, - 0x4c580000, 0x4c540000, 0x4a0370e8, 0x00000000, - 0x805cb9c0, 0x0400000b, 0x4a038807, 0x00000004, - 0x4a0370e5, 0x00080000, 0x59b800ea, 0x8c000510, - 0x04000004, 0x59b800e0, 0x0401f87d, 0x0401f7fb, - 0x42038000, 0x00007720, 0x0201f800, 0x00100ccd, - 0x59c00007, 0x4a038006, 0x20000000, 0x59c00007, - 0x4a038006, 0x8000000a, 0x59c00007, 0x4a038006, - 0x8000000b, 0x59c00007, 0x4a038006, 0x40000001, + 0x42038000, 0x00007700, 0x4a038006, 0x60000001, + 0x4a038009, 0xf4f60000, 0x4a03c822, 0x00000010, + 0x4a0370e8, 0x00000000, 0x0401f809, 0x4a0370e9, + 0x00003a0f, 0x4a0370e8, 0x00000000, 0x4a0370e8, + 0x00000001, 0x5c038000, 0x1c01f000, 0x4c5c0000, + 0x4178b800, 0x0401f80a, 0x5c00b800, 0x1c01f000, + 0x4803c856, 0x4c5c0000, 0x825cbd40, 0x00000001, + 0x0401f803, 0x5c00b800, 0x1c01f000, 0x4803c856, + 0x4dc00000, 0x4c500000, 0x4c580000, 0x4c540000, + 0x4a0370e8, 0x00000000, 0x805cb9c0, 0x0400000b, + 0x4a038807, 0x00000004, 0x4a0370e5, 0x00080000, + 0x59b800ea, 0x8c000510, 0x04000004, 0x59b800e0, + 0x0401f87d, 0x0401f7fb, 0x42038000, 0x00007720, + 0x0201f800, 0x00100cf9, 0x59c00007, 0x4a038006, + 0x20000000, 0x59c00007, 0x4a038006, 0x8000000a, + 0x59c00007, 0x4a038006, 0x8000000b, 0x59c00007, + 0x4a038006, 0x40000001, 0x83c00580, 0x00007700, + 0x04000004, 0x42038000, 0x00007700, 0x0401f7ed, + 0x42038000, 0x00007720, 0x42000800, 0x00000800, + 0x59c00007, 0x8c00051e, 0x04000006, 0x4a038006, + 0x90000001, 0x80040840, 0x040207fa, 0x0401fc48, 0x83c00580, 0x00007700, 0x04000004, 0x42038000, - 0x00007700, 0x0401f7ed, 0x42038000, 0x00007720, - 0x42000800, 0x00000800, 0x59c00007, 0x8c00051e, - 0x04000006, 0x4a038006, 0x90000001, 0x80040840, - 0x040207fa, 0x0401fc3e, 0x83c00580, 0x00007700, - 0x04000004, 0x42038000, 0x00007700, 0x0401f7f1, - 0x4178a000, 0x805cb9c0, 0x0402001d, 0x4200b000, - 0x00000020, 0x83b8ac00, 0x00000020, 0x0201f800, - 0x0010c5e6, 0x4a0370fb, 0x00000001, 0x4a037020, - 0x00100f3c, 0x59a80032, 0x82000500, 0x0000ffff, - 0x48037021, 0x4a037035, 0x0010e84c, 0x4a037030, - 0x0010d095, 0x4a037031, 0x0010c880, 0x4a037032, - 0x0010d186, 0x4a037036, 0x0010d191, 0x59840002, - 0x48037034, 0x4a037038, 0x00100f33, 0x4a0370fb, - 0x00000001, 0x4200b000, 0x00000020, 0x83b8ac00, - 0x00000000, 0x0201f800, 0x0010c5e6, 0x4200b000, - 0x00000040, 0x83b8ac00, 0x00000040, 0x0201f800, - 0x0010c5e6, 0x805cb9c0, 0x04020006, 0x4a0370e4, - 0xaaaaaaaa, 0x4a0370e5, 0xaaaaaaaa, 0x0401f005, - 0x4a0370e4, 0xa2aa2a82, 0x4a0370e5, 0xaaaaa2aa, - 0x4a0370e6, 0xaaaaaaaa, 0x4a0370fb, 0x00000000, - 0x4a0370e6, 0xaaaaaaaa, 0x42038000, 0x00007720, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x02020800, 0x0010032f, 0x42038000, 0x00007700, - 0x4a038006, 0x90000000, 0x59c00007, 0x8c00051e, - 0x02020800, 0x0010032f, 0x5c00a800, 0x5c00b000, - 0x5c00a000, 0x5c038000, 0x1c01f000, 0x4d300000, - 0x4d380000, 0x40026000, 0x82000500, 0x7f000000, - 0x82000580, 0x60000000, 0x04020012, 0x83326500, - 0x00ffffff, 0x0201f800, 0x0010a6dc, 0x0402000d, - 0x59300203, 0x82000580, 0x00000004, 0x04020009, - 0x59300c07, 0x82040580, 0x00000009, 0x04020005, - 0x42027000, 0x00000047, 0x0201f800, 0x00020b22, - 0x5c027000, 0x5c026000, 0x1c01f000, 0x4d300000, - 0x4d2c0000, 0x4d340000, 0x4d400000, 0x4cfc0000, - 0x4d380000, 0x4d3c0000, 0x4d440000, 0x4d4c0000, - 0x4d480000, 0x4c5c0000, 0x4c600000, 0x4c640000, - 0x4d040000, 0x4cc80000, 0x4ccc0000, 0x4cf40000, - 0x4cf80000, 0x0201f800, 0x00020096, 0x5c01f000, - 0x5c01e800, 0x5c019800, 0x5c019000, 0x5c020800, - 0x5c00c800, 0x5c00c000, 0x5c00b800, 0x5c029000, - 0x5c029800, 0x5c028800, 0x5c027800, 0x5c027000, - 0x5c01f800, 0x5c028000, 0x5c026800, 0x5c025800, - 0x5c026000, 0x1c01f000, 0x493bc857, 0x0201f000, - 0x000200c3, 0x83300500, 0x000000ff, 0x82000c80, - 0x00000007, 0x02021800, 0x0010032f, 0x0c01f025, - 0x1c01f000, 0x82000d00, 0xc0000038, 0x02020800, - 0x00100324, 0x0201f800, 0x0010032f, 0x00000000, - 0x00000048, 0x00000054, 0x00000053, 0x001007ba, - 0x001007df, 0x001007da, 0x001007fe, 0x001007c6, - 0x001007d2, 0x001007ba, 0x001007f9, 0x0010085d, - 0x001007ba, 0x00100860, 0x001007ba, 0x001007ba, - 0x00100864, 0x0010086a, 0x00100888, 0x0010089d, - 0x001007ff, 0x001008a6, 0x001008b2, 0x001007ba, - 0x001007ba, 0x001007ba, 0x0201f800, 0x0010032f, - 0x001007c4, 0x00100949, 0x00100823, 0x0010084c, - 0x001007c4, 0x001007c4, 0x001007c4, 0x001007c4, - 0x0201f800, 0x0010032f, 0x4803c856, 0x59300004, - 0x8c00053e, 0x04020005, 0x42027000, 0x00000055, - 0x0201f000, 0x00020b22, 0x0201f800, 0x00107595, - 0x040007fa, 0x1c01f000, 0x4803c856, 0x0401f8e1, - 0x40002800, 0x41782000, 0x42027000, 0x00000056, - 0x0201f000, 0x00020b22, 0x4803c856, 0x42027000, - 0x00000057, 0x0201f000, 0x00020b22, 0x4803c856, - 0x59325809, 0x812e59c0, 0x04000016, 0x59300008, - 0x8c00051a, 0x0402000d, 0x592c0409, 0x8c00051c, - 0x04020003, 0x4a026012, 0xffffffff, 0x59300004, - 0x8c00053e, 0x04020008, 0x42027000, 0x00000048, - 0x0201f000, 0x00020b22, 0x4a025a07, 0x00000007, - 0x0401f7f5, 0x0201f800, 0x00107595, 0x040007f7, - 0x1c01f000, 0x4803c856, 0x83300500, 0x00ffffff, - 0x0201f000, 0x00106e06, 0x1c01f000, 0x4803c856, - 0x813261c0, 0x02000800, 0x0010032f, 0x0201f800, - 0x00109c4d, 0x0400000d, 0x59325809, 0x592c0209, - 0x84000552, 0x48025a09, 0x0201f800, 0x001010f7, - 0x59300004, 0x8c00053e, 0x04020005, 0x417a7800, - 0x0201f800, 0x001097a0, 0x1c01f000, 0x0201f800, - 0x00107595, 0x040007fa, 0x1c01f000, 0x4c040000, - 0x59b808ea, 0x82040d00, 0x00000007, 0x82040580, - 0x00000003, 0x04000004, 0x42000000, 0x60000000, - 0x0401f8c8, 0x5c000800, 0x1c01f000, 0x0401f916, - 0x0400001b, 0x59325809, 0x812e59c0, 0x04000018, - 0x592c0205, 0x82000500, 0x000000ff, 0x82000d80, - 0x00000029, 0x04020012, 0x59300203, 0x82000580, - 0x00000003, 0x0400000b, 0x59300808, 0x84040d26, - 0x48066008, 0x0201f800, 0x0002011f, 0x4a03900d, - 0x00000040, 0x4a0370e5, 0x00000008, 0x1c01f000, - 0x0201f800, 0x00107595, 0x040007f4, 0x42000000, - 0x0010d536, 0x0201f800, 0x0010c50a, 0x59880151, - 0x80000000, 0x48031151, 0x4a03900d, 0x00000040, - 0x42000000, 0xc0000000, 0x0201f000, 0x00020113, - 0x4c5c0000, 0x4c600000, 0x4c640000, 0x4200c800, - 0x0010e853, 0x4200b800, 0x00003000, 0x4200c000, - 0x00000105, 0x0201f800, 0x001065fd, 0x4a0370e4, - 0x02000000, 0x5c00c800, 0x5c00c000, 0x5c00b800, - 0x1c01f000, 0x4933c857, 0x0201f000, 0x00020afe, - 0x4933c857, 0x0201f800, 0x00100cd5, 0x1c01f000, - 0x41300800, 0x800409c0, 0x02020800, 0x0010032f, - 0x0201f800, 0x00100324, 0x42000000, 0x0010d536, - 0x0201f800, 0x0010c50a, 0x4933c857, 0x813261c0, - 0x02000800, 0x0010032f, 0x0401f842, 0x40002800, - 0x0201f800, 0x0010c473, 0x4c140000, 0x59a8007b, - 0x80000540, 0x04000005, 0x8c142d2a, 0x04000003, - 0x0201f800, 0x00100cd5, 0x5c002800, 0x0401f8ae, - 0x04000007, 0x5932680a, 0x59340200, 0x8c00050e, - 0x59300415, 0x02020800, 0x00109f4a, 0x1c01f000, - 0x42000000, 0x0010d536, 0x0201f800, 0x0010c50a, - 0x4933c857, 0x813261c0, 0x02000800, 0x0010032f, - 0x0401f89d, 0x0400000b, 0x0201f800, 0x00109c4d, - 0x04000008, 0x59325809, 0x592c0209, 0x8400054e, - 0x48025a09, 0x417a7800, 0x0201f800, 0x001097a0, - 0x1c01f000, 0x485fc857, 0x5c000000, 0x4d780000, - 0x4203e000, 0x50000000, 0x4200b800, 0x00008005, - 0x0201f000, 0x00100334, 0x4933c857, 0x83300480, - 0x00000020, 0x02021800, 0x0010032f, 0x83300c00, - 0x0010d5ab, 0x50040000, 0x80000000, 0x04001002, - 0x44000800, 0x1c01f000, 0x4933c857, 0x0401f7f4, - 0x4807c856, 0x59b800ea, 0x8c000510, 0x040007fd, - 0x59b800e0, 0x4803c857, 0x1c01f000, 0x4803c856, - 0x42000000, 0x10000000, 0x41300800, 0x0401f029, - 0x8c000510, 0x02000000, 0x00020119, 0x4c040000, - 0x0401f80b, 0x5c000800, 0x82100480, 0x00000008, - 0x02001000, 0x00020119, 0x4c040000, 0x0401fe9c, - 0x5c000800, 0x0201f000, 0x00020119, 0x59b800e2, - 0x59b820e2, 0x80100580, 0x040207fd, 0x80102114, - 0x0401f001, 0x40101800, 0x800c190a, 0x82100500, - 0x0000001f, 0x820c1d00, 0x0000001f, 0x800c2480, - 0x82102500, 0x0000001f, 0x1c01f000, 0x40680000, - 0x406c0800, 0x0401f807, 0x42018800, 0x00000001, - 0x04020003, 0x42018800, 0x00000000, 0x1c01f000, - 0x82000500, 0xf0000000, 0x82040d00, 0x0fffffff, - 0x80040d40, 0x4807c857, 0x42001000, 0x0010d475, - 0x50080000, 0x80000540, 0x04020005, 0x4a0370e5, - 0x00000003, 0x4a0370e4, 0x00000300, 0x80000000, - 0x44001000, 0x42001000, 0x00000400, 0x59b800ea, - 0x8c000510, 0x0400000c, 0x0401ffd1, 0x82100480, - 0x00000008, 0x04001007, 0x4c040000, 0x4c080000, - 0x0401fe63, 0x5c001000, 0x5c000800, 0x0401f020, - 0x59b800ea, 0x8c000516, 0x0402001d, 0x4a0370e4, - 0x00300000, 0x480770e1, 0x42001000, 0x0000ff00, - 0x80081040, 0x04000012, 0x59b808e4, 0x8c040d28, - 0x040207fc, 0x42001000, 0x0010d475, 0x50080000, - 0x80000040, 0x04020005, 0x4a0370e5, 0x00000002, - 0x4a0370e4, 0x00000200, 0x02001800, 0x0010032f, - 0x44001000, 0x8c040d2c, 0x1c01f000, 0x41f80000, - 0x50000000, 0x0201f800, 0x0010032f, 0x80081040, - 0x040207d3, 0x41f80000, 0x50000000, 0x0201f800, - 0x0010032f, 0x4d380000, 0x59300c07, 0x82040580, - 0x00000009, 0x04020006, 0x42027000, 0x00000047, - 0x0201f800, 0x00020b22, 0x80000580, 0x5c027000, - 0x1c01f000, 0x4c500000, 0x4a03900d, 0x00000001, - 0x59c8a020, 0x4a03900d, 0x00000002, 0x59c80820, - 0x8c50a52e, 0x04000002, 0x900409c0, 0x82040d00, - 0x0000ffff, 0x0201f800, 0x001065bc, 0x5c00a000, - 0x1c01f000, 0x42000000, 0x0010d528, 0x0201f800, - 0x0010c50a, 0x0401ffec, 0x0400005b, 0x4933c857, - 0x59300407, 0x82000580, 0x00000000, 0x04000056, - 0x59c82021, 0x4a03900d, 0x00000001, 0x59c82821, - 0x82142d00, 0x0000ffff, 0x59325809, 0x812e59c0, - 0x0400004d, 0x5932680a, 0x0201f800, 0x00104a92, - 0x02020800, 0x00109f32, 0x599c0019, 0x8c00050c, - 0x04020022, 0x0201f800, 0x00104a92, 0x0402001f, - 0x59300812, 0x4807c857, 0x592c0409, 0x8c00051c, - 0x04020018, 0x8400055c, 0x48025c09, 0x42000000, - 0x0010d4a4, 0x0201f800, 0x0010c50a, 0x592c0a05, - 0x82040d00, 0x000000ff, 0x82040580, 0x00000048, - 0x04000007, 0x82040580, 0x00000018, 0x04000004, - 0x82040580, 0x00000068, 0x04020006, 0x59300012, - 0x0201f800, 0x0010a6e6, 0x80000d40, 0x48065803, - 0x4a026012, 0x7fffffff, 0x59300008, 0x8c000516, - 0x04020021, 0x48166014, 0x0201f800, 0x00104a92, - 0x04000004, 0x59300415, 0x8c00051c, 0x04000004, - 0x599c0019, 0x8c00050c, 0x04000017, 0x0201f800, - 0x00100f5c, 0x04020014, 0x0401fa8f, 0x40280000, - 0x4802600e, 0x04000005, 0x4832600c, 0x50200000, - 0x4802600b, 0x4822600d, 0x59300415, 0x8c00051c, - 0x04020004, 0x599c0019, 0x8c00050c, 0x04020885, - 0x4a03900d, 0x00000040, 0x4a0370e5, 0x00000008, - 0x1c01f000, 0x42000000, 0x0010d536, 0x0201f800, - 0x0010c50a, 0x59880153, 0x80000000, 0x48031153, - 0x4a03900d, 0x00000040, 0x42000000, 0xc0000000, - 0x0201f000, 0x00020113, 0x4cf80000, 0x58f40000, - 0x8001f540, 0x0401f820, 0x41781800, 0x0401f935, - 0x04020014, 0x44140800, 0x0401f82a, 0x04000011, - 0x40043800, 0x42001800, 0x00000001, 0x40142000, - 0x0401f92c, 0x0402000b, 0x801c3800, 0x501c0000, - 0x44000800, 0x0401f810, 0x801c0580, 0x04000004, - 0x44103800, 0x801c3840, 0x44143800, 0x0401f819, - 0x5c01f000, 0x1c01f000, 0x80f9f1c0, 0x04020003, - 0x58f41202, 0x0401f003, 0x42001000, 0x00000007, - 0x1c01f000, 0x80f9f1c0, 0x04020006, 0x58f40401, - 0x82000480, 0x00000002, 0x80f40400, 0x0401f005, - 0x58f80401, 0x82000480, 0x00000002, 0x80f80400, - 0x50002800, 0x80000000, 0x50002000, 0x1c01f000, - 0x80f9f1c0, 0x04020008, 0x58f40401, 0x82000480, - 0x00000002, 0x02001800, 0x0010032f, 0x4801ec01, - 0x0401f00b, 0x58f80401, 0x82000480, 0x00000002, - 0x02001800, 0x0010032f, 0x4801f401, 0x82000580, - 0x00000002, 0x04020002, 0x0401f81b, 0x58f40202, - 0x80000040, 0x4801ea02, 0x02000800, 0x0010032f, - 0x82000580, 0x00000001, 0x1c01f000, 0x82f40580, - 0xffffffff, 0x0400000f, 0x58f40201, 0x82000580, - 0x0000dcb3, 0x02020800, 0x0010032f, 0x58f40000, - 0x8001f540, 0x04000006, 0x58f80201, 0x82000580, - 0x0000ddb9, 0x02020800, 0x0010032f, 0x0401f80a, - 0x1c01f000, 0x4d2c0000, 0x40fa5800, 0x0201f800, - 0x001005aa, 0x4979e800, 0x4179f000, 0x5c025800, - 0x1c01f000, 0x80f5e9c0, 0x04000009, 0x80f9f1c0, - 0x04020ff5, 0x4d2c0000, 0x40f65800, 0x0201f800, - 0x001005aa, 0x4179e800, 0x5c025800, 0x1c01f000, - 0x4cf40000, 0x0201f800, 0x00104a92, 0x04020036, - 0x59300808, 0x82040500, 0x00013100, 0x04020032, - 0x8c040d22, 0x04000032, 0x59300028, 0x8001ed40, - 0x02000800, 0x0010032f, 0x82000580, 0xffffffff, - 0x04000029, 0x58f40201, 0x82000580, 0x0000dcb3, - 0x02020800, 0x0010032f, 0x58f40a02, 0x82040500, - 0x0000fffe, 0x04000003, 0x0401ff74, 0x58f40a02, - 0x82040480, 0x0000000f, 0x04021095, 0x80040800, - 0x4805ea02, 0x82040580, 0x00000008, 0x04000099, - 0x82040480, 0x00000008, 0x0400100a, 0x58f40000, - 0x8001ed40, 0x02000800, 0x0010032f, 0x58f40201, - 0x82000580, 0x0000ddb9, 0x02020800, 0x0010032f, - 0x58f40401, 0x82000c00, 0x00000002, 0x4805ec01, - 0x80f40400, 0x59300813, 0x44040000, 0x80000000, - 0x45780000, 0x5c01e800, 0x1c01f000, 0x42001000, - 0x00000400, 0x59b800e4, 0x8c000524, 0x0402005f, - 0x4a0370e4, 0x00030000, 0x40000000, 0x59b800e4, - 0x8c000524, 0x04020057, 0x59300808, 0x84040d62, - 0x48066008, 0x4a0370e4, 0x00020000, 0x4d2c0000, - 0x0201f800, 0x00100584, 0x04000061, 0x492e6028, - 0x4a025a01, 0x0000dcb3, 0x59300009, 0x80001d40, - 0x02000800, 0x0010032f, 0x580c0810, 0x48065803, - 0x580c0205, 0x82000500, 0x000000ff, 0x82000580, - 0x00000068, 0x04020037, 0x580c1801, 0x800c19c0, - 0x02000800, 0x0010032f, 0x580c0c06, 0x82040d00, - 0x00000003, 0x82040580, 0x00000002, 0x04020003, - 0x592c0803, 0x0401f02b, 0x580c2a07, 0x580c0008, - 0x59301812, 0x800c0580, 0x0400002a, 0x82040580, - 0x00000000, 0x04000012, 0x40140000, 0x4c080000, - 0x400c1000, 0x41780800, 0x0201f800, 0x00107000, - 0x800409c0, 0x02020800, 0x0010032f, 0x82140c00, - 0x00000008, 0x0201f800, 0x00106fe1, 0x5c001000, - 0x40041800, 0x592c0803, 0x0401f022, 0x82140400, - 0x00000008, 0x4c080000, 0x400c1000, 0x41780800, - 0x0201f800, 0x00107000, 0x800409c0, 0x02020800, - 0x0010032f, 0x40140800, 0x0201f800, 0x00106fe1, - 0x5c001000, 0x40041800, 0x592c0803, 0x0401f011, - 0x59301812, 0x40040000, 0x800c0580, 0x0402000d, - 0x497a5a02, 0x4a025c01, 0x00000004, 0x0401f011, - 0x4a0370e4, 0x00020000, 0x40000000, 0x40000000, - 0x80081040, 0x02000800, 0x0010032f, 0x0401f79a, - 0x4a025a02, 0x00000001, 0x4a025c01, 0x00000006, - 0x497a5804, 0x400c0000, 0x80040480, 0x48025805, - 0x412de800, 0x5c025800, 0x0401f76d, 0x5c025800, - 0x4a026028, 0xffffffff, 0x0401f787, 0x4d2c0000, - 0x58f65800, 0x0201f800, 0x001005aa, 0x40f65800, - 0x0201f800, 0x001005aa, 0x5c025800, 0x0401f7f5, - 0x4d2c0000, 0x0201f800, 0x00100584, 0x040007f8, - 0x4a025a01, 0x0000ddb9, 0x4a025c01, 0x00000002, - 0x492de800, 0x412de800, 0x5c025800, 0x0401f769, - 0x0401fee2, 0x82f40400, 0x00000004, 0x800c0400, - 0x40000800, 0x50040000, 0x80100580, 0x04000016, - 0x82040c00, 0x00000002, 0x80081040, 0x040207fa, - 0x80f9f1c0, 0x04000011, 0x58f41202, 0x82081480, - 0x00000007, 0x82f80400, 0x00000002, 0x800c0400, - 0x40000800, 0x50040000, 0x80100580, 0x04000006, - 0x82040c00, 0x00000002, 0x80081040, 0x040207fa, - 0x0401f002, 0x1c01f000, 0x82000540, 0x00000001, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 2 05:12:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C565F7342B; Mon, 2 Apr 2018 05:12:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA796DCD0; Mon, 2 Apr 2018 05:12:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1594111526; Mon, 2 Apr 2018 05:12:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w325BxPx014265; Mon, 2 Apr 2018 05:11:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w325Bx89014264; Mon, 2 Apr 2018 05:11:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201804020511.w325Bx89014264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 2 Apr 2018 05:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331871 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 05:12:00 -0000 Author: glebius Date: Mon Apr 2 05:11:59 2018 New Revision: 331871 URL: https://svnweb.freebsd.org/changeset/base/331871 Log: Handle a special case when a slab can fit only one allocation, and zone has a large alignment. With alignment taken into account uk_rsize will be greater than space in a slab. However, since we have only one item per slab, it is always naturally aligned. Code that will panic before this change with 4k page: z = uma_zcreate("test", 3984, NULL, NULL, NULL, NULL, 31, 0); uma_zalloc(z, M_WAITOK); A practical scenario to hit the panic is a machine with 56 CPUs and 2 NUMA domains, which yields in zone size of 3984. PR: 227116 MFC after: 2 weeks Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Apr 1 22:59:53 2018 (r331870) +++ head/sys/vm/uma_core.c Mon Apr 2 05:11:59 2018 (r331871) @@ -1290,7 +1290,15 @@ keg_small_init(uma_keg_t keg) else shsize = sizeof(struct uma_slab); - keg->uk_ipers = (slabsize - shsize) / rsize; + if (rsize <= slabsize - shsize) + keg->uk_ipers = (slabsize - shsize) / rsize; + else { + /* Handle special case when we have 1 item per slab, so + * alignment requirement can be relaxed. */ + KASSERT(keg->uk_size <= slabsize - shsize, + ("%s: size %u greater than slab", __func__, keg->uk_size)); + keg->uk_ipers = 1; + } KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); From owner-svn-src-all@freebsd.org Mon Apr 2 05:14:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3987F735A0; Mon, 2 Apr 2018 05:14:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD196DEE8; Mon, 2 Apr 2018 05:14:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E5CA1154D; Mon, 2 Apr 2018 05:14:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w325EW6a014451; Mon, 2 Apr 2018 05:14:32 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w325EW3u014450; Mon, 2 Apr 2018 05:14:32 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201804020514.w325EW3u014450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 2 Apr 2018 05:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331872 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 05:14:32 -0000 Author: glebius Date: Mon Apr 2 05:14:31 2018 New Revision: 331872 URL: https://svnweb.freebsd.org/changeset/base/331872 Log: In uma_startup_count() handle special case when zone will fit into single slab, but with alignment adjustment it won't. Again, when there is only one item in a slab alignment can be ignored. See previous revision of this file for more info. PR: 227116 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Apr 2 05:11:59 2018 (r331871) +++ head/sys/vm/uma_core.c Mon Apr 2 05:14:31 2018 (r331872) @@ -1828,9 +1828,11 @@ uma_startup_count(int vm_zones) #endif /* Memory for the rest of startup zones, UMA and VM, ... */ - if (zsize > UMA_SLAB_SIZE) + if (zsize > UMA_SLAB_SPACE) pages += (zones + vm_zones) * howmany(roundup2(zsize, UMA_BOOT_ALIGN), UMA_SLAB_SIZE); + else if (roundup2(zsize, UMA_BOOT_ALIGN) > UMA_SLAB_SPACE) + pages += zones; else pages += howmany(zones, UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); From owner-svn-src-all@freebsd.org Mon Apr 2 05:15:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2530DF73653; Mon, 2 Apr 2018 05:15:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDEB06E047; Mon, 2 Apr 2018 05:15:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C88E11154F; Mon, 2 Apr 2018 05:15:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w325FPfm014556; Mon, 2 Apr 2018 05:15:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w325FPdx014555; Mon, 2 Apr 2018 05:15:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201804020515.w325FPdx014555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 2 Apr 2018 05:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331873 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 05:15:26 -0000 Author: glebius Date: Mon Apr 2 05:15:25 2018 New Revision: 331873 URL: https://svnweb.freebsd.org/changeset/base/331873 Log: Use UMA_SLAB_SPACE macro. No functional change here. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Apr 2 05:14:31 2018 (r331872) +++ head/sys/vm/uma_core.c Mon Apr 2 05:15:25 2018 (r331873) @@ -1481,7 +1481,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) if (keg->uk_flags & UMA_ZONE_CACHESPREAD) { keg_cachespread_init(keg); } else { - if (keg->uk_size > (UMA_SLAB_SIZE - sizeof(struct uma_slab))) + if (keg->uk_size > UMA_SLAB_SPACE) keg_large_init(keg); else keg_small_init(keg); From owner-svn-src-all@freebsd.org Mon Apr 2 07:45:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 390EDF79CAD; Mon, 2 Apr 2018 07:45:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE63C72B1D; Mon, 2 Apr 2018 07:45:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D54F212D54; Mon, 2 Apr 2018 07:45:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w327jDEA089793; Mon, 2 Apr 2018 07:45:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w327jDOO089791; Mon, 2 Apr 2018 07:45:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804020745.w327jDOO089791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Apr 2018 07:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331874 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 331874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 07:45:14 -0000 Author: avg Date: Mon Apr 2 07:45:13 2018 New Revision: 331874 URL: https://svnweb.freebsd.org/changeset/base/331874 Log: x86 cpu_reset_proxy: no need to stop_cpus() the original processor The processor is "parked" in a spin-loop already and that's sufficient for the reset. There is nothing that stop_cpus() would add here, only extra complexity and fragility. The original processor does not need to enable interrupts now, in fact, it must not do that. MFC after: 2 weeks Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 05:15:25 2018 (r331873) +++ head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874) @@ -569,14 +569,11 @@ cpu_set_user_tls(struct thread *td, void *tls_base) static void cpu_reset_proxy() { - cpuset_t tcrp; cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) ia32_pause(); /* Wait for other cpu to see that we've started */ - CPU_SETOF(cpu_reset_proxyid, &tcrp); - stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); DELAY(1000000); cpu_reset_real(); @@ -616,7 +613,6 @@ cpu_reset() } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); - enable_intr(); cpu_reset_proxy_active = 2; while (1) Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Mon Apr 2 05:15:25 2018 (r331873) +++ head/sys/i386/i386/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874) @@ -581,14 +581,11 @@ kvtop(void *addr) static void cpu_reset_proxy() { - cpuset_t tcrp; cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) ia32_pause(); /* Wait for other cpu to see that we've started */ - CPU_SETOF(cpu_reset_proxyid, &tcrp); - stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); DELAY(1000000); cpu_reset_real(); @@ -628,7 +625,6 @@ cpu_reset() } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); - enable_intr(); cpu_reset_proxy_active = 2; while (1) From owner-svn-src-all@freebsd.org Mon Apr 2 08:06:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1793F7AF56; Mon, 2 Apr 2018 08:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63E4B736C6; Mon, 2 Apr 2018 08:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E59413077; Mon, 2 Apr 2018 08:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3286JhJ000182; Mon, 2 Apr 2018 08:06:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3286J4l000180; Mon, 2 Apr 2018 08:06:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804020806.w3286J4l000180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Apr 2018 08:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331875 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 331875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 08:06:19 -0000 Author: avg Date: Mon Apr 2 08:06:18 2018 New Revision: 331875 URL: https://svnweb.freebsd.org/changeset/base/331875 Log: x86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real If cpu_reset() is called on an AP and if it somehow fails to wake the BSP, then it's better to attempt the reset on the AP than just sit there spinning on an unusable and undebuggable system. MFC after: 16 days Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874) +++ head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 08:06:18 2018 (r331875) @@ -611,13 +611,14 @@ cpu_reset() ia32_pause(); cnt++; /* Wait for BSP to announce restart */ } - if (cpu_reset_proxy_active == 0) + if (cpu_reset_proxy_active == 0) { printf("cpu_reset: Failed to restart BSP\n"); - cpu_reset_proxy_active = 2; - - while (1) - ia32_pause(); - /* NOTREACHED */ + } else { + cpu_reset_proxy_active = 2; + while (1) + ia32_pause(); + /* NOTREACHED */ + } } DELAY(1000000); Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Mon Apr 2 07:45:13 2018 (r331874) +++ head/sys/i386/i386/vm_machdep.c Mon Apr 2 08:06:18 2018 (r331875) @@ -623,13 +623,14 @@ cpu_reset() ia32_pause(); cnt++; /* Wait for BSP to announce restart */ } - if (cpu_reset_proxy_active == 0) + if (cpu_reset_proxy_active == 0) { printf("cpu_reset: Failed to restart BSP\n"); - cpu_reset_proxy_active = 2; - - while (1) - ia32_pause(); - /* NOTREACHED */ + } else { + cpu_reset_proxy_active = 2; + while (1) + ia32_pause(); + /* NOTREACHED */ + } } DELAY(1000000); From owner-svn-src-all@freebsd.org Mon Apr 2 08:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABF3AF7CDF1; Mon, 2 Apr 2018 08:41:33 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B0874A02; Mon, 2 Apr 2018 08:41:32 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id w328fUo6043979; Mon, 2 Apr 2018 10:41:30 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 3B718372; Mon, 2 Apr 2018 10:41:29 +0200 (CEST) Message-ID: <5AC1ECB8.6050709@omnilan.de> Date: Mon, 02 Apr 2018 10:41:28 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Mark Johnston CC: svn-src-head@freebsd.org, Sean Bruno , src-committers@freebsd.org, glebius@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r324508 - head/sys/kern References: <201710102221.v9AML554015782@repo.freebsd.org> <5ABF55FC.6030102@omnilan.de> <20180401164726.GA953@raichu> In-Reply-To: <20180401164726.GA953@raichu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Mon, 02 Apr 2018 10:41:30 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 08:41:33 -0000 Bezüglich Mark Johnston's Nachricht vom 01.04.2018 18:47 (localtime): > On Sat, Mar 31, 2018 at 11:33:48AM +0200, Harry Schmalzbauer wrote: >> Bezüglich Sean Bruno's Nachricht vom 11.10.2017 00:21 (localtime): >>> Author: sbruno >>> Date: Tue Oct 10 22:21:05 2017 >>> New Revision: 324508 >>> URL: https://svnweb.freebsd.org/changeset/base/324508 >>> >>> Log: >>> match sendfile() error handling to send(). >>> >>> Sendfile() should match the error checking order of send() which >>> is currently: >>> >>> SBS_CANTSENDMORE >>> so_error >>> SS_ISCONNECTED >>> >>> Submitted by: Jason Eggleston >>> Reviewed by: glebius >>> MFC after: 2 weeks >>> Sponsored by: Limelight Networks >>> Differential Revision: https://reviews.freebsd.org/D12633 >>> >>> Modified: >>> head/sys/kern/kern_sendfile.c >>> >> >> I'm still applying this one locally to stable/11. >> Is it going to be MFCd before 11.2? >> >> There are a view more candidates: >> https://svnweb.freebsd.org/base?view=revision&revision=324601 along with >> r324448 >> https://svnweb.freebsd.org/base?view=revision&revision=327596 >> https://svnweb.freebsd.org/base?view=revision&revision=328977 >> These were flagged for MFC with expired defer time. >> And tomorrow this one was supposed to be MFCd also: >> https://svnweb.freebsd.org/base?view=revision&revision=331130 > > I think r324446 and r324448 need to be MFCed before most of these can go > in. I MFCed the other commits (r317567, r324508) that you asked about in > other threads. Thanks for MFCing the unrelated other two (r317567, r324508) from cem@! Hope someone finds time to sort out the dependiencies of r324446, r324448 and this r324508 along with r324601, r327596, r328977. Currently I don't have a sendfile() test case, but for some reason I stumbled across this MFCflagged commit some time ago and I guess 11.2 shouldn't ship without. Thanks, -harry From owner-svn-src-all@freebsd.org Mon Apr 2 13:25:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CADF58F8B; Mon, 2 Apr 2018 13:25:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 386C27E32F; Mon, 2 Apr 2018 13:25:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33553163CB; Mon, 2 Apr 2018 13:25:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32DPdgI062074; Mon, 2 Apr 2018 13:25:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32DPdai062073; Mon, 2 Apr 2018 13:25:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804021325.w32DPdai062073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 2 Apr 2018 13:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331876 - in stable: 10/release 11/release X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release 11/release X-SVN-Commit-Revision: 331876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 13:25:39 -0000 Author: gjb Date: Mon Apr 2 13:25:38 2018 New Revision: 331876 URL: https://svnweb.freebsd.org/changeset/base/331876 Log: MFC r331806: Add logic for "families" for GCE images. This allows for GCE consumers to easily detect the latest major version of FreeBSD when using the gcloud command line utility. To ensure snapshot builds do not conflict with release-style builds (ALPHA, BETA, RC, RELEASE), the '-snap' suffix is appended to the GCE image family name. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/Makefile.gce Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/Makefile.gce Directory Properties: stable/10/ (props changed) Modified: stable/11/release/Makefile.gce ============================================================================== --- stable/11/release/Makefile.gce Mon Apr 2 08:06:18 2018 (r331875) +++ stable/11/release/Makefile.gce Mon Apr 2 13:25:38 2018 (r331876) @@ -18,8 +18,13 @@ CLEANFILES+= ${GCE_UPLOAD_TGTS} GCE_BUCKET?= +.if !defined(GCE_FAMILY) || empty(GCE_FAMILY) +GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} +.endif + .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" SNAPSHOT_DATE!= date +-%Y-%m-%d +GCE_FAMILY_SUFX= -snap .endif # Really? Uppercase characters are not allowed? Sigh... @@ -64,6 +69,7 @@ gce-do-upload: /usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \ gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \ + --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz touch ${.OBJDIR}/${.TARGET} From owner-svn-src-all@freebsd.org Mon Apr 2 13:25:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6158DF58F8A; Mon, 2 Apr 2018 13:25:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10B937E32E; Mon, 2 Apr 2018 13:25:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06EDC163CA; Mon, 2 Apr 2018 13:25:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32DPcLO062068; Mon, 2 Apr 2018 13:25:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32DPckT062067; Mon, 2 Apr 2018 13:25:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804021325.w32DPckT062067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 2 Apr 2018 13:25: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: r331876 - in stable: 10/release 11/release X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release 11/release X-SVN-Commit-Revision: 331876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 13:25:39 -0000 Author: gjb Date: Mon Apr 2 13:25:38 2018 New Revision: 331876 URL: https://svnweb.freebsd.org/changeset/base/331876 Log: MFC r331806: Add logic for "families" for GCE images. This allows for GCE consumers to easily detect the latest major version of FreeBSD when using the gcloud command line utility. To ensure snapshot builds do not conflict with release-style builds (ALPHA, BETA, RC, RELEASE), the '-snap' suffix is appended to the GCE image family name. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.gce Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/Makefile.gce Directory Properties: stable/11/ (props changed) Modified: stable/10/release/Makefile.gce ============================================================================== --- stable/10/release/Makefile.gce Mon Apr 2 08:06:18 2018 (r331875) +++ stable/10/release/Makefile.gce Mon Apr 2 13:25:38 2018 (r331876) @@ -18,8 +18,13 @@ CLEANFILES+= ${GCE_UPLOAD_TGTS} GCE_BUCKET?= +.if !defined(GCE_FAMILY) || empty(GCE_FAMILY) +GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} +.endif + .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" SNAPSHOT_DATE!= date +-%Y-%m-%d +GCE_FAMILY_SUFX= -snap .endif # Really? Uppercase characters are not allowed? Sigh... @@ -64,6 +69,7 @@ gce-do-upload: /usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \ gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \ + --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz touch ${.OBJDIR}/${.TARGET} From owner-svn-src-all@freebsd.org Mon Apr 2 13:27:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACF63F59205; Mon, 2 Apr 2018 13:27:18 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 213607E5AD; Mon, 2 Apr 2018 13:27:17 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm0-f52.google.com with SMTP id g8so1626693wmd.2; Mon, 02 Apr 2018 06:27:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=MWGFbLlxvUnupy54sVhUkrOEHMrBCvvdx1luGRX1os4=; b=iei5UOHm4OF0Yw7pSbBtjqKiwFcMZ5wOsbUfQOHIqLZuZIPWwN0PP0V3yk0YM/2JAL sG2ADYRSxK13K2chojCAN2/ljITT8qhVXKbejpjET7pWGq+WA31GTquQKKrFwZDVx7xC D+z7nnskH/T17S9WkjfVto+bjPzBVp1MTRoVfExPY/iCpL7uIum80bd1Rhf6ioUxoJ99 RV/rwT2k9f3qtiu3aDMeuIzgSojN4Wq+cHCcbuYLu2dAeuUcJhkWBpizMqgx/YDcrRlA 6CaPXDqS+FWsx6hkh8kerqX3U4Yv6selfh3FMJJVll+xrgCXR0RkcDNCXHV5LFPfLL/Q krwA== X-Gm-Message-State: ALQs6tDHwStcLlAm7tBJtC7IxJn81FeLMqep4h0ItuHAhWiJ9hFaZmRI ssCGMmpAEGO+mSRDEOt9qUwzdw4v X-Google-Smtp-Source: AIpwx4/E62SiKt+nACmlfkLVSbGldRpZRHyZrhGsSkz4swm5v0jsQlKWEPWutylTSK66yYhiAp+Rvw== X-Received: by 10.46.84.12 with SMTP id i12mr5857983ljb.9.1522675631073; Mon, 02 Apr 2018 06:27:11 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id e28-v6sm68487lfb.52.2018.04.02.06.27.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 06:27:10 -0700 (PDT) Subject: Re: svn commit: r327056 - in head/sys: kern sys x86/acpica x86/x86 To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712210917.vBL9Hmd0042736@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Mon, 2 Apr 2018 16:27:08 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201712210917.vBL9Hmd0042736@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 13:27:18 -0000 On 21/12/2017 11:17, Bruce Evans wrote: > Author: bde > Date: Thu Dec 21 09:17:48 2017 > New Revision: 327056 > URL: https://svnweb.freebsd.org/changeset/base/327056 > > Log: > Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension. Bruce, do you plan to merge this to stable/11 and maybe stable/10? If you'd like, I can do it. Unless you see any reason not to. > restart_cpus() worked well enough by accident. Before this set of fixes, > resume_cpus() used the same cpuset (started_cpus, meaning CPUs directed to > restart) as restart_cpus(). resume_cpus() waited for the wrong cpuset > (stopped_cpus) to become empty, but since mixtures of stopped and suspended > CPUs are not close to working, stopped_cpus must be empty when resuming so > the wait is null -- restart_cpus just allows the other CPUs to restart and > returns without waiting. > > Fix resume_cpus() to wait on a non-wrong cpuset for the ACPI case, and > add further kludges to try to keep it working for the XEN case. It > was only used for XEN. It waited on suspended_cpus. This works for > XEN. However, for ACPI, resuming is a 2-step process. ACPI has already > woken up the other CPUs and removed them from suspended_cpus. This > fix records the move by putting them in a new cpuset resuming_cpus. > Waiting on suspended_cpus would give the same null wait as waiting on > stopped_cpus. Wait on resuming_cpus instead. > > Add a cpuset toresume_cpus to map the CPUs being told to resume to keep > this separate from the cpuset started_cpus for mapping the CPUs being told > to restart. Mixtures of stopped and suspended/resuming CPUs are still far > from working. Describe new and some old cpusets in comments. > > Add further kludges to cpususpend_handler() to try to avoid breaking it > for XEN. XEN doesn't use resumectx(), so it doesn't use the second > return path for savectx(), and it goes from the suspended state directly > to the restarted state, while ACPI resume goes through the resuming state. > Enter the resuming state early for all cases so that resume_cpus can test > for being in this state and not have to worry about the intermediate > !suspended state for ACPI only. -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Apr 2 13:36:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62543F59E04; Mon, 2 Apr 2018 13:36:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED737EBAF; Mon, 2 Apr 2018 13:36:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09D4616562; Mon, 2 Apr 2018 13:36:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32DamaD066985; Mon, 2 Apr 2018 13:36:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32Dam3m066984; Mon, 2 Apr 2018 13:36:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804021336.w32Dam3m066984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 2 Apr 2018 13:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331877 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 331877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 13:36:49 -0000 Author: andrew Date: Mon Apr 2 13:36:48 2018 New Revision: 331877 URL: https://svnweb.freebsd.org/changeset/base/331877 Log: Add the missing header for malloc(9). It was pulled in through header pollution that doesn't seem to exist in some configurations. Modified: head/sys/arm/arm/gic_acpi.c Modified: head/sys/arm/arm/gic_acpi.c ============================================================================== --- head/sys/arm/arm/gic_acpi.c Mon Apr 2 13:25:38 2018 (r331876) +++ head/sys/arm/arm/gic_acpi.c Mon Apr 2 13:36:48 2018 (r331877) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@freebsd.org Mon Apr 2 13:45:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB2CF63C5E; Mon, 2 Apr 2018 13:45:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E76637F55A; Mon, 2 Apr 2018 13:45:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE3D21670F; Mon, 2 Apr 2018 13:45:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32DjNQG072553; Mon, 2 Apr 2018 13:45:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32DjND9072550; Mon, 2 Apr 2018 13:45:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804021345.w32DjND9072550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 2 Apr 2018 13:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331878 - in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Commit-Revision: 331878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 13:45:24 -0000 Author: avg Date: Mon Apr 2 13:45:23 2018 New Revision: 331878 URL: https://svnweb.freebsd.org/changeset/base/331878 Log: unify amd64 and i386 cpu_reset() in x86/cpu_machdep.c Because I didn't see any reason not too. I've been making some changes to the code and couldn't help but notice that the i386 and am64 code was nearly identical. MFC after: 17 days Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 13:36:48 2018 (r331877) +++ head/sys/amd64/amd64/vm_machdep.c Mon Apr 2 13:45:23 2018 (r331878) @@ -84,13 +84,6 @@ __FBSDID("$FreeBSD$"); #include -static void cpu_reset_real(void); -#ifdef SMP -static void cpu_reset_proxy(void); -static u_int cpu_reset_proxyid; -static volatile u_int cpu_reset_proxy_active; -#endif - _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), @@ -563,129 +556,6 @@ cpu_set_user_tls(struct thread *td, void *tls_base) #endif pcb->pcb_fsbase = (register_t)tls_base; return (0); -} - -#ifdef SMP -static void -cpu_reset_proxy() -{ - - cpu_reset_proxy_active = 1; - while (cpu_reset_proxy_active == 1) - ia32_pause(); /* Wait for other cpu to see that we've started */ - - printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); - DELAY(1000000); - cpu_reset_real(); -} -#endif - -void -cpu_reset() -{ -#ifdef SMP - cpuset_t map; - u_int cnt; - - if (smp_started) { - map = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &map); - CPU_NAND(&map, &stopped_cpus); - if (!CPU_EMPTY(&map)) { - printf("cpu_reset: Stopping other CPUs\n"); - stop_cpus(map); - } - - if (PCPU_GET(cpuid) != 0) { - cpu_reset_proxyid = PCPU_GET(cpuid); - cpustop_restartfunc = cpu_reset_proxy; - cpu_reset_proxy_active = 0; - printf("cpu_reset: Restarting BSP\n"); - - /* Restart CPU #0. */ - CPU_SETOF(0, &started_cpus); - wmb(); - - cnt = 0; - while (cpu_reset_proxy_active == 0 && cnt < 10000000) { - ia32_pause(); - cnt++; /* Wait for BSP to announce restart */ - } - if (cpu_reset_proxy_active == 0) { - printf("cpu_reset: Failed to restart BSP\n"); - } else { - cpu_reset_proxy_active = 2; - while (1) - ia32_pause(); - /* NOTREACHED */ - } - } - - DELAY(1000000); - } -#endif - cpu_reset_real(); - /* NOTREACHED */ -} - -static void -cpu_reset_real() -{ - struct region_descriptor null_idt; - int b; - - disable_intr(); - - /* - * Attempt to do a CPU reset via the keyboard controller, - * do not turn off GateA20, as any machine that fails - * to do the reset here would then end up in no man's land. - */ - outb(IO_KBD + 4, 0xFE); - DELAY(500000); /* wait 0.5 sec to see if that did it */ - - /* - * Attempt to force a reset via the Reset Control register at - * I/O port 0xcf9. Bit 2 forces a system reset when it - * transitions from 0 to 1. Bit 1 selects the type of reset - * to attempt: 0 selects a "soft" reset, and 1 selects a - * "hard" reset. We try a "hard" reset. The first write sets - * bit 1 to select a "hard" reset and clears bit 2. The - * second write forces a 0 -> 1 transition in bit 2 to trigger - * a reset. - */ - outb(0xcf9, 0x2); - outb(0xcf9, 0x6); - DELAY(500000); /* wait 0.5 sec to see if that did it */ - - /* - * Attempt to force a reset via the Fast A20 and Init register - * at I/O port 0x92. Bit 1 serves as an alternate A20 gate. - * Bit 0 asserts INIT# when set to 1. We are careful to only - * preserve bit 1 while setting bit 0. We also must clear bit - * 0 before setting it if it isn't already clear. - */ - b = inb(0x92); - if (b != 0xff) { - if ((b & 0x1) != 0) - outb(0x92, b & 0xfe); - outb(0x92, b | 0x1); - DELAY(500000); /* wait 0.5 sec to see if that did it */ - } - - printf("No known reset method worked, attempting CPU shutdown\n"); - DELAY(1000000); /* wait 1 sec for printf to complete */ - - /* Wipe the IDT. */ - null_idt.rd_limit = 0; - null_idt.rd_base = 0; - lidt(&null_idt); - - /* "good night, sweet prince .... " */ - breakpoint(); - - /* NOTREACHED */ - while(1); } /* Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Mon Apr 2 13:36:48 2018 (r331877) +++ head/sys/i386/i386/vm_machdep.c Mon Apr 2 13:45:23 2018 (r331878) @@ -103,13 +103,6 @@ _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu _Static_assert(__OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), "__OFFSETOF_MONINORBUF does not correspond with offset of pc_monitorbuf."); -static void cpu_reset_real(void); -#ifdef SMP -static void cpu_reset_proxy(void); -static u_int cpu_reset_proxyid; -static volatile u_int cpu_reset_proxy_active; -#endif - union savefpu * get_pcb_user_save_td(struct thread *td) { @@ -575,141 +568,6 @@ kvtop(void *addr) if (pa == 0) panic("kvtop: zero page frame"); return (pa); -} - -#ifdef SMP -static void -cpu_reset_proxy() -{ - - cpu_reset_proxy_active = 1; - while (cpu_reset_proxy_active == 1) - ia32_pause(); /* Wait for other cpu to see that we've started */ - - printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); - DELAY(1000000); - cpu_reset_real(); -} -#endif - -void -cpu_reset() -{ -#ifdef SMP - cpuset_t map; - u_int cnt; - - if (smp_started) { - map = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &map); - CPU_NAND(&map, &stopped_cpus); - if (!CPU_EMPTY(&map)) { - printf("cpu_reset: Stopping other CPUs\n"); - stop_cpus(map); - } - - if (PCPU_GET(cpuid) != 0) { - cpu_reset_proxyid = PCPU_GET(cpuid); - cpustop_restartfunc = cpu_reset_proxy; - cpu_reset_proxy_active = 0; - printf("cpu_reset: Restarting BSP\n"); - - /* Restart CPU #0. */ - CPU_SETOF(0, &started_cpus); - wmb(); - - cnt = 0; - while (cpu_reset_proxy_active == 0 && cnt < 10000000) { - ia32_pause(); - cnt++; /* Wait for BSP to announce restart */ - } - if (cpu_reset_proxy_active == 0) { - printf("cpu_reset: Failed to restart BSP\n"); - } else { - cpu_reset_proxy_active = 2; - while (1) - ia32_pause(); - /* NOTREACHED */ - } - } - - DELAY(1000000); - } -#endif - cpu_reset_real(); - /* NOTREACHED */ -} - -static void -cpu_reset_real() -{ - struct region_descriptor null_idt; - int b; - - disable_intr(); -#ifdef CPU_ELAN - if (elan_mmcr != NULL) - elan_mmcr->RESCFG = 1; -#endif - - if (cpu == CPU_GEODE1100) { - /* Attempt Geode's own reset */ - outl(0xcf8, 0x80009044ul); - outl(0xcfc, 0xf); - } - -#if !defined(BROKEN_KEYBOARD_RESET) - /* - * Attempt to do a CPU reset via the keyboard controller, - * do not turn off GateA20, as any machine that fails - * to do the reset here would then end up in no man's land. - */ - outb(IO_KBD + 4, 0xFE); - DELAY(500000); /* wait 0.5 sec to see if that did it */ -#endif - - /* - * Attempt to force a reset via the Reset Control register at - * I/O port 0xcf9. Bit 2 forces a system reset when it - * transitions from 0 to 1. Bit 1 selects the type of reset - * to attempt: 0 selects a "soft" reset, and 1 selects a - * "hard" reset. We try a "hard" reset. The first write sets - * bit 1 to select a "hard" reset and clears bit 2. The - * second write forces a 0 -> 1 transition in bit 2 to trigger - * a reset. - */ - outb(0xcf9, 0x2); - outb(0xcf9, 0x6); - DELAY(500000); /* wait 0.5 sec to see if that did it */ - - /* - * Attempt to force a reset via the Fast A20 and Init register - * at I/O port 0x92. Bit 1 serves as an alternate A20 gate. - * Bit 0 asserts INIT# when set to 1. We are careful to only - * preserve bit 1 while setting bit 0. We also must clear bit - * 0 before setting it if it isn't already clear. - */ - b = inb(0x92); - if (b != 0xff) { - if ((b & 0x1) != 0) - outb(0x92, b & 0xfe); - outb(0x92, b | 0x1); - DELAY(500000); /* wait 0.5 sec to see if that did it */ - } - - printf("No known reset method worked, attempting CPU shutdown\n"); - DELAY(1000000); /* wait 1 sec for printf to complete */ - - /* Wipe the IDT. */ - null_idt.rd_limit = 0; - null_idt.rd_base = 0; - lidt(&null_idt); - - /* "good night, sweet prince .... " */ - breakpoint(); - - /* NOTREACHED */ - while(1); } /* Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Mon Apr 2 13:36:48 2018 (r331877) +++ head/sys/x86/x86/cpu_machdep.c Mon Apr 2 13:45:23 2018 (r331878) @@ -96,10 +96,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define STATE_RUNNING 0x0 #define STATE_MWAIT 0x1 #define STATE_SLEEPING 0x2 +#ifdef SMP +static u_int cpu_reset_proxyid; +static volatile u_int cpu_reset_proxy_active; +#endif + + /* * Machine dependent boot() routine * @@ -240,6 +248,141 @@ cpu_halt(void) { for (;;) halt(); +} + +static void +cpu_reset_real() +{ + struct region_descriptor null_idt; + int b; + + disable_intr(); +#ifdef CPU_ELAN + if (elan_mmcr != NULL) + elan_mmcr->RESCFG = 1; +#endif +#ifdef __i386__ + if (cpu == CPU_GEODE1100) { + /* Attempt Geode's own reset */ + outl(0xcf8, 0x80009044ul); + outl(0xcfc, 0xf); + } +#endif +#if !defined(BROKEN_KEYBOARD_RESET) + /* + * Attempt to do a CPU reset via the keyboard controller, + * do not turn off GateA20, as any machine that fails + * to do the reset here would then end up in no man's land. + */ + outb(IO_KBD + 4, 0xFE); + DELAY(500000); /* wait 0.5 sec to see if that did it */ +#endif + + /* + * Attempt to force a reset via the Reset Control register at + * I/O port 0xcf9. Bit 2 forces a system reset when it + * transitions from 0 to 1. Bit 1 selects the type of reset + * to attempt: 0 selects a "soft" reset, and 1 selects a + * "hard" reset. We try a "hard" reset. The first write sets + * bit 1 to select a "hard" reset and clears bit 2. The + * second write forces a 0 -> 1 transition in bit 2 to trigger + * a reset. + */ + outb(0xcf9, 0x2); + outb(0xcf9, 0x6); + DELAY(500000); /* wait 0.5 sec to see if that did it */ + + /* + * Attempt to force a reset via the Fast A20 and Init register + * at I/O port 0x92. Bit 1 serves as an alternate A20 gate. + * Bit 0 asserts INIT# when set to 1. We are careful to only + * preserve bit 1 while setting bit 0. We also must clear bit + * 0 before setting it if it isn't already clear. + */ + b = inb(0x92); + if (b != 0xff) { + if ((b & 0x1) != 0) + outb(0x92, b & 0xfe); + outb(0x92, b | 0x1); + DELAY(500000); /* wait 0.5 sec to see if that did it */ + } + + printf("No known reset method worked, attempting CPU shutdown\n"); + DELAY(1000000); /* wait 1 sec for printf to complete */ + + /* Wipe the IDT. */ + null_idt.rd_limit = 0; + null_idt.rd_base = 0; + lidt(&null_idt); + + /* "good night, sweet prince .... " */ + breakpoint(); + + /* NOTREACHED */ + while(1); +} + +#ifdef SMP +static void +cpu_reset_proxy() +{ + + cpu_reset_proxy_active = 1; + while (cpu_reset_proxy_active == 1) + ia32_pause(); /* Wait for other cpu to see that we've started */ + + printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); + DELAY(1000000); + cpu_reset_real(); +} +#endif + +void +cpu_reset() +{ +#ifdef SMP + cpuset_t map; + u_int cnt; + + if (smp_started) { + map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &map); + CPU_NAND(&map, &stopped_cpus); + if (!CPU_EMPTY(&map)) { + printf("cpu_reset: Stopping other CPUs\n"); + stop_cpus(map); + } + + if (PCPU_GET(cpuid) != 0) { + cpu_reset_proxyid = PCPU_GET(cpuid); + cpustop_restartfunc = cpu_reset_proxy; + cpu_reset_proxy_active = 0; + printf("cpu_reset: Restarting BSP\n"); + + /* Restart CPU #0. */ + CPU_SETOF(0, &started_cpus); + wmb(); + + cnt = 0; + while (cpu_reset_proxy_active == 0 && cnt < 10000000) { + ia32_pause(); + cnt++; /* Wait for BSP to announce restart */ + } + if (cpu_reset_proxy_active == 0) { + printf("cpu_reset: Failed to restart BSP\n"); + } else { + cpu_reset_proxy_active = 2; + while (1) + ia32_pause(); + /* NOTREACHED */ + } + } + + DELAY(1000000); + } +#endif + cpu_reset_real(); + /* NOTREACHED */ } bool From owner-svn-src-all@freebsd.org Mon Apr 2 15:07:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB2B5F70654; Mon, 2 Apr 2018 15:07:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3E882592; Mon, 2 Apr 2018 15:07:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 619741741E; Mon, 2 Apr 2018 15:07:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32F7fqG013664; Mon, 2 Apr 2018 15:07:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32F7fML013663; Mon, 2 Apr 2018 15:07:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804021507.w32F7fML013663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 2 Apr 2018 15:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331879 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 15:07:41 -0000 Author: markj Date: Mon Apr 2 15:07:41 2018 New Revision: 331879 URL: https://svnweb.freebsd.org/changeset/base/331879 Log: Ensure the background laundering threshold is positive after a scan. The division added in r331732 meant that we wouldn't attempt a background laundering until at least v_free_target - v_free_min clean pages had been freed by the page daemon since the last laundering. If the inactive queue is depleted but not completely empty (e.g., because it contains busy pages), it can thus take a long time to meet this threshold. Restore the pre-r331732 behaviour of using a non-zero background laundering threshold if at least one inactive queue scan has elapsed since the last attempt at background laundering. Submitted by: tijl (original version) Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Apr 2 13:45:23 2018 (r331878) +++ head/sys/vm/vm_pageout.c Mon Apr 2 15:07:41 2018 (r331879) @@ -1015,14 +1015,16 @@ vm_pageout_laundry_worker(void *arg) * clean pages freed by the page daemon since the last * background laundering. Thus, as the ratio of dirty to * clean inactive pages grows, the amount of memory pressure - * required to trigger laundering decreases. + * required to trigger laundering decreases. We ensure + * that the threshold is non-zero after an inactive queue + * scan, even if that scan failed to free a single clean page. */ trybackground: nclean = vmd->vmd_free_count + vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt; ndirty = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt; - if (target == 0 && ndirty * isqrt(nfreed / - (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { + if (target == 0 && ndirty * isqrt(howmany(nfreed + 1, + vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { target = vmd->vmd_background_launder_target; } From owner-svn-src-all@freebsd.org Mon Apr 2 15:19:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD04FF71318; Mon, 2 Apr 2018 15:19:36 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87FE782D55; Mon, 2 Apr 2018 15:19:36 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 65CE05A9F17; Mon, 2 Apr 2018 15:19:35 +0000 (UTC) Date: Mon, 2 Apr 2018 15:19:35 +0000 From: Brooks Davis To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331869 - head/sys/dev/nxge Message-ID: <20180402151935.GB88994@spindle.one-eyed-alien.net> References: <201804011853.w31IrR5X003323@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WYTEVAkct0FjGQmd" Content-Disposition: inline In-Reply-To: <201804011853.w31IrR5X003323@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 15:19:37 -0000 --WYTEVAkct0FjGQmd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 01, 2018 at 06:53:27PM +0000, Ian Lepore wrote: > Author: ian > Date: Sun Apr 1 18:53:27 2018 > New Revision: 331869 > URL: https://svnweb.freebsd.org/changeset/base/331869 >=20 > Log: > Fix the build on arches with default unsigned char. Capture the fubyte= () > return value in an int as well as the char, and test the full int value > for fubyte() failure. Thanks for fixing this and sorry for the breakage. -- Brooks --WYTEVAkct0FjGQmd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJawkoGAAoJEKzQXbSebgfAnSYH/3AyQPfke/1CGK9WjvnBErtg aDp6SaMpNvPL6W1XBczQgOznqkFTwEbKkjKiEFk/VIoUC/pWoRyQj9hYueVy81eV 4bUXw7JqS6M8MSTJoJ/tVyWfXzm0qZKfOK1u3AnaFPgMoFFfhkgI1b9p7mK/RXzf Y9AzLRtV0rUYHTJsM0OrXBuMovAqGDg7iPHCGL/0YOJmbR6LEEC0vIFjVuMDE2Wu SlZ8aUCLlfVRata7Nj1qsSIUezLxzq7mM6SsPu7FoSnJL+TVDoP1qUPl6RIEy6Be +lZPh5lCjlcSX7R3B6pJoS7/KsCjDpiyzkZ3MeWzDr76pAyFNbE0aMad6Qie0mg= =XNCZ -----END PGP SIGNATURE----- --WYTEVAkct0FjGQmd-- From owner-svn-src-all@freebsd.org Mon Apr 2 15:28:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 132B3F71CAB; Mon, 2 Apr 2018 15:28:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC318341B; Mon, 2 Apr 2018 15:28:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95B4A17763; Mon, 2 Apr 2018 15:28:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32FSmRq023857; Mon, 2 Apr 2018 15:28:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32FSmd7023856; Mon, 2 Apr 2018 15:28:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804021528.w32FSmd7023856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 2 Apr 2018 15:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331880 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 331880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 15:28:49 -0000 Author: kevans Date: Mon Apr 2 15:28:48 2018 New Revision: 331880 URL: https://svnweb.freebsd.org/changeset/base/331880 Log: MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon Usage is ${name}_limits, and the argument is any flags accepted by limits(1), such as `-n 100' (e.g. only allow 100 open files). Modified: stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) @@ -773,6 +773,8 @@ check_startmsgs() # # ${name}_login_class n Login class to use, else "daemon". # +# ${name}_limits n limits(1) to apply to ${command}. +# # ${rc_arg}_cmd n If set, use this as the method when invoked; # Otherwise, use default command (see below) # @@ -952,7 +954,7 @@ run_rc_command() _group=\$${name}_group _groups=\$${name}_groups \ _fib=\$${name}_fib _env=\$${name}_env \ _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} \ - _oomprotect=\$${name}_oomprotect + _limits=\$${name}_limits _oomprotect=\$${name}_oomprotect if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -1073,7 +1075,7 @@ $command $rc_flags $command_args" fi # Prepend default limits - _doit="$_cd limits -C $_login_class $_doit" + _doit="$_cd limits -C $_login_class $_limits $_doit" # run the full command # From owner-svn-src-all@freebsd.org Mon Apr 2 15:29:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 572EDF71D13; Mon, 2 Apr 2018 15:29:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id BF8278350D; Mon, 2 Apr 2018 15:29:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id F2D143D4875; Tue, 3 Apr 2018 01:28:52 +1000 (AEST) Date: Tue, 3 Apr 2018 01:28:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327056 - in head/sys: kern sys x86/acpica x86/x86 In-Reply-To: Message-ID: <20180403012043.K1434@besplex.bde.org> References: <201712210917.vBL9Hmd0042736@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8vpKE69ueMNQcOfTwboA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 15:29:01 -0000 On Mon, 2 Apr 2018, Andriy Gapon wrote: > On 21/12/2017 11:17, Bruce Evans wrote: >> Author: bde >> Date: Thu Dec 21 09:17:48 2017 >> New Revision: 327056 >> URL: https://svnweb.freebsd.org/changeset/base/327056 >> >> Log: >> Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension. > > Bruce, > > do you plan to merge this to stable/11 and maybe stable/10? No. I'm nit (yet?) set up to merge to stable at all, and this is not the first thing that I would want to merge. > If you'd like, I can do it. Unless you see any reason not to. Please do it. It is only a small part of fixing mapping bugs for low memory which first showed up s incoherent page tables for vm86 (low memory was left unmapped all the time to handle the problem that ACPI resume needs this mapping for 1 instruction). You might need the other fixes. This one is fairly stand- alone but doesn't do much by itself. Bruce From owner-svn-src-all@freebsd.org Mon Apr 2 15:32:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 681B4F72100; Mon, 2 Apr 2018 15:32:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D64E983849; Mon, 2 Apr 2018 15:32:09 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-wm0-f52.google.com with SMTP id f125so27914708wme.4; Mon, 02 Apr 2018 08:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OMw/8RGOC7zxvJ2qSebkBUH2bocg/Q4UT7eXnv7aAz0=; b=epk/R8lS9bY9QVDrJHNk/u3CErdsnvJ1mQGQZkoPAambuxgHguQ+BQGtVmwZvfe2Wa R7DBYtHZJu21IpG3gkSF5WuOTkX7w9sFZOY2lXSBr07m087Y45vGR4m/FzZ22m/zNFXW +semmkxb9yrT3zZAvSCyyAf3u0Aw9ihscz3TNB0Y5P3zVZqyx7ckiHdcsOOqh4V7Z7NZ uXtzqyz6O99nYS9hqbUhXqftV5wBUvNNaYuWpVypI/BJwKqVAdwrb3HXTm9osEYECM+c s3apoL/wR6nJAr/G0qj1yZIJzM8FP5qDE+E0CwqJxb7rJlfFcnpdy0WD/5yV6X/EPgsM RSGg== X-Gm-Message-State: AElRT7EOTNtOgpJzxRtWHTJqu6q78mYE11cqStWFCSouMXchC/sagZeK 8BMx+cbQYvQqLLEAjfmQybpNA2gA X-Google-Smtp-Source: AIpwx49mhuMrxd3IZrYQYPWky8tM3wHRmZXe/+HbrB35+S88qwbHWnQhd5irfsogTxLi9OYdjX4PZA== X-Received: by 10.80.147.89 with SMTP id n25mr13212880eda.189.1522683128539; Mon, 02 Apr 2018 08:32:08 -0700 (PDT) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com. [74.125.82.53]) by smtp.gmail.com with ESMTPSA id w4sm445920edh.56.2018.04.02.08.32.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 08:32:08 -0700 (PDT) Received: by mail-wm0-f53.google.com with SMTP id i3so4165569wmf.3; Mon, 02 Apr 2018 08:32:08 -0700 (PDT) X-Received: by 10.46.29.1 with SMTP id d1mr6139342ljd.22.1522683128138; Mon, 02 Apr 2018 08:32:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 2 Apr 2018 08:31:47 -0700 (PDT) In-Reply-To: <201801241415.w0OEF6vr052976@repo.freebsd.org> References: <201801241415.w0OEF6vr052976@repo.freebsd.org> From: Kyle Evans Date: Mon, 2 Apr 2018 10:31:47 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328331 - head/etc To: Dmitry Marakasov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, 0mp@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 15:32:10 -0000 On Wed, Jan 24, 2018 at 8:15 AM, Dmitry Marakasov wrote: > Author: amdmi3 (ports committer) > Date: Wed Jan 24 14:15:06 2018 > New Revision: 328331 > URL: https://svnweb.freebsd.org/changeset/base/328331 > > Log: > Support configuring arbitrary limits(1) for any daemon in rc.conf > > Usage is ${name}_limits, and the argument is any flags accepted by > limits(1), such as `-n 100' (e.g. only allow 100 open files). > > Approved by: cy > Differential Revision: https://reviews.freebsd.org/D14015 > > Modified: > head/etc/rc.subr > > Modified: head/etc/rc.subr To answer a question you've posed in the Diff. Review, I've MFC'd this to stable/11 as r331880. 0mp@ is working on an effort to correct some leftover ${name}_limits usage in ports that leads to wrong behavior as a result of this commit. Any chance you could help him out with that? Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Mon Apr 2 15:39:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FB9DF726C9; Mon, 2 Apr 2018 15:39:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4F7483D99; Mon, 2 Apr 2018 15:39:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w32Fda83083097; Mon, 2 Apr 2018 08:39:36 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w32FdaID083096; Mon, 2 Apr 2018 08:39:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <201804021528.w32FSmd7023856@repo.freebsd.org> To: Kyle Evans Date: Mon, 2 Apr 2018 08:39:36 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 15:39:41 -0000 > Author: kevans > Date: Mon Apr 2 15:28:48 2018 > New Revision: 331880 > URL: https://svnweb.freebsd.org/changeset/base/331880 > > Log: > MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > > Usage is ${name}_limits, and the argument is any flags accepted by > limits(1), such as `-n 100' (e.g. only allow 100 open files). > > Modified: > stable/11/etc/rc.subr > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/etc/rc.subr > ============================================================================== > --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > @@ -773,6 +773,8 @@ check_startmsgs() > # > # ${name}_login_class n Login class to use, else "daemon". > # > +# ${name}_limits n limits(1) to apply to ${command}. > +# Caution, limits(1) is in /usr/bin, this code can fail if used before /usr is mounted. (Ie, our rc.initdiskless) is probably broken by this change if a call is made to limits. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 2 16:08:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9315CF74675; Mon, 2 Apr 2018 16:08:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4425384FD7; Mon, 2 Apr 2018 16:08:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A20517DC7; Mon, 2 Apr 2018 16:08:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32G8qsh044118; Mon, 2 Apr 2018 16:08:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32G8qRH044117; Mon, 2 Apr 2018 16:08:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804021608.w32G8qRH044117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 2 Apr 2018 16:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331881 - stable/11/sys/dev/pdq X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/pdq X-SVN-Commit-Revision: 331881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 16:08:52 -0000 Author: brooks Date: Mon Apr 2 16:08:51 2018 New Revision: 331881 URL: https://svnweb.freebsd.org/changeset/base/331881 Log: fea(4) was removed in HEAD with the removal of EISA support. This is a direct commit. Modified: stable/11/sys/dev/pdq/if_fea.c Modified: stable/11/sys/dev/pdq/if_fea.c ============================================================================== --- stable/11/sys/dev/pdq/if_fea.c Mon Apr 2 15:28:48 2018 (r331880) +++ stable/11/sys/dev/pdq/if_fea.c Mon Apr 2 16:08:51 2018 (r331881) @@ -234,6 +234,7 @@ pdq_eisa_attach (dev) return (error); } + gone_in_dev(dev, 12, "fea(4) driver"); return (0); bad: pdq_free(dev); From owner-svn-src-all@freebsd.org Mon Apr 2 16:11:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAFF7F74C00; Mon, 2 Apr 2018 16:11:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02BC685423; Mon, 2 Apr 2018 16:11:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1C9B17F27; Mon, 2 Apr 2018 16:11:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32GBnuh046116; Mon, 2 Apr 2018 16:11:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32GBncd046112; Mon, 2 Apr 2018 16:11:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804021611.w32GBncd046112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 2 Apr 2018 16:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331882 - in stable/11: share/man/man4 sys/dev/cm sys/dev/pdq X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/cm sys/dev/pdq X-SVN-Commit-Revision: 331882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 16:11:51 -0000 Author: brooks Date: Mon Apr 2 16:11:49 2018 New Revision: 331882 URL: https://svnweb.freebsd.org/changeset/base/331882 Log: MFC r331830: Add deprecation notices for Arcnet and FDDI drivers. We intend to remove support before FreeBSD 12 is branched. Reviewed by: imp, emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14890 Modified: stable/11/share/man/man4/cm.4 stable/11/share/man/man4/fpa.4 stable/11/sys/dev/cm/if_cm_isa.c stable/11/sys/dev/pdq/if_fpa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/cm.4 ============================================================================== --- stable/11/share/man/man4/cm.4 Mon Apr 2 16:08:51 2018 (r331881) +++ stable/11/share/man/man4/cm.4 Mon Apr 2 16:11:49 2018 (r331882) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd March 29, 2018 .Dt CM 4 .Os .Sh NAME @@ -46,6 +46,12 @@ module at boot time, place the following line in .Bd -literal -offset indent if_cm_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 12.0 +and later. .Sh DESCRIPTION The .Nm Modified: stable/11/share/man/man4/fpa.4 ============================================================================== --- stable/11/share/man/man4/fpa.4 Mon Apr 2 16:08:51 2018 (r331881) +++ stable/11/share/man/man4/fpa.4 Mon Apr 2 16:11:49 2018 (r331882) @@ -4,7 +4,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 1995 +.Dd March 29, 2018 .Dt FPA 4 .Os .Sh NAME @@ -18,6 +18,12 @@ .Fx only: .Cd "device fddi" +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 12.0 +and later. .Sh DESCRIPTION The .Nm Modified: stable/11/sys/dev/cm/if_cm_isa.c ============================================================================== --- stable/11/sys/dev/cm/if_cm_isa.c Mon Apr 2 16:08:51 2018 (r331881) +++ stable/11/sys/dev/cm/if_cm_isa.c Mon Apr 2 16:11:49 2018 (r331882) @@ -111,6 +111,7 @@ cm_isa_attach(dev) if (error) goto err; + gone_in_dev(dev, 12, "cm(4) driver"); return 0; err: Modified: stable/11/sys/dev/pdq/if_fpa.c ============================================================================== --- stable/11/sys/dev/pdq/if_fpa.c Mon Apr 2 16:08:51 2018 (r331881) +++ stable/11/sys/dev/pdq/if_fpa.c Mon Apr 2 16:11:49 2018 (r331882) @@ -156,6 +156,7 @@ pdq_pci_attach(device_t dev) } + gone_in_dev(dev, 12, "fpa(4) driver"); return (0); bad: pdq_free(dev); From owner-svn-src-all@freebsd.org Mon Apr 2 16:13:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83851F74E1A; Mon, 2 Apr 2018 16:13:49 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01BB285926; Mon, 2 Apr 2018 16:13:48 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-wm0-f45.google.com with SMTP id t67so6760877wmt.0; Mon, 02 Apr 2018 09:13:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FgkGMqDrQXhoBZmKwXpEx7Zc99nVi/+dnSvXHoTxHAY=; b=BRSYwqZNzoZwbvvwnuTQSyuTBWTrr1WmQ4Vu5b/tb0YNdgoByBy94ois6s1iMoLjER gDqXGSm4alaxawlDsz+xovGhR2hshJy70UDrLCFB0BW2mFIxRTDA4ErRXntVaNX/uX9C uIlMuey4OisBBUGk8IpRHljD7EqPT7NMcuaCAcaq85aAEFm78oUAhBgCyHdehPUtdtM1 CL9u/zm+XJgJZaO6B6vGWT2iCJa3UgiBUWD3XvuKdyB2YW25Ri5043whEtX1BtOHVZWw VMPwiRyaXrH2NrYlHVnhB+Iv6QYaesgas0dZ9zoj9eXMEUTdIVr8XCwLe5Dszq0+TpQZ C2cQ== X-Gm-Message-State: AElRT7EZ0PcCzRqqvJ6qEe5klfNCOipHEy+lP8fz0+50YDg//1h4PZ9f +j5MSlopizTjfgXX+g4PFdf/LbE1 X-Google-Smtp-Source: AIpwx4+Gfho+Im/PRGwOCB69qSAWdQzx81CdBGB4w7TviifRds+G+MErhZzED21rdlWLis4LIz5j/Q== X-Received: by 10.80.155.6 with SMTP id o6mr13277479edi.280.1522685312305; Mon, 02 Apr 2018 09:08:32 -0700 (PDT) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com. [209.85.128.175]) by smtp.gmail.com with ESMTPSA id v16sm568403edc.5.2018.04.02.09.08.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 09:08:31 -0700 (PDT) Received: by mail-wr0-f175.google.com with SMTP id y55so14463441wry.3; Mon, 02 Apr 2018 09:08:31 -0700 (PDT) X-Received: by 2002:a19:c4c8:: with SMTP id u191-v6mr6329871lff.109.1522685311446; Mon, 02 Apr 2018 09:08:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 2 Apr 2018 09:08:10 -0700 (PDT) In-Reply-To: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> References: <201804021528.w32FSmd7023856@repo.freebsd.org> <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 2 Apr 2018 11:08:10 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 16:13:49 -0000 On Mon, Apr 2, 2018 at 10:39 AM, Rodney W. Grimes wrote: >> Author: kevans >> Date: Mon Apr 2 15:28:48 2018 >> New Revision: 331880 >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> Log: >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> Modified: >> stable/11/etc/rc.subr >> Directory Properties: >> stable/11/ (props changed) >> >> Modified: stable/11/etc/rc.subr >> ============================================================================== >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> @@ -773,6 +773,8 @@ check_startmsgs() >> # >> # ${name}_login_class n Login class to use, else "daemon". >> # >> +# ${name}_limits n limits(1) to apply to ${command}. >> +# > > Caution, limits(1) is in /usr/bin, this code can fail if used before > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > this change if a call is made to limits. > I believe this is a non-issue in this case-- this didn't add any limits(1) invocations, it just allowed flags to be passed to the limits(1) invocation that was already being made. From owner-svn-src-all@freebsd.org Mon Apr 2 16:28:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD973F759EE; Mon, 2 Apr 2018 16:28:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40F3886133; Mon, 2 Apr 2018 16:28:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id b5-v6so8681958itj.1; Mon, 02 Apr 2018 09:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=k0k16zOfogxI7Xlo3+BAvhMm3DTIneQ3I/r+MUxXoGo=; b=GlkkRG/+fFFFdmXb9n0kscxVtTMQDIXEwFQZuFfrxuugXChOiXFe7viGvhgd+WZ8HM zfxhhgvJ1RtHmCtjhxXtQo1l2mLFbP5QWA+a0WxqdlS4Aq6SNRnENFV9en+X7BNrFbjJ edb0mlUkBEYK57pclkhXRJATglCsZB+HYjsopusRuii+JwsO5jS902FthMR5u3Xv3qGT Hg/fv7hiNF7gqOurBb56JuBxCPLP5WtG6Jgo20pk1UX75Y6s+4x0IuGYP0Fv2ND8sC82 l3ZD07Y9WVjtXmzLqjZE/RV4eKpI6maW0mpcAvbNWwyEjJ3S9RI4BSvVnn2M6gBwTb2f rdLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=k0k16zOfogxI7Xlo3+BAvhMm3DTIneQ3I/r+MUxXoGo=; b=m5dhJmYMNAPQBVJt+/Et+K4I7AI4OA5vRGu5civwLJ3MTpHnCR+FI+Sbm/46G1f1wh IkXZMeiOkPt5tWbKX16jWsZ+uQ2XOm/rfgROmvufM1DtNwWlA9tQw8d/ZJRaW/Ck5l0B JJPhSo9Ix1YEDEqtjeFZQp7cztxvmAVGkWFzXfbeFDJ1hppu9NTIRujSn+Lo4XQ+oCn2 owz2GKZFm2y/fE37hcgGv/rtydm/FGTkX8VKTw4cvT2fy7CW06vynsl0ju5jLn9gZM4H /9CzDGXoDVn2ky4GRy/haPvuvpE7UKho+MNyuHPqnSiZMxTWhKSYgOY6iVzUMhgwd7GE +zQA== X-Gm-Message-State: ALQs6tCmeeVYHzrnwK7LUUrdeKEvDMCqpF/fHxjFWJrkDal00ElbG0WI UktT8xbhqzkC8XSe7GrPLHWzqT0d1o+4YKDkuQG65RiB X-Google-Smtp-Source: AIpwx49sIDI0N48wxlvvLfUP2JOetbHRuU+xns6jRGzZSs2bfq7TCkm3zViQGSTepe7qP1YST/FURYSWpCeh6Ok018Y= X-Received: by 2002:a24:a0c6:: with SMTP id o189-v6mr1630225ite.52.1522686488358; Mon, 02 Apr 2018 09:28:08 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Mon, 2 Apr 2018 09:27:47 -0700 (PDT) In-Reply-To: <20180331184109.GA23589@lonesome.com> References: <201803311138.w2VBcKHP014025@repo.freebsd.org> <68DEEF9A-6290-40AD-B51D-E187593C089F@FreeBSD.org> <20180331131818.GA22697@lonesome.com> <20180331184109.GA23589@lonesome.com> From: Ed Maste Date: Mon, 2 Apr 2018 12:27:47 -0400 X-Google-Sender-Auth: LYvyMa4jMGZVNSCyBmnx2DnRTUY Message-ID: Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... To: Mark Linimon Cc: Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2018 16:28:10 -0000 On 31 March 2018 at 14:41, Mark Linimon wrote: > > Number of ports with no maintainer: 4625 (16.5%) > > (that number is a bit stale) > > Add the number of port maintainers that are no longer active, overwhelmed > "group" maintainers, and the number of maintainers who only run -stable, > and you have a significant number. Do we have a good way of identifying maintainers who are no longer active? It's understandable that people, and especially volunteers, are going to get busy and may not be so responsive from time to time. On the other hand, it's unfortunate to repeatedly add weeks or months of latency if the maintainer is truly inactive. > Please also consider the fact that the _correct_ way to get patches like > this done is to submit them to the upstream (if it still exists) and get > them to incorporate them. That takes time, as well. I'd argue that the best way to handle cases like this is to develop a patch, ./configure change, workaround etc., simultaneously submitting upstream and committing to the ports tree. This way the port builds and is available for our users right away, upstream benefits from our work, and we don't need to carry a patch indefinitely (assuming upstream accepts it). An approach that relies on upstream accepting first the patch and then producing a new release I suspect is not viable given the variability in responsiveness of different upstreams. > Now let me add a personal irritation: no one has bothered doing a writeup > on "here's how you fix old broken code that no longer works." I am neither > a compiler expert nor a C++ expert -- I can sit around and twiddle knobs > and see if that makes things work, but that's not the type of commit I want > to make. (I have already been trying this with consolekit2, to absolutely > no result.) It's quite difficult to write that up in general, but one thing that is likely feasible is to identify and report common issues; I've tried to do that while working on the switch to lld as /usr/bin/ld - there are a small number of issues that come up with some regularity, and many that are unique. It's a lot harder to enumerate the failures that we'll see due to the compiler though, and the fixes or workarounds are also a lot more varied. > The folks that will suffer are the users who build their own packages, who > will find a large number of regressions with no warning. (e.g., there is > nothing in the ports UPDATING file yet.) Fair point, we should have an entry in UPDATING. > Please see the lld work that emaste has been doing for the type of thing > that makes working on ports a lot more bearable. My work's a bit of a different case though: I'm working to replace an existing and obsolete toolchain component that is not going to be upgraded, is on a deprecation path, and is relatively self-contained, so has different challenges and issues than a compiler upgrade. > tl;dr: this is the type of thing that needs coordination between various > teams. This is the most important point of this discussion: we do need to ensure there's good communication and coordination between teams where dependencies like this exist. I'll take the blame here: Dimitry asked me about merging the Clang update to stable/11 and I agreed that it was reasonable to merge sooner rather than later to have as much lead time as possible before the 11.2 process starts. I also assumed that outstanding Clang 6 issues in ports were farther along in being addressed. The key lesson from this discussion is that for significant commits and merges like this one we should make sure to always have sufficient advance notice. From owner-svn-src-all@freebsd.org Mon Apr 2 20:12:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D3FF8256C; Mon, 2 Apr 2018 20:12:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6543B6FE51; Mon, 2 Apr 2018 20:12:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 604F81A5FF; Mon, 2 Apr 2018 20:12:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32KCPnY071901; Mon, 2 Apr 2018 20:12:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32KCPQc071900; Mon, 2 Apr 2018 20:12:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022012.w32KCPQc071900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 20:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r331884 - svnadmin/hooks/scripts X-SVN-Group: svnadmin X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: svnadmin/hooks/scripts X-SVN-Commit-Revision: 331884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 20:12:25 -0000 Author: gonzo Date: Mon Apr 2 20:12:25 2018 New Revision: 331884 URL: https://svnweb.freebsd.org/changeset/base/331884 Log: Make bugzilla notification email UTF-8 compatible Add Content-Transfer-Encoding and Content-Type headers to indicate that email body is UTF-8. Without them Bugzilla's email parser defaults to latin-1 encoding and if there are UTF-8 charasters in commit messages they get corrupted in refrenced PR's comment text. PR: 223634 Modified: svnadmin/hooks/scripts/notify_bz.sh Modified: svnadmin/hooks/scripts/notify_bz.sh ============================================================================== --- svnadmin/hooks/scripts/notify_bz.sh Mon Apr 2 18:10:41 2018 (r331883) +++ svnadmin/hooks/scripts/notify_bz.sh Mon Apr 2 20:12:25 2018 (r331884) @@ -26,6 +26,8 @@ for pr in $PRS; do echo "From: commit-hook@freebsd.org" echo "To: notify-bz@freebsd.org" echo "Subject: [Bug $pr]" + echo "Content-Type: text/plain; charset=UTF-8" + echo "Content-Transfer-Encoding: 8bit" echo "" echo "A commit references this bug:" echo "" From owner-svn-src-all@freebsd.org Mon Apr 2 20:47:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B87FEF8440B; Mon, 2 Apr 2018 20:47:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B04171408; Mon, 2 Apr 2018 20:47:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61A5B1AAF7; Mon, 2 Apr 2018 20:47:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32Klua7087270; Mon, 2 Apr 2018 20:47:56 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32Kluj1087266; Mon, 2 Apr 2018 20:47:56 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022047.w32Kluj1087266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 20:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331885 - stable/11/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/dev/uart X-SVN-Commit-Revision: 331885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 20:47:57 -0000 Author: gonzo Date: Mon Apr 2 20:47:55 2018 New Revision: 331885 URL: https://svnweb.freebsd.org/changeset/base/331885 Log: MFC r303100 by andrew: We will be switching to a new arm64 uart cpu driver that handles both FDT and ACPI. As such pull out what will be the common parts of the FDT cpu detection to a new function that can be shared between them. Reviewed by: manu Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7262 Modified: stable/11/sys/dev/uart/uart_bus_fdt.c stable/11/sys/dev/uart/uart_cpu_fdt.c stable/11/sys/dev/uart/uart_cpu_fdt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/11/sys/dev/uart/uart_bus_fdt.c Mon Apr 2 20:12:25 2018 (r331884) +++ stable/11/sys/dev/uart/uart_bus_fdt.c Mon Apr 2 20:47:55 2018 (r331885) @@ -105,6 +105,129 @@ uart_fdt_find_device(device_t dev) } static int +phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node) +{ + char buf[64]; + + if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0) + return (ENXIO); + if ((*node = OF_finddevice(buf)) == -1) + return (ENXIO); + + return (0); +} + +static const struct ofw_compat_data * +uart_fdt_find_compatible(phandle_t node, const struct ofw_compat_data *cd) +{ + const struct ofw_compat_data *ocd; + + for (ocd = cd; ocd->ocd_str != NULL; ocd++) { + if (fdt_is_compatible(node, ocd->ocd_str)) + return (ocd); + } + return (NULL); +} + +static uintptr_t +uart_fdt_find_by_node(phandle_t node, int class_list) +{ + struct ofw_compat_data **cd; + const struct ofw_compat_data *ocd; + + if (class_list) { + SET_FOREACH(cd, uart_fdt_class_set) { + ocd = uart_fdt_find_compatible(node, *cd); + if ((ocd != NULL) && (ocd->ocd_data != 0)) + return (ocd->ocd_data); + } + } else { + SET_FOREACH(cd, uart_fdt_class_and_device_set) { + ocd = uart_fdt_find_compatible(node, *cd); + if ((ocd != NULL) && (ocd->ocd_data != 0)) + return (ocd->ocd_data); + } + } + + return (0); +} + +int +uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst, + bus_space_handle_t *bsh, int *baud, u_int *rclk, u_int *shiftp) +{ + const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", + "stdin-path", "stdin", NULL}; + const char **name; + struct uart_class *class; + phandle_t node, chosen; + pcell_t br, clk, shift; + char *cp; + int err; + + /* Has the user forced a specific device node? */ + cp = kern_getenv("hw.fdt.console"); + if (cp == NULL) { + /* + * Retrieve /chosen/std{in,out}. + */ + node = -1; + if ((chosen = OF_finddevice("/chosen")) != -1) { + for (name = propnames; *name != NULL; name++) { + if (phandle_chosen_propdev(chosen, *name, + &node) == 0) + break; + } + } + if (chosen == -1 || *name == NULL) + node = OF_finddevice("serial0"); /* Last ditch */ + } else { + node = OF_finddevice(cp); + } + + if (node == -1) + return (ENXIO); + + /* + * Check old style of UART definition first. Unfortunately, the common + * FDT processing is not possible if we have clock, power domains and + * pinmux stuff. + */ + class = (struct uart_class *)uart_fdt_find_by_node(node, 0); + if (class != NULL) { + if ((err = uart_fdt_get_clock(node, &clk)) != 0) + return (err); + } else { + /* Check class only linker set */ + class = + (struct uart_class *)uart_fdt_find_by_node(node, 1); + if (class == NULL) + return (ENXIO); + clk = 0; + } + + /* + * Retrieve serial attributes. + */ + if (uart_fdt_get_shift(node, &shift) != 0) + shift = uart_getregshift(class); + + if (OF_getencprop(node, "current-speed", &br, sizeof(br)) <= 0) + br = 0; + + err = OF_decode_addr(node, 0, bst, bsh, NULL); + if (err != 0) + return (err); + + *classp = class; + *baud = br; + *rclk = clk; + *shiftp = shift; + + return (0); +} + +static int uart_fdt_probe(device_t dev) { struct uart_softc *sc; Modified: stable/11/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- stable/11/sys/dev/uart/uart_cpu_fdt.c Mon Apr 2 20:12:25 2018 (r331884) +++ stable/11/sys/dev/uart/uart_cpu_fdt.c Mon Apr 2 20:47:55 2018 (r331885) @@ -120,14 +120,11 @@ uart_fdt_find_by_node(phandle_t node, int class_list) int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { - const char *propnames[] = {"stdout-path", "linux,stdout-path", "stdout", - "stdin-path", "stdin", NULL}; - const char **name; struct uart_class *class; - phandle_t node, chosen; - pcell_t shift, br, rclk; - char *cp; - int err; + bus_space_tag_t bst; + bus_space_handle_t bsh; + u_int shift, rclk; + int br, err; /* Allow overriding the FDT using the environment. */ class = &uart_ns8250_class; @@ -138,69 +135,24 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) if (devtype != UART_DEV_CONSOLE) return (ENXIO); - /* Has the user forced a specific device node? */ - cp = kern_getenv("hw.fdt.console"); - if (cp == NULL) { - /* - * Retrieve /chosen/std{in,out}. - */ - node = -1; - if ((chosen = OF_finddevice("/chosen")) != -1) { - for (name = propnames; *name != NULL; name++) { - if (phandle_chosen_propdev(chosen, *name, - &node) == 0) - break; - } - } - if (chosen == -1 || *name == NULL) - node = OF_finddevice("serial0"); /* Last ditch */ - } else { - node = OF_finddevice(cp); - } + err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, &shift); + if (err != 0) + return (err); - if (node == -1) /* Can't find anything */ - return (ENXIO); - /* - * Check old style of UART definition first. Unfortunately, the common - * FDT processing is not possible if we have clock, power domains and - * pinmux stuff. - */ - class = (struct uart_class *)uart_fdt_find_by_node(node, 0); - if (class != NULL) { - if ((err = uart_fdt_get_clock(node, &rclk)) != 0) - return (err); - } else { - /* Check class only linker set */ - class = - (struct uart_class *)uart_fdt_find_by_node(node, 1); - if (class == NULL) - return (ENXIO); - rclk = 0; - } - - /* - * Retrieve serial attributes. - */ - if (uart_fdt_get_shift(node, &shift) != 0) - shift = uart_getregshift(class); - - if (OF_getencprop(node, "current-speed", &br, sizeof(br)) <= 0) - br = 0; - - /* * Finalize configuration. */ di->bas.chan = 0; - di->bas.regshft = (u_int)shift; + di->bas.regshft = shift; di->baudrate = br; - di->bas.rclk = (u_int)rclk; + di->bas.rclk = rclk; di->ops = uart_getops(class); di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; + di->bas.bst = bst; + di->bas.bsh = bsh; - err = OF_decode_addr(node, 0, &di->bas.bst, &di->bas.bsh, NULL); uart_bus_space_mem = di->bas.bst; uart_bus_space_io = NULL; Modified: stable/11/sys/dev/uart/uart_cpu_fdt.h ============================================================================== --- stable/11/sys/dev/uart/uart_cpu_fdt.h Mon Apr 2 20:12:25 2018 (r331884) +++ stable/11/sys/dev/uart/uart_cpu_fdt.h Mon Apr 2 20:47:55 2018 (r331885) @@ -50,6 +50,8 @@ SET_DECLARE(uart_fdt_class_set, struct ofw_compat_data #define UART_FDT_CLASS(data) \ DATA_SET(uart_fdt_class_set, data) +int uart_cpu_fdt_probe(struct uart_class **, bus_space_tag_t *, + bus_space_handle_t *, int *, u_int *, u_int *); int uart_fdt_get_clock(phandle_t node, pcell_t *cell); int uart_fdt_get_shift(phandle_t node, pcell_t *cell); From owner-svn-src-all@freebsd.org Mon Apr 2 20:54:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CBF0F84A06; Mon, 2 Apr 2018 20:54:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B418B719F2; Mon, 2 Apr 2018 20:54:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90E091AC86; Mon, 2 Apr 2018 20:54:33 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32KsXno092123; Mon, 2 Apr 2018 20:54:33 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32KsXDs092120; Mon, 2 Apr 2018 20:54:33 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022054.w32KsXDs092120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 20:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331886 - in stable/11/sys/dev: fdt uart usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys/dev: fdt uart usb/net X-SVN-Commit-Revision: 331886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 20:54:34 -0000 Author: gonzo Date: Mon Apr 2 20:54:33 2018 New Revision: 331886 URL: https://svnweb.freebsd.org/changeset/base/331886 Log: MFC r308533 by andrew: Use ofw_bus_node_is_compatible in more drivers used on arm. Sponsored by: ABT Systems Ltd Modified: stable/11/sys/dev/fdt/fdt_arm_platform.c stable/11/sys/dev/uart/uart_bus_fdt.c stable/11/sys/dev/usb/net/if_smsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/fdt/fdt_arm_platform.c ============================================================================== --- stable/11/sys/dev/fdt/fdt_arm_platform.c Mon Apr 2 20:47:55 2018 (r331885) +++ stable/11/sys/dev/fdt/fdt_arm_platform.c Mon Apr 2 20:54:33 2018 (r331886) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "platform_if.h" @@ -58,7 +59,7 @@ fdt_platform_probe(platform_t plat) /* Is the device is compatible? */ root = OF_finddevice("/"); compat = FDT_PLATFORM(plat)->fdt_compatible; - if (fdt_is_compatible(root, compat) != 0) + if (ofw_bus_node_is_compatible(root, compat) != 0) return 0; /* Not compatible, return an error */ Modified: stable/11/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/11/sys/dev/uart/uart_bus_fdt.c Mon Apr 2 20:47:55 2018 (r331885) +++ stable/11/sys/dev/uart/uart_bus_fdt.c Mon Apr 2 20:54:33 2018 (r331886) @@ -123,7 +123,7 @@ uart_fdt_find_compatible(phandle_t node, const struct const struct ofw_compat_data *ocd; for (ocd = cd; ocd->ocd_str != NULL; ocd++) { - if (fdt_is_compatible(node, ocd->ocd_str)) + if (ofw_bus_node_is_compatible(node, ocd->ocd_str)) return (ocd); } return (NULL); Modified: stable/11/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/11/sys/dev/usb/net/if_smsc.c Mon Apr 2 20:47:55 2018 (r331885) +++ stable/11/sys/dev/usb/net/if_smsc.c Mon Apr 2 20:54:33 2018 (r331886) @@ -1568,8 +1568,8 @@ smsc_fdt_find_eth_node(phandle_t start) /* Traverse through entire tree to find usb ethernet nodes. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (fdt_is_compatible(node, "net,ethernet") && - fdt_is_compatible(node, "usb,device")) + if (ofw_bus_node_is_compatible(node, "net,ethernet") && + ofw_bus_node_is_compatible(node, "usb,device")) return (node); child = smsc_fdt_find_eth_node(node); if (child != -1) From owner-svn-src-all@freebsd.org Mon Apr 2 21:33:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E038AF86994; Mon, 2 Apr 2018 21:33:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB1173493; Mon, 2 Apr 2018 21:33:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A4C61B30A; Mon, 2 Apr 2018 21:33:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32LXGnB013075; Mon, 2 Apr 2018 21:33:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32LXGww013074; Mon, 2 Apr 2018 21:33:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804022133.w32LXGww013074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Apr 2018 21:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331887 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 331887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 21:33:17 -0000 Author: trasz Date: Mon Apr 2 21:33:16 2018 New Revision: 331887 URL: https://svnweb.freebsd.org/changeset/base/331887 Log: Bring some order to horizontal and vertical spacing in hier(7). MFC after: 2 weeks Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Apr 2 20:54:33 2018 (r331886) +++ head/share/man/man7/hier.7 Mon Apr 2 21:33:16 2018 (r331887) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 27, 2018 +.Dd April 2, 2018 .Dt HIER 7 .Os .Sh NAME @@ -84,7 +84,7 @@ comments apply device special files managed by .Xr devfs 5 .Pp -.Bl -tag -width "net/" -compact +.Bl -tag -width "defaults/" -compact .It Pa fd/ file descriptor files; see @@ -93,7 +93,7 @@ see .It Pa /etc/ system configuration files and scripts .Pp -.Bl -tag -width "bluetooth/" -compact +.Bl -tag -width "defaults/" -compact .It Pa defaults/ default system configuration files; see @@ -143,7 +143,7 @@ critical system libraries needed for binaries in and .Pa /sbin .Pp -.Bl -tag -width "geom/" -compact +.Bl -tag -width "defaults/" -compact .It Pa geom/ class-specific libraries for the .Xr geom 8 @@ -183,7 +183,7 @@ temporary files that are not guaranteed to persist acr .It Pa /usr/ contains the majority of user utilities and applications .Pp -.Bl -tag -width "libdata/" -compact +.Bl -tag -width "defaults/" -compact .It Pa bin/ common utilities, programming tools, and applications .It Pa compat/ @@ -264,7 +264,6 @@ RAID3 GEOM class .It Pa stripe/ STRIPE GEOM class .El -.Pp .It Pa libmilter/ C include files for libmilter, the @@ -274,7 +273,7 @@ mail filter API machine-specific C include files .It Pa net/ miscellaneous network C include files -.Bl -tag -width "altq/" -compact +.Bl -tag -width Fl -compact .It Pa altq/ C include files for alternate queueing .El @@ -342,6 +341,7 @@ see shared and archive .Xr ar 1 Ns -type libraries +.Pp .Bl -tag -width Fl -compact .It Pa aout/ a.out archive libraries @@ -361,6 +361,7 @@ OpenSSL (Cryptography/SSL toolkit) dynamically loadabl .Pp .It Pa libdata/ miscellaneous utility data files +.Pp .Bl -tag -width Fl -compact .It Pa gcc/ .Xr gcc 1 @@ -373,6 +374,7 @@ see .Pp .It Pa libexec/ system daemons & system utilities (executed by other programs) +.Pp .Bl -tag -width Fl -compact .It Pa aout/ utilities to manipulate a.out executables @@ -435,7 +437,7 @@ system daemons & system utilities (executed by users) .It Pa share/ architecture-independent files .Pp -.Bl -tag -width "calendar/" -compact +.Bl -tag -width Fl -compact .It Pa calendar/ a variety of pre-fab calendar files; see @@ -444,7 +446,6 @@ see word lists; see .Xr look 1 -.Pp .Bl -tag -width Fl -compact .It Pa freebsd .Fx Ns -specific @@ -452,7 +453,6 @@ terms, proper names, and jargon .It Pa web2 words from Webster's 2nd International .El -.Pp .It Pa doc/ miscellaneous documentation; source for most of the printed @@ -489,7 +489,6 @@ tutorials .It Pa zh/ Chinese translations of documents in /usr/share/doc .El -.Pp .It Pa examples/ various examples for users and programmers .It Pa firmware/ @@ -498,14 +497,13 @@ firmware images loaded by userland programs ASCII text files used by various games .It Pa keys/ known trusted and revoked keys. -.Bl -tag -width "pkg/" -compact +.Bl -tag -width Fl -compact .It Pa pkg/ fingerprints for .Xr pkg 7 and .Xr pkg 8 .El -.Pp .It Pa locale/ localization files; see @@ -553,7 +551,7 @@ MIB files files used by syscons; see .Xr syscons 4 -.Bl -tag -width "scrnmaps/" -compact +.Bl -tag -width Fl -compact .It Pa fonts/ console fonts; see @@ -581,7 +579,7 @@ localization support and utilities for files used by vt; see .Xr vt 4 -.Bl -tag -width "scrnmaps/" -compact +.Bl -tag -width Fl -compact .It Pa fonts/ console fonts; see @@ -602,6 +600,7 @@ timezone configuration information; see .Xr tzfile 5 .El +.Pp .It Pa src/ .Bx , third-party, and/or local source files @@ -653,7 +652,7 @@ source for files in boot loader source code .It Pa sys/ kernel source code -.Bl -tag -width "opencrypto/" -compact +.Bl -tag -width Fl -compact .It Pa amd64/ AMD64 architecture support .It Pa arm/ @@ -741,7 +740,7 @@ for more details. .It Pa /var/ multi-purpose log, temporary, transient, and spool files .Pp -.Bl -tag -width "preserve/" -compact +.Bl -tag -width "defaults/" -compact .It Pa account/ system accounting files .Pp @@ -756,7 +755,8 @@ see timed command scheduling files; see .Xr \&at 1 -.Bl -tag -width "preserve/" -compact +.Pp +.Bl -tag -width Fl -compact .It Pa jobs/ directory containing job files .It Pa spool/ @@ -767,7 +767,8 @@ directory containing output spool files miscellaneous backup files .It Pa cache/ miscellaneous cached files -.Bl -tag -width "pkg/" -compact +.Pp +.Bl -tag -width Fl -compact .It Pa pkg/ cached packages for .Xr pkg 8 @@ -782,7 +783,8 @@ and files used by cron; see .Xr cron 8 -.Bl -tag -width "preserve/" -compact +.Pp +.Bl -tag -width Fl -compact .It Pa tabs/ crontab files; see @@ -871,10 +873,12 @@ line printer spooling directories .Pp .It Pa tmp/ temporary files that are kept between system reboots +.Pp .Bl -tag -width Fl -compact .It Pa vi.recover/ the directory where recovery files are stored .El +.Pp .It Pa yp/ the NIS maps .El From owner-svn-src-all@freebsd.org Mon Apr 2 21:38:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C31BDF86EFE; Mon, 2 Apr 2018 21:38:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D271A73854; Mon, 2 Apr 2018 21:38:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w32La4S6046487 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 2 Apr 2018 14:36:04 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w32La4uN046486; Mon, 2 Apr 2018 14:36:04 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 2 Apr 2018 14:36:04 -0700 From: Gleb Smirnoff To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331414 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys Message-ID: <20180402213604.GC1917@FreeBSD.org> References: <201803230250.w2N2odbi085924@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201803230250.w2N2odbi085924@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 21:38:23 -0000 Alexander, Does it make sense to leave the manual padding at all, if you got compiler hint __aligned(CACHE_LINE_SIZE)? With manual padding can get broken again later. On Fri, Mar 23, 2018 at 02:50:39AM +0000, Alexander Motin wrote: A> Author: mav A> Date: Fri Mar 23 02:50:38 2018 A> New Revision: 331414 A> URL: https://svnweb.freebsd.org/changeset/base/331414 A> A> Log: A> Reduce struct aggsum_bucket padding to fit into one cache line. A> A> Reported by: mjg A> A> Modified: A> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h A> A> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h A> ============================================================================== A> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h Fri Mar 23 02:45:09 2018 (r331413) A> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/aggsum.h Fri Mar 23 02:50:38 2018 (r331414) A> @@ -29,7 +29,7 @@ typedef struct aggsum_bucket { A> kmutex_t asc_lock; A> int64_t asc_delta; A> uint64_t asc_borrowed; A> - uint64_t asc_pad[4]; /* pad out to cache line (64 bytes) */ A> + uint64_t asc_pad[2]; /* pad out to cache line (64 bytes) */ A> } aggsum_bucket_t __aligned(CACHE_LINE_SIZE); A> A> /* A> -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Apr 2 21:38:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F74CF86F75; Mon, 2 Apr 2018 21:38:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02AF073989; Mon, 2 Apr 2018 21:38:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1BAC1B30F; Mon, 2 Apr 2018 21:38:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32LcomJ013307; Mon, 2 Apr 2018 21:38:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32Lco0n013306; Mon, 2 Apr 2018 21:38:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022138.w32Lco0n013306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 21:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331888 - stable/11/sys/arm/nvidia X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/arm/nvidia X-SVN-Commit-Revision: 331888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 21:38:51 -0000 Author: gonzo Date: Mon Apr 2 21:38:50 2018 New Revision: 331888 URL: https://svnweb.freebsd.org/changeset/base/331888 Log: MFC r302498 by andrew: Remove an unneeded call to fdt_get_unit, the return value is unused. Sponsored by: ABT Systems Ltd Modified: stable/11/sys/arm/nvidia/tegra_pcie.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_pcie.c Mon Apr 2 21:33:16 2018 (r331887) +++ stable/11/sys/arm/nvidia/tegra_pcie.c Mon Apr 2 21:38:50 2018 (r331888) @@ -1256,7 +1256,7 @@ tegra_pcib_set_bar(struct tegra_pcib_softc *sc, int ba } static int -tegra_pcib_enable(struct tegra_pcib_softc *sc, uint32_t port) +tegra_pcib_enable(struct tegra_pcib_softc *sc) { int rv; int i; @@ -1442,7 +1442,6 @@ tegra_pcib_attach(device_t dev) { struct tegra_pcib_softc *sc; phandle_t node; - uint32_t unit; int rv; int rid; struct tegra_pcib_port *port; @@ -1450,7 +1449,6 @@ tegra_pcib_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - unit = fdt_get_unit(dev); mtx_init(&sc->mtx, "msi_mtx", NULL, MTX_DEF); node = ofw_bus_get_node(dev); @@ -1552,7 +1550,7 @@ tegra_pcib_attach(device_t dev) /* * Enable PCIE device. */ - rv = tegra_pcib_enable(sc, unit); + rv = tegra_pcib_enable(sc); if (rv != 0) goto out; for (i = 0; i < TEGRA_PCIB_MAX_PORTS; i++) { From owner-svn-src-all@freebsd.org Mon Apr 2 21:48:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8E0F87868; Mon, 2 Apr 2018 21:48:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE7973FF4; Mon, 2 Apr 2018 21:48:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6149A1B4B6; Mon, 2 Apr 2018 21:48:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32LmU5m018180; Mon, 2 Apr 2018 21:48:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32LmTXA018175; Mon, 2 Apr 2018 21:48:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022148.w32LmTXA018175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 21:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331889 - in stable/11/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm sys X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm sys X-SVN-Commit-Revision: 331889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 21:48:31 -0000 Author: gonzo Date: Mon Apr 2 21:48:29 2018 New Revision: 331889 URL: https://svnweb.freebsd.org/changeset/base/331889 Log: MFC r303035 by markm: Random bit generator (RBG) driver for RPi and RPi2. Summary: This driver supports the following methods to trigger gathering random bits from the hardware: 1. interrupt when the FIFO is full (default) fed into the harvest queue 2. callout (when BCM2835_RNG_USE_CALLOUT is defined) every second if hz is less than 100, otherwise hz / 100, feeding the random bits into the harvest queue If the kernel is booted with verbose enabled, the contents of the registers will be dumped after the RBG is started during the attach routine. Author: hackagadget_gmail.com (Stephen J. Kiernan) Test Plan: Built RPI2 kernel and booted on board. Tested the different methods to feed the harvest queue (callout, interrupt) and the interrupt driven approach seems best. However, keeping the other method for people to be able to experiment with. Reviewed By: adrian, delphij, markm Differential Revision: https://reviews.freebsd.org/D6888 Added: stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c - copied unchanged from r303035, head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Modified: stable/11/sys/arm/broadcom/bcm2835/files.bcm283x stable/11/sys/boot/fdt/dts/arm/bcm2835.dtsi stable/11/sys/boot/fdt/dts/arm/bcm2836.dtsi stable/11/sys/sys/random.h Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c (from r303035, head/sys/arm/broadcom/bcm2835/bcm2835_rng.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon Apr 2 21:48:29 2018 (r331889, copy of r303035, head/sys/arm/broadcom/bcm2835/bcm2835_rng.c) @@ -0,0 +1,534 @@ +/* + * Copyright (c) 2015, 2016, Stephen J. Kiernan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#if !defined(BCM2835_RNG_USE_CALLOUT) +#define BCM2835_RNG_USE_INTERRUPT +#endif + +static device_attach_t bcm2835_rng_attach; +static device_detach_t bcm2835_rng_detach; +static device_probe_t bcm2835_rng_probe; + +#define RNG_CTRL 0x00 /* RNG Control Register */ +#define RNG_COMBLK1_OSC 0x003f0000 /* Combiner Blk 1 Oscillator */ +#define RNG_COMBLK1_OSC_SHIFT 16 +#define RNG_COMBLK2_OSC 0x0fc00000 /* Combiner Blk 2 Oscillator */ +#define RNG_COMBLK2_OSC_SHIFT 22 +#define RNG_JCLK_BYP_DIV_CNT 0x0000ff00 /* Jitter clk bypass divider + count */ +#define RNG_JCLK_BYP_DIV_CNT_SHIFT 8 +#define RNG_JCLK_BYP_SRC 0x00000020 /* Jitter clk bypass source */ +#define RNG_JCLK_BYP_SEL 0x00000010 /* Jitter clk bypass select */ +#define RNG_RBG2X 0x00000002 /* RBG 2X SPEED */ +#define RNG_RBGEN_BIT 0x00000001 /* Enable RNG bit */ + +#define RNG_STATUS 0x04 /* RNG status register */ +#define RND_VAL_SHIFT 24 /* Shift for valid words */ +#define RND_VAL_MASK 0x000000ff /* Number valid words mask */ +#define RND_VAL_WARM_CNT 0x40000 /* RNG Warm Up count */ +#define RND_WARM_CNT 0xfffff /* RNG Warm Up Count mask */ + +#define RNG_DATA 0x08 /* RNG Data Register */ +#define RNG_FF_THRES 0x0c +#define RNG_FF_THRES_MASK 0x0000001f + +#define RNG_INT_MASK 0x10 +#define RNG_INT_OFF_BIT 0x00000001 + +#define RNG_FF_DEFAULT 0x10 /* FIFO threshold default */ + +#define RNG_FIFO_WORDS (RNG_FF_DEFAULT / sizeof(uint32_t)) + +#define RNG_NUM_OSCILLATORS 6 +#define RNG_STALL_COUNT_DEFAULT 10 + +struct bcm2835_rng_softc { + device_t sc_dev; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + void * sc_intr_hdl; +#if defined(BCM2835_RNG_USE_CALLOUT) || defined(BCM2835_RNG_USE_INTERRUPT) + uint32_t sc_buf[RNG_FIFO_WORDS]; +#endif +#if defined(BCM2835_RNG_USE_CALLOUT) + struct callout sc_rngto; + int sc_rnghz; +#endif + int sc_stall_count; + int sc_rbg2x; + long sc_underrun; +}; + +static __inline void +bcm2835_rng_stat_inc_underrun(struct bcm2835_rng_softc *sc) +{ + + atomic_add_long(&sc->sc_underrun, 1); +} + +static __inline uint32_t +bcm2835_rng_read4(struct bcm2835_rng_softc *sc, bus_size_t off) +{ + + return bus_read_4(sc->sc_mem_res, off); +} + +static __inline void +bcm2835_rng_read_multi4(struct bcm2835_rng_softc *sc, bus_size_t off, + uint32_t *datap, bus_size_t count) +{ + + bus_read_multi_4(sc->sc_mem_res, off, datap, count); +} + +static __inline void +bcm2835_rng_write4(struct bcm2835_rng_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->sc_mem_res, off, val); +} + +static void +bcm2835_rng_dump_registers(struct bcm2835_rng_softc *sc, struct sbuf *sbp) +{ + uint32_t comblk2_osc, comblk1_osc, jclk_byp_div, val; + int i; + + /* Display RNG control register contents */ + val = bcm2835_rng_read4(sc, RNG_CTRL); + sbuf_printf(sbp, "RNG_CTRL (%08x)\n", val); + + comblk2_osc = (val & RNG_COMBLK2_OSC) >> RNG_COMBLK2_OSC_SHIFT; + sbuf_printf(sbp, " RNG_COMBLK2_OSC (%02x)\n", comblk2_osc); + for (i = 0; i < RNG_NUM_OSCILLATORS; i++) + if ((comblk2_osc & (1 << i)) == 0) + sbuf_printf(sbp, " Oscillator %d enabled\n", i + 1); + + comblk1_osc = (val & RNG_COMBLK1_OSC) >> RNG_COMBLK1_OSC_SHIFT; + sbuf_printf(sbp, " RNG_COMBLK1_OSC (%02x)\n", comblk1_osc); + for (i = 0; i < RNG_NUM_OSCILLATORS; i++) + if ((comblk1_osc & (1 << i)) == 0) + sbuf_printf(sbp, " Oscillator %d enabled\n", i + 1); + + jclk_byp_div = (val & RNG_JCLK_BYP_DIV_CNT) >> + RNG_JCLK_BYP_DIV_CNT_SHIFT; + sbuf_printf(sbp, + " RNG_JCLK_BYP_DIV_CNT (%02x)\n APB clock frequency / %d\n", + jclk_byp_div, 2 * (jclk_byp_div + 1)); + + sbuf_printf(sbp, " RNG_JCLK_BYP_SRC:\n %s\n", + (val & RNG_JCLK_BYP_SRC) ? "Use divided down APB clock" : + "Use RNG clock (APB clock)"); + + sbuf_printf(sbp, " RNG_JCLK_BYP_SEL:\n %s\n", + (val & RNG_JCLK_BYP_SEL) ? "Bypass internal jitter clock" : + "Use internal jitter clock"); + + if ((val & RNG_RBG2X) != 0) + sbuf_cat(sbp, " RNG_RBG2X: RNG 2X SPEED enabled\n"); + + if ((val & RNG_RBGEN_BIT) != 0) + sbuf_cat(sbp, " RNG_RBGEN_BIT: RBG enabled\n"); + + /* Display RNG status register contents */ + val = bcm2835_rng_read4(sc, RNG_STATUS); + sbuf_printf(sbp, "RNG_CTRL (%08x)\n", val); + sbuf_printf(sbp, " RND_VAL: %02x\n", + (val >> RND_VAL_SHIFT) & RND_VAL_MASK); + sbuf_printf(sbp, " RND_WARM_CNT: %05x\n", val & RND_WARM_CNT); + + /* Display FIFO threshold register contents */ + val = bcm2835_rng_read4(sc, RNG_FF_THRES); + sbuf_printf(sbp, "RNG_FF_THRES: %05x\n", val & RNG_FF_THRES_MASK); + + /* Display interrupt mask register contents */ + val = bcm2835_rng_read4(sc, RNG_INT_MASK); + sbuf_printf(sbp, "RNG_INT_MASK: interrupt %s\n", + ((val & RNG_INT_OFF_BIT) != 0) ? "disabled" : "enabled"); +} + +static void +bcm2835_rng_disable_intr(struct bcm2835_rng_softc *sc) +{ + uint32_t mask; + + /* Set the interrupt off bit in the interrupt mask register */ + mask = bcm2835_rng_read4(sc, RNG_INT_MASK); + mask |= RNG_INT_OFF_BIT; + bcm2835_rng_write4(sc, RNG_INT_MASK, mask); +} + +#if defined(BCM2835_RNG_USE_INTERRUPT) +static void +bcm2835_rng_enable_intr(struct bcm2835_rng_softc *sc) +{ + uint32_t mask; + + /* Clear the interrupt off bit in the interrupt mask register */ + mask = bcm2835_rng_read4(sc, RNG_INT_MASK); + mask &= ~RNG_INT_OFF_BIT; + bcm2835_rng_write4(sc, RNG_INT_MASK, mask); +} +#endif + +static void +bcm2835_rng_start(struct bcm2835_rng_softc *sc) +{ + uint32_t ctrl; + + /* Disable the interrupt */ + bcm2835_rng_disable_intr(sc); + + /* Set the warmup count */ + bcm2835_rng_write4(sc, RNG_STATUS, RND_VAL_WARM_CNT); + + /* Enable the RNG */ + ctrl = bcm2835_rng_read4(sc, RNG_CTRL); + ctrl |= RNG_RBGEN_BIT; + if (sc->sc_rbg2x) + ctrl |= RNG_RBG2X; + bcm2835_rng_write4(sc, RNG_CTRL, ctrl); + +#if defined(BCM2835_RNG_USE_INTERRUPT) + /* Enable the interrupt */ + bcm2835_rng_enable_intr(sc); +#endif +} + +static void +bcm2835_rng_stop(struct bcm2835_rng_softc *sc) +{ + uint32_t ctrl; + + /* Disable the RNG */ + ctrl = bcm2835_rng_read4(sc, RNG_CTRL); + ctrl &= ~RNG_RBGEN_BIT; + bcm2835_rng_write4(sc, RNG_CTRL, ctrl); +} + +static void +bcm2835_rng_harvest(struct bcm2835_rng_softc *sc) +{ + uint32_t *dest; + uint32_t status; + u_int cnt, nread, num_avail, num_words; + int seen_underrun, num_stalls; + + dest = sc->sc_buf; + nread = num_words = 0; + seen_underrun = num_stalls = 0; + for (cnt = sizeof(sc->sc_buf) / sizeof(uint32_t); cnt > 0; + cnt -= num_words) { + /* Read status register to find out how many words available */ + status = bcm2835_rng_read4(sc, RNG_STATUS); + num_avail = (status >> RND_VAL_SHIFT) & RND_VAL_MASK; + + /* If we have none... */ + if (num_avail == 0) { + bcm2835_rng_stat_inc_underrun(sc); + if (++seen_underrun >= sc->sc_stall_count) { + if (num_stalls++ > 0) { + device_printf(sc->sc_dev, + "RNG stalled, disabling device\n"); + bcm2835_rng_stop(sc); + break; + } else { + device_printf(sc->sc_dev, + "Too many underruns, resetting\n"); + bcm2835_rng_stop(sc); + bcm2835_rng_start(sc); + seen_underrun = 0; + } + } + /* Try again */ + continue; + } + + CTR2(KTR_DEV, "%s: %d words available in RNG FIFO", + device_get_nameunit(sc->sc_dev), num_avail); + + /* Pull MIN(num_avail, cnt) words from the FIFO */ + num_words = (num_avail > cnt) ? cnt : num_avail; + bcm2835_rng_read_multi4(sc, RNG_DATA, dest, + num_words); + dest += num_words; + nread += num_words; + } + + cnt = nread * sizeof(uint32_t); + if (cnt > 0) + random_harvest_queue(sc->sc_buf, cnt, cnt * NBBY / 2, + RANDOM_PURE_BROADCOM); + +#if defined(BCM2835_RNG_USE_CALLOUT) + callout_reset(&sc->sc_rngto, sc->sc_rnghz, bcm2835_rng_harvest, sc); +#endif +} + +static int +sysctl_bcm2835_rng_2xspeed(SYSCTL_HANDLER_ARGS) +{ + struct bcm2835_rng_softc *sc = arg1; + int error, rbg2x; + + rbg2x = sc->sc_rbg2x; + error = sysctl_handle_int(oidp, &rbg2x, 0, req); + if (error) + return (error); + if (req->newptr == NULL) + return (error); + if (rbg2x == sc->sc_rbg2x) + return (0); + + /* Reset the RNG */ + bcm2835_rng_stop(sc); + sc->sc_rbg2x = rbg2x; + bcm2835_rng_start(sc); + + return (0); +} + +#ifdef BCM2835_RNG_DEBUG_REGISTERS +static int +sysctl_bcm2835_rng_dump(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct bcm2835_rng_softc *sc = arg1; + int error; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + sbuf_new_for_sysctl(&sb, NULL, 128, req); + bcm2835_rng_dump_registers(sc, &sb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error); +} +#endif + +static int +bcm2835_rng_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-rng")) + return (ENXIO); + + device_set_desc(dev, "Broadcom BCM2835 RNG"); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm2835_rng_attach(device_t dev) +{ + struct bcm2835_rng_softc *sc; + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; + int error, rid; + + error = 0; + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_stall_count = RNG_STALL_COUNT_DEFAULT; +#ifdef BCM2835_RNG_USE_CALLOUT + /* Initialize callout */ + callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); +#endif + TUNABLE_INT_FETCH("bcmrng.2xspeed", &sc->sc_rbg2x); + TUNABLE_INT_FETCH("bcmrng.stall_count", &sc->sc_stall_count); + + /* Allocate memory resources */ + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + bcm2835_rng_detach(dev); + return (ENXIO); + } + +#if defined(BCM2835_RNG_USE_INTERRUPT) + /* Allocate interrupt resource */ + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + bcm2835_rng_detach(dev); + return (ENXIO); + } + + /* Set up the interrupt handler */ + error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)bcm2835_rng_harvest, sc, &sc->sc_intr_hdl); + if (error) { + device_printf(dev, "Failed to set up IRQ\n"); + sc->sc_intr_hdl = NULL; + bcm2835_rng_detach(dev); + return (error); + } +#endif + + /* Start the RNG */ + bcm2835_rng_start(sc); + + /* Dump the registers if booting verbose */ + if (bootverbose) { + struct sbuf sb; + + (void) sbuf_new(&sb, NULL, 256, + SBUF_AUTOEXTEND | SBUF_INCLUDENUL); + bcm2835_rng_dump_registers(sc, &sb); + sbuf_trim(&sb); + error = sbuf_finish(&sb); + if (error == 0) + device_printf(dev, "%s", sbuf_data(&sb)); + sbuf_delete(&sb); + } + + sysctl_ctx = device_get_sysctl_ctx(dev); + sysctl_tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_LONG(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "underrun", CTLFLAG_RD, &sc->sc_underrun, + "Number of FIFO underruns"); + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "2xspeed", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + sysctl_bcm2835_rng_2xspeed, "I", "Enable RBG 2X SPEED"); + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "stall_count", CTLFLAG_RW, &sc->sc_stall_count, + RNG_STALL_COUNT_DEFAULT, "Number of underruns to assume RNG stall"); +#ifdef BCM2835_RNG_DEBUG_REGISTERS + SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "dumpregs", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); +#endif + +#if defined(BCM2835_RNG_USE_CALLOUT) + /* Reset callout */ + if (hz >= 100) + sc->sc_rnghz = hz / 100; + else + sc->sc_rnghz = 1; + callout_reset(&sc->sc_rngto, sc->sc_rnghz, bcm2835_rng_harvest, sc); +#endif + + return (0); +} + +static int +bcm2835_rng_detach(device_t dev) +{ + struct bcm2835_rng_softc *sc; +#if defined(BCM2835_RNG_USE_INTERRUPT) + int error; +#endif + + sc = device_get_softc(dev); + + /* Stop the RNG */ + bcm2835_rng_stop(sc); + + /* Drain the callout it */ +#if defined(BCM2835_RNG_USE_CALLOUT) + callout_drain(&sc->sc_rngto); +#endif + +#if defined(BCM2835_RNG_USE_INTERRUPT) + /* Tear down the interrupt */ + if (sc->sc_irq_res && sc->sc_intr_hdl) { + error = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl); + if (error != 0) { + device_printf(dev, "could not tear down IRQ\n"); + return (error); + } + sc->sc_intr_hdl = NULL; + } + + /* Release interrupt resource */ + if (sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } +#endif + + /* Release memory resource */ + if (sc->sc_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static device_method_t bcm2835_rng_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm2835_rng_probe), + DEVMETHOD(device_attach, bcm2835_rng_attach), + DEVMETHOD(device_detach, bcm2835_rng_detach), + + DEVMETHOD_END +}; + +static driver_t bcm2835_rng_driver = { + "bcmrng", + bcm2835_rng_methods, + sizeof(struct bcm2835_rng_softc) +}; +static devclass_t bcm2835_rng_devclass; + +DRIVER_MODULE(bcm2835_rng, simplebus, bcm2835_rng_driver, + bcm2835_rng_devclass, 0, 0); +DRIVER_MODULE(bcm2835_rng, ofwbus, bcm2835_rng_driver, bcm2835_rng_devclass, 0, + 0); +MODULE_VERSION(bcm2835_rng, 1); +MODULE_DEPEND(bcm2835_rng, randomdev, 1, 1, 1); Modified: stable/11/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/files.bcm283x Mon Apr 2 21:38:50 2018 (r331888) +++ stable/11/sys/arm/broadcom/bcm2835/files.bcm283x Mon Apr 2 21:48:29 2018 (r331889) @@ -11,6 +11,7 @@ arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard arm/broadcom/bcm2835/bcm2835_mbox.c standard +arm/broadcom/bcm2835/bcm2835_rng.c optional random arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi arm/broadcom/bcm2835/bcm2835_vcio.c standard Modified: stable/11/sys/boot/fdt/dts/arm/bcm2835.dtsi ============================================================================== --- stable/11/sys/boot/fdt/dts/arm/bcm2835.dtsi Mon Apr 2 21:38:50 2018 (r331888) +++ stable/11/sys/boot/fdt/dts/arm/bcm2835.dtsi Mon Apr 2 21:48:29 2018 (r331889) @@ -396,6 +396,14 @@ }; }; + rng { + compatible = "broadcom,bcm2835-rng", + "broadcom,bcm2708-rng"; + reg = <0x104000 0x20>; + interrupts = <69>; + interrupt-parent = <&intc>; + }; + bsc0 { #address-cells = <1>; #size-cells = <0>; Modified: stable/11/sys/boot/fdt/dts/arm/bcm2836.dtsi ============================================================================== --- stable/11/sys/boot/fdt/dts/arm/bcm2836.dtsi Mon Apr 2 21:38:50 2018 (r331888) +++ stable/11/sys/boot/fdt/dts/arm/bcm2836.dtsi Mon Apr 2 21:48:29 2018 (r331889) @@ -389,6 +389,14 @@ }; }; + rng { + compatible = "broadcom,bcm2835-rng", + "broadcom,bcm2708-rng"; + reg = <0x104000 0x20>; + interrupts = <69>; + interrupt-parent = <&intc>; + }; + bsc0 { #address-cells = <1>; #size-cells = <0>; Modified: stable/11/sys/sys/random.h ============================================================================== --- stable/11/sys/sys/random.h Mon Apr 2 21:38:50 2018 (r331888) +++ stable/11/sys/sys/random.h Mon Apr 2 21:48:29 2018 (r331889) @@ -90,6 +90,7 @@ enum random_entropy_source { RANDOM_PURE_NEHEMIAH, RANDOM_PURE_RNDTEST, RANDOM_PURE_VIRTIO, + RANDOM_PURE_BROADCOM, ENTROPYSOURCE }; From owner-svn-src-all@freebsd.org Mon Apr 2 22:02:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4F83F4F8EF; Mon, 2 Apr 2018 22:02:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0D474B8F; Mon, 2 Apr 2018 22:02:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 951951B7DE; Mon, 2 Apr 2018 22:02:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32M2oZL028120; Mon, 2 Apr 2018 22:02:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32M2nfB028113; Mon, 2 Apr 2018 22:02:49 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022202.w32M2nfB028113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 22:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331890 - in stable/11/sys/arm: arm xscale/i8134x X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys/arm: arm xscale/i8134x X-SVN-Commit-Revision: 331890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 22:02:51 -0000 Author: gonzo Date: Mon Apr 2 22:02:49 2018 New Revision: 331890 URL: https://svnweb.freebsd.org/changeset/base/331890 Log: MFC r305094, r305096-r305097 r305094 by cognet: Garbage collect bits forgotten in r295267. r305096 by cognet: Some old arm ports don't load the kernel at the beginning of the memory, because the bootloader, ie redboot, won't let them do so, and so used the memory before the kernel for early memory allocation, such as pagetables, stacks, etc... Make a bit of an effort to try to get that memory mapped. r305097 by cognet: Nuke obio_bs_tag, it was used before it was initialized, and arm_base_bs_tag is the same, anyway. Modified: stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S stable/11/sys/arm/arm/locore-v4.S stable/11/sys/arm/xscale/i8134x/crb_machdep.c stable/11/sys/arm/xscale/i8134x/obio.c stable/11/sys/arm/xscale/i8134x/obiovar.h stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/arm/cpufunc_asm_xscale_c3.S Mon Apr 2 22:02:49 2018 (r331890) @@ -364,8 +364,6 @@ ENTRY(xscalec3_setttb) #ifdef CACHE_CLEAN_BLOCK_INTR msr cpsr_fsxc, r3 -#else - str r2, [r3] #endif RET END(xscalec3_setttb) Modified: stable/11/sys/arm/arm/locore-v4.S ============================================================================== --- stable/11/sys/arm/arm/locore-v4.S Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/arm/locore-v4.S Mon Apr 2 22:02:49 2018 (r331890) @@ -194,6 +194,16 @@ Lunmapped: ldr r2, =(KERNVIRTADDR) mov r3, #64 bl build_pagetables +#if defined(PHYSADDR) && (KERNVIRTADDR != KERNBASE) +/* + * If the kernel wasn't loaded at the beginning of the ram, map the memory + * before the kernel too, as some ports use that for pagetables, stack, etc... + */ + ldr r1, =PHYSADDR + ldr r2, =KERNBASE + ldr r3, =((KERNVIRTADDR - KERNBASE) / L1_S_SIZE) + bl build_pagetables +#endif /* Create a device mapping for early_printf if specified. */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) Modified: stable/11/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/11/sys/arm/xscale/i8134x/crb_machdep.c Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/crb_machdep.c Mon Apr 2 22:02:49 2018 (r331890) @@ -286,7 +286,7 @@ initarm(struct arm_boot_params *abp) cpu_setup(); i80321_calibrate_delay(); - i81342_sdram_bounds(obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); + i81342_sdram_bounds(arm_base_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; cninit(); /* Set stack for exception handlers */ Modified: stable/11/sys/arm/xscale/i8134x/obio.c ============================================================================== --- stable/11/sys/arm/xscale/i8134x/obio.c Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/obio.c Mon Apr 2 22:02:49 2018 (r331890) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -bus_space_tag_t obio_bs_tag; - static int obio_probe(device_t dev) { @@ -69,8 +67,7 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - obio_bs_tag = arm_base_bs_tag; - sc->oba_st = obio_bs_tag; + sc->oba_st = arm_base_bs_tag; sc->oba_rman.rm_type = RMAN_ARRAY; sc->oba_rman.rm_descr = "OBIO I/O"; if (rman_init(&sc->oba_rman) != 0 || Modified: stable/11/sys/arm/xscale/i8134x/obiovar.h ============================================================================== --- stable/11/sys/arm/xscale/i8134x/obiovar.h Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/obiovar.h Mon Apr 2 22:02:49 2018 (r331890) @@ -50,6 +50,5 @@ struct obio_softc { struct rman oba_irq_rman; }; -extern bus_space_tag_t obio_bs_tag; #endif /* _IQ80321_OBIOVAR_H_ */ Modified: stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c ============================================================================== --- stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c Mon Apr 2 21:48:29 2018 (r331889) +++ stable/11/sys/arm/xscale/i8134x/uart_cpu_i81342.c Mon Apr 2 22:02:49 2018 (r331890) @@ -54,14 +54,14 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = obio_bs_tag; + di->bas.bst = arm_base_bs_tag; di->bas.regshft = 2; di->bas.rclk = 33334000; di->baudrate = 115200; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = obio_bs_tag; + uart_bus_space_io = arm_base_bs_tag; uart_bus_space_mem = NULL; di->bas.bsh = IOP34X_UART0_VADDR; return (0); From owner-svn-src-all@freebsd.org Mon Apr 2 22:04:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C19DEF4FAEF; Mon, 2 Apr 2018 22:04:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC8B74D1F; Mon, 2 Apr 2018 22:04:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w32M4UYr046670 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 2 Apr 2018 15:04:30 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w32M4UDI046669; Mon, 2 Apr 2018 15:04:30 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 2 Apr 2018 15:04:30 -0700 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331546 - head/etc/rc.d Message-ID: <20180402220430.GD1917@FreeBSD.org> References: <201803260936.w2Q9aMfD082758@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201803260936.w2Q9aMfD082758@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 22:04:32 -0000 Kristof, I just want to note that this is a huge change of behaviour of pf(4) for a user. Over a decade everybody has been used to the difference between "reload" and "resync". Yes, I admit that back in 2008 the difference was awkward and annoying, but todays I'm afraid that change would be more annoying than keeping status quo. This definitely shouldn't reach stable/11, absolutely. I won't argue about keeping it in head, and thus in 12.0. You are pf maintainer now and you know better. You take the risk of explaining the change to users :) On Mon, Mar 26, 2018 at 09:36:22AM +0000, Kristof Provost wrote: K> Author: kp K> Date: Mon Mar 26 09:36:22 2018 K> New Revision: 331546 K> URL: https://svnweb.freebsd.org/changeset/base/331546 K> K> Log: K> pf: reload and resync do the same thing K> K> The reload and resync commands for the startup script do exactly the same K> thing, so implement one as a call to the other. K> K> MFC after: 3 weeks K> K> Modified: K> head/etc/rc.d/pf K> K> Modified: head/etc/rc.d/pf K> ============================================================================== K> --- head/etc/rc.d/pf Mon Mar 26 09:07:16 2018 (r331545) K> +++ head/etc/rc.d/pf Mon Mar 26 09:36:22 2018 (r331546) K> @@ -53,12 +53,12 @@ pf_check() K> pf_reload() K> { K> echo "Reloading pf rules." K> - $pf_program -n -f "$pf_rules" $pf_flags || return 1 K> - $pf_program -f "$pf_rules" $pf_flags K> + pf_resync K> } K> K> pf_resync() K> { K> + $pf_program -n -f "$pf_rules" $pf_flags || return 1 K> $pf_program -f "$pf_rules" $pf_flags K> } K> K> -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Mon Apr 2 22:16:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB31F5198E; Mon, 2 Apr 2018 22:16:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 298DD75665; Mon, 2 Apr 2018 22:16:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 200F31B98A; Mon, 2 Apr 2018 22:16:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32MGJGI033046; Mon, 2 Apr 2018 22:16:19 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32MGJLX033045; Mon, 2 Apr 2018 22:16:19 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022216.w32MGJLX033045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 22:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331891 - stable/11/sys/arm/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/arm/arm X-SVN-Commit-Revision: 331891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 22:16:20 -0000 Author: gonzo Date: Mon Apr 2 22:16:19 2018 New Revision: 331891 URL: https://svnweb.freebsd.org/changeset/base/331891 Log: MFC r304488, r304623 r304488 by manu: Keep boot parameters in ARM trampoline code Currently boot parameters (r0 - r3) are forgotten in ARM trampoline code. This patch save them at startup and restore them before jumping into kernel _start() routine. This is usefull when booting with Linux ABI and/or custom bootloader. Submitted by: Grégory Soutadé Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D7395 r304623 by manu: Fix building for ARM kernel that have FLASHADDR, PHYSADDR and LOADERRAMADDR defined. Pointy Hat: myself Reported by: bz Modified: stable/11/sys/arm/arm/elf_trampoline.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/elf_trampoline.c ============================================================================== --- stable/11/sys/arm/arm/elf_trampoline.c Mon Apr 2 22:02:49 2018 (r331890) +++ stable/11/sys/arm/arm/elf_trampoline.c Mon Apr 2 22:16:19 2018 (r331891) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include /* For KERNVIRTADDR */ +#include extern char kernel_start[]; extern char kernel_end[]; @@ -48,7 +49,7 @@ extern void *_end; void _start(void); void __start(void); -void __startC(void); +void __startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3); extern unsigned int cpu_ident(void); extern void armv6_idcache_wbinv_all(void); @@ -125,6 +126,10 @@ static int arm_dcache_l2_nsets; static int arm_dcache_l2_assoc; static int arm_dcache_l2_linesize; +/* + * Boot parameters + */ +static struct arm_boot_params s_boot_params; extern int arm9_dcache_sets_inc; extern int arm9_dcache_sets_max; @@ -173,12 +178,17 @@ bzero(void *addr, int count) static void arm9_setup(void); void -_startC(void) +_startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3) { int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; unsigned int pc, kernphysaddr; + s_boot_params.abp_r0 = r0; + s_boot_params.abp_r1 = r1; + s_boot_params.abp_r2 = r2; + s_boot_params.abp_r3 = r3; + /* * Figure out the physical address the kernel was loaded at. This * assumes the entry point (this code right here) is in the first page, @@ -212,8 +222,15 @@ _startC(void) /* Temporary set the sp and jump to the new location. */ __asm __volatile( "mov sp, %1\n" + "mov r0, %2\n" + "mov r1, %3\n" + "mov r2, %4\n" + "mov r3, %5\n" "mov pc, %0\n" - : : "r" (target_addr), "r" (tmp_sp)); + : : "r" (target_addr), "r" (tmp_sp), + "r" (s_boot_params.abp_r0), "r" (s_boot_params.abp_r1), + "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3) + : "r0", "r1", "r2", "r3"); } #endif @@ -488,6 +505,7 @@ load_kernel(unsigned int kstart, unsigned int curaddr, vm_offset_t lastaddr = 0; Elf_Addr ssym = 0; Elf_Dyn *dp; + struct arm_boot_params local_boot_params; eh = (Elf32_Ehdr *)kstart; ssym = 0; @@ -556,6 +574,12 @@ load_kernel(unsigned int kstart, unsigned int curaddr, if (!d) return ((void *)lastaddr); + /* + * Now the stack is fixed, copy boot params + * before it's overrided + */ + memcpy(&local_boot_params, &s_boot_params, sizeof(local_boot_params)); + j = eh->e_phnum; for (i = 0; i < j; i++) { volatile char c; @@ -605,7 +629,10 @@ load_kernel(unsigned int kstart, unsigned int curaddr, "mcr p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ : "=r" (ssym)); /* Jump to the entry point. */ - ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); + ((void(*)(unsigned, unsigned, unsigned, unsigned)) + (entry_point - KERNVIRTADDR + curaddr)) + (local_boot_params.abp_r0, local_boot_params.abp_r1, + local_boot_params.abp_r2, local_boot_params.abp_r3); __asm __volatile(".globl func_end\n" "func_end:"); From owner-svn-src-all@freebsd.org Mon Apr 2 22:59:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A863AF59C9D; Mon, 2 Apr 2018 22:59:34 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C7687737D; Mon, 2 Apr 2018 22:59:34 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51E741C01B; Mon, 2 Apr 2018 22:59:34 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32MxYj9052847; Mon, 2 Apr 2018 22:59:34 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32MxYCb052846; Mon, 2 Apr 2018 22:59:34 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201804022259.w32MxYCb052846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Mon, 2 Apr 2018 22:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331892 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: bjk X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 331892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 22:59:34 -0000 Author: bjk (doc committer) Date: Mon Apr 2 22:59:33 2018 New Revision: 331892 URL: https://svnweb.freebsd.org/changeset/base/331892 Log: Fix formatting in snd_hda.4 Submitted by: 0mp Reviewed by: skreuzer Differential Revision: https://reviews.freebsd.org/D14922 Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Mon Apr 2 22:16:19 2018 (r331891) +++ head/share/man/man4/snd_hda.4 Mon Apr 2 22:59:33 2018 (r331892) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2012 +.Dd April 1, 2018 .Dt SND_HDA 4 .Os .Sh NAME @@ -564,7 +564,7 @@ input mix first external or second internal microphone input .It Va monitor first internal or second external microphone input -.It Va line , Va line1 , Va line2, Va line3 +.It Va line , Va line1 , Va line2 , Va line3 analog (line) inputs .It Va dig1 , Va dig2 , Va dig3 digital (S/PDIF, HDMI or DisplayPort) inputs @@ -572,7 +572,7 @@ digital (S/PDIF, HDMI or DisplayPort) inputs CD input .It Va speaker PC speaker input -.It Va phin , Va phout , Va radio . Va video +.It Va phin , Va phout , Va radio , Va video other random inputs .El .Pp From owner-svn-src-all@freebsd.org Mon Apr 2 23:19:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A90F0F6C335; Mon, 2 Apr 2018 23:19:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5881F780AC; Mon, 2 Apr 2018 23:19:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34C151C352; Mon, 2 Apr 2018 23:19:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32NJ9aq063216; Mon, 2 Apr 2018 23:19:09 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32NJ8HX063205; Mon, 2 Apr 2018 23:19:08 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022319.w32NJ8HX063205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 23:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331893 - in stable/11/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx nvidia/tegra124 qemu ti X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx nvidia/tegra124 qemu ti X-SVN-Commit-Revision: 331893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:19:10 -0000 Author: gonzo Date: Mon Apr 2 23:19:07 2018 New Revision: 331893 URL: https://svnweb.freebsd.org/changeset/base/331893 Log: MFC r306263, r306268 r306263 by andrew: Move cpu_reset to be a platform method to allow multiple implementations. Reviewed by: mmel Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D8010 r306268 by andrew: Also implement platform_cpu_reset on bcm2836 Modified: stable/11/sys/arm/allwinner/aw_machdep.c stable/11/sys/arm/arm/platform.c stable/11/sys/arm/arm/platform_if.m stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/11/sys/arm/freescale/imx/imx51_machdep.c stable/11/sys/arm/freescale/imx/imx53_machdep.c stable/11/sys/arm/freescale/imx/imx6_machdep.c stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c stable/11/sys/arm/qemu/virt_machdep.c stable/11/sys/arm/ti/ti_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/aw_machdep.c ============================================================================== --- stable/11/sys/arm/allwinner/aw_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/allwinner/aw_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -146,8 +146,8 @@ allwinner_devmap_init(platform_t plat) return (0); } -void -cpu_reset() +static void +allwinner_cpu_reset(platform_t plat) { aw_wdog_watchdog_reset(); printf("Reset failed!\n"); @@ -159,6 +159,7 @@ static platform_method_t a10_methods[] = { PLATFORMMETHOD(platform_attach, a10_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), PLATFORMMETHOD_END, }; @@ -170,6 +171,7 @@ static platform_method_t a13_methods[] = { PLATFORMMETHOD(platform_attach, a13_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), PLATFORMMETHOD_END, }; @@ -181,6 +183,7 @@ static platform_method_t a20_methods[] = { PLATFORMMETHOD(platform_attach, a20_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), @@ -196,6 +199,7 @@ static platform_method_t a31_methods[] = { PLATFORMMETHOD(platform_attach, a31_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), @@ -211,6 +215,7 @@ static platform_method_t a31s_methods[] = { PLATFORMMETHOD(platform_attach, a31s_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), @@ -226,6 +231,7 @@ static platform_method_t a83t_methods[] = { PLATFORMMETHOD(platform_attach, a83t_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, a83t_mp_start_ap), @@ -241,6 +247,7 @@ static platform_method_t h3_methods[] = { PLATFORMMETHOD(platform_attach, h3_attach), PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset), #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), Modified: stable/11/sys/arm/arm/platform.c ============================================================================== --- stable/11/sys/arm/arm/platform.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/arm/platform.c Mon Apr 2 23:19:07 2018 (r331893) @@ -188,6 +188,20 @@ platform_late_init(void) PLATFORM_LATE_INIT(plat_obj); } +void +cpu_reset(void) +{ + + PLATFORM_CPU_RESET(plat_obj); + + printf("cpu_reset failed"); + + intr_disable(); + while(1) { + cpu_sleep(0); + } +} + #ifdef MULTIDELAY static void platform_delay(int usec, void *arg __unused) Modified: stable/11/sys/arm/arm/platform_if.m ============================================================================== --- stable/11/sys/arm/arm/platform_if.m Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/arm/platform_if.m Mon Apr 2 23:19:07 2018 (r331893) @@ -133,3 +133,10 @@ METHOD void mp_setmaxid { METHOD void mp_start_ap { platform_t _plat; }; + +/** + * @brief Called by cpu_reset to reboot. + */ +METHOD void cpu_reset { + platform_t _plat; +}; Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -116,11 +116,10 @@ bcm2836_devmap_init(platform_t plat) -void -cpu_reset() +static void +bcm2835_cpu_reset(platform_t plat) { bcmwd_watchdog_reset(); - while (1); } #ifdef SOC_BCM2835 @@ -128,6 +127,7 @@ static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD(platform_devmap_init, bcm2835_devmap_init), PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), PLATFORMMETHOD(platform_late_init, bcm2835_late_init), + PLATFORMMETHOD(platform_cpu_reset, bcm2835_cpu_reset), PLATFORMMETHOD_END, }; @@ -139,6 +139,7 @@ static platform_method_t bcm2836_methods[] = { PLATFORMMETHOD(platform_devmap_init, bcm2836_devmap_init), PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), PLATFORMMETHOD(platform_late_init, bcm2835_late_init), + PLATFORMMETHOD(platform_cpu_reset, bcm2835_cpu_reset), PLATFORMMETHOD_END, }; Modified: stable/11/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx51_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/freescale/imx/imx51_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -81,8 +81,8 @@ imx51_devmap_init(platform_t plat) return (0); } -void -cpu_reset(void) +static void +imx51_cpu_reset(platform_t plat) { imx_wdog_cpu_reset(0x73F98000); @@ -97,6 +97,7 @@ static platform_method_t imx51_methods[] = { PLATFORMMETHOD(platform_attach, imx51_attach), PLATFORMMETHOD(platform_devmap_init, imx51_devmap_init), PLATFORMMETHOD(platform_lastaddr, imx51_lastaddr), + PLATFORMMETHOD(platform_cpu_reset, imx51_cpu_reset), PLATFORMMETHOD_END, }; Modified: stable/11/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx53_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/freescale/imx/imx53_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -77,8 +77,8 @@ imx53_devmap_init(platform_t plat) return (0); } -void -cpu_reset(void) +static void +imx53_cpu_reset(platform_t plat) { imx_wdog_cpu_reset(0x53F98000); @@ -93,6 +93,7 @@ static platform_method_t imx53_methods[] = { PLATFORMMETHOD(platform_attach, imx53_attach), PLATFORMMETHOD(platform_devmap_init, imx53_devmap_init), PLATFORMMETHOD(platform_lastaddr, imx53_lastaddr), + PLATFORMMETHOD(platform_cpu_reset, imx53_cpu_reset), PLATFORMMETHOD_END, }; Modified: stable/11/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/11/sys/arm/freescale/imx/imx6_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/freescale/imx/imx6_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -199,8 +199,8 @@ imx6_devmap_init(platform_t plat) return (0); } -void -cpu_reset(void) +static void +imx6_cpu_reset(platform_t plat) { const uint32_t IMX6_WDOG_CR_PHYS = 0x020bc000; @@ -326,6 +326,7 @@ static platform_method_t imx6_methods[] = { PLATFORMMETHOD(platform_lastaddr, imx6_lastaddr), PLATFORMMETHOD(platform_devmap_init, imx6_devmap_init), PLATFORMMETHOD(platform_late_init, imx6_late_init), + PLATFORMMETHOD(platform_cpu_reset, imx6_cpu_reset), PLATFORMMETHOD_END, }; Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/nvidia/tegra124/tegra124_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -93,8 +93,8 @@ tegra124_devmap_init(platform_t plat) return (0); } -void -cpu_reset(void) +static void +tegra124_cpu_reset(platform_t plat) { bus_space_handle_t pmc; uint32_t reg; @@ -144,6 +144,8 @@ static platform_method_t tegra124_methods[] = { PLATFORMMETHOD(platform_lastaddr, tegra124_lastaddr), PLATFORMMETHOD(platform_devmap_init, tegra124_devmap_init), PLATFORMMETHOD(platform_late_init, tegra124_late_init), + PLATFORMMETHOD(platform_cpu_reset, tegra124_cpu_reset), + #ifdef SMP PLATFORMMETHOD(platform_mp_start_ap, tegra124_mp_start_ap), PLATFORMMETHOD(platform_mp_setmaxid, tegra124_mp_setmaxid), Modified: stable/11/sys/arm/qemu/virt_machdep.c ============================================================================== --- stable/11/sys/arm/qemu/virt_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/qemu/virt_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -44,13 +44,6 @@ __FBSDID("$FreeBSD$"); #include "platform_if.h" -void -cpu_reset(void) -{ - - while (1); -} - static vm_offset_t virt_lastaddr(platform_t plat) { Modified: stable/11/sys/arm/ti/ti_machdep.c ============================================================================== --- stable/11/sys/arm/ti/ti_machdep.c Mon Apr 2 22:59:33 2018 (r331892) +++ stable/11/sys/arm/ti/ti_machdep.c Mon Apr 2 23:19:07 2018 (r331893) @@ -95,21 +95,20 @@ ti_am335x_devmap_init(platform_t plat) } #endif -void -cpu_reset() +static void +ti_plat_cpu_reset(platform_t plat) { if (ti_cpu_reset) (*ti_cpu_reset)(); else printf("no cpu_reset implementation\n"); - printf("Reset failed!\n"); - while (1); } #if defined(SOC_OMAP4) static platform_method_t omap4_methods[] = { PLATFORMMETHOD(platform_devmap_init, ti_omap4_devmap_init), PLATFORMMETHOD(platform_lastaddr, ti_lastaddr), + PLATFORMMETHOD(platform_cpu_reset, ti_plat_cpu_reset), PLATFORMMETHOD_END, }; @@ -120,6 +119,7 @@ FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430", 0); static platform_method_t am335x_methods[] = { PLATFORMMETHOD(platform_devmap_init, ti_am335x_devmap_init), PLATFORMMETHOD(platform_lastaddr, ti_lastaddr), + PLATFORMMETHOD(platform_cpu_reset, ti_plat_cpu_reset), PLATFORMMETHOD_END, }; From owner-svn-src-all@freebsd.org Mon Apr 2 23:30:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC42F6CDD4; Mon, 2 Apr 2018 23:30:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E66D7874F; Mon, 2 Apr 2018 23:30:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54A331C4E4; Mon, 2 Apr 2018 23:30:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32NUMvI068098; Mon, 2 Apr 2018 23:30:22 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32NULVa068091; Mon, 2 Apr 2018 23:30:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022330.w32NULVa068091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 23:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331894 - in stable/11/sys/arm: broadcom/bcm2835 conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys/arm: broadcom/bcm2835 conf X-SVN-Commit-Revision: 331894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:30:23 -0000 Author: gonzo Date: Mon Apr 2 23:30:21 2018 New Revision: 331894 URL: https://svnweb.freebsd.org/changeset/base/331894 Log: MFC r306436-r306437, r306489, r306491 r306436 by manu: RPI-B: Add support for MULTIDELAY 100 cycles per us seems accurate enough, at least it's better than the 200 value that was used before. Reviewed by: andrew, imp Differential Revision: https://reviews.freebsd.org/D8062 r306437 by manu: RPI2: Add support for PLATFORM_SMP so we can later add it to GENERIC. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D8063 r306489 by manu: bcm2835_cpufreq: Only attach driver if we correcly match on the machine compatible string. r306491 by manu: RPI2: Add support for MULTIDELAY, this is needed for inclusion into GENERIC. Added: stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.h - copied unchanged from r306437, head/sys/arm/broadcom/bcm2835/bcm2836_mp.h Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_systimer.c stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.c stable/11/sys/arm/conf/RPI-B stable/11/sys/arm/conf/RPI2 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon Apr 2 23:19:07 2018 (r331893) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon Apr 2 23:30:21 2018 (r331894) @@ -44,6 +44,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include + #include #include #include @@ -119,6 +124,13 @@ struct bcm2835_cpufreq_softc { struct intr_config_hook init_hook; }; +static struct ofw_compat_data compat_data[] = { + { "broadcom,bcm2835-vc", 1 }, + { "broadcom,bcm2708-vc", 1 }, + { "brcm,bcm2709", 1 }, + { NULL, 0 } +}; + static int cpufreq_verbose = 0; TUNABLE_INT("hw.bcm2835.cpufreq.verbose", &cpufreq_verbose); static int cpufreq_lowest_freq = DEFAULT_LOWEST_FREQ; @@ -1244,6 +1256,16 @@ bcm2835_cpufreq_init(void *arg) static void bcm2835_cpufreq_identify(driver_t *driver, device_t parent) { + const struct ofw_compat_data *compat; + phandle_t root; + + root = OF_finddevice("/"); + for (compat = compat_data; compat->ocd_str != NULL; compat++) + if (fdt_is_compatible(root, compat->ocd_str)) + break; + + if (compat->ocd_data == 0) + return; DPRINTF("driver=%p, parent=%p\n", driver, parent); if (device_find_child(parent, "bcm2835_cpufreq", -1) != NULL) Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Apr 2 23:19:07 2018 (r331893) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Apr 2 23:30:21 2018 (r331894) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "platform_if.h" @@ -131,7 +132,7 @@ static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b", 0); +FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b", 100); #endif #ifdef SOC_BCM2836 @@ -141,7 +142,12 @@ static platform_method_t bcm2836_methods[] = { PLATFORMMETHOD(platform_late_init, bcm2835_late_init), PLATFORMMETHOD(platform_cpu_reset, bcm2835_cpu_reset), +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, bcm2836_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, bcm2836_mp_setmaxid), +#endif + PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709", 0); +FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709", 100); #endif Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Mon Apr 2 23:19:07 2018 (r331893) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Mon Apr 2 23:30:21 2018 (r331894) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -101,6 +102,8 @@ static struct bcm_systimer_softc *bcm_systimer_sc = NU static unsigned bcm_systimer_tc_get_timecount(struct timecounter *); +static delay_func bcm_systimer_delay; + static struct timecounter bcm_systimer_tc = { .tc_name = DEFAULT_TIMER_NAME, .tc_get_timecount = bcm_systimer_tc_get_timecount, @@ -113,6 +116,9 @@ static struct timecounter bcm_systimer_tc = { static unsigned bcm_systimer_tc_get_timecount(struct timecounter *tc) { + if (bcm_systimer_sc == NULL) + return (0); + return bcm_systimer_tc_read_4(SYSTIMER_CLO); } @@ -147,7 +153,7 @@ restart: intr_restore(s); return (0); - } + } return (EINVAL); } @@ -167,7 +173,7 @@ bcm_systimer_intr(void *arg) struct systimer *st = (struct systimer *)arg; uint32_t cs; - cs = bcm_systimer_tc_read_4(SYSTIMER_CS); + cs = bcm_systimer_tc_read_4(SYSTIMER_CS); if ((cs & (1 << st->index)) == 0) return (FILTER_STRAY); @@ -254,6 +260,9 @@ bcm_systimer_attach(device_t dev) bcm_systimer_sc = sc; + if (device_get_unit(dev) == 0) + arm_set_delay(bcm_systimer_delay, sc); + bcm_systimer_tc.tc_frequency = DEFAULT_FREQUENCY; tc_init(&bcm_systimer_tc); @@ -276,19 +285,14 @@ static devclass_t bcm_systimer_devclass; DRIVER_MODULE(bcm_systimer, simplebus, bcm_systimer_driver, bcm_systimer_devclass, 0, 0); -void -DELAY(int usec) +static void +bcm_systimer_delay(int usec, void *arg) { + struct bcm_systimer_softc *sc; int32_t counts; uint32_t first, last; - if (bcm_systimer_sc == NULL) { - for (; usec > 0; usec--) - for (counts = 200; counts > 0; counts--) - /* Prevent gcc from optimizing out the loop */ - cpufunc_nullop(); - return; - } + sc = (struct bcm_systimer_softc *) arg; /* Get the number of times to count */ counts = usec * (bcm_systimer_tc.tc_frequency / 1000000) + 1; Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.c Mon Apr 2 23:19:07 2018 (r331893) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.c Mon Apr 2 23:30:21 2018 (r331894) @@ -45,7 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include + #ifdef DEBUG #define DPRINTF(fmt, ...) do { \ printf("%s:%u: ", __func__, __LINE__); \ @@ -77,7 +80,7 @@ static bus_space_handle_t bs_periph; bus_space_write_4(fdtbus_bs_tag, bs_periph, (addr), (val)) void -platform_mp_setmaxid(void) +bcm2836_mp_setmaxid(platform_t plat) { DPRINTF("platform_mp_setmaxid\n"); @@ -90,7 +93,7 @@ platform_mp_setmaxid(void) } void -platform_mp_start_ap(void) +bcm2836_mp_start_ap(platform_t plat) { uint32_t val; int i, retry; Copied: stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.h (from r306437, head/sys/arm/broadcom/bcm2835/bcm2836_mp.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2836_mp.h Mon Apr 2 23:30:21 2018 (r331894, copy of r306437, head/sys/arm/broadcom/bcm2835/bcm2836_mp.h) @@ -0,0 +1,38 @@ +/*- + * Copyright (C) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * + * 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 _BCM2836_MP_H_ +#define _BCM2836_MP_H_ + +void bcm2836_mp_setmaxid(platform_t plat); +void bcm2836_mp_start_ap(platform_t plat); + +#endif /* _BCM2836_MP_H_ */ Modified: stable/11/sys/arm/conf/RPI-B ============================================================================== --- stable/11/sys/arm/conf/RPI-B Mon Apr 2 23:19:07 2018 (r331893) +++ stable/11/sys/arm/conf/RPI-B Mon Apr 2 23:30:21 2018 (r331894) @@ -28,6 +28,7 @@ options INTRNG options SCHED_4BSD # 4BSD scheduler options PLATFORM +options MULTIDELAY # NFS root from boopt/dhcp #options BOOTP Modified: stable/11/sys/arm/conf/RPI2 ============================================================================== --- stable/11/sys/arm/conf/RPI2 Mon Apr 2 23:19:07 2018 (r331893) +++ stable/11/sys/arm/conf/RPI2 Mon Apr 2 23:30:21 2018 (r331894) @@ -29,6 +29,8 @@ options INTRNG options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores options PLATFORM +options PLATFORM_SMP +options MULTIDELAY # NFS root from boopt/dhcp #options BOOTP From owner-svn-src-all@freebsd.org Mon Apr 2 23:35:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D062CF6D3CE; Mon, 2 Apr 2018 23:35:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA6D78BE1; Mon, 2 Apr 2018 23:35:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 731BF1C686; Mon, 2 Apr 2018 23:35:34 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32NZYYm087871; Mon, 2 Apr 2018 23:35:34 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32NZWRP087150; Mon, 2 Apr 2018 23:35:32 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201804022335.w32NZWRP087150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 2 Apr 2018 23:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r331895 - in vendor-sys/ck/dist: include include/gcc include/gcc/sparcv9 include/gcc/x86 include/gcc/x86_64 include/spinlock src X-SVN-Group: vendor-sys X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in vendor-sys/ck/dist: include include/gcc include/gcc/sparcv9 include/gcc/x86 include/gcc/x86_64 include/spinlock src X-SVN-Commit-Revision: 331895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:35:35 -0000 Author: cognet Date: Mon Apr 2 23:35:32 2018 New Revision: 331895 URL: https://svnweb.freebsd.org/changeset/base/331895 Log: Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8 It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no *fence instructions are used on i386, as older cpus don't support it, and make sure we don't rely on gcc builtins that can lead to calls to libatomic when linked with -O0. Modified: vendor-sys/ck/dist/include/ck_cc.h vendor-sys/ck/dist/include/ck_hs.h vendor-sys/ck/dist/include/ck_pr.h vendor-sys/ck/dist/include/ck_queue.h vendor-sys/ck/dist/include/ck_ring.h vendor-sys/ck/dist/include/gcc/ck_cc.h vendor-sys/ck/dist/include/gcc/ck_pr.h vendor-sys/ck/dist/include/gcc/sparcv9/ck_pr.h vendor-sys/ck/dist/include/gcc/x86/ck_pr.h vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h vendor-sys/ck/dist/include/spinlock/dec.h vendor-sys/ck/dist/src/ck_hs.c vendor-sys/ck/dist/src/ck_ht.c vendor-sys/ck/dist/src/ck_ht_hash.h vendor-sys/ck/dist/src/ck_internal.h vendor-sys/ck/dist/src/ck_rhs.c Modified: vendor-sys/ck/dist/include/ck_cc.h ============================================================================== --- vendor-sys/ck/dist/include/ck_cc.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/ck_cc.h Mon Apr 2 23:35:32 2018 (r331895) @@ -104,42 +104,36 @@ #define CK_CC_TYPEOF(X, DEFAULT) (DEFAULT) #endif +#define CK_F_CC_FFS_G(L, T) \ +CK_CC_INLINE static int \ +ck_cc_##L(T v) \ +{ \ + unsigned int i; \ + \ + if (v == 0) \ + return 0; \ + \ + for (i = 1; (v & 1) == 0; i++, v >>= 1); \ + return i; \ +} + #ifndef CK_F_CC_FFS #define CK_F_CC_FFS -CK_CC_INLINE static int -ck_cc_ffs(unsigned int x) -{ - unsigned int i; +CK_F_CC_FFS_G(ffs, unsigned int) +#endif /* CK_F_CC_FFS */ - if (x == 0) - return 0; +#ifndef CK_F_CC_FFSL +#define CK_F_CC_FFSL +CK_F_CC_FFS_G(ffsl, unsigned long) +#endif /* CK_F_CC_FFSL */ - for (i = 1; (x & 1) == 0; i++, x >>= 1); +#ifndef CK_F_CC_FFSLL +#define CK_F_CC_FFSLL +CK_F_CC_FFS_G(ffsll, unsigned long long) +#endif /* CK_F_CC_FFSLL */ - return i; -} -#endif +#undef CK_F_CC_FFS_G -#ifndef CK_F_CC_CLZ -#define CK_F_CC_CLZ -#include - -CK_CC_INLINE static int -ck_cc_clz(unsigned int x) -{ - unsigned int count, i; - - for (count = 0, i = sizeof(unsigned int) * CHAR_BIT; i > 0; count++) { - unsigned int bit = 1U << --i; - - if (x & bit) - break; - } - - return count; -} -#endif - #ifndef CK_F_CC_CTZ #define CK_F_CC_CTZ CK_CC_INLINE static int @@ -151,7 +145,6 @@ ck_cc_ctz(unsigned int x) return 0; for (i = 0; (x & 1) == 0; i++, x >>= 1); - return i; } #endif Modified: vendor-sys/ck/dist/include/ck_hs.h ============================================================================== --- vendor-sys/ck/dist/include/ck_hs.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/ck_hs.h Mon Apr 2 23:35:32 2018 (r331895) @@ -100,10 +100,11 @@ struct ck_hs_stat { struct ck_hs_iterator { void **cursor; unsigned long offset; + struct ck_hs_map *map; }; typedef struct ck_hs_iterator ck_hs_iterator_t; -#define CK_HS_ITERATOR_INITIALIZER { NULL, 0 } +#define CK_HS_ITERATOR_INITIALIZER { NULL, 0, NULL } /* Convenience wrapper to table hash function. */ #define CK_HS_HASH(T, F, K) F((K), (T)->seed) @@ -112,6 +113,7 @@ typedef void *ck_hs_apply_fn_t(void *, void *); bool ck_hs_apply(ck_hs_t *, unsigned long, const void *, ck_hs_apply_fn_t *, void *); void ck_hs_iterator_init(ck_hs_iterator_t *); bool ck_hs_next(ck_hs_t *, ck_hs_iterator_t *, void **); +bool ck_hs_next_spmc(ck_hs_t *, ck_hs_iterator_t *, void **); bool ck_hs_move(ck_hs_t *, ck_hs_t *, ck_hs_hash_cb_t *, ck_hs_compare_cb_t *, struct ck_malloc *); bool ck_hs_init(ck_hs_t *, unsigned int, ck_hs_hash_cb_t *, Modified: vendor-sys/ck/dist/include/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/ck_pr.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/ck_pr.h Mon Apr 2 23:35:32 2018 (r331895) @@ -43,6 +43,8 @@ #include "gcc/sparcv9/ck_pr.h" #elif defined(__ppc64__) #include "gcc/ppc64/ck_pr.h" +#elif defined(__s390x__) +#include "gcc/s390x/ck_pr.h" #elif defined(__ppc__) #include "gcc/ppc/ck_pr.h" #elif defined(__arm__) Modified: vendor-sys/ck/dist/include/ck_queue.h ============================================================================== --- vendor-sys/ck/dist/include/ck_queue.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/ck_queue.h Mon Apr 2 23:35:32 2018 (r331895) @@ -235,7 +235,7 @@ struct { \ * Singly-linked Tail queue functions. */ #define CK_STAILQ_CONCAT(head1, head2) do { \ - if ((head2)->stqh_first == NULL) { \ + if ((head2)->stqh_first != NULL) { \ ck_pr_store_ptr((head1)->stqh_last, (head2)->stqh_first); \ ck_pr_fence_store(); \ (head1)->stqh_last = (head2)->stqh_last; \ Modified: vendor-sys/ck/dist/include/ck_ring.h ============================================================================== --- vendor-sys/ck/dist/include/ck_ring.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/ck_ring.h Mon Apr 2 23:35:32 2018 (r331895) @@ -176,23 +176,54 @@ _ck_ring_enqueue_mp(struct ck_ring *ring, producer = ck_pr_load_uint(&ring->p_head); - do { + for (;;) { /* - * The snapshot of producer must be up to date with - * respect to consumer. + * The snapshot of producer must be up to date with respect to + * consumer. */ ck_pr_fence_load(); consumer = ck_pr_load_uint(&ring->c_head); delta = producer + 1; - if (CK_CC_UNLIKELY((delta & mask) == (consumer & mask))) { - r = false; - goto leave; + + /* + * Only try to CAS if the producer is not clearly stale (not + * less than consumer) and the buffer is definitely not full. + */ + if (CK_CC_LIKELY((producer - consumer) < mask)) { + if (ck_pr_cas_uint_value(&ring->p_head, + producer, delta, &producer) == true) { + break; + } + } else { + unsigned int new_producer; + + /* + * Slow path. Either the buffer is full or we have a + * stale snapshot of p_head. Execute a second read of + * p_read that must be ordered wrt the snapshot of + * c_head. + */ + ck_pr_fence_load(); + new_producer = ck_pr_load_uint(&ring->p_head); + + /* + * Only fail if we haven't made forward progress in + * production: the buffer must have been full when we + * read new_producer (or we wrapped around UINT_MAX + * during this iteration). + */ + if (producer == new_producer) { + r = false; + goto leave; + } + + /* + * p_head advanced during this iteration. Try again. + */ + producer = new_producer; } - } while (ck_pr_cas_uint_value(&ring->p_head, - producer, - delta, - &producer) == false); + } buffer = (char *)buffer + ts * (producer & mask); memcpy(buffer, entry, ts); Modified: vendor-sys/ck/dist/include/gcc/ck_cc.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/ck_cc.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/gcc/ck_cc.h Mon Apr 2 23:35:32 2018 (r331895) @@ -103,28 +103,26 @@ #define CK_CC_TYPEOF(X, DEFAULT) __typeof__(X) /* - * Portability wrappers for bitwise ops. + * Portability wrappers for bitwise operations. */ - +#ifndef CK_MD_CC_BUILTIN_DISABLE #define CK_F_CC_FFS -#define CK_F_CC_CLZ -#define CK_F_CC_CTZ -#define CK_F_CC_POPCOUNT - CK_CC_INLINE static int ck_cc_ffs(unsigned int x) { - return __builtin_ffs(x); + return __builtin_ffsl(x); } +#define CK_F_CC_FFSL CK_CC_INLINE static int -ck_cc_clz(unsigned int x) +ck_cc_ffsl(unsigned long x) { - return __builtin_clz(x); + return __builtin_ffsll(x); } +#define CK_F_CC_CTZ CK_CC_INLINE static int ck_cc_ctz(unsigned int x) { @@ -132,11 +130,12 @@ ck_cc_ctz(unsigned int x) return __builtin_ctz(x); } +#define CK_F_CC_POPCOUNT CK_CC_INLINE static int ck_cc_popcount(unsigned int x) { return __builtin_popcount(x); } - +#endif /* CK_MD_CC_BUILTIN_DISABLE */ #endif /* CK_GCC_CC_H */ Modified: vendor-sys/ck/dist/include/gcc/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/ck_pr.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/gcc/ck_pr.h Mon Apr 2 23:35:32 2018 (r331895) @@ -80,7 +80,7 @@ ck_pr_md_load_ptr(const void *target) void *r; ck_pr_barrier(); - r = CK_CC_DECONST_PTR(CK_PR_ACCESS(target)); + r = CK_CC_DECONST_PTR(*(volatile void *const*)(target)); ck_pr_barrier(); return r; @@ -91,7 +91,7 @@ ck_pr_md_store_ptr(void *target, const void *v) { ck_pr_barrier(); - CK_PR_ACCESS(target) = CK_CC_DECONST_PTR(v); + *(volatile void **)target = CK_CC_DECONST_PTR(v); ck_pr_barrier(); return; } Modified: vendor-sys/ck/dist/include/gcc/sparcv9/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/sparcv9/ck_pr.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/gcc/sparcv9/ck_pr.h Mon Apr 2 23:35:32 2018 (r331895) @@ -76,7 +76,7 @@ CK_PR_FENCE(store, "membar #StoreStore") CK_PR_FENCE(store_load, "membar #StoreLoad") CK_PR_FENCE(load, "membar #LoadLoad") CK_PR_FENCE(load_store, "membar #LoadStore") -CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad") +CK_PR_FENCE(memory, "membar #MemIssue") CK_PR_FENCE(acquire, "membar #LoadLoad | #LoadStore") CK_PR_FENCE(release, "membar #LoadStore | #StoreStore") CK_PR_FENCE(acqrel, "membar #LoadLoad | #LoadStore | #StoreStore") Modified: vendor-sys/ck/dist/include/gcc/x86/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/x86/ck_pr.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/gcc/x86/ck_pr.h Mon Apr 2 23:35:32 2018 (r331895) @@ -45,15 +45,9 @@ /* Minimum requirements for the CK_PR interface are met. */ #define CK_F_PR -#ifdef CK_MD_UMP -#define CK_PR_LOCK_PREFIX -#else -#define CK_PR_LOCK_PREFIX "lock " -#endif - /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -62,28 +56,52 @@ ck_pr_stall(void) return; } +#ifdef CK_MD_UMP +#define CK_PR_LOCK_PREFIX #define CK_PR_FENCE(T, I) \ CK_CC_INLINE static void \ ck_pr_fence_strict_##T(void) \ { \ + __asm__ __volatile__("" ::: "memory"); \ + return; \ + } +#else +#define CK_PR_LOCK_PREFIX "lock " +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ __asm__ __volatile__(I ::: "memory"); \ + return; \ } +#endif /* CK_MD_UMP */ -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") -CK_PR_FENCE(load, "lfence") -CK_PR_FENCE(load_store, "mfence") -CK_PR_FENCE(store, "sfence") -CK_PR_FENCE(store_load, "mfence") -CK_PR_FENCE(memory, "mfence") -CK_PR_FENCE(release, "mfence") -CK_PR_FENCE(acquire, "mfence") -CK_PR_FENCE(acqrel, "mfence") -CK_PR_FENCE(lock, "mfence") -CK_PR_FENCE(unlock, "mfence") +#if defined(CK_MD_SSE_DISABLE) +/* If SSE is disabled, then use atomic operations for serialization. */ +#define CK_MD_X86_MFENCE "lock addl $0, (%%esp)" +#define CK_MD_X86_SFENCE CK_MD_X86_MFENCE +#define CK_MD_X86_LFENCE CK_MD_X86_MFENCE +#else +#define CK_MD_X86_SFENCE "sfence" +#define CK_MD_X86_LFENCE "lfence" +#define CK_MD_X86_MFENCE "mfence" +#endif /* !CK_MD_SSE_DISABLE */ + +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") +CK_PR_FENCE(load, CK_MD_X86_LFENCE) +CK_PR_FENCE(load_store, CK_MD_X86_MFENCE) +CK_PR_FENCE(store, CK_MD_X86_SFENCE) +CK_PR_FENCE(store_load, CK_MD_X86_MFENCE) +CK_PR_FENCE(memory, CK_MD_X86_MFENCE) +CK_PR_FENCE(release, CK_MD_X86_MFENCE) +CK_PR_FENCE(acquire, CK_MD_X86_MFENCE) +CK_PR_FENCE(acqrel, CK_MD_X86_MFENCE) +CK_PR_FENCE(lock, CK_MD_X86_MFENCE) +CK_PR_FENCE(unlock, CK_MD_X86_MFENCE) #undef CK_PR_FENCE Modified: vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h Mon Apr 2 23:35:32 2018 (r331895) @@ -58,8 +58,8 @@ #endif /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -75,18 +75,39 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") +/* Atomic operations are always serializing. */ +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") + +/* Traditional fence interface. */ CK_PR_FENCE(load, "lfence") CK_PR_FENCE(load_store, "mfence") CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(memory, "mfence") + +/* Below are stdatomic-style fences. */ + +/* + * Provides load-store and store-store ordering. However, Intel specifies that + * the WC memory model is relaxed. It is likely an sfence *is* sufficient (in + * particular, stores are not re-ordered with respect to prior loads and it is + * really just the stores that are subject to re-ordering). However, we take + * the conservative route as the manuals are too ambiguous for my taste. + */ CK_PR_FENCE(release, "mfence") + +/* + * Provides load-load and load-store ordering. The lfence instruction ensures + * all prior load operations are complete before any subsequent instructions + * actually begin execution. However, the manual also ends up going to describe + * WC memory as a relaxed model. + */ CK_PR_FENCE(acquire, "mfence") + CK_PR_FENCE(acqrel, "mfence") CK_PR_FENCE(lock, "mfence") CK_PR_FENCE(unlock, "mfence") Modified: vendor-sys/ck/dist/include/spinlock/dec.h ============================================================================== --- vendor-sys/ck/dist/include/spinlock/dec.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/include/spinlock/dec.h Mon Apr 2 23:35:32 2018 (r331895) @@ -111,7 +111,8 @@ ck_spinlock_dec_lock_eb(struct ck_spinlock_dec *lock) if (r == true) break; - ck_backoff_eb(&backoff); + while (ck_pr_load_uint(&lock->value) != 1) + ck_backoff_eb(&backoff); } ck_pr_fence_lock(); Modified: vendor-sys/ck/dist/src/ck_hs.c ============================================================================== --- vendor-sys/ck/dist/src/ck_hs.c Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/src/ck_hs.c Mon Apr 2 23:35:32 2018 (r331895) @@ -105,21 +105,10 @@ ck_hs_map_signal(struct ck_hs_map *map, unsigned long return; } -void -ck_hs_iterator_init(struct ck_hs_iterator *iterator) +static bool +_ck_hs_next(struct ck_hs *hs, struct ck_hs_map *map, struct ck_hs_iterator *i, void **key) { - - iterator->cursor = NULL; - iterator->offset = 0; - return; -} - -bool -ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) -{ - struct ck_hs_map *map = hs->map; void *value; - if (i->offset >= map->capacity) return false; @@ -129,6 +118,8 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, #ifdef CK_HS_PP if (hs->mode & CK_HS_MODE_OBJECT) value = CK_HS_VMA(value); +#else + (void)hs; /* Avoid unused parameter warning. */ #endif i->offset++; *key = value; @@ -140,6 +131,32 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, } void +ck_hs_iterator_init(struct ck_hs_iterator *iterator) +{ + + iterator->cursor = NULL; + iterator->offset = 0; + iterator->map = NULL; + return; +} + +bool +ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + return _ck_hs_next(hs, hs->map, i, key); +} + +bool +ck_hs_next_spmc(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + struct ck_hs_map *m = i->map; + if (m == NULL) { + m = i->map = ck_pr_load_ptr(&hs->map); + } + return _ck_hs_next(hs, m, i, key); +} + +void ck_hs_stat(struct ck_hs *hs, struct ck_hs_stat *st) { struct ck_hs_map *map = hs->map; @@ -206,7 +223,7 @@ ck_hs_map_create(struct ck_hs *hs, unsigned long entri map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; Modified: vendor-sys/ck/dist/src/ck_ht.c ============================================================================== --- vendor-sys/ck/dist/src/ck_ht.c Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/src/ck_ht.c Mon Apr 2 23:35:32 2018 (r331895) @@ -171,7 +171,7 @@ ck_ht_map_create(struct ck_ht *table, CK_HT_TYPE entri map->deletions = 0; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf_64(map->capacity); + map->step = ck_cc_ffsll(map->capacity); map->mask = map->capacity - 1; map->n_entries = 0; map->entries = (struct ck_ht_entry *)(((uintptr_t)&map[1] + prefix + Modified: vendor-sys/ck/dist/src/ck_ht_hash.h ============================================================================== --- vendor-sys/ck/dist/src/ck_ht_hash.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/src/ck_ht_hash.h Mon Apr 2 23:35:32 2018 (r331895) @@ -88,7 +88,15 @@ static inline uint64_t rotl64 ( uint64_t x, int8_t r ) FORCE_INLINE static uint32_t getblock ( const uint32_t * p, int i ) { +#ifdef __s390x__ + uint32_t res; + + __asm__ (" lrv %0,%1\n" + : "=r" (res) : "Q" (p[i]) : "cc", "mem"); + return res; +#else return p[i]; +#endif /* !__s390x__ */ } //----------------------------------------------------------------------------- @@ -147,7 +155,9 @@ static inline void MurmurHash3_x86_32 ( const void * k switch(len & 3) { case 3: k1 ^= tail[2] << 16; + /* fall through */ case 2: k1 ^= tail[1] << 8; + /* fall through */ case 1: k1 ^= tail[0]; k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; }; @@ -196,11 +206,17 @@ static inline uint64_t MurmurHash64A ( const void * ke switch(len & 7) { case 7: h ^= (uint64_t)(data2[6]) << 48; + /* fall through */ case 6: h ^= (uint64_t)(data2[5]) << 40; + /* fall through */ case 5: h ^= (uint64_t)(data2[4]) << 32; + /* fall through */ case 4: h ^= (uint64_t)(data2[3]) << 24; + /* fall through */ case 3: h ^= (uint64_t)(data2[2]) << 16; + /* fall through */ case 2: h ^= (uint64_t)(data2[1]) << 8; + /* fall through */ case 1: h ^= (uint64_t)(data2[0]); h *= m; }; @@ -249,7 +265,9 @@ static inline uint64_t MurmurHash64B ( const void * ke switch(len) { case 3: h2 ^= ((const unsigned char*)data)[2] << 16; + /* fall through */ case 2: h2 ^= ((const unsigned char*)data)[1] << 8; + /* fall through */ case 1: h2 ^= ((const unsigned char*)data)[0]; h2 *= m; }; Modified: vendor-sys/ck/dist/src/ck_internal.h ============================================================================== --- vendor-sys/ck/dist/src/ck_internal.h Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/src/ck_internal.h Mon Apr 2 23:35:32 2018 (r331895) @@ -80,40 +80,3 @@ ck_internal_max_32(uint32_t x, uint32_t y) return x ^ ((x ^ y) & -(x < y)); } - -CK_CC_INLINE static unsigned long -ck_internal_bsf(unsigned long v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1UL << (s - i))) - return sizeof(unsigned long) * 8 - i; - } - - return 1; -#endif /* !__GNUC__ */ -} - -CK_CC_INLINE static uint64_t -ck_internal_bsf_64(uint64_t v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1ULL << (63U - i))) - return i; - } -#endif /* !__GNUC__ */ - - return 1; -} - Modified: vendor-sys/ck/dist/src/ck_rhs.c ============================================================================== --- vendor-sys/ck/dist/src/ck_rhs.c Mon Apr 2 23:30:21 2018 (r331894) +++ vendor-sys/ck/dist/src/ck_rhs.c Mon Apr 2 23:35:32 2018 (r331895) @@ -366,7 +366,7 @@ ck_rhs_map_create(struct ck_rhs *hs, unsigned long ent map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; From owner-svn-src-all@freebsd.org Mon Apr 2 23:37:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7A3F6D5B4; Mon, 2 Apr 2018 23:37:26 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 335D178D5C; Mon, 2 Apr 2018 23:37:26 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 153301C688; Mon, 2 Apr 2018 23:37:26 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32NbPZI040846; Mon, 2 Apr 2018 23:37:25 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32NbPPW040843; Mon, 2 Apr 2018 23:37:25 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201804022337.w32NbPPW040843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 2 Apr 2018 23:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r331896 - vendor-sys/ck/20180304 X-SVN-Group: vendor-sys X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: vendor-sys/ck/20180304 X-SVN-Commit-Revision: 331896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:37:26 -0000 Author: cognet Date: Mon Apr 2 23:37:25 2018 New Revision: 331896 URL: https://svnweb.freebsd.org/changeset/base/331896 Log: Taf CK import as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8 Added: vendor-sys/ck/20180304/ - copied from r331895, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Mon Apr 2 23:39:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5350F6D6EF; Mon, 2 Apr 2018 23:39:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82C9E78EDD; Mon, 2 Apr 2018 23:39:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D9811C689; Mon, 2 Apr 2018 23:39:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32Nd58F078303; Mon, 2 Apr 2018 23:39:05 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32Nd4Ac078102; Mon, 2 Apr 2018 23:39:04 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022339.w32Nd4Ac078102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 23:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331897 - in stable/11/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm dev/usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm dev/usb/net X-SVN-Commit-Revision: 331897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:39:06 -0000 Author: gonzo Date: Mon Apr 2 23:39:04 2018 New Revision: 331897 URL: https://svnweb.freebsd.org/changeset/base/331897 Log: MFC r314672, r315967, r324184, r325768 r314672: [rpi] rpi3 should use the same cpufreq logic as rpi2, not rpi-b RPi3 cpufreq is more like that on RPi2. Setting arm frequency above min (say, "sysctl hw.cpufreq.arm_freq=600000001") turns on turbo mode, and the firmware automatically raises voltage, sets frequency to max 1200MHz, and throttle when overheat, etc. Swap if/else parts and use SOC_BCM2835 def so RPi3 can share the same cpufreq logic as RPi2, instead of falling to that for RPi. Submitted by: Jia-Shiun Li Differential Revision: https://reviews.freebsd.org/D9640 r315967: [rpi] Use compatibility string from upstream DTB for I2C controller FreeBSD uses upstream DTB for RPi3 build and compatibility string for i2c device is different there. Add this new string to compatibility data. Reported by: Karl Denninger r324184 by ian: Allow Raspberry Pi platform and drivers to be configured with upstream DTBs. - Added more compatibility strings to drivers not yet converted - Added new RPI platform code compatibility string to match the ones used upstream - Adapted RPI and RPI2 DTS to match the new platform code compatibility string The goal is to use the upstream DTBs as a replacement for our custom one. This is now possible with these changes. Additionally, as the RPI firmware automatically chooses the right DTB for us, this would allow to have one common armv6 kernel for RPI0 and RPI1 (BCM2835-based), and one common armv7 kernel for RPI2 v1.1 (BCM2836-based), and RPI2 v1.2 / RPI3 (BCM2837-based). Submitted by: Sylvain Garrigues Differential Revision: https://reviews.freebsd.org/D12360 r325768 by manu: arm: rpi2: Fix cpufreq(4) Since r324184 the root node compatible for rpi2 is "brcm,bcm2836", add it to the compatible list of bcm2835_cpufreq. Tested On: RPI2 v1.1 RPI2 v1.2 Reported by: many on freebsd-arm@ Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_bsc.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c stable/11/sys/boot/fdt/dts/arm/rpi2.dts stable/11/sys/dev/usb/net/if_smsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Apr 2 23:37:25 2018 (r331896) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Apr 2 23:39:04 2018 (r331897) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"broadcom,bcm2835-bsc", 1}, {"brcm,bcm2708-i2c", 1}, + {"brcm,bcm2835-i2c", 1}, {NULL, 0} }; Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon Apr 2 23:37:25 2018 (r331896) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Mon Apr 2 23:39:04 2018 (r331897) @@ -68,16 +68,16 @@ __FBSDID("$FreeBSD$"); #define HZ2MHZ(freq) ((freq) / (1000 * 1000)) #define MHZ2HZ(freq) ((freq) * (1000 * 1000)) -#ifdef SOC_BCM2836 -#define OFFSET2MVOLT(val) (((val) / 1000)) -#define MVOLT2OFFSET(val) (((val) * 1000)) -#define DEFAULT_ARM_FREQUENCY 600 -#define DEFAULT_LOWEST_FREQ 600 -#else +#ifdef SOC_BCM2835 #define OFFSET2MVOLT(val) (1200 + ((val) * 25)) #define MVOLT2OFFSET(val) (((val) - 1200) / 25) #define DEFAULT_ARM_FREQUENCY 700 #define DEFAULT_LOWEST_FREQ 300 +#else +#define OFFSET2MVOLT(val) (((val) / 1000)) +#define MVOLT2OFFSET(val) (((val) * 1000)) +#define DEFAULT_ARM_FREQUENCY 600 +#define DEFAULT_LOWEST_FREQ 600 #endif #define DEFAULT_CORE_FREQUENCY 250 #define DEFAULT_SDRAM_FREQUENCY 400 @@ -128,6 +128,7 @@ static struct ofw_compat_data compat_data[] = { { "broadcom,bcm2835-vc", 1 }, { "broadcom,bcm2708-vc", 1 }, { "brcm,bcm2709", 1 }, + { "brcm,bcm2836", 1 }, { NULL, 0 } }; @@ -1546,7 +1547,20 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf if (min_freq > cpufreq_lowest_freq) min_freq = cpufreq_lowest_freq; -#ifdef SOC_BCM2836 +#ifdef SOC_BCM2835 + /* from freq to min_freq */ + for (idx = 0; idx < *count && freq >= min_freq; idx++) { + if (freq > sc->arm_min_freq) + volts = sc->max_voltage_core; + else + volts = sc->min_voltage_core; + sets[idx].freq = freq; + sets[idx].volts = volts; + sets[idx].lat = TRANSITION_LATENCY; + sets[idx].dev = dev; + freq -= MHZSTEP; + } +#else /* XXX RPi2 have only 900/600MHz */ idx = 0; volts = sc->min_voltage_core; @@ -1561,19 +1575,6 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf sets[idx].lat = TRANSITION_LATENCY; sets[idx].dev = dev; idx++; - } -#else - /* from freq to min_freq */ - for (idx = 0; idx < *count && freq >= min_freq; idx++) { - if (freq > sc->arm_min_freq) - volts = sc->max_voltage_core; - else - volts = sc->min_voltage_core; - sets[idx].freq = freq; - sets[idx].volts = volts; - sets[idx].lat = TRANSITION_LATENCY; - sets[idx].dev = dev; - freq -= MHZSTEP; } #endif *count = idx; Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Apr 2 23:37:25 2018 (r331896) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Mon Apr 2 23:39:04 2018 (r331897) @@ -132,7 +132,8 @@ static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b", 100); +FDT_PLATFORM_DEF2(bcm2835, bcm2835_legacy, "bcm2835 (legacy)", 0, "raspberrypi,model-b", 100); +FDT_PLATFORM_DEF2(bcm2835, bcm2835, "bcm2835", 0, "brcm,bcm2835", 100); #endif #ifdef SOC_BCM2836 @@ -149,5 +150,6 @@ static platform_method_t bcm2836_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709", 100); +FDT_PLATFORM_DEF2(bcm2836, bcm2836_legacy, "bcm2836 (legacy)", 0, "brcm,bcm2709", 100); +FDT_PLATFORM_DEF2(bcm2836, bcm2836, "bcm2836", 0, "brcm,bcm2836", 100); #endif Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon Apr 2 23:37:25 2018 (r331896) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c Mon Apr 2 23:39:04 2018 (r331897) @@ -109,6 +109,12 @@ struct bcm2835_rng_softc { long sc_underrun; }; +static struct ofw_compat_data compat_data[] = { + {"broadcom,bcm2835-rng", 1}, + {"brcm,bcm2835-rng", 1}, + {NULL, 0} +}; + static __inline void bcm2835_rng_stat_inc_underrun(struct bcm2835_rng_softc *sc) { @@ -364,7 +370,7 @@ bcm2835_rng_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-rng")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Broadcom BCM2835 RNG"); Modified: stable/11/sys/boot/fdt/dts/arm/rpi2.dts ============================================================================== --- stable/11/sys/boot/fdt/dts/arm/rpi2.dts Mon Apr 2 23:37:25 2018 (r331896) +++ stable/11/sys/boot/fdt/dts/arm/rpi2.dts Mon Apr 2 23:39:04 2018 (r331897) @@ -30,7 +30,7 @@ / { model = "Raspberry Pi 2 Model B"; - compatible = "brcm,bcm2709"; + compatible = "brcm,bcm2836"; memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ Modified: stable/11/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/11/sys/dev/usb/net/if_smsc.c Mon Apr 2 23:37:25 2018 (r331896) +++ stable/11/sys/dev/usb/net/if_smsc.c Mon Apr 2 23:39:04 2018 (r331897) @@ -1568,8 +1568,9 @@ smsc_fdt_find_eth_node(phandle_t start) /* Traverse through entire tree to find usb ethernet nodes. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (ofw_bus_node_is_compatible(node, "net,ethernet") && - ofw_bus_node_is_compatible(node, "usb,device")) + if ((ofw_bus_node_is_compatible(node, "net,ethernet") && + ofw_bus_node_is_compatible(node, "usb,device")) || + ofw_bus_node_is_compatible(node, "usb424,ec00")) return (node); child = smsc_fdt_find_eth_node(node); if (child != -1) From owner-svn-src-all@freebsd.org Mon Apr 2 23:40:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335E4F6D87E; Mon, 2 Apr 2018 23:40:53 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0BF67909E; Mon, 2 Apr 2018 23:40:52 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA6681C69F; Mon, 2 Apr 2018 23:40:52 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32NeqE7015681; Mon, 2 Apr 2018 23:40:52 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32Neo60014397; Mon, 2 Apr 2018 23:40:50 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201804022340.w32Neo60014397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 2 Apr 2018 23:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331898 - in head/sys/contrib/ck: . include include/gcc include/gcc/sparcv9 include/gcc/x86 include/gcc/x86_64 include/spinlock src X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in head/sys/contrib/ck: . include include/gcc include/gcc/sparcv9 include/gcc/x86 include/gcc/x86_64 include/spinlock src X-SVN-Commit-Revision: 331898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:40:53 -0000 Author: cognet Date: Mon Apr 2 23:40:50 2018 New Revision: 331898 URL: https://svnweb.freebsd.org/changeset/base/331898 Log: Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8 It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no *fence instructions are used on i386, as older cpus don't support it, and make sure we don't rely on gcc builtins that can lead to calls to libatomic when linked with -O0. MFC after: 1 week Modified: head/sys/contrib/ck/FREEBSD-Xlist head/sys/contrib/ck/include/ck_cc.h head/sys/contrib/ck/include/ck_hs.h head/sys/contrib/ck/include/ck_md.h head/sys/contrib/ck/include/ck_pr.h head/sys/contrib/ck/include/ck_queue.h head/sys/contrib/ck/include/ck_ring.h head/sys/contrib/ck/include/gcc/ck_cc.h head/sys/contrib/ck/include/gcc/ck_pr.h head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h head/sys/contrib/ck/include/gcc/x86/ck_pr.h head/sys/contrib/ck/include/gcc/x86_64/ck_pr.h head/sys/contrib/ck/include/spinlock/dec.h head/sys/contrib/ck/src/ck_hs.c head/sys/contrib/ck/src/ck_ht.c head/sys/contrib/ck/src/ck_ht_hash.h head/sys/contrib/ck/src/ck_internal.h head/sys/contrib/ck/src/ck_rhs.c Directory Properties: head/sys/contrib/ck/ (props changed) Modified: head/sys/contrib/ck/FREEBSD-Xlist ============================================================================== --- head/sys/contrib/ck/FREEBSD-Xlist Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/FREEBSD-Xlist Mon Apr 2 23:40:50 2018 (r331898) @@ -8,4 +8,5 @@ */regressions */tools */include/ck_md.h.in +*/include/freebsd/ck_md.h.in */src/Makefile.in Modified: head/sys/contrib/ck/include/ck_cc.h ============================================================================== --- head/sys/contrib/ck/include/ck_cc.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/ck_cc.h Mon Apr 2 23:40:50 2018 (r331898) @@ -104,42 +104,36 @@ #define CK_CC_TYPEOF(X, DEFAULT) (DEFAULT) #endif +#define CK_F_CC_FFS_G(L, T) \ +CK_CC_INLINE static int \ +ck_cc_##L(T v) \ +{ \ + unsigned int i; \ + \ + if (v == 0) \ + return 0; \ + \ + for (i = 1; (v & 1) == 0; i++, v >>= 1); \ + return i; \ +} + #ifndef CK_F_CC_FFS #define CK_F_CC_FFS -CK_CC_INLINE static int -ck_cc_ffs(unsigned int x) -{ - unsigned int i; +CK_F_CC_FFS_G(ffs, unsigned int) +#endif /* CK_F_CC_FFS */ - if (x == 0) - return 0; +#ifndef CK_F_CC_FFSL +#define CK_F_CC_FFSL +CK_F_CC_FFS_G(ffsl, unsigned long) +#endif /* CK_F_CC_FFSL */ - for (i = 1; (x & 1) == 0; i++, x >>= 1); +#ifndef CK_F_CC_FFSLL +#define CK_F_CC_FFSLL +CK_F_CC_FFS_G(ffsll, unsigned long long) +#endif /* CK_F_CC_FFSLL */ - return i; -} -#endif +#undef CK_F_CC_FFS_G -#ifndef CK_F_CC_CLZ -#define CK_F_CC_CLZ -#include - -CK_CC_INLINE static int -ck_cc_clz(unsigned int x) -{ - unsigned int count, i; - - for (count = 0, i = sizeof(unsigned int) * CHAR_BIT; i > 0; count++) { - unsigned int bit = 1U << --i; - - if (x & bit) - break; - } - - return count; -} -#endif - #ifndef CK_F_CC_CTZ #define CK_F_CC_CTZ CK_CC_INLINE static int @@ -151,7 +145,6 @@ ck_cc_ctz(unsigned int x) return 0; for (i = 0; (x & 1) == 0; i++, x >>= 1); - return i; } #endif Modified: head/sys/contrib/ck/include/ck_hs.h ============================================================================== --- head/sys/contrib/ck/include/ck_hs.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/ck_hs.h Mon Apr 2 23:40:50 2018 (r331898) @@ -100,10 +100,11 @@ struct ck_hs_stat { struct ck_hs_iterator { void **cursor; unsigned long offset; + struct ck_hs_map *map; }; typedef struct ck_hs_iterator ck_hs_iterator_t; -#define CK_HS_ITERATOR_INITIALIZER { NULL, 0 } +#define CK_HS_ITERATOR_INITIALIZER { NULL, 0, NULL } /* Convenience wrapper to table hash function. */ #define CK_HS_HASH(T, F, K) F((K), (T)->seed) @@ -112,6 +113,7 @@ typedef void *ck_hs_apply_fn_t(void *, void *); bool ck_hs_apply(ck_hs_t *, unsigned long, const void *, ck_hs_apply_fn_t *, void *); void ck_hs_iterator_init(ck_hs_iterator_t *); bool ck_hs_next(ck_hs_t *, ck_hs_iterator_t *, void **); +bool ck_hs_next_spmc(ck_hs_t *, ck_hs_iterator_t *, void **); bool ck_hs_move(ck_hs_t *, ck_hs_t *, ck_hs_hash_cb_t *, ck_hs_compare_cb_t *, struct ck_malloc *); bool ck_hs_init(ck_hs_t *, unsigned int, ck_hs_hash_cb_t *, Modified: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- head/sys/contrib/ck/include/ck_md.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/ck_md.h Mon Apr 2 23:40:50 2018 (r331898) @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 Samy Al Bahra. + * Copyright 2018 Samy Al Bahra. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,45 +23,95 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ + * $FreeBSD: head/sys/contrib/ck/include/ck_md.h 329388 2018-02-16 17:50:06Z cog +net $ */ +/* + * This header file is meant for use of Concurrency Kit in the FreeBSD kernel. + */ + #ifndef CK_MD_H #define CK_MD_H +#include + +#ifndef _KERNEL +#error This header file is meant for the FreeBSD kernel. +#endif /* _KERNEL */ + #ifndef CK_MD_CACHELINE +/* + * FreeBSD's CACHE_LINE macro is a compile-time maximum cache-line size for an + * architecture, defined to be 128 bytes by default on x86*. Even in presence + * of adjacent sector prefetch, this doesn't make sense from a modeling + * perspective. + */ +#if defined(__amd64__) || defined(__i386__) #define CK_MD_CACHELINE (64) -#endif +#else +#define CK_MD_CACHELINE (CACHE_LINE_SIZE) +#endif /* !__amd64__ && !__i386__ */ +#endif /* CK_MD_CACHELINE */ #ifndef CK_MD_PAGESIZE -#define CK_MD_PAGESIZE (4096) +#define CK_MD_PAGESIZE (PAGE_SIZE) #endif +/* + * Once FreeBSD has a mechanism to detect RTM, this can be enabled and RTM + * facilities can be called. These facilities refer to TSX. + */ #ifndef CK_MD_RTM_DISABLE #define CK_MD_RTM_DISABLE #endif /* CK_MD_RTM_DISABLE */ +/* + * Do not enable pointer-packing-related (VMA) optimizations in kernel-space. + */ #ifndef CK_MD_POINTER_PACK_DISABLE #define CK_MD_POINTER_PACK_DISABLE #endif /* CK_MD_POINTER_PACK_DISABLE */ -#ifndef CK_MD_VMA_BITS_UNKNOWN -#define CK_MD_VMA_BITS_UNKNOWN +/* + * The following would be used for pointer-packing tricks, disabled for the + * kernel. + */ +#ifndef CK_MD_VMA_BITS_UNKNOWN +#define CK_MD_VMA_BITS_UNKNOWN #endif /* CK_MD_VMA_BITS_UNKNOWN */ +/* + * Do not enable double operations in kernel-space. + */ #ifndef CK_PR_DISABLE_DOUBLE #define CK_PR_DISABLE_DOUBLE #endif /* CK_PR_DISABLE_DOUBLE */ -#define CK_VERSION "0.6.0" -#define CK_GIT_SHA "" +/* + * If building for a uni-processor target, then enable the uniprocessor + * feature flag. This, among other things, will remove the lock prefix. + */ +#ifndef SMP +#define CK_MD_UMP +#endif /* SMP */ /* + * Disable the use of compiler builtin functions. + */ +#define CK_MD_CC_BUILTIN_DISABLE 1 + +/* * CK expects those, which are normally defined by the build system. */ #if defined(__i386__) && !defined(__x86__) #define __x86__ +/* + * If x86 becomes more relevant, we may want to consider importing in + * __mbk() to avoid potential issues around false sharing. + */ #define CK_MD_TSO +#define CK_MD_SSE_DISABLE 1 #elif defined(__amd64__) #define CK_MD_TSO #elif defined(__sparc64__) && !defined(__sparcv9__) @@ -73,8 +123,12 @@ #define __ppc__ #endif +/* If no memory model has been defined, assume RMO. */ #if !defined(CK_MD_RMO) && !defined(CK_MD_TSO) && !defined(CK_MD_PSO) #define CK_MD_RMO #endif + +#define CK_VERSION "0.7.0" +#define CK_GIT_SHA "db5db44" #endif /* CK_MD_H */ Modified: head/sys/contrib/ck/include/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/ck_pr.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/ck_pr.h Mon Apr 2 23:40:50 2018 (r331898) @@ -43,6 +43,8 @@ #include "gcc/sparcv9/ck_pr.h" #elif defined(__ppc64__) #include "gcc/ppc64/ck_pr.h" +#elif defined(__s390x__) +#include "gcc/s390x/ck_pr.h" #elif defined(__ppc__) #include "gcc/ppc/ck_pr.h" #elif defined(__arm__) Modified: head/sys/contrib/ck/include/ck_queue.h ============================================================================== --- head/sys/contrib/ck/include/ck_queue.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/ck_queue.h Mon Apr 2 23:40:50 2018 (r331898) @@ -235,7 +235,7 @@ struct { \ * Singly-linked Tail queue functions. */ #define CK_STAILQ_CONCAT(head1, head2) do { \ - if ((head2)->stqh_first == NULL) { \ + if ((head2)->stqh_first != NULL) { \ ck_pr_store_ptr((head1)->stqh_last, (head2)->stqh_first); \ ck_pr_fence_store(); \ (head1)->stqh_last = (head2)->stqh_last; \ Modified: head/sys/contrib/ck/include/ck_ring.h ============================================================================== --- head/sys/contrib/ck/include/ck_ring.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/ck_ring.h Mon Apr 2 23:40:50 2018 (r331898) @@ -176,23 +176,54 @@ _ck_ring_enqueue_mp(struct ck_ring *ring, producer = ck_pr_load_uint(&ring->p_head); - do { + for (;;) { /* - * The snapshot of producer must be up to date with - * respect to consumer. + * The snapshot of producer must be up to date with respect to + * consumer. */ ck_pr_fence_load(); consumer = ck_pr_load_uint(&ring->c_head); delta = producer + 1; - if (CK_CC_UNLIKELY((delta & mask) == (consumer & mask))) { - r = false; - goto leave; + + /* + * Only try to CAS if the producer is not clearly stale (not + * less than consumer) and the buffer is definitely not full. + */ + if (CK_CC_LIKELY((producer - consumer) < mask)) { + if (ck_pr_cas_uint_value(&ring->p_head, + producer, delta, &producer) == true) { + break; + } + } else { + unsigned int new_producer; + + /* + * Slow path. Either the buffer is full or we have a + * stale snapshot of p_head. Execute a second read of + * p_read that must be ordered wrt the snapshot of + * c_head. + */ + ck_pr_fence_load(); + new_producer = ck_pr_load_uint(&ring->p_head); + + /* + * Only fail if we haven't made forward progress in + * production: the buffer must have been full when we + * read new_producer (or we wrapped around UINT_MAX + * during this iteration). + */ + if (producer == new_producer) { + r = false; + goto leave; + } + + /* + * p_head advanced during this iteration. Try again. + */ + producer = new_producer; } - } while (ck_pr_cas_uint_value(&ring->p_head, - producer, - delta, - &producer) == false); + } buffer = (char *)buffer + ts * (producer & mask); memcpy(buffer, entry, ts); Modified: head/sys/contrib/ck/include/gcc/ck_cc.h ============================================================================== --- head/sys/contrib/ck/include/gcc/ck_cc.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/gcc/ck_cc.h Mon Apr 2 23:40:50 2018 (r331898) @@ -103,28 +103,26 @@ #define CK_CC_TYPEOF(X, DEFAULT) __typeof__(X) /* - * Portability wrappers for bitwise ops. + * Portability wrappers for bitwise operations. */ - +#ifndef CK_MD_CC_BUILTIN_DISABLE #define CK_F_CC_FFS -#define CK_F_CC_CLZ -#define CK_F_CC_CTZ -#define CK_F_CC_POPCOUNT - CK_CC_INLINE static int ck_cc_ffs(unsigned int x) { - return __builtin_ffs(x); + return __builtin_ffsl(x); } +#define CK_F_CC_FFSL CK_CC_INLINE static int -ck_cc_clz(unsigned int x) +ck_cc_ffsl(unsigned long x) { - return __builtin_clz(x); + return __builtin_ffsll(x); } +#define CK_F_CC_CTZ CK_CC_INLINE static int ck_cc_ctz(unsigned int x) { @@ -132,11 +130,12 @@ ck_cc_ctz(unsigned int x) return __builtin_ctz(x); } +#define CK_F_CC_POPCOUNT CK_CC_INLINE static int ck_cc_popcount(unsigned int x) { return __builtin_popcount(x); } - +#endif /* CK_MD_CC_BUILTIN_DISABLE */ #endif /* CK_GCC_CC_H */ Modified: head/sys/contrib/ck/include/gcc/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/ck_pr.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/gcc/ck_pr.h Mon Apr 2 23:40:50 2018 (r331898) @@ -80,7 +80,7 @@ ck_pr_md_load_ptr(const void *target) void *r; ck_pr_barrier(); - r = CK_CC_DECONST_PTR(CK_PR_ACCESS(target)); + r = CK_CC_DECONST_PTR(*(volatile void *const*)(target)); ck_pr_barrier(); return r; @@ -91,7 +91,7 @@ ck_pr_md_store_ptr(void *target, const void *v) { ck_pr_barrier(); - CK_PR_ACCESS(target) = CK_CC_DECONST_PTR(v); + *(volatile void **)target = CK_CC_DECONST_PTR(v); ck_pr_barrier(); return; } Modified: head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Mon Apr 2 23:40:50 2018 (r331898) @@ -76,7 +76,7 @@ CK_PR_FENCE(store, "membar #StoreStore") CK_PR_FENCE(store_load, "membar #StoreLoad") CK_PR_FENCE(load, "membar #LoadLoad") CK_PR_FENCE(load_store, "membar #LoadStore") -CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad") +CK_PR_FENCE(memory, "membar #MemIssue") CK_PR_FENCE(acquire, "membar #LoadLoad | #LoadStore") CK_PR_FENCE(release, "membar #LoadStore | #StoreStore") CK_PR_FENCE(acqrel, "membar #LoadLoad | #LoadStore | #StoreStore") Modified: head/sys/contrib/ck/include/gcc/x86/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/x86/ck_pr.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/gcc/x86/ck_pr.h Mon Apr 2 23:40:50 2018 (r331898) @@ -45,15 +45,9 @@ /* Minimum requirements for the CK_PR interface are met. */ #define CK_F_PR -#ifdef CK_MD_UMP -#define CK_PR_LOCK_PREFIX -#else -#define CK_PR_LOCK_PREFIX "lock " -#endif - /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -62,28 +56,52 @@ ck_pr_stall(void) return; } +#ifdef CK_MD_UMP +#define CK_PR_LOCK_PREFIX #define CK_PR_FENCE(T, I) \ CK_CC_INLINE static void \ ck_pr_fence_strict_##T(void) \ { \ + __asm__ __volatile__("" ::: "memory"); \ + return; \ + } +#else +#define CK_PR_LOCK_PREFIX "lock " +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ __asm__ __volatile__(I ::: "memory"); \ + return; \ } +#endif /* CK_MD_UMP */ -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") -CK_PR_FENCE(load, "lfence") -CK_PR_FENCE(load_store, "mfence") -CK_PR_FENCE(store, "sfence") -CK_PR_FENCE(store_load, "mfence") -CK_PR_FENCE(memory, "mfence") -CK_PR_FENCE(release, "mfence") -CK_PR_FENCE(acquire, "mfence") -CK_PR_FENCE(acqrel, "mfence") -CK_PR_FENCE(lock, "mfence") -CK_PR_FENCE(unlock, "mfence") +#if defined(CK_MD_SSE_DISABLE) +/* If SSE is disabled, then use atomic operations for serialization. */ +#define CK_MD_X86_MFENCE "lock addl $0, (%%esp)" +#define CK_MD_X86_SFENCE CK_MD_X86_MFENCE +#define CK_MD_X86_LFENCE CK_MD_X86_MFENCE +#else +#define CK_MD_X86_SFENCE "sfence" +#define CK_MD_X86_LFENCE "lfence" +#define CK_MD_X86_MFENCE "mfence" +#endif /* !CK_MD_SSE_DISABLE */ + +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") +CK_PR_FENCE(load, CK_MD_X86_LFENCE) +CK_PR_FENCE(load_store, CK_MD_X86_MFENCE) +CK_PR_FENCE(store, CK_MD_X86_SFENCE) +CK_PR_FENCE(store_load, CK_MD_X86_MFENCE) +CK_PR_FENCE(memory, CK_MD_X86_MFENCE) +CK_PR_FENCE(release, CK_MD_X86_MFENCE) +CK_PR_FENCE(acquire, CK_MD_X86_MFENCE) +CK_PR_FENCE(acqrel, CK_MD_X86_MFENCE) +CK_PR_FENCE(lock, CK_MD_X86_MFENCE) +CK_PR_FENCE(unlock, CK_MD_X86_MFENCE) #undef CK_PR_FENCE Modified: head/sys/contrib/ck/include/gcc/x86_64/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Mon Apr 2 23:40:50 2018 (r331898) @@ -58,8 +58,8 @@ #endif /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -75,18 +75,39 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") +/* Atomic operations are always serializing. */ +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") + +/* Traditional fence interface. */ CK_PR_FENCE(load, "lfence") CK_PR_FENCE(load_store, "mfence") CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(memory, "mfence") + +/* Below are stdatomic-style fences. */ + +/* + * Provides load-store and store-store ordering. However, Intel specifies that + * the WC memory model is relaxed. It is likely an sfence *is* sufficient (in + * particular, stores are not re-ordered with respect to prior loads and it is + * really just the stores that are subject to re-ordering). However, we take + * the conservative route as the manuals are too ambiguous for my taste. + */ CK_PR_FENCE(release, "mfence") + +/* + * Provides load-load and load-store ordering. The lfence instruction ensures + * all prior load operations are complete before any subsequent instructions + * actually begin execution. However, the manual also ends up going to describe + * WC memory as a relaxed model. + */ CK_PR_FENCE(acquire, "mfence") + CK_PR_FENCE(acqrel, "mfence") CK_PR_FENCE(lock, "mfence") CK_PR_FENCE(unlock, "mfence") Modified: head/sys/contrib/ck/include/spinlock/dec.h ============================================================================== --- head/sys/contrib/ck/include/spinlock/dec.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/include/spinlock/dec.h Mon Apr 2 23:40:50 2018 (r331898) @@ -111,7 +111,8 @@ ck_spinlock_dec_lock_eb(struct ck_spinlock_dec *lock) if (r == true) break; - ck_backoff_eb(&backoff); + while (ck_pr_load_uint(&lock->value) != 1) + ck_backoff_eb(&backoff); } ck_pr_fence_lock(); Modified: head/sys/contrib/ck/src/ck_hs.c ============================================================================== --- head/sys/contrib/ck/src/ck_hs.c Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/src/ck_hs.c Mon Apr 2 23:40:50 2018 (r331898) @@ -105,21 +105,10 @@ ck_hs_map_signal(struct ck_hs_map *map, unsigned long return; } -void -ck_hs_iterator_init(struct ck_hs_iterator *iterator) +static bool +_ck_hs_next(struct ck_hs *hs, struct ck_hs_map *map, struct ck_hs_iterator *i, void **key) { - - iterator->cursor = NULL; - iterator->offset = 0; - return; -} - -bool -ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) -{ - struct ck_hs_map *map = hs->map; void *value; - if (i->offset >= map->capacity) return false; @@ -129,6 +118,8 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, #ifdef CK_HS_PP if (hs->mode & CK_HS_MODE_OBJECT) value = CK_HS_VMA(value); +#else + (void)hs; /* Avoid unused parameter warning. */ #endif i->offset++; *key = value; @@ -140,6 +131,32 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, } void +ck_hs_iterator_init(struct ck_hs_iterator *iterator) +{ + + iterator->cursor = NULL; + iterator->offset = 0; + iterator->map = NULL; + return; +} + +bool +ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + return _ck_hs_next(hs, hs->map, i, key); +} + +bool +ck_hs_next_spmc(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + struct ck_hs_map *m = i->map; + if (m == NULL) { + m = i->map = ck_pr_load_ptr(&hs->map); + } + return _ck_hs_next(hs, m, i, key); +} + +void ck_hs_stat(struct ck_hs *hs, struct ck_hs_stat *st) { struct ck_hs_map *map = hs->map; @@ -206,7 +223,7 @@ ck_hs_map_create(struct ck_hs *hs, unsigned long entri map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; Modified: head/sys/contrib/ck/src/ck_ht.c ============================================================================== --- head/sys/contrib/ck/src/ck_ht.c Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/src/ck_ht.c Mon Apr 2 23:40:50 2018 (r331898) @@ -171,7 +171,7 @@ ck_ht_map_create(struct ck_ht *table, CK_HT_TYPE entri map->deletions = 0; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf_64(map->capacity); + map->step = ck_cc_ffsll(map->capacity); map->mask = map->capacity - 1; map->n_entries = 0; map->entries = (struct ck_ht_entry *)(((uintptr_t)&map[1] + prefix + Modified: head/sys/contrib/ck/src/ck_ht_hash.h ============================================================================== --- head/sys/contrib/ck/src/ck_ht_hash.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/src/ck_ht_hash.h Mon Apr 2 23:40:50 2018 (r331898) @@ -88,7 +88,15 @@ static inline uint64_t rotl64 ( uint64_t x, int8_t r ) FORCE_INLINE static uint32_t getblock ( const uint32_t * p, int i ) { +#ifdef __s390x__ + uint32_t res; + + __asm__ (" lrv %0,%1\n" + : "=r" (res) : "Q" (p[i]) : "cc", "mem"); + return res; +#else return p[i]; +#endif /* !__s390x__ */ } //----------------------------------------------------------------------------- @@ -147,7 +155,9 @@ static inline void MurmurHash3_x86_32 ( const void * k switch(len & 3) { case 3: k1 ^= tail[2] << 16; + /* fall through */ case 2: k1 ^= tail[1] << 8; + /* fall through */ case 1: k1 ^= tail[0]; k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; }; @@ -196,11 +206,17 @@ static inline uint64_t MurmurHash64A ( const void * ke switch(len & 7) { case 7: h ^= (uint64_t)(data2[6]) << 48; + /* fall through */ case 6: h ^= (uint64_t)(data2[5]) << 40; + /* fall through */ case 5: h ^= (uint64_t)(data2[4]) << 32; + /* fall through */ case 4: h ^= (uint64_t)(data2[3]) << 24; + /* fall through */ case 3: h ^= (uint64_t)(data2[2]) << 16; + /* fall through */ case 2: h ^= (uint64_t)(data2[1]) << 8; + /* fall through */ case 1: h ^= (uint64_t)(data2[0]); h *= m; }; @@ -249,7 +265,9 @@ static inline uint64_t MurmurHash64B ( const void * ke switch(len) { case 3: h2 ^= ((const unsigned char*)data)[2] << 16; + /* fall through */ case 2: h2 ^= ((const unsigned char*)data)[1] << 8; + /* fall through */ case 1: h2 ^= ((const unsigned char*)data)[0]; h2 *= m; }; Modified: head/sys/contrib/ck/src/ck_internal.h ============================================================================== --- head/sys/contrib/ck/src/ck_internal.h Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/src/ck_internal.h Mon Apr 2 23:40:50 2018 (r331898) @@ -80,40 +80,3 @@ ck_internal_max_32(uint32_t x, uint32_t y) return x ^ ((x ^ y) & -(x < y)); } - -CK_CC_INLINE static unsigned long -ck_internal_bsf(unsigned long v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1UL << (s - i))) - return sizeof(unsigned long) * 8 - i; - } - - return 1; -#endif /* !__GNUC__ */ -} - -CK_CC_INLINE static uint64_t -ck_internal_bsf_64(uint64_t v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1ULL << (63U - i))) - return i; - } -#endif /* !__GNUC__ */ - - return 1; -} - Modified: head/sys/contrib/ck/src/ck_rhs.c ============================================================================== --- head/sys/contrib/ck/src/ck_rhs.c Mon Apr 2 23:39:04 2018 (r331897) +++ head/sys/contrib/ck/src/ck_rhs.c Mon Apr 2 23:40:50 2018 (r331898) @@ -366,7 +366,7 @@ ck_rhs_map_create(struct ck_rhs *hs, unsigned long ent map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; From owner-svn-src-all@freebsd.org Mon Apr 2 23:44:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 418E2F6DD2D; Mon, 2 Apr 2018 23:44:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D160C79530; Mon, 2 Apr 2018 23:44:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66971C819; Mon, 2 Apr 2018 23:44:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w32NiCgS071730; Mon, 2 Apr 2018 23:44:12 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w32NiCvF071727; Mon, 2 Apr 2018 23:44:12 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804022344.w32NiCvF071727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 2 Apr 2018 23:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331899 - stable/11/sys/dev/usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/dev/usb/net X-SVN-Commit-Revision: 331899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 02 Apr 2018 23:44:13 -0000 Author: gonzo Date: Mon Apr 2 23:44:12 2018 New Revision: 331899 URL: https://svnweb.freebsd.org/changeset/base/331899 Log: MFC r325048: Fix MAC address detection regression introduced by r324184 To accomodate all variaties of Pi DTS files floating around we look for MAC address property either in DTS node for USB ethernet (if it exists) or at predefined path ".../usb/hub/ethernet". After r324184 smsc_fdt_find_eth_node started to return node with compatibility string "usb424,ec00" as an eth node. In imported GNU dts files this node still does not have MAC address related property, and therefor following check for "mac-address" and "local-mac-address" fails. To make this logic more robust do not just search for the node but also make sure it has required property, so if node with accepted compatibility string exists but doesn't have the property we fall back to looking for hardoded path mentioned above. Modified: stable/11/sys/dev/usb/net/if_smsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/11/sys/dev/usb/net/if_smsc.c Mon Apr 2 23:40:50 2018 (r331898) +++ stable/11/sys/dev/usb/net/if_smsc.c Mon Apr 2 23:44:12 2018 (r331899) @@ -1637,6 +1637,37 @@ smsc_fdt_find_eth_node_by_path(phandle_t start) return (-1); } +/* + * Look through known names that can contain mac address + * return 0 if valid MAC address has been found + */ +static int +smsc_fdt_read_mac_property(phandle_t node, unsigned char *mac) +{ + int len; + + /* Check if there is property */ + if ((len = OF_getproplen(node, "local-mac-address")) > 0) { + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "local-mac-address", mac, + ETHER_ADDR_LEN); + return (0); + } + + if ((len = OF_getproplen(node, "mac-address")) > 0) { + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "mac-address", mac, + ETHER_ADDR_LEN); + return (0); + } + + return (ENXIO); +} + /** * Get MAC address from FDT blob. Firmware or loader should fill * mac-address or local-mac-address property. Returns 0 if MAC address @@ -1646,37 +1677,22 @@ static int smsc_fdt_find_mac(unsigned char *mac) { phandle_t node, root; - int len; root = OF_finddevice("/"); node = smsc_fdt_find_eth_node(root); + if (node != -1) { + if (smsc_fdt_read_mac_property(node, mac) == 0) + return (0); + } + /* * If it's not FreeBSD FDT blob for RPi, try more * generic .../usb/hub/ethernet */ - if (node == -1) - node = smsc_fdt_find_eth_node_by_path(root); + node = smsc_fdt_find_eth_node_by_path(root); - if (node != -1) { - /* Check if there is property */ - if ((len = OF_getproplen(node, "local-mac-address")) > 0) { - if (len != ETHER_ADDR_LEN) - return (EINVAL); - - OF_getprop(node, "local-mac-address", mac, - ETHER_ADDR_LEN); - return (0); - } - - if ((len = OF_getproplen(node, "mac-address")) > 0) { - if (len != ETHER_ADDR_LEN) - return (EINVAL); - - OF_getprop(node, "mac-address", mac, - ETHER_ADDR_LEN); - return (0); - } - } + if (node != -1) + return smsc_fdt_read_mac_property(node, mac); return (ENXIO); } From owner-svn-src-all@freebsd.org Tue Apr 3 00:45:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E2D3F71DEB; Tue, 3 Apr 2018 00:45:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1E0A7B756; Tue, 3 Apr 2018 00:45:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A88331D206; Tue, 3 Apr 2018 00:45:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w330jc9B037761; Tue, 3 Apr 2018 00:45:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w330jc1G037742; Tue, 3 Apr 2018 00:45:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804030045.w330jc1G037742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 3 Apr 2018 00:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331900 - in head/sys/powerpc: booke include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: booke include X-SVN-Commit-Revision: 331900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 00:45:39 -0000 Author: jhibbits Date: Tue Apr 3 00:45:38 2018 New Revision: 331900 URL: https://svnweb.freebsd.org/changeset/base/331900 Log: Add support for a pmap direct map for 64-bit Book-E As with AIM64, map the DMAP at the beginning of the fourth "quadrant" of memory, and move the KERNBASE to the the start of KVA. Eventually we may run the kernel out of the DMAP, but for now, continue booting as it has been. Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Mon Apr 2 23:44:12 2018 (r331899) +++ head/sys/powerpc/booke/pmap.c Tue Apr 3 00:45:38 2018 (r331900) @@ -1724,7 +1724,11 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o debugf("mmu_booke_bootstrap: entered\n"); /* Set interesting system properties */ +#ifdef __powerpc64__ + hw_direct_map = 1; +#else hw_direct_map = 0; +#endif #if defined(COMPAT_FREEBSD32) || !defined(__powerpc64__) elf32_nxstack = 1; #endif @@ -1970,6 +1974,15 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o debugf("phys_avail_count = %d\n", phys_avail_count); debugf("physsz = 0x%09jx physmem = %jd (0x%09jx)\n", (uintmax_t)physsz, (uintmax_t)physmem, (uintmax_t)physmem); + +#ifdef __powerpc64__ + /* + * Map the physical memory contiguously in TLB1. + * Round so it fits into a single mapping. + */ + tlb1_mapin_region(DMAP_BASE_ADDRESS, 0, + phys_avail[i + 1]); +#endif /*******************************************************/ /* Initialize (statically allocated) kernel pmap. */ Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Mon Apr 2 23:44:12 2018 (r331899) +++ head/sys/powerpc/include/vmparam.h Tue Apr 3 00:45:38 2018 (r331900) @@ -106,13 +106,8 @@ #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE #ifdef __powerpc64__ -#ifdef AIM #define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL #define VM_MAX_KERNEL_ADDRESS 0xe0000001c7ffffffUL -#else -#define VM_MIN_KERNEL_ADDRESS 0xc000000000000000UL -#define VM_MAX_KERNEL_ADDRESS 0xc0000001c7ffffffUL -#endif #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif @@ -135,9 +130,9 @@ #ifdef __powerpc64__ #ifndef LOCORE -#define KERNBASE 0xc000000000000100UL /* start of kernel virtual */ +#define KERNBASE 0xe000000000000100UL /* start of kernel virtual */ #else -#define KERNBASE 0xc000000000000100 /* start of kernel virtual */ +#define KERNBASE 0xe000000000000100 /* start of kernel virtual */ #endif #else #define KERNBASE 0xc0000000 /* start of kernel virtual */ From owner-svn-src-all@freebsd.org Tue Apr 3 01:08:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E1ABF734A1; Tue, 3 Apr 2018 01:08:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DFA97CC2C; Tue, 3 Apr 2018 01:08:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37D451D551; Tue, 3 Apr 2018 01:08:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3318t62051657; Tue, 3 Apr 2018 01:08:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3318s2P051624; Tue, 3 Apr 2018 01:08:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804030108.w3318s2P051624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 3 Apr 2018 01:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331901 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 331901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 01:08:55 -0000 Author: np Date: Tue Apr 3 01:08:54 2018 New Revision: 331901 URL: https://svnweb.freebsd.org/changeset/base/331901 Log: Add a hook to allow the toedev handling an offloaded connection to provide accurate TCP_INFO. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14816 Modified: head/sys/netinet/tcp_offload.c head/sys/netinet/tcp_offload.h head/sys/netinet/tcp_usrreq.c head/sys/netinet/toecore.c head/sys/netinet/toecore.h Modified: head/sys/netinet/tcp_offload.c ============================================================================== --- head/sys/netinet/tcp_offload.c Tue Apr 3 00:45:38 2018 (r331900) +++ head/sys/netinet/tcp_offload.c Tue Apr 3 01:08:54 2018 (r331901) @@ -168,6 +168,17 @@ tcp_offload_ctloutput(struct tcpcb *tp, int sopt_dir, } void +tcp_offload_tcp_info(struct tcpcb *tp, struct tcp_info *ti) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_tcp_info(tod, tp, ti); +} + +void tcp_offload_detach(struct tcpcb *tp) { struct toedev *tod = tp->tod; Modified: head/sys/netinet/tcp_offload.h ============================================================================== --- head/sys/netinet/tcp_offload.h Tue Apr 3 00:45:38 2018 (r331900) +++ head/sys/netinet/tcp_offload.h Tue Apr 3 01:08:54 2018 (r331901) @@ -45,6 +45,7 @@ void tcp_offload_input(struct tcpcb *, struct mbuf *); int tcp_offload_output(struct tcpcb *); void tcp_offload_rcvd(struct tcpcb *); void tcp_offload_ctloutput(struct tcpcb *, int, int); +void tcp_offload_tcp_info(struct tcpcb *, struct tcp_info *); void tcp_offload_detach(struct tcpcb *); #endif Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Apr 3 00:45:38 2018 (r331900) +++ head/sys/netinet/tcp_usrreq.c Tue Apr 3 01:08:54 2018 (r331901) @@ -1393,11 +1393,15 @@ tcp_fill_info(struct tcpcb *tp, struct tcp_info *ti) ti->tcpi_snd_nxt = tp->snd_nxt; ti->tcpi_snd_mss = tp->t_maxseg; ti->tcpi_rcv_mss = tp->t_maxseg; - if (tp->t_flags & TF_TOE) - ti->tcpi_options |= TCPI_OPT_TOE; ti->tcpi_snd_rexmitpack = tp->t_sndrexmitpack; ti->tcpi_rcv_ooopack = tp->t_rcvoopack; ti->tcpi_snd_zerowin = tp->t_sndzerowin; +#ifdef TCP_OFFLOAD + if (tp->t_flags & TF_TOE) { + ti->tcpi_options |= TCPI_OPT_TOE; + tcp_offload_tcp_info(tp, ti); + } +#endif } /* Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Tue Apr 3 00:45:38 2018 (r331900) +++ head/sys/netinet/toecore.c Tue Apr 3 01:08:54 2018 (r331901) @@ -182,6 +182,14 @@ toedev_ctloutput(struct toedev *tod __unused, struct t return; } +static void +toedev_tcp_info(struct toedev *tod __unused, struct tcpcb *tp __unused, + struct tcp_info *ti __unused) +{ + + return; +} + /* * Inform one or more TOE devices about a listening socket. */ @@ -271,6 +279,7 @@ init_toedev(struct toedev *tod) tod->tod_syncache_respond = toedev_syncache_respond; tod->tod_offload_socket = toedev_offload_socket; tod->tod_ctloutput = toedev_ctloutput; + tod->tod_tcp_info = toedev_tcp_info; } /* Modified: head/sys/netinet/toecore.h ============================================================================== --- head/sys/netinet/toecore.h Tue Apr 3 00:45:38 2018 (r331900) +++ head/sys/netinet/toecore.h Tue Apr 3 01:08:54 2018 (r331901) @@ -38,6 +38,7 @@ struct tcpopt; struct tcphdr; struct in_conninfo; +struct tcp_info; struct toedev { TAILQ_ENTRY(toedev) link; /* glue for toedev_list */ @@ -101,6 +102,10 @@ struct toedev { /* TCP socket option */ void (*tod_ctloutput)(struct toedev *, struct tcpcb *, int, int); + + /* Update software state */ + void (*tod_tcp_info)(struct toedev *, struct tcpcb *, + struct tcp_info *); }; #include From owner-svn-src-all@freebsd.org Tue Apr 3 01:22:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD692F74793; Tue, 3 Apr 2018 01:22:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9114C7DA72; Tue, 3 Apr 2018 01:22:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BE2C1D8EA; Tue, 3 Apr 2018 01:22:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w331MGnC008181; Tue, 3 Apr 2018 01:22:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w331MGWL008166; Tue, 3 Apr 2018 01:22:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804030122.w331MGWL008166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 3 Apr 2018 01:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331902 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 331902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 01:22:17 -0000 Author: np Date: Tue Apr 3 01:22:15 2018 New Revision: 331902 URL: https://svnweb.freebsd.org/changeset/base/331902 Log: cxgbe: Implement tcp_info handler for connections handled by t4_tom. The TCB is read using a memory window right now. A better alternate to get self-consistent, uncached information would be to use a GET_TCB request but waiting for a reply from hw while holding non-sleepable locks is quite inconvenient. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14817 Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Apr 3 01:08:54 2018 (r331901) +++ head/sys/dev/cxgbe/adapter.h Tue Apr 3 01:22:15 2018 (r331902) @@ -1160,6 +1160,7 @@ int vi_full_init(struct vi_info *); int vi_full_uninit(struct vi_info *); void vi_sysctls(struct vi_info *); void vi_tick(void *); +int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); #ifdef DEV_NETMAP /* t4_netmap.c */ @@ -1252,4 +1253,19 @@ t4_wrq_tx(struct adapter *sc, struct wrqe *wr) TXQ_UNLOCK(wrq); } +static inline int +read_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, + int len) +{ + + return (rw_via_memwin(sc, idx, addr, val, len, 0)); +} + +static inline int +write_via_memwin(struct adapter *sc, int idx, uint32_t addr, + const uint32_t *val, int len) +{ + + return (rw_via_memwin(sc, idx, addr, (void *)(uintptr_t)val, len, 1)); +} #endif Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue Apr 3 01:08:54 2018 (r331901) +++ head/sys/dev/cxgbe/common/common.h Tue Apr 3 01:22:15 2018 (r331902) @@ -519,6 +519,12 @@ static inline u_int us_to_tcp_ticks(const struct adapt return (us * adap->params.vpd.cclk / 1000 >> adap->params.tp.tre); } +static inline u_int tcp_ticks_to_us(const struct adapter *adap, u_int ticks) +{ + return ((uint64_t)ticks << adap->params.tp.tre) / + core_ticks_per_usec(adap); +} + void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Apr 3 01:08:54 2018 (r331901) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 3 01:22:15 2018 (r331902) @@ -511,11 +511,6 @@ struct filter_entry { static void setup_memwin(struct adapter *); static void position_memwin(struct adapter *, int, uint32_t); -static int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); -static inline int read_via_memwin(struct adapter *, int, uint32_t, uint32_t *, - int); -static inline int write_via_memwin(struct adapter *, int, uint32_t, - const uint32_t *, int); static int validate_mem_range(struct adapter *, uint32_t, int); static int fwmtype_to_hwmtype(int); static int validate_mt_off_len(struct adapter *, int, uint32_t, int, @@ -2391,7 +2386,7 @@ position_memwin(struct adapter *sc, int idx, uint32_t t4_read_reg(sc, reg); /* flush */ } -static int +int rw_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, int len, int rw) { @@ -2437,22 +2432,6 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t ad } return (0); -} - -static inline int -read_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, - int len) -{ - - return (rw_via_memwin(sc, idx, addr, val, len, 0)); -} - -static inline int -write_via_memwin(struct adapter *sc, int idx, uint32_t addr, - const uint32_t *val, int len) -{ - - return (rw_via_memwin(sc, idx, addr, (void *)(uintptr_t)val, len, 1)); } static int Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 3 01:08:54 2018 (r331901) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 3 01:22:15 2018 (r331902) @@ -401,7 +401,85 @@ t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int } } +static inline int +get_tcb_bit(u_char *tcb, int bit) +{ + int ix, shift; + + ix = 127 - (bit >> 3); + shift = bit & 0x7; + + return ((tcb[ix] >> shift) & 1); +} + +static inline uint64_t +get_tcb_bits(u_char *tcb, int hi, int lo) +{ + uint64_t rc = 0; + + while (hi >= lo) { + rc = (rc << 1) | get_tcb_bit(tcb, hi); + --hi; + } + + return (rc); +} + /* + * Called by the kernel to allow the TOE driver to "refine" values filled up in + * the tcp_info for an offloaded connection. + */ +static void +t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +{ + int i, j, k, rc; + struct adapter *sc = tod->tod_softc; + struct toepcb *toep = tp->t_toe; + uint32_t addr, v; + uint32_t buf[TCB_SIZE / sizeof(uint32_t)]; + u_char *tcb, tmp; + + INP_WLOCK_ASSERT(tp->t_inpcb); + MPASS(ti != NULL); + + addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + toep->tid * TCB_SIZE; + rc = read_via_memwin(sc, 2, addr, &buf[0], TCB_SIZE); + if (rc != 0) + return; + + tcb = (u_char *)&buf[0]; + for (i = 0, j = TCB_SIZE - 16; i < j; i += 16, j -= 16) { + for (k = 0; k < 16; k++) { + tmp = tcb[i + k]; + tcb[i + k] = tcb[j + k]; + tcb[j + k] = tmp; + } + } + + ti->tcpi_state = get_tcb_bits(tcb, 115, 112); + + v = get_tcb_bits(tcb, 271, 256); + ti->tcpi_rtt = tcp_ticks_to_us(sc, v); + + v = get_tcb_bits(tcb, 287, 272); + ti->tcpi_rttvar = tcp_ticks_to_us(sc, v); + + ti->tcpi_snd_ssthresh = get_tcb_bits(tcb, 487, 460); + ti->tcpi_snd_cwnd = get_tcb_bits(tcb, 459, 432); + ti->tcpi_rcv_nxt = get_tcb_bits(tcb, 553, 522); + + ti->tcpi_snd_nxt = get_tcb_bits(tcb, 319, 288) - + get_tcb_bits(tcb, 375, 348); + + /* Receive window being advertised by us. */ + ti->tcpi_rcv_space = get_tcb_bits(tcb, 581, 554); + + /* Send window ceiling. */ + v = get_tcb_bits(tcb, 159, 144) << get_tcb_bits(tcb, 131, 128); + ti->tcpi_snd_wnd = min(v, ti->tcpi_snd_cwnd); +} + +/* * The TOE driver will not receive any more CPLs for the tid associated with the * toepcb; release the hold on the inpcb. */ @@ -1126,6 +1204,7 @@ t4_tom_activate(struct adapter *sc) tod->tod_syncache_respond = t4_syncache_respond; tod->tod_offload_socket = t4_offload_socket; tod->tod_ctloutput = t4_ctloutput; + tod->tod_tcp_info = t4_tcp_info; for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { From owner-svn-src-all@freebsd.org Tue Apr 3 01:40:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FACAF75A5E; Tue, 3 Apr 2018 01:40:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D397E4E8; Tue, 3 Apr 2018 01:40:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id p53so16314661wrc.10; Mon, 02 Apr 2018 18:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=msYvQfyimbsD5wseBtycFUyoCgIslfRyDEug1lO8sJU=; b=Cz7du1tGgxl2vStsUD+VscB47f17MTTBQX5koS7Mv5relSmdJ0WKCBQUlUEGwZZtp1 wxsL4SftrLdd8tKLzklz1EmROeeaDC58+6DSryYKLaY4F7i9KLdvax0Mpk9GGxSxxwCu 0zO01eNTic9orWhmV6UAiMsfb3L5d0ToFRBycPkAvmT5J9og/caSpivnP4gLkoo6c05I 1pTFfi8O85C6piEEDqLT5AHwCYvvO/tkOb3BU8pXV4LCaAFQDAOAqdNTzTKq8GTvLHiP NHmhZWWKESo0QhxXwjUfirdgf7aD0roG2qOz1d59lq9WNp4K8CFbWxwpwlyedhLaB7qm F0qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=msYvQfyimbsD5wseBtycFUyoCgIslfRyDEug1lO8sJU=; b=iZlrKU0NNhPuccw8DHOqzaoYPMHEV2vDQp9fdoYfFU6jhJs+es/w6S7shD4iOOYXdD zbTMpjOd8Bof69JX3ra7l0HyLdaQtciZff/jB7NLsoUG6PwXbwFfij/qj4tuJ+9oghpV Iu8GdNO2CorviqHKsfdcM/CEmd/vWeh9fDiG4sdSJcmC3UTOPm4rv0yNpR8m3z7jipn1 jaHGFPZu+4w2l0rKVlu18W52oOmzYs4v6unFvZ4FJyVvuO+LMDuPgXvE/zxMfdURskue 8SrslgSgBI1tMhvT7gYhX1NQ3WTXM6h5AvWGBpt/ll0NLRi7dDfehdvOLDK+C0+cT0aM cP3g== X-Gm-Message-State: AElRT7EUQ4cWbTRrWHhebcCS6mKmSEFQO1CAIF7b2LavD6W03p0xy+Bg KofO6LcY97Oh2ihK8frA/e3b2EQ726iIPBT76zqwkQ== X-Google-Smtp-Source: AIpwx4+u16gYcoyCFu330Lq9ZjG0V61uGV5HsDGh75o0363hObsGXTw+u0yTZzDcQAbVwz7THhcrF1MOzoqzs9hsgTE= X-Received: by 10.223.195.116 with SMTP id e49mr7924570wrg.5.1522719625932; Mon, 02 Apr 2018 18:40:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.14.202 with HTTP; Mon, 2 Apr 2018 18:40:24 -0700 (PDT) In-Reply-To: <201804022340.w32Neo60014397@repo.freebsd.org> References: <201804022340.w32Neo60014397@repo.freebsd.org> From: Adrian Chadd Date: Mon, 2 Apr 2018 18:40:24 -0700 Message-ID: Subject: Re: svn commit: r331898 - in head/sys/contrib/ck: . include include/gcc include/gcc/sparcv9 include/gcc/x86 include/gcc/x86_64 include/spinlock src To: Olivier Houchard Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 01:40:28 -0000 hi! woohoo! what about CACHE_LINE_SIZE ? -a From owner-svn-src-all@freebsd.org Tue Apr 3 01:47:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C04F761B3; Tue, 3 Apr 2018 01:47:43 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 354B97EB3C; Tue, 3 Apr 2018 01:47:42 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id C37B4EE8; Mon, 2 Apr 2018 20:47:35 -0500 (CDT) Date: Mon, 2 Apr 2018 20:47:34 -0500 From: Mark Linimon To: Ed Maste Cc: Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... Message-ID: <20180403014734.GA31748@lonesome.com> References: <201803311138.w2VBcKHP014025@repo.freebsd.org> <68DEEF9A-6290-40AD-B51D-E187593C089F@FreeBSD.org> <20180331131818.GA22697@lonesome.com> <20180331184109.GA23589@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 01:47:44 -0000 So, the takeaway is, this change stays, and stable/11 users that build their own ports are on their own? Whatever happened to POLA? mcl From owner-svn-src-all@freebsd.org Tue Apr 3 02:03:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1695F7729D; Tue, 3 Apr 2018 02:03:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7B97F62C; Tue, 3 Apr 2018 02:03:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w3322xnN085228; Mon, 2 Apr 2018 19:02:59 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3322xXG085227; Mon, 2 Apr 2018 19:02:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804030202.w3322xXG085227@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... In-Reply-To: <20180403014734.GA31748@lonesome.com> To: Mark Linimon Date: Mon, 2 Apr 2018 19:02:59 -0700 (PDT) CC: Ed Maste , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 02:03:12 -0000 > So, the takeaway is, this change stays, and stable/11 users that build > their own ports are on their own? > > Whatever happened to POLA? I have no idea, but I fully agree that changing compilers 30 days before a code slush is just a very bad move. The llvm in 11.1 is 4. Is there some pressing reason that we need llvm 6 to be in release 11.2? Looks like I wont be upgrading to 11.2 as I am sure I'll have blocking issues with some ports. Though I could probably build them with 11.1, I hate that idea as then I have to keep an 11.1 around incase I need to rebuild something. :-( -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 3 02:08:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA831F777B5 for ; Tue, 3 Apr 2018 02:08:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 565E87F93D for ; Tue, 3 Apr 2018 02:08:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id v194-v6so20694744itb.0 for ; Mon, 02 Apr 2018 19:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=WThxa+EuokpJXL9ViZ9ygewEbQ+TR2jIE4rIskB6JGY=; b=SEzjPCKWHdMzf2+qsUnynAVqFcH0/sXaxevEHSALC2JkgyIAUY2QzgoCX9XB/LpLi2 s9gUAU0CeqsqJCHrr+RteIjo6as4tRrA58CS2rKLPBdNDbJTthQN/KYX0CGl5i3KzBQe 5PgLUiVFMU5b+aKCNWu4YRb5N0PH1ECUzPqzJaeT7iyYzuUVWY2pAQ5O8RiPHdLfjnOi OVdZ7t/hqWsgyePvKrFr5MjeCIWZ5xvQbBNa0AXMkgU3bEO2UablAQfCHYVZVpVm32F6 90u7k8pTOSi4G79Bwz1kbOQ2HpVrEXLtt31/YgG51wTtDdJgB+ulrGL1x5E6aSkfbMG8 JW9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=WThxa+EuokpJXL9ViZ9ygewEbQ+TR2jIE4rIskB6JGY=; b=aUG84XvbgpHgKk6p7vgMYb/ikQ5DsesTHdE0x9yJHrsNoLqJ26WUEghfp4iH2lJG7z tL7f0I0E7Ec3bzhL5EvWcHafXVN+kj1UuKlj9x2cgoUWCqhb6XHgPevc88fdvezNivrp ibmcbcYrgdVUj86rsNidhGI853dD542ewxqopyCYiyIjgyw9iPWAO3Ex7dtTiR1sgEKK wd9fN1puJAVQi8tKVRCBNAAEt+14dALk2IGVeTLqrBWlWsN8ChkI8lKm1Qg4YDhydkEp C1nNovEqDIGTGXPKMZNZUQ/Ee+Fqd+eoaHiZu/5MeKDflZlh4i/aJ5KrvKypk8RyADdj em8w== X-Gm-Message-State: ALQs6tB+ZaaHR/g+q9WIi1q5IZW1EIzcsthbmN/s0ruNXuJxSBdLKlA4 XIujSl1Ajhxy9awgi2LtBt38Lf/0yp4FJAx/fkogIg== X-Google-Smtp-Source: AIpwx49nN8NEbZwgOWmIh3SZuRheSRYP4eEnmUpIP531PYWvSaeR/eDzr52oZ+pq3fGJr7IyyforHkSREtYiWSNYKwU= X-Received: by 2002:a24:b649:: with SMTP id d9-v6mr3403085itj.51.1522721311485; Mon, 02 Apr 2018 19:08:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Mon, 2 Apr 2018 19:08:30 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180403014734.GA31748@lonesome.com> References: <201803311138.w2VBcKHP014025@repo.freebsd.org> <68DEEF9A-6290-40AD-B51D-E187593C089F@FreeBSD.org> <20180331131818.GA22697@lonesome.com> <20180331184109.GA23589@lonesome.com> <20180403014734.GA31748@lonesome.com> From: Warner Losh Date: Mon, 2 Apr 2018 20:08:30 -0600 X-Google-Sender-Auth: Z6PZcDLDeFhPANTUVzPS8_gZxvo Message-ID: Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... To: Mark Linimon Cc: Ed Maste , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 02:08:33 -0000 On Mon, Apr 2, 2018 at 7:47 PM, Mark Linimon wrote: > So, the takeaway is, this change stays, and stable/11 users that build > their own ports are on their own? > > Whatever happened to POLA? > I think the takeaway was that the timing was good, but the pre-MFC communication could be more explicit in the future. There's also more communication needed about how to fix common breakage from compiler updates that's needed as well when a new compiler is imported. In the mean time, there's fallout in the ports, and people should use the next month to fix them. Not idea, I'll grant. Warner From owner-svn-src-all@freebsd.org Tue Apr 3 02:29:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8C74F78E8F; Tue, 3 Apr 2018 02:29:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74DC480566; Tue, 3 Apr 2018 02:29:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FACC1E2F0; Tue, 3 Apr 2018 02:29:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w332TIUl037220; Tue, 3 Apr 2018 02:29:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w332THDD037170; Tue, 3 Apr 2018 02:29:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804030229.w332THDD037170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 Apr 2018 02:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331903 - in stable/11/sys/dev/mpr: . mpi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/dev/mpr: . mpi X-SVN-Commit-Revision: 331903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 02:29:19 -0000 Author: mav Date: Tue Apr 3 02:29:17 2018 New Revision: 331903 URL: https://svnweb.freebsd.org/changeset/base/331903 Log: MFC r331228: Update mpr(4) driver from v15 to v18 from Broadcom site. Version 16 is just a number bump, since we already had those changes. Version 17 introduces new AdapterType value, that allows new user-space tools from Broadcom to differentiate adapter generations 3 and 3.5. Version 18 updates headers and adds SAS_DEVICE_DISCOVERY_ERROR reporting. Modified: stable/11/sys/dev/mpr/mpi/mpi2.h stable/11/sys/dev/mpr/mpi/mpi2_cnfg.h stable/11/sys/dev/mpr/mpi/mpi2_history.txt stable/11/sys/dev/mpr/mpi/mpi2_ioc.h stable/11/sys/dev/mpr/mpr_ioctl.h stable/11/sys/dev/mpr/mpr_sas.c stable/11/sys/dev/mpr/mpr_sas_lsi.c stable/11/sys/dev/mpr/mpr_user.c stable/11/sys/dev/mpr/mprvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mpr/mpi/mpi2.h ============================================================================== --- stable/11/sys/dev/mpr/mpi/mpi2.h Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpi/mpi2.h Tue Apr 3 02:29:17 2018 (r331903) @@ -44,7 +44,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.46 + * mpi2.h Version: 02.00.48 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -151,6 +151,8 @@ * 04-10-16 02.00.44 Bumped MPI2_HEADER_VERSION_UNIT. * 07-06-16 02.00.45 Bumped MPI2_HEADER_VERSION_UNIT. * 09-02-16 02.00.46 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-23-16 02.00.47 Bumped MPI2_HEADER_VERSION_UNIT. + * 02-03-17 02.00.48 Bumped MPI2_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- */ @@ -194,7 +196,7 @@ /* Unit and Dev versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x2E) +#define MPI2_HEADER_VERSION_UNIT (0x30) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) Modified: stable/11/sys/dev/mpr/mpi/mpi2_cnfg.h ============================================================================== --- stable/11/sys/dev/mpr/mpi/mpi2_cnfg.h Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpi/mpi2_cnfg.h Tue Apr 3 02:29:17 2018 (r331903) @@ -42,7 +42,7 @@ * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.39 + * mpi2_cnfg.h Version: 02.00.40 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -255,6 +255,10 @@ * 09-01-16 02.00.39 Added MPI26_CONFIG_PAGE_ENCLOSURE_0 and related defines. * Added MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE and * MPI26_ENCLOS_PGAD_FORM_HANDLE page address formats. + * 02-02-17 02.00.40 Added MPI2_MANPAGE7_SLOT_UNKNOWN. + * Added ChassisSlot field to SAS Enclosure Page 0. + * Added ChassisSlot Valid bit (bit 5) to the Flags field + * in SAS Enclosure Page 0. * -------------------------------------------------------------------------- */ @@ -853,6 +857,9 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_INFO #define MPI2_MANPAGE7_LOCATION_NOT_PRESENT (0x20) #define MPI2_MANPAGE7_LOCATION_NOT_CONNECTED (0x80) +/* defines for the Slot field */ +#define MPI2_MANPAGE7_SLOT_UNKNOWN (0xFFFF) + /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to * one and check the value returned for NumPhys at runtime. @@ -3092,11 +3099,11 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 U16 EnclosureHandle; /* 0x16 */ U16 NumSlots; /* 0x18 */ U16 StartSlot; /* 0x1A */ - U8 Reserved2; /* 0x1C */ + U8 ChassisSlot; /* 0x1C */ U8 EnclosureLevel; /* 0x1D */ U16 SEPDevHandle; /* 0x1E */ - U32 Reserved3; /* 0x20 */ - U32 Reserved4; /* 0x24 */ + U32 Reserved2; /* 0x20 */ + U32 Reserved3; /* 0x24 */ } MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0, Mpi2SasEnclosurePage0_t, MPI2_POINTER pMpi2SasEnclosurePage0_t, @@ -3107,6 +3114,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 #define MPI2_SASENCLOSURE0_PAGEVERSION (0x04) /* values for SAS Enclosure Page 0 Flags field */ +#define MPI2_SAS_ENCLS0_FLAGS_CHASSIS_SLOT_VALID (0x0020) #define MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID (0x0010) #define MPI2_SAS_ENCLS0_FLAGS_MNG_MASK (0x000F) #define MPI2_SAS_ENCLS0_FLAGS_MNG_UNKNOWN (0x0000) @@ -3119,6 +3127,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 #define MPI26_ENCLOSURE0_PAGEVERSION (0x04) /* Values for Enclosure Page 0 Flags field */ +#define MPI26_ENCLS0_FLAGS_CHASSIS_SLOT_VALID (0x0020) #define MPI26_ENCLS0_FLAGS_ENCL_LEVEL_VALID (0x0010) #define MPI26_ENCLS0_FLAGS_MNG_MASK (0x000F) #define MPI26_ENCLS0_FLAGS_MNG_UNKNOWN (0x0000) Modified: stable/11/sys/dev/mpr/mpi/mpi2_history.txt ============================================================================== --- stable/11/sys/dev/mpr/mpi/mpi2_history.txt Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpi/mpi2_history.txt Tue Apr 3 02:29:17 2018 (r331903) @@ -41,16 +41,16 @@ All rights reserved. --------------------------------------- - Header Set Release Version: 02.00.46 - Header Set Release Date: 09-07-16 + Header Set Release Version: 02.00.48 + Header Set Release Date: 02-03-17 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.46 02.00.45 - mpi2_cnfg.h 02.00.39 02.00.38 + mpi2.h 02.00.48 02.00.47 + mpi2_cnfg.h 02.00.40 02.00.39 mpi2_init.h 02.00.21 02.00.21 - mpi2_ioc.h 02.00.30 02.00.29 + mpi2_ioc.h 02.00.32 02.00.31 mpi2_raid.h 02.00.11 02.00.11 mpi2_sas.h 02.00.10 02.00.10 mpi2_targ.h 02.00.09 02.00.09 @@ -59,7 +59,7 @@ mpi2_ra.h 02.00.01 02.00.01 mpi2_hbd.h 02.00.04 02.00.04 mpi2_pci.h 02.00.02 02.00.02 - mpi2_history.txt 02.00.43 02.00.43 + mpi2_history.txt 02.00.45 02.00.44 * Date Version Description @@ -161,6 +161,8 @@ mpi2.h * 04-10-16 02.00.44 Bumped MPI2_HEADER_VERSION_UNIT. * 07-06-16 02.00.45 Bumped MPI2_HEADER_VERSION_UNIT. * 09-02-16 02.00.46 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-23-16 02.00.47 Bumped MPI2_HEADER_VERSION_UNIT. + * 02-03-17 02.00.48 Bumped MPI2_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -363,8 +365,12 @@ mpi2_cnfg.h * phy data. * Added InitStatus to PCIe IO Unit Page 1 header. * 09-01-16 02.00.39 Added MPI26_CONFIG_PAGE_ENCLOSURE_0 and related defines. - * Added MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE and - * MPI26_ENCLOS_PGAD_FORM_HANDLE page address formats. + * Added MPI26_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE and + * MPI26_ENCLOS_PGAD_FORM_HANDLE page address formats. + * 02-02-17 02.00.40 Added MPI2_MANPAGE7_SLOT_UNKNOWN. + * Added ChassisSlot field to SAS Enclosure Page 0. + * Added ChassisSlot Valid bit (bit 5) to the Flags field + * in SAS Enclosure Page 0. * -------------------------------------------------------------------------- mpi2_init.h @@ -551,10 +557,15 @@ mpi2_ioc.h * Request Message. * Added new values for the RegionType field in the Layout * Data sections of the FLASH Layout Extended Image Data. - * Added new defines for the ReasonCode field of + * Added new defines for the ReasonCode field of * Active Cable Exception Event. - * Added MPI2_EVENT_ENCL_DEVICE_STATUS_CHANGE and - * MPI26_EVENT_DATA_ENCL_DEV_STATUS_CHANGE. + * Added MPI2_EVENT_ENCL_DEVICE_STATUS_CHANGE and + * MPI26_EVENT_DATA_ENCL_DEV_STATUS_CHANGE. + * 11-23-16 02.00.31 Added MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR and + * MPI25_EVENT_DATA_SAS_DEVICE_DISCOVERY_ERROR. + * 02-02-17 02.00.32 Added MPI2_FW_DOWNLOAD_ITYPE_CBB_BACKUP. + * Added MPI25_EVENT_DATA_ACTIVE_CABLE_EXCEPT and related + * defines for the ReasonCode field. * -------------------------------------------------------------------------- mpi2_raid.h @@ -676,20 +687,35 @@ mpi2_pci.h mpi2_history.txt Parts list history -Filename 02.00.46 02.00.45 02.00.44 02.00.43 02.00.42 ----------- -------- -------- -------- -------- -------- -mpi2.h 02.00.46 02.00.45 02.00.44 02.00.43 02.00.42 -mpi2_cnfg.h 02.00.39 02.00.38 02.00.37 02.00.36 02.00.35 -mpi2_init.h 02.00.21 02.00.21 02.00.21 02.00.21 02.00.20 -mpi2_ioc.h 02.00.30 02.00.29 02.00.28 02.00.28 02.00.27 -mpi2_raid.h 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 -mpi2_sas.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 -mpi2_targ.h 02.00.09 02.00.09 02.00.09 02.00.09 02.00.09 -mpi2_tool.h 02.00.14 02.00.13 02.00.13 02.00.13 02.00.13 -mpi2_type.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 -mpi2_ra.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 -mpi2_hbd.h 02.00.04 02.00.04 02.00.04 02.00.04 02.00.03 -mpi2_pci.h 02.00.02 02.00.02 02.00.01 02.00.01 02.00.00 +Filename 02.00.48 +---------- -------- +mpi2.h 02.00.48 +mpi2_cnfg.h 02.00.40 +mpi2_init.h 02.00.21 +mpi2_ioc.h 02.00.32 +mpi2_raid.h 02.00.11 +mpi2_sas.h 02.00.10 +mpi2_targ.h 02.00.09 +mpi2_tool.h 02.00.14 +mpi2_type.h 02.00.01 +mpi2_ra.h 02.00.01 +mpi2_hbd.h 02.00.04 +mpi2_pci.h 02.00.02 + +Filename 02.00.47 02.00.46 02.00.45 02.00.44 02.00.43 02.00.42 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.47 02.00.46 02.00.45 02.00.44 02.00.43 02.00.42 +mpi2_cnfg.h 02.00.39 02.00.39 02.00.38 02.00.37 02.00.36 02.00.35 +mpi2_init.h 02.00.21 02.00.21 02.00.21 02.00.21 02.00.21 02.00.20 +mpi2_ioc.h 02.00.31 02.00.30 02.00.29 02.00.28 02.00.28 02.00.27 +mpi2_raid.h 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 +mpi2_sas.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 +mpi2_targ.h 02.00.09 02.00.09 02.00.09 02.00.09 02.00.09 02.00.09 +mpi2_tool.h 02.00.14 02.00.14 02.00.13 02.00.13 02.00.13 02.00.13 +mpi2_type.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_ra.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_hbd.h 02.00.04 02.00.04 02.00.04 02.00.04 02.00.04 02.00.03 +mpi2_pci.h 02.00.02 02.00.02 02.00.02 02.00.01 02.00.01 02.00.00 Filename 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 ---------- -------- -------- -------- -------- -------- -------- Modified: stable/11/sys/dev/mpr/mpi/mpi2_ioc.h ============================================================================== --- stable/11/sys/dev/mpr/mpi/mpi2_ioc.h Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpi/mpi2_ioc.h Tue Apr 3 02:29:17 2018 (r331903) @@ -42,7 +42,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: October 11, 2006 * - * mpi2_ioc.h Version: 02.00.30 + * mpi2_ioc.h Version: 02.00.32 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -200,6 +200,11 @@ * Active Cable Exception Event. * Added MPI2_EVENT_ENCL_DEVICE_STATUS_CHANGE and * MPI26_EVENT_DATA_ENCL_DEV_STATUS_CHANGE. + * 11-23-16 02.00.31 Added MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR and + * MPI25_EVENT_DATA_SAS_DEVICE_DISCOVERY_ERROR. + * 02-02-17 02.00.32 Added MPI2_FW_DOWNLOAD_ITYPE_CBB_BACKUP. + * Added MPI25_EVENT_DATA_ACTIVE_CABLE_EXCEPT and related + * defines for the ReasonCode field. * -------------------------------------------------------------------------- */ @@ -610,6 +615,7 @@ typedef struct _MPI2_EVENT_NOTIFICATION_REPLY #define MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST (0x0032) /* MPI v2.6 and later */ #define MPI2_EVENT_PCIE_LINK_COUNTER (0x0033) /* MPI v2.6 and later */ #define MPI2_EVENT_ACTIVE_CABLE_EXCEPTION (0x0034) /* MPI v2.6 and later */ +#define MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR (0x0035) /* MPI v2.5 and later */ #define MPI2_EVENT_MIN_PRODUCT_SPECIFIC (0x006E) #define MPI2_EVENT_MAX_PRODUCT_SPECIFIC (0x007F) @@ -715,12 +721,21 @@ typedef struct _MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT U8 ReasonCode; /* 0x04 */ U8 ReceptacleID; /* 0x05 */ U16 Reserved1; /* 0x06 */ -} MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT, +} MPI25_EVENT_DATA_ACTIVE_CABLE_EXCEPT, + MPI2_POINTER PTR_MPI25_EVENT_DATA_ACTIVE_CABLE_EXCEPT, + Mpi25EventDataActiveCableExcept_t, + MPI2_POINTER pMpi25EventDataActiveCableExcept_t, + MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT, MPI2_POINTER PTR_MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT, Mpi26EventDataActiveCableExcept_t, MPI2_POINTER pMpi26EventDataActiveCableExcept_t; -/* defines for ReasonCode field */ +/* MPI2.5 defines for the ReasonCode field */ +#define MPI25_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER (0x00) +#define MPI25_EVENT_ACTIVE_CABLE_PRESENT (0x01) +#define MPI25_EVENT_ACTIVE_CABLE_DEGRADED (0x02) + +/* MPI2.6 defines for the ReasonCode field */ #define MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER (0x00) #define MPI26_EVENT_ACTIVE_CABLE_PRESENT (0x01) #define MPI26_EVENT_ACTIVE_CABLE_DEGRADED (0x02) @@ -1168,6 +1183,24 @@ typedef struct _MPI2_EVENT_DATA_SAS_QUIESCE #define MPI2_EVENT_SAS_QUIESCE_RC_COMPLETED (0x02) +typedef struct _MPI25_EVENT_DATA_SAS_DEVICE_DISCOVERY_ERROR +{ + U16 DevHandle; /* 0x00 */ + U8 ReasonCode; /* 0x02 */ + U8 PhysicalPort; /* 0x03 */ + U32 Reserved1[2]; /* 0x04 */ + U64 SASAddress; /* 0x0C */ + U32 Reserved2[2]; /* 0x14 */ +} MPI25_EVENT_DATA_SAS_DEVICE_DISCOVERY_ERROR, + MPI2_POINTER PTR_MPI25_EVENT_DATA_SAS_DEVICE_DISCOVERY_ERROR, + Mpi25EventDataSasDeviceDiscoveryError_t, + MPI2_POINTER pMpi25EventDataSasDeviceDiscoveryError_t; + +/* SAS Device Discovery Error Event data ReasonCode values */ +#define MPI25_EVENT_SAS_DISC_ERR_SMP_FAILED (0x01) +#define MPI25_EVENT_SAS_DISC_ERR_SMP_TIMEOUT (0x02) + + /* Host Based Discovery Phy Event data */ typedef struct _MPI2_EVENT_HBD_PHY_SAS @@ -1493,6 +1526,7 @@ typedef struct _MPI2_FW_DOWNLOAD_REQUEST #define MPI2_FW_DOWNLOAD_ITYPE_COMPLETE (0x0A) #define MPI2_FW_DOWNLOAD_ITYPE_COMMON_BOOT_BLOCK (0x0B) #define MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY (0x0C) /* MPI v2.5 and newer */ +#define MPI2_FW_DOWNLOAD_ITYPE_CBB_BACKUP (0x0D) #define MPI2_FW_DOWNLOAD_ITYPE_SBR (0x0E) #define MPI2_FW_DOWNLOAD_ITYPE_SBR_BACKUP (0x0F) #define MPI2_FW_DOWNLOAD_ITYPE_HIIM (0x10) Modified: stable/11/sys/dev/mpr/mpr_ioctl.h ============================================================================== --- stable/11/sys/dev/mpr/mpr_ioctl.h Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpr_ioctl.h Tue Apr 3 02:29:17 2018 (r331903) @@ -149,6 +149,7 @@ typedef struct mpr_pci_bits * */ #define MPRIOCTL_ADAPTER_TYPE_SAS3 6 +#define MPRIOCTL_ADAPTER_TYPE_SAS35 7 typedef struct mpr_adapter_data { uint32_t StructureLength; @@ -202,7 +203,7 @@ typedef struct mpr_pass_thru /* * Event queue defines */ -#define MPR_EVENT_QUEUE_SIZE (50) /* Max Events stored in driver */ +#define MPR_EVENT_QUEUE_SIZE (200) /* Max Events stored in driver */ #define MPR_MAX_EVENT_DATA_LENGTH (48) /* Size of each event in Dwords */ typedef struct mpr_event_query Modified: stable/11/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/11/sys/dev/mpr/mpr_sas.c Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpr_sas.c Tue Apr 3 02:29:17 2018 (r331903) @@ -708,6 +708,7 @@ mprsas_register_events(struct mpr_softc *sc) setbit(events, MPI2_EVENT_IR_PHYSICAL_DISK); setbit(events, MPI2_EVENT_IR_OPERATION_STATUS); setbit(events, MPI2_EVENT_TEMP_THRESHOLD); + setbit(events, MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR); if (sc->facts->MsgVersion >= MPI2_VERSION_02_06) { setbit(events, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION); if (sc->mpr_flags & MPR_FLAGS_GEN35_IOC) { Modified: stable/11/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- stable/11/sys/dev/mpr/mpr_sas_lsi.c Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpr_sas_lsi.c Tue Apr 3 02:29:17 2018 (r331903) @@ -681,6 +681,41 @@ skip_fp_send: } break; } + case MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR: + { + pMpi25EventDataSasDeviceDiscoveryError_t discovery_error_data; + uint64_t sas_address; + + discovery_error_data = + (pMpi25EventDataSasDeviceDiscoveryError_t) + fw_event->event_data; + + sas_address = discovery_error_data->SASAddress.High; + sas_address = (sas_address << 32) | + discovery_error_data->SASAddress.Low; + + switch(discovery_error_data->ReasonCode) { + case MPI25_EVENT_SAS_DISC_ERR_SMP_FAILED: + { + mpr_printf(sc, "SMP command failed during discovery " + "for expander with SAS Address %jx and " + "handle 0x%x.\n", sas_address, + discovery_error_data->DevHandle); + break; + } + case MPI25_EVENT_SAS_DISC_ERR_SMP_TIMEOUT: + { + mpr_printf(sc, "SMP command timed out during " + "discovery for expander with SAS Address %jx and " + "handle 0x%x.\n", sas_address, + discovery_error_data->DevHandle); + break; + } + default: + break; + } + break; + } case MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST: { MPI26_EVENT_DATA_PCIE_TOPOLOGY_CHANGE_LIST *data; Modified: stable/11/sys/dev/mpr/mpr_user.c ============================================================================== --- stable/11/sys/dev/mpr/mpr_user.c Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mpr_user.c Tue Apr 3 02:29:17 2018 (r331903) @@ -1189,7 +1189,10 @@ mpr_user_get_adapter_data(struct mpr_softc *sc, mpr_ad /* * General device info. */ - data->AdapterType = MPRIOCTL_ADAPTER_TYPE_SAS3; + if (sc->mpr_flags & MPR_FLAGS_GEN35_IOC) + data->AdapterType = MPRIOCTL_ADAPTER_TYPE_SAS35; + else + data->AdapterType = MPRIOCTL_ADAPTER_TYPE_SAS3; data->PCIDeviceHwId = pci_get_device(sc->mpr_dev); data->PCIDeviceHwRev = pci_read_config(sc->mpr_dev, PCIR_REVID, 1); data->SubSystemId = pci_get_subdevice(sc->mpr_dev); Modified: stable/11/sys/dev/mpr/mprvar.h ============================================================================== --- stable/11/sys/dev/mpr/mprvar.h Tue Apr 3 01:22:15 2018 (r331902) +++ stable/11/sys/dev/mpr/mprvar.h Tue Apr 3 02:29:17 2018 (r331903) @@ -33,7 +33,7 @@ #ifndef _MPRVAR_H #define _MPRVAR_H -#define MPR_DRIVER_VERSION "15.03.00.00-fbsd" +#define MPR_DRIVER_VERSION "18.03.00.00-fbsd" #define MPR_DB_MAX_WAIT 2500 From owner-svn-src-all@freebsd.org Tue Apr 3 02:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56EACF79CBC; Tue, 3 Apr 2018 02:41:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0597480D4F; Tue, 3 Apr 2018 02:41:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0087E1E502; Tue, 3 Apr 2018 02:41:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w332fW55076157; Tue, 3 Apr 2018 02:41:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w332fWnF076156; Tue, 3 Apr 2018 02:41:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804030241.w332fWnF076156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 3 Apr 2018 02:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331904 - head/stand/defaults X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/defaults X-SVN-Commit-Revision: 331904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 02:41:33 -0000 Author: kevans Date: Tue Apr 3 02:41:32 2018 New Revision: 331904 URL: https://svnweb.freebsd.org/changeset/base/331904 Log: Default loader.conf: Drop efi_max_resolution to 1x1 Effectively disabling the mode changing bits in the loader. No matter which way we go with it, it seems to be wrong- either the firmware doesn't change the resolution and reports the resolution we requested, or the firmware changes the resolution and doesn't report the resolution we requested. It some cases, it does the right thing, but the bad cases outweight those. Interested individuals can still set efi_max_resolution to 1080p or whatnot in loader.conf(5) to restore the new behavior, but the new behavior does not work out well for many cases. Discussed with: imp Modified: head/stand/defaults/loader.conf Modified: head/stand/defaults/loader.conf ============================================================================== --- head/stand/defaults/loader.conf Tue Apr 3 02:29:17 2018 (r331903) +++ head/stand/defaults/loader.conf Tue Apr 3 02:41:32 2018 (r331904) @@ -75,7 +75,7 @@ acpi_video_load="NO" # Load the ACPI video extension #geom_eli_passphrase_prompt="NO" # Prompt for geli(8) passphrase to mount root bootenv_autolist="YES" # Auto populate the list of ZFS Boot Environments #beastie_disable="NO" # Turn the beastie boot menu on and off -efi_max_resolution="1080p" # Set the max resolution for EFI loader to use: +efi_max_resolution="1x1" # Set the max resolution for EFI loader to use: # 480p, 720p, 1080p, 2160p/4k, 5k, or specify # WidthxHeight (e.g. 1920x1080) #kernels="kernel kernel.old" # Kernels to display in the boot menu From owner-svn-src-all@freebsd.org Tue Apr 3 03:41:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA5D2F7D681; Tue, 3 Apr 2018 03:41:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6208A83390; Tue, 3 Apr 2018 03:41:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CEFF1F096; Tue, 3 Apr 2018 03:41:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w333fuPb054626; Tue, 3 Apr 2018 03:41:56 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w333fuuB054625; Tue, 3 Apr 2018 03:41:56 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804030341.w333fuuB054625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 3 Apr 2018 03:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331905 - stable/11/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 331905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 03:41:57 -0000 Author: gonzo Date: Tue Apr 3 03:41:55 2018 New Revision: 331905 URL: https://svnweb.freebsd.org/changeset/base/331905 Log: MFC r330727 (without optional dts part): [rpi] remove IRQ support for BCM233x RNG Upstream DTBs don't provide IRQ lines for the RNG. Moreover, harvesting bytes as often as the RNG interrupt is triggered (87 times per sec) is an overkill. For these reasons, get rid of the interrupt mode and make callout mode the default, with random bits harvested every 4 seconds. Submitted by: Sylvain Garrigues Reviewed by: ian, imp, manu, mmel Approved by: emaste Differential Revision: https://reviews.freebsd.org/D14541 Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c Tue Apr 3 02:41:32 2018 (r331904) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_rng.c Tue Apr 3 03:41:55 2018 (r331905) @@ -51,10 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(BCM2835_RNG_USE_CALLOUT) -#define BCM2835_RNG_USE_INTERRUPT -#endif - static device_attach_t bcm2835_rng_attach; static device_detach_t bcm2835_rng_detach; static device_probe_t bcm2835_rng_probe; @@ -92,18 +88,15 @@ static device_probe_t bcm2835_rng_probe; #define RNG_NUM_OSCILLATORS 6 #define RNG_STALL_COUNT_DEFAULT 10 +#define RNG_CALLOUT_TICKS (hz * 4) + struct bcm2835_rng_softc { device_t sc_dev; struct resource * sc_mem_res; struct resource * sc_irq_res; void * sc_intr_hdl; -#if defined(BCM2835_RNG_USE_CALLOUT) || defined(BCM2835_RNG_USE_INTERRUPT) uint32_t sc_buf[RNG_FIFO_WORDS]; -#endif -#if defined(BCM2835_RNG_USE_CALLOUT) struct callout sc_rngto; - int sc_rnghz; -#endif int sc_stall_count; int sc_rbg2x; long sc_underrun; @@ -214,20 +207,7 @@ bcm2835_rng_disable_intr(struct bcm2835_rng_softc *sc) bcm2835_rng_write4(sc, RNG_INT_MASK, mask); } -#if defined(BCM2835_RNG_USE_INTERRUPT) static void -bcm2835_rng_enable_intr(struct bcm2835_rng_softc *sc) -{ - uint32_t mask; - - /* Clear the interrupt off bit in the interrupt mask register */ - mask = bcm2835_rng_read4(sc, RNG_INT_MASK); - mask &= ~RNG_INT_OFF_BIT; - bcm2835_rng_write4(sc, RNG_INT_MASK, mask); -} -#endif - -static void bcm2835_rng_start(struct bcm2835_rng_softc *sc) { uint32_t ctrl; @@ -244,11 +224,6 @@ bcm2835_rng_start(struct bcm2835_rng_softc *sc) if (sc->sc_rbg2x) ctrl |= RNG_RBG2X; bcm2835_rng_write4(sc, RNG_CTRL, ctrl); - -#if defined(BCM2835_RNG_USE_INTERRUPT) - /* Enable the interrupt */ - bcm2835_rng_enable_intr(sc); -#endif } static void @@ -263,12 +238,13 @@ bcm2835_rng_stop(struct bcm2835_rng_softc *sc) } static void -bcm2835_rng_harvest(struct bcm2835_rng_softc *sc) +bcm2835_rng_harvest(void *arg) { uint32_t *dest; uint32_t status; u_int cnt, nread, num_avail, num_words; int seen_underrun, num_stalls; + struct bcm2835_rng_softc *sc = arg; dest = sc->sc_buf; nread = num_words = 0; @@ -316,9 +292,7 @@ bcm2835_rng_harvest(struct bcm2835_rng_softc *sc) random_harvest_queue(sc->sc_buf, cnt, cnt * NBBY / 2, RANDOM_PURE_BROADCOM); -#if defined(BCM2835_RNG_USE_CALLOUT) - callout_reset(&sc->sc_rngto, sc->sc_rnghz, bcm2835_rng_harvest, sc); -#endif + callout_reset(&sc->sc_rngto, RNG_CALLOUT_TICKS, bcm2835_rng_harvest, sc); } static int @@ -390,10 +364,10 @@ bcm2835_rng_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_stall_count = RNG_STALL_COUNT_DEFAULT; -#ifdef BCM2835_RNG_USE_CALLOUT + /* Initialize callout */ callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); -#endif + TUNABLE_INT_FETCH("bcmrng.2xspeed", &sc->sc_rbg2x); TUNABLE_INT_FETCH("bcmrng.stall_count", &sc->sc_stall_count); @@ -406,27 +380,6 @@ bcm2835_rng_attach(device_t dev) return (ENXIO); } -#if defined(BCM2835_RNG_USE_INTERRUPT) - /* Allocate interrupt resource */ - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq_res == NULL) { - bcm2835_rng_detach(dev); - return (ENXIO); - } - - /* Set up the interrupt handler */ - error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)bcm2835_rng_harvest, sc, &sc->sc_intr_hdl); - if (error) { - device_printf(dev, "Failed to set up IRQ\n"); - sc->sc_intr_hdl = NULL; - bcm2835_rng_detach(dev); - return (error); - } -#endif - /* Start the RNG */ bcm2835_rng_start(sc); @@ -461,14 +414,11 @@ bcm2835_rng_attach(device_t dev) sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); #endif -#if defined(BCM2835_RNG_USE_CALLOUT) - /* Reset callout */ - if (hz >= 100) - sc->sc_rnghz = hz / 100; - else - sc->sc_rnghz = 1; - callout_reset(&sc->sc_rngto, sc->sc_rnghz, bcm2835_rng_harvest, sc); -#endif + /* + * Schedule the initial harvesting one second from now, which should give the + * hardware RNG plenty of time to generate the first random bytes. + */ + callout_reset(&sc->sc_rngto, hz, bcm2835_rng_harvest, sc); return (0); } @@ -477,9 +427,6 @@ static int bcm2835_rng_detach(device_t dev) { struct bcm2835_rng_softc *sc; -#if defined(BCM2835_RNG_USE_INTERRUPT) - int error; -#endif sc = device_get_softc(dev); @@ -487,27 +434,7 @@ bcm2835_rng_detach(device_t dev) bcm2835_rng_stop(sc); /* Drain the callout it */ -#if defined(BCM2835_RNG_USE_CALLOUT) callout_drain(&sc->sc_rngto); -#endif - -#if defined(BCM2835_RNG_USE_INTERRUPT) - /* Tear down the interrupt */ - if (sc->sc_irq_res && sc->sc_intr_hdl) { - error = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl); - if (error != 0) { - device_printf(dev, "could not tear down IRQ\n"); - return (error); - } - sc->sc_intr_hdl = NULL; - } - - /* Release interrupt resource */ - if (sc->sc_irq_res) { - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); - sc->sc_irq_res = NULL; - } -#endif /* Release memory resource */ if (sc->sc_mem_res != NULL) From owner-svn-src-all@freebsd.org Tue Apr 3 04:31:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D313F80C9E; Tue, 3 Apr 2018 04:31:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDFD850C6; Tue, 3 Apr 2018 04:31:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A6461F809; Tue, 3 Apr 2018 04:31:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w334VtxQ086656; Tue, 3 Apr 2018 04:31:55 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w334VtSp086654; Tue, 3 Apr 2018 04:31:55 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804030431.w334VtSp086654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 3 Apr 2018 04:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331906 - head/sys/arm/xilinx X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/xilinx X-SVN-Commit-Revision: 331906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 04:31:55 -0000 Author: gonzo Date: Tue Apr 3 04:31:54 2018 New Revision: 331906 URL: https://svnweb.freebsd.org/changeset/base/331906 Log: Fix accidental USB port resets by GPIO on Zynq/Zedboard boards The Zynq/Zedboard GPIO driver attempts to tri-state all GPIO pins on boot up but the order in which I reset the hardware can cause the pins to be briefly held low before being tri-stated. This is a problem on boards that use GPIO pins to reset devices. In particular, the Zybo and ZC-706 boards use a GPIO pin as a USB PHY reset. If U-boot enables the USB port before booting the kernel, the GPIO driver attach causes a glitch on the USB PHY reset and the USB port loses power. My fix is to have the GPIO driver leave the pins in whatever configuration U-boot placed them. PR: 225713 Submitted by: Thomas Skibo MFC after: 1 week Modified: head/sys/arm/xilinx/zy7_gpio.c Modified: head/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- head/sys/arm/xilinx/zy7_gpio.c Tue Apr 3 03:41:55 2018 (r331905) +++ head/sys/arm/xilinx/zy7_gpio.c Tue Apr 3 04:31:54 2018 (r331906) @@ -298,24 +298,6 @@ zy7_gpio_probe(device_t dev) return (0); } -static void -zy7_gpio_hw_reset(struct zy7_gpio_softc *sc) -{ - int i; - - for (i = 0; i < NUMBANKS; i++) { - WR4(sc, ZY7_GPIO_DATA(i), 0); - WR4(sc, ZY7_GPIO_DIRM(i), 0); - WR4(sc, ZY7_GPIO_OEN(i), 0); - WR4(sc, ZY7_GPIO_INT_DIS(i), 0xffffffff); - WR4(sc, ZY7_GPIO_INT_POLARITY(i), 0); - WR4(sc, ZY7_GPIO_INT_TYPE(i), - i == 1 ? 0x003fffff : 0xffffffff); - WR4(sc, ZY7_GPIO_INT_ANY(i), 0); - WR4(sc, ZY7_GPIO_INT_STAT(i), 0xffffffff); - } -} - static int zy7_gpio_detach(device_t dev); static int @@ -337,9 +319,6 @@ zy7_gpio_attach(device_t dev) zy7_gpio_detach(dev); return (ENOMEM); } - - /* Completely reset. */ - zy7_gpio_hw_reset(sc); sc->busdev = gpiobus_attach_bus(dev); if (sc->busdev == NULL) { From owner-svn-src-all@freebsd.org Tue Apr 3 06:06:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C0EFF84F18; Tue, 3 Apr 2018 06:06:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F158768108; Tue, 3 Apr 2018 06:06:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4030207EC; Tue, 3 Apr 2018 06:06:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3366dU1014373; Tue, 3 Apr 2018 06:06:39 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3366dSJ014363; Tue, 3 Apr 2018 06:06:39 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804030606.w3366dSJ014363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 3 Apr 2018 06:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331907 - in stable/11/sys/arm: include ti ti/am335x X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11/sys/arm: include ti ti/am335x X-SVN-Commit-Revision: 331907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 06:06:40 -0000 Author: gonzo Date: Tue Apr 3 06:06:39 2018 New Revision: 331907 URL: https://svnweb.freebsd.org/changeset/base/331907 Log: MFC r307943-r307944, r308698 r307943 by andrew: Remove the need for the delay to be zero when MULTIDELAY is undefined, it may be useful to only enable this in some configs. Sponsored by: ABT Systems Ltd r307944 by andrew: Add MULTIDELAY support to the am335x dmtimer. This will be useful for testing Cortex-A8 support in GENERIC. Sponsored by: ABT Systems Ltd r308698 by loos: After r308533, the platform compatible string must be an exact match. Use "ti,am33xx" instead of "ti,am335x", which gives an exact match in every DTS we support. This fixes the boot on TI SoCs after r308533. Suggested by: gonzo Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/include/platformvar.h stable/11/sys/arm/ti/am335x/am335x_dmtimer.c stable/11/sys/arm/ti/ti_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/platformvar.h ============================================================================== --- stable/11/sys/arm/include/platformvar.h Tue Apr 3 04:31:54 2018 (r331906) +++ stable/11/sys/arm/include/platformvar.h Tue Apr 3 06:06:39 2018 (r331907) @@ -97,7 +97,7 @@ extern platform_method_t fdt_platform_methods[]; #ifdef MULTIDELAY #define FDT_PLATFORM_CTASSERT(delay) CTASSERT(delay > 0) #else -#define FDT_PLATFORM_CTASSERT(delay) CTASSERT(delay == 0) +#define FDT_PLATFORM_CTASSERT(delay) #endif #define PLATFORM_DATA(NAME, delay) \ Modified: stable/11/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_dmtimer.c Tue Apr 3 04:31:54 2018 (r331906) +++ stable/11/sys/arm/ti/am335x/am335x_dmtimer.c Tue Apr 3 06:06:39 2018 (r331907) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef MULTIDELAY +#include /* For arm_set_delay */ +#endif + #include #include #include @@ -67,6 +71,8 @@ struct am335x_dmtimer_softc { static struct am335x_dmtimer_softc *am335x_dmtimer_et_sc = NULL; static struct am335x_dmtimer_softc *am335x_dmtimer_tc_sc = NULL; +static void am335x_dmtimer_delay(int, void *); + /* * We use dmtimer2 for eventtimer and dmtimer3 for timecounter. */ @@ -235,6 +241,10 @@ am335x_dmtimer_tc_init(struct am335x_dmtimer_softc *sc am335x_dmtimer_tc_sc = sc; tc_init(&sc->func.tc); +#ifdef MULTIDELAY + arm_set_delay(am335x_dmtimer_delay, sc); +#endif + return (0); } @@ -328,23 +338,13 @@ static devclass_t am335x_dmtimer_devclass; DRIVER_MODULE(am335x_dmtimer, simplebus, am335x_dmtimer_driver, am335x_dmtimer_devclass, 0, 0); MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); -void -DELAY(int usec) +static void +am335x_dmtimer_delay(int usec, void *arg) { - struct am335x_dmtimer_softc *sc; + struct am335x_dmtimer_softc *sc = arg; int32_t counts; uint32_t first, last; - sc = am335x_dmtimer_tc_sc; - - if (sc == NULL) { - for (; usec > 0; usec--) - for (counts = 200; counts > 0; counts--) - /* Prevent gcc from optimizing out the loop */ - cpufunc_nullop(); - return; - } - /* Get the number of times to count */ counts = (usec + 1) * (sc->sysclk_freq / 1000000); @@ -361,3 +361,19 @@ DELAY(int usec) } } +#ifndef MULTIDELAY +void +DELAY(int usec) +{ + int32_t counts; + + if (am335x_dmtimer_tc_sc == NULL) { + for (; usec > 0; usec--) + for (counts = 200; counts > 0; counts--) + /* Prevent gcc from optimizing out the loop */ + cpufunc_nullop(); + return; + } else + am335x_dmtimer_delay(usec, am335x_dmtimer_tc_sc); +} +#endif Modified: stable/11/sys/arm/ti/ti_machdep.c ============================================================================== --- stable/11/sys/arm/ti/ti_machdep.c Tue Apr 3 04:31:54 2018 (r331906) +++ stable/11/sys/arm/ti/ti_machdep.c Tue Apr 3 06:06:39 2018 (r331907) @@ -124,5 +124,5 @@ static platform_method_t am335x_methods[] = { PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am335x", 0); +FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am33xx", 200); #endif From owner-svn-src-all@freebsd.org Tue Apr 3 06:46:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CBCF871E7; Tue, 3 Apr 2018 06:46:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B32D697F3; Tue, 3 Apr 2018 06:46:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5614020E93; Tue, 3 Apr 2018 06:46:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w336kQQ0004258; Tue, 3 Apr 2018 06:46:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w336kQI5004257; Tue, 3 Apr 2018 06:46:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804030646.w336kQI5004257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 3 Apr 2018 06:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331908 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 331908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 06:46:26 -0000 Author: avg Date: Tue Apr 3 06:46:26 2018 New Revision: 331908 URL: https://svnweb.freebsd.org/changeset/base/331908 Log: fix signatures of cpu_reset_real and cpu_reset_proxy, broken in r331878 When I moved these functions from i386 and amd64 to x86 I dropped their prototype declarations (that were correct) and left only their definitions that became incorrect. Reported by: bde MFC after: 15 days X-MFC with: r331878 Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Apr 3 06:06:39 2018 (r331907) +++ head/sys/x86/x86/cpu_machdep.c Tue Apr 3 06:46:26 2018 (r331908) @@ -251,7 +251,7 @@ cpu_halt(void) } static void -cpu_reset_real() +cpu_reset_real(void) { struct region_descriptor null_idt; int b; @@ -324,7 +324,7 @@ cpu_reset_real() #ifdef SMP static void -cpu_reset_proxy() +cpu_reset_proxy(void) { cpu_reset_proxy_active = 1; @@ -338,7 +338,7 @@ cpu_reset_proxy() #endif void -cpu_reset() +cpu_reset(void) { #ifdef SMP cpuset_t map; From owner-svn-src-all@freebsd.org Tue Apr 3 06:49:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4475F8742F; Tue, 3 Apr 2018 06:49:12 +0000 (UTC) (envelope-from srs0=rwrb=gy=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63DD1699D7; Tue, 3 Apr 2018 06:49:12 +0000 (UTC) (envelope-from srs0=rwrb=gy=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyygqcdbrpdrmc0f.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:9974:2609:c896:854f]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 971F6874E; Tue, 3 Apr 2018 08:49:10 +0200 (CEST) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331546 - head/etc/rc.d Date: Tue, 03 Apr 2018 08:49:09 +0200 X-Mailer: MailMate (2.0BETAr6106) Message-ID: <4F543A96-C6B1-4FF0-A501-BC6C7FD3F26A@FreeBSD.org> In-Reply-To: <20180402220430.GD1917@FreeBSD.org> References: <201803260936.w2Q9aMfD082758@repo.freebsd.org> <20180402220430.GD1917@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 06:49:12 -0000 On 3 Apr 2018, at 0:04, Gleb Smirnoff wrote: > I just want to note that this is a huge change of behaviour > of pf(4) for a user. Over a decade everybody has been used > to the difference between "reload" and "resync". There is no difference. r330105 removed the ‘$pf_program -Fnat -Fqueue -Frules -FSources -Finfo -FTables -Fosfp’ line, but this never actually did what the author thought it did. pfctl only ever performed the last ‘-F’, not all of them, so all this ever did was flush the OS fingerprints information. Clearly that’s not what was intended. pf never actually breaks existing connections, because existing states keep using the rule that created them, regardless of the current rules. It wouldn’t have broken connections with resync either. A ‘restart’ will, because ‘start’ does ‘pfctl -F all’. If the flush had actually done what was intended it’d arguably have been a security issue, because reloading rules would then (briefly) open the firewall, allowing all traffic to pass and establish state. > Yes, I admit > that back in 2008 the difference was awkward and annoying, but > todays I'm afraid that change would be more annoying than > keeping status quo. > > This definitely shouldn't reach stable/11, absolutely. > I will wait to do the MFC until we’re in agreement about it. Regards, Kristof From owner-svn-src-all@freebsd.org Tue Apr 3 07:31:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE2DF89B32; Tue, 3 Apr 2018 07:31:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A03706B45B; Tue, 3 Apr 2018 07:31:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B25121579; Tue, 3 Apr 2018 07:31:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w337VNu9001204; Tue, 3 Apr 2018 07:31:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w337VNcB000791; Tue, 3 Apr 2018 07:31:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804030731.w337VNcB000791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 3 Apr 2018 07:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331909 - in stable/11/sys: kern sys x86/acpica x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys: kern sys x86/acpica x86/x86 X-SVN-Commit-Revision: 331909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 07:31:24 -0000 Author: avg Date: Tue Apr 3 07:31:22 2018 New Revision: 331909 URL: https://svnweb.freebsd.org/changeset/base/331909 Log: MFC r327056: Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension. Modified: stable/11/sys/kern/subr_smp.c stable/11/sys/sys/smp.h stable/11/sys/x86/acpica/acpi_wakeup.c stable/11/sys/x86/x86/mp_x86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_smp.c ============================================================================== --- stable/11/sys/kern/subr_smp.c Tue Apr 3 06:46:26 2018 (r331908) +++ stable/11/sys/kern/subr_smp.c Tue Apr 3 07:31:22 2018 (r331909) @@ -348,13 +348,18 @@ generic_restart_cpus(cpuset_t map, u_int type) #if X86 if (type == IPI_SUSPEND) - cpus = &suspended_cpus; + cpus = &resuming_cpus; else #endif cpus = &stopped_cpus; /* signal other cpus to restart */ - CPU_COPY_STORE_REL(&map, &started_cpus); +#if X86 + if (type == IPI_SUSPEND) + CPU_COPY_STORE_REL(&map, &toresume_cpus); + else +#endif + CPU_COPY_STORE_REL(&map, &started_cpus); #if X86 if (!nmi_is_broadcast || nmi_kdb_lock == 0) { Modified: stable/11/sys/sys/smp.h ============================================================================== --- stable/11/sys/sys/smp.h Tue Apr 3 06:46:26 2018 (r331908) +++ stable/11/sys/sys/smp.h Tue Apr 3 07:31:22 2018 (r331909) @@ -136,10 +136,13 @@ struct cpu_group *smp_topo_find(struct cpu_group *top, extern void (*cpustop_restartfunc)(void); extern int smp_cpus; -extern volatile cpuset_t started_cpus; -extern volatile cpuset_t stopped_cpus; -extern volatile cpuset_t suspended_cpus; -extern cpuset_t hlt_cpus_mask; +/* The suspend/resume cpusets are x86 only, but minimize ifdefs. */ +extern volatile cpuset_t resuming_cpus; /* woken up cpus in suspend pen */ +extern volatile cpuset_t started_cpus; /* cpus to let out of stop pen */ +extern volatile cpuset_t stopped_cpus; /* cpus in stop pen */ +extern volatile cpuset_t suspended_cpus; /* cpus [near] sleeping in susp pen */ +extern volatile cpuset_t toresume_cpus; /* cpus to let out of suspend pen */ +extern cpuset_t hlt_cpus_mask; /* XXX 'mask' is detail in old impl */ extern cpuset_t logical_cpus_mask; #endif /* SMP */ Modified: stable/11/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/11/sys/x86/acpica/acpi_wakeup.c Tue Apr 3 06:46:26 2018 (r331908) +++ stable/11/sys/x86/acpica/acpi_wakeup.c Tue Apr 3 07:31:22 2018 (r331909) @@ -284,7 +284,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, #ifdef SMP if (!CPU_EMPTY(&suspcpus)) - restart_cpus(suspcpus); + resume_cpus(suspcpus); #endif mca_resume(); #ifdef __amd64__ Modified: stable/11/sys/x86/x86/mp_x86.c ============================================================================== --- stable/11/sys/x86/x86/mp_x86.c Tue Apr 3 06:46:26 2018 (r331908) +++ stable/11/sys/x86/x86/mp_x86.c Tue Apr 3 07:31:22 2018 (r331909) @@ -114,6 +114,9 @@ struct cpu_ops cpu_ops; static volatile cpuset_t ipi_stop_nmi_pending; +volatile cpuset_t resuming_cpus; +volatile cpuset_t toresume_cpus; + /* used to hold the AP's until we are ready to release them */ struct mtx ap_boot_mtx; @@ -1316,6 +1319,13 @@ cpususpend_handler(void) #endif wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); + /* + * Hack for xen, which does not use resumectx() so never + * uses the next clause: set resuming_cpus early so that + * resume_cpus() can wait on the same bitmap for acpi and + * xen. resuming_cpus now means eventually_resumable_cpus. + */ + CPU_SET_ATOMIC(cpu, &resuming_cpus); } else { #ifdef __amd64__ fpuresume(susppcbs[cpu]->sp_fpususpend); @@ -1327,12 +1337,12 @@ cpususpend_handler(void) PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - /* Indicate that we are resumed */ + /* Indicate that we are resuming */ CPU_CLR_ATOMIC(cpu, &suspended_cpus); } - /* Wait for resume */ - while (!CPU_ISSET(cpu, &started_cpus)) + /* Wait for resume directive */ + while (!CPU_ISSET(cpu, &toresume_cpus)) ia32_pause(); if (cpu_ops.cpu_resume) @@ -1348,8 +1358,9 @@ cpususpend_handler(void) lapic_setup(0); /* Indicate that we are resumed */ + CPU_CLR_ATOMIC(cpu, &resuming_cpus); CPU_CLR_ATOMIC(cpu, &suspended_cpus); - CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &toresume_cpus); } From owner-svn-src-all@freebsd.org Tue Apr 3 07:52:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 466B7F53384; Tue, 3 Apr 2018 07:52:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF0DD6C3EB; Tue, 3 Apr 2018 07:52:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9B62219CC; Tue, 3 Apr 2018 07:52:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w337q6G9048038; Tue, 3 Apr 2018 07:52:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w337q6GU048021; Tue, 3 Apr 2018 07:52:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804030752.w337q6GU048021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 3 Apr 2018 07:52:06 +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: r331910 - in stable/10/sys: amd64/amd64 i386/i386 kern sys x86/acpica X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 i386/i386 kern sys x86/acpica X-SVN-Commit-Revision: 331910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 07:52:07 -0000 Author: avg Date: Tue Apr 3 07:52:06 2018 New Revision: 331910 URL: https://svnweb.freebsd.org/changeset/base/331910 Log: MFC r327056: Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension. The merge needed fixing because common x86 code changed by the original commit is still split between i386 and amd64 in this branch. Modified: stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/kern/subr_smp.c stable/10/sys/sys/smp.h stable/10/sys/x86/acpica/acpi_wakeup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Tue Apr 3 07:31:22 2018 (r331909) +++ stable/10/sys/amd64/amd64/mp_machdep.c Tue Apr 3 07:52:06 2018 (r331910) @@ -138,6 +138,9 @@ extern int pmap_pcid_enabled; static volatile cpuset_t ipi_nmi_pending; +volatile cpuset_t resuming_cpus; +volatile cpuset_t toresume_cpus; + /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; @@ -1486,6 +1489,13 @@ cpususpend_handler(void) fpususpend(susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); + /* + * Hack for xen, which does not use resumectx() so never + * uses the next clause: set resuming_cpus early so that + * resume_cpus() can wait on the same bitmap for acpi and + * xen. resuming_cpus now means eventually_resumable_cpus. + */ + CPU_SET_ATOMIC(cpu, &resuming_cpus); } else { fpuresume(susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); @@ -1493,12 +1503,12 @@ cpususpend_handler(void) PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - /* Indicate that we are resumed */ + /* Indicate that we are resuming */ CPU_CLR_ATOMIC(cpu, &suspended_cpus); } - /* Wait for resume */ - while (!CPU_ISSET(cpu, &started_cpus)) + /* Wait for resume directive */ + while (!CPU_ISSET(cpu, &toresume_cpus)) ia32_pause(); if (cpu_ops.cpu_resume) @@ -1510,9 +1520,10 @@ cpususpend_handler(void) mca_resume(); lapic_setup(0); - CPU_CLR_ATOMIC(cpu, &started_cpus); /* Indicate that we are resumed */ + CPU_CLR_ATOMIC(cpu, &resuming_cpus); CPU_CLR_ATOMIC(cpu, &suspended_cpus); + CPU_CLR_ATOMIC(cpu, &toresume_cpus); } /* Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Tue Apr 3 07:31:22 2018 (r331909) +++ stable/10/sys/i386/i386/mp_machdep.c Tue Apr 3 07:52:06 2018 (r331910) @@ -178,6 +178,9 @@ struct cpu_ops cpu_ops = { static volatile cpuset_t ipi_nmi_pending; +volatile cpuset_t resuming_cpus; +volatile cpuset_t toresume_cpus; + /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; @@ -1537,6 +1540,13 @@ cpususpend_handler(void) npxsuspend(susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); + /* + * Hack for xen, which does not use resumectx() so never + * uses the next clause: set resuming_cpus early so that + * resume_cpus() can wait on the same bitmap for acpi and + * xen. resuming_cpus now means eventually_resumable_cpus. + */ + CPU_SET_ATOMIC(cpu, &resuming_cpus); } else { npxresume(susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); @@ -1544,12 +1554,12 @@ cpususpend_handler(void) PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - /* Indicate that we are resumed */ + /* Indicate that we are resuming */ CPU_CLR_ATOMIC(cpu, &suspended_cpus); } - /* Wait for resume */ - while (!CPU_ISSET(cpu, &started_cpus)) + /* Wait for resume directive */ + while (!CPU_ISSET(cpu, &toresume_cpus)) ia32_pause(); if (cpu_ops.cpu_resume) @@ -1560,8 +1570,9 @@ cpususpend_handler(void) lapic_setup(0); /* Indicate that we are resumed */ + CPU_CLR_ATOMIC(cpu, &resuming_cpus); CPU_CLR_ATOMIC(cpu, &suspended_cpus); - CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &toresume_cpus); } /* Modified: stable/10/sys/kern/subr_smp.c ============================================================================== --- stable/10/sys/kern/subr_smp.c Tue Apr 3 07:31:22 2018 (r331909) +++ stable/10/sys/kern/subr_smp.c Tue Apr 3 07:52:06 2018 (r331910) @@ -331,13 +331,18 @@ generic_restart_cpus(cpuset_t map, u_int type) #if defined(__amd64__) || defined(__i386__) if (type == IPI_SUSPEND) - cpus = &suspended_cpus; + cpus = &resuming_cpus; else #endif cpus = &stopped_cpus; /* signal other cpus to restart */ - CPU_COPY_STORE_REL(&map, &started_cpus); +#if defined(__amd64__) || defined(__i386__) + if (type == IPI_SUSPEND) + CPU_COPY_STORE_REL(&map, &toresume_cpus); + else +#endif + CPU_COPY_STORE_REL(&map, &started_cpus); /* wait for each to clear its bit */ while (CPU_OVERLAP(cpus, &map)) Modified: stable/10/sys/sys/smp.h ============================================================================== --- stable/10/sys/sys/smp.h Tue Apr 3 07:31:22 2018 (r331909) +++ stable/10/sys/sys/smp.h Tue Apr 3 07:52:06 2018 (r331910) @@ -72,10 +72,13 @@ struct cpu_group *smp_topo_find(struct cpu_group *top, extern void (*cpustop_restartfunc)(void); extern int smp_cpus; -extern volatile cpuset_t started_cpus; -extern volatile cpuset_t stopped_cpus; -extern volatile cpuset_t suspended_cpus; -extern cpuset_t hlt_cpus_mask; +/* The suspend/resume cpusets are x86 only, but minimize ifdefs. */ +extern volatile cpuset_t resuming_cpus; /* woken up cpus in suspend pen */ +extern volatile cpuset_t started_cpus; /* cpus to let out of stop pen */ +extern volatile cpuset_t stopped_cpus; /* cpus in stop pen */ +extern volatile cpuset_t suspended_cpus; /* cpus [near] sleeping in susp pen */ +extern volatile cpuset_t toresume_cpus; /* cpus to let out of suspend pen */ +extern cpuset_t hlt_cpus_mask; /* XXX 'mask' is detail in old impl */ extern cpuset_t logical_cpus_mask; #endif /* SMP */ Modified: stable/10/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/10/sys/x86/acpica/acpi_wakeup.c Tue Apr 3 07:31:22 2018 (r331909) +++ stable/10/sys/x86/acpica/acpi_wakeup.c Tue Apr 3 07:52:06 2018 (r331910) @@ -278,7 +278,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, #ifdef SMP if (!CPU_EMPTY(&suspcpus)) - restart_cpus(suspcpus); + resume_cpus(suspcpus); #endif mca_resume(); #ifdef __amd64__ From owner-svn-src-all@freebsd.org Tue Apr 3 07:57:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162E4F53914; Tue, 3 Apr 2018 07:57:12 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 785626C79D; Tue, 3 Apr 2018 07:57:11 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm0-f49.google.com with SMTP id t67so11440172wmt.0; Tue, 03 Apr 2018 00:57:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=SVgN95nQM25l//65E93jytMXQ3LyHCQ1+8d68QD9l0A=; b=afX/oE+A3Y2p3jxS4Q4XfoHgo1jWnRImdJ0YFR3R64SbWSxXMRDgECwirHaoYCmxLI JHVy6qrNJkNARN49YnuV94kHyIpu3oCDnf6ImBZCh6Pzi/NT18fsaaMAyfr43g8oImR6 tlwNxJ4YS9+MULhu/YS9XvHLlRL+PDnZvEpxst04+aoKy6EJrKwATQ6TMMP3SQ6eQz0v bQUUb8zYQE78uZHn51G24vg11szqiOBisHH4imYtbgqJqLdDQX2mDCGp50/VxmHDcYeL lt8ESjy3uZQTYtTn64GYNp1bNtYqNoX8Rqn8zGv+ru8aJAu89nqW3mfY/4tsjJh2Edc0 BETA== X-Gm-Message-State: ALQs6tBwPkLWG0vHsOBPV4Z0NxlayBodqDntb9FhzZhQE3aZqwashjks hW5A8jocXpcfOxwI86P7Fib+UXGH X-Google-Smtp-Source: AIpwx4+lDySEHBl7QCALVTGqGFGsk7GxFT57KvBugWaGkvVJlFvyHX1wy+EYjNbYFmvneH0Kq4aOdA== X-Received: by 10.46.151.136 with SMTP id y8mr1411382lji.84.1522742229949; Tue, 03 Apr 2018 00:57:09 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 94-v6sm409268lft.85.2018.04.03.00.57.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 00:57:09 -0700 (PDT) Subject: Re: svn commit: r327056 - in head/sys: kern sys x86/acpica x86/x86 To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712210917.vBL9Hmd0042736@repo.freebsd.org> <20180403012043.K1434@besplex.bde.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Tue, 3 Apr 2018 10:57:08 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180403012043.K1434@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 07:57:12 -0000 On 02/04/2018 18:28, Bruce Evans wrote: > On Mon, 2 Apr 2018, Andriy Gapon wrote: > >> On 21/12/2017 11:17, Bruce Evans wrote: >>> Author: bde >>> Date: Thu Dec 21 09:17:48 2017 >>> New Revision: 327056 >>> URL: https://svnweb.freebsd.org/changeset/base/327056 >>> >>> Log: >>>   Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension. >> >> Bruce, >> >> do you plan to merge this to stable/11 and maybe stable/10? > > No.  I'm nit (yet?) set up to merge to stable at all, and this is not the > first thing that I would want to merge. > >> If you'd like, I can do it.  Unless you see any reason not to. > > Please do it. Done in r327056 and r327056. All merge bugs are mine. > It is only a small part of fixing mapping bugs for low memory which first > showed up s incoherent page tables for vm86 (low memory was left unmapped > all the time to handle the problem that ACPI resume needs this mapping for > 1 instruction).  You might need the other fixes.  This one is fairly stand- > alone but doesn't do much by itself. I was just interested in fixing the KPI misuse (restart vs resume). No particular "real" problems that I wanted to address. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Apr 3 09:22:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D91F6F4D8; Tue, 3 Apr 2018 09:22:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 275CC6FFDD; Tue, 3 Apr 2018 09:22:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 223FE22866; Tue, 3 Apr 2018 09:22:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339Ma7F032044; Tue, 3 Apr 2018 09:22:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339Ma4b032043; Tue, 3 Apr 2018 09:22:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030922.w339Ma4b032043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331911 - stable/11/sys/dev/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5 X-SVN-Commit-Revision: 331911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:22:37 -0000 Author: hselasky Date: Tue Apr 3 09:22:36 2018 New Revision: 331911 URL: https://svnweb.freebsd.org/changeset/base/331911 Log: MFC r331531: Remove redundant prototype to fix compilation with GCC. Reported by: jeff@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Apr 3 07:52:06 2018 (r331910) +++ stable/11/sys/dev/mlx5/driver.h Tue Apr 3 09:22:36 2018 (r331911) @@ -868,7 +868,6 @@ static inline u32 mlx5_base_mkey(const u32 key) return key & 0xffffff00u; } -void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); void mlx5_cmd_use_events(struct mlx5_core_dev *dev); From owner-svn-src-all@freebsd.org Tue Apr 3 09:24:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0691F6F6AF; Tue, 3 Apr 2018 09:24:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54DB470196; Tue, 3 Apr 2018 09:24:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F8862286D; Tue, 3 Apr 2018 09:24:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339OVmX034949; Tue, 3 Apr 2018 09:24:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339OVhj034948; Tue, 3 Apr 2018 09:24:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030924.w339OVhj034948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331912 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:24:31 -0000 Author: hselasky Date: Tue Apr 3 09:24:30 2018 New Revision: 331912 URL: https://svnweb.freebsd.org/changeset/base/331912 Log: MFC r331819: Add missing newline character in print in mlx5core. Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:22:36 2018 (r331911) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:24:30 2018 (r331912) @@ -183,7 +183,7 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d fatal_error == MLX5_SENSOR_NIC_DISABLED || fatal_error == MLX5_SENSOR_NIC_SW_RESET || test_bit(MLX5_SKIP_SW_RESET, &health->flags)) { - mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help."); + mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help.\n"); return; } From owner-svn-src-all@freebsd.org Tue Apr 3 09:25:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C871F6F917; Tue, 3 Apr 2018 09:25:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD837039B; Tue, 3 Apr 2018 09:25:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E15BE2286F; Tue, 3 Apr 2018 09:25:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339Pq6r037044; Tue, 3 Apr 2018 09:25:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339Pq0I037043; Tue, 3 Apr 2018 09:25:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030925.w339Pq0I037043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331913 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:25:53 -0000 Author: hselasky Date: Tue Apr 3 09:25:52 2018 New Revision: 331913 URL: https://svnweb.freebsd.org/changeset/base/331913 Log: MFC r331820: Properly check if crspace is supported in mlx5core. The old code checked for MLX5_CR_SPACE_DOMAIN which is irrelevant here. However, if dev->vsec_addr would be 0, an access to wrong offset would happen. Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_crspace.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_crspace.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_crspace.c Tue Apr 3 09:24:30 2018 (r331912) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_crspace.c Tue Apr 3 09:25:52 2018 (r331913) @@ -65,6 +65,8 @@ enum { #define MLX5_MERGE(rsrc1, rsrc2, start, len) \ (((len) == 32) ? (rsrc2) : MLX5_MERGE_C(rsrc1, rsrc2, start, len)) +#define MLX5_SEMAPHORE_SPACE_DOMAIN 0xA + static int mlx5_pciconf_wait_on_flag(struct mlx5_core_dev *dev, u8 expected_val) { @@ -131,6 +133,9 @@ int mlx5_pciconf_cap9_sem(struct mlx5_core_dev *dev, i int retries = 0; u32 lock_val; + if (!dev->vsec_addr) + return -ENXIO; + if (state == UNLOCK) { pci_write_config_dword(dev->pdev, dev->vsec_addr + PCI_SEMAPHORE_OFFSET, 0); @@ -159,7 +164,6 @@ int mlx5_pciconf_cap9_sem(struct mlx5_core_dev *dev, i return 0; } -#define MLX5_PROTECTED_CR_SPACE_DOMAIN 0x6 static int mlx5_pciconf_set_addr_space(struct mlx5_core_dev *dev, u16 space) { @@ -183,7 +187,6 @@ static int mlx5_pciconf_set_addr_space(struct mlx5_cor return 0; } -#define MLX5_CR_SPACE_DOMAIN 0x2 static int mlx5_get_vendor_cap_addr(struct mlx5_core_dev *dev) { int vend_cap; @@ -196,24 +199,27 @@ static int mlx5_get_vendor_cap_addr(struct mlx5_core_d ret = mlx5_pciconf_cap9_sem(dev, LOCK); if (ret) { mlx5_core_warn(dev, - "pciconf_cap9_sem locking failure\n"); + "pciconf_cap9_sem locking failure\n"); return 0; } - if (mlx5_pciconf_set_addr_space(dev, MLX5_CR_SPACE_DOMAIN)) + if (mlx5_pciconf_set_addr_space(dev, + MLX5_SEMAPHORE_SPACE_DOMAIN)) vend_cap = 0; ret = mlx5_pciconf_cap9_sem(dev, UNLOCK); if (ret) mlx5_core_warn(dev, - "pciconf_cap9_sem unlocking failure\n"); + "pciconf_cap9_sem unlocking failure\n"); return vend_cap; } -#define MLX5_SEMAPHORE_SPACE_DOMAIN 0xA int mlx5_pciconf_set_sem_addr_space(struct mlx5_core_dev *dev, u32 sem_space_address, int state) { u32 data, id = 0; int ret; + + if (!dev->vsec_addr) + return -ENXIO; ret = mlx5_pciconf_set_addr_space(dev, MLX5_SEMAPHORE_SPACE_DOMAIN); From owner-svn-src-all@freebsd.org Tue Apr 3 09:27:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335D6F6FB08; Tue, 3 Apr 2018 09:27:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D583970518; Tue, 3 Apr 2018 09:27:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D086E22871; Tue, 3 Apr 2018 09:27:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339R5bV038922; Tue, 3 Apr 2018 09:27:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339R55D038917; Tue, 3 Apr 2018 09:27:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030927.w339R55D038917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331914 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:27:06 -0000 Author: hselasky Date: Tue Apr 3 09:27:05 2018 New Revision: 331914 URL: https://svnweb.freebsd.org/changeset/base/331914 Log: MFC r331821: Prepare for FW dump in error state in mlx5core. - Move firmware dump prep and cleanup to init_one() and remove_one() so that the init and cleanup will happen only upon driver reload. - Add some prints to indicate firmware dump. Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Tue Apr 3 09:25:52 2018 (r331913) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Tue Apr 3 09:27:05 2018 (r331914) @@ -116,14 +116,18 @@ mlx5_fwdump(struct mlx5_core_dev *mdev) uint32_t i, ri; int error; + dev_info(&mdev->pdev->dev, "Issuing FW dump\n"); dd = (struct mlx5_dump_data *)atomic_load_acq_ptr((uintptr_t *) &mdev->dump_data); if (dd == NULL) return; mtx_lock(&dd->dump_lock); - if (dd->dump_valid) + if (dd->dump_valid) { /* only one dump */ + dev_warn(&mdev->pdev->dev, + "Only one FW dump can be captured aborting FW dump\n"); goto failed; + } /* mlx5_vsc already warns, be silent. */ error = mlx5_vsc_lock(mdev); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Apr 3 09:25:52 2018 (r331913) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Tue Apr 3 09:27:05 2018 (r331914) @@ -1056,8 +1056,6 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st goto err_fs; } - mlx5_fwdump_prep(dev); - clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state); set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); @@ -1127,7 +1125,6 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, goto out; } - mlx5_fwdump_clean(dev); mlx5_unregister_device(dev); mlx5_cleanup_fs(dev); @@ -1179,7 +1176,6 @@ struct mlx5_core_event_handler { void *data); }; - static int init_one(struct pci_dev *pdev, const struct pci_device_id *id) { @@ -1224,6 +1220,8 @@ static int init_one(struct pci_dev *pdev, goto clean_health; } + mlx5_fwdump_prep(dev); + pci_save_state(pdev->dev.bsddev); return 0; @@ -1248,6 +1246,7 @@ static void remove_one(struct pci_dev *pdev) return; } + mlx5_fwdump_clean(dev); mlx5_pagealloc_cleanup(dev); mlx5_health_cleanup(dev); mlx5_pci_close(dev, priv); @@ -1264,6 +1263,7 @@ static pci_ers_result_t mlx5_pci_err_detected(struct p dev_info(&pdev->dev, "%s was called\n", __func__); mlx5_enter_error_state(dev, false); mlx5_unload_one(dev, priv, false); + if (state) { mlx5_drain_health_wq(dev); mlx5_pci_disable_device(dev); From owner-svn-src-all@freebsd.org Tue Apr 3 09:28:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 224D3F6FC3C; Tue, 3 Apr 2018 09:28:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE0C7067B; Tue, 3 Apr 2018 09:28:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7AA822872; Tue, 3 Apr 2018 09:28:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339SBUs040617; Tue, 3 Apr 2018 09:28:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339SBWm040616; Tue, 3 Apr 2018 09:28:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030928.w339SBWm040616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331915 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:28:12 -0000 Author: hselasky Date: Tue Apr 3 09:28:11 2018 New Revision: 331915 URL: https://svnweb.freebsd.org/changeset/base/331915 Log: MFC r331822: Reorganize health recovery in mlx5core. - Move the semaphore locking and unlocking to the same function. - Flags are no longer needed if the reset and crdump will be done in the same function. Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:27:05 2018 (r331914) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:28:11 2018 (r331915) @@ -48,8 +48,6 @@ enum { enum { MLX5_DROP_NEW_HEALTH_WORK, MLX5_DROP_NEW_RECOVERY_WORK, - MLX5_SKIP_SW_RESET, - MLX5_SW_RESET_SEM_LOCKED, }; enum { @@ -167,7 +165,6 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d { bool supported = (ioread32be(&dev->iseg->initializing) >> MLX5_FW_RESET_SUPPORTED_OFFSET) & 1; - struct mlx5_core_health *health = &dev->priv.health; u32 cmdq_addr, fatal_error; if (!supported) @@ -181,8 +178,7 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d fatal_error = check_fatal_sensors(dev); if (fatal_error == MLX5_SENSOR_PCI_COMM_ERR || fatal_error == MLX5_SENSOR_NIC_DISABLED || - fatal_error == MLX5_SENSOR_NIC_SW_RESET || - test_bit(MLX5_SKIP_SW_RESET, &health->flags)) { + fatal_error == MLX5_SENSOR_NIC_SW_RESET) { mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help.\n"); return; } @@ -197,26 +193,65 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d &dev->iseg->cmdq_addr_l_sz); } +#define MLX5_CRDUMP_WAIT_MS 60000 +#define MLX5_FW_RESET_WAIT_MS 1000 +#define MLX5_NIC_STATE_POLL_MS 5 void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force) { + unsigned long end, delay_ms = MLX5_CRDUMP_WAIT_MS; + u32 fatal_error; + int lock = -EBUSY; + mutex_lock(&dev->intf_state_mutex); if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { goto unlock; return; } - if (!force) - mlx5_core_err(dev, "internal state error detected\n"); - if (check_fatal_sensors(dev) || force) { - reset_fw_if_needed(dev); + fatal_error = check_fatal_sensors(dev); + + if (fatal_error || force) { + if (!force) + mlx5_core_err(dev, "internal state error detected\n"); dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; mlx5_trigger_cmd_completions(dev); } - mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); - if (!force) - mlx5_core_err(dev, "system error event triggered\n"); + if (force) + goto err_state_done; + if (fatal_error == MLX5_SENSOR_FW_SYND_RFR) { + if (mlx5_core_is_pf(dev)) + lock = lock_sem_sw_reset(dev, LOCK); + + if (lock != -EBUSY) { + reset_fw_if_needed(dev); + delay_ms = MLX5_FW_RESET_WAIT_MS; + } + } + + /* Recover from SW reset */ + end = jiffies + msecs_to_jiffies(delay_ms); + do { + if (sensor_nic_disabled(dev)) + break; + + msleep(MLX5_NIC_STATE_POLL_MS); + } while (!time_after(jiffies, end)); + + if (!sensor_nic_disabled(dev)) { + dev_err(&dev->pdev->dev, "NIC IFC still %d after %lums.\n", + get_nic_mode(dev), delay_ms); + } + + /* Release FW semaphore if you are the lock owner */ + if (!lock) + lock_sem_sw_reset(dev, UNLOCK); + + mlx5_core_err(dev, "system error event triggered\n"); + +err_state_done: + mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); unlock: mutex_unlock(&dev->intf_state_mutex); } @@ -265,7 +300,6 @@ static void health_recover(struct work_struct *work) if (sensor_pci_no_comm(dev)) { dev_err(&dev->pdev->dev, "health recovery flow aborted, PCI reads still not working\n"); recover = false; - goto clear_sem; } nic_mode = get_nic_mode(dev); @@ -281,14 +315,6 @@ static void health_recover(struct work_struct *work) recover = false; } -clear_sem: - if (test_and_clear_bit(MLX5_SW_RESET_SEM_LOCKED, &health->flags)) { - mlx5_core_dbg(dev, "Unlocking FW reset semaphore\n"); - lock_sem_sw_reset(dev, UNLOCK); - } - - test_and_clear_bit(MLX5_SKIP_SW_RESET, &health->flags); - if (recover) { dev_err(&dev->pdev->dev, "starting health recovery flow\n"); mlx5_recover_device(dev); @@ -312,28 +338,10 @@ static void health_care(struct work_struct *work) struct mlx5_core_dev *dev; struct mlx5_priv *priv; unsigned long flags; - int ret; health = container_of(work, struct mlx5_core_health, work); priv = container_of(health, struct mlx5_priv, health); dev = container_of(priv, struct mlx5_core_dev, priv); - - if (mlx5_core_is_pf(dev)) { - ret = lock_sem_sw_reset(dev, LOCK); - if (!ret) { - mlx5_core_warn(dev, "Locked FW reset semaphore\n"); - set_bit(MLX5_SW_RESET_SEM_LOCKED, &health->flags); - } - else if (ret == -EBUSY) { - /* sw reset will be skipped only in case we detect the - * semaphore was already taken. In case of an error - * while taking the semaphore we prefer to issue a - * reset since longer cr-dump time and multiple resets - * are better than a stuck fw. - */ - set_bit(MLX5_SKIP_SW_RESET, &health->flags); - } - } mlx5_core_warn(dev, "handling bad device here\n"); mlx5_handle_bad_state(dev); From owner-svn-src-all@freebsd.org Tue Apr 3 09:29:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C311F6FD87; Tue, 3 Apr 2018 09:29:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DCD2708DC; Tue, 3 Apr 2018 09:29:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2881422874; Tue, 3 Apr 2018 09:29:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339TRJW042647; Tue, 3 Apr 2018 09:29:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339TRGn042644; Tue, 3 Apr 2018 09:29:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030929.w339TRGn042644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331916 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:29:27 -0000 Author: hselasky Date: Tue Apr 3 09:29:26 2018 New Revision: 331916 URL: https://svnweb.freebsd.org/changeset/base/331916 Log: MFC r331823: Collect firmware dump when mlx5core is in device error state. Firmware dump collecting should be triggered in case firmware syndrome with request for reset bit is set. Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:28:11 2018 (r331915) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:29:26 2018 (r331916) @@ -221,10 +221,13 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, goto err_state_done; if (fatal_error == MLX5_SENSOR_FW_SYND_RFR) { + /* Get cr-dump and reset FW semaphore */ if (mlx5_core_is_pf(dev)) lock = lock_sem_sw_reset(dev, LOCK); + /* Execute cr-dump and SW reset */ if (lock != -EBUSY) { + mlx5_fwdump(dev); reset_fw_if_needed(dev); delay_ms = MLX5_FW_RESET_WAIT_MS; } From owner-svn-src-all@freebsd.org Tue Apr 3 09:30:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 855EBF6FF56; Tue, 3 Apr 2018 09:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29F9970A83; Tue, 3 Apr 2018 09:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24F2822881; Tue, 3 Apr 2018 09:30:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339UfQ8044545; Tue, 3 Apr 2018 09:30:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339UfbJ044543; Tue, 3 Apr 2018 09:30:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030930.w339UfbJ044543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331917 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:30:41 -0000 Author: hselasky Date: Tue Apr 3 09:30:40 2018 New Revision: 331917 URL: https://svnweb.freebsd.org/changeset/base/331917 Log: MFC r331824: Make sure Giant is locked when allocating bus resources in mlx5core. During health care IRQ resources will be reallocated. Newbus requires that Giant is locked before accessing these resources. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:29:26 2018 (r331916) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_health.c Tue Apr 3 09:30:40 2018 (r331917) @@ -300,6 +300,8 @@ static void health_recover(struct work_struct *work) priv = container_of(health, struct mlx5_priv, health); dev = container_of(priv, struct mlx5_core_dev, priv); + mtx_lock(&Giant); /* XXX newbus needs this */ + if (sensor_pci_no_comm(dev)) { dev_err(&dev->pdev->dev, "health recovery flow aborted, PCI reads still not working\n"); recover = false; @@ -322,6 +324,8 @@ static void health_recover(struct work_struct *work) dev_err(&dev->pdev->dev, "starting health recovery flow\n"); mlx5_recover_device(dev); } + + mtx_unlock(&Giant); } /* How much time to wait until health resetting the driver (in msecs) */ From owner-svn-src-all@freebsd.org Tue Apr 3 09:31:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00881F70077; Tue, 3 Apr 2018 09:31:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A627E70C64; Tue, 3 Apr 2018 09:31:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A143D229CA; Tue, 3 Apr 2018 09:31:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339VUQN047532; Tue, 3 Apr 2018 09:31:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339VU2i047530; Tue, 3 Apr 2018 09:31:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030931.w339VU2i047530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331918 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:31:31 -0000 Author: hselasky Date: Tue Apr 3 09:31:30 2018 New Revision: 331918 URL: https://svnweb.freebsd.org/changeset/base/331918 Log: MFC r331825: Fix for use after free in mlx5core. Make sure the command completion handler is not called when the device is in internal error state. This can easily trigger use after free situations. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Apr 3 09:30:40 2018 (r331917) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Tue Apr 3 09:31:30 2018 (r331918) @@ -254,7 +254,8 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru break; case MLX5_EVENT_TYPE_CMD: - mlx5_cmd_comp_handler(dev, be32_to_cpu(eqe->data.cmd.vector)); + if (dev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR) + mlx5_cmd_comp_handler(dev, be32_to_cpu(eqe->data.cmd.vector)); break; case MLX5_EVENT_TYPE_PORT_CHANGE: From owner-svn-src-all@freebsd.org Tue Apr 3 09:33:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E03FFF70460; Tue, 3 Apr 2018 09:33:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8F270FD7; Tue, 3 Apr 2018 09:33:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85E2722A1E; Tue, 3 Apr 2018 09:33:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339XN6f053505; Tue, 3 Apr 2018 09:33:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339XNRm053504; Tue, 3 Apr 2018 09:33:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030933.w339XNRm053504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331919 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 331919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:33:24 -0000 Author: hselasky Date: Tue Apr 3 09:33:23 2018 New Revision: 331919 URL: https://svnweb.freebsd.org/changeset/base/331919 Log: MFC r331826: Bump mlx5core driver version. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Tue Apr 3 09:31:30 2018 (r331918) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Tue Apr 3 09:33:23 2018 (r331919) @@ -33,8 +33,10 @@ #include #define DRIVER_NAME "mlx5_core" -#define DRIVER_VERSION "1.23.0 (03 Mar 2015)" -#define DRIVER_RELDATE "03 Mar 2015" +#ifndef DRIVER_VERSION +#define DRIVER_VERSION "3.4.1" +#endif +#define DRIVER_RELDATE "February 2018" extern int mlx5_core_debug_mask; From owner-svn-src-all@freebsd.org Tue Apr 3 09:34:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3574BF70564; Tue, 3 Apr 2018 09:34:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D78ED711E1; Tue, 3 Apr 2018 09:34:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D285022A20; Tue, 3 Apr 2018 09:34:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339YGVk055009; Tue, 3 Apr 2018 09:34:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339YGlG055008; Tue, 3 Apr 2018 09:34:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030934.w339YGlG055008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331920 - stable/11/sys/dev/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5 X-SVN-Commit-Revision: 331920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:34:17 -0000 Author: hselasky Date: Tue Apr 3 09:34:16 2018 New Revision: 331920 URL: https://svnweb.freebsd.org/changeset/base/331920 Log: MFC r331827: Remove unused structure field in mlx5core. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Tue Apr 3 09:33:23 2018 (r331919) +++ stable/11/sys/dev/mlx5/driver.h Tue Apr 3 09:34:16 2018 (r331920) @@ -371,7 +371,6 @@ struct mlx5_cmd { struct cmd_msg_cache cache; int checksum_disabled; struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX]; - int moving_to_polling; }; struct mlx5_port_caps { From owner-svn-src-all@freebsd.org Tue Apr 3 09:38:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3553F70B11; Tue, 3 Apr 2018 09:38:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50FC671682; Tue, 3 Apr 2018 09:38:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BD2622A29; Tue, 3 Apr 2018 09:38:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339csSv062321; Tue, 3 Apr 2018 09:38:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339csmV062318; Tue, 3 Apr 2018 09:38:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804030938.w339csmV062318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 3 Apr 2018 09:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331921 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 331921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:38:54 -0000 Author: kib Date: Tue Apr 3 09:38:53 2018 New Revision: 331921 URL: https://svnweb.freebsd.org/changeset/base/331921 Log: MFC r331557: Allow to specify for vm_fault_quick_hold_pages() that nofault mode should be honored. Modified: stable/11/sys/vm/vm.h stable/11/sys/vm/vm_fault.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm.h ============================================================================== --- stable/11/sys/vm/vm.h Tue Apr 3 09:34:16 2018 (r331920) +++ stable/11/sys/vm/vm.h Tue Apr 3 09:38:53 2018 (r331921) @@ -78,7 +78,9 @@ typedef u_char vm_prot_t; /* protection codes */ #define VM_PROT_WRITE ((vm_prot_t) 0x02) #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) #define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */ -#define VM_PROT_FAULT_LOOKUP ((vm_prot_t) 0x010) +#define VM_PROT_PRIV_FLAG ((vm_prot_t) 0x10) +#define VM_PROT_FAULT_LOOKUP VM_PROT_PRIV_FLAG +#define VM_PROT_QUICK_NOFAULT VM_PROT_PRIV_FLAG /* same to save bits */ #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) #define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE) Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Tue Apr 3 09:34:16 2018 (r331920) +++ stable/11/sys/vm/vm_fault.c Tue Apr 3 09:38:53 2018 (r331921) @@ -1523,7 +1523,18 @@ vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t ad * page was mapped at the specified virtual address or that * mapping had insufficient permissions. Attempt to fault in * and hold these pages. + * + * If vm_fault_disable_pagefaults() was called, + * i.e., TDP_NOFAULTING is set, we must not sleep nor + * acquire MD VM locks, which means we must not call + * vm_fault_hold(). Some (out of tree) callers mark + * too wide a code area with vm_fault_disable_pagefaults() + * already, use the VM_PROT_QUICK_NOFAULT flag to request + * the proper behaviour explicitly. */ + if ((prot & VM_PROT_QUICK_NOFAULT) != 0 && + (curthread->td_pflags & TDP_NOFAULTING) != 0) + goto error; for (mp = ma, va = addr; va < end; mp++, va += PAGE_SIZE) if (*mp == NULL && vm_fault_hold(map, va, prot, VM_FAULT_NORMAL, mp) != KERN_SUCCESS) From owner-svn-src-all@freebsd.org Tue Apr 3 09:40:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C8E3F70DF4; Tue, 3 Apr 2018 09:40:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C31B071893; Tue, 3 Apr 2018 09:40:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDD3622A4A; Tue, 3 Apr 2018 09:40:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339erGc067756; Tue, 3 Apr 2018 09:40:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339ernj067739; Tue, 3 Apr 2018 09:40:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804030940.w339ernj067739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 3 Apr 2018 09:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331922 - in stable/11/sys: compat/freebsd32 dev/pci kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: compat/freebsd32 dev/pci kern X-SVN-Commit-Revision: 331922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:40:54 -0000 Author: kib Date: Tue Apr 3 09:40:52 2018 New Revision: 331922 URL: https://svnweb.freebsd.org/changeset/base/331922 Log: MFC r331640: Fix several leaks of kernel stack data through paddings. Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/dev/pci/pci_user.c stable/11/sys/kern/kern_ntptime.c stable/11/sys/kern/kern_sig.c stable/11/sys/kern/sysv_shm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Apr 3 09:38:53 2018 (r331921) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Apr 3 09:40:52 2018 (r331922) @@ -2989,6 +2989,7 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_ CP(*stat, *stat32, size); bcopy(&stat->pathname[0], &stat32->pathname[0], sizeof(stat->pathname)); + stat32->version = version; error = copyout(stat32, uap->stat, version); } free(stat, M_TEMP); Modified: stable/11/sys/dev/pci/pci_user.c ============================================================================== --- stable/11/sys/dev/pci/pci_user.c Tue Apr 3 09:38:53 2018 (r331921) +++ stable/11/sys/dev/pci/pci_user.c Tue Apr 3 09:40:52 2018 (r331922) @@ -766,6 +766,8 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 if (cmd == PCIOCGETCONF_OLD32) { + memset(&conf_old32, 0, + sizeof(conf_old32)); conf_old32.pc_sel.pc_bus = dinfo->conf.pc_sel.pc_bus; conf_old32.pc_sel.pc_dev = @@ -799,6 +801,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, } else #endif /* COMPAT_FREEBSD32 */ if (cmd == PCIOCGETCONF_OLD) { + memset(&conf_old, 0, sizeof(conf_old)); conf_old.pc_sel.pc_bus = dinfo->conf.pc_sel.pc_bus; conf_old.pc_sel.pc_dev = Modified: stable/11/sys/kern/kern_ntptime.c ============================================================================== --- stable/11/sys/kern/kern_ntptime.c Tue Apr 3 09:38:53 2018 (r331921) +++ stable/11/sys/kern/kern_ntptime.c Tue Apr 3 09:40:52 2018 (r331922) @@ -285,6 +285,8 @@ sys_ntp_gettime(struct thread *td, struct ntp_gettime_ { struct ntptimeval ntv; + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Tue Apr 3 09:38:53 2018 (r331921) +++ stable/11/sys/kern/kern_sig.c Tue Apr 3 09:40:52 2018 (r331922) @@ -692,8 +692,8 @@ kern_sigaction(struct thread *td, int sig, const struc ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); if (oact) { + memset(oact, 0, sizeof(*oact)); oact->sa_mask = ps->ps_catchmask[_SIG_IDX(sig)]; - oact->sa_flags = 0; if (SIGISMEMBER(ps->ps_sigonstack, sig)) oact->sa_flags |= SA_ONSTACK; if (!SIGISMEMBER(ps->ps_sigintr, sig)) Modified: stable/11/sys/kern/sysv_shm.c ============================================================================== --- stable/11/sys/kern/sysv_shm.c Tue Apr 3 09:38:53 2018 (r331921) +++ stable/11/sys/kern/sysv_shm.c Tue Apr 3 09:40:52 2018 (r331922) @@ -1447,6 +1447,7 @@ freebsd7_freebsd32_shmctl(struct thread *td, break; case SHM_STAT: case IPC_STAT: + memset(&u32.shmid_ds32, 0, sizeof(u32.shmid_ds32)); freebsd32_ipcperm_old_out(&u.shmid_ds.shm_perm, &u32.shmid_ds32.shm_perm); if (u.shmid_ds.shm_segsz > INT32_MAX) @@ -1610,6 +1611,7 @@ freebsd7_shmctl(struct thread *td, struct freebsd7_shm /* Cases in which we need to copyout */ switch (uap->cmd) { case IPC_STAT: + memset(&old, 0, sizeof(old)); ipcperm_new2old(&buf.shm_perm, &old.shm_perm); if (buf.shm_segsz > INT_MAX) old.shm_segsz = INT_MAX; From owner-svn-src-all@freebsd.org Tue Apr 3 09:46:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E4F5F714C2; Tue, 3 Apr 2018 09:46:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A78BC71F50; Tue, 3 Apr 2018 09:46:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8236B22BDF; Tue, 3 Apr 2018 09:46:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w339kStY078762; Tue, 3 Apr 2018 09:46:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w339kS53078761; Tue, 3 Apr 2018 09:46:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804030946.w339kS53078761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 3 Apr 2018 09:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331923 - stable/11/sys/dev/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5 X-SVN-Commit-Revision: 331923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 09:46:29 -0000 Author: hselasky Date: Tue Apr 3 09:46:28 2018 New Revision: 331923 URL: https://svnweb.freebsd.org/changeset/base/331923 Log: MFC r330655: Remove duplicate prototypes. This is a direct commit (mergeinfo was added by r331796). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/cmd.h Modified: stable/11/sys/dev/mlx5/cmd.h ============================================================================== --- stable/11/sys/dev/mlx5/cmd.h Tue Apr 3 09:40:52 2018 (r331922) +++ stable/11/sys/dev/mlx5/cmd.h Tue Apr 3 09:46:28 2018 (r331923) @@ -50,11 +50,4 @@ int mlx5_cmd_query_cong_params(struct mlx5_core_dev *d void *out, int out_size); int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev, void *in, int in_size); -struct mlx5_core_dev; -int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev, - bool reset, void *out, int out_size); -int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point, - void *out, int out_size); -int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev, - void *in, int in_size); #endif /* MLX5_CMD_H */ From owner-svn-src-all@freebsd.org Tue Apr 3 04:21:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DAC3F80331 for ; Tue, 3 Apr 2018 04:21:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2711B84C1E for ; Tue, 3 Apr 2018 04:21:54 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 582fb5e6-36f6-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 582fb5e6-36f6-11e8-b951-f99fef315fd9; Tue, 03 Apr 2018 04:20:31 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w334LjBs079497; Mon, 2 Apr 2018 22:21:45 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1522729305.49673.206.camel@freebsd.org> Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... From: Ian Lepore To: rgrimes@freebsd.org, Mark Linimon Cc: Ed Maste , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Date: Mon, 02 Apr 2018 22:21:45 -0600 In-Reply-To: <201804030202.w3322xXG085227@pdx.rh.CN85.dnsmgr.net> References: <201804030202.w3322xXG085227@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 03 Apr 2018 10:44:54 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 04:21:55 -0000 On Mon, 2018-04-02 at 19:02 -0700, Rodney W. Grimes wrote: > > > > So, the takeaway is, this change stays, and stable/11 users that build > > their own ports are on their own? > > > > Whatever happened to POLA? > I have no idea, but I fully agree that changing compilers 30 days before > a code slush is just a very bad move. > > The llvm in 11.1 is 4. > Is there some pressing reason that we need llvm 6 to be in release 11.2? > > Looks like I wont be upgrading to 11.2 as I am sure I'll have blocking > issues with some ports. > > Though I could probably build them with 11.1, I hate that idea as then > I have to keep an 11.1 around incase I need to rebuild something. > > :-( I was hoping to import 11.2 to our repo at $work and be shipping products based on it later this year. But there's no way we have resources available to sidetrack and start debugging out of the blue failures of ports that have been working fine for us until now. I guess the best I can do now is import 11-stable immediately before the compiler change. At least I was lucky enough to get all the arm changes important for us MFC'd before the compiler change. -- Ian From owner-svn-src-all@freebsd.org Tue Apr 3 04:32:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4868F80D3C for ; Tue, 3 Apr 2018 04:32:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4EC8536A for ; Tue, 3 Apr 2018 04:32:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id 19-v6so20937464itw.3 for ; Mon, 02 Apr 2018 21:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vnboHRjrRjY6pMWRzK7U5yUo/4nwagM8YPKD1rmARFA=; b=S6Y9tig/c+x9I3QGsh9/0VKpH0U49y0i8AKD4jUH0Mkcfp2AkHLfNERNxsq/PKf4m1 +H4XbtC2t0WStwh+KuTHvZd85c5pvJqZzs3ExcaEEAraPCgBsPFe4wOUt7IN60ufQQFM 7z6c+zDdeHDp5ma7cnH6BLsTjj4FDkFYOGZ3zN85c6P6GCBG0WkmnF9fcVORJR97ybdC qbhV3Ey0Pkiw+jb/qnB6pV5/Fq4634qIhal3YCA08Vl4dvBrFBduemWGUOhE4YWqbGyj hnG/52OIBDI1k0sKUeWUwdVVWiMQvdehjSWKV9TBQ427o2dasTd8n4eWJhVsM24249tk st5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vnboHRjrRjY6pMWRzK7U5yUo/4nwagM8YPKD1rmARFA=; b=Qk6xrL5yMFVHYD3xXJZjwLWyyghofqg3mdmPybHitHzGrRGaJOcklcyzkAfLw4MDWu aV6At/fuyK/MxKKo2qwXyPG1K+lDqFw38KeJkYgIJsGJXrBnjr+buCuGOpp5K6Vdo5rZ CNOEjDoOa6+7oIvxDk3zrBd78rCwhGfSr8oKEjWW4GYsGl98CzxBfz0IkZcvx2aNNPyb 3YczE/m3NqH9mjbIvM7d0kD+b3p2pF7Nmc0W8cHXJSfst4sZQySPNRPKoJ2lKk5ok2+g +B8Kztn6wpq9gB6pnA+0yVVbmBnrWnjhgWRAIWYj0c0lY/pZFdtvOwNCvRbyvlrcOecC uLlw== X-Gm-Message-State: ALQs6tDFYSZEltRVpiv8YuKWeGCJO0P07XLLeSZIVmtEZvv33KYftWU2 9vJgZ/XE168ARahfNng7gmGJFFBUuC89nBWq7ejcPA== X-Google-Smtp-Source: AIpwx4+/7b+YQuwvkgmemJbIOYA0e/xwdCn1Qd1z0FCvLPDa8NDppr2ysZKnioR1sNvd4mdZ1ObjN5s2jcshkfKgtXk= X-Received: by 2002:a24:fa83:: with SMTP id v125-v6mr3581803ith.36.1522729942522; Mon, 02 Apr 2018 21:32:22 -0700 (PDT) MIME-Version: 1.0 References: <201804030202.w3322xXG085227@pdx.rh.CN85.dnsmgr.net> <1522729305.49673.206.camel@freebsd.org> In-Reply-To: <1522729305.49673.206.camel@freebsd.org> From: Warner Losh Date: Tue, 03 Apr 2018 04:32:11 +0000 Message-ID: Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... To: Ian Lepore Cc: "Rodney W. Grimes" , Mark Linimon , Ed Maste , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org X-Mailman-Approved-At: Tue, 03 Apr 2018 10:45:09 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 04:32:23 -0000 On Mon, Apr 2, 2018, 10:22 PM Ian Lepore wrote: > On Mon, 2018-04-02 at 19:02 -0700, Rodney W. Grimes wrote: > > > > > > So, the takeaway is, this change stays, and stable/11 users that build > > > their own ports are on their own? > > > > > > Whatever happened to POLA? > > I have no idea, but I fully agree that changing compilers 30 days before > > a code slush is just a very bad move. > > > > The llvm in 11.1 is 4. > > Is there some pressing reason that we need llvm 6 to be in release 11.2? > > > > Looks like I wont be upgrading to 11.2 as I am sure I'll have blocking > > issues with some ports. > > > > Though I could probably build them with 11.1, I hate that idea as then > > I have to keep an 11.1 around incase I need to rebuild something. > > > > :-( > > I was hoping to import 11.2 to our repo at $work and be shipping > products based on it later this year. But there's no way we have > resources available to sidetrack and start debugging out of the blue > failures of ports that have been working fine for us until now. I guess > the best I can do now is import 11-stable immediately before the > compiler change. At least I was lucky enough to get all the arm changes > important for us MFC'd before the compiler change. > All depends on which ports are broken... would be nice to have a list... Warner > From owner-svn-src-all@freebsd.org Tue Apr 3 06:34:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD21F867C7; Tue, 3 Apr 2018 06:34:22 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21F1169120; Tue, 3 Apr 2018 06:34:21 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 38AFA11F1; Tue, 3 Apr 2018 01:34:19 -0500 (CDT) Date: Tue, 3 Apr 2018 01:34:18 -0500 From: Mark Linimon To: Warner Losh Cc: Ian Lepore , "Rodney W. Grimes" , Ed Maste , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... Message-ID: <20180403063417.GA32517@lonesome.com> References: <201804030202.w3322xXG085227@pdx.rh.CN85.dnsmgr.net> <1522729305.49673.206.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Tue, 03 Apr 2018 10:45:18 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 06:34:22 -0000 On Tue, Apr 03, 2018 at 04:32:11AM +0000, Warner Losh wrote: > All depends on which ports are broken... would be nice to have a list... It's only a matter of a few hours' work. mcl From owner-svn-src-all@freebsd.org Tue Apr 3 07:32:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 233A3F89D34; Tue, 3 Apr 2018 07:32:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C1936B751; Tue, 3 Apr 2018 07:32:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w337W9Vv086229; Tue, 3 Apr 2018 00:32:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w337W91X086228; Tue, 3 Apr 2018 00:32:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804030732.w337W91X086228@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... In-Reply-To: <1522729305.49673.206.camel@freebsd.org> To: Ian Lepore Date: Tue, 3 Apr 2018 00:32:09 -0700 (PDT) CC: rgrimes@freebsd.org, Mark Linimon , Ed Maste , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Mailman-Approved-At: Tue, 03 Apr 2018 10:45:26 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 07:32:16 -0000 > On Mon, 2018-04-02 at 19:02 -0700, Rodney W. Grimes wrote: > > > > > > So, the takeaway is, this change stays, and stable/11 users that build > > > their own ports are on their own? > > > > > > Whatever happened to POLA? > > I have no idea, but I fully agree that changing compilers 30 days before > > a code slush is just a very bad move. > > > > The llvm in 11.1 is 4. > > Is there some pressing reason that we need llvm 6 to be in release 11.2? > > > > Looks like I wont be upgrading to 11.2 as I am sure I'll have blocking > > issues with some ports. > > > > Though I could probably build them with 11.1, I hate that idea as then > > I have to keep an 11.1 around incase I need to rebuild something. > > > > :-( > > I was hoping to import 11.2 to our repo at $work and be shipping > products based on it later this year. But there's no way we have > resources available to sidetrack and start debugging out of the blue > failures of ports that have been working fine for us until now. I guess > the best I can do now is import 11-stable immediately before the > compiler change. At least I was lucky enough to get all the arm changes > important for us MFC'd before the compiler change. Or checkout 11.2 and revert this commit locally, then commit that to your repo at $work. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 3 11:01:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24901F76D0B; Tue, 3 Apr 2018 11:01:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C624C7717D; Tue, 3 Apr 2018 11:01:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C06F3238F0; Tue, 3 Apr 2018 11:01:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33B1pVg027435; Tue, 3 Apr 2018 11:01:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33B1p3B027414; Tue, 3 Apr 2018 11:01:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804031101.w33B1p3B027414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 3 Apr 2018 11:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331924 - in head/sys: arm/freescale/vybrid arm/mv arm/nvidia arm/nvidia/tegra124 dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/freescale/vybrid arm/mv arm/nvidia arm/nvidia/tegra124 dev/fdt X-SVN-Commit-Revision: 331924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 11:01:52 -0000 Author: andrew Date: Tue Apr 3 11:01:50 2018 New Revision: 331924 URL: https://svnweb.freebsd.org/changeset/base/331924 Log: Switch users of fdt_is_enabled to use ofw_bus_node_status_okay. These are equivalent, so to prepare to remove the former move users to call the latter. Sponsored by: DARPA, AFRL Modified: head/sys/arm/freescale/vybrid/vf_ccm.c head/sys/arm/freescale/vybrid/vf_iomuxc.c head/sys/arm/mv/mv_localbus.c head/sys/arm/nvidia/as3722_gpio.c head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c head/sys/arm/nvidia/tegra_pinmux.c head/sys/dev/fdt/fdt_pinctrl.c Modified: head/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ccm.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/arm/freescale/vybrid/vf_ccm.c Tue Apr 3 11:01:50 2018 (r331924) @@ -414,7 +414,7 @@ ccm_fdt_set(struct ccm_softc *sc) child = OF_child(child); } - if (!fdt_is_enabled(child)) + if (!ofw_bus_node_status_okay(child)) continue; if ((len = OF_getproplen(child, "clock_names")) > 0) { Modified: head/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_iomuxc.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/arm/freescale/vybrid/vf_iomuxc.c Tue Apr 3 11:01:50 2018 (r331924) @@ -146,7 +146,7 @@ pinmux_set(struct iomuxc_softc *sc) child = OF_child(child); } - if (!fdt_is_enabled(child)) + if (!ofw_bus_node_status_okay(child)) continue; if ((len = OF_getproplen(child, "iomux_config")) > 0) { Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/arm/mv/mv_localbus.c Tue Apr 3 11:01:50 2018 (r331924) @@ -272,7 +272,7 @@ localbus_attach(device_t dev) dt_child = OF_peer(dt_child)) { /* Check and process 'status' property. */ - if (!(fdt_is_enabled(dt_child))) + if (!(ofw_bus_node_status_okay(dt_child))) continue; if (!(fdt_pm_is_enabled(dt_child))) Modified: head/sys/arm/nvidia/as3722_gpio.c ============================================================================== --- head/sys/arm/nvidia/as3722_gpio.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/arm/nvidia/as3722_gpio.c Tue Apr 3 11:01:50 2018 (r331924) @@ -271,7 +271,7 @@ int as3722_pinmux_configure(device_t dev, phandle_t cf cfgnode = OF_node_from_xref(cfgxref); for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) + if (!ofw_bus_node_status_okay(node)) continue; rv = as3722_pinmux_process_node(sc, node); if (rv != 0) Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Tue Apr 3 11:01:50 2018 (r331924) @@ -968,7 +968,7 @@ process_pad(struct padctl_softc *sc, phandle_t node) } for (node = OF_child(node); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) + if (!ofw_bus_node_status_okay(node)) continue; rv = process_lane(sc, node, pad); @@ -1079,7 +1079,7 @@ parse_fdt(struct padctl_softc *sc, phandle_t base_node return (ENXIO); } for (node = OF_child(node); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) + if (!ofw_bus_node_status_okay(node)) continue; rv = process_pad(sc, node); if (rv != 0) @@ -1092,7 +1092,7 @@ parse_fdt(struct padctl_softc *sc, phandle_t base_node return (ENXIO); } for (node = OF_child(node); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) + if (!ofw_bus_node_status_okay(node)) continue; rv = process_port(sc, node); if (rv != 0) Modified: head/sys/arm/nvidia/tegra_pinmux.c ============================================================================== --- head/sys/arm/nvidia/tegra_pinmux.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/arm/nvidia/tegra_pinmux.c Tue Apr 3 11:01:50 2018 (r331924) @@ -710,7 +710,7 @@ static int pinmux_configure(device_t dev, phandle_t cf for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) + if (!ofw_bus_node_status_okay(node)) continue; rv = pinmux_process_node(sc, node); } Modified: head/sys/dev/fdt/fdt_pinctrl.c ============================================================================== --- head/sys/dev/fdt/fdt_pinctrl.c Tue Apr 3 09:46:28 2018 (r331923) +++ head/sys/dev/fdt/fdt_pinctrl.c Tue Apr 3 11:01:50 2018 (r331924) @@ -119,7 +119,7 @@ pinctrl_configure_children(device_t pinctrl, phandle_t int i, nconfigs; for (node = OF_child(parent); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) + if (!ofw_bus_node_status_okay(node)) continue; pinctrl_configure_children(pinctrl, node); nconfigs = OF_getencprop_alloc(node, "pinctrl-0", From owner-svn-src-all@freebsd.org Tue Apr 3 13:30:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCE82F80B58; Tue, 3 Apr 2018 13:30:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9114C7D1BD; Tue, 3 Apr 2018 13:30:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C0E825020; Tue, 3 Apr 2018 13:30:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33DUeHX090436; Tue, 3 Apr 2018 13:30:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33DUeHc090432; Tue, 3 Apr 2018 13:30:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804031330.w33DUeHc090432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 3 Apr 2018 13:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331925 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 331925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 13:30:41 -0000 Author: andrew Date: Tue Apr 3 13:30:40 2018 New Revision: 331925 URL: https://svnweb.freebsd.org/changeset/base/331925 Log: Remove fdt_is_enabled, fdt_reg_to_rl, and fdt_get_unit. These are not used by anything in the tree. Sponsored by: DARPA, AFRL Modified: head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Tue Apr 3 11:01:50 2018 (r331924) +++ head/sys/dev/fdt/fdt_common.c Tue Apr 3 13:30:40 2018 (r331925) @@ -335,28 +335,6 @@ fdt_depth_search_compatible(phandle_t start, const cha } int -fdt_is_enabled(phandle_t node) -{ - char *stat; - int ena, len; - - len = OF_getprop_alloc(node, "status", sizeof(char), - (void **)&stat); - - if (len <= 0) - /* It is OK if no 'status' property. */ - return (1); - - /* Anything other than 'okay' means disabled. */ - ena = 0; - if (strncmp((char *)stat, "okay", len) == 0) - ena = 1; - - OF_prop_free(stat); - return (ena); -} - -int fdt_is_type(phandle_t node, const char *typestr) { char type[FDT_TYPE_LEN]; @@ -475,59 +453,6 @@ fdt_regsize(phandle_t node, u_long *base, u_long *size } int -fdt_reg_to_rl(phandle_t node, struct resource_list *rl) -{ - u_long end, count, start; - pcell_t *reg, *regptr; - pcell_t addr_cells, size_cells; - int tuple_size, tuples; - int i, rv; - long busaddr, bussize; - - if (fdt_addrsize_cells(OF_parent(node), &addr_cells, &size_cells) != 0) - return (ENXIO); - if (fdt_get_range(OF_parent(node), 0, &busaddr, &bussize)) { - busaddr = 0; - bussize = 0; - } - - tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); - tuples = OF_getprop_alloc(node, "reg", tuple_size, (void **)®); - debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells); - debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size); - if (tuples <= 0) - /* No 'reg' property in this node. */ - return (0); - - regptr = reg; - for (i = 0; i < tuples; i++) { - - rv = fdt_data_to_res(reg, addr_cells, size_cells, &start, - &count); - if (rv != 0) { - resource_list_free(rl); - goto out; - } - reg += addr_cells + size_cells; - - /* Calculate address range relative to base. */ - start += busaddr; - end = start + count - 1; - - debugf("reg addr start = %lx, end = %lx, count = %lx\n", start, - end, count); - - resource_list_add(rl, SYS_RES_MEMORY, i, start, end, - count); - } - rv = 0; - -out: - OF_prop_free(regptr); - return (rv); -} - -int fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; @@ -710,17 +635,6 @@ fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, rv = 0; out: return (rv); -} - -int -fdt_get_unit(device_t dev) -{ - const char * name; - - name = ofw_bus_get_name(dev); - name = strchr(name, '@') + 1; - - return (strtol(name,NULL,0)); } int Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Tue Apr 3 11:01:50 2018 (r331924) +++ head/sys/dev/fdt/fdt_common.h Tue Apr 3 13:30:40 2018 (r331925) @@ -91,13 +91,10 @@ int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_is_compatible_strict(phandle_t, const char *); -int fdt_is_enabled(phandle_t); int fdt_pm_is_enabled(phandle_t); int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); -int fdt_reg_to_rl(phandle_t, struct resource_list *); int fdt_pm(phandle_t); -int fdt_get_unit(device_t); int fdt_get_chosen_bootargs(char *bootargs, size_t max_size); #endif /* _FDT_COMMON_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 3 13:54:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADDFBF82461; Tue, 3 Apr 2018 13:54:39 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 407887E5B5; Tue, 3 Apr 2018 13:54:39 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B4C02550B; Tue, 3 Apr 2018 13:54:39 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Dsdnv034401; Tue, 3 Apr 2018 13:54:39 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33DsdZ6034400; Tue, 3 Apr 2018 13:54:39 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804031354.w33DsdZ6034400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 3 Apr 2018 13:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331926 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 331926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 13:54:39 -0000 Author: jtl Date: Tue Apr 3 13:54:38 2018 New Revision: 331926 URL: https://svnweb.freebsd.org/changeset/base/331926 Log: r330675 introduced an extra window check in the LRO code to ensure it captured and reported the highest window advertisement with the same SEQ/ACK. However, the window comparison uses modulo 2**16 math, rather than directly comparing the absolute values. Because windows use absolute values and not modulo 2**16 math (i.e. they don't wrap), we need to compare the absolute values. Reviewed by: gallatin MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D14937 Modified: head/sys/netinet/tcp_seq.h Modified: head/sys/netinet/tcp_seq.h ============================================================================== --- head/sys/netinet/tcp_seq.h Tue Apr 3 13:30:40 2018 (r331925) +++ head/sys/netinet/tcp_seq.h Tue Apr 3 13:54:38 2018 (r331926) @@ -47,10 +47,10 @@ #define SEQ_MIN(a, b) ((SEQ_LT(a, b)) ? (a) : (b)) #define SEQ_MAX(a, b) ((SEQ_GT(a, b)) ? (a) : (b)) -#define WIN_LT(a,b) ((short)(ntohs(a)-ntohs(b)) < 0) -#define WIN_LEQ(a,b) ((short)(ntohs(a)-ntohs(b)) <= 0) -#define WIN_GT(a,b) ((short)(ntohs(a)-ntohs(b)) > 0) -#define WIN_GEQ(a,b) ((short)(ntohs(a)-ntohs(b)) >= 0) +#define WIN_LT(a,b) (ntohs(a) < ntohs(b)) +#define WIN_LEQ(a,b) (ntohs(a) <= ntohs(b)) +#define WIN_GT(a,b) (ntohs(a) > ntohs(b)) +#define WIN_GEQ(a,b) (ntohs(a) >= ntohs(b)) #define WIN_MIN(a, b) ((WIN_LT(a, b)) ? (a) : (b)) #define WIN_MAX(a, b) ((WIN_GT(a, b)) ? (a) : (b)) From owner-svn-src-all@freebsd.org Tue Apr 3 14:05:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B2BCF82F7E; Tue, 3 Apr 2018 14:05:41 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 030D37EFE5; Tue, 3 Apr 2018 14:05:41 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1F4E256C9; Tue, 3 Apr 2018 14:05:40 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33E5eCk052582; Tue, 3 Apr 2018 14:05:40 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33E5e42052580; Tue, 3 Apr 2018 14:05:40 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201804031405.w33E5e42052580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 3 Apr 2018 14:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331927 - stable/11/stand/i386/zfsboot X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/stand/i386/zfsboot X-SVN-Commit-Revision: 331927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 14:05:41 -0000 Author: eugen Date: Tue Apr 3 14:05:40 2018 New Revision: 331927 URL: https://svnweb.freebsd.org/changeset/base/331927 Log: MFC r331630: Fix instructions in the zfsboot manual page. zfsloader(8) fails to probe a slice containing ZFS pool if its second sector contains traces of BSD label (DISKMAGIC == 0x82564557). Fix manual page to show working example erasing such traces. PR: 226714 Approved by: avg (mentor) _M . M stand/i386/zfsboot/zfsboot.8 Modified: stable/11/stand/i386/zfsboot/zfsboot.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/zfsboot/zfsboot.8 ============================================================================== --- stable/11/stand/i386/zfsboot/zfsboot.8 Tue Apr 3 13:54:38 2018 (r331926) +++ stable/11/stand/i386/zfsboot/zfsboot.8 Tue Apr 3 14:05:40 2018 (r331927) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd March 27, 2018 .Dt ZFSBOOT 8 .Os .Sh NAME @@ -99,9 +99,9 @@ can also be installed in an MBR slice: .Bd -literal -offset indent gpart create -s mbr ada0 gpart add -t freebsd ada0 -gpart create -s BSD ada0s1 gpart bootcode -b /boot/boot0 ada0 gpart set -a active -i 1 ada0 +dd if=/dev/zero of=/dev/ada0s1 count=2 dd if=/boot/zfsboot of=/dev/ada0s1 count=1 dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024 .Ed From owner-svn-src-all@freebsd.org Tue Apr 3 14:09:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28552F832AA; Tue, 3 Apr 2018 14:09:35 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE1367F2D1; Tue, 3 Apr 2018 14:09:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D11256CC; Tue, 3 Apr 2018 14:09:34 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33E9Y1B057430; Tue, 3 Apr 2018 14:09:34 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33E9YBd057429; Tue, 3 Apr 2018 14:09:34 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201804031409.w33E9YBd057429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 3 Apr 2018 14:09:34 +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: r331928 - stable/10/sys/boot/i386/zfsboot X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/sys/boot/i386/zfsboot X-SVN-Commit-Revision: 331928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 14:09:35 -0000 Author: eugen Date: Tue Apr 3 14:09:34 2018 New Revision: 331928 URL: https://svnweb.freebsd.org/changeset/base/331928 Log: MFC r331630: Fix instructions in the zfsboot manual page. zfsloader(8) fails to probe a slice containing ZFS pool if its second sector contains traces of BSD label (DISKMAGIC == 0x82564557). Fix manual page to show working example erasing such traces. _M . M sys/boot/i386/zfsboot/zfsboot.8 Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/i386/zfsboot/zfsboot.8 ============================================================================== --- stable/10/sys/boot/i386/zfsboot/zfsboot.8 Tue Apr 3 14:05:40 2018 (r331927) +++ stable/10/sys/boot/i386/zfsboot/zfsboot.8 Tue Apr 3 14:09:34 2018 (r331928) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd March 27, 2018 .Dt ZFSBOOT 8 .Os .Sh NAME @@ -99,9 +99,9 @@ can also be installed in an MBR slice: .Bd -literal -offset indent gpart create -s mbr ada0 gpart add -t freebsd ada0 -gpart create -s BSD ada0s1 gpart bootcode -b /boot/boot0 ada0 gpart set -a active -i 1 ada0 +dd if=/dev/zero of=/dev/ada0s1 count=2 dd if=/boot/zfsboot of=/dev/ada0s1 count=1 dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024 .Ed From owner-svn-src-all@freebsd.org Tue Apr 3 14:14:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A6DF83797; Tue, 3 Apr 2018 14:14:00 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4581F7F82A; Tue, 3 Apr 2018 14:14:00 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w33EDrbr017533 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Apr 2018 16:13:54 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: src-committers@freebsd.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id w33EDnvT094655; Tue, 3 Apr 2018 21:13:49 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r331927 - stable/11/stand/i386/zfsboot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201804031405.w33E5e42052580@repo.freebsd.org> From: Eugene Grosbein Message-ID: <5AC38C1D.3010701@grosbein.net> Date: Tue, 3 Apr 2018 21:13:49 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201804031405.w33E5e42052580@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=3.2 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_96_Q, LOCAL_FROM, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * 1.0 DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: date * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-Spam-Level: *** X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 14:14:00 -0000 On 03.04.2018 21:05, Eugene Grosbein wrote: > Author: eugen > Date: Tue Apr 3 14:05:40 2018 > New Revision: 331927 > URL: https://svnweb.freebsd.org/changeset/base/331927 > > Log: > MFC r331630: Fix instructions in the zfsboot manual page. > > zfsloader(8) fails to probe a slice containing ZFS pool if its second sector > contains traces of BSD label (DISKMAGIC == 0x82564557). > Fix manual page to show working example erasing such traces. > > PR: 226714 > Approved by: avg (mentor) This should be, and for next my commit too: Approved by: mav (mentor) From owner-svn-src-all@freebsd.org Tue Apr 3 15:14:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA3FF874BF; Tue, 3 Apr 2018 15:14:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD6882095; Tue, 3 Apr 2018 15:14:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 456A42625C; Tue, 3 Apr 2018 15:14:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33FEVFk067753; Tue, 3 Apr 2018 15:14:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33FEVQH067752; Tue, 3 Apr 2018 15:14:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804031514.w33FEVQH067752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 3 Apr 2018 15:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331930 - stable/11/sys/netinet/cc X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/netinet/cc X-SVN-Commit-Revision: 331930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 15:14:31 -0000 Author: emaste Date: Tue Apr 3 15:14:30 2018 New Revision: 331930 URL: https://svnweb.freebsd.org/changeset/base/331930 Log: MFC r321587: cc_cubic: restore braces around if-condition block r307901 was reverted in r321480, restoring an incorrect block delimitation bug present in the original cc_cubic commit. Restore only the bugfix (brace addition) from r307901. [HEAD revs above; r307901 and r321480 were both merged to stable/11 in r330445.] CID: 1090182 Reported by: bz Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/netinet/cc/cc_cubic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/cc/cc_cubic.c ============================================================================== --- stable/11/sys/netinet/cc/cc_cubic.c Tue Apr 3 14:29:56 2018 (r331929) +++ stable/11/sys/netinet/cc/cc_cubic.c Tue Apr 3 15:14:30 2018 (r331930) @@ -261,9 +261,10 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) * chance the first one is a false alarm and may not indicate * congestion. */ - if (CCV(ccv, t_rxtshift) >= 2) + if (CCV(ccv, t_rxtshift) >= 2) { cubic_data->num_cong_events++; cubic_data->t_last_cong = ticks; + } break; } } From owner-svn-src-all@freebsd.org Tue Apr 3 16:06:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F210F59197; Tue, 3 Apr 2018 16:06:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B30C848E5; Tue, 3 Apr 2018 16:06:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w33G6l2G052749 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 09:06:47 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w33G6kN0052748; Tue, 3 Apr 2018 09:06:46 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 3 Apr 2018 09:06:46 -0700 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331546 - head/etc/rc.d Message-ID: <20180403160646.GE1917@FreeBSD.org> References: <201803260936.w2Q9aMfD082758@repo.freebsd.org> <20180402220430.GD1917@FreeBSD.org> <4F543A96-C6B1-4FF0-A501-BC6C7FD3F26A@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4F543A96-C6B1-4FF0-A501-BC6C7FD3F26A@FreeBSD.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 16:06:49 -0000 On Tue, Apr 03, 2018 at 08:49:09AM +0200, Kristof Provost wrote: K> On 3 Apr 2018, at 0:04, Gleb Smirnoff wrote: K> > I just want to note that this is a huge change of behaviour K> > of pf(4) for a user. Over a decade everybody has been used K> > to the difference between "reload" and "resync". K> K> There is no difference. r330105 removed the ‘$pf_program -Fnat -Fqueue K> -Frules -FSources -Finfo -FTables -Fosfp’ line, but this never K> actually did what the author thought it did. K> pfctl only ever performed the last ‘-F’, not all of them, so all K> this ever did was flush the OS fingerprints information. Clearly K> that’s not what was intended. K> K> pf never actually breaks existing connections, because existing states K> keep using the rule that created them, regardless of the current rules. K> It wouldn’t have broken connections with resync either. A K> ‘restart’ will, because ‘start’ does ‘pfctl -F all’. K> K> If the flush had actually done what was intended it’d arguably have K> been a security issue, because reloading rules would then (briefly) open K> the firewall, allowing all traffic to pass and establish state. Hmm, may be I am wrong, but back when I was actively working with pf, the "reload" command would break the ssh connection I am using, so I have taught myself to use "resync". If I am wrong, please go forward :) -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Apr 3 16:07:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7529EF592F7; Tue, 3 Apr 2018 16:07:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0182584AD4; Tue, 3 Apr 2018 16:07:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w33G7pRg052790 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 09:07:51 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w33G7p5m052789; Tue, 3 Apr 2018 09:07:51 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 3 Apr 2018 09:07:51 -0700 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331546 - head/etc/rc.d Message-ID: <20180403160751.GF1917@FreeBSD.org> References: <201803260936.w2Q9aMfD082758@repo.freebsd.org> <20180402220430.GD1917@FreeBSD.org> <4F543A96-C6B1-4FF0-A501-BC6C7FD3F26A@FreeBSD.org> <20180403160646.GE1917@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403160646.GE1917@FreeBSD.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 16:07:53 -0000 On Tue, Apr 03, 2018 at 09:06:46AM -0700, Gleb Smirnoff wrote: T> Hmm, may be I am wrong, but back when I was actively working with pf, T> the "reload" command would break the ssh connection I am using, so T> I have taught myself to use "resync". Just checked on r328916, and it doesn't happen. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Apr 3 16:12:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C4BF59B11; Tue, 3 Apr 2018 16:12:33 +0000 (UTC) (envelope-from srs0=rwrb=gy=freebsd.org=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A8BB851D0; Tue, 3 Apr 2018 16:12:30 +0000 (UTC) (envelope-from srs0=rwrb=gy=freebsd.org=kp@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyg3pshqansoctr.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:701f:5a9f:25d:ceef]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id DE0159503; Tue, 3 Apr 2018 18:12:27 +0200 (CEST) From: "Kristof Provost" To: "Gleb Smirnoff" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331546 - head/etc/rc.d Date: Tue, 03 Apr 2018 18:12:26 +0200 X-Mailer: MailMate (2.0BETAr6106) Message-ID: <15CEFBCD-8875-438D-B370-3468DC637A53@FreeBSD.org> In-Reply-To: <20180403160646.GE1917@FreeBSD.org> References: <201803260936.w2Q9aMfD082758@repo.freebsd.org> <20180402220430.GD1917@FreeBSD.org> <4F543A96-C6B1-4FF0-A501-BC6C7FD3F26A@FreeBSD.org> <20180403160646.GE1917@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 16:12:34 -0000 On 3 Apr 2018, at 18:06, Gleb Smirnoff wrote: > On Tue, Apr 03, 2018 at 08:49:09AM +0200, Kristof Provost wrote: > K> On 3 Apr 2018, at 0:04, Gleb Smirnoff wrote: > K> > I just want to note that this is a huge change of behaviour > K> > of pf(4) for a user. Over a decade everybody has been used > K> > to the difference between "reload" and "resync". > K> > K> There is no difference. r330105 removed the ‘$pf_program -Fnat > -Fqueue > K> -Frules -FSources -Finfo -FTables -Fosfp’ line, but this never > K> actually did what the author thought it did. > K> pfctl only ever performed the last ‘-F’, not all of them, so > all > K> this ever did was flush the OS fingerprints information. Clearly > K> that’s not what was intended. > K> > K> pf never actually breaks existing connections, because existing > states > K> keep using the rule that created them, regardless of the current > rules. > K> It wouldn’t have broken connections with resync either. A > K> ‘restart’ will, because ‘start’ does ‘pfctl -F all’. > K> > K> If the flush had actually done what was intended it’d arguably > have > K> been a security issue, because reloading rules would then (briefly) > open > K> the firewall, allowing all traffic to pass and establish state. > > Hmm, may be I am wrong, but back when I was actively working with pf, > the "reload" command would break the ssh connection I am using, so > I have taught myself to use "resync". > Apparently reload used to have a ‘${pf_program:-/sbin/pfctl} -Fa’, which would have flushed everything and killed your connection. That was removed back in 2005 (April 4th, so pretty much exactly 13 years ago), and replaced by the erroneous ‘-Fnat -Fqueue -Frules -FSources -Finfo -FTables -Fosfp’ version. Regards, Kristof From owner-svn-src-all@freebsd.org Tue Apr 3 17:16:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDAAFF6FCA4; Tue, 3 Apr 2018 17:16:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80BE987F2E; Tue, 3 Apr 2018 17:16:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BB2D2767F; Tue, 3 Apr 2018 17:16:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33HG7ig062388; Tue, 3 Apr 2018 17:16:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33HG7Yc062382; Tue, 3 Apr 2018 17:16:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804031716.w33HG7Yc062382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 3 Apr 2018 17:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331931 - in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/x86 X-SVN-Commit-Revision: 331931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 17:16:08 -0000 Author: avg Date: Tue Apr 3 17:16:06 2018 New Revision: 331931 URL: https://svnweb.freebsd.org/changeset/base/331931 Log: fix i386 build with CPU_ELAN (LINT for instance) after r331878 x86/cpu_machdep.c now needs to include elan_mmcr.h when CPU_ELAN is set. While here, also remove the now unneeded inclusion of isareg.h in i386 and amd64 vm_machdep.c. Reported by: lwhsu MFC after: 14 days X-MFC with: r331878 Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Apr 3 15:14:30 2018 (r331930) +++ head/sys/amd64/amd64/vm_machdep.c Tue Apr 3 17:16:06 2018 (r331931) @@ -82,8 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Tue Apr 3 15:14:30 2018 (r331930) +++ head/sys/i386/i386/vm_machdep.c Tue Apr 3 17:16:06 2018 (r331931) @@ -79,18 +79,12 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef CPU_ELAN -#include -#endif - #include #include #include #include #include #include - -#include #ifndef NSFBUFS #define NSFBUFS (512 + maxusers * 16) Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Apr 3 15:14:30 2018 (r331930) +++ head/sys/x86/x86/cpu_machdep.c Tue Apr 3 17:16:06 2018 (r331931) @@ -85,6 +85,9 @@ __FBSDID("$FreeBSD$"); #ifdef SMP #include #endif +#ifdef CPU_ELAN +#include +#endif #include #include From owner-svn-src-all@freebsd.org Tue Apr 3 18:41:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D9FCF7632A; Tue, 3 Apr 2018 18:41:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29C916C127; Tue, 3 Apr 2018 18:41:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24A81484; Tue, 3 Apr 2018 18:41:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33IfS6N094696; Tue, 3 Apr 2018 18:41:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33IfSJ3094695; Tue, 3 Apr 2018 18:41:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804031841.w33IfSJ3094695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 Apr 2018 18:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331934 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 331934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 18:41:28 -0000 Author: markj Date: Tue Apr 3 18:41:27 2018 New Revision: 331934 URL: https://svnweb.freebsd.org/changeset/base/331934 Log: Wrap long lines. MFC after: 3 days Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Tue Apr 3 18:39:49 2018 (r331933) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Tue Apr 3 18:41:27 2018 (r331934) @@ -267,7 +267,8 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q PHOLD(task->task_thread->td_proc); sleepq_lock(task); if (atomic_read(&task->state) != TASK_WAKING) { - ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, state); + ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, + state); } else { sleepq_release(task); ret = 0; @@ -300,7 +301,8 @@ linux_schedule_timeout(int timeout) sleepq_lock(task); state = atomic_read(&task->state); if (state != TASK_WAKING) { - ret = linux_add_to_sleepqueue(task, task, "sched", timeout, state); + ret = linux_add_to_sleepqueue(task, task, "sched", timeout, + state); } else { sleepq_release(task); ret = 0; @@ -368,7 +370,8 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit break; } set_task_state(task, state); - ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, state); + ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, + state); if (ret != 0) break; } From owner-svn-src-all@freebsd.org Tue Apr 3 18:43:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB975F764DB; Tue, 3 Apr 2018 18:43:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89BE86C373; Tue, 3 Apr 2018 18:43:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84A265CE; Tue, 3 Apr 2018 18:43:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Ih0kO098218; Tue, 3 Apr 2018 18:43:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33Ih0JA098217; Tue, 3 Apr 2018 18:43:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804031843.w33Ih0JA098217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 3 Apr 2018 18:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331935 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 331935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 18:43:01 -0000 Author: emaste Date: Tue Apr 3 18:43:00 2018 New Revision: 331935 URL: https://svnweb.freebsd.org/changeset/base/331935 Log: vtfontcvt: allow .bdf characters less than full height Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Apr 3 18:41:27 2018 (r331934) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Apr 3 18:43:00 2018 (r331935) @@ -265,10 +265,23 @@ parse_bdf(FILE *fp, unsigned int map_idx) if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + /* + * Assume that the next _height_ lines are bitmap + * data. ENDCHAR is allowed to terminate the bitmap + * early but is not otherwise checked; any extra data + * is ignored. + */ for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!"); ln[length - 1] = '\0'; + if (strcmp(ln, "ENDCHAR") == 0) { + memset(bytes + i * wbytes, 0, + (height - i) * wbytes); + memset(bytes_r + i * wbytes, 0, + (height - i) * wbytes); + break; + } sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, bytes_r + i * wbytes, line, dwidth) != 0) From owner-svn-src-all@freebsd.org Tue Apr 3 18:52:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AD98F76D6F; Tue, 3 Apr 2018 18:52:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD5C46CA2E; Tue, 3 Apr 2018 18:52:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C789D780; Tue, 3 Apr 2018 18:52:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Iqdtl013529; Tue, 3 Apr 2018 18:52:39 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33IqdIQ013512; Tue, 3 Apr 2018 18:52:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804031852.w33IqdIQ013512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 18:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331936 - in head/lib/libc: stdio tests/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/lib/libc: stdio tests/stdio X-SVN-Commit-Revision: 331936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 18:52:40 -0000 Author: cy Date: Tue Apr 3 18:52:38 2018 New Revision: 331936 URL: https://svnweb.freebsd.org/changeset/base/331936 Log: Add new gets_s(3) stdio function. This implements the gets_s(3) function as documented at http://en.cppreference.com/w/c/io/gets. It facilitates the optional removal of gets(3). Reviewed by: ed MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12785 Added: head/lib/libc/stdio/gets_s.c - copied, changed from r326083, head/lib/libc/stdio/gets.c head/lib/libc/tests/stdio/gets_s_test.c (contents, props changed) Modified: head/lib/libc/stdio/Makefile.inc head/lib/libc/stdio/Symbol.map head/lib/libc/stdio/fgets.3 head/lib/libc/tests/stdio/Makefile Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Tue Apr 3 18:43:00 2018 (r331935) +++ head/lib/libc/stdio/Makefile.inc Tue Apr 3 18:52:38 2018 (r331936) @@ -14,7 +14,7 @@ SRCS+= _flock_stub.c asprintf.c clrerr.c dprintf.c \ fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \ ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \ fwrite.c getc.c getchar.c getdelim.c getline.c \ - gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \ + gets.c gets_s.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \ open_memstream.c open_wmemstream.c \ perror.c printf.c printf-pos.c putc.c putchar.c \ puts.c putw.c putwc.c putwchar.c \ @@ -50,6 +50,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \ ferror.3 fileno.3 ferror.3 fileno_unlocked.3 MLINKS+=fflush.3 fpurge.3 MLINKS+=fgets.3 gets.3 +MLINKS+=fgets.3 gets_s.3 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3 MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3 MLINKS+=fputs.3 puts.3 Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 (r331935) +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 (r331936) @@ -165,6 +165,7 @@ FBSD_1.3 { FBSD_1.4 { fdclose; fopencookie; + gets_s; }; FBSDprivate_1.0 { Modified: head/lib/libc/stdio/fgets.3 ============================================================================== --- head/lib/libc/stdio/fgets.3 Tue Apr 3 18:43:00 2018 (r331935) +++ head/lib/libc/stdio/fgets.3 Tue Apr 3 18:52:38 2018 (r331936) @@ -46,6 +46,8 @@ .Ft char * .Fn fgets "char * restrict str" "int size" "FILE * restrict stream" .Ft char * +.Fn gets_s "char *str" "rsize_t size" +.Ft char * .Fn gets "char *str" .Sh DESCRIPTION The @@ -65,6 +67,17 @@ If any characters are read and there is no error, a character is appended to end the string. .Pp The +.Fn gets_s +function +is equivalent to +.Fn fgets +with a +.Fa stream +of +.Dv stdin , +except that the newline character (if any) is not stored in the string. +.Pp +The .Fn gets function is equivalent to @@ -80,7 +93,8 @@ It is the caller's responsibility to ensure that the i if any, is sufficiently short to fit in the string. .Sh RETURN VALUES Upon successful completion, -.Fn fgets +.Fn fgets , +.Fn gets_s , and .Fn gets return @@ -94,7 +108,8 @@ they return .Dv NULL and the buffer contents are indeterminate. The -.Fn fgets +.Fn fgets , +.Fn gets_s , and .Fn gets functions @@ -141,6 +156,13 @@ and .Fn gets conform to .St -isoC-99 . +.Fn gets_s +conforms to +.St -isoC-2011 +K.3.7.4.1. +.Fn gets +has been removed from +.St -isoC-2011 . .Sh SECURITY CONSIDERATIONS The .Fn gets Copied and modified: head/lib/libc/stdio/gets_s.c (from r326083, head/lib/libc/stdio/gets.c) ============================================================================== --- head/lib/libc/stdio/gets.c Wed Nov 22 01:53:59 2017 (r326083, copy source) +++ head/lib/libc/stdio/gets_s.c Tue Apr 3 18:52:38 2018 (r331936) @@ -3,6 +3,8 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017, 2018 + * Cyril S. E. Schubert. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. @@ -32,49 +34,69 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)gets.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include +#include #include #include "un-namespace.h" #include "libc_private.h" #include "local.h" -__warn_references(gets, "warning: this program uses gets(), which is unsafe."); - -char * -gets(char *buf) +static inline char * +_gets_s(char *buf, rsize_t n) { int c; - char *s, *ret; - static int warned; - static const char w[] = - "warning: this program uses gets(), which is unsafe.\n"; + char *s; - FLOCKFILE_CANCELSAFE(stdin); ORIENT(stdin, -1); - if (!warned) { - (void) _write(STDERR_FILENO, w, sizeof(w) - 1); - warned = 1; - } - for (s = buf; (c = __sgetc(stdin)) != '\n'; ) { + for (s = buf, n--; (c = __sgetc(stdin)) != '\n' && n > 0 ; n--) { if (c == EOF) { if (s == buf) { - ret = NULL; - goto end; + return (NULL); } else break; } else *s++ = c; } + + /* + * If end of buffer reached, discard until \n or eof. + * Then throw an error. + */ + if (n == 0) { + /* discard */ + while ((c = __sgetc(stdin)) != '\n' && c != EOF); + /* throw the error after lock released prior to exit */ + __throw_constraint_handler_s("gets_s : end of buffer", E2BIG); + return (NULL); + } *s = 0; - ret = buf; -end: + return (buf); +} + +/* ISO/IEC 9899:2011 K.3.7.4.1 */ +char * +gets_s(char *buf, rsize_t n) +{ + char *ret; + if (buf == NULL) { + __throw_constraint_handler_s("gets_s : str is NULL", EINVAL); + return(NULL); + } else if (n > RSIZE_MAX) { + __throw_constraint_handler_s("gets_s : n > RSIZE_MAX", + EINVAL); + return(NULL); + } else if (n == 0) { + __throw_constraint_handler_s("gets_s : n == 0", EINVAL); + return(NULL); + } + + FLOCKFILE_CANCELSAFE(stdin); + ret = _gets_s(buf, n); FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: head/lib/libc/tests/stdio/Makefile ============================================================================== --- head/lib/libc/tests/stdio/Makefile Tue Apr 3 18:43:00 2018 (r331935) +++ head/lib/libc/tests/stdio/Makefile Tue Apr 3 18:52:38 2018 (r331936) @@ -7,6 +7,7 @@ ATF_TESTS_C+= fmemopen2_test ATF_TESTS_C+= fopen2_test ATF_TESTS_C+= freopen_test ATF_TESTS_C+= getdelim_test +ATF_TESTS_C+= gets_s_test ATF_TESTS_C+= mkostemp_test ATF_TESTS_C+= open_memstream2_test ATF_TESTS_C+= open_wmemstream_test Added: head/lib/libc/tests/stdio/gets_s_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdio/gets_s_test.c Tue Apr 3 18:52:38 2018 (r331936) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2017 Cyril S. E. Schubert. 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +static errno_t error_code; +static const char * message; + +void +h(const char * msg, void * ptr __unused, errno_t error) +{ + error_code = error; + message = msg; +} + +/* null ptr */ +ATF_TC_WITHOUT_HEAD(null_ptr); +ATF_TC_BODY(null_ptr, tc) +{ + ATF_CHECK_MSG(gets_s(NULL, 1) == NULL, + "gets_s() failed to handle NULL pointer"); +} + +/* normal */ +ATF_TC_WITHOUT_HEAD(normal); +ATF_TC_BODY(normal, tc) +{ + pid_t kidpid; + int fd[2]; + int nfd; + + // close(STDIN_FILENO); + // close(STDOUT_FILENO); + pipe(fd); + + if ((kidpid = fork()) == 0) { + char b[10]; + + close(fd[1]); + nfd = dup2(fd[0], 0); + close(fd[0]); + stdin = fdopen(nfd, "r"); + ATF_CHECK_MSG(gets_s(b, sizeof(b)) == 0, "gets_s() normal failed"); + fclose(stdin); + } else { + int stat; + + close(fd[0]); + stdout = fdopen(fd[1], "w"); + puts("a sting"); + fclose(stdout); + (void) waitpid(kidpid, &stat, WEXITED); + } +} + +/* n > rmax */ +ATF_TC_WITHOUT_HEAD(n_gt_rmax); +ATF_TC_BODY(n_gt_rmax, tc) +{ + char b; + + ATF_CHECK_MSG(gets_s(&b, RSIZE_MAX + 1) == NULL, + "gets_s() n > RSIZE_MAX"); +} + +/* n == 0 */ +ATF_TC_WITHOUT_HEAD(n_eq_zero); +ATF_TC_BODY(n_eq_zero, tc) +{ + char b; + + ATF_CHECK_MSG(gets_s(&b, 0) == NULL, "gets_s() n is zero"); +} + +/* n > rmax, handler */ +ATF_TC_WITHOUT_HEAD(n_gt_rmax_handler); +ATF_TC_BODY(n_gt_rmax_handler, tc) +{ + char b; + + error_code = 0; + message = NULL; + set_constraint_handler_s(h); + ATF_CHECK_MSG(gets_s(&b, RSIZE_MAX + 1) == NULL, "gets_s() n > RSIZE_MAX"); + ATF_CHECK_MSG(error_code > 0, "gets_s() error code is %d", error_code); + ATF_CHECK_MSG(strcmp(message, "gets_s : n > RSIZE_MAX") == 0, "gets_s(): incorrect error message"); +} + +/* n == 0, handler */ +ATF_TC_WITHOUT_HEAD(n_eq_zero_handler); +ATF_TC_BODY(n_eq_zero_handler, tc) +{ + char b; + + error_code = 0; + message = NULL; + set_constraint_handler_s(h); + ATF_CHECK(gets_s(&b, 0) == NULL); + ATF_CHECK_MSG(error_code > 0, "gets_s() error code is %d", error_code); + ATF_CHECK_MSG(strcmp(message, "gets_s : n == 0") == 0, "gets_s(): incorrect error message"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, null_ptr); + ATF_TP_ADD_TC(tp, normal); + ATF_TP_ADD_TC(tp, n_gt_rmax); + ATF_TP_ADD_TC(tp, n_eq_zero); + ATF_TP_ADD_TC(tp, n_gt_rmax_handler); + ATF_TP_ADD_TC(tp, n_eq_zero_handler); + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Tue Apr 3 19:35:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A859F79C9E; Tue, 3 Apr 2018 19:35:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A63E6EE75; Tue, 3 Apr 2018 19:35:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04B70E35; Tue, 3 Apr 2018 19:35:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33JZBvc077449; Tue, 3 Apr 2018 19:35:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33JZBBh077448; Tue, 3 Apr 2018 19:35:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804031935.w33JZBBh077448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 19:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r331938 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cy X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 331938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 19:35:12 -0000 Author: cy Date: Tue Apr 3 19:35:11 2018 New Revision: 331938 URL: https://svnweb.freebsd.org/changeset/base/331938 Log: Add myself for MIT krb5-1.16 import into vendor-crypto branch. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Tue Apr 3 19:08:49 2018 (r331937) +++ svnadmin/conf/sizelimit.conf Tue Apr 3 19:35:11 2018 (r331938) @@ -16,6 +16,7 @@ # First field is username, second field is the raised limit required. achim bapt +cy davidcs dim imp From owner-svn-src-all@freebsd.org Tue Apr 3 19:36:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 015EDF79E1A; Tue, 3 Apr 2018 19:36:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A29A6F00D; Tue, 3 Apr 2018 19:36:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94543E38; Tue, 3 Apr 2018 19:36:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Ja3m0078275; Tue, 3 Apr 2018 19:36:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33Ja1kp078226; Tue, 3 Apr 2018 19:36:01 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804031936.w33Ja1kp078226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 19:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r331939 - in vendor-crypto/krb5/dist: . doc doc/admin doc/admin/admin_commands doc/admin/conf_files doc/appdev doc/basic doc/build doc/html doc/html/_sources doc/html/_sources/admin doc... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor-crypto/krb5/dist: . doc doc/admin doc/admin/admin_commands doc/admin/conf_files doc/appdev doc/basic doc/build doc/html doc/html/_sources doc/html/_sources/admin doc/html/_sources/admin/admi... X-SVN-Commit-Revision: 331939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 19:36:04 -0000 Author: cy Date: Tue Apr 3 19:36:00 2018 New Revision: 331939 URL: https://svnweb.freebsd.org/changeset/base/331939 Log: Import MIT KRB5 1.16. Added: vendor-crypto/krb5/dist/.travis.yml vendor-crypto/krb5/dist/doc/appdev/y2038.rst vendor-crypto/krb5/dist/doc/html/_sources/appdev/y2038.txt (contents, props changed) vendor-crypto/krb5/dist/doc/html/_sources/plugindev/certauth.txt (contents, props changed) vendor-crypto/krb5/dist/doc/html/_sources/plugindev/kadm5_auth.txt (contents, props changed) vendor-crypto/krb5/dist/doc/html/_sources/plugindev/kdcpolicy.txt (contents, props changed) vendor-crypto/krb5/dist/doc/html/appdev/y2038.html (contents, props changed) vendor-crypto/krb5/dist/doc/html/plugindev/certauth.html (contents, props changed) vendor-crypto/krb5/dist/doc/html/plugindev/kadm5_auth.html (contents, props changed) vendor-crypto/krb5/dist/doc/html/plugindev/kdcpolicy.html (contents, props changed) vendor-crypto/krb5/dist/doc/plugindev/certauth.rst vendor-crypto/krb5/dist/doc/plugindev/kadm5_auth.rst vendor-crypto/krb5/dist/doc/plugindev/kdcpolicy.rst vendor-crypto/krb5/dist/src/config/ac-archive/ax_pthread.m4 vendor-crypto/krb5/dist/src/config/ac-archive/ax_recursive_eval.m4 vendor-crypto/krb5/dist/src/include/k5-cmocka.h (contents, props changed) vendor-crypto/krb5/dist/src/include/krb5/certauth_plugin.h (contents, props changed) vendor-crypto/krb5/dist/src/include/krb5/kadm5_auth_plugin.h (contents, props changed) vendor-crypto/krb5/dist/src/include/krb5/kdcpolicy_plugin.h (contents, props changed) vendor-crypto/krb5/dist/src/kadmin/server/auth.c (contents, props changed) vendor-crypto/krb5/dist/src/kadmin/server/auth.h (contents, props changed) vendor-crypto/krb5/dist/src/kadmin/server/auth_acl.c (contents, props changed) vendor-crypto/krb5/dist/src/kadmin/server/auth_self.c (contents, props changed) vendor-crypto/krb5/dist/src/lib/krb5/ccache/ccselect_hostname.c (contents, props changed) vendor-crypto/krb5/dist/src/lib/krb5/krb/t_valid_times.c (contents, props changed) vendor-crypto/krb5/dist/src/plugins/certauth/ vendor-crypto/krb5/dist/src/plugins/certauth/test/ vendor-crypto/krb5/dist/src/plugins/certauth/test/Makefile.in (contents, props changed) vendor-crypto/krb5/dist/src/plugins/certauth/test/certauth_test.exports vendor-crypto/krb5/dist/src/plugins/certauth/test/deps vendor-crypto/krb5/dist/src/plugins/certauth/test/main.c (contents, props changed) vendor-crypto/krb5/dist/src/plugins/kadm5_auth/ vendor-crypto/krb5/dist/src/plugins/kadm5_auth/test/ vendor-crypto/krb5/dist/src/plugins/kadm5_auth/test/Makefile.in (contents, props changed) vendor-crypto/krb5/dist/src/plugins/kadm5_auth/test/deps vendor-crypto/krb5/dist/src/plugins/kadm5_auth/test/kadm5_auth_test.exports vendor-crypto/krb5/dist/src/plugins/kadm5_auth/test/main.c (contents, props changed) vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/kerberos.openldap.ldif vendor-crypto/krb5/dist/src/plugins/kdcpolicy/ vendor-crypto/krb5/dist/src/plugins/kdcpolicy/test/ vendor-crypto/krb5/dist/src/plugins/kdcpolicy/test/Makefile.in (contents, props changed) vendor-crypto/krb5/dist/src/plugins/kdcpolicy/test/deps vendor-crypto/krb5/dist/src/plugins/kdcpolicy/test/kdcpolicy_test.exports vendor-crypto/krb5/dist/src/plugins/kdcpolicy/test/main.c (contents, props changed) vendor-crypto/krb5/dist/src/plugins/preauth/test/common.c (contents, props changed) vendor-crypto/krb5/dist/src/plugins/preauth/test/common.h (contents, props changed) vendor-crypto/krb5/dist/src/po/de.po (contents, props changed) vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/generic.p12 (contents, props changed) vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/generic.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-upn.p12 (contents, props changed) vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-upn.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-upn2.p12 (contents, props changed) vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-upn2.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-upn3.p12 (contents, props changed) vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-upn3.pem vendor-crypto/krb5/dist/src/tests/gssapi/t_lifetime.c (contents, props changed) vendor-crypto/krb5/dist/src/tests/icinterleave.c (contents, props changed) vendor-crypto/krb5/dist/src/tests/t_certauth.py (contents, props changed) vendor-crypto/krb5/dist/src/tests/t_kadm5_auth.py (contents, props changed) vendor-crypto/krb5/dist/src/tests/t_kdcpolicy.py (contents, props changed) vendor-crypto/krb5/dist/src/tests/t_y2038.py (contents, props changed) vendor-crypto/krb5/dist/src/util/support/t_utf16.c (contents, props changed) Deleted: vendor-crypto/krb5/dist/src/clients/kpasswd/ksetpwd.c vendor-crypto/krb5/dist/src/config/ac-archive/acx_pthread.m4 vendor-crypto/krb5/dist/src/config/ac-archive/relpaths.m4 vendor-crypto/krb5/dist/src/lib/kadm5/srv/server_acl.c vendor-crypto/krb5/dist/src/lib/kadm5/srv/server_acl.h vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_crypto_nss.c Modified: vendor-crypto/krb5/dist/NOTICE vendor-crypto/krb5/dist/README vendor-crypto/krb5/dist/doc/admin/admin_commands/kadmin_local.rst vendor-crypto/krb5/dist/doc/admin/admin_commands/kpropd.rst vendor-crypto/krb5/dist/doc/admin/admin_commands/ktutil.rst vendor-crypto/krb5/dist/doc/admin/conf_files/kadm5_acl.rst vendor-crypto/krb5/dist/doc/admin/conf_files/kdc_conf.rst vendor-crypto/krb5/dist/doc/admin/conf_files/krb5_conf.rst vendor-crypto/krb5/dist/doc/admin/pkinit.rst vendor-crypto/krb5/dist/doc/admin/realm_config.rst vendor-crypto/krb5/dist/doc/appdev/gssapi.rst vendor-crypto/krb5/dist/doc/appdev/index.rst vendor-crypto/krb5/dist/doc/basic/ccache_def.rst vendor-crypto/krb5/dist/doc/build/options2configure.rst vendor-crypto/krb5/dist/doc/conf.py vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kadmin_local.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kpropd.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/ktutil.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kadm5_acl.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kdc_conf.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/krb5_conf.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/pkinit.txt vendor-crypto/krb5/dist/doc/html/_sources/admin/realm_config.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/gssapi.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/index.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_auth_con_initivector.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_fwd_tgt_creds.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_init_creds_free.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_init_creds_get.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_init_creds_init.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_init_creds_set_service.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_init_creds_step.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_mk_req.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/api/krb5_pac_verify.txt vendor-crypto/krb5/dist/doc/html/_sources/appdev/refs/types/krb5_timestamp.txt vendor-crypto/krb5/dist/doc/html/_sources/basic/ccache_def.txt vendor-crypto/krb5/dist/doc/html/_sources/build/options2configure.txt vendor-crypto/krb5/dist/doc/html/_sources/mitK5features.txt vendor-crypto/krb5/dist/doc/html/_sources/plugindev/index.txt vendor-crypto/krb5/dist/doc/html/about.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/index.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/k5srvutil.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kadmin_local.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kadmind.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kdb5_ldap_util.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kdb5_util.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kprop.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kpropd.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/kproplog.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/krb5kdc.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/ktutil.html vendor-crypto/krb5/dist/doc/html/admin/admin_commands/sserver.html vendor-crypto/krb5/dist/doc/html/admin/advanced/index.html vendor-crypto/krb5/dist/doc/html/admin/advanced/ldapbackend.html vendor-crypto/krb5/dist/doc/html/admin/advanced/retiring-des.html vendor-crypto/krb5/dist/doc/html/admin/appl_servers.html vendor-crypto/krb5/dist/doc/html/admin/auth_indicator.html vendor-crypto/krb5/dist/doc/html/admin/backup_host.html vendor-crypto/krb5/dist/doc/html/admin/conf_files/index.html vendor-crypto/krb5/dist/doc/html/admin/conf_files/kadm5_acl.html vendor-crypto/krb5/dist/doc/html/admin/conf_files/kdc_conf.html vendor-crypto/krb5/dist/doc/html/admin/conf_files/krb5_conf.html vendor-crypto/krb5/dist/doc/html/admin/conf_ldap.html vendor-crypto/krb5/dist/doc/html/admin/database.html vendor-crypto/krb5/dist/doc/html/admin/enctypes.html vendor-crypto/krb5/dist/doc/html/admin/env_variables.html vendor-crypto/krb5/dist/doc/html/admin/host_config.html vendor-crypto/krb5/dist/doc/html/admin/https.html vendor-crypto/krb5/dist/doc/html/admin/index.html vendor-crypto/krb5/dist/doc/html/admin/install.html vendor-crypto/krb5/dist/doc/html/admin/install_appl_srv.html vendor-crypto/krb5/dist/doc/html/admin/install_clients.html vendor-crypto/krb5/dist/doc/html/admin/install_kdc.html vendor-crypto/krb5/dist/doc/html/admin/lockout.html vendor-crypto/krb5/dist/doc/html/admin/otp.html vendor-crypto/krb5/dist/doc/html/admin/pkinit.html vendor-crypto/krb5/dist/doc/html/admin/princ_dns.html vendor-crypto/krb5/dist/doc/html/admin/realm_config.html vendor-crypto/krb5/dist/doc/html/admin/troubleshoot.html vendor-crypto/krb5/dist/doc/html/admin/various_envs.html vendor-crypto/krb5/dist/doc/html/appdev/gssapi.html vendor-crypto/krb5/dist/doc/html/appdev/h5l_mit_apidiff.html vendor-crypto/krb5/dist/doc/html/appdev/index.html vendor-crypto/krb5/dist/doc/html/appdev/init_creds.html vendor-crypto/krb5/dist/doc/html/appdev/princ_handle.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/index.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_425_conv_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_524_conv_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_524_convert_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_address_compare.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_address_order.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_address_search.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_allow_weak_crypto.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_aname_to_localname.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_anonymous_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_anonymous_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_appdefault_boolean.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_appdefault_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_genaddrs.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_get_checksum_func.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getaddrs.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getauthenticator.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getflags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getkey_k.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getlocalseqnumber.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getlocalsubkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getrcache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getrecvsubkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getrecvsubkey_k.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getremoteseqnumber.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getremotesubkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getsendsubkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_getsendsubkey_k.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_init.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_initivector.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_set_checksum_func.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_set_req_cksumtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setaddrs.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setflags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setports.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setrcache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setrecvsubkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setrecvsubkey_k.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setsendsubkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setsendsubkey_k.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_auth_con_setuseruserkey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_build_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_build_principal_alloc_va.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_build_principal_ext.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_build_principal_va.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_block_size.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_checksum_length.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_crypto_length.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_crypto_length_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_decrypt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_decrypt_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_derive_prfplus.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_encrypt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_encrypt_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_encrypt_length.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_enctype_compare.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_free_state.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_fx_cf2_simple.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_init_state.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_is_coll_proof_cksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_is_keyed_cksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_keyed_checksum_types.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_keylengths.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_make_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_make_checksum_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_make_random_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_padding_length.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_prf.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_prf_length.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_prfplus.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_random_add_entropy.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_random_make_octets.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_random_os_entropy.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_random_seed.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_random_to_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_string_to_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_string_to_key_with_params.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_valid_cksumtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_valid_enctype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_verify_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_c_verify_checksum_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_calculate_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_cache_match.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_close.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_copy_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_default.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_default_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_destroy.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_dup.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_end_seq_get.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_gen_new.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_get_config.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_get_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_get_full_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_get_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_get_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_get_type.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_initialize.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_last_change_time.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_lock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_move.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_new_unique.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_next_cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_remove_cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_resolve.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_retrieve_cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_select.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_set_config.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_set_default_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_set_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_start_seq_get.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_store_cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_support_switch.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_switch.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cc_unlock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_cursor_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_cursor_new.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_cursor_next.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_have_content.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_last_change_time.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_lock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cccol_unlock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_change_password.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_check_clockskew.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_checksum_size.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_chpw_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_cksumtype_to_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_clear_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_addresses.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_authdata.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_authenticator.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_keyblock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_keyblock_contents.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_copy_ticket.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_decode_authdata_container.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_decode_ticket.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_decrypt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_deltat_to_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_eblock_enctype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_encode_authdata_container.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_encrypt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_encrypt_size.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_enctype_to_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_enctype_to_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_expand_hostname.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_find_authdata.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_finish_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_finish_random_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_addresses.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_ap_rep_enc_part.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_authdata.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_authenticator.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_checksum_contents.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_cksumtypes.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_cred_contents.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_data_contents.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_default_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_enctypes.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_error.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_host_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_keyblock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_keyblock_contents.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_keytab_entry_contents.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_tgt_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_ticket.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_free_unparsed_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_fwd_tgt_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_credentials.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_credentials_renew.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_credentials_validate.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_default_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_fallback_host_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_host_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_in_tkt_with_keytab.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_in_tkt_with_password.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_in_tkt_with_skey.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_keytab.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_alloc.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_get_fast_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_init.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_address_list.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_anonymous.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_canonicalize.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_change_password_prompt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_etype_list.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_expire_callback.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_fast_ccache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_fast_ccache_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_fast_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_forwardable.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_in_ccache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_out_ccache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_pa.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_pac_request.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_preauth_list.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_proxiable.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_renew_life.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_responder.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_salt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_opt_set_tkt_life.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_init_creds_password.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_permitted_enctypes.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_profile.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_prompt_types.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_renewed_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_server_rcache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_time_offsets.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_get_validated_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_context_profile.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_get.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_get_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_get_error.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_get_times.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_init.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_set_keytab.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_set_password.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_set_service.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_creds_step.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_keyblock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_random_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_init_secure_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_is_config_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_is_referral_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_is_thread_safe.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_create_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_decrypt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_decrypt_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_encrypt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_encrypt_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_free_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_key_enctype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_key_keyblock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_make_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_make_checksum_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_prf.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_reference_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_verify_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_k_verify_checksum_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_add_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_client_default.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_close.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_default.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_default_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_dup.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_end_seq_get.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_free_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_get_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_get_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_get_type.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_have_content.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_next_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_read_service_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_remove_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_resolve.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kt_start_seq_get.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_kuserok.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_make_authdata_kdc_issued.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_merge_authdata.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_1cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_error.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_ncred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_priv.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_rep.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_rep_dce.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_req.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_req_extended.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_mk_safe.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_os_localaddr.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_add_buffer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_get_buffer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_get_types.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_init.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_parse.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_sign.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_pac_verify.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_parse_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_parse_name_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_prepend_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_principal2salt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_principal_compare.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_principal_compare_any_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_principal_compare_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_process_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_prompter_posix.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_random_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_error.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_priv.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_rep.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_rep_dce.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_req.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_rd_safe.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_read_password.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_realm_compare.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_recvauth.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_recvauth_version.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_get_challenge.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_list_questions.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_otp_challenge_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_otp_get_challenge.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_otp_set_answer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_pkinit_challenge_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_pkinit_get_challenge.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_pkinit_set_answer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_responder_set_answer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_salttype_to_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_sendauth.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_server_decrypt_ticket_keytab.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_default_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_default_tgs_enctypes.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_kdc_recv_hook.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_kdc_send_hook.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_password.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_password_using_ccache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_principal_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_real_time.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_trace_callback.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_set_trace_filename.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_sname_match.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_sname_to_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_string_to_cksumtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_string_to_deltat.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_string_to_enctype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_string_to_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_string_to_salttype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_string_to_timestamp.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_timeofday.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_timestamp_to_sfstring.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_timestamp_to_string.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_tkt_creds_free.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_tkt_creds_get.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_tkt_creds_get_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_tkt_creds_get_times.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_tkt_creds_init.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_tkt_creds_step.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_unparse_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_unparse_name_ext.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_unparse_name_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_unparse_name_flags_ext.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_us_timeofday.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_use_enctype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_verify_authdata_kdc_issued.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_verify_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_verify_init_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_verify_init_creds_opt_init.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_verify_init_creds_opt_set_ap_req_nofail.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_vprepend_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_vset_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_vwrap_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/api/krb5_wrap_error_message.html vendor-crypto/krb5/dist/doc/html/appdev/refs/index.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_ADDRPORT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_CHAOS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_DDP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_INET.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_INET6.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_IPPORT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_ISO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_IS_LOCAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_NETBIOS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ADDRTYPE_XNS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AD_TYPE_EXTERNAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AD_TYPE_FIELD_TYPE_MASK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AD_TYPE_REGISTERED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AD_TYPE_RESERVED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AP_OPTS_ETYPE_NEGOTIATION.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AP_OPTS_MUTUAL_REQUIRED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AP_OPTS_RESERVED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AP_OPTS_USE_SESSION_KEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AP_OPTS_USE_SUBKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/AP_OPTS_WIRE_MASK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_CMAC_CAMELLIA128.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_CMAC_CAMELLIA256.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_CRC32.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_DESCBC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_HMAC_MD5_ARCFOUR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_HMAC_SHA1_96_AES128.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_HMAC_SHA1_96_AES256.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_HMAC_SHA1_DES3.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_HMAC_SHA256_128_AES128.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_HMAC_SHA384_192_AES256.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_MD5_HMAC_ARCFOUR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_NIST_SHA.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_RSA_MD4.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_RSA_MD4_DES.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_RSA_MD5.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/CKSUMTYPE_RSA_MD5_DES.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_AES128_CTS_HMAC_SHA1_96.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_AES128_CTS_HMAC_SHA256_128.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_AES256_CTS_HMAC_SHA1_96.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_AES256_CTS_HMAC_SHA384_192.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_ARCFOUR_HMAC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_ARCFOUR_HMAC_EXP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_CAMELLIA128_CTS_CMAC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_CAMELLIA256_CTS_CMAC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES3_CBC_ENV.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES3_CBC_RAW.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES3_CBC_SHA.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES3_CBC_SHA1.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES_CBC_CRC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES_CBC_MD4.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES_CBC_MD5.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES_CBC_RAW.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DES_HMAC_SHA1.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_DSA_SHA1_CMS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_MD5_RSA_CMS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_NULL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_RC2_CBC_ENV.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_RSA_ENV.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_RSA_ES_OAEP_ENV.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_SHA1_RSA_CMS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/ENCTYPE_UNKNOWN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_ALLOW_POSTDATE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_CANONICALIZE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_CNAME_IN_ADDL_TKT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_DISABLE_TRANSITED_CHECK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_ENC_TKT_IN_SKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_FORWARDABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_FORWARDED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_POSTDATED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_PROXIABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_PROXY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_RENEW.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_RENEWABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_RENEWABLE_OK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_REQUEST_ANONYMOUS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_OPT_VALIDATE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KDC_TKT_COMMON_MASK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_ANONYMOUS_PRINCSTR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_ANONYMOUS_REALMSTR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AP_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AP_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AS_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AS_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_AND_OR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_AUTH_INDICATOR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_CAMMAC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_ETYPE_NEGOTIATION.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_FX_ARMOR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_IF_RELEVANT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_INITIAL_VERIFIED_CAS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_KDC_ISSUED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_MANDATORY_FOR_KDC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_OSF_DCE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_SESAME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_SIGNTICKET.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTHDATA_WIN2K_PAC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_DO_SEQUENCE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_DO_TIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_PERMIT_ALL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_RET_SEQUENCE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_RET_TIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_AUTH_CONTEXT_USE_SUBKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_CHECKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_DATA.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_EMPTY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_HEADER.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_PADDING.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_SIGN_ONLY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_STREAM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CRYPTO_TYPE_TRAILER.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_CYBERSAFE_SECUREID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_DOMAIN_X500_COMPRESS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_ENCPADATA_REQ_ENC_PA_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_ERROR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_FAST_REQUIRED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_CACHED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_CANONICALIZE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_CONSTRAINED_DELEGATION.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_FORWARDABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_NO_STORE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_NO_TRANSIT_CHECK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GC_USER_USER.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_ANONYMOUS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_CANONICALIZE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_CHG_PWD_PRMPT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_FORWARDABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_PROXIABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_SALT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_GET_INIT_CREDS_OPT_TKT_LIFE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INIT_CONTEXT_KDC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INIT_CONTEXT_SECURE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INIT_CREDS_STEP_FLAG_CONTINUE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INT16_MAX.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INT16_MIN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INT32_MAX.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_INT32_MIN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AD_ITE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AD_MTE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AD_SIGNEDPATH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_APP_DATA_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_APP_DATA_ENCRYPT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AP_REP_ENCPART.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AP_REQ_AUTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AS_REP_ENCPART.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AS_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_CAMMAC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_ENC_CHALLENGE_CLIENT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_ENC_CHALLENGE_KDC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_FAST_ENC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_FAST_FINISHED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_FAST_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_FAST_REQ_CHKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_GSS_TOK_MIC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_IAKERB_FINISHED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_KDC_REP_TICKET.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_KRB_CRED_ENCPART.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_KRB_ERROR_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_KRB_PRIV_ENCPART.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_KRB_SAFE_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_FX_COOKIE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_OTP_REQUEST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_PKINIT_KX.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_S4U_X509_USER_REPLY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_S4U_X509_USER_REQUEST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_PA_SAM_RESPONSE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_TGS_REQ_AUTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_ACCESSDENIED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_AUTHERROR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_BAD_VERSION.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_HARDERROR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_INITIAL_FLAG_NEEDED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_MALFORMED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_SOFTERROR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_KPASSWD_SUCCESS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_ACCT_EXPTIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_LAST_INITIAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_LAST_RENEWAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_LAST_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_LAST_TGT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_LAST_TGT_ISSUED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ALL_PW_EXPTIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_NONE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_ACCT_EXPTIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_LAST_INITIAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_LAST_RENEWAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_LAST_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_LAST_TGT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_LAST_TGT_ISSUED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_LRQ_ONE_PW_EXPTIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_ENTERPRISE_PRINCIPAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_ENT_PRINCIPAL_AND_ID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_MS_PRINCIPAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_MS_PRINCIPAL_AND_ID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_PRINCIPAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_SMTP_NAME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_SRV_HST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_SRV_INST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_SRV_XHST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_UID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_UNKNOWN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_WELLKNOWN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_NT_X500_PRINCIPAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_CLIENT_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_CREDENTIALS_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_DELEGATION_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_LOGON_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_PRIVSVR_CHECKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_SERVER_CHECKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PAC_UPN_DNS_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_AFS3_SALT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_AP_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_AS_CHECKSUM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_ENCRYPTED_CHALLENGE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_ENC_SANDIA_SECURID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_ENC_TIMESTAMP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_ENC_UNIX_TIME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_ETYPE_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_ETYPE_INFO2.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_FOR_USER.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_FX_COOKIE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_FX_ERROR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_FX_FAST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_GET_FROM_TYPED_DATA.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_NONE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_OSF_DCE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_OTP_CHALLENGE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_OTP_PIN_CHANGE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_OTP_REQUEST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PAC_REQUEST.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PKINIT_KX.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PK_AS_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PK_AS_REP_OLD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PK_AS_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PK_AS_REQ_OLD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_PW_SALT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_REFERRAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_S4U_X509_USER.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SAM_CHALLENGE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SAM_CHALLENGE_2.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SAM_REDIRECT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SAM_RESPONSE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SAM_RESPONSE_2.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SESAME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_SVR_REFERRAL_INFO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_TGS_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PADATA_USE_SPECIFIED_KVNO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_COMPARE_CASEFOLD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_COMPARE_ENTERPRISE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_COMPARE_IGNORE_REALM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_COMPARE_UTF8.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_PARSE_ENTERPRISE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_PARSE_IGNORE_REALM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_PARSE_NO_REALM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_PARSE_REQUIRE_REALM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_UNPARSE_DISPLAY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_UNPARSE_NO_REALM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRINCIPAL_UNPARSE_SHORT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PRIV.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PROMPT_TYPE_NEW_PASSWORD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PROMPT_TYPE_PASSWORD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PROMPT_TYPE_PREAUTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_PVNO.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_REALM_BRANCH_CHAR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RECVAUTH_BADAUTHVERS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RECVAUTH_SKIP_VERSION.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_REFERRAL_REALM.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FLAGS_NEXTOTP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FORMAT_ALPHANUMERIC.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FORMAT_DECIMAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_OTP_FORMAT_HEXADECIMAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_COUNT_LOW.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_FINAL_TRY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_PKINIT_FLAGS_TOKEN_USER_PIN_LOCKED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_QUESTION_OTP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_QUESTION_PASSWORD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_RESPONDER_QUESTION_PKINIT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_SAFE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_SAM_MUST_PK_ENCRYPT_SAD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_SAM_SEND_ENCRYPTED_SAD.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_SAM_USE_SAD_AS_KEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_2ND_TKT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_AUTHDATA.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_FLAGS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_FLAGS_EXACT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_IS_SKEY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_KTYPE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_SRV_NAMEONLY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_TIMES.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_MATCH_TIMES_EXACT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_NOTICKET.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_OPENCLOSE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TC_SUPPORTED_KTYPES.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TGS_NAME.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TGS_NAME_SIZE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TGS_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TGS_REQ.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_TKT_CREDS_STEP_FLAG_CONTINUE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/KRB5_WELLKNOWN_NAMESTR.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/LR_TYPE_INTERPRETATION_MASK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/LR_TYPE_THIS_SERVER_ONLY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/MAX_KEYTAB_NAME_LEN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/MSEC_DIRBIT.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/MSEC_VAL_MASK.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/SALT_TYPE_AFS_LENGTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/SALT_TYPE_NO_LENGTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/THREEPARAMOPEN.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_ANONYMOUS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_ENC_PA_REP.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_FORWARDABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_FORWARDED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_HW_AUTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_INITIAL.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_INVALID.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_MAY_POSTDATE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_OK_AS_DELEGATE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_POSTDATED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_PRE_AUTH.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_PROXIABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_PROXY.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_RENEWABLE.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/TKT_FLG_TRANSIT_POLICY_CHECKED.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/VALID_INT_BITS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/VALID_UINT_BITS.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/index.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb524_convert_creds_kdc.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb524_init_ets.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_const.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_component.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_name.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_set_realm.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_set_realm_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_set_realm_length.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_size.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_princ_type.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_roundup.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_x.html vendor-crypto/krb5/dist/doc/html/appdev/refs/macros/krb5_xc.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/index.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_address.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_addrtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ap_rep.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ap_rep_enc_part.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ap_req.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_auth_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_authdata.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_authdatatype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_authenticator.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_boolean.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cc_cursor.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ccache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cccol_cursor.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_checksum.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cksumtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_const_pointer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_const_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cred.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cred_enc_part.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cred_info.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_creds.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_crypto_iov.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_cryptotype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_deltat.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_enc_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_enc_kdc_rep_part.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_enc_tkt_part.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_encrypt_block.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_enctype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_error.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_error_code.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_expire_callback_func.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_flags.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_get_init_creds_opt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_gic_opt_pa_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_init_creds_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_int16.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_int32.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_kdc_rep.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_kdc_req.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_key.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_keyblock.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_keytab.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_keytab_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_keyusage.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_kt_cursor.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_kvno.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_last_req_entry.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_magic.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_mk_req_checksum_func.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_msgtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_octet.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pa_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pa_pac_req.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pa_server_referral_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pa_svr_referral_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pac.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pointer.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_post_recv_fn.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pre_send_fn.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_preauthtype.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_principal.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_principal_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_prompt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_prompt_type.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_prompter_fct.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_pwd_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_rcache.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_replay_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_responder_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_responder_fn.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_responder_otp_challenge.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_responder_otp_tokeninfo.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_responder_pkinit_challenge.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_responder_pkinit_identity.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_response.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ticket.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ticket_times.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_timestamp.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_tkt_authent.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_tkt_creds_context.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_trace_callback.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_trace_info.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_transited.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_typed_data.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ui_2.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_ui_4.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/krb5_verify_init_creds_opt.html vendor-crypto/krb5/dist/doc/html/appdev/refs/types/passwd_phrase_element.html vendor-crypto/krb5/dist/doc/html/basic/ccache_def.html vendor-crypto/krb5/dist/doc/html/basic/date_format.html vendor-crypto/krb5/dist/doc/html/basic/index.html vendor-crypto/krb5/dist/doc/html/basic/keytab_def.html vendor-crypto/krb5/dist/doc/html/basic/rcache_def.html vendor-crypto/krb5/dist/doc/html/basic/stash_file_def.html vendor-crypto/krb5/dist/doc/html/build/directory_org.html vendor-crypto/krb5/dist/doc/html/build/doing_build.html vendor-crypto/krb5/dist/doc/html/build/index.html vendor-crypto/krb5/dist/doc/html/build/options2configure.html vendor-crypto/krb5/dist/doc/html/build/osconf.html vendor-crypto/krb5/dist/doc/html/build_this.html vendor-crypto/krb5/dist/doc/html/copyright.html vendor-crypto/krb5/dist/doc/html/formats/ccache_file_format.html vendor-crypto/krb5/dist/doc/html/formats/cookie.html vendor-crypto/krb5/dist/doc/html/formats/index.html vendor-crypto/krb5/dist/doc/html/formats/keytab_file_format.html vendor-crypto/krb5/dist/doc/html/genindex-A.html vendor-crypto/krb5/dist/doc/html/genindex-C.html vendor-crypto/krb5/dist/doc/html/genindex-E.html vendor-crypto/krb5/dist/doc/html/genindex-K.html vendor-crypto/krb5/dist/doc/html/genindex-L.html vendor-crypto/krb5/dist/doc/html/genindex-M.html vendor-crypto/krb5/dist/doc/html/genindex-P.html vendor-crypto/krb5/dist/doc/html/genindex-R.html vendor-crypto/krb5/dist/doc/html/genindex-S.html vendor-crypto/krb5/dist/doc/html/genindex-T.html vendor-crypto/krb5/dist/doc/html/genindex-V.html vendor-crypto/krb5/dist/doc/html/genindex-all.html vendor-crypto/krb5/dist/doc/html/genindex.html vendor-crypto/krb5/dist/doc/html/index.html vendor-crypto/krb5/dist/doc/html/mitK5defaults.html vendor-crypto/krb5/dist/doc/html/mitK5features.html vendor-crypto/krb5/dist/doc/html/mitK5license.html vendor-crypto/krb5/dist/doc/html/objects.inv vendor-crypto/krb5/dist/doc/html/plugindev/ccselect.html vendor-crypto/krb5/dist/doc/html/plugindev/clpreauth.html vendor-crypto/krb5/dist/doc/html/plugindev/general.html vendor-crypto/krb5/dist/doc/html/plugindev/gssapi.html vendor-crypto/krb5/dist/doc/html/plugindev/hostrealm.html vendor-crypto/krb5/dist/doc/html/plugindev/index.html vendor-crypto/krb5/dist/doc/html/plugindev/internal.html vendor-crypto/krb5/dist/doc/html/plugindev/kadm5_hook.html vendor-crypto/krb5/dist/doc/html/plugindev/kdcpreauth.html vendor-crypto/krb5/dist/doc/html/plugindev/localauth.html vendor-crypto/krb5/dist/doc/html/plugindev/locate.html vendor-crypto/krb5/dist/doc/html/plugindev/profile.html vendor-crypto/krb5/dist/doc/html/plugindev/pwqual.html vendor-crypto/krb5/dist/doc/html/resources.html vendor-crypto/krb5/dist/doc/html/search.html vendor-crypto/krb5/dist/doc/html/searchindex.js vendor-crypto/krb5/dist/doc/html/user/index.html vendor-crypto/krb5/dist/doc/html/user/pwd_mgmt.html vendor-crypto/krb5/dist/doc/html/user/tkt_mgmt.html vendor-crypto/krb5/dist/doc/html/user/user_commands/index.html vendor-crypto/krb5/dist/doc/html/user/user_commands/kdestroy.html vendor-crypto/krb5/dist/doc/html/user/user_commands/kinit.html vendor-crypto/krb5/dist/doc/html/user/user_commands/klist.html vendor-crypto/krb5/dist/doc/html/user/user_commands/kpasswd.html vendor-crypto/krb5/dist/doc/html/user/user_commands/krb5-config.html vendor-crypto/krb5/dist/doc/html/user/user_commands/ksu.html vendor-crypto/krb5/dist/doc/html/user/user_commands/kswitch.html vendor-crypto/krb5/dist/doc/html/user/user_commands/kvno.html vendor-crypto/krb5/dist/doc/html/user/user_commands/sclient.html vendor-crypto/krb5/dist/doc/html/user/user_config/index.html vendor-crypto/krb5/dist/doc/html/user/user_config/k5identity.html vendor-crypto/krb5/dist/doc/html/user/user_config/k5login.html vendor-crypto/krb5/dist/doc/mitK5features.rst vendor-crypto/krb5/dist/doc/notice.rst vendor-crypto/krb5/dist/doc/pdf/admin.pdf vendor-crypto/krb5/dist/doc/pdf/admin.tex vendor-crypto/krb5/dist/doc/pdf/appdev.pdf vendor-crypto/krb5/dist/doc/pdf/appdev.tex vendor-crypto/krb5/dist/doc/pdf/basic.pdf vendor-crypto/krb5/dist/doc/pdf/basic.tex vendor-crypto/krb5/dist/doc/pdf/build.pdf vendor-crypto/krb5/dist/doc/pdf/build.tex vendor-crypto/krb5/dist/doc/pdf/plugindev.pdf vendor-crypto/krb5/dist/doc/pdf/plugindev.tex vendor-crypto/krb5/dist/doc/pdf/user.pdf vendor-crypto/krb5/dist/doc/pdf/user.tex vendor-crypto/krb5/dist/doc/plugindev/index.rst vendor-crypto/krb5/dist/src/Makefile.in vendor-crypto/krb5/dist/src/aclocal.m4 vendor-crypto/krb5/dist/src/appl/gss-sample/t_gss_sample.py vendor-crypto/krb5/dist/src/appl/simple/client/sim_client.c vendor-crypto/krb5/dist/src/appl/simple/server/sim_server.c vendor-crypto/krb5/dist/src/appl/user_user/t_user2user.py vendor-crypto/krb5/dist/src/ccapi/server/mac/ccs_os_pipe.c vendor-crypto/krb5/dist/src/clients/kcpytkt/kcpytkt.c vendor-crypto/krb5/dist/src/clients/kdeltkt/kdeltkt.c vendor-crypto/krb5/dist/src/clients/kdestroy/kdestroy.c vendor-crypto/krb5/dist/src/clients/kinit/kinit.c vendor-crypto/krb5/dist/src/clients/kinit/kinit_kdb.c vendor-crypto/krb5/dist/src/clients/klist/klist.c vendor-crypto/krb5/dist/src/clients/kpasswd/Makefile.in vendor-crypto/krb5/dist/src/clients/kpasswd/deps vendor-crypto/krb5/dist/src/clients/kpasswd/kpasswd.c vendor-crypto/krb5/dist/src/clients/ksu/ccache.c vendor-crypto/krb5/dist/src/clients/ksu/ksu.h vendor-crypto/krb5/dist/src/clients/ksu/main.c vendor-crypto/krb5/dist/src/clients/kvno/kvno.c vendor-crypto/krb5/dist/src/config/ac-archive/README vendor-crypto/krb5/dist/src/config/config.guess vendor-crypto/krb5/dist/src/config/config.sub vendor-crypto/krb5/dist/src/config/post.in vendor-crypto/krb5/dist/src/config/pre.in vendor-crypto/krb5/dist/src/configure vendor-crypto/krb5/dist/src/configure.in vendor-crypto/krb5/dist/src/include/Makefile.in vendor-crypto/krb5/dist/src/include/autoconf.h.in vendor-crypto/krb5/dist/src/include/fake-addrinfo.h vendor-crypto/krb5/dist/src/include/k5-input.h vendor-crypto/krb5/dist/src/include/k5-int.h vendor-crypto/krb5/dist/src/include/k5-platform.h vendor-crypto/krb5/dist/src/include/k5-thread.h vendor-crypto/krb5/dist/src/include/k5-trace.h vendor-crypto/krb5/dist/src/include/k5-utf8.h vendor-crypto/krb5/dist/src/include/kdb.h vendor-crypto/krb5/dist/src/include/kdb_log.h vendor-crypto/krb5/dist/src/include/krb5/kdcpreauth_plugin.h vendor-crypto/krb5/dist/src/include/krb5/krb5.hin vendor-crypto/krb5/dist/src/include/net-server.h vendor-crypto/krb5/dist/src/include/socket-utils.h vendor-crypto/krb5/dist/src/include/win-mac.h vendor-crypto/krb5/dist/src/kadmin/cli/deps vendor-crypto/krb5/dist/src/kadmin/cli/getdate.y vendor-crypto/krb5/dist/src/kadmin/cli/kadmin.c vendor-crypto/krb5/dist/src/kadmin/dbutil/dump.c vendor-crypto/krb5/dist/src/kadmin/dbutil/kdb5_mkey.c vendor-crypto/krb5/dist/src/kadmin/dbutil/tabdump.c vendor-crypto/krb5/dist/src/kadmin/ktutil/ktutil.c vendor-crypto/krb5/dist/src/kadmin/ktutil/ktutil.h vendor-crypto/krb5/dist/src/kadmin/ktutil/ktutil_funcs.c vendor-crypto/krb5/dist/src/kadmin/server/Makefile.in vendor-crypto/krb5/dist/src/kadmin/server/deps vendor-crypto/krb5/dist/src/kadmin/server/ipropd_svc.c vendor-crypto/krb5/dist/src/kadmin/server/misc.c vendor-crypto/krb5/dist/src/kadmin/server/misc.h vendor-crypto/krb5/dist/src/kadmin/server/ovsec_kadmd.c vendor-crypto/krb5/dist/src/kadmin/server/schpw.c vendor-crypto/krb5/dist/src/kadmin/server/server_stubs.c vendor-crypto/krb5/dist/src/kadmin/testing/util/tcl_kadm5.c vendor-crypto/krb5/dist/src/kdc/deps vendor-crypto/krb5/dist/src/kdc/dispatch.c vendor-crypto/krb5/dist/src/kdc/do_as_req.c vendor-crypto/krb5/dist/src/kdc/do_tgs_req.c vendor-crypto/krb5/dist/src/kdc/extern.c vendor-crypto/krb5/dist/src/kdc/fast_util.c vendor-crypto/krb5/dist/src/kdc/kdc_log.c vendor-crypto/krb5/dist/src/kdc/kdc_preauth.c vendor-crypto/krb5/dist/src/kdc/kdc_preauth_ec.c vendor-crypto/krb5/dist/src/kdc/kdc_preauth_encts.c vendor-crypto/krb5/dist/src/kdc/kdc_util.c vendor-crypto/krb5/dist/src/kdc/kdc_util.h vendor-crypto/krb5/dist/src/kdc/main.c vendor-crypto/krb5/dist/src/kdc/policy.c vendor-crypto/krb5/dist/src/kdc/policy.h vendor-crypto/krb5/dist/src/kdc/replay.c vendor-crypto/krb5/dist/src/kdc/t_emptytgt.py vendor-crypto/krb5/dist/src/kdc/t_replay.c vendor-crypto/krb5/dist/src/kdc/tgs_policy.c vendor-crypto/krb5/dist/src/lib/apputils/net-server.c vendor-crypto/krb5/dist/src/lib/apputils/udppktinfo.c vendor-crypto/krb5/dist/src/lib/apputils/udppktinfo.h vendor-crypto/krb5/dist/src/lib/crypto/builtin/des/des_int.h vendor-crypto/krb5/dist/src/lib/crypto/builtin/des/destest.c vendor-crypto/krb5/dist/src/lib/crypto/builtin/enc_provider/rc4.c vendor-crypto/krb5/dist/src/lib/crypto/builtin/sha2/sha256.c vendor-crypto/krb5/dist/src/lib/crypto/builtin/sha2/sha512.c vendor-crypto/krb5/dist/src/lib/crypto/krb/Makefile.in vendor-crypto/krb5/dist/src/lib/crypto/krb/crypto_int.h vendor-crypto/krb5/dist/src/lib/crypto/krb/enctype_util.c vendor-crypto/krb5/dist/src/lib/crypto/krb/etypes.c vendor-crypto/krb5/dist/src/lib/crypto/krb/s2k_des.c vendor-crypto/krb5/dist/src/lib/crypto/krb/s2k_pbkdf2.c vendor-crypto/krb5/dist/src/lib/crypto/krb/s2k_rc4.c vendor-crypto/krb5/dist/src/lib/crypto/krb/string_to_key.c vendor-crypto/krb5/dist/src/lib/crypto/krb/t_fortuna.c vendor-crypto/krb5/dist/src/lib/crypto/libk5crypto.exports vendor-crypto/krb5/dist/src/lib/gssapi/generic/gssapi_ext.h vendor-crypto/krb5/dist/src/lib/gssapi/generic/gssapi_generic.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/accept_sec_context.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/acquire_cred.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/context_time.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/copy_ccache.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/export_cred.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/gssapiP_krb5.h vendor-crypto/krb5/dist/src/lib/gssapi/krb5/gssapi_krb5.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/gssapi_krb5.h vendor-crypto/krb5/dist/src/lib/gssapi/krb5/iakerb.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/init_sec_context.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/inq_context.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/inq_cred.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/k5sealv3.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/k5unseal.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/naming_exts.c vendor-crypto/krb5/dist/src/lib/gssapi/krb5/s4u_gss_glue.c vendor-crypto/krb5/dist/src/lib/gssapi/libgssapi_krb5.exports vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_accept_sec_context.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_complete_auth_token.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_context_time.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_delete_sec_context.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_dup_name.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_exp_sec_context.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_glue.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_init_sec_context.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_inq_context.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_inq_cred_oid.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_prf.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_process_context.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_seal.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_sign.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_unseal.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_unwrap_aead.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_unwrap_iov.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_verify.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_wrap_aead.c vendor-crypto/krb5/dist/src/lib/gssapi/mechglue/g_wrap_iov.c vendor-crypto/krb5/dist/src/lib/gssapi32.def vendor-crypto/krb5/dist/src/lib/kadm5/chpass_util.c vendor-crypto/krb5/dist/src/lib/kadm5/deps vendor-crypto/krb5/dist/src/lib/kadm5/kadm_err.et vendor-crypto/krb5/dist/src/lib/kadm5/srv/Makefile.in vendor-crypto/krb5/dist/src/lib/kadm5/srv/deps vendor-crypto/krb5/dist/src/lib/kadm5/srv/libkadm5srv_mit.exports vendor-crypto/krb5/dist/src/lib/kadm5/srv/server_kdb.c vendor-crypto/krb5/dist/src/lib/kadm5/srv/server_misc.c vendor-crypto/krb5/dist/src/lib/kadm5/srv/svr_principal.c vendor-crypto/krb5/dist/src/lib/kadm5/unit-test/setkey-test.c vendor-crypto/krb5/dist/src/lib/kdb/Makefile.in vendor-crypto/krb5/dist/src/lib/kdb/deps vendor-crypto/krb5/dist/src/lib/kdb/kdb5.c vendor-crypto/krb5/dist/src/lib/kdb/kdb_convert.c vendor-crypto/krb5/dist/src/lib/kdb/kdb_default.c vendor-crypto/krb5/dist/src/lib/kdb/t_sort_key_data.c vendor-crypto/krb5/dist/src/lib/krb5/asn.1/asn1_k_encode.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/Makefile.in vendor-crypto/krb5/dist/src/lib/krb5/ccache/cc-int.h vendor-crypto/krb5/dist/src/lib/krb5/ccache/cc_kcm.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/cc_keyring.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/cc_memory.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/cc_mslsa.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/cc_retr.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/ccapi/stdcc_util.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/cccursor.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/ccmarshal.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/ccselect.c vendor-crypto/krb5/dist/src/lib/krb5/ccache/deps vendor-crypto/krb5/dist/src/lib/krb5/keytab/kt_file.c vendor-crypto/krb5/dist/src/lib/krb5/keytab/kt_memory.c vendor-crypto/krb5/dist/src/lib/krb5/keytab/kt_srvtab.c vendor-crypto/krb5/dist/src/lib/krb5/krb/Makefile.in vendor-crypto/krb5/dist/src/lib/krb5/krb/deltat.c vendor-crypto/krb5/dist/src/lib/krb5/krb/deps vendor-crypto/krb5/dist/src/lib/krb5/krb/fwd_tgt.c vendor-crypto/krb5/dist/src/lib/krb5/krb/gc_via_tkt.c vendor-crypto/krb5/dist/src/lib/krb5/krb/gen_save_subkey.c vendor-crypto/krb5/dist/src/lib/krb5/krb/get_creds.c vendor-crypto/krb5/dist/src/lib/krb5/krb/get_in_tkt.c vendor-crypto/krb5/dist/src/lib/krb5/krb/gic_opt.c vendor-crypto/krb5/dist/src/lib/krb5/krb/gic_pwd.c vendor-crypto/krb5/dist/src/lib/krb5/krb/init_creds_ctx.h vendor-crypto/krb5/dist/src/lib/krb5/krb/init_ctx.c vendor-crypto/krb5/dist/src/lib/krb5/krb/int-proto.h vendor-crypto/krb5/dist/src/lib/krb5/krb/mk_req.c vendor-crypto/krb5/dist/src/lib/krb5/krb/pac.c vendor-crypto/krb5/dist/src/lib/krb5/krb/pac_sign.c vendor-crypto/krb5/dist/src/lib/krb5/krb/plugin.c vendor-crypto/krb5/dist/src/lib/krb5/krb/preauth2.c vendor-crypto/krb5/dist/src/lib/krb5/krb/preauth_ec.c vendor-crypto/krb5/dist/src/lib/krb5/krb/send_tgs.c vendor-crypto/krb5/dist/src/lib/krb5/krb/sendauth.c vendor-crypto/krb5/dist/src/lib/krb5/krb/str_conv.c vendor-crypto/krb5/dist/src/lib/krb5/krb/t_expire_warn.py vendor-crypto/krb5/dist/src/lib/krb5/krb/t_kerb.c vendor-crypto/krb5/dist/src/lib/krb5/krb/t_parse_host_string.c vendor-crypto/krb5/dist/src/lib/krb5/krb/valid_times.c vendor-crypto/krb5/dist/src/lib/krb5/krb/vfy_increds.c vendor-crypto/krb5/dist/src/lib/krb5/krb/x-deltat.y vendor-crypto/krb5/dist/src/lib/krb5/os/Makefile.in vendor-crypto/krb5/dist/src/lib/krb5/os/accessor.c vendor-crypto/krb5/dist/src/lib/krb5/os/c_ustime.c vendor-crypto/krb5/dist/src/lib/krb5/os/dnsglue.c vendor-crypto/krb5/dist/src/lib/krb5/os/dnsglue.h vendor-crypto/krb5/dist/src/lib/krb5/os/dnssrv.c vendor-crypto/krb5/dist/src/lib/krb5/os/expand_path.c vendor-crypto/krb5/dist/src/lib/krb5/os/genaddrs.c vendor-crypto/krb5/dist/src/lib/krb5/os/hostaddr.c vendor-crypto/krb5/dist/src/lib/krb5/os/localaddr.c vendor-crypto/krb5/dist/src/lib/krb5/os/locate_kdc.c vendor-crypto/krb5/dist/src/lib/krb5/os/sendto_kdc.c vendor-crypto/krb5/dist/src/lib/krb5/os/t_locate_kdc.c vendor-crypto/krb5/dist/src/lib/krb5/os/timeofday.c vendor-crypto/krb5/dist/src/lib/krb5/os/toffset.c vendor-crypto/krb5/dist/src/lib/krb5/os/trace.c vendor-crypto/krb5/dist/src/lib/krb5/os/ustime.c vendor-crypto/krb5/dist/src/lib/krb5/rcache/rc_dfl.c vendor-crypto/krb5/dist/src/lib/krb5/rcache/ser_rc.c vendor-crypto/krb5/dist/src/lib/krb5/rcache/t_replay.c vendor-crypto/krb5/dist/src/lib/krb5/unicode/ure/ure.c vendor-crypto/krb5/dist/src/lib/krb5_32.def vendor-crypto/krb5/dist/src/lib/rpc/deps vendor-crypto/krb5/dist/src/lib/rpc/pmap_rmt.c vendor-crypto/krb5/dist/src/man/k5identity.man vendor-crypto/krb5/dist/src/man/k5login.man vendor-crypto/krb5/dist/src/man/k5srvutil.man vendor-crypto/krb5/dist/src/man/kadm5.acl.man vendor-crypto/krb5/dist/src/man/kadmin.man vendor-crypto/krb5/dist/src/man/kadmind.man vendor-crypto/krb5/dist/src/man/kdb5_ldap_util.man vendor-crypto/krb5/dist/src/man/kdb5_util.man vendor-crypto/krb5/dist/src/man/kdc.conf.man vendor-crypto/krb5/dist/src/man/kdestroy.man vendor-crypto/krb5/dist/src/man/kinit.man vendor-crypto/krb5/dist/src/man/klist.man vendor-crypto/krb5/dist/src/man/kpasswd.man vendor-crypto/krb5/dist/src/man/kprop.man vendor-crypto/krb5/dist/src/man/kpropd.man vendor-crypto/krb5/dist/src/man/kproplog.man vendor-crypto/krb5/dist/src/man/krb5-config.man vendor-crypto/krb5/dist/src/man/krb5.conf.man vendor-crypto/krb5/dist/src/man/krb5kdc.man vendor-crypto/krb5/dist/src/man/ksu.man vendor-crypto/krb5/dist/src/man/kswitch.man vendor-crypto/krb5/dist/src/man/ktutil.man vendor-crypto/krb5/dist/src/man/kvno.man vendor-crypto/krb5/dist/src/man/sclient.man vendor-crypto/krb5/dist/src/man/sserver.man vendor-crypto/krb5/dist/src/patchlevel.h vendor-crypto/krb5/dist/src/plugins/audit/kdc_j_encode.c vendor-crypto/krb5/dist/src/plugins/kdb/db2/db2_exp.c vendor-crypto/krb5/dist/src/plugins/kdb/db2/kdb_db2.c vendor-crypto/krb5/dist/src/plugins/kdb/db2/kdb_db2.h vendor-crypto/krb5/dist/src/plugins/kdb/db2/libdb2/hash/hash.c vendor-crypto/krb5/dist/src/plugins/kdb/db2/lockout.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/ldap_handle.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/ldap_tkt_policy.c vendor-crypto/krb5/dist/src/plugins/kdb/ldap/libkdb_ldap/lockout.c vendor-crypto/krb5/dist/src/plugins/preauth/otp/main.c vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/Makefile.in vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/deps vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit.h vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_clnt.c vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_crypto.h vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_crypto_openssl.h vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_identity.c vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_matching.c vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_srv.c vendor-crypto/krb5/dist/src/plugins/preauth/pkinit/pkinit_trace.h vendor-crypto/krb5/dist/src/plugins/preauth/test/Makefile.in vendor-crypto/krb5/dist/src/plugins/preauth/test/cltest.c vendor-crypto/krb5/dist/src/plugins/preauth/test/deps vendor-crypto/krb5/dist/src/plugins/preauth/test/kdctest.c vendor-crypto/krb5/dist/src/po/Makefile.in vendor-crypto/krb5/dist/src/po/mit-krb5.pot vendor-crypto/krb5/dist/src/slave/kprop.c vendor-crypto/krb5/dist/src/slave/kprop_util.c vendor-crypto/krb5/dist/src/slave/kpropd.c vendor-crypto/krb5/dist/src/tests/Makefile.in vendor-crypto/krb5/dist/src/tests/create/kdb5_mkdums.c vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/ca.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/kdc.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/make-certs.sh vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/privkey-enc.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/privkey.pem vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user-enc.p12 vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user.p12 vendor-crypto/krb5/dist/src/tests/dejagnu/pkinit-certs/user.pem vendor-crypto/krb5/dist/src/tests/deps vendor-crypto/krb5/dist/src/tests/gssapi/Makefile.in vendor-crypto/krb5/dist/src/tests/gssapi/deps vendor-crypto/krb5/dist/src/tests/gssapi/t_authind.py vendor-crypto/krb5/dist/src/tests/gssapi/t_ccselect.py vendor-crypto/krb5/dist/src/tests/gssapi/t_client_keytab.py vendor-crypto/krb5/dist/src/tests/gssapi/t_enctypes.c vendor-crypto/krb5/dist/src/tests/gssapi/t_enctypes.py vendor-crypto/krb5/dist/src/tests/gssapi/t_export_cred.py vendor-crypto/krb5/dist/src/tests/gssapi/t_gssapi.py vendor-crypto/krb5/dist/src/tests/gssapi/t_invalid.c vendor-crypto/krb5/dist/src/tests/gssapi/t_s4u.c vendor-crypto/krb5/dist/src/tests/gssapi/t_s4u.py vendor-crypto/krb5/dist/src/tests/hammer/kdc5_hammer.c vendor-crypto/krb5/dist/src/tests/icred.c vendor-crypto/krb5/dist/src/tests/kdbtest.c vendor-crypto/krb5/dist/src/tests/responder.c vendor-crypto/krb5/dist/src/tests/t_audit.py vendor-crypto/krb5/dist/src/tests/t_authdata.py vendor-crypto/krb5/dist/src/tests/t_ccache.py vendor-crypto/krb5/dist/src/tests/t_crossrealm.py vendor-crypto/krb5/dist/src/tests/t_dump.py vendor-crypto/krb5/dist/src/tests/t_general.py vendor-crypto/krb5/dist/src/tests/t_hostrealm.py vendor-crypto/krb5/dist/src/tests/t_iprop.py vendor-crypto/krb5/dist/src/tests/t_kadm5_hook.py vendor-crypto/krb5/dist/src/tests/t_kadmin_acl.py vendor-crypto/krb5/dist/src/tests/t_kadmin_parsing.py vendor-crypto/krb5/dist/src/tests/t_kdb.py vendor-crypto/krb5/dist/src/tests/t_kdb_locking.py vendor-crypto/krb5/dist/src/tests/t_keydata.py vendor-crypto/krb5/dist/src/tests/t_keyrollover.py vendor-crypto/krb5/dist/src/tests/t_keytab.py vendor-crypto/krb5/dist/src/tests/t_kprop.py vendor-crypto/krb5/dist/src/tests/t_localauth.py vendor-crypto/krb5/dist/src/tests/t_mkey.py vendor-crypto/krb5/dist/src/tests/t_otp.py vendor-crypto/krb5/dist/src/tests/t_pkinit.py vendor-crypto/krb5/dist/src/tests/t_policy.py vendor-crypto/krb5/dist/src/tests/t_preauth.py vendor-crypto/krb5/dist/src/tests/t_pwqual.py vendor-crypto/krb5/dist/src/tests/t_referral.py vendor-crypto/krb5/dist/src/tests/t_renew.py vendor-crypto/krb5/dist/src/tests/t_salt.py vendor-crypto/krb5/dist/src/tests/t_skew.py vendor-crypto/krb5/dist/src/tests/t_stringattr.py vendor-crypto/krb5/dist/src/util/depfix.pl vendor-crypto/krb5/dist/src/util/k5test.py vendor-crypto/krb5/dist/src/util/profile/prof_parse.c vendor-crypto/krb5/dist/src/util/profile/profile_tcl.c vendor-crypto/krb5/dist/src/util/ss/data.c vendor-crypto/krb5/dist/src/util/support/Makefile.in vendor-crypto/krb5/dist/src/util/support/cache-addrinfo.h vendor-crypto/krb5/dist/src/util/support/deps vendor-crypto/krb5/dist/src/util/support/fake-addrinfo.c vendor-crypto/krb5/dist/src/util/support/gmt_mktime.c vendor-crypto/krb5/dist/src/util/support/libkrb5support-fixed.exports vendor-crypto/krb5/dist/src/util/support/plugins.c vendor-crypto/krb5/dist/src/util/support/threads.c vendor-crypto/krb5/dist/src/util/support/utf8.c vendor-crypto/krb5/dist/src/util/support/utf8_conv.c vendor-crypto/krb5/dist/src/util/verto/README vendor-crypto/krb5/dist/src/util/verto/libverto.exports vendor-crypto/krb5/dist/src/util/verto/verto-k5ev.c vendor-crypto/krb5/dist/src/util/verto/verto-libev.c vendor-crypto/krb5/dist/src/util/verto/verto.c vendor-crypto/krb5/dist/src/util/verto/verto.h vendor-crypto/krb5/dist/src/windows/cns/tktlist.c vendor-crypto/krb5/dist/src/windows/include/leashwin.h vendor-crypto/krb5/dist/src/windows/leash/KrbListTickets.cpp vendor-crypto/krb5/dist/src/windows/leash/LeashView.cpp vendor-crypto/krb5/dist/src/windows/leashdll/lshfunc.c vendor-crypto/krb5/dist/src/windows/ms2mit/ms2mit.c Added: vendor-crypto/krb5/dist/.travis.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-crypto/krb5/dist/.travis.yml Tue Apr 3 19:36:00 2018 (r331939) @@ -0,0 +1,26 @@ +language: c++ + +sudo: required + +dist: xenial + +matrix: + include: + - compiler: clang + env: MAKEVARS=CPPFLAGS=-Werror + - compiler: gcc + +before_install: + - sudo apt-get update -qq + - sudo apt-get install -y bison dejagnu gettext keyutils ldap-utils libldap2-dev libkeyutils-dev libssl-dev python-cjson python-paste python-pyrad slapd tcl-dev tcsh + - mkdir -p cmocka/build + - cd cmocka + - wget https://cmocka.org/files/1.1/cmocka-1.1.1.tar.xz + - tar -xvf cmocka-1.1.1.tar.xz + - cd build + - cmake ../cmocka-1.1.1 -DCMAKE_INSTALL_PREFIX=/usr + - make + - sudo make install + - cd ../.. + +script: cd src && autoreconf && ./configure --enable-maintainer-mode --with-ldap && make $MAKEVARS && make check Modified: vendor-crypto/krb5/dist/NOTICE ============================================================================== --- vendor-crypto/krb5/dist/NOTICE Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/NOTICE Tue Apr 3 19:36:00 2018 (r331939) @@ -583,7 +583,7 @@ Marked test programs in src/lib/krb5/krb have the foll ====================================================================== -The KCM Mach RPC definition file used on OS X has the following +The KCM Mach RPC definition file used on macOS has the following copyright: Copyright (C) 2009 Kungliga Tekniska Högskola Modified: vendor-crypto/krb5/dist/README ============================================================================== --- vendor-crypto/krb5/dist/README Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/README Tue Apr 3 19:36:00 2018 (r331939) @@ -1,4 +1,4 @@ - Kerberos Version 5, Release 1.15 + Kerberos Version 5, Release 1.16 Release Notes The MIT Kerberos Team @@ -73,193 +73,150 @@ from using single-DES cryptosystems. Among these is a variable that enables "weak" enctypes, which defaults to "false" beginning with krb5-1.8. -Major changes in 1.15.1 (2017-03-01) ------------------------------------- +Major changes in 1.16 (2017-12-05) +---------------------------------- -This is a bug fix release. +Administrator experience: -* Allow KDB modules to determine how the e_data field of principal - fields is freed +* The KDC can match PKINIT client certificates against the + "pkinit_cert_match" string attribute on the client principal entry, + using the same syntax as the existing "pkinit_cert_match" profile + option. -* Fix udp_preference_limit when the KDC location is configured with - SRV records +* The ktutil addent command supports the "-k 0" option to ignore the + key version, and the "-s" option to use a non-default salt string. -* Fix KDC and kadmind startup on some IPv4-only systems +* kpropd supports a --pid-file option to write a pid file at startup, + when it is run in standalone mode. -* Fix the processing of PKINIT certificate matching rules which have - two components and no explicit relation +* The "encrypted_challenge_indicator" realm option can be used to + attach an authentication indicator to tickets obtained using FAST + encrypted challenge pre-authentication. -* Improve documentation +* Localization support can be disabled at build time with the + --disable-nls configure option. -krb5-1.15.1 changes by ticket ID --------------------------------- +Developer experience: -7940 PKINIT docs only work for one-component client principals -8523 Add krbPwdPolicy attributes to kerberos.ldif -8524 Add caveats to krbtgt change documentation -8525 Fix error handling in PKINIT decode_data() -8530 KDC/kadmind explicit wildcard listener addresses do not use pktinfo -8531 KDC/kadmind may fail to start on IPv4-only systems -8532 Fix GSSAPI authind attribute name in docs -8538 Need a way to free KDB module e_data -8540 Document default realm and login authorization -8552 Add GSSAPI S4U documentation -8553 Fix PKINIT two-component matching rule parsing -8554 udp_preference_limit fails with SRV records +* The kdcpolicy pluggable interface allows modules control whether + tickets are issued by the KDC. +* The kadm5_auth pluggable interface allows modules to control whether + kadmind grants access to a kadmin request. -Major changes in 1.15 (2016-12-01) ----------------------------------- +* The certauth pluggable interface allows modules to control which + PKINIT client certificates can authenticate to which client + principals. -Administrator experience: +* KDB modules can use the client and KDC interface IP addresses to + determine whether to allow an AS request. -* Improve support for multihomed Kerberos servers by adding options - for specifying restricted listening addresses for the KDC and - kadmind. +* GSS applications can query the bit strength of a krb5 GSS context + using the GSS_C_SEC_CONTEXT_SASL_SSF OID with + gss_inquire_sec_context_by_oid(). -* Add support to kadmin for remote extraction of current keys without - changing them (requires a special kadmin permission that is excluded - from the wildcard permission), with the exception of highly - protected keys. +* GSS applications can query the impersonator name of a krb5 GSS + credential using the GSS_KRB5_GET_CRED_IMPERSONATOR OID with + gss_inquire_cred_by_oid(). -* Add a lockdown_keys principal attribute to prevent retrieval of the - principal's keys (old or new) via the kadmin protocol. In newly - created databases, this attribute is set on the krbtgt and kadmin - principals. +* kdcpreauth modules can query the KDC for the canonicalized requested + client principal name, or match a principal name against the + requested client principal name with canonicalization. -* Restore recursive dump capability for DB2 back end, so sites can - more easily recover from database corruption resulting from power - failure events. +Protocol evolution: -* Add DNS auto-discovery of KDC and kpasswd servers from URI records, - in addition to SRV records. URI records can convey TCP and UDP - servers and master KDC status in a single DNS lookup, and can also - point to HTTPS proxy servers. +* The client library will continue to try pre-authentication + mechanisms after most failure conditions. -* Add support for password history to the LDAP back end. +* The KDC will issue trivially renewable tickets (where the renewable + lifetime is equal to or less than the ticket lifetime) if requested + by the client, to be friendlier to scripts. -* Add support for principal renaming to the LDAP back end. +* The client library will use a random nonce for TGS requests instead + of the current system time. -* Use the getrandom system call on supported Linux kernels to avoid - blocking problems when getting entropy from the operating system. +* For the RC4 string-to-key or PAC operations, UTF-16 is supported + (previously only UCS-2 was supported). -* In the PKINIT client, use the correct DigestInfo encoding for PKCS - #1 signatures, so that some especially strict smart cards will work. +* When matching PKINIT client certificates, UPN SANs will be matched + correctly as UPNs, with canonicalization. -Code quality: +User experience: -* Clean up numerous compilation warnings. +* Dates after the year 2038 are accepted (provided that the platform + time facilities support them), through the year 2106. -* Remove various infrequently built modules, including some preauth - modules that were not built by default. +* Automatic credential cache selection based on the client realm will + take into account the fallback realm and the service hostname. -Developer experience: +* Referral and alternate cross-realm TGTs will not be cached, avoiding + some scenarios where they can be added to the credential cache + multiple times. -* Add support for building with OpenSSL 1.1. +* A German translation has been added. -* Use SHA-256 instead of MD5 for (non-cryptographic) hashing of - authenticators in the replay cache. This helps sites that must - build with FIPS 140 conformant libraries that lack MD5. +Code quality: -* Eliminate util/reconf and allow the use of autoreconf alone to - regenerate the configure script. +* The build is warning-clean under clang with the configured warning + options. -Protocol evolution: +* The automated test suite runs cleanly under AddressSanitizer. -* Add support for the AES-SHA2 enctypes, which allows sites to conform - to Suite B crypto requirements. - -krb5-1.15 changes by ticket ID +krb5-1.16 changes by ticket ID ------------------------------ -1093 KDC could use feature to limit listening interfaces -5889 password history doesn't work with LDAP KDB -6666 some non-default plugin directories don't build in 1.8 branch -7852 kadmin.local's ktadd -norandkey does not handle multiple kvnos - in the KDB -7985 Add krb5_get_init_creds_opt_set_pac_request -8065 Renaming principals with LDAP KDB deletes the principal -8277 iprop can choose wrong realm -8278 Add krb5_expand_hostname() API -8280 Fix impersonate_name to work with interposers -8295 kdb5_ldap_stash_service_password() stash file logic needs tweaking -8297 jsonwalker.py test fails -8298 Audit Test fails when system has IPV6 address -8299 Remove util/reconf -8329 Only run export-check.pl in maintainer mode -8344 Create KDC and kadmind log files with mode 0640 -8345 Remove nss libk5crypto implementation -8348 Remove workaround when binding to udp addresses and pktinfo - isn't supported by the system -8353 Replace MD5 use in rcache with SHA-256 -8354 Only store latest keys in key history entry -8355 Add kadm5_setkey_principal_4 RPC to kadmin -8364 Add get_principal_keys RPC to kadmin -8365 Add the ability to lock down principal keys -8366 Increase initial DNS buffer size -8368 Remove hdb KDB module -8371 Improve libkadm5 client RPC thread safety -8372 Use cached S4U2Proxy tickets in GSSAPI -8374 Interoperate with incomplete SPNEGO responses -8375 Allow zero cksumtype in krb5_k_verify_checksum() -8379 Add auth indicator handling to libkdb_ldap -8381 Don't fall back to master on password read error -8386 Add KDC pre-send and post-receive KDC hooks -8388 Remove port 750 from the KDC default ports -8389 Make profile includedir accept all *.conf files -8391 Add kinit long option support for all platforms -8393 Password Expiration "Never" Inconsistently Applied -8394 Add debug message filtering to krb5_klog_syslog -8396 Skip password prompt when running ksu as root -8398 Add libk5crypto support for OpenSSL 1.1.0 -8399 Unconstify some krb5 GSS OIDs -8403 kinit documentation page -8404 Remove non-DFSG documentation -8405 Work around python-ldap bug in kerberos.ldif -8412 Link correct VS2015 C libraries for debug builds -8414 Use library malloc for principal, policy entries -8418 Add libkdb function to specialize principal's salt -8419 Do not indicate deprecated GSS mechanisms -8423 Add SPNEGO special case for NTLMSSP+MechListMIC -8425 Add auth-indicator authdata module -8426 test_check_allowed_to_delegate() should free unparsed princ output -8428 Minimize timing leaks in PKINIT decryption -8429 Fix Makefile for paths containing '+' character -8434 Fix memory leak in old gssrpc authentication -8436 Update libev sources to 4.22 -8446 Fix leak in key change operations -8451 Add hints for -A flag to kdestroy -8456 Add the kprop-port option to kadmind -8462 Better handle failures to resolve client keytab -8464 Set prompt type for OTP preauth prompt -8465 Improve bad password inference in kinit -8466 Rename k5-queue.h macros -8471 Change KDC error for encrypted timestamp preauth -8476 Restore recursive dump functionality -8478 usability improvements for bttest -8488 Stop generating doc/CHANGES -8490 Add aes-sha2 enctype support -8494 Add krb5_db_register_keytab() -8496 Add KDC discovery from URI records -8498 Potential memory leak in prepare_error_as() -8499 Use getrandom system call on recent Linux kernels -8500 Document krb5_kt_next_entry() requirement -8502 ret_boolean in profile_get_boolean() should be krb5_boolean * - instead of int * -8504 Properly handle EOF condition on libkrad sockets -8506 PKINIT fails with PKCS#11 middlware that implements PKCS#1 V2.1 -8507 Suggest unlocked iteration for mkey rollover -8508 Clarify krb5_kt_resolve() API documentation -8509 Leak in krb5_cccol_have_content with truncated ccache -8510 Update features list for 1.15 -8512 Fix detection of libaceclnt for securid_sam2 -8513 Add doxygen comments for RFC 8009, RFC 4757 -8514 Make zap() more reliable -8516 Fix declaration without type in t_shs3.c -8520 Relicense ccapi/common/win/OldCC/autolock.hxx -8521 Allow slapd path configuration in t_kdb.py +3349 Allow keytab entries to ignore the key version +7647 let ktutil support non-default salts +7877 Interleaved init_creds operations use same per-request preauth context +8352 Year 2038 fixes +8515 Add German translation +8517 Add KRB5_TRACE calls for DNS lookups +8518 Remove redeclaration of ttyname() in ksu +8526 Constify service and hostname in krb5_mk_req() +8527 Clean up memory handling in krb5_fwd_tgt_creds() +8528 Improve PKINIT UPN SAN matching +8529 Add OpenLDAP LDIF file for Kerberos schema +8533 Bug in src/tests/responder.c +8534 Add configure option to disable nls support +8537 Preauthentication should continue after failure +8539 Preauth tryagain should copy KDC cookie +8544 Wrong PKCS11 PIN can trigger PKINIT draft9 code +8548 Add OID to inquire GSS cred impersonator name +8549 Use fallback realm for GSSAPI ccache selection +8558 kvno memory leak (1.15.1) +8561 Add certauth pluggable interface +8562 Add the certauth dbmatch module +8568 Convert some pkiDebug messages to TRACE macros +8569 Add support to query the SSF of a GSS context +8570 Add the client_name() kdcpreauth callback +8571 Use the canonical client principal name for OTP +8572 Un-deprecate krb5_auth_con_initivector() +8575 Add FAST encrypted challenge auth indicator +8577 Replace UCS-2 conversions with UTF-16 +8578 Add various bound checks +8579 duplicate caching of some cross-realm TGTs +8582 Use a random nonce in TGS requests +8583 Pass client address to DAL audit_as_req +8592 Parse all kadm5.acl fields at startup +8595 Pluggable interface for kadmin authorization +8597 acx_pthread.m4 needs to be updated +8602 Make ccache name work for klist/kdestroy -A +8603 Remove incomplete PKINIT OCSP support +8606 Add KDC policy pluggable interface +8607 kpropd should write a pidfile when started in standalone mode... +8608 Fix AIX build issues +8609 Renewed tickets can be marked renewable with no renewable endtime +8610 Don't set ctime in KDC error replies +8612 Bump bundled libverto for 0.3.0 release +8613 Add hostname-based ccselect module +8615 Abort client preauth on keyboard interrupt +8616 Fix default enctype order in docs +8617 PKINIT matching can crash for certs with long issuer and subject +8620 Length check when parsing GSS token encapsulation +8621 Expose context errors in pkinit_server_plugin_init +8623 Update features list for 1.16 +8624 Update config.guess, config.sub - Acknowledgements ---------------- @@ -349,7 +306,7 @@ Past and present members of the Kerberos Team at MIT: Zhanna Tsitkova Ted Ts'o Marshall Vale - Tom Yu + Taylor Yu The following external contributors have provided code, patches, bug reports, suggestions, and valuable resources: @@ -372,7 +329,9 @@ reports, suggestions, and valuable resources: Radoslav Bodo Sumit Bose Emmanuel Bouillon + Isaac Boukris Philip Brown + Samuel Cabrero Michael Calmer Andrea Campi Julien Chaffraix @@ -396,7 +355,9 @@ reports, suggestions, and valuable resources: Mark Deneen Günther Deschner John Devitofranceschi + Marc Dionne Roland Dowdeswell + Dorian Ducournau Viktor Dukhovni Jason Edgecombe Mark Eichin @@ -421,6 +382,7 @@ reports, suggestions, and valuable resources: Philip Guenther Dominic Hargreaves Robbie Harwood + John Hascall Jakob Haufe Matthieu Hautreux Jochen Hein @@ -441,18 +403,25 @@ reports, suggestions, and valuable resources: Pavel Jindra Brian Johannesmeyer Joel Johnson + Alexander Karaivanov Anders Kaseorg + Bar Katz + Zentaro Kavanagh + Mubashir Kazia W. Trevor King Patrik Kis + Martin Kittel Mikkel Kruse Reinhard Kugler Tomas Kuthan Pierre Labastie + Chris Leick Volker Lendecke Jan iankko Lieskovsky Todd Lipcon Oliver Loch Kevin Longfellow + Frank Lonigro Jon Looney Nuno Lopes Ryan Lynch @@ -486,6 +455,7 @@ reports, suggestions, and valuable resources: Jonathan Reams Jonathan Reed Robert Relyea + Tony Reix Martin Rex Jason Rogers Matt Rogers @@ -493,10 +463,13 @@ reports, suggestions, and valuable resources: Solly Ross Mike Roszkowski Guillaume Rousse + Joshua Schaeffer Andreas Schneider Tom Shaw Jim Shi Peter Shoults + Richard Silverman + Cel Skeggs Simo Sorce Michael Spang Michael Ströder Modified: vendor-crypto/krb5/dist/doc/admin/admin_commands/kadmin_local.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/admin_commands/kadmin_local.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/admin_commands/kadmin_local.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -661,6 +661,13 @@ KDC: *principal*. The *value* is a JSON string representing an array of objects, each having optional ``type`` and ``username`` fields. +**pkinit_cert_match** + Specifies a matching expression that defines the certificate + attributes required for the client certificate used by the + principal during PKINIT authentication. The matching expression + is in the same format as those used by the **pkinit_cert_match** + option in :ref:`krb5.conf(5)`. (New in release 1.16.) + This command requires the **modify** privilege. Alias: **setstr** Modified: vendor-crypto/krb5/dist/doc/admin/admin_commands/kpropd.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/admin_commands/kpropd.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/admin_commands/kpropd.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -14,6 +14,7 @@ SYNOPSIS [**-F** *principal_database*] [**-p** *kdb5_util_prog*] [**-P** *port*] +[**--pid-file**\ =\ *pid_file*] [**-d**] [**-t**] @@ -103,6 +104,10 @@ OPTIONS **-a** *acl_file* Allows the user to specify the path to the kpropd.acl file; by default the path used is |kdcdir|\ ``/kpropd.acl``. + +**--pid-file**\ =\ *pid_file* + In standalone mode, write the process ID of the daemon into + *pid_file*. ENVIRONMENT Modified: vendor-crypto/krb5/dist/doc/admin/admin_commands/ktutil.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/admin_commands/ktutil.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/admin_commands/ktutil.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -87,7 +87,7 @@ add_entry ~~~~~~~~~ **add_entry** {**-key**\|\ **-password**} **-p** *principal* - **-k** *kvno* **-e** *enctype* + **-k** *kvno* **-e** *enctype* [**-s** *salt*] Add *principal* to keylist using key or password. Modified: vendor-crypto/krb5/dist/doc/admin/conf_files/kadm5_acl.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/conf_files/kadm5_acl.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/conf_files/kadm5_acl.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -116,16 +116,17 @@ Here is an example of a kadm5.acl file:: */root@ATHENA.MIT.EDU l * # line 5 sms@ATHENA.MIT.EDU x * -maxlife 9h -postdateable # line 6 -(line 1) Any principal in the ``ATHENA.MIT.EDU`` realm with -an ``admin`` instance has all administrative privileges. +(line 1) Any principal in the ``ATHENA.MIT.EDU`` realm with an +``admin`` instance has all administrative privileges except extracting +keys. -(lines 1-3) The user ``joeadmin`` has all permissions with his -``admin`` instance, ``joeadmin/admin@ATHENA.MIT.EDU`` (matches line -1). He has no permissions at all with his null instance, -``joeadmin@ATHENA.MIT.EDU`` (matches line 2). His ``root`` and other -non-``admin``, non-null instances (e.g., ``extra`` or ``dbadmin``) have -inquire permissions with any principal that has the instance ``root`` -(matches line 3). +(lines 1-3) The user ``joeadmin`` has all permissions except +extracting keys with his ``admin`` instance, +``joeadmin/admin@ATHENA.MIT.EDU`` (matches line 1). He has no +permissions at all with his null instance, ``joeadmin@ATHENA.MIT.EDU`` +(matches line 2). His ``root`` and other non-``admin``, non-null +instances (e.g., ``extra`` or ``dbadmin``) have inquire permissions +with any principal that has the instance ``root`` (matches line 3). (line 4) Any ``root`` principal in ``ATHENA.MIT.EDU`` can inquire or change the password of their null instance, but not any other @@ -139,9 +140,22 @@ permission can only be granted globally, not to specif principals. (line 6) Finally, the Service Management System principal -``sms@ATHENA.MIT.EDU`` has all permissions, but any principal that it -creates or modifies will not be able to get postdateable tickets or -tickets with a life of longer than 9 hours. +``sms@ATHENA.MIT.EDU`` has all permissions except extracting keys, but +any principal that it creates or modifies will not be able to get +postdateable tickets or tickets with a life of longer than 9 hours. + +MODULE BEHAVIOR +--------------- + +The ACL file can coexist with other authorization modules in release +1.16 and later, as configured in the :ref:`kadm5_auth` section of +:ref:`krb5.conf(5)`. The ACL file will positively authorize +operations according to the rules above, but will never +authoritatively deny an operation, so other modules can authorize +operations in addition to those authorized by the ACL file. + +To operate without an ACL file, set the *acl_file* variable in +:ref:`kdc.conf(5)` to the empty string with ``acl_file = ""``. SEE ALSO -------- Modified: vendor-crypto/krb5/dist/doc/admin/conf_files/kdc_conf.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/conf_files/kdc_conf.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/conf_files/kdc_conf.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -86,9 +86,10 @@ The following tags may be specified in a [realms] subs **acl_file** (String.) Location of the access control list file that :ref:`kadmind(8)` uses to determine which principals are allowed - which permissions on the Kerberos database. The default value is - |kdcdir|\ ``/kadm5.acl``. For more information on Kerberos ACL - file see :ref:`kadm5.acl(5)`. + which permissions on the Kerberos database. To operate without an + ACL file, set this relation to the empty string with ``acl_file = + ""``. The default value is |kdcdir|\ ``/kadm5.acl``. For more + information on Kerberos ACL file see :ref:`kadm5.acl(5)`. **database_module** (String.) This relation indicates the name of the configuration @@ -198,6 +199,11 @@ The following tags may be specified in a [realms] subs if there is no policy assigned to the principal, no dictionary checks of passwords will be performed. +**encrypted_challenge_indicator** + (String.) Specifies the authentication indicator value that the KDC + asserts into tickets obtained using FAST encrypted challenge + pre-authentication. New in 1.16. + **host_based_services** (Whitespace- or comma-separated list.) Lists services which will get host-based referral processing even if the server principal is @@ -765,9 +771,6 @@ For information about the syntax of some of these opti pkinit is used to authenticate. This option may be specified multiple times. (New in release 1.14.) -**pkinit_kdc_ocsp** - Specifies the location of the KDC's OCSP. - **pkinit_pool** Specifies the location of intermediate certificates which may be used by the KDC to complete the trust chain between a client's @@ -824,7 +827,7 @@ camellia256-cts-cmac camellia256-cts C camellia128-cts-cmac camellia128-cts Camellia-128 CTS mode with CMAC des The DES family: des-cbc-crc, des-cbc-md5, and des-cbc-md4 (weak) des3 The triple DES family: des3-cbc-sha1 -aes The AES family: aes256-cts-hmac-sha1-96 and aes128-cts-hmac-sha1-96 +aes The AES family: aes256-cts-hmac-sha1-96, aes128-cts-hmac-sha1-96, aes256-cts-hmac-sha384-192, and aes128-cts-hmac-sha256-128 rc4 The RC4 family: arcfour-hmac camellia The Camellia family: camellia256-cts-cmac and camellia128-cts-cmac ==================================================== ========================================================= Modified: vendor-crypto/krb5/dist/doc/admin/conf_files/krb5_conf.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/conf_files/krb5_conf.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/conf_files/krb5_conf.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -55,9 +55,10 @@ following directives at the beginning of a line:: directory must exist and be readable. Including a directory includes all files within the directory whose names consist solely of alphanumeric characters, dashes, or underscores. Starting in release -1.15, files with names ending in ".conf" are also included. Included -profile files are syntactically independent of their parents, so each -included file must begin with a section header. +1.15, files with names ending in ".conf" are also included, unless the +name begins with ".". Included profile files are syntactically +independent of their parents, so each included file must begin with a +section header. The krb5.conf file can specify that configuration should be obtained from a loadable module, rather than the file itself, using the @@ -262,7 +263,7 @@ The libdefaults section may contain any of the followi the local user or by root. **kcm_mach_service** - On OS X only, determines the name of the bootstrap service used to + On macOS only, determines the name of the bootstrap service used to contact the KCM daemon for the KCM credential cache type. If the value is ``-``, Mach RPC will not be used to contact the KCM daemon. The default value is ``org.h5l.kcm``. @@ -744,6 +745,10 @@ disabled with the disable tag): Uses the service realm to guess an appropriate cache from the collection +**hostname** + If the service principal is host-based, uses the service hostname + to guess an appropriate cache from the collection + .. _pwqual: pwqual interface @@ -777,6 +782,26 @@ interface can be used to write a plugin to synchronize with another database such as Active Directory. No plugins are built in for this interface. +.. _kadm5_auth: + +kadm5_auth interface +#################### + +The kadm5_auth section (introduced in release 1.16) controls modules +for the kadmin authorization interface, which determines whether a +client principal is allowed to perform a kadmin operation. The +following built-in modules exist for this interface: + +**acl** + This module reads the :ref:`kadm5.acl(5)` file, and authorizes + operations which are allowed according to the rules in the file. + +**self** + This module authorizes self-service operations including password + changes, creation of new random keys, fetching the client's + principal record or string attributes, and fetching the policy + record associated with the client principal. + .. _clpreauth: .. _kdcpreauth: @@ -857,6 +882,32 @@ built-in modules exist for this interface: **an2ln** This module authorizes a principal to a local account if the principal name maps to the local account name. + +.. _certauth: + +certauth interface +################## + +The certauth section (introduced in release 1.16) controls modules for +the certificate authorization interface, which determines whether a +certificate is allowed to preauthenticate a user via PKINIT. The +following built-in modules exist for this interface: + +**pkinit_san** + This module authorizes the certificate if it contains a PKINIT + Subject Alternative Name for the requested client principal, or a + Microsoft UPN SAN matching the principal if **pkinit_allow_upn** + is set to true for the realm. + +**pkinit_eku** + This module rejects the certificate if it does not contain an + Extended Key Usage attribute consistent with the + **pkinit_eku_checking** value for the realm. + +**dbmatch** + This module authorizes or rejects the certificate according to + whether it matches the **pkinit_cert_match** string attribute on + the client principal, if that attribute is present. PKINIT options Modified: vendor-crypto/krb5/dist/doc/admin/pkinit.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/pkinit.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/pkinit.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -223,6 +223,26 @@ time as follows:: kadmin -q 'add_principal +requires_preauth -nokey YOUR_PRINCNAME' +By default, the KDC requires PKINIT client certificates to have the +standard Extended Key Usage and Subject Alternative Name attributes +for PKINIT. Starting in release 1.16, it is possible to authorize +client certificates based on the subject or other criteria instead of +the standard PKINIT Subject Alternative Name, by setting the +**pkinit_cert_match** string attribute on each client principal entry. +For example:: + + kadmin set_string user@REALM pkinit_cert_match "CN=user@REALM$" + +The **pkinit_cert_match** string attribute follows the syntax used by +the :ref:`krb5.conf(5)` **pkinit_cert_match** relation. To allow the +use of non-PKINIT client certificates, it will also be necessary to +disable key usage checking using the **pkinit_eku_checking** relation; +for example:: + + [kdcdefaults] + pkinit_eku_checking = none + + Configuring the clients ----------------------- Modified: vendor-crypto/krb5/dist/doc/admin/realm_config.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/admin/realm_config.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/admin/realm_config.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -207,7 +207,7 @@ convey more information about a realm's KDCs with a si The client performs a query for the following URI records: -* ``_kerberos.REALM`` for fiding KDCs. +* ``_kerberos.REALM`` for finding KDCs. * ``_kerberos-adm.REALM`` for finding kadmin services. * ``_kpasswd.REALM`` for finding password services. Modified: vendor-crypto/krb5/dist/doc/appdev/gssapi.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/appdev/gssapi.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/appdev/gssapi.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -312,6 +312,25 @@ issue a ticket from the client to the target service. library will then use this ticket to authenticate to the target service. +If an application needs to find out whether a credential it holds is a +proxy credential and the name of the intermediate service, it can +query the credential with the **GSS_KRB5_GET_CRED_IMPERSONATOR** OID +(new in release 1.16, declared in ````) using +the gss_inquire_cred_by_oid extension (declared in +````):: + + OM_uint32 gss_inquire_cred_by_oid(OM_uint32 *minor_status, + const gss_cred_id_t cred_handle, + gss_OID desired_object, + gss_buffer_set_t *data_set); + +If the call succeeds and *cred_handle* is a proxy credential, +*data_set* will be set to a single-element buffer set containing the +unparsed principal name of the intermediate service. If *cred_handle* +is not a proxy credential, *data_set* will be set to an empty buffer +set. If the library does not support the query, +gss_inquire_cred_by_oid will return **GSS_S_UNAVAILABLE**. + AEAD message wrapping --------------------- Modified: vendor-crypto/krb5/dist/doc/appdev/index.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/appdev/index.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/appdev/index.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -5,6 +5,7 @@ For application developers :maxdepth: 1 gssapi.rst + y2038.rst h5l_mit_apidiff.rst init_creds.rst princ_handle.rst Added: vendor-crypto/krb5/dist/doc/appdev/y2038.rst ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-crypto/krb5/dist/doc/appdev/y2038.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -0,0 +1,28 @@ +Year 2038 considerations for uses of krb5_timestamp +=================================================== + +POSIX time values, which measure the number of seconds since January 1 +1970, will exceed the maximum value representable in a signed 32-bit +integer in January 2038. This documentation describes considerations +for consumers of the MIT krb5 libraries. + +Applications or libraries which use libkrb5 and consume the timestamps +included in credentials or other structures make use of the +:c:type:`krb5_timestamp` type. For historical reasons, krb5_timestamp +is a signed 32-bit integer, even on platforms where a larger type is +natively used to represent time values. To behave properly for time +values after January 2038, calling code should cast krb5_timestamp +values to uint32_t, and then to time_t:: + + (time_t)(uint32_t)timestamp + +Used in this way, krb5_timestamp values can represent time values up +until February 2106, provided that the platform uses a 64-bit or +larger time_t type. This usage will also remain safe if a later +version of MIT krb5 changes krb5_timestamp to an unsigned 32-bit +integer. + +The GSSAPI only uses representations of time intervals, not absolute +times. Callers of the GSSAPI should require no changes to behave +correctly after January 2038, provided that they use MIT krb5 release +1.16 or later. Modified: vendor-crypto/krb5/dist/doc/basic/ccache_def.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/basic/ccache_def.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/basic/ccache_def.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -64,7 +64,7 @@ library. KCM client support is new in release 1.13. A KCM daemon has not yet been implemented in MIT krb5, but the client will interoperate - with the KCM daemon implemented by Heimdal. OS X 10.7 and higher + with the KCM daemon implemented by Heimdal. macOS 10.7 and higher provides a KCM daemon as part of the operating system, and the **KCM** cache type is used as the default cache on that platform in a default build. Modified: vendor-crypto/krb5/dist/doc/build/options2configure.rst ============================================================================== --- vendor-crypto/krb5/dist/doc/build/options2configure.rst Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/build/options2configure.rst Tue Apr 3 19:36:00 2018 (r331939) @@ -350,10 +350,6 @@ Optional packages prng specify ``--with-prng-alg=os``. The default is ``fortuna``. (See :ref:`mitK5features`) -**-**\ **-with-pkinit-crypto-impl=**\ *IMPL* - Use the specified pkinit crypto implementation *IMPL*. - Defaults to using OpenSSL. - **-**\ **-without-libedit** Do not compile and link against libedit. Some utilities will no longer offer command history or completion in interactive mode if Modified: vendor-crypto/krb5/dist/doc/conf.py ============================================================================== --- vendor-crypto/krb5/dist/doc/conf.py Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/conf.py Tue Apr 3 19:36:00 2018 (r331939) @@ -272,7 +272,7 @@ else: rst_epilog += ''' .. |krb5conf| replace:: ``/etc/krb5.conf`` .. |defkeysalts| replace:: ``aes256-cts-hmac-sha1-96:normal aes128-cts-hmac-sha1-96:normal des3-cbc-sha1:normal arcfour-hmac-md5:normal`` -.. |defetypes| replace:: ``aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4`` +.. |defetypes| replace:: ``aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 aes256-cts-hmac-sha384-192 aes128-cts-hmac-sha256-128 des3-cbc-sha1 arcfour-hmac-md5 camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4`` .. |defmkey| replace:: ``aes256-cts-hmac-sha1-96`` .. |copy| unicode:: U+000A9 ''' Modified: vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kadmin_local.txt ============================================================================== --- vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kadmin_local.txt Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kadmin_local.txt Tue Apr 3 19:36:00 2018 (r331939) @@ -661,6 +661,13 @@ KDC: *principal*. The *value* is a JSON string representing an array of objects, each having optional ``type`` and ``username`` fields. +**pkinit_cert_match** + Specifies a matching expression that defines the certificate + attributes required for the client certificate used by the + principal during PKINIT authentication. The matching expression + is in the same format as those used by the **pkinit_cert_match** + option in :ref:`krb5.conf(5)`. (New in release 1.16.) + This command requires the **modify** privilege. Alias: **setstr** Modified: vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kpropd.txt ============================================================================== --- vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kpropd.txt Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/kpropd.txt Tue Apr 3 19:36:00 2018 (r331939) @@ -14,6 +14,7 @@ SYNOPSIS [**-F** *principal_database*] [**-p** *kdb5_util_prog*] [**-P** *port*] +[**--pid-file**\ =\ *pid_file*] [**-d**] [**-t**] @@ -103,6 +104,10 @@ OPTIONS **-a** *acl_file* Allows the user to specify the path to the kpropd.acl file; by default the path used is |kdcdir|\ ``/kpropd.acl``. + +**--pid-file**\ =\ *pid_file* + In standalone mode, write the process ID of the daemon into + *pid_file*. ENVIRONMENT Modified: vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/ktutil.txt ============================================================================== --- vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/ktutil.txt Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/html/_sources/admin/admin_commands/ktutil.txt Tue Apr 3 19:36:00 2018 (r331939) @@ -87,7 +87,7 @@ add_entry ~~~~~~~~~ **add_entry** {**-key**\|\ **-password**} **-p** *principal* - **-k** *kvno* **-e** *enctype* + **-k** *kvno* **-e** *enctype* [**-s** *salt*] Add *principal* to keylist using key or password. Modified: vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kadm5_acl.txt ============================================================================== --- vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kadm5_acl.txt Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kadm5_acl.txt Tue Apr 3 19:36:00 2018 (r331939) @@ -116,16 +116,17 @@ Here is an example of a kadm5.acl file:: */root@ATHENA.MIT.EDU l * # line 5 sms@ATHENA.MIT.EDU x * -maxlife 9h -postdateable # line 6 -(line 1) Any principal in the ``ATHENA.MIT.EDU`` realm with -an ``admin`` instance has all administrative privileges. +(line 1) Any principal in the ``ATHENA.MIT.EDU`` realm with an +``admin`` instance has all administrative privileges except extracting +keys. -(lines 1-3) The user ``joeadmin`` has all permissions with his -``admin`` instance, ``joeadmin/admin@ATHENA.MIT.EDU`` (matches line -1). He has no permissions at all with his null instance, -``joeadmin@ATHENA.MIT.EDU`` (matches line 2). His ``root`` and other -non-``admin``, non-null instances (e.g., ``extra`` or ``dbadmin``) have -inquire permissions with any principal that has the instance ``root`` -(matches line 3). +(lines 1-3) The user ``joeadmin`` has all permissions except +extracting keys with his ``admin`` instance, +``joeadmin/admin@ATHENA.MIT.EDU`` (matches line 1). He has no +permissions at all with his null instance, ``joeadmin@ATHENA.MIT.EDU`` +(matches line 2). His ``root`` and other non-``admin``, non-null +instances (e.g., ``extra`` or ``dbadmin``) have inquire permissions +with any principal that has the instance ``root`` (matches line 3). (line 4) Any ``root`` principal in ``ATHENA.MIT.EDU`` can inquire or change the password of their null instance, but not any other @@ -139,9 +140,22 @@ permission can only be granted globally, not to specif principals. (line 6) Finally, the Service Management System principal -``sms@ATHENA.MIT.EDU`` has all permissions, but any principal that it -creates or modifies will not be able to get postdateable tickets or -tickets with a life of longer than 9 hours. +``sms@ATHENA.MIT.EDU`` has all permissions except extracting keys, but +any principal that it creates or modifies will not be able to get +postdateable tickets or tickets with a life of longer than 9 hours. + +MODULE BEHAVIOR +--------------- + +The ACL file can coexist with other authorization modules in release +1.16 and later, as configured in the :ref:`kadm5_auth` section of +:ref:`krb5.conf(5)`. The ACL file will positively authorize +operations according to the rules above, but will never +authoritatively deny an operation, so other modules can authorize +operations in addition to those authorized by the ACL file. + +To operate without an ACL file, set the *acl_file* variable in +:ref:`kdc.conf(5)` to the empty string with ``acl_file = ""``. SEE ALSO -------- Modified: vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kdc_conf.txt ============================================================================== --- vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kdc_conf.txt Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/kdc_conf.txt Tue Apr 3 19:36:00 2018 (r331939) @@ -86,9 +86,10 @@ The following tags may be specified in a [realms] subs **acl_file** (String.) Location of the access control list file that :ref:`kadmind(8)` uses to determine which principals are allowed - which permissions on the Kerberos database. The default value is - |kdcdir|\ ``/kadm5.acl``. For more information on Kerberos ACL - file see :ref:`kadm5.acl(5)`. + which permissions on the Kerberos database. To operate without an + ACL file, set this relation to the empty string with ``acl_file = + ""``. The default value is |kdcdir|\ ``/kadm5.acl``. For more + information on Kerberos ACL file see :ref:`kadm5.acl(5)`. **database_module** (String.) This relation indicates the name of the configuration @@ -198,6 +199,11 @@ The following tags may be specified in a [realms] subs if there is no policy assigned to the principal, no dictionary checks of passwords will be performed. +**encrypted_challenge_indicator** + (String.) Specifies the authentication indicator value that the KDC + asserts into tickets obtained using FAST encrypted challenge + pre-authentication. New in 1.16. + **host_based_services** (Whitespace- or comma-separated list.) Lists services which will get host-based referral processing even if the server principal is @@ -765,9 +771,6 @@ For information about the syntax of some of these opti pkinit is used to authenticate. This option may be specified multiple times. (New in release 1.14.) -**pkinit_kdc_ocsp** - Specifies the location of the KDC's OCSP. - **pkinit_pool** Specifies the location of intermediate certificates which may be used by the KDC to complete the trust chain between a client's @@ -824,7 +827,7 @@ camellia256-cts-cmac camellia256-cts C camellia128-cts-cmac camellia128-cts Camellia-128 CTS mode with CMAC des The DES family: des-cbc-crc, des-cbc-md5, and des-cbc-md4 (weak) des3 The triple DES family: des3-cbc-sha1 -aes The AES family: aes256-cts-hmac-sha1-96 and aes128-cts-hmac-sha1-96 +aes The AES family: aes256-cts-hmac-sha1-96, aes128-cts-hmac-sha1-96, aes256-cts-hmac-sha384-192, and aes128-cts-hmac-sha256-128 rc4 The RC4 family: arcfour-hmac camellia The Camellia family: camellia256-cts-cmac and camellia128-cts-cmac ==================================================== ========================================================= Modified: vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/krb5_conf.txt ============================================================================== --- vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/krb5_conf.txt Tue Apr 3 19:35:11 2018 (r331938) +++ vendor-crypto/krb5/dist/doc/html/_sources/admin/conf_files/krb5_conf.txt Tue Apr 3 19:36:00 2018 (r331939) @@ -55,9 +55,10 @@ following directives at the beginning of a line:: directory must exist and be readable. Including a directory includes all files within the directory whose names consist solely of alphanumeric characters, dashes, or underscores. Starting in release -1.15, files with names ending in ".conf" are also included. Included -profile files are syntactically independent of their parents, so each -included file must begin with a section header. +1.15, files with names ending in ".conf" are also included, unless the +name begins with ".". Included profile files are syntactically +independent of their parents, so each included file must begin with a +section header. The krb5.conf file can specify that configuration should be obtained from a loadable module, rather than the file itself, using the @@ -262,7 +263,7 @@ The libdefaults section may contain any of the followi the local user or by root. **kcm_mach_service** - On OS X only, determines the name of the bootstrap service used to *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 3 19:36:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C19EF79EF2; Tue, 3 Apr 2018 19:36:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4AB6F176; Tue, 3 Apr 2018 19:36:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17CBAE39; Tue, 3 Apr 2018 19:36:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Jamog079105; Tue, 3 Apr 2018 19:36:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33JamOo079104; Tue, 3 Apr 2018 19:36:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804031936.w33JamOo079104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 19:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r331940 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cy X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 331940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 19:36:49 -0000 Author: cy Date: Tue Apr 3 19:36:48 2018 New Revision: 331940 URL: https://svnweb.freebsd.org/changeset/base/331940 Log: Import of MIT krb5-1.16 is now complete. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Tue Apr 3 19:36:00 2018 (r331939) +++ svnadmin/conf/sizelimit.conf Tue Apr 3 19:36:48 2018 (r331940) @@ -16,7 +16,6 @@ # First field is username, second field is the raised limit required. achim bapt -cy davidcs dim imp From owner-svn-src-all@freebsd.org Tue Apr 3 19:39:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92244F7A220; Tue, 3 Apr 2018 19:39:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E89C6F3A9; Tue, 3 Apr 2018 19:39:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C035E3D; Tue, 3 Apr 2018 19:39:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Jd6A6081222; Tue, 3 Apr 2018 19:39:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33Jd6g3081220; Tue, 3 Apr 2018 19:39:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804031939.w33Jd6g3081220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 19:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r331941 - vendor-crypto/krb5/1.16 X-SVN-Group: vendor-crypto X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor-crypto/krb5/1.16 X-SVN-Commit-Revision: 331941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 19:39:07 -0000 Author: cy Date: Tue Apr 3 19:39:06 2018 New Revision: 331941 URL: https://svnweb.freebsd.org/changeset/base/331941 Log: Tag MIT krb5-1.16. Added: vendor-crypto/krb5/1.16/ - copied from r331940, vendor-crypto/krb5/dist/ From owner-svn-src-all@freebsd.org Tue Apr 3 19:51:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD665F7AFAD; Tue, 3 Apr 2018 19:51:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 688B86FB97; Tue, 3 Apr 2018 19:51:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6358E1064; Tue, 3 Apr 2018 19:51:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33JpOaZ099166; Tue, 3 Apr 2018 19:51:24 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33JpOmP099165; Tue, 3 Apr 2018 19:51:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804031951.w33JpOmP099165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 19:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331942 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 331942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 19:51:24 -0000 Author: cy Date: Tue Apr 3 19:51:23 2018 New Revision: 331942 URL: https://svnweb.freebsd.org/changeset/base/331942 Log: Add gets_s(3) to the man page title (noticed by ed@). While I'm at it correct the update date in the man page. Reported by: ed@ MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Modified: head/lib/libc/stdio/fgets.3 Modified: head/lib/libc/stdio/fgets.3 ============================================================================== --- head/lib/libc/stdio/fgets.3 Tue Apr 3 19:39:06 2018 (r331941) +++ head/lib/libc/stdio/fgets.3 Tue Apr 3 19:51:23 2018 (r331942) @@ -32,12 +32,13 @@ .\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 5, 2012 +.Dd April 3, 2018 .Dt FGETS 3 .Os .Sh NAME .Nm fgets , -.Nm gets +.Nm gets , +.Nm gets_s .Nd get a line from a stream .Sh LIBRARY .Lb libc From owner-svn-src-all@freebsd.org Tue Apr 3 20:14:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 816E5F7CA32; Tue, 3 Apr 2018 20:14:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA7570E02; Tue, 3 Apr 2018 20:14:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 250471526; Tue, 3 Apr 2018 20:14:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33KEbrl036306; Tue, 3 Apr 2018 20:14:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33KEbY2036305; Tue, 3 Apr 2018 20:14:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804032014.w33KEbY2036305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 20:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331943 - head/include X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 331943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:14:38 -0000 Author: cy Date: Tue Apr 3 20:14:37 2018 New Revision: 331943 URL: https://svnweb.freebsd.org/changeset/base/331943 Log: Include update to stdio.h missed in r331936. In my attempt to limit the commit in r331936 to only the gets_s() commit and not include unrelated patches in my tree, this patch was missed. Reported by: pfg MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Modified: head/include/stdio.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Tue Apr 3 19:51:23 2018 (r331942) +++ head/include/stdio.h Tue Apr 3 20:14:37 2018 (r331943) @@ -51,6 +51,11 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + #if __POSIX_VISIBLE >= 200809 #ifndef _OFF_T_DECLARED #define _OFF_T_DECLARED @@ -265,6 +270,9 @@ size_t fwrite(const void * __restrict, size_t, size_t int getc(FILE *); int getchar(void); char *gets(char *); +#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1 +char *gets_s(char *, rsize_t); +#endif void perror(const char *); int printf(const char * __restrict, ...); int putc(int, FILE *); From owner-svn-src-all@freebsd.org Tue Apr 3 20:20:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81B46F7CFCF; Tue, 3 Apr 2018 20:20:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F136E71246; Tue, 3 Apr 2018 20:20:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w33KKAnj062269 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 23:20:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w33KKAnj062269 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w33KKAiw062265; Tue, 3 Apr 2018 23:20:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 3 Apr 2018 23:20:10 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio Message-ID: <20180403202010.GK1774@kib.kiev.ua> References: <201804031852.w33IqdIQ013512@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804031852.w33IqdIQ013512@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 20:20:21 -0000 On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > Modified: head/lib/libc/stdio/Symbol.map > ============================================================================== > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 (r331935) > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 (r331936) > @@ -165,6 +165,7 @@ FBSD_1.3 { > FBSD_1.4 { > fdclose; > fopencookie; > + gets_s; > }; This is wrong. From owner-svn-src-all@freebsd.org Tue Apr 3 20:22:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86297F7D3B2; Tue, 3 Apr 2018 20:22:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015CC717C5; Tue, 3 Apr 2018 20:22:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w33KMXEp063254 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 23:22:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w33KMXEp063254 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w33KMXP5063253; Tue, 3 Apr 2018 23:22:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 3 Apr 2018 23:22:33 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio Message-ID: <20180403202233.GL1774@kib.kiev.ua> References: <201804031852.w33IqdIQ013512@repo.freebsd.org> <20180403202010.GK1774@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403202010.GK1774@kib.kiev.ua> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 20:22:44 -0000 On Tue, Apr 03, 2018 at 11:20:10PM +0300, Konstantin Belousov wrote: > On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > > Modified: head/lib/libc/stdio/Symbol.map > > ============================================================================== > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 (r331935) > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 (r331936) > > @@ -165,6 +165,7 @@ FBSD_1.3 { > > FBSD_1.4 { > > fdclose; > > fopencookie; > > + gets_s; > > }; > This is wrong. And then, I noticed that the function is not added to the header file as well, am I missing it ? From owner-svn-src-all@freebsd.org Tue Apr 3 20:24:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BAABF7D634; Tue, 3 Apr 2018 20:24:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EBD89719F2; Tue, 3 Apr 2018 20:24:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3SU2fpbJvXziT3SU3fmcK9; Tue, 03 Apr 2018 14:24:47 -0600 X-Authority-Analysis: v=2.3 cv=X6B81lbe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=SrMf8hbOp_N-bMP_NfsA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 8F3C97FA; Tue, 3 Apr 2018 13:24:45 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w33KOgIb022471; Tue, 3 Apr 2018 13:24:42 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w33KOgcJ022468; Tue, 3 Apr 2018 13:24:42 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804032024.w33KOgcJ022468@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio In-Reply-To: Message from Konstantin Belousov of "Tue, 03 Apr 2018 23:20:10 +0300." <20180403202010.GK1774@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2018 13:24:42 -0700 X-CMAE-Envelope: MS4wfK7Gmre+KWXbNqSN84RU3PcaaYOlZYXvuLFk0X3BQ5G/VMZ5dtgNIoc3fbnZcmS6K6My9bM1UB9MnfDF13bBocC8iRp+YV0gMrETvKaV+id66Yww4+eI Vf+ZxfC/sheRi/Y4N1MJGGkfDC1VPzG/U/F+qaUBZin5RSHryn/P1IFKfLmARN4uNFNNb/bKAJZJHdWN+pxKu1VxVNmz/hZIbrMZ8OG1Rd+hxohU9TJ8VOiC t4h/yfAhfuzYcvxE29sPTOj/2g6qM+KN635jzSTlwYmMAQIkKNvhB3ghG9+ID2TYrpupCKe+4FOUUVJt4ruOxA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:24:54 -0000 In message <20180403202010.GK1774@kib.kiev.ua>, Konstantin Belousov writes: > On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > > Modified: head/lib/libc/stdio/Symbol.map > > =========================================================================== > === > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 (r33193 > 5) > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 (r33193 > 6) > > @@ -165,6 +165,7 @@ FBSD_1.3 { > > FBSD_1.4 { > > fdclose; > > fopencookie; > > + gets_s; > > }; > This is wrong. Would you suggest a different version number? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Apr 3 20:26:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8ACDF7D7CF; Tue, 3 Apr 2018 20:26:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 12CDE71BB2; Tue, 3 Apr 2018 20:25:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3SVAfpbhqXziT3SVCfmccV; Tue, 03 Apr 2018 14:25:58 -0600 X-Authority-Analysis: v=2.3 cv=X6B81lbe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=01UsYihvV-c3iVwlEgMA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 85C27819; Tue, 3 Apr 2018 13:25:56 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w33KPtAo022515; Tue, 3 Apr 2018 13:25:55 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w33KPto8022512; Tue, 3 Apr 2018 13:25:55 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804032025.w33KPto8022512@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio In-Reply-To: Message from Konstantin Belousov of "Tue, 03 Apr 2018 23:22:33 +0300." <20180403202233.GL1774@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2018 13:25:55 -0700 X-CMAE-Envelope: MS4wfPKEoY16y0p99Y15YZGFWc4N9Hzv1A9MgRrx52SGKYA5Y/cPfBZ3J33CBER58dSuoByzjNcyyfbC8+X/8FTj0lI/3qWxU7AMb62D+tWV1leqqIcWtHbY anMp3WXiGVF6sslAGY7jQtAMxEQWWKQJ9VkaLcySPBrtG1L68QIhuXmTVbSLxytXgV47Xqx3uzmR/R7Isci1DoJUcC2FvvNKw5ZF+DT+d2Qc+UuDXc+xTo/S 6o6+fuEjRoei1lpK/iR/weTDQgn8Yf8R//ZaHxWtTmyHa6OhDmH2ytlW6jpr0skqfe7HaJo8izlKRLueTndF7w== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:26:00 -0000 In message <20180403202233.GL1774@kib.kiev.ua>, Konstantin Belousov writes: > On Tue, Apr 03, 2018 at 11:20:10PM +0300, Konstantin Belousov wrote: > > On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > > > Modified: head/lib/libc/stdio/Symbol.map > > > ========================================================================= > ===== > > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 > (r331935) > > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 > (r331936) > > > @@ -165,6 +165,7 @@ FBSD_1.3 { > > > FBSD_1.4 { > > > fdclose; > > > fopencookie; > > > + gets_s; > > > }; > > This is wrong. I replied to this previously. > > And then, I noticed that the function is not added to the header file as well > , > am I missing it ? I my attempt to only commit gets_s() and nothing else I missed committing the header file. It's there now. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Apr 3 20:38:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE298F7E617; Tue, 3 Apr 2018 20:38:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6129A72527; Tue, 3 Apr 2018 20:38:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C225186D; Tue, 3 Apr 2018 20:38:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33KcPLo069864; Tue, 3 Apr 2018 20:38:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33KcPsj069863; Tue, 3 Apr 2018 20:38:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804032038.w33KcPsj069863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 20:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331945 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 331945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:38:25 -0000 Author: cy Date: Tue Apr 3 20:38:25 2018 New Revision: 331945 URL: https://svnweb.freebsd.org/changeset/base/331945 Log: Correct the version number for gets_s(3). Reported by: kib@ MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Modified: head/lib/libc/stdio/Symbol.map Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Tue Apr 3 20:22:02 2018 (r331944) +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 20:38:25 2018 (r331945) @@ -160,12 +160,12 @@ FBSD_1.3 { open_wmemstream; mkostemp; mkostemps; + gets_s; }; FBSD_1.4 { fdclose; fopencookie; - gets_s; }; FBSDprivate_1.0 { From owner-svn-src-all@freebsd.org Tue Apr 3 20:40:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88C6F7E7CD; Tue, 3 Apr 2018 20:40:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C73D672707; Tue, 3 Apr 2018 20:40:10 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3SitfZiAdYxCT3SiuffJ22; Tue, 03 Apr 2018 14:40:08 -0600 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=pp5kDD734Ao5TmKL9n8A:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 11F7D887; Tue, 3 Apr 2018 13:40:07 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w33Ke6QL023380; Tue, 3 Apr 2018 13:40:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w33Ke6JZ023377; Tue, 3 Apr 2018 13:40:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804032040.w33Ke6JZ023377@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio In-Reply-To: Message from Konstantin Belousov of "Tue, 03 Apr 2018 23:20:10 +0300." <20180403202010.GK1774@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2018 13:40:06 -0700 X-CMAE-Envelope: MS4wfE10Nxp853gCzBTHIdZb9p3U6YptcpTTgf+Lkv0M8jC0YISfXQtmGTkCAkzNnfOuECbff3jQvLrG+bC0o2r/7nLVjUnQvIDR6rcDe7g4vLGsXZ4JILcK FG52oq5jUGZc/DWWqFVsyLBmjbh7Vm9M+74kGvka2Je1tQ3ISgWoL90rI0Tpj0DS5oULe8VStPBaSJGVzl0OnChY+l9wfkBgAM/FKrpjs42qe/trzg0V6f0u oVfSAdQNg6JNFXlnlQDzl5mgGBpVKW48jOXC1mDxX2AySwyq8Sn4pKGqW6oTF1AXKVD1c4IGudRfNoGw4f8Vxw== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:40:11 -0000 In message <20180403202010.GK1774@kib.kiev.ua>, Konstantin Belousov writes: > On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > > Modified: head/lib/libc/stdio/Symbol.map > > =========================================================================== > === > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 (r33193 > 5) > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 (r33193 > 6) > > @@ -165,6 +165,7 @@ FBSD_1.3 { > > FBSD_1.4 { > > fdclose; > > fopencookie; > > + gets_s; > > }; > This is wrong. Fixed. Thanks for input Konstantin. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Apr 3 20:41:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6112DF7E927; Tue, 3 Apr 2018 20:41:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5C5072A17; Tue, 3 Apr 2018 20:41:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w33KevlO067759 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 23:41:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w33KevlO067759 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w33KevHt067757; Tue, 3 Apr 2018 23:40:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 3 Apr 2018 23:40:57 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331943 - head/include Message-ID: <20180403204057.GM1774@kib.kiev.ua> References: <201804032014.w33KEbY2036305@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804032014.w33KEbY2036305@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 20:41:08 -0000 On Tue, Apr 03, 2018 at 08:14:37PM +0000, Cy Schubert wrote: > Author: cy > Date: Tue Apr 3 20:14:37 2018 > New Revision: 331943 > URL: https://svnweb.freebsd.org/changeset/base/331943 > > Log: > Include update to stdio.h missed in r331936. > > In my attempt to limit the commit in r331936 to only the gets_s() > commit and not include unrelated patches in my tree, this patch > was missed. > > Reported by: pfg > MFC after: 2 weeks > X-MFC with: r331936 > Differential Revision: https://reviews.freebsd.org/D12785 > > Modified: > head/include/stdio.h > > Modified: head/include/stdio.h > ============================================================================== > --- head/include/stdio.h Tue Apr 3 19:51:23 2018 (r331942) > +++ head/include/stdio.h Tue Apr 3 20:14:37 2018 (r331943) > @@ -51,6 +51,11 @@ typedef __size_t size_t; > #define _SIZE_T_DECLARED > #endif > > +#ifndef _RSIZE_T_DEFINED > +#define _RSIZE_T_DEFINED > +typedef size_t rsize_t; > +#endif > + > #if __POSIX_VISIBLE >= 200809 > #ifndef _OFF_T_DECLARED > #define _OFF_T_DECLARED > @@ -265,6 +270,9 @@ size_t fwrite(const void * __restrict, size_t, size_t > int getc(FILE *); > int getchar(void); > char *gets(char *); > +#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1 What is the purpose of the __EXT1_VISIBLE == 1 check ? It is against the intended __XX_VISIBLE mechanism construction. > +char *gets_s(char *, rsize_t); > +#endif > void perror(const char *); > int printf(const char * __restrict, ...); > int putc(int, FILE *); From owner-svn-src-all@freebsd.org Tue Apr 3 20:42:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 981F2F7EBDC; Tue, 3 Apr 2018 20:42:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA59772D7A; Tue, 3 Apr 2018 20:42:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w33Kgee2067838 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 23:42:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w33Kgee2067838 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w33KgeL6067835; Tue, 3 Apr 2018 23:42:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 3 Apr 2018 23:42:40 +0300 From: Konstantin Belousov To: Cy Schubert Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio Message-ID: <20180403204240.GN1774@kib.kiev.ua> References: <20180403202010.GK1774@kib.kiev.ua> <201804032024.w33KOgcJ022468@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804032024.w33KOgcJ022468@slippy.cwsent.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 20:42:54 -0000 On Tue, Apr 03, 2018 at 01:24:42PM -0700, Cy Schubert wrote: > In message <20180403202010.GK1774@kib.kiev.ua>, Konstantin Belousov > writes: > > On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > > > Modified: head/lib/libc/stdio/Symbol.map > > > =========================================================================== > > === > > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 (r33193 > > 5) > > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 (r33193 > > 6) > > > @@ -165,6 +165,7 @@ FBSD_1.3 { > > > FBSD_1.4 { > > > fdclose; > > > fopencookie; > > > + gets_s; > > > }; > > This is wrong. > > Would you suggest a different version number? Right version number for HEAD while it is 12 is FBSD_1.5. You will need to add it to stdio/Symbol.map since this is the first symbol in that namespace from stdio subdirectory. From owner-svn-src-all@freebsd.org Tue Apr 3 20:51:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80A96F7F70A; Tue, 3 Apr 2018 20:51:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D46877380D; Tue, 3 Apr 2018 20:51:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3StpfpkZxXziT3StqfmjHD; Tue, 03 Apr 2018 14:51:26 -0600 X-Authority-Analysis: v=2.3 cv=X6B81lbe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=KyEggJhy-pvkK12t3XYA:9 a=yR6CNe_cHF_cZkW1:21 a=IbUFIDMGQQ64dAyb:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id D78A5901; Tue, 3 Apr 2018 13:51:24 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w33KpNit024221; Tue, 3 Apr 2018 13:51:23 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w33KpN7I024218; Tue, 3 Apr 2018 13:51:23 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804032051.w33KpN7I024218@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio In-Reply-To: Message from Konstantin Belousov of "Tue, 03 Apr 2018 23:42:40 +0300." <20180403204240.GN1774@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2018 13:51:23 -0700 X-CMAE-Envelope: MS4wfArm1mTfDl3AV80NrseXRsZFiDJkRVJYRn59NcV0wymLjML5xyR3DEQgm7qaGq/SsJtyyrULhQpLdl5f9/L19fEWUHXEyFxgajTtzYPZ6iLPC0rfMjhO ibjavSFCGmH60YpxsI2VRYq1Sme6yNxOsrQQm5B7mkHzZzeizkc2KQvA0zmfU7th9ATU8FYNYiu5Id8UkqcRLfKgXsqHUtOnqy2ZOfp87kfw5sPvhSOyEAT/ Ms+bOnTsZF6RL/d2e9FXTJbm4PwHVuSORwv7t+2qeiFc5LePmmr1xMKdvCia6AnZYwrJgoa522B3REQ3I3oxcw== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:51:28 -0000 In message <20180403204240.GN1774@kib.kiev.ua>, Konstantin Belousov writes: > On Tue, Apr 03, 2018 at 01:24:42PM -0700, Cy Schubert wrote: > > In message <20180403202010.GK1774@kib.kiev.ua>, Konstantin Belousov > > writes: > > > On Tue, Apr 03, 2018 at 06:52:39PM +0000, Cy Schubert wrote: > > > > Modified: head/lib/libc/stdio/Symbol.map > > > > ======================================================================= > ==== > > > === > > > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 18:43:00 2018 > (r33193 > > > 5) > > > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 18:52:38 2018 > (r33193 > > > 6) > > > > @@ -165,6 +165,7 @@ FBSD_1.3 { > > > > FBSD_1.4 { > > > > fdclose; > > > > fopencookie; > > > > + gets_s; > > > > }; > > > This is wrong. > > > > Would you suggest a different version number? > > Right version number for HEAD while it is 12 is FBSD_1.5. You will need > to add it to stdio/Symbol.map since this is the first symbol in that > namespace from stdio subdirectory. Ok. I understand now. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Apr 3 20:53:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A02C1F7F9B2; Tue, 3 Apr 2018 20:53:54 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2C173AF9; Tue, 3 Apr 2018 20:53:54 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 327351BF0; Tue, 3 Apr 2018 20:53:54 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Krsgu095156; Tue, 3 Apr 2018 20:53:54 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33Krsu1095154; Tue, 3 Apr 2018 20:53:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804032053.w33Krsu1095154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 20:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331947 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 331947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:53:54 -0000 Author: cy Date: Tue Apr 3 20:53:53 2018 New Revision: 331947 URL: https://svnweb.freebsd.org/changeset/base/331947 Log: The correct symbol version for FreeBSD 12 is 1.5. Reported by: kib@ MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Modified: head/lib/libc/stdio/Symbol.map Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Tue Apr 3 20:41:57 2018 (r331946) +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 20:53:53 2018 (r331947) @@ -160,12 +160,15 @@ FBSD_1.3 { open_wmemstream; mkostemp; mkostemps; - gets_s; }; FBSD_1.4 { fdclose; fopencookie; +}; + +FBSD_1.5 { + gets_s; }; FBSDprivate_1.0 { From owner-svn-src-all@freebsd.org Tue Apr 3 20:54:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F50F7FA9B; Tue, 3 Apr 2018 20:54:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D61873C5A; Tue, 3 Apr 2018 20:54:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w33KsVDQ070160 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Apr 2018 23:54:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w33KsVDQ070160 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w33KsVBV070159; Tue, 3 Apr 2018 23:54:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 3 Apr 2018 23:54:31 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331945 - head/lib/libc/stdio Message-ID: <20180403205431.GO1774@kib.kiev.ua> References: <201804032038.w33KcPsj069863@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804032038.w33KcPsj069863@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 20:54:42 -0000 On Tue, Apr 03, 2018 at 08:38:25PM +0000, Cy Schubert wrote: > Author: cy > Date: Tue Apr 3 20:38:25 2018 > New Revision: 331945 > URL: https://svnweb.freebsd.org/changeset/base/331945 > > Log: > Correct the version number for gets_s(3). > > Reported by: kib@ > MFC after: 2 weeks > X-MFC with: r331936 > Differential Revision: https://reviews.freebsd.org/D12785 > > Modified: > head/lib/libc/stdio/Symbol.map > > Modified: head/lib/libc/stdio/Symbol.map > ============================================================================== > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 20:22:02 2018 (r331944) > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 20:38:25 2018 (r331945) > @@ -160,12 +160,12 @@ FBSD_1.3 { Please re-read my previous mail. > open_wmemstream; > mkostemp; > mkostemps; > + gets_s; > }; > > FBSD_1.4 { > fdclose; > fopencookie; > - gets_s; > }; > > FBSDprivate_1.0 { From owner-svn-src-all@freebsd.org Tue Apr 3 20:58:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2794F7FF2F; Tue, 3 Apr 2018 20:58:58 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB3F7406D; Tue, 3 Apr 2018 20:58:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3T15fZpTDYxCT3T16ffNtZ; Tue, 03 Apr 2018 14:58:56 -0600 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=qROpeadeCB7nu2nCmHQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 3AE7C95F; Tue, 3 Apr 2018 13:58:55 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w33Kwsss024417; Tue, 3 Apr 2018 13:58:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w33KwsxY024414; Tue, 3 Apr 2018 13:58:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804032058.w33KwsxY024414@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331945 - head/lib/libc/stdio In-Reply-To: Message from Konstantin Belousov of "Tue, 03 Apr 2018 23:54:31 +0300." <20180403205431.GO1774@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2018 13:58:54 -0700 X-CMAE-Envelope: MS4wfPC/vp1HntaO60xhSARLnBB3uLLDP71MtdCuQRjvYEq+60aBHSkht/MBAdsk36lBA10qnJj6xlqfC2PsvQNzhq/yPpIwlObxSzUqAhhhLR2FHxcQLg7V bJop62NRGpyR1yDvw+xn+RXMUhIV0FRt0q5ubxoF0TaP6+UEUYmXE5348ERivTY1828IjYY0ZklLox19Q/HNOZpnImPzYL5Fl1D2dWuCe8pXL40lIs3vSm1w 0aROr9bfgY9H3rlBdRGlnMtIAJTqDOI7dV7IeS+FhJ9XcXh/F3J2mV3GHT1oWBoA9ptLxyapN5JqK8vjjTMOWQ== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:58:59 -0000 In message <20180403205431.GO1774@kib.kiev.ua>, Konstantin Belousov writes: > On Tue, Apr 03, 2018 at 08:38:25PM +0000, Cy Schubert wrote: > > Author: cy > > Date: Tue Apr 3 20:38:25 2018 > > New Revision: 331945 > > URL: https://svnweb.freebsd.org/changeset/base/331945 > > > > Log: > > Correct the version number for gets_s(3). > > > > Reported by: kib@ > > MFC after: 2 weeks > > X-MFC with: r331936 > > Differential Revision: https://reviews.freebsd.org/D12785 > > > > Modified: > > head/lib/libc/stdio/Symbol.map > > > > Modified: head/lib/libc/stdio/Symbol.map > > =========================================================================== > === > > --- head/lib/libc/stdio/Symbol.map Tue Apr 3 20:22:02 2018 (r33194 > 4) > > +++ head/lib/libc/stdio/Symbol.map Tue Apr 3 20:38:25 2018 (r33194 > 5) > > @@ -160,12 +160,12 @@ FBSD_1.3 { > Please re-read my previous mail. We are out of sync, before you explained it to me. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Apr 3 20:59:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72129F80012; Tue, 3 Apr 2018 20:59:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2503F741DE; Tue, 3 Apr 2018 20:59:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FCB61C1B; Tue, 3 Apr 2018 20:59:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33KxkmZ001514; Tue, 3 Apr 2018 20:59:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33KxklJ001513; Tue, 3 Apr 2018 20:59:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201804032059.w33KxklJ001513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 3 Apr 2018 20:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331948 - head/include X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 331948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 20:59:47 -0000 Author: cy Date: Tue Apr 3 20:59:46 2018 New Revision: 331948 URL: https://svnweb.freebsd.org/changeset/base/331948 Log: Remove redundant check. Reported by: kib@ MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Modified: head/include/stdio.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Tue Apr 3 20:53:53 2018 (r331947) +++ head/include/stdio.h Tue Apr 3 20:59:46 2018 (r331948) @@ -270,7 +270,7 @@ size_t fwrite(const void * __restrict, size_t, size_t int getc(FILE *); int getchar(void); char *gets(char *); -#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1 +#if __EXT1_VISIBLE char *gets_s(char *, rsize_t); #endif void perror(const char *); From owner-svn-src-all@freebsd.org Tue Apr 3 21:00:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72934F80235; Tue, 3 Apr 2018 21:00:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D07D7456D; Tue, 3 Apr 2018 21:00:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 3T2rfpnmqXziT3T2tfmlhI; Tue, 03 Apr 2018 15:00:47 -0600 X-Authority-Analysis: v=2.3 cv=X6B81lbe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VOjm7XU_MTT69P80fhcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 8CAFF975; Tue, 3 Apr 2018 14:00:45 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w33L0jp2024505; Tue, 3 Apr 2018 14:00:45 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w33L0i5g024502; Tue, 3 Apr 2018 14:00:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804032100.w33L0i5g024502@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331943 - head/include In-Reply-To: Message from Konstantin Belousov of "Tue, 03 Apr 2018 23:40:57 +0300." <20180403204057.GM1774@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 03 Apr 2018 14:00:44 -0700 X-CMAE-Envelope: MS4wfIzt9iEVNe6270h+fKaVMX2JOAEcT2ed2QyRG9FEZffvHQQDX0yPIc5K4KACjhd790vEnxgt0MHeGNbP/uF6R1Kk8sFtFXmwyCt6EDrJ0bA8pMBZOQcd II3hgGAZRCpy4iUELPOASZDYd6F1IkiIt1CuEblEQWncYfX+7KxnEAfFi3zHvx9V2lAfs50Skxv19L3sgQDKzGwoJPvkciuMezpwbYc2cX3ExBXeKGlJ/Nu6 +El7XJxyp5hjLyaadMSUDQERn5k2bAokMTo7YFIQsM2/zafYKJ6G2P8IXTfMu04mqBr8/JLxN2yVuzUQD0xBSQ== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:00:55 -0000 In message <20180403204057.GM1774@kib.kiev.ua>, Konstantin Belousov writes: > On Tue, Apr 03, 2018 at 08:14:37PM +0000, Cy Schubert wrote: > > Author: cy > > Date: Tue Apr 3 20:14:37 2018 > > New Revision: 331943 > > URL: https://svnweb.freebsd.org/changeset/base/331943 > > > > Log: > > Include update to stdio.h missed in r331936. > > > > In my attempt to limit the commit in r331936 to only the gets_s() > > commit and not include unrelated patches in my tree, this patch > > was missed. > > > > Reported by: pfg > > MFC after: 2 weeks > > X-MFC with: r331936 > > Differential Revision: https://reviews.freebsd.org/D12785 > > > > Modified: > > head/include/stdio.h > > > > Modified: head/include/stdio.h > > =========================================================================== > === > > --- head/include/stdio.h Tue Apr 3 19:51:23 2018 (r331942) > > +++ head/include/stdio.h Tue Apr 3 20:14:37 2018 (r331943) > > @@ -51,6 +51,11 @@ typedef __size_t size_t; > > #define _SIZE_T_DECLARED > > #endif > > > > +#ifndef _RSIZE_T_DEFINED > > +#define _RSIZE_T_DEFINED > > +typedef size_t rsize_t; > > +#endif > > + > > #if __POSIX_VISIBLE >= 200809 > > #ifndef _OFF_T_DECLARED > > #define _OFF_T_DECLARED > > @@ -265,6 +270,9 @@ size_t fwrite(const void * __restrict, size_t, size_t > > int getc(FILE *); > > int getchar(void); > > char *gets(char *); > > +#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1 > What is the purpose of the __EXT1_VISIBLE == 1 check ? > It is against the intended __XX_VISIBLE mechanism construction. That appears to have been left over in my commit tree. > > > +char *gets_s(char *, rsize_t); > > +#endif > > void perror(const char *); > > int printf(const char * __restrict, ...); > > int putc(int, FILE *); -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue Apr 3 21:08:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1550F80AF4; Tue, 3 Apr 2018 21:08:11 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93D18749D9; Tue, 3 Apr 2018 21:08:11 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88F4E1DB7; Tue, 3 Apr 2018 21:08:11 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33L8Bc0014610; Tue, 3 Apr 2018 21:08:11 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33L8AEc014593; Tue, 3 Apr 2018 21:08:10 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804032108.w33L8AEc014593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 3 Apr 2018 21:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331949 - in head/usr.bin: . etdump X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in head/usr.bin: . etdump X-SVN-Commit-Revision: 331949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:08:12 -0000 Author: benno Date: Tue Apr 3 21:08:10 2018 New Revision: 331949 URL: https://svnweb.freebsd.org/changeset/base/331949 Log: Add the etdump utility for dumping El Torito boot catalog information. This can be used to check existing images but will be used in the future to find EFI ESP images placed in El Torito catalogs so they can be used for hybrid boot purposes. Reviewed by: imp (code), sbruno (man page), bcr (man page) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14952 Added: head/usr.bin/etdump/ head/usr.bin/etdump/Makefile (contents, props changed) head/usr.bin/etdump/etdump.1 (contents, props changed) head/usr.bin/etdump/etdump.c (contents, props changed) head/usr.bin/etdump/etdump.h (contents, props changed) head/usr.bin/etdump/output_shell.c (contents, props changed) head/usr.bin/etdump/output_text.c (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Apr 3 20:59:46 2018 (r331948) +++ head/usr.bin/Makefile Tue Apr 3 21:08:10 2018 (r331949) @@ -41,6 +41,7 @@ SUBDIR= alias \ elfdump \ enigma \ env \ + etdump \ expand \ false \ fetch \ Added: head/usr.bin/etdump/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/etdump/Makefile Tue Apr 3 21:08:10 2018 (r331949) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PROG= etdump + +MAKEFS_SRC= ${SRCTOP}/usr.sbin/makefs + +CFLAGS+= -I${SRCTOP}/sys/fs/cd9660 -I${MAKEFS_SRC} \ + -I${MAKEFS_SRC}/cd9660 + +.PATH: ${MAKEFS_SRC}/cd9660 + +SRCS= etdump.c output_shell.c output_text.c cd9660_conversion.c + +.include Added: head/usr.bin/etdump/etdump.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/etdump/etdump.1 Tue Apr 3 21:08:10 2018 (r331949) @@ -0,0 +1,104 @@ +.\" Copyright (c) 2018 iXsystems, Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL 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 April 3, 2018 +.Dt ETDUMP 8 +.Os +.Sh NAME +.Nm etdump +.Nd Dump El Torito boot catalog information from ISO images +.Sh SYNOPSIS +.Nm +.Op Fl f Ar format +.Op Fl o Ar file +.Ar +.Sh DESCRIPTION +This program reads El Torito boot catalog information from an ISO image and +outputs it in various formats. +It can be used to check the catalog in an image or to output catalog data in +a format that can be used by other tools such as shell scripts. +.Pp +Supported options are: +.Bl -tag -width flag +.It Fl f Ar format Fl -format Ar format +Select the output format. +Supported output formats are: +.Bl -tag -width shell -offset indent +.It Sy text +Human-readable text (default) +.It Sy shell +Each boot entry is emitted as a string suitable for passing to a sh-compatible +eval command. +The variables emitted are: +.Bl -tag -width et_platform -offset indent +.It et_platform +The platform ID from the section header. +Set to 'default' for the initial (default) entry. +.It et_system +The system ID from the boot entry. +.It et_lba +The starting LBA (2048-byte blocks) of the boot image. +.It et_sectors +The number of sectors (512-byte sectors) that comprise the boot image. +.El +.El +.It Fl o Ar file Fl -output Ar file +Write output to +.Ar file . +If '-' is specified then standard out is used. +.El +.Sh EXAMPLES +To see what entries are in a given boot catalog run +.Nm +passing the filename of the image as an argument like so: +.Bd -literal -offset indent +% etdump bootonly.iso +Image in bootonly.iso +Default entry + System i386 + Start LBA 420 (0x1a4), sector count 4 (0x4) + Media type: no emulation + +Section header: efi, final + Section entry + System i386 + Start LBA 20 (0x14), sector count 1600 (0x640) + Media type: no emulation +.Ed +.Pp +To use the output in a shell script a for loop can be used to iterate over the +entries returned using eval: +.Bd -literal -offset indent +for entry in `etdump --format shell bootonly.iso`; do + eval $entry + echo $et_platform $et_system $et_lba $et_sectors +done +.Ed +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 12.0 . Added: head/usr.bin/etdump/etdump.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/etdump/etdump.c Tue Apr 3 21:08:10 2018 (r331949) @@ -0,0 +1,268 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL 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 "cd9660.h" +#include "cd9660_eltorito.h" + +#include "etdump.h" + +const char * +system_id_string(u_char system_id) +{ + + switch (system_id) { + case ET_SYS_X86: + return ("i386"); + case ET_SYS_PPC: + return ("powerpc"); + case ET_SYS_MAC: + return ("mac"); + case ET_SYS_EFI: + return ("efi"); + default: + return ("invalid"); + } +} + +const char * +media_type_string(u_char media_type) +{ + + switch (media_type) { + case ET_MEDIA_NOEM: + return ("no emulation"); + case ET_MEDIA_12FDD: + return ("1.2MB FDD"); + case ET_MEDIA_144FDD: + return ("1.44MB FDD"); + case ET_MEDIA_288FDD: + return ("2.88MB FDD"); + case ET_MEDIA_HDD: + return ("HDD"); + default: + return ("invalid"); + } +} + +static int +read_sector(FILE *iso, daddr_t sector, char *buffer) +{ + + fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET); + if (fread(buffer, ISO_DEFAULT_BLOCK_SIZE, 1, iso) != 1) { + return (errno); + } + return (0); +} + +static bool +boot_catalog_valid(char *entry) +{ + boot_catalog_validation_entry *ve; + int16_t checksum, sum; + unsigned char *csptr; + size_t i; + + ve = (boot_catalog_validation_entry *)entry; + + checksum = isonum_721(ve->checksum); + cd9660_721(0, ve->checksum); + csptr = (unsigned char *)ve; + + for (i = sum = 0; i < sizeof(*ve); i += 2) { + sum += (int16_t)csptr[i]; + sum += 256 * (int16_t)csptr[i + 1]; + } + if (sum + checksum != 0) { + return (false); + } + + cd9660_721(checksum, ve->checksum); + return (true); +} + +static int +dump_section(char *buffer, size_t offset, FILE *outfile, const char *filename, + struct outputter *outputter) +{ + boot_catalog_section_header *sh; + u_char platform_id; + int i; + size_t entry_offset; + boot_catalog_section_entry *entry; + + sh = (boot_catalog_section_header *)&buffer[offset]; + if (outputter->output_section != NULL) { + outputter->output_section(outfile, filename, sh); + } + + platform_id = sh->platform_id[0]; + + if (outputter->output_entry != NULL) { + for (i = 1; i <= (int)sh->num_section_entries[0]; i++) { + entry_offset = offset + i * ET_BOOT_ENTRY_SIZE; + entry = + (boot_catalog_section_entry *)&buffer[entry_offset]; + outputter->output_entry(outfile, filename, entry, + platform_id, false); + } + } + + return (1 + (int)sh->num_section_entries[0]); +} + +static void +dump_eltorito(FILE *iso, const char *filename, FILE *outfile, + struct outputter *outputter) +{ + char buffer[ISO_DEFAULT_BLOCK_SIZE], *entry; + boot_volume_descriptor *bvd; + daddr_t boot_catalog; + size_t offset; + int entry_count; + + if (read_sector(iso, 17, buffer) != 0) + err(1, "failed to read from image"); + + bvd = (boot_volume_descriptor *)buffer; + if (memcmp(bvd->identifier, ISO_VOLUME_DESCRIPTOR_STANDARD_ID, 5) != 0) + warnx("%s: not a valid ISO", filename); + if (bvd->boot_record_indicator[0] != ISO_VOLUME_DESCRIPTOR_BOOT) + warnx("%s: not an El Torito bootable ISO", filename); + if (memcmp(bvd->boot_system_identifier, ET_ID, 23) != 0) + warnx("%s: not an El Torito bootable ISO", filename); + + boot_catalog = isonum_731(bvd->boot_catalog_pointer); + + if (read_sector(iso, boot_catalog, buffer) != 0) + err(1, "failed to read from image"); + + entry = buffer; + offset = 0; + + if (!boot_catalog_valid(entry)) + warnx("%s: boot catalog checksum is invalid", filename); + + if (outputter->output_image != NULL) + outputter->output_image(outfile, filename, bvd); + + offset += ET_BOOT_ENTRY_SIZE; + entry = &buffer[offset]; + if (outputter->output_entry != NULL) + outputter->output_entry(outfile, filename, + (boot_catalog_section_entry *)entry, 0, true); + + offset += ET_BOOT_ENTRY_SIZE; + + while (offset < ISO_DEFAULT_BLOCK_SIZE) { + entry = &buffer[offset]; + + if ((uint8_t)entry[0] != ET_SECTION_HEADER_MORE && + (uint8_t)entry[0] != ET_SECTION_HEADER_LAST) + break; + + entry_count = dump_section(buffer, offset, outfile, filename, + outputter); + + offset += entry_count * ET_BOOT_ENTRY_SIZE; + } +} + +static void +usage(const char *progname) +{ + char *path; + + path = strdup(progname); + + fprintf(stderr, "usage: %s [-f format] [-o filename] filename [...]\n", + basename(path)); + fprintf(stderr, "\tsupported output formats: shell, text\n"); + exit(1); +} + +int +main(int argc, char **argv) +{ + int ch, i; + FILE *outfile, *iso; + struct outputter *outputter; + + outfile = stdout; + outputter = output_text; + + static struct option longopts[] = { + { "format", required_argument, NULL, 'f' }, + { "output", required_argument, NULL, 'o' }, + { NULL, 0, NULL, 0 }, + }; + + while ((ch = getopt_long(argc, argv, "f:o:", longopts, NULL)) != -1) { + switch (ch) { + case 'f': + if (strcmp(optarg, "shell") == 0) + outputter = output_shell; + else if (strcmp(optarg, "text") == 0) + outputter = output_text; + else + usage(argv[0]); + break; + case 'o': + if (strcmp(optarg, "-") == 0) { + outfile = stdout; + } else if ((outfile = fopen(optarg, "w")) == NULL) { + err(1, "unable to open %s for output", optarg); + } + break; + default: + usage(argv[0]); + } + } + + argc -= optind; + argv += optind; + + for (i = 0; i < argc; i++) { + printf("%d %s\n", optind, argv[i]); + if (strcmp(argv[i], "-") == 0) { + iso = stdin; + } else { + iso = fopen(argv[i], "r"); + if (iso == NULL) + err(1, "could not open %s", argv[1]); + } + dump_eltorito(iso, argv[i], outfile, outputter); + } +} Added: head/usr.bin/etdump/etdump.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/etdump/etdump.h Tue Apr 3 21:08:10 2018 (r331949) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL 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 _ETDUMP_H_ +#define _ETDUMP_H_ + +struct outputter { + void (*output_image)(FILE *outfile, const char *filename, + boot_volume_descriptor *bvd); + void (*output_section)(FILE *outfile, const char *filename, + boot_catalog_section_header *bcsh); + void (*output_entry)(FILE *outfile, const char *filename, + boot_catalog_section_entry *bcse, + u_char platform_id, bool initial); +}; + +extern struct outputter *output_text; +extern struct outputter *output_shell; + +const char *system_id_string(u_char system_id); +const char *media_type_string(u_char media_type); + +#endif /* _ETDUMP_H_ */ + Added: head/usr.bin/etdump/output_shell.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/etdump/output_shell.c Tue Apr 3 21:08:10 2018 (r331949) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL 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 "cd9660.h" +#include "cd9660_eltorito.h" + +#include "etdump.h" + +static void +output_entry(FILE *outfile, const char *filename __unused, + boot_catalog_section_entry *bcse, u_char platform_id, bool initial) +{ + const char *platform; + + switch (bcse->boot_indicator[0]) { + case ET_BOOTABLE: + break; + case ET_NOT_BOOTABLE: + default: + return; + } + + if (initial) + platform = "default"; + else + platform = system_id_string(platform_id); + + fprintf(outfile, + "et_platform=%s;et_system=%s;et_lba=%d;et_sectors=%d\n", + platform, system_id_string(bcse->system_type[0]), + isonum_731(bcse->load_rba), isonum_721(bcse->sector_count)); +} + +static struct outputter _output_shell = { + .output_image = NULL, + .output_section = NULL, + .output_entry = output_entry, +}; + +struct outputter *output_shell = &_output_shell; Added: head/usr.bin/etdump/output_text.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/etdump/output_text.c Tue Apr 3 21:08:10 2018 (r331949) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL 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 "cd9660.h" +#include "cd9660_eltorito.h" + +#include "etdump.h" + +static void +output_image(FILE *outfile, const char *filename, boot_volume_descriptor *bvd __unused) +{ + + fprintf(outfile, "Image in %s\n", filename); +} + +static void +output_section(FILE *outfile, const char *filename __unused, + boot_catalog_section_header *bcsh) +{ + + fprintf(outfile, "\nSection header: %s", + system_id_string(bcsh->platform_id[0])); + + if (bcsh->header_indicator[0] == ET_SECTION_HEADER_LAST) + fprintf(outfile, ", final\n"); + else + fprintf(outfile, "\n"); +} + +static void +output_entry(FILE *outfile, const char *filename __unused, + boot_catalog_section_entry *bcse, u_char platform_id __unused, + bool initial) +{ + const char *indent; + + switch (bcse->boot_indicator[0]) { + case ET_BOOTABLE: + break; + case ET_NOT_BOOTABLE: + default: + return; + } + + if (initial) { + fprintf(outfile, "Default entry\n"); + indent = "\t"; + } else { + fprintf(outfile, "\tSection entry\n"); + indent = "\t\t"; + } + + fprintf(outfile, "%sSystem %s\n", indent, + system_id_string(bcse->system_type[0])); + fprintf(outfile, "%sStart LBA %d (0x%x), sector count %d (0x%x)\n", + indent, isonum_731(bcse->load_rba), isonum_731(bcse->load_rba), + isonum_721(bcse->sector_count), isonum_721(bcse->sector_count)); + fprintf(outfile, "%sMedia type: %s\n", indent, + media_type_string(bcse->media_type[0])); +} + +static struct outputter _output_text = { + .output_image = output_image, + .output_section = output_section, + .output_entry = output_entry, +}; + +struct outputter *output_text = &_output_text; From owner-svn-src-all@freebsd.org Tue Apr 3 21:16:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DECADF813E1; Tue, 3 Apr 2018 21:16:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9042275151; Tue, 3 Apr 2018 21:16:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A9ED1F5E; Tue, 3 Apr 2018 21:16:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LGfWX027162; Tue, 3 Apr 2018 21:16:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33LGfRq027160; Tue, 3 Apr 2018 21:16:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804032116.w33LGfRq027160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 3 Apr 2018 21:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331950 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 331950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:16:42 -0000 Author: mav Date: Tue Apr 3 21:16:41 2018 New Revision: 331950 URL: https://svnweb.freebsd.org/changeset/base/331950 Log: 9434 Speculative prefetch is blocked by device removal code. Device removal code does not set spa_indirect_vdevs_loaded for pools that never experienced device removal. At least one visual consequence of it is completely blocked speculative prefetcher. This patch sets the variable in such situations. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c Tue Apr 3 21:08:10 2018 (r331949) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c Tue Apr 3 21:16:41 2018 (r331950) @@ -368,6 +368,7 @@ spa_remove_init(spa_t *spa) spa->spa_removing_phys.sr_state = DSS_NONE; spa->spa_removing_phys.sr_removing_vdev = -1; spa->spa_removing_phys.sr_prev_indirect_vdev = -1; + spa->spa_indirect_vdevs_loaded = B_TRUE; return (0); } else if (error != 0) { return (error); From owner-svn-src-all@freebsd.org Tue Apr 3 21:17:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6BB3F81463; Tue, 3 Apr 2018 21:17:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 563FD752A3; Tue, 3 Apr 2018 21:17:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 508881F60; Tue, 3 Apr 2018 21:17:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LHKqm027885; Tue, 3 Apr 2018 21:17:20 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33LHJkZ027875; Tue, 3 Apr 2018 21:17:19 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032117.w33LHJkZ027875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 21:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331951 - in head/sys/arm: conf include mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm: conf include mv X-SVN-Commit-Revision: 331951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:17:20 -0000 Author: mw Date: Tue Apr 3 21:17:19 2018 New Revision: 331951 URL: https://svnweb.freebsd.org/changeset/base/331951 Log: Enable ArmadaXP using INTRNG interrupt controller Defining INTRNG remove some necessary registers and declarations of pic_init_secondary, pic_ipi_send, pic_ipi_read and pic_ipi_clear. Because Marvell ArmadaXP and Armada38X always use INTRNG, include all INTRNG code and remove code that does not use it. Separate pic registers declarations for Armada38X are unnecessary, it works properly with ArmadaXP config. Submitted by: Rafal Kozik Reviewed by: andrew Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14734 Modified: head/sys/arm/conf/ARMADAXP head/sys/arm/include/intr.h head/sys/arm/mv/mpic.c head/sys/arm/mv/mvreg.h Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue Apr 3 21:16:41 2018 (r331950) +++ head/sys/arm/conf/ARMADAXP Tue Apr 3 21:17:19 2018 (r331951) @@ -88,3 +88,5 @@ device pci options FDT # Configure using FDT/DTB data options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=db78460.dts + +options INTRNG Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Tue Apr 3 21:16:41 2018 (r331950) +++ head/sys/arm/include/intr.h Tue Apr 3 21:17:19 2018 (r331951) @@ -84,13 +84,6 @@ int intr_pic_ipi_setup(u_int, const char *, intr_ipi_h #define NIRQ 288 #elif defined(CPU_ARM1176) #define NIRQ 128 -#elif defined(SOC_MV_ARMADAXP) -#define MAIN_IRQ_NUM 116 -#define ERR_IRQ_NUM 32 -#define ERR_IRQ (MAIN_IRQ_NUM) -#define MSI_IRQ_NUM 32 -#define MSI_IRQ (ERR_IRQ + ERR_IRQ_NUM) -#define NIRQ (MAIN_IRQ_NUM + ERR_IRQ_NUM + MSI_IRQ_NUM) #else #define NIRQ 32 #endif Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Tue Apr 3 21:16:41 2018 (r331950) +++ head/sys/arm/mv/mpic.c Tue Apr 3 21:17:19 2018 (r331951) @@ -103,12 +103,10 @@ __FBSDID("$FreeBSD$"); #define MPIC_PPI 32 -#ifdef INTRNG struct mv_mpic_irqsrc { struct intr_irqsrc mmi_isrc; u_int mmi_irq; }; -#endif struct mv_mpic_softc { device_t sc_dev; @@ -120,9 +118,7 @@ struct mv_mpic_softc { bus_space_tag_t drbl_bst; bus_space_handle_t drbl_bsh; struct mtx mtx; -#ifdef INTRNG struct mv_mpic_irqsrc * mpic_isrcs; -#endif int nirqs; void * intr_hand; }; @@ -155,10 +151,12 @@ static void mpic_mask_irq(uintptr_t nb); static void mpic_mask_irq_err(uintptr_t nb); static void mpic_unmask_irq_err(uintptr_t nb); static boolean_t mpic_irq_is_percpu(uintptr_t); -#ifdef INTRNG static int mpic_intr(void *arg); -#endif static void mpic_unmask_msi(void); +void mpic_init_secondary(device_t); +void mpic_ipi_send(device_t, struct intr_irqsrc*, cpuset_t, u_int); +int mpic_ipi_read(int); +void mpic_ipi_clear(int); #define MPIC_WRITE(softc, reg, val) \ bus_space_write_4((softc)->mpic_bst, (softc)->mpic_bsh, (reg), (val)) @@ -189,7 +187,6 @@ mv_mpic_probe(device_t dev) return (0); } -#ifdef INTRNG static int mv_mpic_register_isrcs(struct mv_mpic_softc *sc) { @@ -221,7 +218,6 @@ mv_mpic_register_isrcs(struct mv_mpic_softc *sc) } return (0); } -#endif static int mv_mpic_attach(device_t dev) @@ -246,13 +242,11 @@ mv_mpic_attach(device_t dev) device_printf(dev, "could not allocate resources\n"); return (ENXIO); } -#ifdef INTRNG if (sc->mpic_res[3] == NULL) device_printf(dev, "No interrupt to use.\n"); else bus_setup_intr(dev, sc->mpic_res[3], INTR_TYPE_CLK, mpic_intr, NULL, sc, &sc->intr_hand); -#endif sc->mpic_bst = rman_get_bustag(sc->mpic_res[0]); sc->mpic_bsh = rman_get_bushandle(sc->mpic_res[0]); @@ -272,7 +266,6 @@ mv_mpic_attach(device_t dev) val = MPIC_READ(mv_mpic_sc, MPIC_CTRL); sc->nirqs = MPIC_CTRL_NIRQS(val); -#ifdef INTRNG if (mv_mpic_register_isrcs(sc) != 0) { device_printf(dev, "could not register PIC ISRCs\n"); bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); @@ -286,7 +279,6 @@ mv_mpic_attach(device_t dev) bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); return (ENXIO); } -#endif mpic_unmask_msi(); @@ -299,7 +291,6 @@ mv_mpic_attach(device_t dev) return (0); } -#ifdef INTRNG static int mpic_intr(void *arg) { @@ -386,20 +377,19 @@ static void mpic_post_filter(device_t dev, struct intr_irqsrc *isrc) { } -#endif static device_method_t mv_mpic_methods[] = { DEVMETHOD(device_probe, mv_mpic_probe), DEVMETHOD(device_attach, mv_mpic_attach), -#ifdef INTRNG DEVMETHOD(pic_disable_intr, mpic_disable_intr), DEVMETHOD(pic_enable_intr, mpic_enable_intr), DEVMETHOD(pic_map_intr, mpic_map_intr), DEVMETHOD(pic_post_filter, mpic_post_filter), DEVMETHOD(pic_post_ithread, mpic_post_ithread), DEVMETHOD(pic_pre_ithread, mpic_pre_ithread), -#endif + DEVMETHOD(pic_init_secondary, mpic_init_secondary), + DEVMETHOD(pic_ipi_send, mpic_ipi_send), { 0, 0 } }; @@ -414,46 +404,6 @@ static devclass_t mv_mpic_devclass; EARLY_DRIVER_MODULE(mpic, simplebus, mv_mpic_driver, mv_mpic_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); -#ifndef INTRNG -int -arm_get_next_irq(int last) -{ - u_int irq, next = -1; - - irq = mv_mpic_get_cause() & MPIC_IRQ_MASK; - CTR2(KTR_INTR, "%s: irq:%#x", __func__, irq); - - if (irq != MPIC_IRQ_MASK) { - if (irq == MPIC_INT_ERR) - irq = mv_mpic_get_cause_err(); - if (irq == MPIC_INT_MSI) - irq = mv_mpic_get_msi(); - next = irq; - } - - CTR3(KTR_INTR, "%s: last=%d, next=%d", __func__, last, next); - return (next); -} - -/* - * XXX We can make arm_enable_irq to operate on ICE and then mask/unmask only - * by ISM/ICM and remove access to ICE in masking operation - */ -void -arm_mask_irq(uintptr_t nb) -{ - - mpic_mask_irq(nb); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - - mpic_unmask_irq(nb); -} -#endif - static void mpic_unmask_msi(void) { @@ -621,15 +571,13 @@ mv_msi_data(int irq, uint64_t *addr, uint32_t *data) return (0); } - -#if defined(SMP) && defined(SOC_MV_ARMADAXP) void -intr_pic_init_secondary(void) +mpic_init_secondary(device_t dev) { } void -pic_ipi_send(cpuset_t cpus, u_int ipi) +mpic_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus, u_int ipi) { uint32_t val, i; @@ -642,7 +590,7 @@ pic_ipi_send(cpuset_t cpus, u_int ipi) } int -pic_ipi_read(int i __unused) +mpic_ipi_read(int i __unused) { uint32_t val; int ipi; @@ -658,8 +606,6 @@ pic_ipi_read(int i __unused) } void -pic_ipi_clear(int ipi) +mpic_ipi_clear(int ipi) { } - -#endif Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Tue Apr 3 21:16:41 2018 (r331950) +++ head/sys/arm/mv/mvreg.h Tue Apr 3 21:17:19 2018 (r331951) @@ -54,12 +54,6 @@ #define ENDPOINT_IRQ_MASK(n) 0x30 #define ENDPOINT_IRQ_MASK_HI(n) 0x34 #define ENDPOINT_IRQ_CAUSE_SELECT 0x38 -#elif defined (SOC_MV_ARMADAXP) -#define IRQ_CAUSE 0x18 -#define IRQ_MASK 0x30 -#elif defined (SOC_MV_ARMADA38X) -#define MSI_IRQ 0x3ff -#define ERR_IRQ 0x3ff #else #define IRQ_CAUSE 0x0 #define IRQ_MASK 0x4 @@ -74,6 +68,14 @@ #define IRQ_MASK_ERROR (-1) /* interrupt controller code */ #endif +#define MAIN_IRQ_NUM 116 +#define ERR_IRQ_NUM 32 +#define ERR_IRQ (MAIN_IRQ_NUM) +#define MSI_IRQ (ERR_IRQ + ERR_IRQ_NUM) + +#define MSI_IRQ_NUM 32 + +#define IRQ_CPU_SELF 0x00000001 #if defined(SOC_MV_ARMADAXP) #define BRIDGE_IRQ_CAUSE 0x68 #define IRQ_TIMER0 0x00000001 From owner-svn-src-all@freebsd.org Tue Apr 3 21:22:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7AFF81B8F; Tue, 3 Apr 2018 21:22:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7EB75970; Tue, 3 Apr 2018 21:22:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A69F211F; Tue, 3 Apr 2018 21:22:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LMhSH037640; Tue, 3 Apr 2018 21:22:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33LMhOD037638; Tue, 3 Apr 2018 21:22:43 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804032122.w33LMhOD037638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 3 Apr 2018 21:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331952 - stable/11/sys/cddl/dev/fbt/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/cddl/dev/fbt/arm X-SVN-Commit-Revision: 331952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:22:44 -0000 Author: gonzo Date: Tue Apr 3 21:22:43 2018 New Revision: 331952 URL: https://svnweb.freebsd.org/changeset/base/331952 Log: MFC r312378 by andrew: Use the kernel stack in the ARM FBT DTrace provider. This is used to find the fifth argument to functions being traced, however there was an error where the userspace stack was being used. This may be invalid leading to a kernel panic if this address is unmapped. Submitted by: Graeme Jenkinson Differential Revision: https://reviews.freebsd.org/D9229 MFC commit fields PR: 211389 Modified: stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c Tue Apr 3 21:17:19 2018 (r331951) +++ stable/11/sys/cddl/dev/fbt/arm/fbt_isa.c Tue Apr 3 21:22:43 2018 (r331952) @@ -61,7 +61,7 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin /* Get 5th parameter from stack */ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - fifthparam = *(register_t *)frame->tf_usr_sp; + fifthparam = *(register_t *)frame->tf_svc_sp; DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); dtrace_probe(fbt->fbtp_id, frame->tf_r0, From owner-svn-src-all@freebsd.org Tue Apr 3 21:25:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ACB8F81E8D; Tue, 3 Apr 2018 21:25:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E37F075CD6; Tue, 3 Apr 2018 21:25:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE643212A; Tue, 3 Apr 2018 21:25:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LPF4p040445; Tue, 3 Apr 2018 21:25:15 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33LPFIK040441; Tue, 3 Apr 2018 21:25:15 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032125.w33LPFIK040441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 21:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331953 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 331953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:25:16 -0000 Author: mw Date: Tue Apr 3 21:25:15 2018 New Revision: 331953 URL: https://svnweb.freebsd.org/changeset/base/331953 Log: Make Marvell mv_pci.c driver generic PCI ports differ between Marvell SoCs, but have the same compatible in FDT. Identification is made based on parent compatible during attach. For ArmadaXP skipping enable procedure is necessary. To achieve it sc_skip_enable_procedure flag is used. For Armada38x find root procedure is necessary. For other SoCs root link is always at slot 0. sc_enable_find_root_slot flag is used to select proper behaviour. Marvell armv5 platforms does not support msi. Submitted by: Rafal Kozik Reviewed by: andrew Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14735 Modified: head/sys/arm/mv/mv_pci.c head/sys/arm/mv/mvwin.h Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Apr 3 21:22:43 2018 (r331952) +++ head/sys/arm/mv/mv_pci.c Tue Apr 3 21:25:15 2018 (r331953) @@ -308,6 +308,9 @@ struct mv_pcib_softc { int sc_type; int sc_mode; /* Endpoint / Root Complex */ + int sc_msi_supported; + int sc_skip_enable_procedure; + int sc_enable_find_root_slot; struct ofw_bus_iinfo sc_pci_iinfo; }; @@ -341,11 +344,10 @@ static uint32_t mv_pcib_read_config(device_t, u_int, u static void mv_pcib_write_config(device_t, u_int, u_int, u_int, u_int, uint32_t, int); static int mv_pcib_route_interrupt(device_t, device_t, int); -#if defined(SOC_MV_ARMADAXP) + static int mv_pcib_alloc_msi(device_t, device_t, int, int, int *); static int mv_pcib_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); static int mv_pcib_release_msi(device_t, device_t, int, int *); -#endif /* * Bus interface definitions. @@ -371,11 +373,10 @@ static device_method_t mv_pcib_methods[] = { DEVMETHOD(pcib_write_config, mv_pcib_write_config), DEVMETHOD(pcib_route_interrupt, mv_pcib_route_interrupt), DEVMETHOD(pcib_request_feature, pcib_request_feature_allow), -#if defined(SOC_MV_ARMADAXP) + DEVMETHOD(pcib_alloc_msi, mv_pcib_alloc_msi), DEVMETHOD(pcib_release_msi, mv_pcib_release_msi), DEVMETHOD(pcib_map_msi, mv_pcib_map_msi), -#endif /* OFW bus interface */ DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), @@ -442,9 +443,19 @@ mv_pcib_attach(device_t self) if (ofw_bus_node_is_compatible(node, "mrvl,pcie")) { sc->sc_type = MV_TYPE_PCIE; - sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id); - sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id); - sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id); + if (ofw_bus_node_is_compatible(parnode, "marvell,armada-370-pcie")) { + sc->sc_win_target = MV_WIN_PCIE_TARGET_ARMADA38X(port_id); + sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR_ARMADA38X(port_id); + sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR_ARMADA38X(port_id); + sc->sc_enable_find_root_slot = 1; + } else { + sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id); + sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id); + sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id); +#if __ARM_ARCH >= 6 + sc->sc_skip_enable_procedure = 1; +#endif + } } else if (ofw_bus_node_is_compatible(node, "mrvl,pci")) { sc->sc_type = MV_TYPE_PCI; sc->sc_win_target = MV_WIN_PCI_TARGET; @@ -541,9 +552,11 @@ static void mv_pcib_enable(struct mv_pcib_softc *sc, uint32_t unit) { uint32_t val; -#if !defined(SOC_MV_ARMADAXP) int timeout; + if (sc->sc_skip_enable_procedure) + goto pcib_enable_root_mode; + /* * Check if PCIE device is enabled. */ @@ -561,9 +574,8 @@ mv_pcib_enable(struct mv_pcib_softc *sc, uint32_t unit PCIE_REG_STATUS); } } -#endif - +pcib_enable_root_mode: if (sc->sc_mode == MV_MODE_ROOT) { /* * Enable PCI bridge. @@ -1042,20 +1054,19 @@ mv_pcib_maxslots(device_t dev) static int mv_pcib_root_slot(device_t dev, u_int bus, u_int slot, u_int func) { -#if defined(SOC_MV_ARMADA38X) struct mv_pcib_softc *sc = device_get_softc(dev); uint32_t vendor, device; +/* On platforms other than Armada38x, root link is always at slot 0 */ + if (!sc->sc_enable_find_root_slot) + return (slot == 0); + vendor = mv_pcib_hw_cfgread(sc, bus, slot, func, PCIR_VENDOR, PCIR_VENDOR_LENGTH); device = mv_pcib_hw_cfgread(sc, bus, slot, func, PCIR_DEVICE, PCIR_DEVICE_LENGTH) & MV_DEV_FAMILY_MASK; return (vendor == PCI_VENDORID_MRVL && device == MV_DEV_ARMADA38X); -#else - /* On platforms other than Armada38x, root link is always at slot 0 */ - return (slot == 0); -#endif } static uint32_t @@ -1159,7 +1170,6 @@ mv_pcib_decode_win(phandle_t node, struct mv_pcib_soft return (0); } -#if defined(SOC_MV_ARMADAXP) static int mv_pcib_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, uint32_t *data) @@ -1167,6 +1177,9 @@ mv_pcib_map_msi(device_t dev, device_t child, int irq, struct mv_pcib_softc *sc; sc = device_get_softc(dev); + if (!sc->sc_msi_supported) + return (ENOTSUP); + irq = irq - MSI_IRQ; /* validate parameters */ @@ -1175,7 +1188,9 @@ mv_pcib_map_msi(device_t dev, device_t child, int irq, return (EINVAL); } +#if __ARM_ARCH >= 6 mv_msi_data(irq, addr, data); +#endif debugf("%s: irq: %d addr: %jx data: %x\n", __func__, irq, *addr, *data); @@ -1190,10 +1205,13 @@ mv_pcib_alloc_msi(device_t dev, device_t child, int co struct mv_pcib_softc *sc; u_int start = 0, i; + sc = device_get_softc(dev); + if (!sc->sc_msi_supported) + return (ENOTSUP); + if (powerof2(count) == 0 || count > MSI_IRQ_NUM) return (EINVAL); - sc = device_get_softc(dev); mtx_lock(&sc->sc_msi_mtx); for (start = 0; (start + count) < MSI_IRQ_NUM; start++) { @@ -1227,6 +1245,9 @@ mv_pcib_release_msi(device_t dev, device_t child, int u_int i; sc = device_get_softc(dev); + if(!sc->sc_msi_supported) + return (ENOTSUP); + mtx_lock(&sc->sc_msi_mtx); for (i = 0; i < count; i++) @@ -1235,5 +1256,3 @@ mv_pcib_release_msi(device_t dev, device_t child, int mtx_unlock(&sc->sc_msi_mtx); return (0); } -#endif - Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Tue Apr 3 21:22:43 2018 (r331952) +++ head/sys/arm/mv/mvwin.h Tue Apr 3 21:25:15 2018 (r331953) @@ -64,12 +64,8 @@ #define MV_PCI_PORTS 1 /* 1x PCIE */ #elif defined(SOC_MV_DISCOVERY) #define MV_PCI_PORTS 8 /* 8x PCIE */ -#elif defined(SOC_MV_ARMADAXP) -#define MV_PCI_PORTS 3 /* 3x PCIE */ -#elif defined(SOC_MV_ARMADA38X) -#define MV_PCI_PORTS 4 /* 4x PCIE */ #else -#error "MV_PCI_PORTS not configured !" +#define MV_PCI_PORTS 1 /* 1x PCIE -> worst case */ #endif /* PCI/PCIE Memory */ @@ -77,15 +73,11 @@ #define MV_PCI_MEM_SIZE (512 * 1024 * 1024) /* 512 MB */ #define MV_PCI_MEM_BASE MV_PCI_MEM_PHYS_BASE #define MV_PCI_MEM_SLICE_SIZE (MV_PCI_MEM_SIZE / MV_PCI_PORTS) -#define MV_PCI_MEM_SLICE(n) (MV_PCI_MEM_BASE + ((n) * \ - MV_PCI_MEM_SLICE_SIZE)) /* PCI/PCIE I/O */ #define MV_PCI_IO_PHYS_BASE 0xBF000000 #define MV_PCI_IO_SIZE (16 * 1024 * 1024) /* 16 MB */ #define MV_PCI_IO_BASE MV_PCI_IO_PHYS_BASE #define MV_PCI_IO_SLICE_SIZE (MV_PCI_IO_SIZE / MV_PCI_PORTS) -#define MV_PCI_IO_SLICE(n) (MV_PCI_IO_BASE + ((n) * MV_PCI_IO_SLICE_SIZE)) - #define MV_PCI_VA_MEM_BASE 0 #define MV_PCI_VA_IO_BASE 0 @@ -131,22 +123,9 @@ #define MV_PCI_BASE (MV_BASE + 0x30000) #define MV_PCI_SIZE 0x2000 -#if defined(SOC_MV_ARMADA38X) -#define MV_PCIE_BASE (MV_BASE + 0x80000) -#else +#define MV_PCIE_BASE_ARMADA38X (MV_BASE + 0x80000) #define MV_PCIE_BASE (MV_BASE + 0x40000) -#endif #define MV_PCIE_SIZE 0x2000 - -#define MV_PCIE00_BASE (MV_PCIE_BASE + 0x00000) -#define MV_PCIE01_BASE (MV_PCIE_BASE + 0x04000) -#define MV_PCIE02_BASE (MV_PCIE_BASE + 0x08000) -#define MV_PCIE03_BASE (MV_PCIE_BASE + 0x0C000) -#define MV_PCIE10_BASE (MV_PCIE_BASE + 0x40000) -#define MV_PCIE11_BASE (MV_PCIE_BASE + 0x44000) -#define MV_PCIE12_BASE (MV_PCIE_BASE + 0x48000) -#define MV_PCIE13_BASE (MV_PCIE_BASE + 0x4C000) - #define MV_SDIO_BASE (MV_BASE + 0x90000) #define MV_SDIO_SIZE 0x10000 @@ -255,22 +234,24 @@ #define MV_XOR_CHAN_MAX 2 #define MV_XOR_NON_REMAP 4 +#define MV_WIN_PCIE_TARGET_ARMADAXP(n) (4 + (4 * ((n) % 2))) +#define MV_WIN_PCIE_MEM_ATTR_ARMADAXP(n) (0xE8 + (0x10 * ((n) / 2))) +#define MV_WIN_PCIE_IO_ATTR_ARMADAXP(n) (0xE0 + (0x10 * ((n) / 2))) +#define MV_WIN_PCIE_TARGET_ARMADA38X(n) ((n) == 0 ? 8 : 4) +#define MV_WIN_PCIE_MEM_ATTR_ARMADA38X(n) ((n) < 2 ? 0xE8 : (0xD8 - (((n) % 2) * 0x20))) +#define MV_WIN_PCIE_IO_ATTR_ARMADA38X(n) ((n) < 2 ? 0xE0 : (0xD0 - (((n) % 2) * 0x20))) #if defined(SOC_MV_DISCOVERY) || defined(SOC_MV_KIRKWOOD) #define MV_WIN_PCIE_TARGET(n) 4 #define MV_WIN_PCIE_MEM_ATTR(n) 0xE8 #define MV_WIN_PCIE_IO_ATTR(n) 0xE0 -#elif defined(SOC_MV_ARMADAXP) -#define MV_WIN_PCIE_TARGET(n) (4 + (4 * ((n) % 2))) -#define MV_WIN_PCIE_MEM_ATTR(n) (0xE8 + (0x10 * ((n) / 2))) -#define MV_WIN_PCIE_IO_ATTR(n) (0xE0 + (0x10 * ((n) / 2))) -#elif defined(SOC_MV_ARMADA38X) -#define MV_WIN_PCIE_TARGET(n) ((n) == 0 ? 8 : 4) -#define MV_WIN_PCIE_MEM_ATTR(n) ((n) < 2 ? 0xE8 : (0xD8 - (((n) % 2) * 0x20))) -#define MV_WIN_PCIE_IO_ATTR(n) ((n) < 2 ? 0xE0 : (0xD0 - (((n) % 2) * 0x20))) #elif defined(SOC_MV_ORION) #define MV_WIN_PCIE_TARGET(n) 4 #define MV_WIN_PCIE_MEM_ATTR(n) 0x59 #define MV_WIN_PCIE_IO_ATTR(n) 0x51 +#else +#define MV_WIN_PCIE_TARGET(n) (4 + (4 * ((n) % 2))) +#define MV_WIN_PCIE_MEM_ATTR(n) (0xE8 + (0x10 * ((n) / 2))) +#define MV_WIN_PCIE_IO_ATTR(n) (0xE0 + (0x10 * ((n) / 2))) #endif #define MV_WIN_PCI_TARGET 3 From owner-svn-src-all@freebsd.org Tue Apr 3 21:38:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD1D8F82CB0; Tue, 3 Apr 2018 21:38:12 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3A276764; Tue, 3 Apr 2018 21:38:12 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55E5922DD; Tue, 3 Apr 2018 21:38:12 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LcCwp057698; Tue, 3 Apr 2018 21:38:12 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33LcBiD057685; Tue, 3 Apr 2018 21:38:11 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032138.w33LcBiD057685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 21:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331954 - in head/sys/arm/mv: . armada38x armadaxp X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm/mv: . armada38x armadaxp X-SVN-Commit-Revision: 331954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:38:13 -0000 Author: mw Date: Tue Apr 3 21:38:11 2018 New Revision: 331954 URL: https://svnweb.freebsd.org/changeset/base/331954 Log: Split get_sar_value function for Marvell ArmadaXP and Armada38X get_sar_value is implemented only for ArmadaXP and Armada38X. Splitting it for two different functions and change registers names result in more generic code. Submitted by: Rafal Kozik Reviewed by: andrew Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14736 Modified: head/sys/arm/mv/armada38x/armada38x.c head/sys/arm/mv/armadaxp/armadaxp.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvvar.h Modified: head/sys/arm/mv/armada38x/armada38x.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x.c Tue Apr 3 21:25:15 2018 (r331953) +++ head/sys/arm/mv/armada38x/armada38x.c Tue Apr 3 21:38:11 2018 (r331954) @@ -43,11 +43,23 @@ int armada38x_open_bootrom_win(void); int armada38x_scu_enable(void); int armada38x_win_set_iosync_barrier(void); int armada38x_mbus_optimization(void); +static uint64_t get_sar_value_armada38x(void); static int hw_clockrate; SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); +static uint64_t +get_sar_value_armada38x(void) +{ + uint32_t sar_low, sar_high; + + sar_high = 0; + sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE, + SAMPLE_AT_RESET_ARMADA38X); + return (((uint64_t)sar_high << 32) | sar_low); +} + uint32_t get_tclk(void) { @@ -57,8 +69,8 @@ get_tclk(void) * On Armada38x TCLK can be configured to 250 MHz or 200 MHz. * Current setting is read from Sample At Reset register. */ - sar = (uint32_t)get_sar_value(); - sar = (sar & TCLK_MASK) >> TCLK_SHIFT; + sar = (uint32_t)get_sar_value_armada38x(); + sar = (sar & TCLK_MASK_ARMADA38X) >> TCLK_SHIFT_ARMADA38X; if (sar == 0) return (TCLK_250MHZ); else @@ -78,7 +90,7 @@ get_cpu_freq(void) 1866, 0, 0, 2000 }; - sar = (uint32_t)get_sar_value(); + sar = (uint32_t)get_sar_value_armada38x(); sar = (sar & A38X_CPU_DDR_CLK_MASK) >> A38X_CPU_DDR_CLK_SHIFT; if (sar >= nitems(cpu_frequencies)) return (0); Modified: head/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr 3 21:25:15 2018 (r331953) +++ head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr 3 21:38:11 2018 (r331954) @@ -55,6 +55,7 @@ static uint32_t count_l2clk(void); void armadaxp_l2_init(void); void armadaxp_init_coher_fabric(void); int platform_get_ncpus(void); +static uint64_t get_sar_value_armadaxp(void); #define ARMADAXP_L2_BASE (MV_BASE + 0x8000) #define ARMADAXP_L2_CTRL 0x100 @@ -124,6 +125,18 @@ static uint16_t cpu_clock_table[] = { 1000, 1066, 1200, 1333, 1500, 1666, 1800, 2000, 600, 667, 800, 1600, 2133, 2200, 2400 }; +static uint64_t +get_sar_value_armadaxp(void) +{ + uint32_t sar_low, sar_high; + + sar_high = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE, + SAMPLE_AT_RESET_HI); + sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE, + SAMPLE_AT_RESET_LO); + return (((uint64_t)sar_high << 32) | sar_low); +} + uint32_t get_tclk(void) { @@ -153,7 +166,7 @@ count_l2clk(void) uint8_t sar_cpu_freq, sar_fab_freq, array_size; /* Get value of the SAR register and process it */ - sar_reg = get_sar_value(); + sar_reg = get_sar_value_armadaxp(); sar_cpu_freq = CPU_FREQ_FIELD(sar_reg); sar_fab_freq = FAB_FREQ_FIELD(sar_reg); Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Apr 3 21:25:15 2018 (r331953) +++ head/sys/arm/mv/mv_common.c Tue Apr 3 21:38:11 2018 (r331954) @@ -2664,28 +2664,3 @@ fdt_pic_decode_t fdt_pic_table[] = { NULL }; #endif - -uint64_t -get_sar_value(void) -{ - uint32_t sar_low, sar_high; - -#if defined(SOC_MV_ARMADAXP) - sar_high = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE, - SAMPLE_AT_RESET_HI); - sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE, - SAMPLE_AT_RESET_LO); -#elif defined(SOC_MV_ARMADA38X) - sar_high = 0; - sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE, - SAMPLE_AT_RESET); -#else - /* - * TODO: Add getting proper values for other SoC configurations - */ - sar_high = 0; - sar_low = 0; -#endif - - return (((uint64_t)sar_high << 32) | sar_low); -} Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Tue Apr 3 21:25:15 2018 (r331953) +++ head/sys/arm/mv/mvreg.h Tue Apr 3 21:38:11 2018 (r331954) @@ -327,13 +327,10 @@ #define SAMPLE_AT_RESET 0x10 #elif defined(SOC_MV_KIRKWOOD) #define SAMPLE_AT_RESET 0x30 -#elif defined(SOC_MV_ARMADA38X) -#define SAMPLE_AT_RESET 0x400 #endif -#if defined(SOC_MV_DISCOVERY) || defined(SOC_MV_ARMADAXP) -#define SAMPLE_AT_RESET_LO 0x30 -#define SAMPLE_AT_RESET_HI 0x34 -#endif +#define SAMPLE_AT_RESET_ARMADA38X 0x400 +#define SAMPLE_AT_RESET_LO 0x30 +#define SAMPLE_AT_RESET_HI 0x34 /* * Clocks @@ -344,10 +341,10 @@ #elif defined(SOC_MV_DISCOVERY) #define TCLK_MASK 0x00000180 #define TCLK_SHIFT 0x07 -#elif defined(SOC_MV_ARMADA38X) -#define TCLK_MASK 0x00008000 -#define TCLK_SHIFT 15 #endif + +#define TCLK_MASK_ARMADA38X 0x00008000 +#define TCLK_SHIFT_ARMADA38X 15 #define TCLK_100MHZ 100000000 #define TCLK_125MHZ 125000000 Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Tue Apr 3 21:25:15 2018 (r331953) +++ head/sys/arm/mv/mvvar.h Tue Apr 3 21:38:11 2018 (r331954) @@ -89,7 +89,6 @@ void soc_id(uint32_t *dev, uint32_t *rev); void soc_dump_decode_win(void); uint32_t soc_power_ctrl_get(uint32_t mask); void soc_power_ctrl_set(uint32_t mask); -uint64_t get_sar_value(void); int decode_win_cpu_set(int target, int attr, vm_paddr_t base, uint32_t size, vm_paddr_t remap); From owner-svn-src-all@freebsd.org Tue Apr 3 21:44:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ABB2F83404; Tue, 3 Apr 2018 21:44:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD33976DA1; Tue, 3 Apr 2018 21:44:43 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C80932481; Tue, 3 Apr 2018 21:44:43 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LihCL068964; Tue, 3 Apr 2018 21:44:43 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33Lihl6068963; Tue, 3 Apr 2018 21:44:43 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201804032144.w33Lihl6068963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 3 Apr 2018 21:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331955 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 331955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:44:44 -0000 Author: jilles Date: Tue Apr 3 21:44:43 2018 New Revision: 331955 URL: https://svnweb.freebsd.org/changeset/base/331955 Log: rc.subr.8: Improve documentation of ${name}_limits and ${name}_login_class Submitted by: 0mp Differential Revision: https://reviews.freebsd.org/D14928 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Tue Apr 3 21:38:11 2018 (r331954) +++ head/share/man/man8/rc.subr.8 Tue Apr 3 21:44:43 2018 (r331955) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2016 +.Dd April 3, 2018 .Dt RC.SUBR 8 .Os .Sh NAME @@ -584,21 +584,27 @@ Only supported after .Pa /usr is mounted. .It Va ${name}_limits -.Xr limits 1 -to apply to +Resource limits to apply to .Va command . This will be passed as arguments to the .Xr limits 1 utility. +By default, the resource limits are based on the login class defined in +.Va ${name}_login_class . +.It Va ${name}_login_class +Login class to use with +.Va ${name}_limits . +Defaults to +.Dq Li daemon . .It Va ${name}_oomprotect .Xr protect 1 .Va command from being killed when swap space is exhausted. If -.Em YES +.Dq Li YES is used, no child processes are protected. If -.Em ALL , +.Dq Li ALL , protect all child processes. .It Va ${name}_program Full path to the command. From owner-svn-src-all@freebsd.org Tue Apr 3 21:46:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E79F83603; Tue, 3 Apr 2018 21:46:28 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FC3976FA1; Tue, 3 Apr 2018 21:46:28 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ABDE249B; Tue, 3 Apr 2018 21:46:28 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33LkSqc070575; Tue, 3 Apr 2018 21:46:28 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33LkSUA070574; Tue, 3 Apr 2018 21:46:28 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032146.w33LkSUA070574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 21:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331956 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 331956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:46:28 -0000 Author: mw Date: Tue Apr 3 21:46:28 2018 New Revision: 331956 URL: https://svnweb.freebsd.org/changeset/base/331956 Log: Make validation in Marvell mv_common.c generic Validate only drivers used by given platform. Pointers to validation function are added to soc_node_spec structure. Submitted by: Rafal Kozik Reviewed by: andrew Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14737 Modified: head/sys/arm/mv/mv_common.c Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Apr 3 21:44:43 2018 (r331955) +++ head/sys/arm/mv/mv_common.c Tue Apr 3 21:46:28 2018 (r331956) @@ -138,6 +138,7 @@ const struct decode_win *cpu_wins = cpu_win_tbl; typedef void (*decode_win_setup_t)(u_long); typedef void (*dump_win_t)(u_long); +typedef int (*valid_t)(void); /* * The power status of device feature is only supported on @@ -153,22 +154,27 @@ struct soc_node_spec { const char *compat; decode_win_setup_t decode_handler; dump_win_t dump_handler; + valid_t valid_handler; }; static struct soc_node_spec soc_nodes[] = { - { "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump }, - { "marvell,armada-370-neta", &decode_win_neta_setup, &decode_win_neta_dump }, - { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, - { "marvell,orion-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, - { "marvell,armada-380-xhci", &decode_win_usb3_setup, &decode_win_usb3_dump }, - { "marvell,armada-380-ahci", &decode_win_ahci_setup, &decode_win_ahci_dump }, - { "marvell,armada-380-sdhci", &decode_win_sdhci_setup, &decode_win_sdhci_dump }, - { "mrvl,sata", &decode_win_sata_setup, NULL }, - { "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump }, - { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump }, - { "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump }, - { "mrvl,pcie", &decode_win_pcie_setup, &decode_win_pcie_dump }, - { NULL, NULL, NULL }, + { "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump, &decode_win_eth_valid}, + { "marvell,armada-370-neta", &decode_win_neta_setup, + &decode_win_neta_dump, NULL }, + { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump, &decode_win_usb_valid}, + { "marvell,orion-ehci", &decode_win_usb_setup, &decode_win_usb_dump, &decode_win_usb_valid }, + { "marvell,armada-380-xhci", &decode_win_usb3_setup, + &decode_win_usb3_dump, &decode_win_usb3_valid }, + { "marvell,armada-380-ahci", &decode_win_ahci_setup, + &decode_win_ahci_dump, NULL }, + { "marvell,armada-380-sdhci", &decode_win_sdhci_setup, + &decode_win_sdhci_dump, &decode_win_sdhci_valid}, + { "mrvl,sata", &decode_win_sata_setup, NULL, &decode_win_sata_valid}, + { "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump, &decode_win_xor_valid}, + { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump, &decode_win_idma_valid}, + { "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump, &decode_win_cesa_valid}, + { "mrvl,pcie", &decode_win_pcie_setup, &decode_win_pcie_dump, &decode_win_pcie_valid}, + { NULL, NULL, NULL, NULL }, }; struct fdt_pm_mask_entry { @@ -595,12 +601,6 @@ soc_decode_win(void) return(err); #endif - if (!decode_win_cpu_valid() || !decode_win_usb_valid() || - !decode_win_eth_valid() || !decode_win_idma_valid() || - !decode_win_pcie_valid() || !decode_win_sata_valid() || - !decode_win_xor_valid() || !decode_win_usb3_valid() || - !decode_win_sdhci_valid() || !decode_win_cesa_valid()) - return (EINVAL); decode_win_cpu_setup(); if (MV_DUMP_WIN) @@ -2461,6 +2461,10 @@ fdt_win_process(phandle_t child) else base = fdt_data_get(®[addr_cells - 2], 2); size = fdt_data_get(®[addr_cells], size_cells); + + if (soc_node->valid_handler != NULL) + if (!soc_node->valid_handler()) + return (EINVAL); base = (base & 0x000fffff) | fdt_immr_va; if (soc_node->decode_handler != NULL) From owner-svn-src-all@freebsd.org Tue Apr 3 21:54:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B3E9F83D35; Tue, 3 Apr 2018 21:54:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A51B77553; Tue, 3 Apr 2018 21:54:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34450263E; Tue, 3 Apr 2018 21:54:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33Lsbne083291; Tue, 3 Apr 2018 21:54:37 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33Lsa4h083279; Tue, 3 Apr 2018 21:54:36 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032154.w33Lsa4h083279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 21:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331957 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 331957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 21:54:37 -0000 Author: mw Date: Tue Apr 3 21:54:36 2018 New Revision: 331957 URL: https://svnweb.freebsd.org/changeset/base/331957 Log: Make mv_common.c generic for Marvell Armada38X and ArmadaXP Preparation for adding Armada38X and ArmadaXP SoC to GENERIC config. Supported platform are listed in soc_family enum. struct decode_win_spec contains platform specific functions and constants. Function mv_check_soc_family checks SoC type and chooses proper structure in runtime, as well as platform-dependent functions. Unnecessary dummy functions are removed. Because of changing registers name to more generic new definition of FDT_DEVMAP_MAX in mv_machdep is added. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14738 Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvvar.h head/sys/arm/mv/mvwin.h Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Apr 3 21:46:28 2018 (r331956) +++ head/sys/arm/mv/mv_common.c Tue Apr 3 21:54:36 2018 (r331957) @@ -76,6 +76,19 @@ MALLOC_DEFINE(M_IDMA, "idma", "idma dma test memory"); #define MV_DUMP_WIN 0 #endif +static enum soc_family soc_family; + +static int mv_win_cesa_attr(int wng_sel); +static int mv_win_cesa_attr_armv5(int eng_sel); +static int mv_win_cesa_attr_armada38x(int eng_sel); +static int mv_win_cesa_attr_armadaxp(int eng_sel); + +uint32_t read_cpu_ctrl_armv5(uint32_t reg); +uint32_t read_cpu_ctrl_armv7(uint32_t reg); + +void write_cpu_ctrl_armv5(uint32_t reg, uint32_t val); +void write_cpu_ctrl_armv7(uint32_t reg, uint32_t val); + static int win_eth_can_remap(int i); static int decode_win_cesa_valid(void); @@ -91,9 +104,7 @@ static int decode_win_idma_valid(void); static int decode_win_xor_valid(void); static void decode_win_cpu_setup(void); -#ifdef SOC_MV_ARMADAXP static int decode_win_sdram_fixup(void); -#endif static void decode_win_cesa_setup(u_long); static void decode_win_usb_setup(u_long); static void decode_win_usb3_setup(u_long); @@ -117,11 +128,48 @@ static void decode_win_ahci_dump(u_long base); static void decode_win_sdhci_dump(u_long); static void decode_win_pcie_dump(u_long); +static uint32_t win_cpu_cr_read(int); +static uint32_t win_cpu_armv5_cr_read(int); +static uint32_t win_cpu_armv7_cr_read(int); +static uint32_t win_cpu_br_read(int); +static uint32_t win_cpu_armv5_br_read(int); +static uint32_t win_cpu_armv7_br_read(int); +static uint32_t win_cpu_remap_l_read(int); +static uint32_t win_cpu_armv5_remap_l_read(int); +static uint32_t win_cpu_armv7_remap_l_read(int); +static uint32_t win_cpu_remap_h_read(int); +static uint32_t win_cpu_armv5_remap_h_read(int); +static uint32_t win_cpu_armv7_remap_h_read(int); + +static void win_cpu_cr_write(int, uint32_t); +static void win_cpu_armv5_cr_write(int, uint32_t); +static void win_cpu_armv7_cr_write(int, uint32_t); +static void win_cpu_br_write(int, uint32_t); +static void win_cpu_armv5_br_write(int, uint32_t); +static void win_cpu_armv7_br_write(int, uint32_t); +static void win_cpu_remap_l_write(int, uint32_t); +static void win_cpu_armv5_remap_l_write(int, uint32_t); +static void win_cpu_armv7_remap_l_write(int, uint32_t); +static void win_cpu_remap_h_write(int, uint32_t); +static void win_cpu_armv5_remap_h_write(int, uint32_t); +static void win_cpu_armv7_remap_h_write(int, uint32_t); + +static uint32_t ddr_br_read(int); +static uint32_t ddr_sz_read(int); +static uint32_t ddr_armv5_br_read(int); +static uint32_t ddr_armv5_sz_read(int); +static uint32_t ddr_armv7_br_read(int); +static uint32_t ddr_armv7_sz_read(int); +static void ddr_br_write(int, uint32_t); +static void ddr_sz_write(int, uint32_t); +static void ddr_armv5_br_write(int, uint32_t); +static void ddr_armv5_sz_write(int, uint32_t); +static void ddr_armv7_br_write(int, uint32_t); +static void ddr_armv7_sz_write(int, uint32_t); + static int fdt_get_ranges(const char *, void *, int, int *, int *); -#ifdef SOC_MV_ARMADA38X int gic_decode_fdt(phandle_t iparent, pcell_t *intr, int *interrupt, int *trig, int *pol); -#endif static int win_cpu_from_dt(void); static int fdt_win_setup(void); @@ -177,6 +225,95 @@ static struct soc_node_spec soc_nodes[] = { { NULL, NULL, NULL, NULL }, }; +typedef uint32_t(*read_cpu_ctrl_t)(uint32_t); +typedef void(*write_cpu_ctrl_t)(uint32_t, uint32_t); +typedef uint32_t (*win_read_t)(int); +typedef void (*win_write_t)(int, uint32_t); +typedef int (*win_cesa_attr_t)(int); + +struct decode_win_spec { + read_cpu_ctrl_t read_cpu_ctrl; + write_cpu_ctrl_t write_cpu_ctrl; + win_read_t cr_read; + win_read_t br_read; + win_read_t remap_l_read; + win_read_t remap_h_read; + win_write_t cr_write; + win_write_t br_write; + win_write_t remap_l_write; + win_write_t remap_h_write; + uint32_t mv_win_cpu_max; + win_cesa_attr_t win_cesa_attr; + int win_cesa_target; + win_read_t ddr_br_read; + win_read_t ddr_sz_read; + win_write_t ddr_br_write; + win_write_t ddr_sz_write; +}; + +struct decode_win_spec *soc_decode_win_spec; + +static struct decode_win_spec decode_win_specs[] = +{ + { + &read_cpu_ctrl_armv7, + &write_cpu_ctrl_armv7, + &win_cpu_armv7_cr_read, + &win_cpu_armv7_br_read, + &win_cpu_armv7_remap_l_read, + &win_cpu_armv7_remap_h_read, + &win_cpu_armv7_cr_write, + &win_cpu_armv7_br_write, + &win_cpu_armv7_remap_l_write, + &win_cpu_armv7_remap_h_write, + MV_WIN_CPU_MAX_ARMV7, + &mv_win_cesa_attr_armada38x, + MV_WIN_CESA_TARGET_ARMADA38X, + &ddr_armv7_br_read, + &ddr_armv7_sz_read, + &ddr_armv7_br_write, + &ddr_armv7_sz_write, + }, + { + &read_cpu_ctrl_armv7, + &write_cpu_ctrl_armv7, + &win_cpu_armv7_cr_read, + &win_cpu_armv7_br_read, + &win_cpu_armv7_remap_l_read, + &win_cpu_armv7_remap_h_read, + &win_cpu_armv7_cr_write, + &win_cpu_armv7_br_write, + &win_cpu_armv7_remap_l_write, + &win_cpu_armv7_remap_h_write, + MV_WIN_CPU_MAX_ARMV7, + &mv_win_cesa_attr_armadaxp, + MV_WIN_CESA_TARGET_ARMADAXP, + &ddr_armv7_br_read, + &ddr_armv7_sz_read, + &ddr_armv7_br_write, + &ddr_armv7_sz_write, + }, + { + &read_cpu_ctrl_armv5, + &write_cpu_ctrl_armv5, + &win_cpu_armv5_cr_read, + &win_cpu_armv5_br_read, + &win_cpu_armv5_remap_l_read, + &win_cpu_armv5_remap_h_read, + &win_cpu_armv5_cr_write, + &win_cpu_armv5_br_write, + &win_cpu_armv5_remap_l_write, + &win_cpu_armv5_remap_h_write, + MV_WIN_CPU_MAX, + &mv_win_cesa_attr_armv5, + MV_WIN_CESA_TARGET, + &ddr_armv5_br_read, + &ddr_armv5_sz_read, + &ddr_armv5_br_write, + &ddr_armv5_sz_write, + }, +}; + struct fdt_pm_mask_entry { char *compat; uint32_t mask; @@ -237,6 +374,74 @@ pm_is_disabled(uint32_t mask) * This feature can be used only on Kirkwood and Discovery * machines. */ + +static int mv_win_cesa_attr(int eng_sel) +{ + + if (soc_decode_win_spec->win_cesa_attr != NULL) + return (soc_decode_win_spec->win_cesa_attr(eng_sel)); + + return (-1); +} + +static int mv_win_cesa_attr_armv5(int eng_sel) +{ + + return MV_WIN_CESA_ATTR(eng_sel); +} + +static int mv_win_cesa_attr_armada38x(int eng_sel) +{ + + return MV_WIN_CESA_ATTR_ARMADA38X(eng_sel); +} + +static int mv_win_cesa_attr_armadaxp(int eng_sel) +{ + + return MV_WIN_CESA_ATTR_ARMADAXP(eng_sel); +} + +enum soc_family +mv_check_soc_family() +{ + uint32_t dev, rev; + + soc_id(&dev, &rev); + switch (dev) { + case MV_DEV_MV78230: + case MV_DEV_MV78260: + case MV_DEV_MV78460: + soc_decode_win_spec = &decode_win_specs[MV_SOC_ARMADA_XP]; + soc_family = MV_SOC_ARMADA_XP; + return (MV_SOC_ARMADA_XP); + case MV_DEV_88F6828: + case MV_DEV_88F6820: + case MV_DEV_88F6810: + soc_decode_win_spec = &decode_win_specs[MV_SOC_ARMADA_38X]; + soc_family = MV_SOC_ARMADA_38X; + return (MV_SOC_ARMADA_38X); + case MV_DEV_88F5181: + case MV_DEV_88F5182: + case MV_DEV_88F5281: + case MV_DEV_88F6281: + case MV_DEV_88RC8180: + case MV_DEV_88RC9480: + case MV_DEV_88RC9580: + case MV_DEV_88F6781: + case MV_DEV_88F6282: + case MV_DEV_MV78100_Z0: + case MV_DEV_MV78100: + case MV_DEV_MV78160: + soc_decode_win_spec = &decode_win_specs[MV_SOC_ARMV5]; + soc_family = MV_SOC_ARMV5; + return (MV_SOC_ARMV5); + default: + soc_family = MV_SOC_UNSUPPORTED; + return (MV_SOC_UNSUPPORTED); + } +} + static __inline void pm_disable_device(int mask) { @@ -297,17 +502,47 @@ uint32_t read_cpu_ctrl(uint32_t reg) { + if (soc_decode_win_spec->read_cpu_ctrl != NULL) + return (soc_decode_win_spec->read_cpu_ctrl(reg)); + return (-1); +} + +uint32_t +read_cpu_ctrl_armv5(uint32_t reg) +{ + return (bus_space_read_4(fdtbus_bs_tag, MV_CPU_CONTROL_BASE, reg)); } +uint32_t +read_cpu_ctrl_armv7(uint32_t reg) +{ + + return (bus_space_read_4(fdtbus_bs_tag, MV_CPU_CONTROL_BASE_ARMV7, reg)); +} + void write_cpu_ctrl(uint32_t reg, uint32_t val) { + if (soc_decode_win_spec->write_cpu_ctrl != NULL) + soc_decode_win_spec->write_cpu_ctrl(reg, val); +} + +void +write_cpu_ctrl_armv5(uint32_t reg, uint32_t val) +{ + bus_space_write_4(fdtbus_bs_tag, MV_CPU_CONTROL_BASE, reg, val); } -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) +void +write_cpu_ctrl_armv7(uint32_t reg, uint32_t val) +{ + + bus_space_write_4(fdtbus_bs_tag, MV_CPU_CONTROL_BASE_ARMV7, reg, val); +} + uint32_t read_cpu_mp_clocks(uint32_t reg) { @@ -335,7 +570,6 @@ write_cpu_misc(uint32_t reg, uint32_t val) bus_space_write_4(fdtbus_bs_tag, MV_MISC_BASE, reg, val); } -#endif void cpu_reset(void) @@ -414,6 +648,8 @@ soc_power_ctrl_set(uint32_t mask) void soc_id(uint32_t *dev, uint32_t *rev) { + uint64_t mv_pcie_base = MV_PCIE_BASE; + phandle_t node; /* * Notice: system identifiers are available in the registers range of @@ -421,8 +657,15 @@ soc_id(uint32_t *dev, uint32_t *rev) * possible) after the internal registers range has been mapped in via * devmap_bootstrap(). */ - *dev = bus_space_read_4(fdtbus_bs_tag, MV_PCIE_BASE, 0) >> 16; - *rev = bus_space_read_4(fdtbus_bs_tag, MV_PCIE_BASE, 8) & 0xff; + *dev = 0; + *rev = 0; + if ((node = OF_finddevice("/")) == -1) + return; + if (ofw_bus_node_is_compatible(node, "marvell,armada380")) + mv_pcie_base = MV_PCIE_BASE_ARMADA38X; + + *dev = bus_space_read_4(fdtbus_bs_tag, mv_pcie_base, 0) >> 16; + *rev = bus_space_read_4(fdtbus_bs_tag, mv_pcie_base, 8) & 0xff; } static void @@ -596,10 +839,9 @@ soc_decode_win(void) /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); -#ifdef SOC_MV_ARMADAXP - if ((err = decode_win_sdram_fixup()) != 0) - return(err); -#endif + if (soc_family == MV_SOC_ARMADA_XP) + if ((err = decode_win_sdram_fixup()) != 0) + return(err); decode_win_cpu_setup(); @@ -617,15 +859,92 @@ soc_decode_win(void) /************************************************************************** * Decode windows registers accessors **************************************************************************/ -WIN_REG_IDX_RD(win_cpu, cr, MV_WIN_CPU_CTRL, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_RD(win_cpu, br, MV_WIN_CPU_BASE, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_RD(win_cpu, remap_l, MV_WIN_CPU_REMAP_LO, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_RD(win_cpu, remap_h, MV_WIN_CPU_REMAP_HI, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_WR(win_cpu, cr, MV_WIN_CPU_CTRL, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_WR(win_cpu, br, MV_WIN_CPU_BASE, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_WR(win_cpu, remap_l, MV_WIN_CPU_REMAP_LO, MV_MBUS_BRIDGE_BASE) -WIN_REG_IDX_WR(win_cpu, remap_h, MV_WIN_CPU_REMAP_HI, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv5, cr, MV_WIN_CPU_CTRL_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv5, br, MV_WIN_CPU_BASE_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv5, remap_l, MV_WIN_CPU_REMAP_LO_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv5, remap_h, MV_WIN_CPU_REMAP_HI_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv5, cr, MV_WIN_CPU_CTRL_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv5, br, MV_WIN_CPU_BASE_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv5, remap_l, MV_WIN_CPU_REMAP_LO_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv5, remap_h, MV_WIN_CPU_REMAP_HI_ARMV5, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv7, cr, MV_WIN_CPU_CTRL_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv7, br, MV_WIN_CPU_BASE_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv7, remap_l, MV_WIN_CPU_REMAP_LO_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_RD(win_cpu_armv7, remap_h, MV_WIN_CPU_REMAP_HI_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv7, cr, MV_WIN_CPU_CTRL_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv7, br, MV_WIN_CPU_BASE_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv7, remap_l, MV_WIN_CPU_REMAP_LO_ARMV7, MV_MBUS_BRIDGE_BASE) +WIN_REG_IDX_WR(win_cpu_armv7, remap_h, MV_WIN_CPU_REMAP_HI_ARMV7, MV_MBUS_BRIDGE_BASE) + +static uint32_t +win_cpu_cr_read(int i) +{ + + if (soc_decode_win_spec->cr_read != NULL) + return (soc_decode_win_spec->cr_read(i)); + return (-1); +} + +static uint32_t +win_cpu_br_read(int i) +{ + + if (soc_decode_win_spec->br_read != NULL) + return (soc_decode_win_spec->br_read(i)); + return (-1); +} + +static uint32_t +win_cpu_remap_l_read(int i) +{ + + if (soc_decode_win_spec->remap_l_read != NULL) + return (soc_decode_win_spec->remap_l_read(i)); + return (-1); +} + +static uint32_t +win_cpu_remap_h_read(int i) +{ + + if (soc_decode_win_spec->remap_h_read != NULL) + return soc_decode_win_spec->remap_h_read(i); + return (-1); +} + +static void +win_cpu_cr_write(int i, uint32_t val) +{ + + if (soc_decode_win_spec->cr_write != NULL) + soc_decode_win_spec->cr_write(i, val); +} + +static void +win_cpu_br_write(int i, uint32_t val) +{ + + if (soc_decode_win_spec->br_write != NULL) + soc_decode_win_spec->br_write(i, val); +} + +static void +win_cpu_remap_l_write(int i, uint32_t val) +{ + + if (soc_decode_win_spec->remap_l_write != NULL) + soc_decode_win_spec->remap_l_write(i, val); +} + +static void +win_cpu_remap_h_write(int i, uint32_t val) +{ + + if (soc_decode_win_spec->remap_h_write != NULL) + soc_decode_win_spec->remap_h_write(i, val); +} + WIN_REG_BASE_IDX_RD(win_cesa, cr, MV_WIN_CESA_CTRL) WIN_REG_BASE_IDX_RD(win_cesa, br, MV_WIN_CESA_BASE) WIN_REG_BASE_IDX_WR(win_cesa, cr, MV_WIN_CESA_CTRL) @@ -636,12 +955,10 @@ WIN_REG_BASE_IDX_RD(win_usb, br, MV_WIN_USB_BASE) WIN_REG_BASE_IDX_WR(win_usb, cr, MV_WIN_USB_CTRL) WIN_REG_BASE_IDX_WR(win_usb, br, MV_WIN_USB_BASE) -#ifdef SOC_MV_ARMADA38X WIN_REG_BASE_IDX_RD(win_usb3, cr, MV_WIN_USB3_CTRL) WIN_REG_BASE_IDX_RD(win_usb3, br, MV_WIN_USB3_BASE) WIN_REG_BASE_IDX_WR(win_usb3, cr, MV_WIN_USB3_CTRL) WIN_REG_BASE_IDX_WR(win_usb3, br, MV_WIN_USB3_BASE) -#endif WIN_REG_BASE_IDX_RD(win_eth, br, MV_WIN_ETH_BASE) WIN_REG_BASE_IDX_RD(win_eth, sz, MV_WIN_ETH_SIZE) @@ -692,21 +1009,63 @@ WIN_REG_BASE_IDX_RD(win_sata, cr, MV_WIN_SATA_CTRL); WIN_REG_BASE_IDX_RD(win_sata, br, MV_WIN_SATA_BASE); WIN_REG_BASE_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL); WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN_SATA_BASE); -#if defined(SOC_MV_ARMADA38X) -WIN_REG_BASE_IDX_RD(win_sata, sz, MV_WIN_SATA_SIZE); -WIN_REG_BASE_IDX_WR(win_sata, sz, MV_WIN_SATA_SIZE); -#endif +WIN_REG_BASE_IDX_RD(win_sata_armada38x, sz, MV_WIN_SATA_SIZE_ARMADA38X); +WIN_REG_BASE_IDX_WR(win_sata_armada38x, sz, MV_WIN_SATA_SIZE_ARMADA38X); +WIN_REG_BASE_IDX_RD(win_sata_armada38x, cr, MV_WIN_SATA_CTRL_ARMADA38X); +WIN_REG_BASE_IDX_RD(win_sata_armada38x, br, MV_WIN_SATA_BASE_ARMADA38X); +WIN_REG_BASE_IDX_WR(win_sata_armada38x, cr, MV_WIN_SATA_CTRL_ARMADA38X); +WIN_REG_BASE_IDX_WR(win_sata_armada38x, br, MV_WIN_SATA_BASE_ARMADA38X); + WIN_REG_BASE_IDX_RD(win_sdhci, cr, MV_WIN_SDHCI_CTRL); WIN_REG_BASE_IDX_RD(win_sdhci, br, MV_WIN_SDHCI_BASE); WIN_REG_BASE_IDX_WR(win_sdhci, cr, MV_WIN_SDHCI_CTRL); WIN_REG_BASE_IDX_WR(win_sdhci, br, MV_WIN_SDHCI_BASE); #ifndef SOC_MV_DOVE -WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) -WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) -WIN_REG_IDX_WR(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) -WIN_REG_IDX_WR(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) +WIN_REG_IDX_RD(ddr_armv5, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) +WIN_REG_IDX_RD(ddr_armv5, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) +WIN_REG_IDX_WR(ddr_armv5, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) +WIN_REG_IDX_WR(ddr_armv5, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) + +WIN_REG_IDX_RD(ddr_armv7, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE_ARMV7) +WIN_REG_IDX_RD(ddr_armv7, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE_ARMV7) +WIN_REG_IDX_WR(ddr_armv7, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE_ARMV7) +WIN_REG_IDX_WR(ddr_armv7, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE_ARMV7) + +static inline uint32_t +ddr_br_read(int i) +{ + + if (soc_decode_win_spec->ddr_br_read != NULL) + return (soc_decode_win_spec->ddr_br_read(i)); + return (-1); +} + +static inline uint32_t +ddr_sz_read(int i) +{ + + if (soc_decode_win_spec->ddr_sz_read != NULL) + return (soc_decode_win_spec->ddr_sz_read(i)); + return (-1); +} + +static inline void +ddr_br_write(int i, uint32_t val) +{ + + if (soc_decode_win_spec->ddr_br_write != NULL) + soc_decode_win_spec->ddr_br_write(i, val); +} + +static inline void +ddr_sz_write(int i, uint32_t val) +{ + + if (soc_decode_win_spec->ddr_sz_write != NULL) + soc_decode_win_spec->ddr_sz_write(i, val); +} #else /* * On 88F6781 (Dove) SoC DDR Controller is accessed through @@ -747,12 +1106,9 @@ static inline uint32_t ddr_sz_read(int i) void soc_dump_decode_win(void) { - uint32_t dev, rev; int i; - soc_id(&dev, &rev); - - for (i = 0; i < MV_WIN_CPU_MAX; i++) { + for (i = 0; i < soc_decode_win_spec->mv_win_cpu_max; i++) { printf("CPU window#%d: c 0x%08x, b 0x%08x", i, win_cpu_cr_read(i), win_cpu_br_read(i)); @@ -832,7 +1188,7 @@ decode_win_cpu_valid(void) int i, j, rv; uint32_t b, e, s; - if (cpu_wins_no > MV_WIN_CPU_MAX) { + if (cpu_wins_no > soc_decode_win_spec->mv_win_cpu_max) { printf("CPU windows: too many entries: %d\n", cpu_wins_no); return (0); } @@ -894,14 +1250,14 @@ decode_win_cpu_set(int target, int attr, vm_paddr_t ba int win, i; if (remap == ~0) { - win = MV_WIN_CPU_MAX - 1; + win = soc_decode_win_spec->mv_win_cpu_max - 1; i = -1; } else { win = 0; i = 1; } - while ((win >= 0) && (win < MV_WIN_CPU_MAX)) { + while ((win >= 0) && (win < soc_decode_win_spec->mv_win_cpu_max)) { cr = win_cpu_cr_read(win); if ((cr & MV_WIN_CPU_ENABLE_BIT) == 0) break; @@ -912,7 +1268,7 @@ decode_win_cpu_set(int target, int attr, vm_paddr_t ba break; win += i; } - if ((win < 0) || (win >= MV_WIN_CPU_MAX) || + if ((win < 0) || (win >= soc_decode_win_spec->mv_win_cpu_max) || ((remap != ~0) && (win_cpu_can_remap(win) == 0))) return (-1); @@ -947,7 +1303,7 @@ decode_win_cpu_setup(void) int i; /* Disable all CPU windows */ - for (i = 0; i < MV_WIN_CPU_MAX; i++) { + for (i = 0; i < soc_decode_win_spec->mv_win_cpu_max; i++) { win_cpu_cr_write(i, 0); win_cpu_br_write(i, 0); if (win_cpu_can_remap(i)) { @@ -964,7 +1320,6 @@ decode_win_cpu_setup(void) } -#ifdef SOC_MV_ARMADAXP static int decode_win_sdram_fixup(void) { @@ -1006,7 +1361,6 @@ decode_win_sdram_fixup(void) return (0); } -#endif /* * Check if we're able to cover all active DDR banks. */ @@ -1147,7 +1501,6 @@ decode_win_cesa_setup(u_long base) br = ddr_base(i); size = ddr_size(i); -#ifdef SOC_MV_ARMADA38X /* * Armada 38x SoC's equipped with 4GB DRAM * suffer freeze during CESA operation, if @@ -1156,9 +1509,9 @@ decode_win_cesa_setup(u_long base) * by setting the window size to the closest possible * value, i.e. divide it by 2. */ - if (size + ddr_base(i) == 0x100000000ULL) + if ((soc_family == MV_SOC_ARMADA_38X) && + (size + ddr_base(i) == 0x100000000ULL)) size /= 2; -#endif cr = (((size - 1) & 0xffff0000) | (ddr_attr(i) << IO_WIN_ATTR_SHIFT) | @@ -1248,7 +1601,6 @@ decode_win_usb_setup(u_long base) /************************************************************************** * USB3 windows routines **************************************************************************/ -#ifdef SOC_MV_ARMADA38X static int decode_win_usb3_valid(void) { @@ -1302,28 +1654,8 @@ decode_win_usb3_setup(u_long base) } } } -#else -/* - * Provide dummy functions to satisfy the build - * for SoCs not equipped with USB3 - */ -static int -decode_win_usb3_valid(void) -{ - return (1); -} -static void -decode_win_usb3_setup(u_long base) -{ -} - -static void -decode_win_usb3_dump(u_long base) -{ -} -#endif /************************************************************************** * ETH windows routines **************************************************************************/ @@ -2140,7 +2472,6 @@ decode_win_sata_setup(u_long base) } } -#ifdef SOC_MV_ARMADA38X /* * Configure AHCI decoding windows */ @@ -2150,10 +2481,10 @@ decode_win_ahci_setup(u_long base) uint32_t br, cr, sz; int i, j; - for (i = 0; i < MV_WIN_SATA_MAX; i++) { - win_sata_cr_write(base, i, 0); - win_sata_br_write(base, i, 0); - win_sata_sz_write(base, i, 0); + for (i = 0; i < MV_WIN_SATA_MAX_ARMADA38X; i++) { + win_sata_armada38x_cr_write(base, i, 0); + win_sata_armada38x_br_write(base, i, 0); + win_sata_armada38x_sz_write(base, i, 0); } for (i = 0; i < MV_WIN_DDR_MAX; i++) { @@ -2166,16 +2497,16 @@ decode_win_ahci_setup(u_long base) (IO_WIN_SIZE_MASK << IO_WIN_SIZE_SHIFT); /* Use first available SATA window */ - for (j = 0; j < MV_WIN_SATA_MAX; j++) { - if (win_sata_cr_read(base, j) & IO_WIN_ENA_MASK) + for (j = 0; j < MV_WIN_SATA_MAX_ARMADA38X; j++) { + if (win_sata_armada38x_cr_read(base, j) & IO_WIN_ENA_MASK) continue; /* BASE is set to DRAM base (0x00000000) */ - win_sata_br_write(base, j, br); + win_sata_armada38x_br_write(base, j, br); /* CTRL targets DRAM ctrl with 0x0E or 0x0D */ - win_sata_cr_write(base, j, cr); + win_sata_armada38x_cr_write(base, j, cr); /* SIZE is set to 16MB - max value */ - win_sata_sz_write(base, j, sz); + win_sata_armada38x_sz_write(base, j, sz); break; } } @@ -2187,28 +2518,12 @@ decode_win_ahci_dump(u_long base) { int i; - for (i = 0; i < MV_WIN_SATA_MAX; i++) + for (i = 0; i < MV_WIN_SATA_MAX_ARMADA38X; i++) printf("SATA window#%d: cr 0x%08x, br 0x%08x, sz 0x%08x\n", i, - win_sata_cr_read(base, i), win_sata_br_read(base, i), - win_sata_sz_read(base,i)); + win_sata_armada38x_cr_read(base, i), win_sata_br_read(base, i), + win_sata_armada38x_sz_read(base,i)); } -#else -/* - * Provide dummy functions to satisfy the build - * for SoC's not equipped with AHCI controller - */ -static void -decode_win_ahci_setup(u_long base) -{ -} - -static void -decode_win_ahci_dump(u_long base) -{ -} -#endif - static int decode_win_sata_valid(void) { @@ -2267,12 +2582,7 @@ static int decode_win_sdhci_valid(void) { -#ifdef SOC_MV_ARMADA38X return (decode_win_can_cover_ddr(MV_WIN_SDHCI_MAX)); -#endif - - /* Satisfy platforms not equipped with this controller. */ - return (1); } /************************************************************************** @@ -2384,12 +2694,11 @@ moveon: return (ENOMEM); } - cpu_win_tbl[t].target = MV_WIN_CESA_TARGET; -#ifdef SOC_MV_ARMADA38X - cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(0); -#else - cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(1); -#endif + cpu_win_tbl[t].target = soc_decode_win_spec->win_cesa_target; + if (soc_family == MV_SOC_ARMADA_38X) + cpu_win_tbl[t].attr = soc_decode_win_spec->win_cesa_attr(0); + else + cpu_win_tbl[t].attr = soc_decode_win_spec->win_cesa_attr(1); cpu_win_tbl[t].base = sram_base; cpu_win_tbl[t].size = sram_size; cpu_win_tbl[t].remap = ~0; @@ -2415,8 +2724,8 @@ moveon: } /* Configure window for CESA1 */ - cpu_win_tbl[t].target = MV_WIN_CESA_TARGET; - cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(1); + cpu_win_tbl[t].target = soc_decode_win_spec->win_cesa_target; + cpu_win_tbl[t].attr = soc_decode_win_spec->win_cesa_attr(1); cpu_win_tbl[t].base = sram_base; cpu_win_tbl[t].size = sram_size; cpu_win_tbl[t].remap = ~0; @@ -2661,9 +2970,6 @@ fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int * } fdt_pic_decode_t fdt_pic_table[] = { -#ifdef SOC_MV_ARMADA38X - &gic_decode_fdt, -#endif &fdt_pic_decode_ic, NULL }; Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Tue Apr 3 21:46:28 2018 (r331956) +++ head/sys/arm/mv/mv_machdep.c Tue Apr 3 21:54:36 2018 (r331957) @@ -285,6 +285,9 @@ platform_late_init(void) /* * Re-initialise decode windows */ + if (mv_check_soc_family() == MV_SOC_UNSUPPORTED) + panic("Unsupported SoC family\n"); + if (soc_decode_win() != 0) printf("WARNING: could not re-initialise decode windows! " "Running with existing settings...\n"); @@ -323,8 +326,11 @@ platform_late_init(void) #endif #endif } - +#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) +#define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX_ARMV7 + 2) +#else #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) +#endif static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, } }; Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Tue Apr 3 21:46:28 2018 (r331956) +++ head/sys/arm/mv/mvreg.h Tue Apr 3 21:54:36 2018 (r331957) @@ -87,13 +87,13 @@ #define IRQ_TIMER0 0x00000002 #define IRQ_TIMER1 0x00000004 #define IRQ_TIMER_WD 0x00000008 +#endif #define BRIDGE_IRQ_MASK 0x14 #define IRQ_CPU_MASK 0x00000001 #define IRQ_TIMER0_MASK 0x00000002 #define IRQ_TIMER1_MASK 0x00000004 #define IRQ_TIMER_WD_MASK 0x00000008 -#endif #define IRQ_CPU_SELF_CLR (~IRQ_CPU_SELF) #define IRQ_TIMER0_CLR (~IRQ_TIMER0) @@ -423,7 +423,6 @@ /* * SCU */ -#if defined(SOC_MV_ARMADA38X) #define MV_SCU_BASE (MV_BASE + 0xc000) #define MV_SCU_REGS_LEN 0x100 #define MV_SCU_REG_CTRL 0x00 @@ -431,30 +430,23 @@ #define MV_SCU_ENABLE (1 << 0) #define MV_SCU_SL_L2_ENABLE (1 << 3) #define SCU_CFG_REG_NCPU_MASK 0x3 -#endif /* * PMSU */ -#if defined(SOC_MV_ARMADA38X) #define MV_PMSU_BASE (MV_BASE + 0x22000) #define MV_PMSU_REGS_LEN 0x1000 #define PMSU_BOOT_ADDR_REDIRECT_OFFSET(cpu) (((cpu) * 0x100) + 0x124) -#endif /* * CPU RESET */ -#if defined(SOC_MV_ARMADA38X) #define MV_CPU_RESET_BASE (MV_BASE + 0x20800) #define MV_CPU_RESET_REGS_LEN 0x8 #define CPU_RESET_OFFSET(cpu) ((cpu) * 0x8) #define CPU_RESET_ASSERT 0x1 -#endif -#if defined(SOC_MV_ARMADA38X) #define MV_MBUS_CTRL_BASE (MV_BASE + 0x20420) #define MV_MBUS_CTRL_REGS_LEN 0x10 -#endif #endif /* _MVREG_H_ */ Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Tue Apr 3 21:46:28 2018 (r331956) +++ head/sys/arm/mv/mvvar.h Tue Apr 3 21:54:36 2018 (r331957) @@ -55,6 +55,13 @@ #define MV_MODE_ENDPOINT 0 #define MV_MODE_ROOT 1 +enum soc_family{ + MV_SOC_ARMADA_38X = 0x00, + MV_SOC_ARMADA_XP = 0x01, + MV_SOC_ARMV5 = 0x02, + MV_SOC_UNSUPPORTED = 0xff, +}; + struct gpio_config { int gc_gpio; /* GPIO number */ uint32_t gc_flags; /* GPIO flags */ @@ -110,12 +117,10 @@ uint32_t get_l2clk(void); uint32_t read_cpu_ctrl(uint32_t); void write_cpu_ctrl(uint32_t, uint32_t); -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) uint32_t read_cpu_mp_clocks(uint32_t reg); void write_cpu_mp_clocks(uint32_t reg, uint32_t val); uint32_t read_cpu_misc(uint32_t reg); void write_cpu_misc(uint32_t reg, uint32_t val); -#endif int mv_pcib_bar_win_set(device_t dev, uint32_t base, uint32_t size, uint32_t remap, int winno, int busno); @@ -142,5 +147,5 @@ struct devmap_entry; int mv_pci_devmap(phandle_t, struct devmap_entry *, vm_offset_t, vm_offset_t); int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *); - +enum soc_family mv_check_soc_family(void); #endif /* _MVVAR_H_ */ Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Tue Apr 3 21:46:28 2018 (r331956) +++ head/sys/arm/mv/mvwin.h Tue Apr 3 21:54:36 2018 (r331957) @@ -101,24 +101,18 @@ * Integrated SoC peripherals addresses */ #define MV_BASE MV_PHYS_BASE /* VA == PA mapping */ -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define MV_DDR_CADR_BASE (MV_BASE + 0x20180) -#else +#define MV_DDR_CADR_BASE_ARMV7 (MV_BASE + 0x20180) #define MV_DDR_CADR_BASE (MV_BASE + 0x1500) -#endif #define MV_MPP_BASE (MV_BASE + 0x10000) -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) + #define MV_MISC_BASE (MV_BASE + 0x18200) #define MV_MBUS_BRIDGE_BASE (MV_BASE + 0x20000) #define MV_INTREGS_BASE (MV_MBUS_BRIDGE_BASE + 0x80) #define MV_MP_CLOCKS_BASE (MV_MBUS_BRIDGE_BASE + 0x700) -#define MV_CPU_CONTROL_BASE (MV_MBUS_BRIDGE_BASE + 0x1800) -#else -#define MV_MBUS_BRIDGE_BASE (MV_BASE + 0x20000) -#define MV_INTREGS_BASE (MV_MBUS_BRIDGE_BASE + 0x80) + +#define MV_CPU_CONTROL_BASE_ARMV7 (MV_MBUS_BRIDGE_BASE + 0x1800) #define MV_CPU_CONTROL_BASE (MV_MBUS_BRIDGE_BASE + 0x100) -#endif #define MV_PCI_BASE (MV_BASE + 0x30000) #define MV_PCI_SIZE 0x2000 @@ -132,25 +126,22 @@ /* * Decode windows definitions and macros */ -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define MV_WIN_CPU_CTRL(n) (((n) < 8) ? 0x10 * (n) : 0x90 + (0x8 * ((n) - 8))) -#define MV_WIN_CPU_BASE(n) ((((n) < 8) ? 0x10 * (n) : 0x90 + (0x8 * ((n) - 8))) + 0x4) -#define MV_WIN_CPU_REMAP_LO(n) (0x10 * (n) + 0x008) -#define MV_WIN_CPU_REMAP_HI(n) (0x10 * (n) + 0x00C) -#else -#define MV_WIN_CPU_CTRL(n) (0x10 * (n) + (((n) < 8) ? 0x000 : 0x880)) -#define MV_WIN_CPU_BASE(n) (0x10 * (n) + (((n) < 8) ? 0x004 : 0x884)) -#define MV_WIN_CPU_REMAP_LO(n) (0x10 * (n) + (((n) < 8) ? 0x008 : 0x888)) -#define MV_WIN_CPU_REMAP_HI(n) (0x10 * (n) + (((n) < 8) ? 0x00C : 0x88C)) -#endif +#define MV_WIN_CPU_CTRL_ARMV7(n) (((n) < 8) ? 0x10 * (n) : 0x90 + (0x8 * ((n) - 8))) +#define MV_WIN_CPU_BASE_ARMV7(n) ((((n) < 8) ? 0x10 * (n) : 0x90 + (0x8 * ((n) - 8))) + 0x4) +#define MV_WIN_CPU_REMAP_LO_ARMV7(n) (0x10 * (n) + 0x008) +#define MV_WIN_CPU_REMAP_HI_ARMV7(n) (0x10 * (n) + 0x00C) +#define MV_WIN_CPU_CTRL_ARMV5(n) (0x10 * (n) + (((n) < 8) ? 0x000 : 0x880)) +#define MV_WIN_CPU_BASE_ARMV5(n) (0x10 * (n) + (((n) < 8) ? 0x004 : 0x884)) +#define MV_WIN_CPU_REMAP_LO_ARMV5(n) (0x10 * (n) + (((n) < 8) ? 0x008 : 0x888)) +#define MV_WIN_CPU_REMAP_HI_ARMV5(n) (0x10 * (n) + (((n) < 8) ? 0x00C : 0x88C)) + #if defined(SOC_MV_DISCOVERY) #define MV_WIN_CPU_MAX 14 -#elif defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define MV_WIN_CPU_MAX 20 #else #define MV_WIN_CPU_MAX 8 #endif +#define MV_WIN_CPU_MAX_ARMV7 20 #define MV_WIN_CPU_ATTR_SHIFT 8 #define MV_WIN_CPU_TARGET_SHIFT 4 @@ -170,17 +161,20 @@ #if defined(SOC_MV_DISCOVERY) #define MV_WIN_CESA_TARGET 9 #define MV_WIN_CESA_ATTR(eng_sel) 1 -#elif defined(SOC_MV_ARMADAXP) -#define MV_WIN_CESA_TARGET 9 +#else +#define MV_WIN_CESA_TARGET 3 +#define MV_WIN_CESA_ATTR(eng_sel) 0 +#endif + +#define MV_WIN_CESA_TARGET_ARMADAXP 9 /* * Bits [2:3] of cesa attribute select engine: * eng_sel: * 1: engine1 * 2: engine0 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 3 22:10:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC624F84BC5; Tue, 3 Apr 2018 22:10:51 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A65B77F00; Tue, 3 Apr 2018 22:10:51 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85294281D; Tue, 3 Apr 2018 22:10:51 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33MApFG004568; Tue, 3 Apr 2018 22:10:51 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33MAosI004549; Tue, 3 Apr 2018 22:10:50 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032210.w33MAosI004549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 22:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331958 - in head/sys/arm/mv: . armada38x armadaxp X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm/mv: . armada38x armadaxp X-SVN-Commit-Revision: 331958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 22:10:52 -0000 Author: mw Date: Tue Apr 3 22:10:50 2018 New Revision: 331958 URL: https://svnweb.freebsd.org/changeset/base/331958 Log: Make get_tclk and get_cpu_freq generic for Marvell armv7 SoCs In GENERIC kernel choosing proper get_tclk and get_cpu_freq implementation must be done in runtime. Kernel for both SoC need to have implementation of each other functions, so common file list mv/files.arm7 is added. Marvell armv5 SoC have their own non-generic implementation of those function. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14739 Added: head/sys/arm/mv/files.arm7 (contents, props changed) Modified: head/sys/arm/mv/armada38x/armada38x.c head/sys/arm/mv/armada38x/std.armada38x head/sys/arm/mv/armadaxp/armadaxp.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvvar.h head/sys/arm/mv/std-pj4b.mv Modified: head/sys/arm/mv/armada38x/armada38x.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x.c Tue Apr 3 21:54:36 2018 (r331957) +++ head/sys/arm/mv/armada38x/armada38x.c Tue Apr 3 22:10:50 2018 (r331958) @@ -61,7 +61,7 @@ get_sar_value_armada38x(void) } uint32_t -get_tclk(void) +get_tclk_armada38x(void) { uint32_t sar; @@ -78,7 +78,7 @@ get_tclk(void) } uint32_t -get_cpu_freq(void) +get_cpu_freq_armada38x(void) { uint32_t sar; Modified: head/sys/arm/mv/armada38x/std.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/std.armada38x Tue Apr 3 21:54:36 2018 (r331957) +++ head/sys/arm/mv/armada38x/std.armada38x Tue Apr 3 22:10:50 2018 (r331958) @@ -1,6 +1,7 @@ # $FreeBSD$ files "../mv/armada38x/files.armada38x" files "../mv/files.mv" +files "../mv/files.arm7" cpu CPU_CORTEXA machine arm armv7 Modified: head/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr 3 21:54:36 2018 (r331957) +++ head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr 3 22:10:50 2018 (r331958) @@ -138,7 +138,7 @@ get_sar_value_armadaxp(void) } uint32_t -get_tclk(void) +get_tclk_armadaxp(void) { uint32_t cputype; @@ -152,7 +152,7 @@ get_tclk(void) } uint32_t -get_cpu_freq(void) +get_cpu_freq_armadaxp(void) { return (0); Added: head/sys/arm/mv/files.arm7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/files.arm7 Tue Apr 3 22:10:50 2018 (r331958) @@ -0,0 +1,3 @@ +# $FreeBSD$ +arm/mv/armada38x/armada38x.c standard +arm/mv/armadaxp/armadaxp.c standard Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Apr 3 21:54:36 2018 (r331957) +++ head/sys/arm/mv/mv_common.c Tue Apr 3 22:10:50 2018 (r331958) @@ -230,6 +230,7 @@ typedef void(*write_cpu_ctrl_t)(uint32_t, uint32_t); typedef uint32_t (*win_read_t)(int); typedef void (*win_write_t)(int, uint32_t); typedef int (*win_cesa_attr_t)(int); +typedef uint32_t (*get_t)(void); struct decode_win_spec { read_cpu_ctrl_t read_cpu_ctrl; @@ -249,6 +250,10 @@ struct decode_win_spec { win_read_t ddr_sz_read; win_write_t ddr_br_write; win_write_t ddr_sz_write; +#if __ARM_ARCH >= 6 + get_t get_tclk; + get_t get_cpu_freq; +#endif }; struct decode_win_spec *soc_decode_win_spec; @@ -273,6 +278,10 @@ static struct decode_win_spec decode_win_specs[] = &ddr_armv7_sz_read, &ddr_armv7_br_write, &ddr_armv7_sz_write, +#if __ARM_ARCH >= 6 + &get_tclk_armada38x, + &get_cpu_freq_armada38x, +#endif }, { &read_cpu_ctrl_armv7, @@ -292,6 +301,10 @@ static struct decode_win_spec decode_win_specs[] = &ddr_armv7_sz_read, &ddr_armv7_br_write, &ddr_armv7_sz_write, +#if __ARM_ARCH >= 6 + &get_tclk_armadaxp, + &get_cpu_freq_armadaxp, +#endif }, { &read_cpu_ctrl_armv5, @@ -311,6 +324,10 @@ static struct decode_win_spec decode_win_specs[] = &ddr_armv5_sz_read, &ddr_armv5_br_write, &ddr_armv5_sz_write, +#if __ARM_ARCH >= 6 + NULL, + NULL, +#endif }, }; @@ -2951,6 +2968,28 @@ struct fdt_fixup_entry fdt_fixup_table[] = { { "mrvl,DB-78460", &fdt_fixup_ranges }, { NULL, NULL } }; + +#if __ARM_ARCH >= 6 +uint32_t +get_tclk(void) +{ + + if (soc_decode_win_spec->get_tclk != NULL) + return soc_decode_win_spec->get_tclk(); + else + return -1; +} + +uint32_t +get_cpu_freq(void) +{ + + if (soc_decode_win_spec->get_cpu_freq != NULL) + return soc_decode_win_spec->get_cpu_freq(); + else + return -1; +} +#endif #ifndef INTRNG static int Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Tue Apr 3 21:54:36 2018 (r331957) +++ head/sys/arm/mv/mvvar.h Tue Apr 3 22:10:50 2018 (r331958) @@ -148,4 +148,9 @@ int mv_pci_devmap(phandle_t, struct devmap_entry *, vm vm_offset_t); int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *); enum soc_family mv_check_soc_family(void); + +uint32_t get_tclk_armadaxp(void); +uint32_t get_tclk_armada38x(void); +uint32_t get_cpu_freq_armadaxp(void); +uint32_t get_cpu_freq_armada38x(void); #endif /* _MVVAR_H_ */ Modified: head/sys/arm/mv/std-pj4b.mv ============================================================================== --- head/sys/arm/mv/std-pj4b.mv Tue Apr 3 21:54:36 2018 (r331957) +++ head/sys/arm/mv/std-pj4b.mv Tue Apr 3 22:10:50 2018 (r331958) @@ -1,6 +1,7 @@ # $FreeBSD$ files "../mv/files.mv" +files "../mv/files.arm7" cpu CPU_MV_PJ4B machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" From owner-svn-src-all@freebsd.org Tue Apr 3 22:11:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3DDDF84DDB; Tue, 3 Apr 2018 22:11:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69EF1781FB; Tue, 3 Apr 2018 22:11:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 646E7295C; Tue, 3 Apr 2018 22:11:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33MBdPF005445; Tue, 3 Apr 2018 22:11:39 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33MBd7l005444; Tue, 3 Apr 2018 22:11:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804032211.w33MBd7l005444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 3 Apr 2018 22:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331959 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 331959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 22:11:39 -0000 Author: cem Date: Tue Apr 3 22:11:39 2018 New Revision: 331959 URL: https://svnweb.freebsd.org/changeset/base/331959 Log: cryptosoft: Remove a dead store Introduced in r331639 by removing an instance of undefined behavior. While we're here, the variable scope can be entirely moved inside the loop. Reported by: Coverity CID: 1387985 Sponsored by: Dell EMC Isilon Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Tue Apr 3 22:10:50 2018 (r331958) +++ head/sys/opencrypto/cryptosoft.c Tue Apr 3 22:11:39 2018 (r331959) @@ -84,7 +84,7 @@ static int swcr_encdec(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf, int flags) { - unsigned char iv[EALG_MAX_BLOCK_LEN], blk[EALG_MAX_BLOCK_LEN], *idat; + unsigned char iv[EALG_MAX_BLOCK_LEN], blk[EALG_MAX_BLOCK_LEN]; unsigned char *ivp, *nivp, iv2[EALG_MAX_BLOCK_LEN]; struct enc_xform *exf; int i, j, k, blks, ind, count, ivlen; @@ -249,11 +249,12 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data * } while (uio->uio_iov[ind].iov_len >= k + blks && i > 0) { + uint8_t *idat; size_t nb, rem; nb = blks; rem = uio->uio_iov[ind].iov_len - k; - idat = (char *)uio->uio_iov[ind].iov_base + k; + idat = (uint8_t *)uio->uio_iov[ind].iov_base + k; if (exf->reinit) { if ((crd->crd_flags & CRD_F_ENCRYPT) != 0 && @@ -296,7 +297,6 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data * ivp = nivp; } - idat += nb; count += nb; k += nb; i -= nb; From owner-svn-src-all@freebsd.org Tue Apr 3 22:15:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 262CDF85158; Tue, 3 Apr 2018 22:15:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D05F8784ED; Tue, 3 Apr 2018 22:15:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CADC429A0; Tue, 3 Apr 2018 22:15:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33MFrOa013470; Tue, 3 Apr 2018 22:15:53 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33MFr3O013467; Tue, 3 Apr 2018 22:15:53 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032215.w33MFr3O013467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 22:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331960 - in head/sys/arm/mv: . armada X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm/mv: . armada X-SVN-Commit-Revision: 331960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 22:15:54 -0000 Author: mw Date: Tue Apr 3 22:15:53 2018 New Revision: 331960 URL: https://svnweb.freebsd.org/changeset/base/331960 Log: Make Marvell Armada watchdog driver more generic Store platform dependent functions and constants in mv_wdt_config structure and select proper configuration on runtime based on compatible string provided in FDT. Marvell Armada38X and ArmadaXP non-repetitive registers are moved to generic part of code. To support armv5 as well, use proper compatible string: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/watchdog/orion_wdt.c?h=v4.13-rc3#n456 Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14740 Modified: head/sys/arm/mv/armada/wdt.c head/sys/arm/mv/mvreg.h Modified: head/sys/arm/mv/armada/wdt.c ============================================================================== --- head/sys/arm/mv/armada/wdt.c Tue Apr 3 22:11:39 2018 (r331959) +++ head/sys/arm/mv/armada/wdt.c Tue Apr 3 22:15:53 2018 (r331960) @@ -53,22 +53,54 @@ __FBSDID("$FreeBSD$"); #define INITIAL_TIMECOUNTER (0xffffffff) #define MAX_WATCHDOG_TICKS (0xffffffff) +#define WD_RST_OUT_EN 0x00000002 -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define MV_CLOCK_SRC 25000000 /* Timers' 25MHz mode */ -#else -#define MV_CLOCK_SRC get_tclk() -#endif +#define MV_CLOCK_SRC_ARMV7 25000000 /* Timers' 25MHz mode */ -#if defined(SOC_MV_ARMADA38X) -#define WATCHDOG_TIMER 4 -#else -#define WATCHDOG_TIMER 2 -#endif +struct mv_wdt_config { + enum soc_family wdt_soc; + uint32_t wdt_timer; + void (*wdt_enable)(void); + void (*wdt_disable)(void); + unsigned int wdt_clock_src; +}; +static void mv_wdt_enable_armv5(void); +static void mv_wdt_enable_armada_38x(void); +static void mv_wdt_enable_armada_xp(void); + +static void mv_wdt_disable_armv5(void); +static void mv_wdt_disable_armada_38x(void); +static void mv_wdt_disable_armada_xp(void); + +static struct mv_wdt_config mv_wdt_armada_38x_config = { + .wdt_soc = MV_SOC_ARMADA_38X, + .wdt_timer = 4, + .wdt_enable = &mv_wdt_enable_armada_38x, + .wdt_disable = &mv_wdt_disable_armada_38x, + .wdt_clock_src = MV_CLOCK_SRC_ARMV7, +}; + +static struct mv_wdt_config mv_wdt_armada_xp_config = { + .wdt_soc = MV_SOC_ARMADA_XP, + .wdt_timer = 2, + .wdt_enable = &mv_wdt_enable_armada_xp, + .wdt_disable = &mv_wdt_disable_armada_xp, + .wdt_clock_src = MV_CLOCK_SRC_ARMV7, +}; + +static struct mv_wdt_config mv_wdt_armv5_config = { + .wdt_soc = MV_SOC_ARMV5, + .wdt_timer = 2, + .wdt_enable = &mv_wdt_enable_armv5, + .wdt_disable = &mv_wdt_disable_armv5, + .wdt_clock_src = 0, +}; + struct mv_wdt_softc { struct resource * wdt_res; struct mtx wdt_mtx; + struct mv_wdt_config * wdt_config; }; static struct resource_spec mv_wdt_spec[] = { @@ -77,8 +109,10 @@ static struct resource_spec mv_wdt_spec[] = { }; static struct ofw_compat_data mv_wdt_compat[] = { - {"marvell,armada-380-wdt", true}, - {NULL, false} + {"marvell,armada-380-wdt", (uintptr_t)&mv_wdt_armada_38x_config}, + {"marvell,armada-xp-wdt", (uintptr_t)&mv_wdt_armada_xp_config}, + {"marvell,orion-wdt", (uintptr_t)&mv_wdt_armv5_config}, + {NULL, (uintptr_t)NULL} }; static struct mv_wdt_softc *wdt_softc = NULL; @@ -91,8 +125,6 @@ static uint32_t mv_get_timer_control(void); static void mv_set_timer_control(uint32_t); static void mv_set_timer(uint32_t, uint32_t); -static void mv_watchdog_enable(void); -static void mv_watchdog_disable(void); static void mv_watchdog_event(void *, unsigned int, int *); static device_method_t mv_wdt_methods[] = { @@ -145,7 +177,14 @@ mv_wdt_attach(device_t dev) mtx_init(&sc->wdt_mtx, "watchdog", NULL, MTX_DEF); - mv_watchdog_disable(); + sc->wdt_config = (struct mv_wdt_config *) + ofw_bus_search_compatible(dev, mv_wdt_compat)->ocd_data; + + if (sc->wdt_config->wdt_clock_src == 0) + sc->wdt_config->wdt_clock_src = get_tclk(); + + if (wdt_softc->wdt_config->wdt_disable != NULL) + wdt_softc->wdt_config->wdt_disable(); EVENTHANDLER_REGISTER(watchdog_list, mv_watchdog_event, sc, 0); return (0); @@ -171,20 +210,37 @@ mv_set_timer(uint32_t timer, uint32_t val) bus_write_4(wdt_softc->wdt_res, CPU_TIMER0 + timer * 0x8, val); } - static void -mv_watchdog_enable(void) +mv_wdt_enable_armv5(void) { + uint32_t val, irq_cause, irq_mask; + + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); + irq_cause &= IRQ_TIMER_WD_CLR; + write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + + irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); + irq_mask |= IRQ_TIMER_WD_MASK; + write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); + + val = read_cpu_ctrl(RSTOUTn_MASK); + val |= WD_RST_OUT_EN; + write_cpu_ctrl(RSTOUTn_MASK, val); + + val = mv_get_timer_control(); + val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO; + mv_set_timer_control(val); +} + +static inline void +mv_wdt_enable_armada_38x_xp_helper() +{ uint32_t val, irq_cause; -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) - uint32_t irq_mask; -#endif irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= IRQ_TIMER_WD_CLR; write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); val |= (WD_GLOBAL_MASK | WD_CPU0_MASK); write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); @@ -192,52 +248,41 @@ mv_watchdog_enable(void) val = read_cpu_misc(RSTOUTn_MASK); val &= ~RSTOUTn_MASK_WD; write_cpu_misc(RSTOUTn_MASK, val); -#else - irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); - irq_mask |= IRQ_TIMER_WD_MASK; - write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); +} - val = read_cpu_ctrl(RSTOUTn_MASK); - val |= WD_RST_OUT_EN; - write_cpu_ctrl(RSTOUTn_MASK, val); -#endif +static void +mv_wdt_enable_armada_38x(void) +{ + uint32_t val; + mv_wdt_enable_armada_38x_xp_helper(); + val = mv_get_timer_control(); -#if defined(SOC_MV_ARMADA38X) val |= CPU_TIMER_WD_EN | CPU_TIMER_WD_AUTO | CPU_TIMER_WD_25MHZ_EN; -#elif defined(SOC_MV_ARMADAXP) + mv_set_timer_control(val); +} + +static void +mv_wdt_enable_armada_xp(void) +{ + uint32_t val; + + mv_wdt_enable_armada_38x_xp_helper(); + + val = mv_get_timer_control(); val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO | CPU_TIMER_WD_25MHZ_EN; -#else - val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO; -#endif mv_set_timer_control(val); } static void -mv_watchdog_disable(void) +mv_wdt_disable_armv5(void) { - uint32_t val, irq_cause; -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) - uint32_t irq_mask; -#endif + uint32_t val, irq_cause, irq_mask; val = mv_get_timer_control(); -#if defined(SOC_MV_ARMADA38X) - val &= ~(CPU_TIMER_WD_EN | CPU_TIMER_WD_AUTO); -#else val &= ~(CPU_TIMER2_EN | CPU_TIMER2_AUTO); -#endif mv_set_timer_control(val); -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) - val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); - val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK); - write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); - - val = read_cpu_misc(RSTOUTn_MASK); - val |= RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD); -#else val = read_cpu_ctrl(RSTOUTn_MASK); val &= ~WD_RST_OUT_EN; write_cpu_ctrl(RSTOUTn_MASK, val); @@ -245,13 +290,50 @@ mv_watchdog_disable(void) irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); irq_mask &= ~(IRQ_TIMER_WD_MASK); write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); -#endif irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= IRQ_TIMER_WD_CLR; write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); } +static __inline void +mv_wdt_disable_armada_38x_xp_helper(void) +{ + uint32_t val; + + val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); + val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK); + write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); + + val = read_cpu_misc(RSTOUTn_MASK); + val |= RSTOUTn_MASK_WD; + write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD); +} + +static void +mv_wdt_disable_armada_38x(void) +{ + uint32_t val; + + val = mv_get_timer_control(); + val &= ~(CPU_TIMER_WD_EN | CPU_TIMER_WD_AUTO); + mv_set_timer_control(val); + + mv_wdt_disable_armada_38x_xp_helper(); +} + +static void +mv_wdt_disable_armada_xp(void) +{ + uint32_t val; + + val = mv_get_timer_control(); + val &= ~(CPU_TIMER2_EN | CPU_TIMER2_AUTO); + mv_set_timer_control(val); + + mv_wdt_disable_armada_38x_xp_helper(); +} + /* * Watchdog event handler. */ @@ -264,20 +346,24 @@ mv_watchdog_event(void *arg, unsigned int cmd, int *er sc = arg; mtx_lock(&sc->wdt_mtx); - if (cmd == 0) - mv_watchdog_disable(); - else { + if (cmd == 0) { + if (wdt_softc->wdt_config->wdt_disable != NULL) + wdt_softc->wdt_config->wdt_disable(); + } else { /* * Watchdog timeout is in nanosecs, calculation according to * watchdog(9) */ ns = (uint64_t)1 << (cmd & WD_INTERVAL); - ticks = (uint64_t)(ns * MV_CLOCK_SRC) / 1000000000; - if (ticks > MAX_WATCHDOG_TICKS) - mv_watchdog_disable(); + ticks = (uint64_t)(ns * sc->wdt_config->wdt_clock_src) / 1000000000; + if (ticks > MAX_WATCHDOG_TICKS) { + if (wdt_softc->wdt_config->wdt_disable != NULL) + wdt_softc->wdt_config->wdt_disable(); + } else { - mv_set_timer(WATCHDOG_TIMER, ticks); - mv_watchdog_enable(); + mv_set_timer(wdt_softc->wdt_config->wdt_timer, ticks); + if (wdt_softc->wdt_config->wdt_enable != NULL) + wdt_softc->wdt_config->wdt_enable(); *error = 0; } } Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Tue Apr 3 22:11:39 2018 (r331959) +++ head/sys/arm/mv/mvreg.h Tue Apr 3 22:15:53 2018 (r331960) @@ -105,20 +105,20 @@ */ #if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) #define RSTOUTn_MASK 0x60 -#define RSTOUTn_MASK_WD 0x400 #define SYSTEM_SOFT_RESET 0x64 -#define WD_RSTOUTn_MASK 0x4 -#define WD_GLOBAL_MASK 0x00000100 -#define WD_CPU0_MASK 0x00000001 #define SOFT_RST_OUT_EN 0x00000001 #define SYS_SOFT_RST 0x00000001 #else #define RSTOUTn_MASK 0x8 -#define WD_RST_OUT_EN 0x00000002 #define SOFT_RST_OUT_EN 0x00000004 #define SYSTEM_SOFT_RESET 0xc #define SYS_SOFT_RST 0x00000001 #endif +#define RSTOUTn_MASK_WD 0x400 +#define WD_RSTOUTn_MASK 0x4 +#define WD_GLOBAL_MASK 0x00000100 +#define WD_CPU0_MASK 0x00000001 +#define WD_RST_OUT_EN 0x00000002 /* * Power Control From owner-svn-src-all@freebsd.org Tue Apr 3 22:21:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0E3CF855DE; Tue, 3 Apr 2018 22:21:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D47D78920; Tue, 3 Apr 2018 22:21:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 481282ADA; Tue, 3 Apr 2018 22:21:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33MLDwY019505; Tue, 3 Apr 2018 22:21:13 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33MLDTE019502; Tue, 3 Apr 2018 22:21:13 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032221.w33MLDTE019502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 22:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331961 - in head/sys: arm/mv dts/arm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dts/arm X-SVN-Commit-Revision: 331961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 22:21:13 -0000 Author: mw Date: Tue Apr 3 22:21:12 2018 New Revision: 331961 URL: https://svnweb.freebsd.org/changeset/base/331961 Log: Make Marvell AmadaXP timer driver more generic Store pointers to SoC specific functions in mv_timer_config structure and determine proper config in runtime based on compatible string from FDT. Compatible string for ArmadaXP timers is changed to match Linux FDT. Armada 38x uses generic Cortex-A9 timer and separate watchdog drivers, so it does not need to be supported by timer driver. Submitted by: Rafal Kozik Reviewed by: manu Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14741 Modified: head/sys/arm/mv/timer.c head/sys/dts/arm/db78460.dts Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Tue Apr 3 22:15:53 2018 (r331960) +++ head/sys/arm/mv/timer.c Tue Apr 3 22:21:12 2018 (r331961) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,18 +61,20 @@ __FBSDID("$FreeBSD$"); #define MV_WDT 0x2 #define MV_NONE 0x0 -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define MV_CLOCK_SRC 25000000 /* Timers' 25MHz mode */ -#else -#define MV_CLOCK_SRC get_tclk() -#endif +#define MV_CLOCK_SRC_ARMV7 25000000 /* Timers' 25MHz mode */ -#if defined(SOC_MV_ARMADA38X) -#define WATCHDOG_TIMER 4 -#else -#define WATCHDOG_TIMER 2 -#endif +#define WATCHDOG_TIMER_ARMV5 2 +typedef void (*mv_watchdog_enable_t)(void); +typedef void (*mv_watchdog_disable_t)(void); + +struct mv_timer_config { + enum soc_family soc_family; + mv_watchdog_enable_t watchdog_enable; + mv_watchdog_disable_t watchdog_disable; + unsigned int clock_src; +}; + struct mv_timer_softc { struct resource * timer_res[2]; bus_space_tag_t timer_bst; @@ -79,6 +82,7 @@ struct mv_timer_softc { struct mtx timer_mtx; struct eventtimer et; boolean_t has_wdt; + struct mv_timer_config* config; }; static struct resource_spec mv_timer_spec[] = { @@ -89,8 +93,9 @@ static struct resource_spec mv_timer_spec[] = { /* Interrupt is not required by MV_WDT devices */ static struct ofw_compat_data mv_timer_compat[] = { + {"marvell,armada-380-timer", MV_NONE }, + {"marvell,armada-xp-timer", MV_TMR | MV_WDT }, {"mrvl,timer", MV_TMR | MV_WDT }, - {"marvell,armada-380-wdt", MV_WDT }, {NULL, MV_NONE } }; @@ -108,14 +113,42 @@ static void mv_set_timer_control(uint32_t); static uint32_t mv_get_timer(uint32_t); static void mv_set_timer(uint32_t, uint32_t); static void mv_set_timer_rel(uint32_t, uint32_t); -static void mv_watchdog_enable(void); -static void mv_watchdog_disable(void); static void mv_watchdog_event(void *, unsigned int, int *); static int mv_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period); static int mv_timer_stop(struct eventtimer *et); static void mv_setup_timers(void); +static void mv_watchdog_enable_armv5(void); +static void mv_watchdog_enable_armadaxp(void); +static void mv_watchdog_disable_armv5(void); +static void mv_watchdog_disable_armadaxp(void); + +#ifdef PLATFORM +void mv_delay(int usec, void* arg); +#endif + +static struct mv_timer_config timer_armadaxp_config = +{ + MV_SOC_ARMADA_XP, + &mv_watchdog_enable_armadaxp, + &mv_watchdog_disable_armadaxp, + MV_CLOCK_SRC_ARMV7, +}; +static struct mv_timer_config timer_armv5_config = +{ + MV_SOC_ARMV5, + &mv_watchdog_enable_armv5, + &mv_watchdog_disable_armv5, + 0, +}; + +static struct ofw_compat_data mv_timer_soc_config[] = { + {"marvell,armada-xp-timer", (uintptr_t)&timer_armadaxp_config }, + {"mrvl,timer", (uintptr_t)&timer_armv5_config }, + {NULL, (uintptr_t)NULL }, +}; + static struct timecounter mv_timer_timecounter = { .tc_get_timecount = mv_timer_get_timecount, .tc_name = "CPUTimer1", @@ -144,9 +177,7 @@ mv_timer_attach(device_t dev) int error; void *ihl; struct mv_timer_softc *sc; -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) uint32_t irq_cause, irq_mask; -#endif if (timer_softc != NULL) return (ENXIO); @@ -154,6 +185,12 @@ mv_timer_attach(device_t dev) sc = (struct mv_timer_softc *)device_get_softc(dev); timer_softc = sc; + sc->config = (struct mv_timer_config*) + ofw_bus_search_compatible(dev, mv_timer_soc_config)->ocd_data; + + if (sc->config->clock_src == 0) + sc->config->clock_src = get_tclk(); + error = bus_alloc_resources(dev, mv_timer_spec, sc->timer_res); if (error) { device_printf(dev, "could not allocate resources\n"); @@ -163,13 +200,13 @@ mv_timer_attach(device_t dev) sc->timer_bst = rman_get_bustag(sc->timer_res[0]); sc->timer_bsh = rman_get_bushandle(sc->timer_res[0]); - sc->has_wdt = ofw_bus_has_prop(dev, "mrvl,has-wdt") || - ofw_bus_is_compatible(dev, "marvell,armada-380-wdt"); + sc->has_wdt = ofw_bus_has_prop(dev, "mrvl,has-wdt"); mtx_init(&timer_softc->timer_mtx, "watchdog", NULL, MTX_DEF); if (sc->has_wdt) { - mv_watchdog_disable(); + if (sc->config->watchdog_disable) + sc->config->watchdog_disable(); EVENTHANDLER_REGISTER(watchdog_list, mv_watchdog_event, sc, 0); } @@ -192,30 +229,33 @@ mv_timer_attach(device_t dev) } mv_setup_timers(); -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER0_CLR; + if (sc->config->soc_family != MV_SOC_ARMADA_XP ) { + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); + irq_cause &= IRQ_TIMER0_CLR; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); - irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); - irq_mask |= IRQ_TIMER0_MASK; - irq_mask &= ~IRQ_TIMER1_MASK; - write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); -#endif + write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); + irq_mask |= IRQ_TIMER0_MASK; + irq_mask &= ~IRQ_TIMER1_MASK; + write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); + } sc->et.et_name = "CPUTimer0"; sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; sc->et.et_quality = 1000; - sc->et.et_frequency = MV_CLOCK_SRC; + sc->et.et_frequency = sc->config->clock_src; sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency; sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; sc->et.et_start = mv_timer_start; sc->et.et_stop = mv_timer_stop; sc->et.et_priv = sc; et_register(&sc->et); - mv_timer_timecounter.tc_frequency = MV_CLOCK_SRC; + mv_timer_timecounter.tc_frequency = sc->config->clock_src; tc_init(&mv_timer_timecounter); +#ifdef PLATFORM + arm_set_delay(mv_delay, NULL); +#endif return (0); } @@ -260,8 +300,13 @@ mv_timer_get_timecount(struct timecounter *tc) return (INITIAL_TIMECOUNTER - mv_get_timer(1)); } +#ifdef PLATFORM void +mv_delay(int usec, void* arg) +#else +void DELAY(int usec) +#endif { uint32_t val, val_temp; int32_t nticks; @@ -275,7 +320,7 @@ DELAY(int usec) TSENTER(); val = mv_get_timer(1); - nticks = ((MV_CLOCK_SRC / 1000000 + 1) * usec); + nticks = ((timer_softc->config->clock_src / 1000000 + 1) * usec); while (nticks > 0) { val_temp = mv_get_timer(1); @@ -330,26 +375,14 @@ mv_set_timer_rel(uint32_t timer, uint32_t val) } static void -mv_watchdog_enable(void) +mv_watchdog_enable_armv5(void) { - uint32_t val, irq_cause; -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) - uint32_t irq_mask; -#endif + uint32_t val, irq_cause, irq_mask; irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= IRQ_TIMER_WD_CLR; write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) - val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); - val |= (WD_GLOBAL_MASK | WD_CPU0_MASK); - write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); - - val = read_cpu_misc(RSTOUTn_MASK); - val &= ~RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, val); -#else irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); irq_mask |= IRQ_TIMER_WD_MASK; write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); @@ -357,44 +390,43 @@ mv_watchdog_enable(void) val = read_cpu_ctrl(RSTOUTn_MASK); val |= WD_RST_OUT_EN; write_cpu_ctrl(RSTOUTn_MASK, val); -#endif val = mv_get_timer_control(); -#if defined(SOC_MV_ARMADA38X) - val |= CPU_TIMER_WD_EN | CPU_TIMER_WD_AUTO | CPU_TIMER_WD_25MHZ_EN; -#elif defined(SOC_MV_ARMADAXP) - val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO | CPU_TIMER_WD_25MHZ_EN; -#else val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO; -#endif mv_set_timer_control(val); } static void -mv_watchdog_disable(void) +mv_watchdog_enable_armadaxp(void) { - uint32_t val, irq_cause; -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) - uint32_t irq_mask; -#endif + uint32_t irq_cause, val; - val = mv_get_timer_control(); -#if defined(SOC_MV_ARMADA38X) - val &= ~(CPU_TIMER_WD_EN | CPU_TIMER_WD_AUTO); -#else - val &= ~(CPU_TIMER2_EN | CPU_TIMER2_AUTO); -#endif - mv_set_timer_control(val); + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); + irq_cause &= IRQ_TIMER_WD_CLR; + write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); - val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK); + val |= (WD_GLOBAL_MASK | WD_CPU0_MASK); write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); val = read_cpu_misc(RSTOUTn_MASK); - val |= RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD); -#else + val &= ~RSTOUTn_MASK_WD; + write_cpu_misc(RSTOUTn_MASK, val); + + val = mv_get_timer_control(); + val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO | CPU_TIMER_WD_25MHZ_EN; + mv_set_timer_control(val); +} + +static void +mv_watchdog_disable_armv5(void) +{ + uint32_t val, irq_cause,irq_mask; + + val = mv_get_timer_control(); + val &= ~(CPU_TIMER2_EN | CPU_TIMER2_AUTO); + mv_set_timer_control(val); + val = read_cpu_ctrl(RSTOUTn_MASK); val &= ~WD_RST_OUT_EN; write_cpu_ctrl(RSTOUTn_MASK, val); @@ -402,14 +434,34 @@ mv_watchdog_disable(void) irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); irq_mask &= ~(IRQ_TIMER_WD_MASK); write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); -#endif irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= IRQ_TIMER_WD_CLR; write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); } +static void +mv_watchdog_disable_armadaxp(void) +{ + uint32_t val, irq_cause; + val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); + val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK); + write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); + + val = read_cpu_misc(RSTOUTn_MASK); + val |= RSTOUTn_MASK_WD; + write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD); + + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); + irq_cause &= IRQ_TIMER_WD_CLR; + write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + + val = mv_get_timer_control(); + val &= ~(CPU_TIMER2_EN | CPU_TIMER2_AUTO); + mv_set_timer_control(val); +} + /* * Watchdog event handler. */ @@ -420,20 +472,23 @@ mv_watchdog_event(void *arg, unsigned int cmd, int *er uint64_t ticks; mtx_lock(&timer_softc->timer_mtx); - if (cmd == 0) - mv_watchdog_disable(); - else { + if (cmd == 0) { + if (timer_softc->config->watchdog_disable != NULL) + timer_softc->config->watchdog_disable(); + } else { /* * Watchdog timeout is in nanosecs, calculation according to * watchdog(9) */ ns = (uint64_t)1 << (cmd & WD_INTERVAL); - ticks = (uint64_t)(ns * MV_CLOCK_SRC) / 1000000000; - if (ticks > MAX_WATCHDOG_TICKS) - mv_watchdog_disable(); - else { - mv_set_timer(WATCHDOG_TIMER, ticks); - mv_watchdog_enable(); + ticks = (uint64_t)(ns * timer_softc->config->clock_src) / 1000000000; + if (ticks > MAX_WATCHDOG_TICKS) { + if (timer_softc->config->watchdog_disable != NULL) + timer_softc->config->watchdog_disable(); + } else { + mv_set_timer(WATCHDOG_TIMER_ARMV5, ticks); + if (timer_softc->config->watchdog_enable != NULL) + timer_softc->config->watchdog_enable(); *error = 0; } } @@ -491,10 +546,12 @@ mv_setup_timers(void) val = mv_get_timer_control(); val &= ~(CPU_TIMER0_EN | CPU_TIMER0_AUTO); val |= CPU_TIMER1_EN | CPU_TIMER1_AUTO; -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) - /* Enable 25MHz mode */ - val |= CPU_TIMER0_25MHZ_EN | CPU_TIMER1_25MHZ_EN; -#endif + + if (timer_softc->config->soc_family == MV_SOC_ARMADA_XP) { + /* Enable 25MHz mode */ + val |= CPU_TIMER0_25MHZ_EN | CPU_TIMER1_25MHZ_EN; + } + mv_set_timer_control(val); timers_initialized = 1; } Modified: head/sys/dts/arm/db78460.dts ============================================================================== --- head/sys/dts/arm/db78460.dts Tue Apr 3 22:15:53 2018 (r331960) +++ head/sys/dts/arm/db78460.dts Tue Apr 3 22:21:12 2018 (r331961) @@ -85,7 +85,7 @@ }; timer@21840 { - compatible = "mrvl,timer"; + compatible = "marvell,armada-xp-timer"; reg = <0x21840 0x30>; interrupts = <5>; interrupt-parent = <&MPIC>; From owner-svn-src-all@freebsd.org Tue Apr 3 22:35:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F81CF8614C; Tue, 3 Apr 2018 22:35:36 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B2F4F792BD; Tue, 3 Apr 2018 22:35:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id f698a56e; Wed, 4 Apr 2018 00:28:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=NOT2Fn ZYGpUVwE9fHG5K0UllqKo=; b=Mv4lFB2q/VtOiXfa7ewy90cxyjXOnUBTVzyv+M Wpv9dii/dLyjDIew66y56FbNCCuSLbJMntZpmT2fylGDU6cdlO878Xt3l7m+EQLp 27QY9AMvBAkjgDkEsRVf0Kxuri0PfzmiRO/HJa0xJE0t5aXnS2NK+yU1fKAoMogB nq1gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= dvPrUnM/D//fALJZ7pkRZjFOMBJAPNALdrvi2Zrh57pv6JRcN62KCwxjbjaugnRV 6RTZdb0cHDmXdvR4zRvbaHvooNHlduIzwkswHVSeCfJB0XkCquk55cFYCkTiFPUA Res2CnSW0kTamEvf4nTvzg0+xGDfW0MSEw72X6v7H7U= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 2b35bd42; Wed, 4 Apr 2018 00:28:53 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 04 Apr 2018 00:28:53 +0200 From: Emmanuel Vadot To: Marcin Wojtas Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r331961 - in head/sys: arm/mv dts/arm Organization: Bidouilliste In-Reply-To: <201804032221.w33MLDTE019502@repo.freebsd.org> References: <201804032221.w33MLDTE019502@repo.freebsd.org> Message-ID: <5dea78be118fa5ee4b8cb77a1e26a6f0@megadrive.org> X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 22:35:36 -0000 On 2018-04-04 00:21, Marcin Wojtas wrote: > Author: mw > Date: Tue Apr 3 22:21:12 2018 > New Revision: 331961 > URL: https://svnweb.freebsd.org/changeset/base/331961 > > Log: > Make Marvell AmadaXP timer driver more generic > > Store pointers to SoC specific functions in mv_timer_config structure > and determine proper config in runtime based on compatible string > from FDT. > Compatible string for ArmadaXP timers is changed to match Linux FDT. > Armada 38x uses generic Cortex-A9 timer and separate watchdog > drivers, so > it does not need to be supported by timer driver. > > Submitted by: Rafal Kozik > Reviewed by: manu > Obtained from: Semihalf > Sponsored by: Stormshield > Differential Revision: https://reviews.freebsd.org/D14741 Hello Marcin, I've only reviewed the DTS part. Also you didn't address andrew@ comment, see https://reviews.freebsd.org/D14741?id=40452#inline-89719 Cheers, -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Tue Apr 3 23:11:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ED56F8855B; Tue, 3 Apr 2018 23:11:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 119BC7A989; Tue, 3 Apr 2018 23:11:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C7F13227; Tue, 3 Apr 2018 23:11:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33NB8JB090164; Tue, 3 Apr 2018 23:11:08 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33NB83B090161; Tue, 3 Apr 2018 23:11:08 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201804032311.w33NB83B090161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 3 Apr 2018 23:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331963 - in head/share: examples/etc mk X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/share: examples/etc mk X-SVN-Commit-Revision: 331963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 23:11:09 -0000 Author: jkim Date: Tue Apr 3 23:11:08 2018 New Revision: 331963 URL: https://svnweb.freebsd.org/changeset/base/331963 Log: Catch up with Clang 6.0. MFC after: 3 days Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Tue Apr 3 22:49:58 2018 (r331962) +++ head/share/examples/etc/make.conf Tue Apr 3 23:11:08 2018 (r331963) @@ -45,7 +45,8 @@ # Additionally the following CPU types are recognized by clang: # Intel x86 architecture (for both amd64 and i386): # (AMD CPUs) znver1, bdver4, bdver3, bdver2, bdver1, btver2, btver1 -# (Intel CPUs) skylake, knl, broadwell, haswell, ivybridge, +# (Intel CPUs) cannonlake, knm, skylake-avx512, knl, goldmont, +# skylake, broadwell, haswell, ivybridge, # sandybridge, westmere, nehalem, silvermont, bonnell # # (?= allows to buildworld for a different CPUTYPE.) Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Tue Apr 3 22:49:58 2018 (r331962) +++ head/share/mk/bsd.cpu.mk Tue Apr 3 23:11:08 2018 (r331963) @@ -199,14 +199,16 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586 MACHINE_CPU = mmx k6 k5 i586 . elif ${CPUTYPE} == "k5" MACHINE_CPU = k5 i586 -. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "knl" +. elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" +. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \ + ${CPUTYPE} == "haswell" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" || \ - ${CPUTYPE} == "silvermont" +. elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \ + ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 @@ -260,14 +262,16 @@ MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "knl" +. elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" +. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \ + ${CPUTYPE} == "haswell" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" || \ - ${CPUTYPE} == "silvermont" +. elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \ + ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 From owner-svn-src-all@freebsd.org Tue Apr 3 23:27:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD316F89434; Tue, 3 Apr 2018 23:27:07 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C34B7B6B3; Tue, 3 Apr 2018 23:27:07 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773C338A7; Tue, 3 Apr 2018 23:27:07 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33NR7u1013323; Tue, 3 Apr 2018 23:27:07 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33NR78n013322; Tue, 3 Apr 2018 23:27:07 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032327.w33NR78n013322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 23:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331964 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 331964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 23:27:08 -0000 Author: mw Date: Tue Apr 3 23:27:07 2018 New Revision: 331964 URL: https://svnweb.freebsd.org/changeset/base/331964 Log: Add missing flag check in Marvell PCIE driver Flag was introduced in r331953, but eventually not used. Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Apr 3 23:11:08 2018 (r331963) +++ head/sys/arm/mv/mv_pci.c Tue Apr 3 23:27:07 2018 (r331964) @@ -560,7 +560,8 @@ mv_pcib_enable(struct mv_pcib_softc *sc, uint32_t unit /* * Check if PCIE device is enabled. */ - if (read_cpu_ctrl(CPU_CONTROL) & CPU_CONTROL_PCIE_DISABLE(unit)) { + if ((sc->sc_skip_enable_procedure == 0) && + (read_cpu_ctrl(CPU_CONTROL) & CPU_CONTROL_PCIE_DISABLE(unit))) { write_cpu_ctrl(CPU_CONTROL, read_cpu_ctrl(CPU_CONTROL) & ~(CPU_CONTROL_PCIE_DISABLE(unit))); @@ -1057,7 +1058,7 @@ mv_pcib_root_slot(device_t dev, u_int bus, u_int slot, struct mv_pcib_softc *sc = device_get_softc(dev); uint32_t vendor, device; -/* On platforms other than Armada38x, root link is always at slot 0 */ + /* On platforms other than Armada38x, root link is always at slot 0 */ if (!sc->sc_enable_find_root_slot) return (slot == 0); From owner-svn-src-all@freebsd.org Tue Apr 3 23:29:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D850F8964F; Tue, 3 Apr 2018 23:29:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 008E67B8A9; Tue, 3 Apr 2018 23:29:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF68138A9; Tue, 3 Apr 2018 23:29:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33NTYJw015669; Tue, 3 Apr 2018 23:29:34 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33NTY4C015668; Tue, 3 Apr 2018 23:29:34 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032329.w33NTY4C015668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 23:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331965 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 331965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 23:29:35 -0000 Author: mw Date: Tue Apr 3 23:29:34 2018 New Revision: 331965 URL: https://svnweb.freebsd.org/changeset/base/331965 Log: Split out delay code in Marvell timer driver for PLATFORM The PLATFORM code will perform the software loop in the early boot, so extract the actual delay code to handle situation, when the timers are already initialized. Obtained from: Semihalf Sponsored by: Stormshield Modified: head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Tue Apr 3 23:27:07 2018 (r331964) +++ head/sys/arm/mv/timer.c Tue Apr 3 23:29:34 2018 (r331965) @@ -124,9 +124,7 @@ static void mv_watchdog_enable_armadaxp(void); static void mv_watchdog_disable_armv5(void); static void mv_watchdog_disable_armadaxp(void); -#ifdef PLATFORM -void mv_delay(int usec, void* arg); -#endif +static void mv_delay(int usec, void* arg); static struct mv_timer_config timer_armadaxp_config = { @@ -300,25 +298,12 @@ mv_timer_get_timecount(struct timecounter *tc) return (INITIAL_TIMECOUNTER - mv_get_timer(1)); } -#ifdef PLATFORM -void +static void mv_delay(int usec, void* arg) -#else -void -DELAY(int usec) -#endif { uint32_t val, val_temp; int32_t nticks; - if (!timers_initialized) { - for (; usec > 0; usec--) - for (val = 100; val > 0; val--) - __asm __volatile("nop" ::: "memory"); - return; - } - TSENTER(); - val = mv_get_timer(1); nticks = ((timer_softc->config->clock_src / 1000000 + 1) * usec); @@ -331,8 +316,25 @@ DELAY(int usec) val = val_temp; } - TSEXIT(); } + +#ifndef PLATFORM +void +DELAY(int usec) +{ + uint32_t val; + + if (!timers_initialized) { + for (; usec > 0; usec--) + for (val = 100; val > 0; val--) + __asm __volatile("nop" ::: "memory"); + } else { + TSENTER(); + mv_delay(usec, NULL); + TSEXIT(); + } +} +#endif static uint32_t mv_get_timer_control(void) From owner-svn-src-all@freebsd.org Tue Apr 3 23:49:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE5AEF8A71F; Tue, 3 Apr 2018 23:49:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E07D7C467; Tue, 3 Apr 2018 23:49:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 577233C98; Tue, 3 Apr 2018 23:49:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w33NnaPd043901; Tue, 3 Apr 2018 23:49:36 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w33NnaBD043897; Tue, 3 Apr 2018 23:49:36 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804032349.w33NnaBD043897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 3 Apr 2018 23:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331966 - in head/sys: arm/mv dev/ahci X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dev/ahci X-SVN-Commit-Revision: 331966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 03 Apr 2018 23:49:36 -0000 Author: mw Date: Tue Apr 3 23:49:35 2018 New Revision: 331966 URL: https://svnweb.freebsd.org/changeset/base/331966 Log: Fix kernel modules names for Marvell armv7 Two modules with the same name cannot be loaded, so Marvell specific drivers cannot have the same name as the generic drivers. Files with the same name, even in different folders overlaps their .o files, so in order to prepare for supporting Marvell platforms in GENERIC armv7 config, modify conflicting names. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14743 Modified: head/sys/arm/mv/timer.c head/sys/dev/ahci/ahci_mv_fdt.c Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Tue Apr 3 23:29:34 2018 (r331965) +++ head/sys/arm/mv/timer.c Tue Apr 3 23:49:35 2018 (r331966) @@ -289,7 +289,7 @@ static driver_t mv_timer_driver = { static devclass_t mv_timer_devclass; -DRIVER_MODULE(timer, simplebus, mv_timer_driver, mv_timer_devclass, 0, 0); +DRIVER_MODULE(timer_mv, simplebus, mv_timer_driver, mv_timer_devclass, 0, 0); static unsigned mv_timer_get_timecount(struct timecounter *tc) Modified: head/sys/dev/ahci/ahci_mv_fdt.c ============================================================================== --- head/sys/dev/ahci/ahci_mv_fdt.c Tue Apr 3 23:29:34 2018 (r331965) +++ head/sys/dev/ahci/ahci_mv_fdt.c Tue Apr 3 23:49:35 2018 (r331966) @@ -151,5 +151,5 @@ static driver_t ahci_driver = { sizeof(struct ahci_controller) }; -DRIVER_MODULE(ahci, simplebus, ahci_driver, ahci_devclass, NULL, NULL); -DRIVER_MODULE(ahci, ofwbus, ahci_driver, ahci_devclass, NULL, NULL); +DRIVER_MODULE(ahci_mv, simplebus, ahci_driver, ahci_devclass, NULL, NULL); +DRIVER_MODULE(ahci_mv, ofwbus, ahci_driver, ahci_devclass, NULL, NULL); From owner-svn-src-all@freebsd.org Wed Apr 4 00:13:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 594E7F8BED5 for ; Wed, 4 Apr 2018 00:13:16 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E14A37D3C8 for ; Wed, 4 Apr 2018 00:13:15 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-io0-x22d.google.com with SMTP id q80so24126464ioi.13 for ; Tue, 03 Apr 2018 17:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gMqgXI+Gv2rwY6XN7JuqkPNWwxaPZ0JuWZ/aKiTSwks=; b=2Iz7lentGiodLKx8O1huT0V8GccX7F9iOw1ip7h0inGVya+RgPGYOLyF8EM574xjOo FYf5Epvicu9X52Ofbre2jGioMrpJFa7agKh/VJI5KJ8ul7XDbQnklDkMmOWGa9Nm6pFV eLOuIYpC+pAKBNnlvGAKYP50Ozzp4meEjWerPBO3pSSrmWsD09vJWHf4S5/oH/+OAtsP YSo09mzirWPzwaaIJOOCDhbpY/Wrj+GhnPu71QdNFrTBV0AIY35iqXPd8j9JAQe3qneb 3MkZzjB8MXSVP85JF8nVVRUge7+n8vs4UKotp1UaLNS/liqk/Bi5Tgve1zVLXRUsaUF2 ZBnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gMqgXI+Gv2rwY6XN7JuqkPNWwxaPZ0JuWZ/aKiTSwks=; b=FLVzmyYTHnf8XC1hTCykQjmwORHPaya6D5BTxaeidJrOlVEuSGF5LNIL6U0qckmyrY G6XxmwdctNDZ2s4SvhPXk63TG7cmF/FqKRl0AZOqAyzGnAQpRtPk96t2LXmtSfftpjaI EuNw0pIRWNfCV9XjEJVAqDB9z4LKyf7Hbh3F50rlcgY+We9xm9TSFZZN+wljzc1mrvGc 8Wbmo0hdk40YPqpVC0lBZ8GjGKxCgD/lc2oy8fqN/aFeiZbtyyVQ0QYetJbCwt1zpwKq RMFLarLV9TnvEFWcmXlReOPZSh1Ch9KzLdZDWK+ogCBXijjJWpZTZVBS5Temgp0okcJS m0gQ== X-Gm-Message-State: AElRT7H7/sBFO3kOI1pR+e1VIKWBks1YfmpLSIhbOke4tk59P/m1XGel JX7I3QIdm6JQvGC/rV1D2BuE4AVhBCPzG/a6mh8LoaGMMGw= X-Google-Smtp-Source: AIpwx49+9tp8DdYPr8CyET+uh/9zmm7M5GgbsXSHibP+Y0z1DADa1uW1Z8M61QB6SC6149xnn/FpzJISevMlqAi1cis= X-Received: by 10.107.135.157 with SMTP id r29mr14130602ioi.248.1522800795145; Tue, 03 Apr 2018 17:13:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.183.206 with HTTP; Tue, 3 Apr 2018 17:13:14 -0700 (PDT) In-Reply-To: <5dea78be118fa5ee4b8cb77a1e26a6f0@megadrive.org> References: <201804032221.w33MLDTE019502@repo.freebsd.org> <5dea78be118fa5ee4b8cb77a1e26a6f0@megadrive.org> From: Marcin Wojtas Date: Wed, 4 Apr 2018 02:13:14 +0200 Message-ID: Subject: Re: svn commit: r331961 - in head/sys: arm/mv dts/arm To: Emmanuel Vadot Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 00:13:16 -0000 Hi Manu, 2018-04-04 0:28 GMT+02:00 Emmanuel Vadot : > On 2018-04-04 00:21, Marcin Wojtas wrote: >> >> Author: mw >> Date: Tue Apr 3 22:21:12 2018 >> New Revision: 331961 >> URL: https://svnweb.freebsd.org/changeset/base/331961 >> >> Log: >> Make Marvell AmadaXP timer driver more generic >> >> Store pointers to SoC specific functions in mv_timer_config structure >> and determine proper config in runtime based on compatible string from >> FDT. >> Compatible string for ArmadaXP timers is changed to match Linux FDT. >> Armada 38x uses generic Cortex-A9 timer and separate watchdog drivers, >> so >> it does not need to be supported by timer driver. >> >> Submitted by: Rafal Kozik >> Reviewed by: manu >> Obtained from: Semihalf >> Sponsored by: Stormshield >> Differential Revision: https://reviews.freebsd.org/D14741 > > > Hello Marcin, > > I've only reviewed the DTS part. Right, forgot to add note - sorry. > Also you didn't address andrew@ comment, see > https://reviews.freebsd.org/D14741?id=40452#inline-89719 > I took the wrong patch version initially (it was fixed in phabricator long time ago). I applied this improvemnet in r331965. Thanks, Marcin From owner-svn-src-all@freebsd.org Wed Apr 4 01:13:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23F4F82A8D; Wed, 4 Apr 2018 01:13:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94FF67F711; Wed, 4 Apr 2018 01:13:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FF404BEF; Wed, 4 Apr 2018 01:13:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w341DSqN062286; Wed, 4 Apr 2018 01:13:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w341DSZk062285; Wed, 4 Apr 2018 01:13:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804040113.w341DSZk062285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 4 Apr 2018 01:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331967 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 331967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 01:13:29 -0000 Author: gonzo Date: Wed Apr 4 01:13:28 2018 New Revision: 331967 URL: https://svnweb.freebsd.org/changeset/base/331967 Log: Fix arm64 buildkernel target with "nooptions KDB" Make kdb_trap in breakpoint exception handler conditional. If "options KDB" is not present just panic with message that debugger is not enabled. PR: 224653 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Tue Apr 3 23:49:35 2018 (r331966) +++ head/sys/arm64/arm64/trap.c Wed Apr 4 01:13:28 2018 (r331967) @@ -323,8 +323,12 @@ do_el1h_sync(struct thread *td, struct trapframe *fram break; } #endif +#ifdef KDB kdb_trap(exception, 0, (td->td_frame != NULL) ? td->td_frame : frame); +#else + panic("No debugger in kernel.\n"); +#endif frame->tf_elr += 4; break; case EXCP_WATCHPT_EL1: From owner-svn-src-all@freebsd.org Wed Apr 4 01:56:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0287F854F4; Wed, 4 Apr 2018 01:56:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A09368134F; Wed, 4 Apr 2018 01:56:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B1795268; Wed, 4 Apr 2018 01:56:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w341ulVN019376; Wed, 4 Apr 2018 01:56:47 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w341uk90019363; Wed, 4 Apr 2018 01:56:46 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040156.w341uk90019363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 01:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331968 - in stable/11/sys/arm: arm include X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in stable/11/sys/arm: arm include X-SVN-Commit-Revision: 331968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 01:56:48 -0000 Author: mmel Date: Wed Apr 4 01:56:46 2018 New Revision: 331968 URL: https://svnweb.freebsd.org/changeset/base/331968 Log: MFC r319896,r320054: r319896: Implement tunable CPU quirks. These quirks are intended for optimizing CPU performance, not for applying errata workarounds. Nobody can expect that CPU with unfixed errata is stable enough to execute the kernel until quirks are applied. r320054: Manually load tunable CPU quirks. These are needed too early, far before SYSINIT is processed. Modified: stable/11/sys/arm/arm/cpuinfo.c stable/11/sys/arm/arm/mp_machdep.c stable/11/sys/arm/arm/pmap-v6.c stable/11/sys/arm/include/cpuinfo.h stable/11/sys/arm/include/pmap-v6.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/cpuinfo.c ============================================================================== --- stable/11/sys/arm/arm/cpuinfo.c Wed Apr 4 01:13:28 2018 (r331967) +++ stable/11/sys/arm/arm/cpuinfo.c Wed Apr 4 01:56:46 2018 (r331968) @@ -30,12 +30,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include #include +#if __ARM_ARCH >= 6 +void reinit_mmu(uint32_t ttb, uint32_t aux_clr, uint32_t aux_set); +#endif + struct cpuinfo cpuinfo = { /* Use safe defaults for start */ @@ -45,6 +51,30 @@ struct cpuinfo cpuinfo = .icache_line_mask = 31, }; +static SYSCTL_NODE(_hw, OID_AUTO, cpu, CTLFLAG_RD, 0, + "CPU"); +static SYSCTL_NODE(_hw_cpu, OID_AUTO, quirks, CTLFLAG_RD, 0, + "CPU quirks"); + +/* + * Tunable CPU quirks. + * Be careful, ACTRL cannot be changed if CPU is started in secure + * mode(world) and write to ACTRL can cause exception! + * These quirks are intended for optimizing CPU performance, not for + * applying errata workarounds. Nobody can expect that CPU with unfixed + * errata is stable enough to execute the kernel until quirks are applied. + */ +static uint32_t cpu_quirks_actlr_mask; +SYSCTL_INT(_hw_cpu_quirks, OID_AUTO, actlr_mask, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &cpu_quirks_actlr_mask, 0, + "Bits to be masked in ACTLR"); + +static uint32_t cpu_quirks_actlr_set; +SYSCTL_INT(_hw_cpu_quirks, OID_AUTO, actlr_set, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &cpu_quirks_actlr_set, 0, + "Bits to be set in ACTLR"); + + /* Read and parse CPU id scheme */ void cpuinfo_init(void) @@ -53,6 +83,14 @@ cpuinfo_init(void) uint32_t tmp; #endif + /* + * Prematurely fetch CPU quirks. Standard fetch for tunable + * sysctls is handled using SYSINIT, thus too late for boot CPU. + * Keep names in sync with sysctls. + */ + TUNABLE_INT_FETCH("hw.cpu.quirks.actlr_mask", &cpu_quirks_actlr_mask); + TUNABLE_INT_FETCH("hw.cpu.quirks.actlr_set", &cpu_quirks_actlr_set); + cpuinfo.midr = cp15_midr_get(); /* Test old version id schemes first */ if ((cpuinfo.midr & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD) { @@ -199,15 +237,17 @@ cpuinfo_init(void) #endif } +#if __ARM_ARCH >= 6 /* * Get bits that must be set or cleared in ACLR register. * Note: Bits in ACLR register are IMPLEMENTATION DEFINED. * Its expected that SCU is in operational state before this * function is called. */ -void +static void cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint32_t *actlr_set) { + *actlr_mask = 0; *actlr_set = 0; @@ -282,3 +322,18 @@ cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint3 return; } } + +/* Reinitialize MMU to final kernel mapping and apply all CPU quirks. */ +void +cpuinfo_reinit_mmu(uint32_t ttb) +{ + uint32_t actlr_mask; + uint32_t actlr_set; + + cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); + actlr_mask |= cpu_quirks_actlr_mask; + actlr_set |= cpu_quirks_actlr_set; + reinit_mmu(ttb, actlr_mask, actlr_set); +} + +#endif /* __ARM_ARCH >= 6 */ Modified: stable/11/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/11/sys/arm/arm/mp_machdep.c Wed Apr 4 01:13:28 2018 (r331967) +++ stable/11/sys/arm/arm/mp_machdep.c Wed Apr 4 01:56:46 2018 (r331968) @@ -155,11 +155,9 @@ init_secondary(int cpu) #ifndef INTRNG int start = 0, end = 0; #endif - uint32_t actlr_mask, actlr_set; pmap_set_tex(); - cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); - reinit_mmu(pmap_kern_ttb, actlr_mask, actlr_set); + cpuinfo_reinit_mmu(pmap_kern_ttb); cpu_setup(); /* Provide stack pointers for other processor modes. */ Modified: stable/11/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/11/sys/arm/arm/pmap-v6.c Wed Apr 4 01:13:28 2018 (r331967) +++ stable/11/sys/arm/arm/pmap-v6.c Wed Apr 4 01:56:46 2018 (r331968) @@ -762,7 +762,7 @@ pmap_bootstrap_prepare(vm_paddr_t last) pt1_entry_t *pte1p; pt2_entry_t *pte2p; u_int i; - uint32_t actlr_mask, actlr_set, l1_attr; + uint32_t l1_attr; /* * Now, we are going to make real kernel mapping. Note that we are @@ -879,8 +879,7 @@ pmap_bootstrap_prepare(vm_paddr_t last) /* Finally, switch from 'boot_pt1' to 'kern_pt1'. */ pmap_kern_ttb = base_pt1 | ttb_flags; - cpuinfo_get_actlr_modifier(&actlr_mask, &actlr_set); - reinit_mmu(pmap_kern_ttb, actlr_mask, actlr_set); + cpuinfo_reinit_mmu(pmap_kern_ttb); /* * Initialize the first available KVA. As kernel image is mapped by * sections, we are leaving some gap behind. Modified: stable/11/sys/arm/include/cpuinfo.h ============================================================================== --- stable/11/sys/arm/include/cpuinfo.h Wed Apr 4 01:13:28 2018 (r331967) +++ stable/11/sys/arm/include/cpuinfo.h Wed Apr 4 01:56:46 2018 (r331968) @@ -121,5 +121,7 @@ struct cpuinfo { extern struct cpuinfo cpuinfo; void cpuinfo_init(void); -void cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint32_t *actlr_set); +#if __ARM_ARCH >= 6 +void cpuinfo_reinit_mmu(uint32_t ttb); +#endif #endif /* _MACHINE_CPUINFO_H_ */ Modified: stable/11/sys/arm/include/pmap-v6.h ============================================================================== --- stable/11/sys/arm/include/pmap-v6.h Wed Apr 4 01:13:28 2018 (r331967) +++ stable/11/sys/arm/include/pmap-v6.h Wed Apr 4 01:56:46 2018 (r331968) @@ -177,7 +177,6 @@ vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t int pmap_fault(pmap_t, vm_offset_t, uint32_t, int, bool); void pmap_set_tex(void); -void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set); /* * Pre-bootstrap epoch functions set. From owner-svn-src-all@freebsd.org Wed Apr 4 02:00:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84DA0F857DD; Wed, 4 Apr 2018 02:00:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 338D181599; Wed, 4 Apr 2018 02:00:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A0A6526D; Wed, 4 Apr 2018 02:00:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3420AmP022519; Wed, 4 Apr 2018 02:00:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3420AC3022518; Wed, 4 Apr 2018 02:00:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201804040200.w3420AC3022518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 4 Apr 2018 02:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331969 - head/include X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 331969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:00:11 -0000 Author: pfg Date: Wed Apr 4 02:00:10 2018 New Revision: 331969 URL: https://svnweb.freebsd.org/changeset/base/331969 Log: pthread.h: drop nullability attributes. These have been found to be practically useless. We were actually following the Android bionic library and had some interest in replicating the same warnings and behaviour but Android has since removed them. We are still keeping some uses of nullability attributes in other headers, somewhat in line with Apple's libc. MFC after: 1 week Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde) Modified: head/include/pthread.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Wed Apr 4 01:56:46 2018 (r331968) +++ head/include/pthread.h Wed Apr 4 02:00:10 2018 (r331969) @@ -48,8 +48,6 @@ #include #include -__NULLABILITY_PRAGMA_PUSH - /* * Run-time invariant values: */ @@ -151,34 +149,33 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t * _Nonnull); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( - const pthread_attr_t * _Nonnull __restrict, - void ** _Nonnull __restrict, - size_t * _Nonnull __restrict); -int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); -int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); + const pthread_attr_t * __restrict, void ** __restrict, + size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, + size_t *); +int pthread_attr_getguardsize(const pthread_attr_t *, + size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_init(pthread_attr_t * _Nonnull); -int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *, +int pthread_attr_getdetachstate(const pthread_attr_t *, + int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int); -int pthread_barrier_destroy(pthread_barrier_t * _Nonnull); -int pthread_barrier_init(pthread_barrier_t * _Nonnull, +int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_barrier_destroy(pthread_barrier_t *); +int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); -int pthread_barrier_wait(pthread_barrier_t * _Nonnull); -int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull); +int pthread_barrier_wait(pthread_barrier_t *); +int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t * _Nonnull, int * _Nonnull); -int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull); -int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull, + const pthread_barrierattr_t *, int *); +int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ @@ -194,108 +191,107 @@ int pthread_barrierattr_setpshared(pthread_barrieratt __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t * _Nonnull); -int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull, - clockid_t * _Nonnull); -int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull, - int * _Nonnull); -int pthread_condattr_init(pthread_condattr_t * _Nonnull); -int pthread_condattr_setclock(pthread_condattr_t * _Nonnull, +int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_getclock(const pthread_condattr_t *, + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, + int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int); -int pthread_cond_broadcast(pthread_cond_t * _Nonnull); -int pthread_cond_destroy(pthread_cond_t * _Nonnull); -int pthread_cond_init(pthread_cond_t * _Nonnull, +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t * _Nonnull); -int pthread_cond_timedwait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_cond_signal(pthread_cond_t *); +int pthread_cond_timedwait(pthread_cond_t *, + pthread_mutex_t * __mutex, + const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex) +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *, - void *(* _Nonnull) (void *), void *); +int pthread_create(pthread_t *, const pthread_attr_t *, + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); -int pthread_key_create(pthread_key_t * _Nonnull, +int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull); +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); int pthread_mutexattr_getpshared( - const pthread_mutexattr_t * _Nonnull, int * _Nonnull); -int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull, - int * _Nonnull); -int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull, + const pthread_mutexattr_t *, int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, + int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); -int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex, +int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t *) __requires_unlocked(*__mutex); -int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); -int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_mutex_timedlock(pthread_mutex_t * __mutex, + const struct timespec *) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); -int pthread_once(pthread_once_t * _Nonnull, - void (* _Nonnull) (void)); -int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_once(pthread_once_t *, + void (*) (void)); +int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock, +int pthread_rwlock_init(pthread_rwlock_t * __rwlock, const pthread_rwlockattr_t *) __requires_unlocked(*__rwlock); -int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __unlocks(*__rwlock); -int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull); +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); int pthread_rwlockattr_getkind_np( - const pthread_rwlockattr_t * _Nonnull, int *); + const pthread_rwlockattr_t *, int *); int pthread_rwlockattr_getpshared( - const pthread_rwlockattr_t * _Nonnull, int * _Nonnull); -int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull, + const pthread_rwlockattr_t *, int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull, +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int) +int pthread_spin_init(pthread_spinlock_t * __spin, int) __requires_unlocked(*__spin); -int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_destroy(pthread_spinlock_t * __spin) __requires_unlocked(*__spin); -int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_lock(pthread_spinlock_t * __spin) __locks_exclusive(*__spin); -int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_trylock(pthread_spinlock_t * __spin) __trylocks_exclusive(0, *__spin); -int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_unlock(pthread_spinlock_t * __spin) __unlocks(*__spin); int pthread_cancel(pthread_t); int pthread_setcancelstate(int, int *); @@ -317,27 +313,26 @@ int pthread_mutexattr_getprotocol(pthread_mutexattr_t int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( - pthread_mutexattr_t * _Nonnull __restrict, - int * _Nonnull __restrict); -int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, + pthread_mutexattr_t * __restrict, int * __restrict); +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); -int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull, - struct sched_param * _Nonnull); -int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_getscope(const pthread_attr_t * _Nonnull, - int * _Nonnull); +int pthread_attr_getschedparam(const pthread_attr_t *, + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, + int *); +int pthread_attr_getscope(const pthread_attr_t *, + int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); -int pthread_attr_setschedparam(pthread_attr_t * _Nonnull, - const struct sched_param * _Nonnull); -int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int); -int pthread_attr_setscope(pthread_attr_t * _Nonnull, int); -int pthread_getschedparam(pthread_t pthread, int * _Nonnull, - struct sched_param * _Nonnull); +int pthread_attr_setschedparam(pthread_attr_t *, + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); +int pthread_getschedparam(pthread_t pthread, int *, + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param * _Nonnull); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); @@ -347,6 +342,5 @@ void __pthread_cleanup_push_imp(void (*)(void *), voi struct _pthread_cleanup_info *); void __pthread_cleanup_pop_imp(int); __END_DECLS -__NULLABILITY_PRAGMA_POP #endif /* !_PTHREAD_H_ */ From owner-svn-src-all@freebsd.org Wed Apr 4 02:13:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B9C3F863E7; Wed, 4 Apr 2018 02:13:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D299481EAF; Wed, 4 Apr 2018 02:13:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD6F155A5; Wed, 4 Apr 2018 02:13:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342DRhs043971; Wed, 4 Apr 2018 02:13:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342DRG8043970; Wed, 4 Apr 2018 02:13:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804040213.w342DRG8043970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 4 Apr 2018 02:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331970 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 331970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:13:28 -0000 Author: jhibbits Date: Wed Apr 4 02:13:27 2018 New Revision: 331970 URL: https://svnweb.freebsd.org/changeset/base/331970 Log: Correct the ilog2() for calculating memory sizes. TLB1 can handle ranges up to 4GB (through e5500, larger in e6500), but ilog2() took a unsigned int, which maxes out at 4GB-1, but truncates silently. Increase the input range to the largest supported, at least for 64-bit targets. This lets the DMAP be completely mapped, instead of only 1GB blocks with it assuming being fully mapped. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Apr 4 02:00:10 2018 (r331969) +++ head/sys/powerpc/booke/pmap.c Wed Apr 4 02:13:27 2018 (r331970) @@ -234,7 +234,7 @@ static vm_size_t tlb1_mapin_region(vm_offset_t, vm_pad static vm_size_t tsize2size(unsigned int); static unsigned int size2tsize(vm_size_t); -static unsigned int ilog2(unsigned int); +static unsigned int ilog2(unsigned long); static void set_mas4_defaults(void); @@ -4020,12 +4020,17 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) * Return the largest uint value log such that 2^log <= num. */ static unsigned int -ilog2(unsigned int num) +ilog2(unsigned long num) { - int lz; + long lz; +#ifdef __powerpc64__ + __asm ("cntlzd %0, %1" : "=r" (lz) : "r" (num)); + return (63 - lz); +#else __asm ("cntlzw %0, %1" : "=r" (lz) : "r" (num)); return (31 - lz); +#endif } /* @@ -4163,7 +4168,8 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_si for (idx = 0; idx < nents; idx++) { pgsz = pgs[idx]; - debugf("%u: %llx -> %x, size=%x\n", idx, pa, va, pgsz); + debugf("%u: %llx -> %jx, size=%jx\n", idx, pa, + (uintmax_t)va, (uintmax_t)pgsz); tlb1_set_entry(va, pa, pgsz, _TLB_ENTRY_SHARED | _TLB_ENTRY_MEM); pa += pgsz; From owner-svn-src-all@freebsd.org Wed Apr 4 02:17:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 880F3F86796; Wed, 4 Apr 2018 02:17:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF1C8214A; Wed, 4 Apr 2018 02:17:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35CFD55AC; Wed, 4 Apr 2018 02:17:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342HQP8047595; Wed, 4 Apr 2018 02:17:26 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342HQ48047590; Wed, 4 Apr 2018 02:17:26 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040217.w342HQ48047590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 02:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331971 - stable/11/sys/arm/include X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/sys/arm/include X-SVN-Commit-Revision: 331971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:17:27 -0000 Author: mmel Date: Wed Apr 4 02:17:26 2018 New Revision: 331971 URL: https://svnweb.freebsd.org/changeset/base/331971 Log: MFC r309531,r309553,r309604: r309531: Implement fake pmap_mapdev_attr() for ARMv6. This function is referenced, but never called from DRM2 code. Also, real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't have any additional attribute for a device memory type. r309553: Fix build breakage caused by r309531. r309604: Fix the armv6 build after r309553. Modified: stable/11/sys/arm/include/pmap-v6.h stable/11/sys/arm/include/pmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/pmap-v6.h ============================================================================== --- stable/11/sys/arm/include/pmap-v6.h Wed Apr 4 02:13:27 2018 (r331970) +++ stable/11/sys/arm/include/pmap-v6.h Wed Apr 4 02:17:26 2018 (r331971) @@ -166,7 +166,6 @@ extern ttb_entry_t pmap_kern_ttb; /* TTB for kernel p void pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t, vm_paddr_t); void pmap_kremove(vm_offset_t); -void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); boolean_t pmap_page_is_mapped(vm_page_t); void pmap_tlb_flush(pmap_t, vm_offset_t); Modified: stable/11/sys/arm/include/pmap.h ============================================================================== --- stable/11/sys/arm/include/pmap.h Wed Apr 4 02:13:27 2018 (r331970) +++ stable/11/sys/arm/include/pmap.h Wed Apr 4 02:17:26 2018 (r331971) @@ -37,6 +37,7 @@ #endif #ifdef _KERNEL +#include extern vm_paddr_t dump_avail[]; extern vm_paddr_t phys_avail[]; @@ -52,6 +53,12 @@ void pmap_page_set_memattr(vm_page_t, vm_memattr_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); + +static inline void * +pmap_mapdev_attr(vm_paddr_t addr, vm_size_t size, int attr) +{ + panic("%s is not implemented yet!\n", __func__); +} struct pcb; void pmap_set_pcb_pagedir(pmap_t, struct pcb *); From owner-svn-src-all@freebsd.org Wed Apr 4 02:22:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DBD6F86E44; Wed, 4 Apr 2018 02:22:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34A2A8264B; Wed, 4 Apr 2018 02:22:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D350573E; Wed, 4 Apr 2018 02:22:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342Mvdu056990; Wed, 4 Apr 2018 02:22:57 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342MvNX056989; Wed, 4 Apr 2018 02:22:57 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040222.w342MvNX056989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 02:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331972 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/sys/arm64/arm64 X-SVN-Commit-Revision: 331972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:22:57 -0000 Author: mmel Date: Wed Apr 4 02:22:56 2018 New Revision: 331972 URL: https://svnweb.freebsd.org/changeset/base/331972 Log: MFC r327827: Initialize CONTEXTIDR register on secondary cores by zero, not with undefined value from X1 register. Modified: stable/11/sys/arm64/arm64/locore.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/locore.S ============================================================================== --- stable/11/sys/arm64/arm64/locore.S Wed Apr 4 02:17:26 2018 (r331971) +++ stable/11/sys/arm64/arm64/locore.S Wed Apr 4 02:22:56 2018 (r331972) @@ -167,7 +167,7 @@ ENTRY(mpentry) bl drop_to_el1 /* Set the context id */ - msr contextidr_el1, x1 + msr contextidr_el1, xzr /* Load the kernel page table */ adr x24, pagetable_l0_ttbr1 From owner-svn-src-all@freebsd.org Wed Apr 4 02:30:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C32AF873FB; Wed, 4 Apr 2018 02:30:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0B482DBA; Wed, 4 Apr 2018 02:30:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45D7C574B; Wed, 4 Apr 2018 02:30:01 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342U1j7063474; Wed, 4 Apr 2018 02:30:01 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342U1RD063473; Wed, 4 Apr 2018 02:30:01 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040230.w342U1RD063473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 02:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331973 - stable/11/libexec/rtld-elf/aarch64 X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/libexec/rtld-elf/aarch64 X-SVN-Commit-Revision: 331973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:30:03 -0000 Author: mmel Date: Wed Apr 4 02:30:00 2018 New Revision: 331973 URL: https://svnweb.freebsd.org/changeset/base/331973 Log: MFC r330073: Make rtld_bind_start() debugger friendly. Save link register and annotate call frame structure so debugger can unwind call frame created by rtld_bind_start(). Modified: stable/11/libexec/rtld-elf/aarch64/rtld_start.S Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/aarch64/rtld_start.S ============================================================================== --- stable/11/libexec/rtld-elf/aarch64/rtld_start.S Wed Apr 4 02:22:56 2018 (r331972) +++ stable/11/libexec/rtld-elf/aarch64/rtld_start.S Wed Apr 4 02:30:00 2018 (r331973) @@ -55,7 +55,15 @@ END(.rtld_start) * x17 = &_rtld_bind_start */ ENTRY(_rtld_bind_start) + .cfi_startproc mov x17, sp + + /* Save frame pointer and SP */ + stp x29, x30, [sp, #-16]! + mov x29, sp + .cfi_def_cfa x29, 16 + .cfi_offset x30, -8 + .cfi_offset x29, -16 /* Save the arguments */ stp x0, x1, [sp, #-16]! @@ -84,9 +92,6 @@ ENTRY(_rtld_bind_start) /* Call into rtld */ bl _rtld_bind - /* Restore the registers saved by the plt code */ - ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)] - /* Backup the address to branch to */ mov x16, x0 @@ -100,11 +105,16 @@ ENTRY(_rtld_bind_start) ldp x4, x5, [sp], #16 ldp x2, x3, [sp], #16 ldp x0, x1, [sp], #16 - /* And the part of the stack the plt entry handled */ - add sp, sp, #16 + /* Restore frame pointer */ + ldp x29, xzr, [sp], #16 + + /* Restore link register saved by the plt code */ + ldp xzr, x30, [sp], #16 + /* Call into the correct function */ br x16 + .cfi_endproc END(_rtld_bind_start) /* From owner-svn-src-all@freebsd.org Wed Apr 4 02:31:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 999FBF87656; Wed, 4 Apr 2018 02:31:15 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC0B82F91; Wed, 4 Apr 2018 02:31:15 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45A40577C; Wed, 4 Apr 2018 02:31:15 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342VFTP065514; Wed, 4 Apr 2018 02:31:15 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342VFZX065513; Wed, 4 Apr 2018 02:31:15 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040231.w342VFZX065513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 02:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331974 - stable/11/sys/dev/extres/clk X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/sys/dev/extres/clk X-SVN-Commit-Revision: 331974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:31:15 -0000 Author: mmel Date: Wed Apr 4 02:31:14 2018 New Revision: 331974 URL: https://svnweb.freebsd.org/changeset/base/331974 Log: MFC r330074: Define meaning of remaining clock rounding flags combinations. Modified: stable/11/sys/dev/extres/clk/clk.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/extres/clk/clk.h ============================================================================== --- stable/11/sys/dev/extres/clk/clk.h Wed Apr 4 02:30:00 2018 (r331973) +++ stable/11/sys/dev/extres/clk/clk.h Wed Apr 4 02:31:14 2018 (r331974) @@ -44,8 +44,12 @@ #define CLK_NODE_CANNOT_STOP 0x00000004 /* Clock cannot be disabled */ /* Flags passed to clk_set_freq() and clknode_set_freq(). */ +#define CLK_SET_ROUND(x) ((x) & (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN)) +#define CLK_SET_ROUND_EXACT 0 #define CLK_SET_ROUND_UP 0x00000001 #define CLK_SET_ROUND_DOWN 0x00000002 +#define CLK_SET_ROUND_ANY (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN) + #define CLK_SET_USER_MASK 0x0000FFFF #define CLK_SET_DRYRUN 0x00010000 From owner-svn-src-all@freebsd.org Wed Apr 4 02:35:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7192AF87A58; Wed, 4 Apr 2018 02:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F32A833B9; Wed, 4 Apr 2018 02:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11E6158F1; Wed, 4 Apr 2018 02:35:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342ZmkW073724; Wed, 4 Apr 2018 02:35:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342ZmEb073723; Wed, 4 Apr 2018 02:35:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804040235.w342ZmEb073723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 4 Apr 2018 02:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331975 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 331975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:35:49 -0000 Author: imp Date: Wed Apr 4 02:35:48 2018 New Revision: 331975 URL: https://svnweb.freebsd.org/changeset/base/331975 Log: Fix minor whitespace nits Modified: head/sys/sys/module.h Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Wed Apr 4 02:31:14 2018 (r331974) +++ head/sys/sys/module.h Wed Apr 4 02:35:48 2018 (r331975) @@ -141,7 +141,7 @@ struct mod_pnp_match_info #define DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver) \ MODULE_DEPEND(name, kernel, __FreeBSD_version, \ - __FreeBSD_version, maxver); \ + __FreeBSD_version, maxver); \ MODULE_METADATA(_md_##name, MDT_MODULE, &data, __XSTRING(name));\ SYSINIT(name##module, sub, order, module_register_init, &data); \ struct __hack @@ -156,7 +156,7 @@ struct mod_pnp_match_info * Use it for modules that use kernel interfaces that are not stable * even on STABLE/X branches. */ -#define DECLARE_MODULE_TIED(name, data, sub, order) \ +#define DECLARE_MODULE_TIED(name, data, sub, order) \ DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) #define MODULE_VERSION_CONCAT(module, version) _##module##_version From owner-svn-src-all@freebsd.org Wed Apr 4 02:37:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E54F2F87B41; Wed, 4 Apr 2018 02:37:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98DEC83531; Wed, 4 Apr 2018 02:37:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9315758F2; Wed, 4 Apr 2018 02:37:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w342b5t4074885; Wed, 4 Apr 2018 02:37:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w342b5EA074884; Wed, 4 Apr 2018 02:37:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804040237.w342b5EA074884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 4 Apr 2018 02:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331976 - head/sys/modules/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/cam X-SVN-Commit-Revision: 331976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 02:37:06 -0000 Author: imp Date: Wed Apr 4 02:37:05 2018 New Revision: 331976 URL: https://svnweb.freebsd.org/changeset/base/331976 Log: Add nvme_da back. Now that it can co-exist in the kernel with nvd, add it back to the cam module. Sponsored by: Netflix Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Wed Apr 4 02:35:48 2018 (r331975) +++ head/sys/modules/cam/Makefile Wed Apr 4 02:37:05 2018 (r331976) @@ -46,6 +46,7 @@ SRCS+= ata_machdep.c SRCS+= ata_pmp.c SRCS+= nvme_all.c SRCS+= nvme_xpt.c +SRCS+= nvme_da.c EXPORT_SYMS= YES # XXX evaluate From owner-svn-src-all@freebsd.org Wed Apr 4 04:20:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64421F8D51C; Wed, 4 Apr 2018 04:20:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED92F8718D; Wed, 4 Apr 2018 04:20:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E895669B5; Wed, 4 Apr 2018 04:20:39 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w344Kd42010845; Wed, 4 Apr 2018 04:20:39 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w344KdtY010844; Wed, 4 Apr 2018 04:20:39 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201804040420.w344KdtY010844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 4 Apr 2018 04:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r331977 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 331977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 04:20:40 -0000 Author: hrs Date: Wed Apr 4 04:20:39 2018 New Revision: 331977 URL: https://svnweb.freebsd.org/changeset/base/331977 Log: Add myself temporarily to import Heimdal 7.5.0. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Apr 4 02:37:05 2018 (r331976) +++ svnadmin/conf/sizelimit.conf Wed Apr 4 04:20:39 2018 (r331977) @@ -18,6 +18,7 @@ achim bapt davidcs dim +hrs imp jb jeff From owner-svn-src-all@freebsd.org Wed Apr 4 04:21:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A80BF8D5C1; Wed, 4 Apr 2018 04:21:21 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCE38743B; Wed, 4 Apr 2018 04:21:21 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 471C769F3; Wed, 4 Apr 2018 04:21:21 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w344LLnd013197; Wed, 4 Apr 2018 04:21:21 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w344LKuh013184; Wed, 4 Apr 2018 04:21:20 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201804040421.w344LKuh013184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 4 Apr 2018 04:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r331978 - in vendor-crypto/heimdal/dist: . admin appl appl/afsutil appl/dbutils appl/dceutils appl/ftp appl/gssmask appl/kf appl/kx appl/login appl/otp appl/popper appl/push appl/rcp ap... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: in vendor-crypto/heimdal/dist: . admin appl appl/afsutil appl/dbutils appl/dceutils appl/ftp appl/gssmask appl/kf appl/kx appl/login appl/otp appl/popper appl/push appl/rcp appl/rsh appl/su appl/telne... X-SVN-Commit-Revision: 331978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 04:21:23 -0000 Author: hrs Date: Wed Apr 4 04:21:19 2018 New Revision: 331978 URL: https://svnweb.freebsd.org/changeset/base/331978 Log: Import Heimdal 7.5.0. Added: vendor-crypto/heimdal/dist/admin/ktutil.1 (contents, props changed) vendor-crypto/heimdal/dist/admin/ktutil.cat1 vendor-crypto/heimdal/dist/appl/dbutils/ vendor-crypto/heimdal/dist/appl/dbutils/Makefile.am (contents, props changed) vendor-crypto/heimdal/dist/appl/dbutils/Makefile.in (contents, props changed) vendor-crypto/heimdal/dist/appl/dbutils/NTMakefile vendor-crypto/heimdal/dist/appl/dbutils/bsearch.1 (contents, props changed) vendor-crypto/heimdal/dist/appl/dbutils/bsearch.c (contents, props changed) vendor-crypto/heimdal/dist/appl/dbutils/bsearch.cat1 vendor-crypto/heimdal/dist/appl/test/jgssapi_server.java vendor-crypto/heimdal/dist/cf/._ltoptions.m4 (contents, props changed) vendor-crypto/heimdal/dist/cf/._ltsugar.m4 (contents, props changed) vendor-crypto/heimdal/dist/cf/._lt~obsolete.m4 (contents, props changed) vendor-crypto/heimdal/dist/cf/krb-prog-perl.m4 vendor-crypto/heimdal/dist/cf/maybe-valgrind.sh (contents, props changed) vendor-crypto/heimdal/dist/cf/roken-h-process.pl (contents, props changed) vendor-crypto/heimdal/dist/cf/symbol-version.py (contents, props changed) vendor-crypto/heimdal/dist/cf/w32-check-exported-symbols.pl (contents, props changed) vendor-crypto/heimdal/dist/cf/w32-def-from-dll.pl (contents, props changed) vendor-crypto/heimdal/dist/cf/w32-detect-vc-version.pl (contents, props changed) vendor-crypto/heimdal/dist/cf/w32-hh-toc-from-info.pl (contents, props changed) vendor-crypto/heimdal/dist/cf/w32-list-externs-from-objs.pl (contents, props changed) vendor-crypto/heimdal/dist/doc/base.din vendor-crypto/heimdal/dist/doc/base.hhp vendor-crypto/heimdal/dist/doc/doxyout/base/ vendor-crypto/heimdal/dist/doc/doxyout/base/html/ vendor-crypto/heimdal/dist/doc/doxyout/base/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/doxygen.css (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/doxygen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/base/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/graph_legend.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/base/html/graph_legend.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/group__heimbase.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/index.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/base/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/base/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/base/html/modules.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/html/tabs.css (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/man/ vendor-crypto/heimdal/dist/doc/doxyout/base/man/man3/ vendor-crypto/heimdal/dist/doc/doxyout/base/man/man3/heimbase.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/base/manpages vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/internal_v_smechname.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/gss_display_status.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/gss_export_name.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/internal_v_smechname.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/example_evp_cipher_8c-example.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/pages.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/OSSL_CIPHER_ALGORITHM.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/WINCNG_CIPHER_ALGORITHM.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/WINCNG_CIPHER_ALGORITHM_UNAVAILABLE.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/classes.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_ca_tbs_set_signature_algorithm.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/classes.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/structkrb5plugin__an2ln__ftable__desc.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/structkrb5plugin__db__ftable__desc.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/structkrb5plugin__kuserok__ftable__desc.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_abort.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_abortx.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_aname_to_localname.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_dcc_ops.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_err.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_errx.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_free_error_message.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_generate_random.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_generate_random_block.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_get_err_text.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_get_error_message.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_get_error_string.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_get_warn_dest.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_is_enctype_weak.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal_is_gss_hostbased_service.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal_is_lkdc.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal_is_null.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal_is_pku2u.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal_is_root_krbtgt.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_realm_is_lkdc.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_ret_int64.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_ret_uint64.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_set_warn_dest.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_storage_from_socket.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_storage_fsync.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_store_int64.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_store_uint64.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_vabort.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_verr.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_verrx.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_vprepend_error_message.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_vset_error_message.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_vwarnx.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_warn.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_warnx.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5plugin_an2ln_ftable_desc.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5plugin_db_ftable_desc.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5plugin_kuserok_ftable_desc.3 (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/classes.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/test_ntlm_8c-example.html (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/bc_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/bdwn.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/closed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/doc.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/dynsections.js vendor-crypto/heimdal/dist/doc/doxyout/wind/html/folderclosed.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/folderopen.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/graph_legend.md5 vendor-crypto/heimdal/dist/doc/doxyout/wind/html/jquery.js vendor-crypto/heimdal/dist/doc/doxyout/wind/html/menu.js vendor-crypto/heimdal/dist/doc/doxyout/wind/html/menudata.js vendor-crypto/heimdal/dist/doc/doxyout/wind/html/nav_f.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/nav_g.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/nav_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/open.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/splitbar.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/sync_off.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/sync_on.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_a.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_b.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_h.png (contents, props changed) vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_s.png (contents, props changed) vendor-crypto/heimdal/dist/doc/heimdal.hhp vendor-crypto/heimdal/dist/doc/hx509.hhp vendor-crypto/heimdal/dist/include/config.h.w32 vendor-crypto/heimdal/dist/kadmin/kadmin.1 (contents, props changed) vendor-crypto/heimdal/dist/kadmin/kadmin.cat1 vendor-crypto/heimdal/dist/kdc/fast.c (contents, props changed) vendor-crypto/heimdal/dist/kdc/kdc-tester.c (contents, props changed) vendor-crypto/heimdal/dist/kdc/pkinit-ec.c (contents, props changed) vendor-crypto/heimdal/dist/kuser/heimtools-commands.in (contents, props changed) vendor-crypto/heimdal/dist/kuser/heimtools-version.rc vendor-crypto/heimdal/dist/kuser/heimtools.c (contents, props changed) vendor-crypto/heimdal/dist/kuser/kcpytkt.c (contents, props changed) vendor-crypto/heimdal/dist/kuser/kdeltkt.c (contents, props changed) vendor-crypto/heimdal/dist/kuser/kvno.c (contents, props changed) vendor-crypto/heimdal/dist/lib/asn1/README.template vendor-crypto/heimdal/dist/lib/asn1/fuzzer.c (contents, props changed) vendor-crypto/heimdal/dist/lib/asn1/roken_rename.h (contents, props changed) vendor-crypto/heimdal/dist/lib/base/ vendor-crypto/heimdal/dist/lib/base/Makefile.am (contents, props changed) vendor-crypto/heimdal/dist/lib/base/Makefile.in (contents, props changed) vendor-crypto/heimdal/dist/lib/base/NTMakefile vendor-crypto/heimdal/dist/lib/base/array.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/baselocl.h (contents, props changed) vendor-crypto/heimdal/dist/lib/base/bool.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/bsearch.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/data.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/db.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/dict.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/dll.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/error.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/heimbase.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/heimbase.h (contents, props changed) vendor-crypto/heimdal/dist/lib/base/heimbasepriv.h (contents, props changed) vendor-crypto/heimdal/dist/lib/base/heimqueue.h (contents, props changed) vendor-crypto/heimdal/dist/lib/base/json.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/null.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/number.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/roken_rename.h (contents, props changed) vendor-crypto/heimdal/dist/lib/base/string.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/test_base.c (contents, props changed) vendor-crypto/heimdal/dist/lib/base/version-script.map vendor-crypto/heimdal/dist/lib/com_err/com_err.3 (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/gen-oid.pl (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/gssapi/gssapi_netlogon.h (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/krb5/test_acquire_cred.c (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/krb5/test_cred.c (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/krb5/test_kcred.c (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/krb5/test_oid.c (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/oid.txt (contents, props changed) vendor-crypto/heimdal/dist/lib/gssapi/test_add_store_cred.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/dh-tfm.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-crypt.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-openssl.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-openssl.h (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-pkcs11.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-pkcs11.h (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-w32.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-w32.h (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-wincng.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/evp-wincng.h (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/rand-w32.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/rsa-tfm.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/test_bulk.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hcrypto/undef.h (contents, props changed) vendor-crypto/heimdal/dist/lib/hdb/hdb-mdb.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hdb/test_hdbplugin.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hx509/crypto-ec.c (contents, props changed) vendor-crypto/heimdal/dist/lib/hx509/data/PKITS_data.zip (contents, props changed) vendor-crypto/heimdal/dist/lib/hx509/data/eccurve.pem vendor-crypto/heimdal/dist/lib/hx509/data/https.crt vendor-crypto/heimdal/dist/lib/hx509/data/https.key vendor-crypto/heimdal/dist/lib/hx509/data/mkcert.sh (contents, props changed) vendor-crypto/heimdal/dist/lib/hx509/data/nist-result2 vendor-crypto/heimdal/dist/lib/hx509/data/secp256r1TestCA.cert.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r1TestCA.key.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r1TestCA.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r2TestClient.cert.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r2TestClient.key.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r2TestClient.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r2TestServer.cert.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r2TestServer.key.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp256r2TestServer.pem vendor-crypto/heimdal/dist/lib/kadm5/setkey3_s.c (contents, props changed) vendor-crypto/heimdal/dist/lib/kadm5/version-script-client.map vendor-crypto/heimdal/dist/lib/kafs/rxkad_kdf.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/an2ln_plugin.h (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/config_reg.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/crypto-aes-sha1.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/crypto-aes-sha2.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/db_plugin.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/db_plugin.h (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/dcache.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/dll.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/enomem.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/fast.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/krb5-plugin.7 (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/krb5-plugin.cat7 vendor-crypto/heimdal/dist/lib/krb5/kuserok_plugin.h (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/libkrb5-exports.def.in (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/pkinit-ec.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/pseudo-random-test.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/salt-aes-sha1.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/salt-aes-sha2.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/sp800-108-kdf.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/store_sock.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/test_canon.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/test_expand_toks.c (contents, props changed) vendor-crypto/heimdal/dist/lib/krb5/test_set_kvno0.c (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/compile (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/historyn.c (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/keymacro.c (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/keymacro.h (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/readline/ vendor-crypto/heimdal/dist/lib/libedit/src/readline/readline.h (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/terminal.c (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/terminal.h (contents, props changed) vendor-crypto/heimdal/dist/lib/libedit/src/tokenizern.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/detach.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/dirent-test.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/dirent.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/dirent.hin vendor-crypto/heimdal/dist/lib/roken/dlfcn.hin vendor-crypto/heimdal/dist/lib/roken/dlfcn_w32.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/getifaddrs_w32.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/getxxyyy.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/memset_s.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/mkdir.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/rename.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/simple_exec_w32.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/sleep.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/sockstartup_w32.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/stdbool.hin vendor-crypto/heimdal/dist/lib/roken/stdint.hin vendor-crypto/heimdal/dist/lib/roken/strtoll.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/strtoull.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/syslog.hin vendor-crypto/heimdal/dist/lib/roken/syslogc.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/test-detach.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/test-mini_inetd.c (contents, props changed) vendor-crypto/heimdal/dist/lib/roken/win32_alloc.c (contents, props changed) vendor-crypto/heimdal/dist/lib/sqlite/README vendor-crypto/heimdal/dist/lib/vers/make-print-version.c (contents, props changed) vendor-crypto/heimdal/dist/packages/NTMakefile vendor-crypto/heimdal/dist/packages/windows/installer/heimdal-command.wxs vendor-crypto/heimdal/dist/packages/windows/installer/heimdal-gss.wxs vendor-crypto/heimdal/dist/packages/windows/installer/images/ vendor-crypto/heimdal/dist/packages/windows/installer/images/Heimdal_banner.bmp (contents, props changed) vendor-crypto/heimdal/dist/packages/windows/installer/images/Heimdal_banner.png (contents, props changed) vendor-crypto/heimdal/dist/packages/windows/installer/images/Heimdal_dialog.bmp (contents, props changed) vendor-crypto/heimdal/dist/packages/windows/installer/images/Heimdal_dialog.png (contents, props changed) vendor-crypto/heimdal/dist/test-driver (contents, props changed) vendor-crypto/heimdal/dist/tests/bin/intr.c (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/an2ln-db.txt (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/check-authz.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/check-canon.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/check-fast.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/check-hdb-mitdb.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/check-kinit.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/check-tester.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/hdb-mitdb (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/hdb-mitdb.kadm5 (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/hdb-mitdb.mkey (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/k5login/ vendor-crypto/heimdal/dist/tests/kdc/k5login/foo vendor-crypto/heimdal/dist/tests/kdc/kdc-tester1.json vendor-crypto/heimdal/dist/tests/kdc/kdc-tester2.json vendor-crypto/heimdal/dist/tests/kdc/kdc-tester3.json vendor-crypto/heimdal/dist/tests/kdc/kdc-tester4.json.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/krb5-authz.conf.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/krb5-authz2.conf.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/krb5-canon.conf.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/krb5-canon2.conf.in (contents, props changed) vendor-crypto/heimdal/dist/tests/kdc/krb5-hdb-mitdb.conf.in (contents, props changed) vendor-crypto/heimdal/dist/tools/cov.sh (contents, props changed) vendor-crypto/heimdal/dist/tools/heimdal-kadm-client.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/heimdal-kadm-server.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/heimdal-krb5.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/kadm-client.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/kadm-server.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/kafs.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/krb5-gssapi.pc.in (contents, props changed) vendor-crypto/heimdal/dist/tools/krb5.pc.in (contents, props changed) vendor-crypto/heimdal/dist/windows/README.md Deleted: vendor-crypto/heimdal/dist/admin/ktutil.8 vendor-crypto/heimdal/dist/admin/ktutil.cat8 vendor-crypto/heimdal/dist/appl/ftp/ vendor-crypto/heimdal/dist/appl/kx/ vendor-crypto/heimdal/dist/appl/login/ vendor-crypto/heimdal/dist/appl/popper/ vendor-crypto/heimdal/dist/appl/push/ vendor-crypto/heimdal/dist/appl/rcp/ vendor-crypto/heimdal/dist/appl/rsh/ vendor-crypto/heimdal/dist/appl/telnet/ vendor-crypto/heimdal/dist/appl/xnlock/ vendor-crypto/heimdal/dist/base/ vendor-crypto/heimdal/dist/cf/check-x.m4 vendor-crypto/heimdal/dist/cf/check-xau.m4 vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/internalvsmechname.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tab_r.gif vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/__gss_c_attr_stream_sizes_oid_desc.3 vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/internalvsmechname.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/example__evp__cipher_8c-example.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tab_r.gif vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tab_r.gif vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tab_r.gif vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tab_r.gif vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tab_r.gif vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/test__ntlm_8c-example.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/challenge.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/context.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/domain.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/flags.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/hostname.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/lm.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ntlm.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/os.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/sessionkey.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/targetinfo.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/targetname.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/username.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ws.3 vendor-crypto/heimdal/dist/doc/doxyout/wind/html/graph_legend.dot vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_b.gif vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_l.gif vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tab_r.gif vendor-crypto/heimdal/dist/kadmin/kadmin.8 vendor-crypto/heimdal/dist/kadmin/kadmin.cat8 vendor-crypto/heimdal/dist/kuser/kcc-commands.in vendor-crypto/heimdal/dist/kuser/kcc-version.rc vendor-crypto/heimdal/dist/kuser/kcc.c vendor-crypto/heimdal/dist/lib/hcrypto/dllmain.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_mp_isprime.c vendor-crypto/heimdal/dist/lib/hcrypto/rand-egd.c vendor-crypto/heimdal/dist/lib/heimdal/dllmain.c vendor-crypto/heimdal/dist/lib/hx509/data/secp160r1TestCA.cert.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r1TestCA.key.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r1TestCA.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r2TestClient.cert.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r2TestClient.key.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r2TestClient.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r2TestServer.cert.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r2TestServer.key.pem vendor-crypto/heimdal/dist/lib/hx509/data/secp160r2TestServer.pem vendor-crypto/heimdal/dist/lib/krb5/crypto-aes.c vendor-crypto/heimdal/dist/lib/krb5/salt-aes.c vendor-crypto/heimdal/dist/lib/libedit/src/editline/ vendor-crypto/heimdal/dist/lib/libedit/src/el_term.h vendor-crypto/heimdal/dist/lib/libedit/src/fgetln.c vendor-crypto/heimdal/dist/lib/libedit/src/key.c vendor-crypto/heimdal/dist/lib/libedit/src/key.h vendor-crypto/heimdal/dist/lib/libedit/src/strlcat.c vendor-crypto/heimdal/dist/lib/libedit/src/strlcpy.c vendor-crypto/heimdal/dist/lib/libedit/src/term.c vendor-crypto/heimdal/dist/windows/README vendor-crypto/heimdal/dist/windows/maint.el Modified: vendor-crypto/heimdal/dist/LICENSE vendor-crypto/heimdal/dist/Makefile.am vendor-crypto/heimdal/dist/Makefile.in vendor-crypto/heimdal/dist/NEWS vendor-crypto/heimdal/dist/NTMakefile vendor-crypto/heimdal/dist/aclocal.m4 vendor-crypto/heimdal/dist/admin/Makefile.am vendor-crypto/heimdal/dist/admin/Makefile.in vendor-crypto/heimdal/dist/admin/ktutil-commands.in vendor-crypto/heimdal/dist/admin/list.c vendor-crypto/heimdal/dist/appl/Makefile.am vendor-crypto/heimdal/dist/appl/Makefile.in vendor-crypto/heimdal/dist/appl/afsutil/Makefile.am vendor-crypto/heimdal/dist/appl/afsutil/Makefile.in vendor-crypto/heimdal/dist/appl/afsutil/afslog.1 vendor-crypto/heimdal/dist/appl/afsutil/afslog.c vendor-crypto/heimdal/dist/appl/afsutil/afslog.cat1 vendor-crypto/heimdal/dist/appl/afsutil/pagsh.1 vendor-crypto/heimdal/dist/appl/afsutil/pagsh.c vendor-crypto/heimdal/dist/appl/afsutil/pagsh.cat1 vendor-crypto/heimdal/dist/appl/dceutils/Makefile.in vendor-crypto/heimdal/dist/appl/dceutils/k5dce.h vendor-crypto/heimdal/dist/appl/gssmask/Makefile.in vendor-crypto/heimdal/dist/appl/gssmask/common.h vendor-crypto/heimdal/dist/appl/gssmask/gssmaestro.c vendor-crypto/heimdal/dist/appl/gssmask/gssmask.c vendor-crypto/heimdal/dist/appl/kf/Makefile.in vendor-crypto/heimdal/dist/appl/kf/kf.1 vendor-crypto/heimdal/dist/appl/kf/kf.c vendor-crypto/heimdal/dist/appl/kf/kf.cat1 vendor-crypto/heimdal/dist/appl/kf/kfd.8 vendor-crypto/heimdal/dist/appl/kf/kfd.c vendor-crypto/heimdal/dist/appl/kf/kfd.cat8 vendor-crypto/heimdal/dist/appl/otp/Makefile.am vendor-crypto/heimdal/dist/appl/otp/Makefile.in vendor-crypto/heimdal/dist/appl/otp/otp.c vendor-crypto/heimdal/dist/appl/otp/otpprint.c vendor-crypto/heimdal/dist/appl/su/Makefile.am vendor-crypto/heimdal/dist/appl/su/Makefile.in vendor-crypto/heimdal/dist/appl/su/su.c vendor-crypto/heimdal/dist/appl/test/Makefile.am vendor-crypto/heimdal/dist/appl/test/Makefile.in vendor-crypto/heimdal/dist/appl/test/common.c vendor-crypto/heimdal/dist/appl/test/gssapi_client.c vendor-crypto/heimdal/dist/appl/test/gssapi_server.c vendor-crypto/heimdal/dist/appl/test/http_client.c vendor-crypto/heimdal/dist/appl/test/nt_gss_common.c vendor-crypto/heimdal/dist/appl/test/nt_gss_server.c vendor-crypto/heimdal/dist/appl/test/tcp_server.c vendor-crypto/heimdal/dist/appl/test/test_locl.h vendor-crypto/heimdal/dist/appl/test/uu_client.c vendor-crypto/heimdal/dist/appl/test/uu_server.c vendor-crypto/heimdal/dist/autogen.sh vendor-crypto/heimdal/dist/cf/Makefile.am.common vendor-crypto/heimdal/dist/cf/check-compile-et.m4 vendor-crypto/heimdal/dist/cf/crypto.m4 vendor-crypto/heimdal/dist/cf/db.m4 vendor-crypto/heimdal/dist/cf/dispatch.m4 vendor-crypto/heimdal/dist/cf/dlopen.m4 vendor-crypto/heimdal/dist/cf/find-func-no-libs2.m4 vendor-crypto/heimdal/dist/cf/install-catman.sh vendor-crypto/heimdal/dist/cf/libtool.m4 vendor-crypto/heimdal/dist/cf/ltoptions.m4 vendor-crypto/heimdal/dist/cf/ltsugar.m4 vendor-crypto/heimdal/dist/cf/ltversion.m4 vendor-crypto/heimdal/dist/cf/lt~obsolete.m4 vendor-crypto/heimdal/dist/cf/make-proto.pl vendor-crypto/heimdal/dist/cf/pthreads.m4 vendor-crypto/heimdal/dist/cf/roken-frag.m4 vendor-crypto/heimdal/dist/cf/sunos.m4 vendor-crypto/heimdal/dist/cf/test-package.m4 vendor-crypto/heimdal/dist/cf/valgrind-suppressions vendor-crypto/heimdal/dist/cf/wflags.m4 vendor-crypto/heimdal/dist/compile vendor-crypto/heimdal/dist/config.guess vendor-crypto/heimdal/dist/config.sub vendor-crypto/heimdal/dist/configure vendor-crypto/heimdal/dist/configure.ac vendor-crypto/heimdal/dist/depcomp vendor-crypto/heimdal/dist/doc/Makefile.am vendor-crypto/heimdal/dist/doc/Makefile.in vendor-crypto/heimdal/dist/doc/NTMakefile vendor-crypto/heimdal/dist/doc/ack.texi vendor-crypto/heimdal/dist/doc/copyright.texi vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/group__gssapi.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/gssapi_mechs_intro.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/gssapi_services_intro.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/modules.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/pages.html vendor-crypto/heimdal/dist/doc/doxyout/gssapi/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/gssapi.3 vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/gssapi_mechs_intro.3 vendor-crypto/heimdal/dist/doc/doxyout/gssapi/man/man3/gssapi_services_intro.3 vendor-crypto/heimdal/dist/doc/doxyout/gssapi/manpages vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/examples.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__core.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__des.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__dh.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__evp.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__misc.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__rand.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/group__hcrypto__rsa.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/modules.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/page_des.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/page_dh.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/page_evp.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/page_rand.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/page_rsa.html vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_core.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_des.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_dh.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_evp.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_misc.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/hcrypto_rsa.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/page_des.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/page_dh.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/page_evp.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/page_rand.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/man/man3/page_rsa.3 vendor-crypto/heimdal/dist/doc/doxyout/hcrypto/manpages vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/annotated.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/functions.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/functions_vars.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/struct_h_d_b.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/structhdb__entry__ex.html vendor-crypto/heimdal/dist/doc/doxyout/hdb/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/hdb/man/man3/HDB.3 vendor-crypto/heimdal/dist/doc/doxyout/hdb/man/man3/hdb_entry_ex.3 vendor-crypto/heimdal/dist/doc/doxyout/hdb/manpages vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__ca.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__cert.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__cms.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__crypto.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__env.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__error.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__keyset.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__lock.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__misc.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__name.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__peer.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__print.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__query.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__revoke.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/group__hx509__verify.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/modules.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_ca.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_cert.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_cms.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_env.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_error.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_keyset.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_lock.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_name.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_peer.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_print.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/page_revoke.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/pages.html vendor-crypto/heimdal/dist/doc/doxyout/hx509/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_ca.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_cert.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_cms.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_crypto.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_env.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_error.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_keyset.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_lock.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_misc.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_name.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_peer.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_print.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_query.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_revoke.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/hx509_verify.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_ca.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_cert.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_cms.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_env.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_error.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_keyset.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_lock.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_name.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_peer.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_print.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/man/man3/page_revoke.3 vendor-crypto/heimdal/dist/doc/doxyout/hx509/manpages vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/annotated.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__address.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__auth.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__ccache.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__credential.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__crypto.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__deprecated.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__digest.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__error.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__keytab.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__pac.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__principal.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__storage.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__support.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__ticket.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/group__krb5__v4compat.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/krb5_ccache_intro.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/krb5_fileformats.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/krb5_init_creds_intro.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/krb5_introduction.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/krb5_keytab_intro.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/krb5_principal_intro.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/modules.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/pages.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/structkrb5__crypto__iov.html vendor-crypto/heimdal/dist/doc/doxyout/krb5/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_address.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_auth.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_ccache.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_credential.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_crypto.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_crypto_iov.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_deprecated.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_digest.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_error.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_fileformats.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_init_creds_intro.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_introduction.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_keytab.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_keytab_intro.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_pac.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_principal_intro.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_storage.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_support.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_ticket.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/man/man3/krb5_v4compat.3 vendor-crypto/heimdal/dist/doc/doxyout/krb5/manpages vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/annotated.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/examples.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/functions.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/functions_vars.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/group__ntlm__core.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/modules.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__buf.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type1.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type2.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type2__coll__graph.map vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type2__coll__graph.md5 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type2__coll__graph.png vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type3.html vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type3__coll__graph.map vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type3__coll__graph.md5 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/structntlm__type3__coll__graph.png vendor-crypto/heimdal/dist/doc/doxyout/ntlm/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ntlm_buf.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ntlm_core.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ntlm_type1.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ntlm_type2.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/man/man3/ntlm_type3.3 vendor-crypto/heimdal/dist/doc/doxyout/ntlm/manpages vendor-crypto/heimdal/dist/doc/doxyout/wind/html/doxygen.css vendor-crypto/heimdal/dist/doc/doxyout/wind/html/doxygen.png vendor-crypto/heimdal/dist/doc/doxyout/wind/html/graph_legend.html vendor-crypto/heimdal/dist/doc/doxyout/wind/html/graph_legend.png vendor-crypto/heimdal/dist/doc/doxyout/wind/html/group__wind.html vendor-crypto/heimdal/dist/doc/doxyout/wind/html/index.html vendor-crypto/heimdal/dist/doc/doxyout/wind/html/modules.html vendor-crypto/heimdal/dist/doc/doxyout/wind/html/tabs.css vendor-crypto/heimdal/dist/doc/doxyout/wind/man/man3/wind.3 vendor-crypto/heimdal/dist/doc/doxyout/wind/manpages vendor-crypto/heimdal/dist/doc/doxytmpl.dxy vendor-crypto/heimdal/dist/doc/heimdal.info vendor-crypto/heimdal/dist/doc/heimdal.texi vendor-crypto/heimdal/dist/doc/hx509.info vendor-crypto/heimdal/dist/doc/hx509.texi vendor-crypto/heimdal/dist/doc/migration.texi vendor-crypto/heimdal/dist/doc/setup.texi vendor-crypto/heimdal/dist/doc/vars.texi vendor-crypto/heimdal/dist/doc/vars.tin vendor-crypto/heimdal/dist/doc/whatis.texi vendor-crypto/heimdal/dist/doc/win2k.texi vendor-crypto/heimdal/dist/etc/Makefile.in vendor-crypto/heimdal/dist/include/Makefile.am vendor-crypto/heimdal/dist/include/Makefile.in vendor-crypto/heimdal/dist/include/NTMakefile vendor-crypto/heimdal/dist/include/bits.c vendor-crypto/heimdal/dist/include/config.h.in vendor-crypto/heimdal/dist/include/crypto-headers.h vendor-crypto/heimdal/dist/include/gssapi/Makefile.in vendor-crypto/heimdal/dist/include/hcrypto/Makefile.am vendor-crypto/heimdal/dist/include/hcrypto/Makefile.in vendor-crypto/heimdal/dist/include/heim_threads.h vendor-crypto/heimdal/dist/include/kadm5/Makefile.in vendor-crypto/heimdal/dist/include/krb5-types.cross vendor-crypto/heimdal/dist/install-sh vendor-crypto/heimdal/dist/kadmin/Makefile.am vendor-crypto/heimdal/dist/kadmin/Makefile.in vendor-crypto/heimdal/dist/kadmin/add-random-users.c vendor-crypto/heimdal/dist/kadmin/add_enctype.c vendor-crypto/heimdal/dist/kadmin/ank.c vendor-crypto/heimdal/dist/kadmin/check.c vendor-crypto/heimdal/dist/kadmin/cpw.c vendor-crypto/heimdal/dist/kadmin/del_enctype.c vendor-crypto/heimdal/dist/kadmin/dump.c vendor-crypto/heimdal/dist/kadmin/ext.c vendor-crypto/heimdal/dist/kadmin/get.c vendor-crypto/heimdal/dist/kadmin/init.c vendor-crypto/heimdal/dist/kadmin/kadm_conn.c vendor-crypto/heimdal/dist/kadmin/kadmin-commands.in vendor-crypto/heimdal/dist/kadmin/kadmin.c vendor-crypto/heimdal/dist/kadmin/kadmin_locl.h vendor-crypto/heimdal/dist/kadmin/kadmind.8 vendor-crypto/heimdal/dist/kadmin/kadmind.c vendor-crypto/heimdal/dist/kadmin/kadmind.cat8 vendor-crypto/heimdal/dist/kadmin/load.c vendor-crypto/heimdal/dist/kadmin/mod.c vendor-crypto/heimdal/dist/kadmin/rpc.c vendor-crypto/heimdal/dist/kadmin/server.c vendor-crypto/heimdal/dist/kadmin/stash.c vendor-crypto/heimdal/dist/kadmin/util.c vendor-crypto/heimdal/dist/kcm/Makefile.am vendor-crypto/heimdal/dist/kcm/Makefile.in vendor-crypto/heimdal/dist/kcm/acquire.c vendor-crypto/heimdal/dist/kcm/cache.c vendor-crypto/heimdal/dist/kcm/client.c vendor-crypto/heimdal/dist/kcm/config.c vendor-crypto/heimdal/dist/kcm/events.c vendor-crypto/heimdal/dist/kcm/glue.c vendor-crypto/heimdal/dist/kcm/kcm-protos.h vendor-crypto/heimdal/dist/kcm/kcm.8 vendor-crypto/heimdal/dist/kcm/kcm.cat8 vendor-crypto/heimdal/dist/kcm/kcm_locl.h vendor-crypto/heimdal/dist/kcm/log.c vendor-crypto/heimdal/dist/kcm/main.c vendor-crypto/heimdal/dist/kcm/protocol.c vendor-crypto/heimdal/dist/kcm/renew.c vendor-crypto/heimdal/dist/kdc/Makefile.am vendor-crypto/heimdal/dist/kdc/Makefile.in vendor-crypto/heimdal/dist/kdc/NTMakefile vendor-crypto/heimdal/dist/kdc/config.c vendor-crypto/heimdal/dist/kdc/connect.c vendor-crypto/heimdal/dist/kdc/default_config.c vendor-crypto/heimdal/dist/kdc/digest-service.c vendor-crypto/heimdal/dist/kdc/digest.c vendor-crypto/heimdal/dist/kdc/headers.h vendor-crypto/heimdal/dist/kdc/hprop.c vendor-crypto/heimdal/dist/kdc/hprop.h vendor-crypto/heimdal/dist/kdc/hpropd.c vendor-crypto/heimdal/dist/kdc/kdc-private.h vendor-crypto/heimdal/dist/kdc/kdc-protos.h vendor-crypto/heimdal/dist/kdc/kdc-replay.c vendor-crypto/heimdal/dist/kdc/kdc.8 vendor-crypto/heimdal/dist/kdc/kdc.cat8 vendor-crypto/heimdal/dist/kdc/kdc.h vendor-crypto/heimdal/dist/kdc/kdc_locl.h vendor-crypto/heimdal/dist/kdc/kerberos5.c vendor-crypto/heimdal/dist/kdc/krb5tgs.c vendor-crypto/heimdal/dist/kdc/kstash.c vendor-crypto/heimdal/dist/kdc/kx509.c vendor-crypto/heimdal/dist/kdc/log.c vendor-crypto/heimdal/dist/kdc/main.c vendor-crypto/heimdal/dist/kdc/misc.c vendor-crypto/heimdal/dist/kdc/mit_dump.c vendor-crypto/heimdal/dist/kdc/pkinit.c vendor-crypto/heimdal/dist/kdc/process.c vendor-crypto/heimdal/dist/kdc/string2key.c vendor-crypto/heimdal/dist/kdc/windc.c vendor-crypto/heimdal/dist/kdc/windc_plugin.h vendor-crypto/heimdal/dist/kpasswd/Makefile.am vendor-crypto/heimdal/dist/kpasswd/Makefile.in vendor-crypto/heimdal/dist/kpasswd/kpasswd-generator.c vendor-crypto/heimdal/dist/kpasswd/kpasswd.c vendor-crypto/heimdal/dist/kpasswd/kpasswd_locl.h vendor-crypto/heimdal/dist/kpasswd/kpasswdd.c vendor-crypto/heimdal/dist/krb5.conf vendor-crypto/heimdal/dist/kuser/Makefile.am vendor-crypto/heimdal/dist/kuser/Makefile.in vendor-crypto/heimdal/dist/kuser/NTMakefile vendor-crypto/heimdal/dist/kuser/copy_cred_cache.c vendor-crypto/heimdal/dist/kuser/generate-requests.c vendor-crypto/heimdal/dist/kuser/kdecode_ticket.c vendor-crypto/heimdal/dist/kuser/kdigest.8 vendor-crypto/heimdal/dist/kuser/kdigest.c vendor-crypto/heimdal/dist/kuser/kgetcred.1 vendor-crypto/heimdal/dist/kuser/kgetcred.c vendor-crypto/heimdal/dist/kuser/kgetcred.cat1 vendor-crypto/heimdal/dist/kuser/kimpersonate.8 vendor-crypto/heimdal/dist/kuser/kimpersonate.c vendor-crypto/heimdal/dist/kuser/kimpersonate.cat8 vendor-crypto/heimdal/dist/kuser/kinit.1 vendor-crypto/heimdal/dist/kuser/kinit.c vendor-crypto/heimdal/dist/kuser/kinit.cat1 vendor-crypto/heimdal/dist/kuser/klist.c vendor-crypto/heimdal/dist/kuser/kswitch.1 vendor-crypto/heimdal/dist/kuser/kswitch.c vendor-crypto/heimdal/dist/kuser/kswitch.cat1 vendor-crypto/heimdal/dist/kuser/kuser_locl.h vendor-crypto/heimdal/dist/kuser/kverify.c vendor-crypto/heimdal/dist/lib/Makefile.am vendor-crypto/heimdal/dist/lib/Makefile.in vendor-crypto/heimdal/dist/lib/NTMakefile vendor-crypto/heimdal/dist/lib/asn1/Makefile.am vendor-crypto/heimdal/dist/lib/asn1/Makefile.in vendor-crypto/heimdal/dist/lib/asn1/NTMakefile vendor-crypto/heimdal/dist/lib/asn1/asn1-common.h vendor-crypto/heimdal/dist/lib/asn1/asn1-template.h vendor-crypto/heimdal/dist/lib/asn1/asn1_gen.c vendor-crypto/heimdal/dist/lib/asn1/asn1_print.c vendor-crypto/heimdal/dist/lib/asn1/asn1parse.c vendor-crypto/heimdal/dist/lib/asn1/asn1parse.h vendor-crypto/heimdal/dist/lib/asn1/asn1parse.y vendor-crypto/heimdal/dist/lib/asn1/check-common.c vendor-crypto/heimdal/dist/lib/asn1/check-common.h vendor-crypto/heimdal/dist/lib/asn1/check-der.c vendor-crypto/heimdal/dist/lib/asn1/check-gen.c vendor-crypto/heimdal/dist/lib/asn1/check-template.c vendor-crypto/heimdal/dist/lib/asn1/der-private.h vendor-crypto/heimdal/dist/lib/asn1/der-protos.h vendor-crypto/heimdal/dist/lib/asn1/der.h vendor-crypto/heimdal/dist/lib/asn1/der_cmp.c vendor-crypto/heimdal/dist/lib/asn1/der_copy.c vendor-crypto/heimdal/dist/lib/asn1/der_format.c vendor-crypto/heimdal/dist/lib/asn1/der_free.c vendor-crypto/heimdal/dist/lib/asn1/der_get.c vendor-crypto/heimdal/dist/lib/asn1/der_length.c vendor-crypto/heimdal/dist/lib/asn1/der_put.c vendor-crypto/heimdal/dist/lib/asn1/digest.asn1 vendor-crypto/heimdal/dist/lib/asn1/gen.c vendor-crypto/heimdal/dist/lib/asn1/gen_decode.c vendor-crypto/heimdal/dist/lib/asn1/gen_encode.c vendor-crypto/heimdal/dist/lib/asn1/gen_glue.c vendor-crypto/heimdal/dist/lib/asn1/gen_length.c vendor-crypto/heimdal/dist/lib/asn1/gen_locl.h vendor-crypto/heimdal/dist/lib/asn1/gen_template.c vendor-crypto/heimdal/dist/lib/asn1/krb5.asn1 vendor-crypto/heimdal/dist/lib/asn1/lex.c vendor-crypto/heimdal/dist/lib/asn1/lex.l vendor-crypto/heimdal/dist/lib/asn1/libasn1-exports.def vendor-crypto/heimdal/dist/lib/asn1/main.c vendor-crypto/heimdal/dist/lib/asn1/pkinit.asn1 vendor-crypto/heimdal/dist/lib/asn1/rfc2459.asn1 vendor-crypto/heimdal/dist/lib/asn1/symbol.c vendor-crypto/heimdal/dist/lib/asn1/symbol.h vendor-crypto/heimdal/dist/lib/asn1/template.c vendor-crypto/heimdal/dist/lib/asn1/test.asn1 vendor-crypto/heimdal/dist/lib/asn1/timegm.c vendor-crypto/heimdal/dist/lib/com_err/Makefile.am vendor-crypto/heimdal/dist/lib/com_err/Makefile.in vendor-crypto/heimdal/dist/lib/com_err/com_err.c vendor-crypto/heimdal/dist/lib/com_err/com_err.h vendor-crypto/heimdal/dist/lib/com_err/com_right.h vendor-crypto/heimdal/dist/lib/com_err/compile_et.c vendor-crypto/heimdal/dist/lib/com_err/error.c vendor-crypto/heimdal/dist/lib/com_err/lex.c vendor-crypto/heimdal/dist/lib/com_err/lex.h vendor-crypto/heimdal/dist/lib/com_err/lex.l vendor-crypto/heimdal/dist/lib/gssapi/Makefile.am vendor-crypto/heimdal/dist/lib/gssapi/Makefile.in vendor-crypto/heimdal/dist/lib/gssapi/NTMakefile vendor-crypto/heimdal/dist/lib/gssapi/gss-commands.in vendor-crypto/heimdal/dist/lib/gssapi/gss_acquire_cred.3 vendor-crypto/heimdal/dist/lib/gssapi/gss_acquire_cred.cat3 vendor-crypto/heimdal/dist/lib/gssapi/gssapi/gssapi.h vendor-crypto/heimdal/dist/lib/gssapi/gssapi/gssapi_krb5.h vendor-crypto/heimdal/dist/lib/gssapi/gssapi_mech.h vendor-crypto/heimdal/dist/lib/gssapi/gsstool.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/8003.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/accept_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/acquire_cred.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/add_cred.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/aeap.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/arcfour.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/authorize_localname.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/canonicalize_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/cfx.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/compare_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/context_time.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/copy_ccache.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/creds.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/decapsulate.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/display_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/duplicate_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/export_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/export_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/external.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/get_mic.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/gsskrb5-private.h vendor-crypto/heimdal/dist/lib/gssapi/krb5/gsskrb5_locl.h vendor-crypto/heimdal/dist/lib/gssapi/krb5/import_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/import_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/init_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/inquire_context.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/inquire_cred.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/inquire_cred_by_mech.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/inquire_cred_by_oid.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/inquire_mechs_for_name.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/inquire_sec_context_by_oid.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/pname_to_uid.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/prf.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/process_context_token.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/set_sec_context_option.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/store_cred.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/test_cfx.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/unwrap.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/verify_mic.c vendor-crypto/heimdal/dist/lib/gssapi/krb5/wrap.c vendor-crypto/heimdal/dist/lib/gssapi/libgssapi-exports.def vendor-crypto/heimdal/dist/lib/gssapi/mech/compat.h vendor-crypto/heimdal/dist/lib/gssapi/mech/doxygen.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_accept_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_acquire_cred.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_acquire_cred_ext.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_acquire_cred_with_password.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_add_cred.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_add_cred_with_password.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_aeap.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_authorize_localname.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_canonicalize_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_compare_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_context_time.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_delete_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_display_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_display_status.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_duplicate_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_export_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_get_mic.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_import_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_indicate_mechs.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_init_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_inquire_context.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_inquire_cred.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_inquire_cred_by_mech.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_inquire_cred_by_oid.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_inquire_mechs_for_name.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_inquire_sec_context_by_oid.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_mech_switch.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_mo.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_oid.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_pname_to_uid.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_process_context_token.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_store_cred.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_unwrap.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_verify_mic.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_wrap.c vendor-crypto/heimdal/dist/lib/gssapi/mech/gss_wrap_size_limit.c vendor-crypto/heimdal/dist/lib/gssapi/mech/mech.5 vendor-crypto/heimdal/dist/lib/gssapi/mech/mech.cat5 vendor-crypto/heimdal/dist/lib/gssapi/ntlm/accept_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/acquire_cred.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/add_cred.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/canonicalize_name.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/compare_name.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/context_time.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/creds.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/crypto.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/display_name.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/duplicate_name.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/export_name.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/external.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/init_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/inquire_context.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/inquire_cred_by_mech.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/inquire_mechs_for_name.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/inquire_sec_context_by_oid.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/kdc.c vendor-crypto/heimdal/dist/lib/gssapi/ntlm/ntlm-private.h vendor-crypto/heimdal/dist/lib/gssapi/ntlm/process_context_token.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/accept_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/compat.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/context_stubs.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/cred_stubs.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/external.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/init_sec_context.c vendor-crypto/heimdal/dist/lib/gssapi/spnego/spnego-private.h vendor-crypto/heimdal/dist/lib/gssapi/test_common.c vendor-crypto/heimdal/dist/lib/gssapi/test_context.c vendor-crypto/heimdal/dist/lib/gssapi/test_cred.c vendor-crypto/heimdal/dist/lib/gssapi/test_ntlm.c vendor-crypto/heimdal/dist/lib/gssapi/version-script.map vendor-crypto/heimdal/dist/lib/hcrypto/Makefile.am vendor-crypto/heimdal/dist/lib/hcrypto/Makefile.in vendor-crypto/heimdal/dist/lib/hcrypto/NTMakefile vendor-crypto/heimdal/dist/lib/hcrypto/aes.c vendor-crypto/heimdal/dist/lib/hcrypto/bn.c vendor-crypto/heimdal/dist/lib/hcrypto/bn.h vendor-crypto/heimdal/dist/lib/hcrypto/camellia-ntt.c vendor-crypto/heimdal/dist/lib/hcrypto/camellia.c vendor-crypto/heimdal/dist/lib/hcrypto/common.c vendor-crypto/heimdal/dist/lib/hcrypto/des.c vendor-crypto/heimdal/dist/lib/hcrypto/destest.c vendor-crypto/heimdal/dist/lib/hcrypto/dh-ltm.c vendor-crypto/heimdal/dist/lib/hcrypto/dh.c vendor-crypto/heimdal/dist/lib/hcrypto/dh.h vendor-crypto/heimdal/dist/lib/hcrypto/dsa.c vendor-crypto/heimdal/dist/lib/hcrypto/dsa.h vendor-crypto/heimdal/dist/lib/hcrypto/ec.h vendor-crypto/heimdal/dist/lib/hcrypto/engine.c vendor-crypto/heimdal/dist/lib/hcrypto/engine.h vendor-crypto/heimdal/dist/lib/hcrypto/evp-cc.c vendor-crypto/heimdal/dist/lib/hcrypto/evp-cc.h vendor-crypto/heimdal/dist/lib/hcrypto/evp-hcrypto.c vendor-crypto/heimdal/dist/lib/hcrypto/evp.c vendor-crypto/heimdal/dist/lib/hcrypto/evp.h vendor-crypto/heimdal/dist/lib/hcrypto/example_evp_cipher.c vendor-crypto/heimdal/dist/lib/hcrypto/hash.h vendor-crypto/heimdal/dist/lib/hcrypto/hmac.c vendor-crypto/heimdal/dist/lib/hcrypto/libhcrypto-exports.def vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_error.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_mp_find_prime.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_mp_mod.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_mp_prime_next_prime.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_mp_rand.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/bn_mp_shrink.c vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/tommath.h vendor-crypto/heimdal/dist/lib/hcrypto/libtommath/tommath_class.h vendor-crypto/heimdal/dist/lib/hcrypto/md2.c vendor-crypto/heimdal/dist/lib/hcrypto/md2.h vendor-crypto/heimdal/dist/lib/hcrypto/md4.c vendor-crypto/heimdal/dist/lib/hcrypto/md4.h vendor-crypto/heimdal/dist/lib/hcrypto/md5.c vendor-crypto/heimdal/dist/lib/hcrypto/md5.h vendor-crypto/heimdal/dist/lib/hcrypto/md5crypt_test.c vendor-crypto/heimdal/dist/lib/hcrypto/mdtest.c vendor-crypto/heimdal/dist/lib/hcrypto/passwd_dlg.c vendor-crypto/heimdal/dist/lib/hcrypto/pkcs12.c vendor-crypto/heimdal/dist/lib/hcrypto/pkcs5.c vendor-crypto/heimdal/dist/lib/hcrypto/rand-fortuna.c vendor-crypto/heimdal/dist/lib/hcrypto/rand-timer.c vendor-crypto/heimdal/dist/lib/hcrypto/rand-unix.c vendor-crypto/heimdal/dist/lib/hcrypto/rand.c vendor-crypto/heimdal/dist/lib/hcrypto/rand.h vendor-crypto/heimdal/dist/lib/hcrypto/randi.h vendor-crypto/heimdal/dist/lib/hcrypto/rc2.c vendor-crypto/heimdal/dist/lib/hcrypto/rc2test.c vendor-crypto/heimdal/dist/lib/hcrypto/rc4.c vendor-crypto/heimdal/dist/lib/hcrypto/rctest.c vendor-crypto/heimdal/dist/lib/hcrypto/rijndael-alg-fst.c vendor-crypto/heimdal/dist/lib/hcrypto/rnd_keys.c vendor-crypto/heimdal/dist/lib/hcrypto/rsa-gmp.c vendor-crypto/heimdal/dist/lib/hcrypto/rsa-ltm.c vendor-crypto/heimdal/dist/lib/hcrypto/rsa.c vendor-crypto/heimdal/dist/lib/hcrypto/rsa.h vendor-crypto/heimdal/dist/lib/hcrypto/sha.c vendor-crypto/heimdal/dist/lib/hcrypto/sha.h vendor-crypto/heimdal/dist/lib/hcrypto/sha256.c vendor-crypto/heimdal/dist/lib/hcrypto/sha512.c vendor-crypto/heimdal/dist/lib/hcrypto/test_bn.c vendor-crypto/heimdal/dist/lib/hcrypto/test_cipher.c vendor-crypto/heimdal/dist/lib/hcrypto/test_crypto.in vendor-crypto/heimdal/dist/lib/hcrypto/test_dh.c vendor-crypto/heimdal/dist/lib/hcrypto/test_engine_dso.c vendor-crypto/heimdal/dist/lib/hcrypto/test_hmac.c vendor-crypto/heimdal/dist/lib/hcrypto/test_pkcs12.c vendor-crypto/heimdal/dist/lib/hcrypto/test_pkcs5.c vendor-crypto/heimdal/dist/lib/hcrypto/test_rand.c vendor-crypto/heimdal/dist/lib/hcrypto/test_rsa.c vendor-crypto/heimdal/dist/lib/hcrypto/ui.c vendor-crypto/heimdal/dist/lib/hcrypto/validate.c vendor-crypto/heimdal/dist/lib/hcrypto/version-script.map vendor-crypto/heimdal/dist/lib/hdb/Makefile.am vendor-crypto/heimdal/dist/lib/hdb/Makefile.in vendor-crypto/heimdal/dist/lib/hdb/NTMakefile vendor-crypto/heimdal/dist/lib/hdb/common.c vendor-crypto/heimdal/dist/lib/hdb/db.c vendor-crypto/heimdal/dist/lib/hdb/db3.c vendor-crypto/heimdal/dist/lib/hdb/dbinfo.c vendor-crypto/heimdal/dist/lib/hdb/ext.c vendor-crypto/heimdal/dist/lib/hdb/hdb-ldap.c vendor-crypto/heimdal/dist/lib/hdb/hdb-mitdb.c vendor-crypto/heimdal/dist/lib/hdb/hdb-private.h vendor-crypto/heimdal/dist/lib/hdb/hdb-protos.h vendor-crypto/heimdal/dist/lib/hdb/hdb-sqlite.c vendor-crypto/heimdal/dist/lib/hdb/hdb.asn1 vendor-crypto/heimdal/dist/lib/hdb/hdb.c vendor-crypto/heimdal/dist/lib/hdb/hdb.h vendor-crypto/heimdal/dist/lib/hdb/hdb.schema vendor-crypto/heimdal/dist/lib/hdb/hdb_err.et vendor-crypto/heimdal/dist/lib/hdb/hdb_locl.h vendor-crypto/heimdal/dist/lib/hdb/keys.c vendor-crypto/heimdal/dist/lib/hdb/keytab.c vendor-crypto/heimdal/dist/lib/hdb/libhdb-exports.def vendor-crypto/heimdal/dist/lib/hdb/mkey.c vendor-crypto/heimdal/dist/lib/hdb/print.c vendor-crypto/heimdal/dist/lib/hdb/test_dbinfo.c vendor-crypto/heimdal/dist/lib/hdb/test_hdbkeys.c vendor-crypto/heimdal/dist/lib/hdb/test_mkey.c vendor-crypto/heimdal/dist/lib/hdb/version-script.map vendor-crypto/heimdal/dist/lib/heimdal/NTMakefile vendor-crypto/heimdal/dist/lib/hx509/Makefile.am vendor-crypto/heimdal/dist/lib/hx509/Makefile.in vendor-crypto/heimdal/dist/lib/hx509/NTMakefile vendor-crypto/heimdal/dist/lib/hx509/ca.c vendor-crypto/heimdal/dist/lib/hx509/cert.c vendor-crypto/heimdal/dist/lib/hx509/cms.c vendor-crypto/heimdal/dist/lib/hx509/crypto.c vendor-crypto/heimdal/dist/lib/hx509/data/openssl.cnf vendor-crypto/heimdal/dist/lib/hx509/doxygen.c vendor-crypto/heimdal/dist/lib/hx509/env.c vendor-crypto/heimdal/dist/lib/hx509/error.c vendor-crypto/heimdal/dist/lib/hx509/file.c vendor-crypto/heimdal/dist/lib/hx509/hx509-private.h vendor-crypto/heimdal/dist/lib/hx509/hx509-protos.h vendor-crypto/heimdal/dist/lib/hx509/hx509.h vendor-crypto/heimdal/dist/lib/hx509/hx509_err.et vendor-crypto/heimdal/dist/lib/hx509/hx_locl.h vendor-crypto/heimdal/dist/lib/hx509/hxtool-commands.in vendor-crypto/heimdal/dist/lib/hx509/hxtool.c vendor-crypto/heimdal/dist/lib/hx509/keyset.c vendor-crypto/heimdal/dist/lib/hx509/ks_dir.c vendor-crypto/heimdal/dist/lib/hx509/ks_file.c vendor-crypto/heimdal/dist/lib/hx509/ks_keychain.c vendor-crypto/heimdal/dist/lib/hx509/ks_null.c vendor-crypto/heimdal/dist/lib/hx509/ks_p11.c vendor-crypto/heimdal/dist/lib/hx509/ks_p12.c vendor-crypto/heimdal/dist/lib/hx509/libhx509-exports.def vendor-crypto/heimdal/dist/lib/hx509/lock.c vendor-crypto/heimdal/dist/lib/hx509/name.c vendor-crypto/heimdal/dist/lib/hx509/print.c vendor-crypto/heimdal/dist/lib/hx509/ref/pkcs11.h vendor-crypto/heimdal/dist/lib/hx509/revoke.c vendor-crypto/heimdal/dist/lib/hx509/sel-gram.c vendor-crypto/heimdal/dist/lib/hx509/sel-gram.h vendor-crypto/heimdal/dist/lib/hx509/sel-gram.y vendor-crypto/heimdal/dist/lib/hx509/sel-lex.c vendor-crypto/heimdal/dist/lib/hx509/sel-lex.l vendor-crypto/heimdal/dist/lib/hx509/sel.h vendor-crypto/heimdal/dist/lib/hx509/softp11.c vendor-crypto/heimdal/dist/lib/hx509/test_ca.in vendor-crypto/heimdal/dist/lib/hx509/test_cert.in vendor-crypto/heimdal/dist/lib/hx509/test_chain.in vendor-crypto/heimdal/dist/lib/hx509/test_cms.in vendor-crypto/heimdal/dist/lib/hx509/test_name.c vendor-crypto/heimdal/dist/lib/hx509/test_soft_pkcs11.c vendor-crypto/heimdal/dist/lib/hx509/version-script.map vendor-crypto/heimdal/dist/lib/ipc/Makefile.am vendor-crypto/heimdal/dist/lib/ipc/Makefile.in vendor-crypto/heimdal/dist/lib/ipc/client.c vendor-crypto/heimdal/dist/lib/ipc/common.c vendor-crypto/heimdal/dist/lib/ipc/heim-ipc.h vendor-crypto/heimdal/dist/lib/ipc/server.c vendor-crypto/heimdal/dist/lib/ipc/tc.c vendor-crypto/heimdal/dist/lib/ipc/ts-http.c vendor-crypto/heimdal/dist/lib/ipc/ts.c vendor-crypto/heimdal/dist/lib/kadm5/Makefile.am vendor-crypto/heimdal/dist/lib/kadm5/Makefile.in vendor-crypto/heimdal/dist/lib/kadm5/NTMakefile vendor-crypto/heimdal/dist/lib/kadm5/acl.c vendor-crypto/heimdal/dist/lib/kadm5/ad.c vendor-crypto/heimdal/dist/lib/kadm5/admin.h vendor-crypto/heimdal/dist/lib/kadm5/chpass_c.c vendor-crypto/heimdal/dist/lib/kadm5/chpass_s.c vendor-crypto/heimdal/dist/lib/kadm5/common_glue.c vendor-crypto/heimdal/dist/lib/kadm5/context_s.c vendor-crypto/heimdal/dist/lib/kadm5/create_c.c vendor-crypto/heimdal/dist/lib/kadm5/create_s.c vendor-crypto/heimdal/dist/lib/kadm5/default_keys.c vendor-crypto/heimdal/dist/lib/kadm5/delete_s.c vendor-crypto/heimdal/dist/lib/kadm5/destroy_c.c vendor-crypto/heimdal/dist/lib/kadm5/destroy_s.c vendor-crypto/heimdal/dist/lib/kadm5/ent_setup.c vendor-crypto/heimdal/dist/lib/kadm5/free.c vendor-crypto/heimdal/dist/lib/kadm5/get_princs_s.c vendor-crypto/heimdal/dist/lib/kadm5/get_s.c vendor-crypto/heimdal/dist/lib/kadm5/init_c.c vendor-crypto/heimdal/dist/lib/kadm5/init_s.c vendor-crypto/heimdal/dist/lib/kadm5/iprop-commands.in vendor-crypto/heimdal/dist/lib/kadm5/iprop-log.8 vendor-crypto/heimdal/dist/lib/kadm5/iprop-log.c vendor-crypto/heimdal/dist/lib/kadm5/iprop-log.cat8 vendor-crypto/heimdal/dist/lib/kadm5/iprop.8 vendor-crypto/heimdal/dist/lib/kadm5/iprop.cat8 vendor-crypto/heimdal/dist/lib/kadm5/iprop.h vendor-crypto/heimdal/dist/lib/kadm5/ipropd_common.c vendor-crypto/heimdal/dist/lib/kadm5/ipropd_master.c vendor-crypto/heimdal/dist/lib/kadm5/ipropd_slave.c vendor-crypto/heimdal/dist/lib/kadm5/kadm5-private.h vendor-crypto/heimdal/dist/lib/kadm5/kadm5-protos.h vendor-crypto/heimdal/dist/lib/kadm5/kadm5_err.et vendor-crypto/heimdal/dist/lib/kadm5/kadm5_locl.h vendor-crypto/heimdal/dist/lib/kadm5/keys.c vendor-crypto/heimdal/dist/lib/kadm5/libkadm5srv-exports.def vendor-crypto/heimdal/dist/lib/kadm5/log.c vendor-crypto/heimdal/dist/lib/kadm5/marshall.c vendor-crypto/heimdal/dist/lib/kadm5/modify_s.c vendor-crypto/heimdal/dist/lib/kadm5/password_quality.c vendor-crypto/heimdal/dist/lib/kadm5/private.h vendor-crypto/heimdal/dist/lib/kadm5/randkey_c.c vendor-crypto/heimdal/dist/lib/kadm5/randkey_s.c vendor-crypto/heimdal/dist/lib/kadm5/rename_s.c vendor-crypto/heimdal/dist/lib/kadm5/send_recv.c vendor-crypto/heimdal/dist/lib/kadm5/set_keys.c vendor-crypto/heimdal/dist/lib/kadm5/test_pw_quality.c vendor-crypto/heimdal/dist/lib/kadm5/version-script.map vendor-crypto/heimdal/dist/lib/kafs/Makefile.am vendor-crypto/heimdal/dist/lib/kafs/Makefile.in vendor-crypto/heimdal/dist/lib/kafs/afskrb5.c vendor-crypto/heimdal/dist/lib/kafs/afssys.c vendor-crypto/heimdal/dist/lib/kafs/common.c vendor-crypto/heimdal/dist/lib/kafs/kafs.h vendor-crypto/heimdal/dist/lib/kafs/kafs_locl.h vendor-crypto/heimdal/dist/lib/kdfs/Makefile.in vendor-crypto/heimdal/dist/lib/kdfs/k5dfspag.c vendor-crypto/heimdal/dist/lib/krb5/Makefile.am vendor-crypto/heimdal/dist/lib/krb5/Makefile.in vendor-crypto/heimdal/dist/lib/krb5/NTMakefile vendor-crypto/heimdal/dist/lib/krb5/acache.c vendor-crypto/heimdal/dist/lib/krb5/acl.c vendor-crypto/heimdal/dist/lib/krb5/addr_families.c vendor-crypto/heimdal/dist/lib/krb5/aes-test.c vendor-crypto/heimdal/dist/lib/krb5/aname_to_localname.c vendor-crypto/heimdal/dist/lib/krb5/asn1_glue.c vendor-crypto/heimdal/dist/lib/krb5/auth_context.c vendor-crypto/heimdal/dist/lib/krb5/build_auth.c vendor-crypto/heimdal/dist/lib/krb5/cache.c vendor-crypto/heimdal/dist/lib/krb5/changepw.c vendor-crypto/heimdal/dist/lib/krb5/config_file.c vendor-crypto/heimdal/dist/lib/krb5/constants.c vendor-crypto/heimdal/dist/lib/krb5/context.c vendor-crypto/heimdal/dist/lib/krb5/copy_host_realm.c vendor-crypto/heimdal/dist/lib/krb5/crc.c vendor-crypto/heimdal/dist/lib/krb5/creds.c vendor-crypto/heimdal/dist/lib/krb5/crypto-algs.c vendor-crypto/heimdal/dist/lib/krb5/crypto-arcfour.c vendor-crypto/heimdal/dist/lib/krb5/crypto-des-common.c vendor-crypto/heimdal/dist/lib/krb5/crypto-des.c vendor-crypto/heimdal/dist/lib/krb5/crypto-des3.c vendor-crypto/heimdal/dist/lib/krb5/crypto-evp.c vendor-crypto/heimdal/dist/lib/krb5/crypto-null.c vendor-crypto/heimdal/dist/lib/krb5/crypto-pk.c vendor-crypto/heimdal/dist/lib/krb5/crypto-rand.c vendor-crypto/heimdal/dist/lib/krb5/crypto-stubs.c vendor-crypto/heimdal/dist/lib/krb5/crypto.c vendor-crypto/heimdal/dist/lib/krb5/crypto.h vendor-crypto/heimdal/dist/lib/krb5/data.c vendor-crypto/heimdal/dist/lib/krb5/deprecated.c vendor-crypto/heimdal/dist/lib/krb5/derived-key-test.c vendor-crypto/heimdal/dist/lib/krb5/digest.c vendor-crypto/heimdal/dist/lib/krb5/doxygen.c vendor-crypto/heimdal/dist/lib/krb5/error_string.c vendor-crypto/heimdal/dist/lib/krb5/expand_hostname.c vendor-crypto/heimdal/dist/lib/krb5/expand_path.c vendor-crypto/heimdal/dist/lib/krb5/fcache.c vendor-crypto/heimdal/dist/lib/krb5/generate_subkey.c vendor-crypto/heimdal/dist/lib/krb5/get_addrs.c vendor-crypto/heimdal/dist/lib/krb5/get_cred.c vendor-crypto/heimdal/dist/lib/krb5/get_default_principal.c vendor-crypto/heimdal/dist/lib/krb5/get_default_realm.c vendor-crypto/heimdal/dist/lib/krb5/get_for_creds.c vendor-crypto/heimdal/dist/lib/krb5/get_host_realm.c vendor-crypto/heimdal/dist/lib/krb5/get_in_tkt.c vendor-crypto/heimdal/dist/lib/krb5/heim_err.et vendor-crypto/heimdal/dist/lib/krb5/init_creds.c vendor-crypto/heimdal/dist/lib/krb5/init_creds_pw.c vendor-crypto/heimdal/dist/lib/krb5/kcm.c vendor-crypto/heimdal/dist/lib/krb5/kerberos.8 vendor-crypto/heimdal/dist/lib/krb5/kerberos.cat8 vendor-crypto/heimdal/dist/lib/krb5/keyblock.c vendor-crypto/heimdal/dist/lib/krb5/keytab.c vendor-crypto/heimdal/dist/lib/krb5/keytab_any.c vendor-crypto/heimdal/dist/lib/krb5/keytab_file.c vendor-crypto/heimdal/dist/lib/krb5/keytab_keyfile.c vendor-crypto/heimdal/dist/lib/krb5/keytab_memory.c vendor-crypto/heimdal/dist/lib/krb5/krb5-private.h vendor-crypto/heimdal/dist/lib/krb5/krb5-protos.h vendor-crypto/heimdal/dist/lib/krb5/krb5.conf.5 vendor-crypto/heimdal/dist/lib/krb5/krb5.conf.cat5 vendor-crypto/heimdal/dist/lib/krb5/krb5.h vendor-crypto/heimdal/dist/lib/krb5/krb5_auth_context.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_auth_context.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_c_make_checksum.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_c_make_checksum.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_digest.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_digest.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_err.et vendor-crypto/heimdal/dist/lib/krb5/krb5_get_creds.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_get_creds.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_get_init_creds.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_get_init_creds.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_locl.h vendor-crypto/heimdal/dist/lib/krb5/krb5_parse_name.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_parse_name.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_principal.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_principal.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_set_default_realm.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_set_default_realm.cat3 vendor-crypto/heimdal/dist/lib/krb5/krb5_timeofday.3 vendor-crypto/heimdal/dist/lib/krb5/krb5_timeofday.cat3 vendor-crypto/heimdal/dist/lib/krb5/krbhst.c vendor-crypto/heimdal/dist/lib/krb5/kuserok.c vendor-crypto/heimdal/dist/lib/krb5/locate_plugin.h vendor-crypto/heimdal/dist/lib/krb5/log.c vendor-crypto/heimdal/dist/lib/krb5/mcache.c vendor-crypto/heimdal/dist/lib/krb5/misc.c vendor-crypto/heimdal/dist/lib/krb5/mit_glue.c vendor-crypto/heimdal/dist/lib/krb5/mk_error.c vendor-crypto/heimdal/dist/lib/krb5/mk_priv.c vendor-crypto/heimdal/dist/lib/krb5/mk_rep.c vendor-crypto/heimdal/dist/lib/krb5/mk_req_ext.c vendor-crypto/heimdal/dist/lib/krb5/n-fold-test.c vendor-crypto/heimdal/dist/lib/krb5/n-fold.c vendor-crypto/heimdal/dist/lib/krb5/net_read.c vendor-crypto/heimdal/dist/lib/krb5/pac.c vendor-crypto/heimdal/dist/lib/krb5/padata.c vendor-crypto/heimdal/dist/lib/krb5/pcache.c vendor-crypto/heimdal/dist/lib/krb5/pkinit.c vendor-crypto/heimdal/dist/lib/krb5/plugin.c vendor-crypto/heimdal/dist/lib/krb5/principal.c vendor-crypto/heimdal/dist/lib/krb5/rd_cred.c vendor-crypto/heimdal/dist/lib/krb5/rd_priv.c vendor-crypto/heimdal/dist/lib/krb5/rd_rep.c vendor-crypto/heimdal/dist/lib/krb5/rd_req.c vendor-crypto/heimdal/dist/lib/krb5/rd_safe.c vendor-crypto/heimdal/dist/lib/krb5/recvauth.c vendor-crypto/heimdal/dist/lib/krb5/replay.c vendor-crypto/heimdal/dist/lib/krb5/salt-arcfour.c vendor-crypto/heimdal/dist/lib/krb5/salt-des.c vendor-crypto/heimdal/dist/lib/krb5/salt-des3.c vendor-crypto/heimdal/dist/lib/krb5/salt.c vendor-crypto/heimdal/dist/lib/krb5/scache.c vendor-crypto/heimdal/dist/lib/krb5/send_to_kdc.c vendor-crypto/heimdal/dist/lib/krb5/send_to_kdc_plugin.h vendor-crypto/heimdal/dist/lib/krb5/sendauth.c vendor-crypto/heimdal/dist/lib/krb5/set_default_realm.c vendor-crypto/heimdal/dist/lib/krb5/store-int.c vendor-crypto/heimdal/dist/lib/krb5/store-int.h vendor-crypto/heimdal/dist/lib/krb5/store.c vendor-crypto/heimdal/dist/lib/krb5/store_emem.c vendor-crypto/heimdal/dist/lib/krb5/store_fd.c vendor-crypto/heimdal/dist/lib/krb5/store_mem.c vendor-crypto/heimdal/dist/lib/krb5/string-to-key-test.c vendor-crypto/heimdal/dist/lib/krb5/test_alname.c vendor-crypto/heimdal/dist/lib/krb5/test_cc.c vendor-crypto/heimdal/dist/lib/krb5/test_crypto.c vendor-crypto/heimdal/dist/lib/krb5/test_crypto_wrapping.c vendor-crypto/heimdal/dist/lib/krb5/test_fx.c vendor-crypto/heimdal/dist/lib/krb5/test_kuserok.c vendor-crypto/heimdal/dist/lib/krb5/test_pknistkdf.c vendor-crypto/heimdal/dist/lib/krb5/test_plugin.c vendor-crypto/heimdal/dist/lib/krb5/test_rfc3961.c vendor-crypto/heimdal/dist/lib/krb5/test_store.c vendor-crypto/heimdal/dist/lib/krb5/test_time.c vendor-crypto/heimdal/dist/lib/krb5/ticket.c vendor-crypto/heimdal/dist/lib/krb5/transited.c vendor-crypto/heimdal/dist/lib/krb5/verify_init.c vendor-crypto/heimdal/dist/lib/krb5/verify_krb5_conf.c vendor-crypto/heimdal/dist/lib/krb5/verify_user.c vendor-crypto/heimdal/dist/lib/krb5/version-script.map vendor-crypto/heimdal/dist/lib/krb5/warn.c vendor-crypto/heimdal/dist/lib/libedit/Makefile.in vendor-crypto/heimdal/dist/lib/libedit/acinclude.m4 vendor-crypto/heimdal/dist/lib/libedit/aclocal.m4 vendor-crypto/heimdal/dist/lib/libedit/config.guess vendor-crypto/heimdal/dist/lib/libedit/config.h.in vendor-crypto/heimdal/dist/lib/libedit/config.sub vendor-crypto/heimdal/dist/lib/libedit/configure vendor-crypto/heimdal/dist/lib/libedit/configure.ac vendor-crypto/heimdal/dist/lib/libedit/depcomp vendor-crypto/heimdal/dist/lib/libedit/install-sh vendor-crypto/heimdal/dist/lib/libedit/ltmain.sh vendor-crypto/heimdal/dist/lib/libedit/missing vendor-crypto/heimdal/dist/lib/libedit/src/Makefile.am vendor-crypto/heimdal/dist/lib/libedit/src/Makefile.in vendor-crypto/heimdal/dist/lib/libedit/src/chared.c vendor-crypto/heimdal/dist/lib/libedit/src/chared.h vendor-crypto/heimdal/dist/lib/libedit/src/chartype.c vendor-crypto/heimdal/dist/lib/libedit/src/chartype.h vendor-crypto/heimdal/dist/lib/libedit/src/common.c vendor-crypto/heimdal/dist/lib/libedit/src/el.c vendor-crypto/heimdal/dist/lib/libedit/src/el.h vendor-crypto/heimdal/dist/lib/libedit/src/eln.c vendor-crypto/heimdal/dist/lib/libedit/src/emacs.c vendor-crypto/heimdal/dist/lib/libedit/src/filecomplete.c vendor-crypto/heimdal/dist/lib/libedit/src/filecomplete.h vendor-crypto/heimdal/dist/lib/libedit/src/hist.c vendor-crypto/heimdal/dist/lib/libedit/src/hist.h vendor-crypto/heimdal/dist/lib/libedit/src/histedit.h vendor-crypto/heimdal/dist/lib/libedit/src/history.c vendor-crypto/heimdal/dist/lib/libedit/src/makelist vendor-crypto/heimdal/dist/lib/libedit/src/map.c vendor-crypto/heimdal/dist/lib/libedit/src/map.h vendor-crypto/heimdal/dist/lib/libedit/src/parse.c vendor-crypto/heimdal/dist/lib/libedit/src/parse.h vendor-crypto/heimdal/dist/lib/libedit/src/prompt.c vendor-crypto/heimdal/dist/lib/libedit/src/prompt.h vendor-crypto/heimdal/dist/lib/libedit/src/read.c vendor-crypto/heimdal/dist/lib/libedit/src/read.h vendor-crypto/heimdal/dist/lib/libedit/src/readline.c vendor-crypto/heimdal/dist/lib/libedit/src/refresh.c vendor-crypto/heimdal/dist/lib/libedit/src/refresh.h vendor-crypto/heimdal/dist/lib/libedit/src/search.c vendor-crypto/heimdal/dist/lib/libedit/src/search.h vendor-crypto/heimdal/dist/lib/libedit/src/shlib_version vendor-crypto/heimdal/dist/lib/libedit/src/sig.c vendor-crypto/heimdal/dist/lib/libedit/src/sig.h vendor-crypto/heimdal/dist/lib/libedit/src/sys.h vendor-crypto/heimdal/dist/lib/libedit/src/tokenizer.c vendor-crypto/heimdal/dist/lib/libedit/src/tty.c vendor-crypto/heimdal/dist/lib/libedit/src/tty.h vendor-crypto/heimdal/dist/lib/libedit/src/unvis.c vendor-crypto/heimdal/dist/lib/libedit/src/vi.c vendor-crypto/heimdal/dist/lib/libedit/src/vis.c vendor-crypto/heimdal/dist/lib/libedit/src/vis.h vendor-crypto/heimdal/dist/lib/ntlm/Makefile.am vendor-crypto/heimdal/dist/lib/ntlm/Makefile.in vendor-crypto/heimdal/dist/lib/ntlm/NTMakefile vendor-crypto/heimdal/dist/lib/ntlm/heimntlm-protos.h vendor-crypto/heimdal/dist/lib/ntlm/heimntlm.h vendor-crypto/heimdal/dist/lib/ntlm/ntlm.c vendor-crypto/heimdal/dist/lib/ntlm/ntlm_err.et vendor-crypto/heimdal/dist/lib/ntlm/test_ntlm.c vendor-crypto/heimdal/dist/lib/otp/Makefile.am vendor-crypto/heimdal/dist/lib/otp/Makefile.in vendor-crypto/heimdal/dist/lib/otp/otptest.c vendor-crypto/heimdal/dist/lib/roken/Makefile.am vendor-crypto/heimdal/dist/lib/roken/Makefile.in vendor-crypto/heimdal/dist/lib/roken/NTMakefile vendor-crypto/heimdal/dist/lib/roken/base64-test.c vendor-crypto/heimdal/dist/lib/roken/base64.c vendor-crypto/heimdal/dist/lib/roken/base64.h vendor-crypto/heimdal/dist/lib/roken/bswap.c vendor-crypto/heimdal/dist/lib/roken/cloexec.c vendor-crypto/heimdal/dist/lib/roken/ct.c vendor-crypto/heimdal/dist/lib/roken/daemon.c vendor-crypto/heimdal/dist/lib/roken/dumpdata.c vendor-crypto/heimdal/dist/lib/roken/err.hin vendor-crypto/heimdal/dist/lib/roken/getarg.3 vendor-crypto/heimdal/dist/lib/roken/getarg.c vendor-crypto/heimdal/dist/lib/roken/getarg.cat3 vendor-crypto/heimdal/dist/lib/roken/getcap.c vendor-crypto/heimdal/dist/lib/roken/glob.c vendor-crypto/heimdal/dist/lib/roken/hex-test.c vendor-crypto/heimdal/dist/lib/roken/issuid.c vendor-crypto/heimdal/dist/lib/roken/ndbm_wrap.c vendor-crypto/heimdal/dist/lib/roken/parse_bytes-test.c vendor-crypto/heimdal/dist/lib/roken/parse_time-test.c vendor-crypto/heimdal/dist/lib/roken/parse_time.3 vendor-crypto/heimdal/dist/lib/roken/parse_time.cat3 vendor-crypto/heimdal/dist/lib/roken/rand.c vendor-crypto/heimdal/dist/lib/roken/realloc.c vendor-crypto/heimdal/dist/lib/roken/resolve-test.c vendor-crypto/heimdal/dist/lib/roken/resolve.c vendor-crypto/heimdal/dist/lib/roken/rkpty.c vendor-crypto/heimdal/dist/lib/roken/roken-common.h vendor-crypto/heimdal/dist/lib/roken/roken.awk vendor-crypto/heimdal/dist/lib/roken/roken.h.in vendor-crypto/heimdal/dist/lib/roken/roken_gethostby.c vendor-crypto/heimdal/dist/lib/roken/rtbl.c vendor-crypto/heimdal/dist/lib/roken/rtbl.h vendor-crypto/heimdal/dist/lib/roken/simple_exec.c vendor-crypto/heimdal/dist/lib/roken/snprintf-test.c vendor-crypto/heimdal/dist/lib/roken/snprintf.c vendor-crypto/heimdal/dist/lib/roken/socket.c vendor-crypto/heimdal/dist/lib/roken/test-mem.c vendor-crypto/heimdal/dist/lib/roken/tsearch.c vendor-crypto/heimdal/dist/lib/roken/version-script.map vendor-crypto/heimdal/dist/lib/roken/write_pid.c vendor-crypto/heimdal/dist/lib/sl/Makefile.am vendor-crypto/heimdal/dist/lib/sl/Makefile.in vendor-crypto/heimdal/dist/lib/sl/NTMakefile vendor-crypto/heimdal/dist/lib/sl/sl.c vendor-crypto/heimdal/dist/lib/sl/sl.h vendor-crypto/heimdal/dist/lib/sl/slc-gram.c vendor-crypto/heimdal/dist/lib/sl/slc-gram.y vendor-crypto/heimdal/dist/lib/sl/slc-lex.c vendor-crypto/heimdal/dist/lib/sqlite/Makefile.am vendor-crypto/heimdal/dist/lib/sqlite/Makefile.in vendor-crypto/heimdal/dist/lib/sqlite/sqlite3.c vendor-crypto/heimdal/dist/lib/sqlite/sqlite3.h vendor-crypto/heimdal/dist/lib/sqlite/sqlite3ext.h vendor-crypto/heimdal/dist/lib/vers/Makefile.am vendor-crypto/heimdal/dist/lib/vers/Makefile.in vendor-crypto/heimdal/dist/lib/vers/print_version.c vendor-crypto/heimdal/dist/lib/wind/Makefile.in vendor-crypto/heimdal/dist/lib/wind/NTMakefile vendor-crypto/heimdal/dist/lib/wind/bidi.c vendor-crypto/heimdal/dist/lib/wind/bidi_table.c vendor-crypto/heimdal/dist/lib/wind/bidi_table.h vendor-crypto/heimdal/dist/lib/wind/combining.c vendor-crypto/heimdal/dist/lib/wind/combining_table.c vendor-crypto/heimdal/dist/lib/wind/combining_table.h vendor-crypto/heimdal/dist/lib/wind/errorlist.c vendor-crypto/heimdal/dist/lib/wind/errorlist_table.c vendor-crypto/heimdal/dist/lib/wind/errorlist_table.h vendor-crypto/heimdal/dist/lib/wind/gen-bidi.py vendor-crypto/heimdal/dist/lib/wind/gen-combining.py vendor-crypto/heimdal/dist/lib/wind/gen-errorlist.py vendor-crypto/heimdal/dist/lib/wind/gen-normalize.py vendor-crypto/heimdal/dist/lib/wind/libwind-exports.def vendor-crypto/heimdal/dist/lib/wind/map.c vendor-crypto/heimdal/dist/lib/wind/map_table.c vendor-crypto/heimdal/dist/lib/wind/map_table.h vendor-crypto/heimdal/dist/lib/wind/normalize.c vendor-crypto/heimdal/dist/lib/wind/normalize_table.c vendor-crypto/heimdal/dist/lib/wind/normalize_table.h vendor-crypto/heimdal/dist/lib/wind/punycode_examples.c vendor-crypto/heimdal/dist/lib/wind/punycode_examples.h vendor-crypto/heimdal/dist/lib/wind/test-normalize.c vendor-crypto/heimdal/dist/lib/wind/test-utf8.c vendor-crypto/heimdal/dist/ltmain.sh vendor-crypto/heimdal/dist/missing vendor-crypto/heimdal/dist/packages/Makefile.am vendor-crypto/heimdal/dist/packages/Makefile.in vendor-crypto/heimdal/dist/packages/mac/Makefile.in vendor-crypto/heimdal/dist/packages/mac/mac.sh vendor-crypto/heimdal/dist/packages/windows/assembly/Heimdal.Kerberos.manifest.in vendor-crypto/heimdal/dist/packages/windows/assembly/NTMakefile vendor-crypto/heimdal/dist/packages/windows/installer/NTMakefile vendor-crypto/heimdal/dist/packages/windows/installer/heimdal-assemblies.wxs vendor-crypto/heimdal/dist/packages/windows/installer/heimdal-installer.wxs vendor-crypto/heimdal/dist/packages/windows/installer/heimdal-policy.wxs vendor-crypto/heimdal/dist/packages/windows/sdk/NTMakefile vendor-crypto/heimdal/dist/po/Makefile.in vendor-crypto/heimdal/dist/po/heimdal_krb5/heimdal_krb5.pot vendor-crypto/heimdal/dist/po/heimdal_krb5/sv_SE.po vendor-crypto/heimdal/dist/tests/Makefile.am vendor-crypto/heimdal/dist/tests/Makefile.in vendor-crypto/heimdal/dist/tests/bin/Makefile.am vendor-crypto/heimdal/dist/tests/bin/Makefile.in vendor-crypto/heimdal/dist/tests/bin/setup-env.in vendor-crypto/heimdal/dist/tests/can/Makefile.in vendor-crypto/heimdal/dist/tests/can/check-can.in vendor-crypto/heimdal/dist/tests/can/krb5.conf.in vendor-crypto/heimdal/dist/tests/can/mit-pkinit-20070607.xf vendor-crypto/heimdal/dist/tests/can/test_can.in vendor-crypto/heimdal/dist/tests/db/Makefile.am vendor-crypto/heimdal/dist/tests/db/Makefile.in vendor-crypto/heimdal/dist/tests/db/add-modify-delete.in vendor-crypto/heimdal/dist/tests/db/check-aliases.in vendor-crypto/heimdal/dist/tests/db/check-dbinfo.in vendor-crypto/heimdal/dist/tests/db/have-db.in vendor-crypto/heimdal/dist/tests/db/krb5-mit.conf.in vendor-crypto/heimdal/dist/tests/db/krb5.conf.in vendor-crypto/heimdal/dist/tests/db/loaddump-db.in vendor-crypto/heimdal/dist/tests/gss/Makefile.am vendor-crypto/heimdal/dist/tests/gss/Makefile.in vendor-crypto/heimdal/dist/tests/gss/check-basic.in vendor-crypto/heimdal/dist/tests/gss/check-context.in vendor-crypto/heimdal/dist/tests/gss/check-gssmask.in vendor-crypto/heimdal/dist/tests/gss/check-ntlm.in vendor-crypto/heimdal/dist/tests/gss/check-spnego.in vendor-crypto/heimdal/dist/tests/gss/krb5.conf.in vendor-crypto/heimdal/dist/tests/java/Makefile.am vendor-crypto/heimdal/dist/tests/java/Makefile.in vendor-crypto/heimdal/dist/tests/java/check-kinit.in vendor-crypto/heimdal/dist/tests/java/jaas.conf vendor-crypto/heimdal/dist/tests/java/krb5.conf.in vendor-crypto/heimdal/dist/tests/kdc/Makefile.am vendor-crypto/heimdal/dist/tests/kdc/Makefile.in vendor-crypto/heimdal/dist/tests/kdc/check-cc.in vendor-crypto/heimdal/dist/tests/kdc/check-delegation.in vendor-crypto/heimdal/dist/tests/kdc/check-des.in vendor-crypto/heimdal/dist/tests/kdc/check-digest.in vendor-crypto/heimdal/dist/tests/kdc/check-iprop.in vendor-crypto/heimdal/dist/tests/kdc/check-kadmin.in vendor-crypto/heimdal/dist/tests/kdc/check-kdc.in vendor-crypto/heimdal/dist/tests/kdc/check-keys.in vendor-crypto/heimdal/dist/tests/kdc/check-kpasswdd.in vendor-crypto/heimdal/dist/tests/kdc/check-pkinit.in vendor-crypto/heimdal/dist/tests/kdc/check-referral.in vendor-crypto/heimdal/dist/tests/kdc/check-uu.in vendor-crypto/heimdal/dist/tests/kdc/heimdal.acl vendor-crypto/heimdal/dist/tests/kdc/krb5-pkinit.conf.in vendor-crypto/heimdal/dist/tests/kdc/krb5.conf.in vendor-crypto/heimdal/dist/tests/kdc/krb5.conf.keys.in vendor-crypto/heimdal/dist/tests/kdc/leaks-kill.sh vendor-crypto/heimdal/dist/tests/kdc/wait-kdc.sh vendor-crypto/heimdal/dist/tests/ldap/Makefile.am vendor-crypto/heimdal/dist/tests/ldap/Makefile.in vendor-crypto/heimdal/dist/tests/ldap/check-ldap.in vendor-crypto/heimdal/dist/tests/ldap/krb5.conf.in vendor-crypto/heimdal/dist/tests/ldap/slapd-init.in vendor-crypto/heimdal/dist/tests/ldap/slapd.conf vendor-crypto/heimdal/dist/tests/plugin/Makefile.am vendor-crypto/heimdal/dist/tests/plugin/Makefile.in vendor-crypto/heimdal/dist/tests/plugin/check-pac.in vendor-crypto/heimdal/dist/tests/plugin/krb5.conf.in vendor-crypto/heimdal/dist/tests/plugin/windc.c vendor-crypto/heimdal/dist/tools/Makefile.am vendor-crypto/heimdal/dist/tools/Makefile.in vendor-crypto/heimdal/dist/tools/heimdal-gssapi.pc.in vendor-crypto/heimdal/dist/tools/krb5-config.1 vendor-crypto/heimdal/dist/tools/krb5-config.cat1 vendor-crypto/heimdal/dist/tools/krb5-config.in vendor-crypto/heimdal/dist/windows/NTMakefile.config vendor-crypto/heimdal/dist/windows/NTMakefile.version vendor-crypto/heimdal/dist/windows/NTMakefile.w32 vendor-crypto/heimdal/dist/windows/version.rc vendor-crypto/heimdal/dist/ylwrap Modified: vendor-crypto/heimdal/dist/LICENSE ============================================================================== --- vendor-crypto/heimdal/dist/LICENSE Wed Apr 4 04:20:39 2018 (r331977) +++ vendor-crypto/heimdal/dist/LICENSE Wed Apr 4 04:21:19 2018 (r331978) @@ -1,4 +1,4 @@ -Copyright (c) 1995 - 2011 Kungliga Tekniska Högskolan +Copyright (c) 1995 - 2014 Kungliga Tekniska Högskolan (Royal Institute of Technology, Stockholm, Sweden). All rights reserved. Modified: vendor-crypto/heimdal/dist/Makefile.am ============================================================================== --- vendor-crypto/heimdal/dist/Makefile.am Wed Apr 4 04:20:39 2018 (r331977) +++ vendor-crypto/heimdal/dist/Makefile.am Wed Apr 4 04:21:19 2018 (r331978) @@ -6,7 +6,7 @@ if KCM kcm_dir = kcm endif -SUBDIRS= include base lib kuser kdc admin kadmin kpasswd +SUBDIRS= include lib kuser kdc admin kadmin kpasswd SUBDIRS+= $(kcm_dir) appl tools tests packages etc po if HEIMDAL_DOCUMENTATION @@ -38,6 +38,7 @@ EXTRA_DIST = \ autogen.sh \ krb5.conf \ cf/make-proto.pl \ + cf/roken-h-process.pl \ cf/install-catman.sh \ cf/ChangeLog \ cf/c-function.m4 \ @@ -52,6 +53,13 @@ EXTRA_DIST = \ cf/krb-version.m4 \ cf/roken.m4 \ cf/valgrind-suppressions \ + cf/maybe-valgrind.sh \ + cf/symbol-version.py \ + cf/w32-check-exported-symbols.pl \ + cf/w32-def-from-dll.pl \ + cf/w32-detect-vc-version.pl \ + cf/w32-hh-toc-from-info.pl \ + cf/w32-list-externs-from-objs.pl \ cf/vararray.m4 print-distdir: Modified: vendor-crypto/heimdal/dist/Makefile.in ============================================================================== --- vendor-crypto/heimdal/dist/Makefile.in Wed Apr 4 04:20:39 2018 (r331977) +++ vendor-crypto/heimdal/dist/Makefile.in Wed Apr 4 04:21:19 2018 (r331978) @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,6 +20,61 @@ # $Id$ VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -39,11 +93,6 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.common \ - $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure \ - ChangeLog NEWS TODO compile config.guess config.sub depcomp \ - install-sh ltmain.sh missing ylwrap @HEIMDAL_DOCUMENTATION_TRUE@am__append_1 = doc subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -60,8 +109,7 @@ am__aclocal_m4_deps = $(top_srcdir)/cf/aix.m4 \ $(top_srcdir)/cf/check-man.m4 \ $(top_srcdir)/cf/check-netinet-ip-and-tcp.m4 \ $(top_srcdir)/cf/check-type-extra.m4 \ - $(top_srcdir)/cf/check-var.m4 $(top_srcdir)/cf/check-x.m4 \ - $(top_srcdir)/cf/check-xau.m4 $(top_srcdir)/cf/crypto.m4 \ + $(top_srcdir)/cf/check-var.m4 $(top_srcdir)/cf/crypto.m4 \ $(top_srcdir)/cf/db.m4 $(top_srcdir)/cf/destdirs.m4 \ $(top_srcdir)/cf/dispatch.m4 $(top_srcdir)/cf/dlopen.m4 \ $(top_srcdir)/cf/find-func-no-libs.m4 \ @@ -74,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/cf/aix.m4 \ $(top_srcdir)/cf/krb-bigendian.m4 \ $(top_srcdir)/cf/krb-func-getlogin.m4 \ $(top_srcdir)/cf/krb-ipv6.m4 $(top_srcdir)/cf/krb-prog-ln-s.m4 \ + $(top_srcdir)/cf/krb-prog-perl.m4 \ $(top_srcdir)/cf/krb-readline.m4 \ $(top_srcdir)/cf/krb-struct-spwd.m4 \ $(top_srcdir)/cf/krb-struct-winsize.m4 \ @@ -93,37 +142,85 @@ am__aclocal_m4_deps = $(top_srcdir)/cf/aix.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = include base lib kuser kdc admin kadmin kpasswd kcm \ - appl tools tests packages etc po doc +CSCOPE = cscope +DIST_SUBDIRS = include lib kuser kdc admin kadmin kpasswd kcm appl \ + tools tests packages etc po doc +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.common \ + $(top_srcdir)/cf/Makefile.am.common ChangeLog NEWS README TODO \ + compile config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -151,12 +248,17 @@ am__relativize = \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +AS = @AS@ ASN1_COMPILE = @ASN1_COMPILE@ ASN1_COMPILE_DEP = @ASN1_COMPILE_DEP@ AUTOCONF = @AUTOCONF@ @@ -175,12 +277,12 @@ COMPILE_ET = @COMPILE_ET@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ +DB1LIB = @DB1LIB@ +DB3LIB = @DB3LIB@ DBHEADER = @DBHEADER@ -DBLIB = @DBLIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIR_com_err = @DIR_com_err@ -DIR_hcrypto = @DIR_hcrypto@ DIR_hdbdir = @DIR_hdbdir@ DIR_roken = @DIR_roken@ DLLTOOL = @DLLTOOL@ @@ -190,17 +292,17 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_AFS_STRING_TO_KEY = @ENABLE_AFS_STRING_TO_KEY@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +GCD_MIG = @GCD_MIG@ GREP = @GREP@ GROFF = @GROFF@ INCLUDES_roken = @INCLUDES_roken@ -INCLUDE_hcrypto = @INCLUDE_hcrypto@ -INCLUDE_hesiod = @INCLUDE_hesiod@ -INCLUDE_krb4 = @INCLUDE_krb4@ INCLUDE_libedit = @INCLUDE_libedit@ INCLUDE_libintl = @INCLUDE_libintl@ INCLUDE_openldap = @INCLUDE_openldap@ +INCLUDE_openssl_crypto = @INCLUDE_openssl_crypto@ INCLUDE_readline = @INCLUDE_readline@ INCLUDE_sqlite3 = @INCLUDE_sqlite3@ INSTALL = @INSTALL@ @@ -219,12 +321,9 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_AUTH_SUBDIRS = @LIB_AUTH_SUBDIRS@ -LIB_NDBM = @LIB_NDBM@ -LIB_XauFileName = @LIB_XauFileName@ -LIB_XauReadAuth = @LIB_XauReadAuth@ -LIB_XauWriteAuth = @LIB_XauWriteAuth@ LIB_bswap16 = @LIB_bswap16@ LIB_bswap32 = @LIB_bswap32@ +LIB_bswap64 = @LIB_bswap64@ LIB_com_err = @LIB_com_err@ LIB_com_err_a = @LIB_com_err_a@ LIB_com_err_so = @LIB_com_err_so@ @@ -233,6 +332,7 @@ LIB_db_create = @LIB_db_create@ LIB_dbm_firstkey = @LIB_dbm_firstkey@ LIB_dbopen = @LIB_dbopen@ LIB_dispatch_async_f = @LIB_dispatch_async_f@ +LIB_dladdr = @LIB_dladdr@ LIB_dlopen = @LIB_dlopen@ LIB_dn_expand = @LIB_dn_expand@ LIB_dns_search = @LIB_dns_search@ @@ -249,10 +349,8 @@ LIB_hcrypto = @LIB_hcrypto@ LIB_hcrypto_a = @LIB_hcrypto_a@ LIB_hcrypto_appl = @LIB_hcrypto_appl@ LIB_hcrypto_so = @LIB_hcrypto_so@ -LIB_hesiod = @LIB_hesiod@ LIB_hstrerror = @LIB_hstrerror@ LIB_kdb = @LIB_kdb@ -LIB_krb4 = @LIB_krb4@ LIB_libedit = @LIB_libedit@ LIB_libintl = @LIB_libintl@ LIB_loadquery = @LIB_loadquery@ @@ -260,6 +358,7 @@ LIB_logout = @LIB_logout@ LIB_logwtmp = @LIB_logwtmp@ LIB_openldap = @LIB_openldap@ LIB_openpty = @LIB_openpty@ +LIB_openssl_crypto = @LIB_openssl_crypto@ LIB_otp = @LIB_otp@ LIB_pidfile = @LIB_pidfile@ LIB_readline = @LIB_readline@ @@ -274,12 +373,15 @@ LIB_sqlite3 = @LIB_sqlite3@ LIB_syslog = @LIB_syslog@ LIB_tgetent = @LIB_tgetent@ LIPO = @LIPO@ +LMDBLIB = @LMDBLIB@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +NDBMLIB = @NDBMLIB@ NM = @NM@ NMEDIT = @NMEDIT@ NO_AFS = @NO_AFS@ @@ -296,6 +398,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LDADD = @PTHREAD_LDADD@ @@ -310,13 +413,7 @@ STRIP = @STRIP@ VERSION = @VERSION@ VERSIONING = @VERSIONING@ WFLAGS = @WFLAGS@ -WFLAGS_NOIMPLICITINT = @WFLAGS_NOIMPLICITINT@ -WFLAGS_NOUNUSED = @WFLAGS_NOUNUSED@ -XMKMF = @XMKMF@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ +WFLAGS_LITE = @WFLAGS_LITE@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ @@ -340,6 +437,8 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +db_type = @db_type@ +db_type_preference = @db_type_preference@ docdir = @docdir@ dpagaix_cflags = @dpagaix_cflags@ dpagaix_ldadd = @dpagaix_ldadd@ @@ -375,32 +474,40 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUFFIXES = .et .h .x .z .hx .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 +SUFFIXES = .et .h .pc.in .pc .x .z .hx .1 .3 .5 .7 .8 .cat1 .cat3 \ + .cat5 .cat7 .cat8 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include AM_CPPFLAGS = $(INCLUDES_roken) @do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME AM_CFLAGS = $(WFLAGS) CP = cp buildinclude = $(top_builddir)/include +LIB_XauReadAuth = @LIB_XauReadAuth@ LIB_el_init = @LIB_el_init@ LIB_getattr = @LIB_getattr@ LIB_getpwent_r = @LIB_getpwent_r@ LIB_odm_initialize = @LIB_odm_initialize@ LIB_setpcred = @LIB_setpcred@ -HESIODLIB = @HESIODLIB@ -HESIODINCLUDE = @HESIODINCLUDE@ +INCLUDE_krb4 = @INCLUDE_krb4@ +LIB_krb4 = @LIB_krb4@ libexec_heimdaldir = $(libexecdir)/heimdal NROFF_MAN = groff -mandoc -Tascii -LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) +@NO_AFS_FALSE@LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) +@NO_AFS_TRUE@LIB_kafs = @KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \ @KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la @KRB5_TRUE@LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la -LIB_heimbase = $(top_builddir)/base/libheimbase.la +LIB_heimbase = $(top_builddir)/lib/base/libheimbase.la @DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la + +#silent-rules +heim_verbose = $(heim_verbose_$(V)) +heim_verbose_ = $(heim_verbose_$(AM_DEFAULT_VERBOSITY)) +heim_verbose_0 = @echo " GEN "$@; @KCM_TRUE@kcm_dir = kcm -SUBDIRS = include base lib kuser kdc admin kadmin kpasswd $(kcm_dir) \ - appl tools tests packages etc po $(am__append_1) +SUBDIRS = include lib kuser kdc admin kadmin kpasswd $(kcm_dir) appl \ + tools tests packages etc po $(am__append_1) ACLOCAL_AMFLAGS = -I cf EXTRA_DIST = \ NTMakefile \ @@ -422,6 +529,7 @@ EXTRA_DIST = \ autogen.sh \ krb5.conf \ cf/make-proto.pl \ + cf/roken-h-process.pl \ cf/install-catman.sh \ cf/ChangeLog \ cf/c-function.m4 \ @@ -436,13 +544,20 @@ EXTRA_DIST = \ cf/krb-version.m4 \ cf/roken.m4 \ cf/valgrind-suppressions \ + cf/maybe-valgrind.sh \ + cf/symbol-version.py \ + cf/w32-check-exported-symbols.pl \ + cf/w32-def-from-dll.pl \ + cf/w32-detect-vc-version.pl \ + cf/w32-hh-toc-from-info.pl \ + cf/w32-list-externs-from-objs.pl \ cf/vararray.m4 all: all-recursive .SUFFIXES: -.SUFFIXES: .et .h .x .z .hx .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c -am--refresh: +.SUFFIXES: .et .h .pc.in .pc .x .z .hx .1 .3 .5 .7 .8 .cat1 .cat3 .cat5 .cat7 .cat8 .c +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(am__configure_deps) @for dep in $?; do \ @@ -457,7 +572,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -467,6 +581,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; +$(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -487,22 +602,25 @@ distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -517,57 +635,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -583,12 +656,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEP set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -600,15 +668,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEP $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -617,9 +681,31 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -655,13 +741,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -692,37 +775,43 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -730,31 +819,33 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -777,13 +868,21 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -815,10 +914,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -859,9 +963,8 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: install-exec-local + install-html: install-html-recursive install-html-am: @@ -903,43 +1006,55 @@ ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ - ctags-recursive install-am install-data-am install-exec-am \ - install-strip tags-recursive uninstall-am +.MAKE: $(am__recursive_targets) check-am install-am install-data-am \ + install-strip uninstall-am -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am all-local am--refresh check check-am check-local \ - clean clean-generic clean-libtool ctags ctags-recursive dist \ - dist-all dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar \ - dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-generic distclean-libtool distclean-tags \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ + am--refresh check check-am check-local clean clean-cscope \ + clean-generic clean-libtool cscope cscopelist-am ctags \ + ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ + dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ + install-exec install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-hook + ps ps-am tags tags-am uninstall uninstall-am uninstall-hook +.PRECIOUS: Makefile + install-suid-programs: @foo='$(bin_SUIDS)'; \ for file in $$foo; do \ - x=$(DESTDIR)$(bindir)/$$file; \ - if chown 0:0 $$x && chmod u+s $$x; then :; else \ - echo "*"; \ - echo "* Failed to install $$x setuid root"; \ - echo "*"; \ - fi; done + x=$(DESTDIR)$(bindir)/$$file; \ + if chown 0:0 $$x && chmod u+s $$x; then :; else \ + echo "*"; \ + echo "* Failed to install $$x setuid root"; \ + echo "*"; \ + fi; \ + done -install-exec-hook: install-suid-programs +install-exec-local: install-suid-programs -install-build-headers:: $(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS) - @foo='$(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ)'; \ +codesign-all: + @if [ X"$$CODE_SIGN_IDENTITY" != X ] ; then \ + foo='$(bin_PROGRAMS) $(sbin_PROGRAMS) $(libexec_PROGRAMS)' ; \ + for file in $$foo ; do \ + echo "CODESIGN $$file" ; \ + codesign -f -s "$$CODE_SIGN_IDENTITY" $$file || exit 1 ; \ + done ; \ + fi + +all-local: codesign-all + +install-build-headers:: $(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS) $(noinst_HEADERS) + @foo='$(include_HEADERS) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(noinst_HEADERS)'; \ for f in $$foo; do \ f=`basename $$f`; \ if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \ @@ -947,7 +1062,7 @@ install-build-headers:: $(include_HEADERS) $(dist_incl if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \ : ; else \ echo " $(CP) $$file $(buildinclude)/$$f"; \ - $(CP) $$file $(buildinclude)/$$f; \ + $(CP) $$file $(buildinclude)/$$f || true; \ fi ; \ done ; \ foo='$(nobase_include_HEADERS)'; \ @@ -1004,6 +1119,8 @@ check-local:: $(NROFF_MAN) $< > $@ .5.cat5: $(NROFF_MAN) $< > $@ +.7.cat7: + $(NROFF_MAN) $< > $@ .8.cat8: $(NROFF_MAN) $< > $@ @@ -1046,6 +1163,19 @@ dist-cat5-mans: $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ done +dist-cat7-mans: + @foo='$(man7_MANS)'; \ + bar='$(man_MANS)'; \ + for i in $$bar; do \ + case $$i in \ + *.7) foo="$$foo $$i";; \ + esac; done ;\ + for i in $$foo; do \ + x=`echo $$i | sed 's/\.[^.]*$$/.cat7/'`; \ + echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \ + $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ + done + dist-cat8-mans: @foo='$(man8_MANS)'; \ bar='$(man_MANS)'; \ @@ -1059,13 +1189,13 @@ dist-cat8-mans: $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \ done -dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans +dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat7-mans dist-cat8-mans install-cat-mans: - $(SHELL) $(top_srcdir)/cf/install-catman.sh install "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS) + $(SHELL) $(top_srcdir)/cf/install-catman.sh install "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS) uninstall-cat-mans: - $(SHELL) $(top_srcdir)/cf/install-catman.sh uninstall "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS) + $(SHELL) $(top_srcdir)/cf/install-catman.sh uninstall "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS) install-data-hook: install-cat-mans uninstall-hook: uninstall-cat-mans Modified: vendor-crypto/heimdal/dist/NEWS ============================================================================== --- vendor-crypto/heimdal/dist/NEWS Wed Apr 4 04:20:39 2018 (r331977) +++ vendor-crypto/heimdal/dist/NEWS Wed Apr 4 04:21:19 2018 (r331978) @@ -1,3 +1,221 @@ +Release Notes - Heimdal - Version Heimdal 7.5 + + Security + + - Fix CVE-2017-17439, which is a remote denial of service + vulnerability: + + In Heimdal 7.1 through 7.4, remote unauthenticated attackers + are able to crash the KDC by sending a crafted UDP packet + containing empty data fields for client name or realm. + + Bug fixes + + - Handle long input lines when reloading database dumps. + + - In pre-forked mode (default on Unix), correctly clear + the process ids of exited children, allowing new child processes + to replace the old. + + - Fixed incorrect KDC response when no-cross realm TGT exists, + allowing client requests to fail quickly rather than time + out after trying to get a correct answer from each KDC. + +Release Notes - Heimdal - Version Heimdal 7.4 + + Security + + - Fix CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation + + This is a critical vulnerability. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 04:23:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 838AFF8D795; Wed, 4 Apr 2018 04:23:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F118876CA; Wed, 4 Apr 2018 04:23:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10BEA6B50; Wed, 4 Apr 2018 04:23:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w344NO7O018259; Wed, 4 Apr 2018 04:23:24 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w344NObT018258; Wed, 4 Apr 2018 04:23:24 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201804040423.w344NObT018258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 4 Apr 2018 04:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r331979 - vendor-crypto/heimdal/7.5.0 X-SVN-Group: vendor-crypto X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: vendor-crypto/heimdal/7.5.0 X-SVN-Commit-Revision: 331979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 04:23:25 -0000 Author: hrs Date: Wed Apr 4 04:23:24 2018 New Revision: 331979 URL: https://svnweb.freebsd.org/changeset/base/331979 Log: Tag Heimdal 7.5.0. Added: vendor-crypto/heimdal/7.5.0/ - copied from r331978, vendor-crypto/heimdal/dist/ From owner-svn-src-all@freebsd.org Wed Apr 4 04:26:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A20F8DADF; Wed, 4 Apr 2018 04:26:22 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D5A887931; Wed, 4 Apr 2018 04:26:22 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 083B16B56; Wed, 4 Apr 2018 04:26:22 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w344QL0q020715; Wed, 4 Apr 2018 04:26:21 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w344QLSs020714; Wed, 4 Apr 2018 04:26:21 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201804040426.w344QLSs020714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Wed, 4 Apr 2018 04:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r331980 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 331980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 04:26:22 -0000 Author: hrs Date: Wed Apr 4 04:26:21 2018 New Revision: 331980 URL: https://svnweb.freebsd.org/changeset/base/331980 Log: Remove myself because import of Heimdal 7.5.0 completed. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Apr 4 04:23:24 2018 (r331979) +++ svnadmin/conf/sizelimit.conf Wed Apr 4 04:26:21 2018 (r331980) @@ -18,7 +18,6 @@ achim bapt davidcs dim -hrs imp jb jeff From owner-svn-src-all@freebsd.org Wed Apr 4 05:21:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B45AF909E4; Wed, 4 Apr 2018 05:21:47 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDB7489A65; Wed, 4 Apr 2018 05:21:46 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87E174BF; Wed, 4 Apr 2018 05:21:46 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345LkJJ092880; Wed, 4 Apr 2018 05:21:46 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345LkiY092879; Wed, 4 Apr 2018 05:21:46 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040521.w345LkiY092879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331981 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 331981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:21:47 -0000 Author: gordon Date: Wed Apr 4 05:21:46 2018 New Revision: 331981 URL: https://svnweb.freebsd.org/changeset/base/331981 Log: Limit glyph count in vtfont_load to avoid integer overflow. Invalid font data passed to PIO_VFONT can result in an integer overflow in glyphsize. Characters may then be drawn on the console using glyph map entries that point beyond the end of allocated glyph memory, resulting in a kernel memory disclosure. Submitted by: emaste Reported by: Dr. Silvio Cesare of InfoSect Security: CVE-2018-6917 Security: FreeBSD-SA-18:04.vt Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_font.c Modified: head/sys/dev/vt/vt_font.c ============================================================================== --- head/sys/dev/vt/vt_font.c Wed Apr 4 04:26:21 2018 (r331980) +++ head/sys/dev/vt/vt_font.c Wed Apr 4 05:21:46 2018 (r331981) @@ -44,6 +44,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -173,7 +174,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ From owner-svn-src-all@freebsd.org Wed Apr 4 05:25:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D928F90BDF; Wed, 4 Apr 2018 05:25:00 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 135DA89CF3; Wed, 4 Apr 2018 05:25:00 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07A547502; Wed, 4 Apr 2018 05:25:00 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345OxRa096194; Wed, 4 Apr 2018 05:24:59 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345OxMx096193; Wed, 4 Apr 2018 05:24:59 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040524.w345OxMx096193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331982 - stable/11/sys/dev/vt X-SVN-Group: stable-11 X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: stable/11/sys/dev/vt X-SVN-Commit-Revision: 331982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:25:00 -0000 Author: gordon Date: Wed Apr 4 05:24:59 2018 New Revision: 331982 URL: https://svnweb.freebsd.org/changeset/base/331982 Log: MFC r331981: Limit glyph count in vtfont_load to avoid integer overflow. Invalid font data passed to PIO_VFONT can result in an integer overflow in glyphsize. Characters may then be drawn on the console using glyph map entries that point beyond the end of allocated glyph memory, resulting in a kernel memory disclosure. Submitted by: emaste Reported by: Dr. Silvio Cesare of InfoSect Security: CVE-2018-6917 Security: FreeBSD-SA-18:04.vt Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/vt/vt_font.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vt/vt_font.c ============================================================================== --- stable/11/sys/dev/vt/vt_font.c Wed Apr 4 05:21:46 2018 (r331981) +++ stable/11/sys/dev/vt/vt_font.c Wed Apr 4 05:24:59 2018 (r331982) @@ -42,6 +42,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -171,7 +172,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ From owner-svn-src-all@freebsd.org Wed Apr 4 05:26:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 843EDF90D5C; Wed, 4 Apr 2018 05:26:34 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EBD189E8A; Wed, 4 Apr 2018 05:26:34 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 276177507; Wed, 4 Apr 2018 05:26:34 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345QYbd097608; Wed, 4 Apr 2018 05:26:34 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345QYFT097606; Wed, 4 Apr 2018 05:26:34 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040526.w345QYFT097606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:26:34 +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: r331983 - stable/10/sys/dev/vt X-SVN-Group: stable-10 X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: stable/10/sys/dev/vt X-SVN-Commit-Revision: 331983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:26:34 -0000 Author: gordon Date: Wed Apr 4 05:26:33 2018 New Revision: 331983 URL: https://svnweb.freebsd.org/changeset/base/331983 Log: MFC r331981: Limit glyph count in vtfont_load to avoid integer overflow. Invalid font data passed to PIO_VFONT can result in an integer overflow in glyphsize. Characters may then be drawn on the console using glyph map entries that point beyond the end of allocated glyph memory, resulting in a kernel memory disclosure. Submitted by: emaste Reported by: Dr. Silvio Cesare of InfoSect Security: CVE-2018-6917 Security: FreeBSD-SA-18:04.vt Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/vt_font.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_font.c ============================================================================== --- stable/10/sys/dev/vt/vt_font.c Wed Apr 4 05:24:59 2018 (r331982) +++ stable/10/sys/dev/vt/vt_font.c Wed Apr 4 05:26:33 2018 (r331983) @@ -42,6 +42,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -171,7 +172,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ From owner-svn-src-all@freebsd.org Wed Apr 4 05:33:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047F9F9130E; Wed, 4 Apr 2018 05:33:58 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAA678A37E; Wed, 4 Apr 2018 05:33:57 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A571276B6; Wed, 4 Apr 2018 05:33:57 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345XvE8008639; Wed, 4 Apr 2018 05:33:57 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345XuKR008616; Wed, 4 Apr 2018 05:33:56 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040533.w345XuKR008616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r331984 - in releng: 10.3 10.3/sys/conf 10.3/sys/dev/vt 10.4 10.4/sys/conf 10.4/sys/dev/vt 11.1 11.1/sys/conf 11.1/sys/dev/vt X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 10.3 10.3/sys/conf 10.3/sys/dev/vt 10.4 10.4/sys/conf 10.4/sys/dev/vt 11.1 11.1/sys/conf 11.1/sys/dev/vt X-SVN-Commit-Revision: 331984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:33:58 -0000 Author: gordon Date: Wed Apr 4 05:33:56 2018 New Revision: 331984 URL: https://svnweb.freebsd.org/changeset/base/331984 Log: Fix vt console memory disclosure. [SA-18:04.vt] Bump newvers.sh and UPDATING for today's patches. Submitted by: emaste Reported by: Dr Silvio Cesare of InfoSect Approved by: so Security: CVE-2018-6917 Security: FreeBSD-SA-18:04.vt Sponsored by: The FreeBSD Foundation Modified: releng/10.3/UPDATING releng/10.3/sys/conf/newvers.sh releng/10.3/sys/dev/vt/vt_font.c releng/10.4/UPDATING releng/10.4/sys/conf/newvers.sh releng/10.4/sys/dev/vt/vt_font.c releng/11.1/UPDATING releng/11.1/sys/conf/newvers.sh releng/11.1/sys/dev/vt/vt_font.c Modified: releng/10.3/UPDATING ============================================================================== --- releng/10.3/UPDATING Wed Apr 4 05:26:33 2018 (r331983) +++ releng/10.3/UPDATING Wed Apr 4 05:33:56 2018 (r331984) @@ -16,6 +16,19 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20180404 p29 FreeBSD-SA-18:04.vt + FreeBSD-SA-18:05.ipsec + FreeBSD-EN-18:03.tzdata + FreeBSD-EN-18:04.mem + + Fix vt console memory disclosure. [SA-18:04.vt] + + Fix ipsec crash or denial of service. [SA-18:05.ipsec] + + Update timezone database information. [EN-18:03.tzdata] + + Fix multiple small kernel memory disclosures. [EN-18:04.mem] + 20180308 p28 FreeBSD-SA-18:01.ipsec [revised] Fix ipsec validation and use-after-free. Modified: releng/10.3/sys/conf/newvers.sh ============================================================================== --- releng/10.3/sys/conf/newvers.sh Wed Apr 4 05:26:33 2018 (r331983) +++ releng/10.3/sys/conf/newvers.sh Wed Apr 4 05:33:56 2018 (r331984) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.3" -BRANCH="RELEASE-p28" +BRANCH="RELEASE-p29" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.3/sys/dev/vt/vt_font.c ============================================================================== --- releng/10.3/sys/dev/vt/vt_font.c Wed Apr 4 05:26:33 2018 (r331983) +++ releng/10.3/sys/dev/vt/vt_font.c Wed Apr 4 05:33:56 2018 (r331984) @@ -42,6 +42,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -171,7 +172,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ Modified: releng/10.4/UPDATING ============================================================================== --- releng/10.4/UPDATING Wed Apr 4 05:26:33 2018 (r331983) +++ releng/10.4/UPDATING Wed Apr 4 05:33:56 2018 (r331984) @@ -16,6 +16,19 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20180404 p8 FreeBSD-SA-18:04.vt + FreeBSD-SA-18:05.ipsec + FreeBSD-EN-18:03.tzdata + FreeBSD-EN-18:04.mem + + Fix vt console memory disclosure. [SA-18:04.vt] + + Fix ipsec crash or denial of service. [SA-18:05.ipsec] + + Update timezone database information. [EN-18:03.tzdata] + + Fix multiple small kernel memory disclosures. [EN-18:04.mem] + 20180307 p7 FreeBSD-SA-18:01.ipsec [revised] Fix ipsec validation and use-after-free. Modified: releng/10.4/sys/conf/newvers.sh ============================================================================== --- releng/10.4/sys/conf/newvers.sh Wed Apr 4 05:26:33 2018 (r331983) +++ releng/10.4/sys/conf/newvers.sh Wed Apr 4 05:33:56 2018 (r331984) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.4" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.4/sys/dev/vt/vt_font.c ============================================================================== --- releng/10.4/sys/dev/vt/vt_font.c Wed Apr 4 05:26:33 2018 (r331983) +++ releng/10.4/sys/dev/vt/vt_font.c Wed Apr 4 05:33:56 2018 (r331984) @@ -42,6 +42,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -171,7 +172,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ Modified: releng/11.1/UPDATING ============================================================================== --- releng/11.1/UPDATING Wed Apr 4 05:26:33 2018 (r331983) +++ releng/11.1/UPDATING Wed Apr 4 05:33:56 2018 (r331984) @@ -16,6 +16,19 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180404 p9 FreeBSD-SA-18:04.vt + FreeBSD-SA-18:05.ipsec + FreeBSD-EN-18:03.tzdata + FreeBSD-EN-18:04.mem + + Fix vt console memory disclosure. [SA-18:04.vt] + + Fix ipsec crash or denial of service. [SA-18:05.ipsec] + + Update timezone database information. [EN-18:03.tzdata] + + Fix multiple small kernel memory disclosures. [EN-18:04.mem] + 20180314 p8 FreeBSD-SA-18:03.speculative_execution Add mitigations for two classes of speculative execution vulnerabilities Modified: releng/11.1/sys/conf/newvers.sh ============================================================================== --- releng/11.1/sys/conf/newvers.sh Wed Apr 4 05:26:33 2018 (r331983) +++ releng/11.1/sys/conf/newvers.sh Wed Apr 4 05:33:56 2018 (r331984) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.1/sys/dev/vt/vt_font.c ============================================================================== --- releng/11.1/sys/dev/vt/vt_font.c Wed Apr 4 05:26:33 2018 (r331983) +++ releng/11.1/sys/dev/vt/vt_font.c Wed Apr 4 05:33:56 2018 (r331984) @@ -42,6 +42,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #define VTFONT_MAXMAPPINGS 65536 +#define VTFONT_MAXGLYPHS 131072 #define VTFONT_MAXGLYPHSIZE 2097152 #define VTFONT_MAXDIMENSION 128 @@ -171,7 +172,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ From owner-svn-src-all@freebsd.org Wed Apr 4 05:37:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B8BF915E4; Wed, 4 Apr 2018 05:37:53 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE6C68A5E6; Wed, 4 Apr 2018 05:37:52 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B501B76BC; Wed, 4 Apr 2018 05:37:52 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345bqIa012037; Wed, 4 Apr 2018 05:37:52 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345bqEu012031; Wed, 4 Apr 2018 05:37:52 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040537.w345bqEu012031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r331985 - in releng: 10.3/sys/netipsec 10.4/sys/netipsec 11.1/sys/netipsec X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 10.3/sys/netipsec 10.4/sys/netipsec 11.1/sys/netipsec X-SVN-Commit-Revision: 331985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:37:53 -0000 Author: gordon Date: Wed Apr 4 05:37:52 2018 New Revision: 331985 URL: https://svnweb.freebsd.org/changeset/base/331985 Log: Fix ipsec crash or denial of service. [SA-18:05.ipsec] Reported by: Maxime Villard Approved by: so Security: CVE-2018-6918 Security: FreeBSD-SA-18:05.ipsec Modified: releng/10.3/sys/netipsec/xform_ah.c releng/10.4/sys/netipsec/xform_ah.c releng/11.1/sys/netipsec/xform_ah.c Modified: releng/10.3/sys/netipsec/xform_ah.c ============================================================================== --- releng/10.3/sys/netipsec/xform_ah.c Wed Apr 4 05:33:56 2018 (r331984) +++ releng/10.3/sys/netipsec/xform_ah.c Wed Apr 4 05:37:52 2018 (r331985) @@ -285,7 +285,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk #ifdef INET6 struct ip6_ext *ip6e; struct ip6_hdr ip6; - int alloc, len, ad; + int ad, alloc, nxt, noff; #endif /* INET6 */ switch (proto) { @@ -314,7 +314,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk else ip->ip_off = htons(0); - ptr = mtod(m, unsigned char *) + sizeof(struct ip); + ptr = mtod(m, unsigned char *); /* IPv4 option processing */ for (off = sizeof(struct ip); off < skip;) { @@ -395,7 +395,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk /* Zeroize all other options. */ count = ptr[off + 1]; - bcopy(ipseczeroes, ptr, count); + bcopy(ipseczeroes, ptr + off, count); off += count; break; } @@ -468,61 +468,44 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk } else break; - off = ip6.ip6_nxt & 0xff; /* Next header type. */ + nxt = ip6.ip6_nxt & 0xff; /* Next header type. */ - for (len = 0; len < skip - sizeof(struct ip6_hdr);) - switch (off) { + for (off = 0; off < skip - sizeof(struct ip6_hdr);) + switch (nxt) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: - ip6e = (struct ip6_ext *) (ptr + len); + ip6e = (struct ip6_ext *)(ptr + off); + noff = off + ((ip6e->ip6e_len + 1) << 3); + /* Sanity check. */ + if (noff > skip - sizeof(struct ip6_hdr)) + goto error6; + /* - * Process the mutable/immutable - * options -- borrows heavily from the - * KAME code. + * Zero out mutable options. */ - for (count = len + sizeof(struct ip6_ext); - count < len + ((ip6e->ip6e_len + 1) << 3);) { + for (count = off + sizeof(struct ip6_ext); + count < noff;) { if (ptr[count] == IP6OPT_PAD1) { count++; continue; /* Skip padding. */ } - /* Sanity check. */ - if (count > len + - ((ip6e->ip6e_len + 1) << 3)) { - m_freem(m); + ad = ptr[count + 1] + 2; + if (count + ad > noff) + goto error6; - /* Free, if we allocated. */ - if (alloc) - free(ptr, M_XDATA); - return EINVAL; - } - - ad = ptr[count + 1]; - - /* If mutable option, zeroize. */ if (ptr[count] & IP6OPT_MUTABLE) - bcopy(ipseczeroes, ptr + count, - ptr[count + 1]); - + memset(ptr + count, 0, ad); count += ad; - - /* Sanity check. */ - if (count > - skip - sizeof(struct ip6_hdr)) { - m_freem(m); - - /* Free, if we allocated. */ - if (alloc) - free(ptr, M_XDATA); - return EINVAL; - } } + if (count != noff) + goto error6; + /* Advance. */ - len += ((ip6e->ip6e_len + 1) << 3); - off = ip6e->ip6e_nxt; + off += ((ip6e->ip6e_len + 1) << 3); + nxt = ip6e->ip6e_nxt; break; case IPPROTO_ROUTING: @@ -530,14 +513,15 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk * Always include routing headers in * computation. */ - ip6e = (struct ip6_ext *) (ptr + len); - len += ((ip6e->ip6e_len + 1) << 3); - off = ip6e->ip6e_nxt; + ip6e = (struct ip6_ext *) (ptr + off); + off += ((ip6e->ip6e_len + 1) << 3); + nxt = ip6e->ip6e_nxt; break; default: DPRINTF(("%s: unexpected IPv6 header type %d", __func__, off)); +error6: if (alloc) free(ptr, M_XDATA); m_freem(m); Modified: releng/10.4/sys/netipsec/xform_ah.c ============================================================================== --- releng/10.4/sys/netipsec/xform_ah.c Wed Apr 4 05:33:56 2018 (r331984) +++ releng/10.4/sys/netipsec/xform_ah.c Wed Apr 4 05:37:52 2018 (r331985) @@ -285,7 +285,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk #ifdef INET6 struct ip6_ext *ip6e; struct ip6_hdr ip6; - int alloc, len, ad; + int ad, alloc, nxt, noff; #endif /* INET6 */ switch (proto) { @@ -314,7 +314,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk else ip->ip_off = htons(0); - ptr = mtod(m, unsigned char *) + sizeof(struct ip); + ptr = mtod(m, unsigned char *); /* IPv4 option processing */ for (off = sizeof(struct ip); off < skip;) { @@ -395,7 +395,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk /* Zeroize all other options. */ count = ptr[off + 1]; - bcopy(ipseczeroes, ptr, count); + bcopy(ipseczeroes, ptr + off, count); off += count; break; } @@ -468,61 +468,44 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk } else break; - off = ip6.ip6_nxt & 0xff; /* Next header type. */ + nxt = ip6.ip6_nxt & 0xff; /* Next header type. */ - for (len = 0; len < skip - sizeof(struct ip6_hdr);) - switch (off) { + for (off = 0; off < skip - sizeof(struct ip6_hdr);) + switch (nxt) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: - ip6e = (struct ip6_ext *) (ptr + len); + ip6e = (struct ip6_ext *)(ptr + off); + noff = off + ((ip6e->ip6e_len + 1) << 3); + /* Sanity check. */ + if (noff > skip - sizeof(struct ip6_hdr)) + goto error6; + /* - * Process the mutable/immutable - * options -- borrows heavily from the - * KAME code. + * Zero out mutable options. */ - for (count = len + sizeof(struct ip6_ext); - count < len + ((ip6e->ip6e_len + 1) << 3);) { + for (count = off + sizeof(struct ip6_ext); + count < noff;) { if (ptr[count] == IP6OPT_PAD1) { count++; continue; /* Skip padding. */ } - /* Sanity check. */ - if (count > len + - ((ip6e->ip6e_len + 1) << 3)) { - m_freem(m); + ad = ptr[count + 1] + 2; + if (count + ad > noff) + goto error6; - /* Free, if we allocated. */ - if (alloc) - free(ptr, M_XDATA); - return EINVAL; - } - - ad = ptr[count + 1]; - - /* If mutable option, zeroize. */ if (ptr[count] & IP6OPT_MUTABLE) - bcopy(ipseczeroes, ptr + count, - ptr[count + 1]); - + memset(ptr + count, 0, ad); count += ad; - - /* Sanity check. */ - if (count > - skip - sizeof(struct ip6_hdr)) { - m_freem(m); - - /* Free, if we allocated. */ - if (alloc) - free(ptr, M_XDATA); - return EINVAL; - } } + if (count != noff) + goto error6; + /* Advance. */ - len += ((ip6e->ip6e_len + 1) << 3); - off = ip6e->ip6e_nxt; + off += ((ip6e->ip6e_len + 1) << 3); + nxt = ip6e->ip6e_nxt; break; case IPPROTO_ROUTING: @@ -530,14 +513,15 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk * Always include routing headers in * computation. */ - ip6e = (struct ip6_ext *) (ptr + len); - len += ((ip6e->ip6e_len + 1) << 3); - off = ip6e->ip6e_nxt; + ip6e = (struct ip6_ext *) (ptr + off); + off += ((ip6e->ip6e_len + 1) << 3); + nxt = ip6e->ip6e_nxt; break; default: DPRINTF(("%s: unexpected IPv6 header type %d", __func__, off)); +error6: if (alloc) free(ptr, M_XDATA); m_freem(m); Modified: releng/11.1/sys/netipsec/xform_ah.c ============================================================================== --- releng/11.1/sys/netipsec/xform_ah.c Wed Apr 4 05:33:56 2018 (r331984) +++ releng/11.1/sys/netipsec/xform_ah.c Wed Apr 4 05:37:52 2018 (r331985) @@ -264,7 +264,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk #ifdef INET6 struct ip6_ext *ip6e; struct ip6_hdr ip6; - int alloc, len, ad; + int ad, alloc, nxt, noff; #endif /* INET6 */ switch (proto) { @@ -293,7 +293,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk else ip->ip_off = htons(0); - ptr = mtod(m, unsigned char *) + sizeof(struct ip); + ptr = mtod(m, unsigned char *); /* IPv4 option processing */ for (off = sizeof(struct ip); off < skip;) { @@ -374,7 +374,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk /* Zeroize all other options. */ count = ptr[off + 1]; - bcopy(ipseczeroes, ptr, count); + bcopy(ipseczeroes, ptr + off, count); off += count; break; } @@ -447,61 +447,44 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk } else break; - off = ip6.ip6_nxt & 0xff; /* Next header type. */ + nxt = ip6.ip6_nxt & 0xff; /* Next header type. */ - for (len = 0; len < skip - sizeof(struct ip6_hdr);) - switch (off) { + for (off = 0; off < skip - sizeof(struct ip6_hdr);) + switch (nxt) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: - ip6e = (struct ip6_ext *) (ptr + len); + ip6e = (struct ip6_ext *)(ptr + off); + noff = off + ((ip6e->ip6e_len + 1) << 3); + /* Sanity check. */ + if (noff > skip - sizeof(struct ip6_hdr)) + goto error6; + /* - * Process the mutable/immutable - * options -- borrows heavily from the - * KAME code. + * Zero out mutable options. */ - for (count = len + sizeof(struct ip6_ext); - count < len + ((ip6e->ip6e_len + 1) << 3);) { + for (count = off + sizeof(struct ip6_ext); + count < noff;) { if (ptr[count] == IP6OPT_PAD1) { count++; continue; /* Skip padding. */ } - /* Sanity check. */ - if (count > len + - ((ip6e->ip6e_len + 1) << 3)) { - m_freem(m); + ad = ptr[count + 1] + 2; + if (count + ad > noff) + goto error6; - /* Free, if we allocated. */ - if (alloc) - free(ptr, M_XDATA); - return EINVAL; - } - - ad = ptr[count + 1]; - - /* If mutable option, zeroize. */ if (ptr[count] & IP6OPT_MUTABLE) - bcopy(ipseczeroes, ptr + count, - ptr[count + 1]); - + memset(ptr + count, 0, ad); count += ad; - - /* Sanity check. */ - if (count > - skip - sizeof(struct ip6_hdr)) { - m_freem(m); - - /* Free, if we allocated. */ - if (alloc) - free(ptr, M_XDATA); - return EINVAL; - } } + if (count != noff) + goto error6; + /* Advance. */ - len += ((ip6e->ip6e_len + 1) << 3); - off = ip6e->ip6e_nxt; + off += ((ip6e->ip6e_len + 1) << 3); + nxt = ip6e->ip6e_nxt; break; case IPPROTO_ROUTING: @@ -509,14 +492,15 @@ ah_massage_headers(struct mbuf **m0, int proto, int sk * Always include routing headers in * computation. */ - ip6e = (struct ip6_ext *) (ptr + len); - len += ((ip6e->ip6e_len + 1) << 3); - off = ip6e->ip6e_nxt; + ip6e = (struct ip6_ext *) (ptr + off); + off += ((ip6e->ip6e_len + 1) << 3); + nxt = ip6e->ip6e_nxt; break; default: DPRINTF(("%s: unexpected IPv6 header type %d", __func__, off)); +error6: if (alloc) free(ptr, M_XDATA); m_freem(m); From owner-svn-src-all@freebsd.org Wed Apr 4 05:40:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C285BF91A87; Wed, 4 Apr 2018 05:40:49 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7075B8AA78; Wed, 4 Apr 2018 05:40:49 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66EE476D2; Wed, 4 Apr 2018 05:40:49 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345ensm017707; Wed, 4 Apr 2018 05:40:49 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345emD2017627; Wed, 4 Apr 2018 05:40:48 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040540.w345emD2017627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r331986 - in releng: 10.3/contrib/tzdata 10.4/contrib/tzdata 11.1/contrib/tzdata X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 10.3/contrib/tzdata 10.4/contrib/tzdata 11.1/contrib/tzdata X-SVN-Commit-Revision: 331986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:40:50 -0000 Author: gordon Date: Wed Apr 4 05:40:48 2018 New Revision: 331986 URL: https://svnweb.freebsd.org/changeset/base/331986 Log: Update timezone database information. [EN-18:03.tzdata] Submitted by: philip Approved by: so Security: FreeBSD-EN-18:03.tzdata Added: releng/10.3/contrib/tzdata/ziguard.awk releng/10.4/contrib/tzdata/ziguard.awk releng/11.1/contrib/tzdata/ziguard.awk Modified: releng/10.3/contrib/tzdata/CONTRIBUTING releng/10.3/contrib/tzdata/Makefile releng/10.3/contrib/tzdata/NEWS releng/10.3/contrib/tzdata/africa releng/10.3/contrib/tzdata/antarctica releng/10.3/contrib/tzdata/asia releng/10.3/contrib/tzdata/australasia releng/10.3/contrib/tzdata/backzone releng/10.3/contrib/tzdata/checktab.awk releng/10.3/contrib/tzdata/europe releng/10.3/contrib/tzdata/northamerica releng/10.3/contrib/tzdata/southamerica releng/10.3/contrib/tzdata/theory.html releng/10.3/contrib/tzdata/version releng/10.3/contrib/tzdata/zishrink.awk releng/10.3/contrib/tzdata/zone.tab releng/10.3/contrib/tzdata/zone1970.tab releng/10.4/contrib/tzdata/CONTRIBUTING releng/10.4/contrib/tzdata/Makefile releng/10.4/contrib/tzdata/NEWS releng/10.4/contrib/tzdata/africa releng/10.4/contrib/tzdata/antarctica releng/10.4/contrib/tzdata/asia releng/10.4/contrib/tzdata/australasia releng/10.4/contrib/tzdata/backzone releng/10.4/contrib/tzdata/checktab.awk releng/10.4/contrib/tzdata/europe releng/10.4/contrib/tzdata/northamerica releng/10.4/contrib/tzdata/southamerica releng/10.4/contrib/tzdata/theory.html releng/10.4/contrib/tzdata/version releng/10.4/contrib/tzdata/zishrink.awk releng/10.4/contrib/tzdata/zone.tab releng/10.4/contrib/tzdata/zone1970.tab releng/11.1/contrib/tzdata/CONTRIBUTING releng/11.1/contrib/tzdata/Makefile releng/11.1/contrib/tzdata/NEWS releng/11.1/contrib/tzdata/africa releng/11.1/contrib/tzdata/antarctica releng/11.1/contrib/tzdata/asia releng/11.1/contrib/tzdata/australasia releng/11.1/contrib/tzdata/backzone releng/11.1/contrib/tzdata/checktab.awk releng/11.1/contrib/tzdata/europe releng/11.1/contrib/tzdata/northamerica releng/11.1/contrib/tzdata/southamerica releng/11.1/contrib/tzdata/theory.html releng/11.1/contrib/tzdata/version releng/11.1/contrib/tzdata/zishrink.awk releng/11.1/contrib/tzdata/zone.tab releng/11.1/contrib/tzdata/zone1970.tab Modified: releng/10.3/contrib/tzdata/CONTRIBUTING ============================================================================== --- releng/10.3/contrib/tzdata/CONTRIBUTING Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/CONTRIBUTING Wed Apr 4 05:40:48 2018 (r331986) @@ -25,7 +25,8 @@ justification. Citations should use https: URLs if av Please submit changes against either the latest release in or the master branch of the development -repository. If you use Git the following workflow may be helpful: +repository. The latter is preferred. If you use Git the following +workflow may be helpful: * Copy the development repository. @@ -42,6 +43,12 @@ repository. If you use Git the following workflow may git checkout -b mybranch + * Sleuth by using 'git blame'. For example, when fixing data for + Africa/Sao_Tome, if the command 'git blame africa' outputs a line + '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone + Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should + provide some justification for the 'Zone Africa/Sao_Tome' line. + * Edit source files. Include commentary that justifies the changes by citing reliable sources. @@ -66,6 +73,9 @@ repository. If you use Git the following workflow may for others to review. git send-email master + + For an archived example of such an email, see + . * Start anew by getting current with the master branch again (the second step above). Modified: releng/10.3/contrib/tzdata/Makefile ============================================================================== --- releng/10.3/contrib/tzdata/Makefile Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/Makefile Wed Apr 4 05:40:48 2018 (r331986) @@ -10,6 +10,15 @@ VERSION= unknown # Email address for bug reports. BUGEMAIL= tz@iana.org +# Choose source data features. To get new features right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +DATAFORM= main + # Change the line below for your time zone (after finding the zone you want in # the time zone files, or adding it to a time zone file). # Alternately, if you discover you've got the wrong time zone, you can just @@ -25,10 +34,10 @@ LOCALTIME= GMT # for handling POSIX-style time zone environment variables, # change the line below (after finding the zone you want in the # time zone files, or adding it to a time zone file). -# (When a POSIX-style environment variable is handled, the rules in the +# When a POSIX-style environment variable is handled, the rules in the # template file are used to determine "spring forward" and "fall back" days and # times; the environment variable itself specifies UT offsets of standard and -# summer time.) +# daylight saving time. # Alternately, if you discover you've got the wrong time zone, you can just # zic -p rightzone # to correct things. @@ -189,13 +198,18 @@ LDLIBS= # -DHAVE_STDINT_H if you have a non-C99 compiler with # -DHAVE_STRFTIME_L if declares locale_t and strftime_l # -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function # -DHAVE_SYMLINK=0 if your system lacks the symlink function # -DHAVE_SYS_STAT_H=0 if your compiler lacks a # -DHAVE_SYS_WAIT_H=0 if your compiler lacks a # -DHAVE_TZSET=0 if your system lacks a tzset function # -DHAVE_UNISTD_H=0 if your compiler lacks a # -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. # -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use # -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; # not needed by the main-program tz code, which is single-threaded. # Append other compiler flags as needed, e.g., -pthread on GNU/Linux. @@ -394,13 +408,19 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. XEmacs 21.5.34 displays them correctly, +# presumably because they are Latin-1. +UNUSUAL_OK_CHARSET= °±½¾× + # OK_CHAR matches any character allowed in the distributed files. -# This is the same as SAFE_CHAR, except that multibyte letters are -# also allowed so that commentary can contain people's names and quote -# non-English sources. For non-letters the sources are limited to -# ASCII renderings for the convenience of maintainers whose text editors -# mishandle UTF-8 by default (e.g., XEmacs 21.4.22). -OK_CHAR= '[][:alpha:]'$(SAFE_CHARSET)'-]' +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' # SAFE_LINE matches a line of safe characters. # SAFE_SHARP_LINE is similar, except any OK character can follow '#'; @@ -462,10 +482,12 @@ TDATA= $(YDATA) $(NDATA) $(BACKWARD) ZONETABLES= zone1970.tab zone.tab TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) LEAP_DEPS= leapseconds.awk leap-seconds.list -TZDATA_ZI_DEPS= zishrink.awk version $(TDATA) $(PACKRATDATA) +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ leapseconds yearistype.sh $(ZONETABLES) -AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk zishrink.awk +AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl TZS_YEAR= 2050 TZS= to$(TZS_YEAR).tzs @@ -499,7 +521,8 @@ VERSION_DEPS= \ SHELL= /bin/sh -all: tzselect yearistype zic zdump libtz.a $(TABDATA) +all: tzselect yearistype zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi ALL: all date $(ENCHILADA) @@ -534,11 +557,15 @@ version: $(VERSION_DEPS) printf '%s\n' "$$V" >$@.out mv $@.out $@ -# This file can be tailored by setting BACKWARD, PACKRATDATA, etc. -tzdata.zi: $(TZDATA_ZI_DEPS) +# These files can be tailored by setting BACKWARD, PACKRATDATA, etc. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) -v outfile='$@' -f ziguard.awk $(TDATA) $(PACKRATDATA) \ + >$@.out + mv $@.out $@ +tzdata.zi: $(DATAFORM).zi version version=`sed 1q version` && \ LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \ - $(TDATA) $(PACKRATDATA) >$@.out + $(DATAFORM).zi >$@.out mv $@.out $@ version.h: version @@ -614,19 +641,29 @@ posix_packrat: zones: $(REDO) +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@ + $(TZS_NEW): tzdata.zi zdump zic - mkdir -p tzs.dir + rm -fr tzs.dir + mkdir tzs.dir $(zic) -d tzs.dir tzdata.zi $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ tzdata.zi | LC_ALL=C sort >$@.out wd=`pwd` && \ - zones=`$(AWK) -v wd="$$wd" \ - '/^Z/{print wd "/tzs.dir/" $$2}' tzdata.zi \ - | LC_ALL=C sort` && \ - ./zdump -i -c $(TZS_YEAR) $$zones >>$@.out - sed 's,^TZ=".*tzs\.dir/,TZ=",' $@.out >$@.sed.out - rm -fr tzs.dir $@.out - mv $@.sed.out $@ + set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2` && \ + shift && \ + ZDS=$$* && \ + $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs.dir + mv $@.out $@ # If $(TZS) does not already exist (e.g., old-format tarballs), create it. # If it exists but 'make check_tzs' fails, a maintainer should inspect the @@ -669,8 +706,10 @@ check_character_set: $(ENCHILADA) sharp='#' && \ ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ $(MISC) $(SOURCES) $(WEB_PAGES) \ - CONTRIBUTING LICENSE Makefile README \ + CONTRIBUTING LICENSE README \ version tzdata.zi && \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \ + Makefile && \ ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ leapseconds yearistype.sh zone.tab && \ ! grep -Env $(OK_LINE) $(ENCHILADA); \ @@ -702,7 +741,7 @@ check_sorted: backward backzone iso3166.tab zone.tab z $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ LC_ALL=C sort -cu -check_links: checklinks.awk $(TDATA_TO_CHECK) +check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) $(AWK) -f checklinks.awk tzdata.zi @@ -720,17 +759,26 @@ check_tzs: $(TZS) $(TZS_NEW) check_web: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html -# Check that tzdata.zi generates the same binary data that its sources do. -check_zishrink: tzdata.zi zic leapseconds $(PACKRATDATA) $(TDATA) +# Check that zishrink.awk does not alter the data, and that ziguard.awk +# preserves main-format data. +check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \ + $(DATAFORM).zi tzdata.zi for type in posix right; do \ - mkdir -p time_t.dir/$$type time_t.dir/$$type-shrunk && \ + mkdir -p time_t.dir/$$type time_t.dir/$$type-t \ + time_t.dir/$$type-shrunk && \ case $$type in \ right) leap='-L leapseconds';; \ *) leap=;; \ esac && \ - $(ZIC) $$leap -d time_t.dir/$$type $(TDATA) && \ - $(AWK) '/^Rule/' $(TDATA) | \ - $(ZIC) $$leap -d time_t.dir/$$type - $(PACKRATDATA) && \ + $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \ + case $(DATAFORM) in \ + main) \ + $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \ + $(AWK) '/^Rule/' $(TDATA) | \ + $(ZIC) $$leap -d time_t.dir/$$type-t - \ + $(PACKRATDATA) && \ + diff -r time_t.dir/$$type time_t.dir/$$type-t;; \ + esac && \ $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \ diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \ done @@ -740,7 +788,7 @@ clean_misc: rm -f core *.o *.out \ date tzselect version.h zdump zic yearistype libtz.a clean: clean_misc - rm -fr *.dir tzdata.zi tzdb-*/ $(TZS_NEW) + rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW) maintainer-clean: clean @echo 'This command is intended for maintainers to use; it' @@ -856,6 +904,9 @@ tarballs traditional_tarballs signatures traditional_s VERSION=`cat version` && \ $(MAKE) VERSION="$$VERSION" $@_version +# These *_version rules are intended for use if VERSION is set by some +# other means. Ordinarily these rules are used only by the above +# non-_version rules, which set VERSION on the 'make' command line. tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz traditional_tarballs_version: \ tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz @@ -917,13 +968,17 @@ zic.o: private.h tzfile.h version.h .KEEP_STATE: .PHONY: ALL INSTALL all -.PHONY: check check_character_set check_links +.PHONY: check check_character_set check_links check_name_lengths .PHONY: check_public check_sorted check_tables .PHONY: check_time_t_alternatives check_tzs check_web check_white_space .PHONY: check_zishrink -.PHONY: clean clean_misc force_tzs +.PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right .PHONY: public right_only right_posix signatures signatures_version -.PHONY: tarballs tarballs_version typecheck +.PHONY: tarballs tarballs_version +.PHONY: traditional_signatures traditional_signatures_version +.PHONY: traditional_tarballs traditional_tarballs_version +.PHONY: typecheck .PHONY: zonenames zones +.PHONY: $(ZDS) Modified: releng/10.3/contrib/tzdata/NEWS ============================================================================== --- releng/10.3/contrib/tzdata/NEWS Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/NEWS Wed Apr 4 05:40:48 2018 (r331986) @@ -1,9 +1,146 @@ News for the tz database +Release 2018d - 2018-03-22 07:05:46 -0700 + + Briefly: + + Palestine starts DST a week earlier in 2018. + Add support for vanguard and rearguard data consumers. + Add subsecond precision to source data format, though not to data. + + Changes to future time stamps + + In 2018, Palestine starts DST on March 24, not March 31. + Adjust future predictions accordingly. (Thanks to Sharef Mustafa.) + + Changes to past and future time stamps + + Casey Station in Antarctica changed from +11 to +08 on 2018-03-11 + at 04:00. (Thanks to Steffen Thorsen.) + + Changes to past time stamps + + Historical transitions for Uruguay, represented by + America/Montevideo, have been updated per official legal documents, + replacing previous data mainly originating from the inventions of + Shanks & Pottenger. This has resulted in adjustments ranging from + 30 to 90 minutes in either direction over at least two dozen + distinct periods ranging from one day to several years in length. + A mere handful of pre-1991 transitions are unaffected; data since + then has come from more reliable contemporaneous reporting. These + changes affect various timestamps in 1920-1923, 1936, 1939, + 1942-1943, 1959, 1966-1970, 1972, 1974-1980, and 1988-1990. + Additionally, Uruguay's pre-standard-time UT offset has been + adjusted westward by 7 seconds, from UT-03:44:44 to UT-03:44:51, to + match the location of the Observatory of the National Meteorological + Institute in Montevideo. + (Thanks to Jeremie Bonjour, Tim Parenti, and Michael Deckers.) + + Enderbury and Kiritimati skipped New Year's Eve 1994, not + New Year's Day 1995. (Thanks to Kerry Shetline.) + + Fix the 1912-01-01 transition for Portugual and its colonies. + This transition was at 00:00 according to the new UT offset, not + according to the old one. Also assume that Cape Verde switched on + the same date as the rest, not in 1907. This affects + Africa/Bissau, Africa/Sao_Tome, Asia/Macau, Atlantic/Azores, + Atlantic/Cape_Verde, Atlantic/Madeira, and Europe/Lisbon. + (Thanks to Michael Deckers.) + + Fix an off-by-1 error for pre-1913 timestamps in Jamaica and in + Turks & Caicos. + + Changes to past time zone abbreviations + + MMT took effect in Uruguay from 1908-06-10, not 1898-06-28. There + is no clock change associated with the transition. + + Changes to build procedure + + The new DATAFORM macro in the Makefile lets the installer choose + among three source data formats. The idea is to lessen downstream + disruption when data formats are improved. + + * DATAFORM=vanguard installs from the latest, bleeding-edge + format. DATAFORM=main (the default) installs from the format + used in the 'africa' etc. files. DATAFORM=rearguard installs + from a trailing-edge format. Eventually, elements of today's + vanguard format should move to the main format, and similarly + the main format's features should eventually move to the + rearguard format. + + * In the current version, the main and rearguard formats are + identical and match that of 2018c, so this change does not + affect default behavior. The vanguard format currently contains + one feature not in the main format: negative SAVE values. This + improves support for Ireland, which uses Irish Standard Time + (IST, UTC+01) in summer and GMT (UTC) in winter. tzcode has + supported negative SAVE values for decades, and this feature + should move to the main format soon. However, it will not move + to the rearguard format for quite some time because some + downstream parsers do not support it. + + * The build procedure constructs three files vanguard.zi, main.zi, + and rearguard.zi, one for each format. The files represent the + same data as closely as the formats allow. These three files + are intended for downstream data consumers and are not + installed. Zoneinfo parsers that do not support negative SAVE values + should start using rearguard.zi, so that they will be unaffected + when the negative-DST feature moves from vanguard to main. + Bleeding-edge Zoneinfo parsers that support the new features + already can use vanguard.zi; in this respect, current tzcode is + bleeding-edge. + + The Makefile should now be safe for parallelized builds, and 'make + -j to2050new.tzs' is now much faster on a multiprocessor host + with GNU Make. + + When built with -DSUPPRESS_TZDIR, the tzcode library no longer + prepends TZDIR/ to file names that do not begin with '/'. This is + not recommended for general use, due to its security implications. + (From a suggestion by Manuela Friedrich.) + + Changes to code + + zic now accepts subsecond precision in expressions like + 00:19:32.13, which is approximately the legal time of the + Netherlands from 1835 to 1937. However, because it is + questionable whether the few recorded uses of non-integer offsets + had subsecond precision in practice, there are no plans for tzdata + to use this feature. (Thanks to Steve Allen for pointing out + the limitations of historical data in this area.) + + The code is a bit more portable to MS-Windows. Installers can + compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that + reserve identifiers like 'localtime'. (Thanks to Manuela + Friedrich). + + Changes to documentation and commentary + + theory.html now outlines tzdb's extensions to POSIX's model for + civil time, and has a section "POSIX features no longer needed" + that lists POSIX API components that are now vestigial. + (From suggestions by Steve Summit.) It also better distinguishes + time zones from tz regions. (From a suggestion by Guy Harris.) + + Commentary is now more consistent about using the phrase "daylight + saving time", to match the C name tm_isdst. Daylight saving time + need not occur in summer, and need not have a positive offset from + standard time. + + Commentary about historical transitions in Uruguay has been expanded + with links to many relevant legal documents. + (Thanks to Tim Parenti.) + + Commentary now uses some non-ASCII characters with Unicode value + less than U+0100, as they can be useful and should work even with + older editors such as XEmacs. + + Release 2018c - 2018-01-22 23:00:44 -0800 Briefly: - Revert Irish changes that relied on negative DST offsets. + Revert Irish changes that relied on negative SAVE values. Changes to tm_isdst @@ -14,8 +151,8 @@ Release 2018c - 2018-01-22 23:00:44 -0800 struct tm type. This reversion is intended to be a temporary workaround for problems discovered with downstream uses of releases 2018a and 2018b, which implemented Irish time by using - negative DST offsets in the Eire rules of the 'europe' file. - Although negative DST offsets have been part of tzcode for many + negative SAVE values in the Eire rules of the 'europe' file. + Although negative SAVE values have been part of tzcode for many years and are supported by many platforms, they were not documented before 2018a and ICU and OpenJDK do not currently support them. A mechanism to export data to platforms lacking @@ -900,7 +1037,7 @@ Release 2016b - 2016-03-12 17:30:14 -0800 Comments in zone tables have been improved. (Thanks to J William Piggott.) tzselect again limits its menu comments so that menus fit on a - 24x80 alphanumeric display. + 24×80 alphanumeric display. A new web page tz-how-to.html. (Thanks to Bill Seymour.) Modified: releng/10.3/contrib/tzdata/africa ============================================================================== --- releng/10.3/contrib/tzdata/africa Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/africa Wed Apr 4 05:40:48 2018 (r331986) @@ -115,13 +115,13 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 # Cape Verde / Cabo Verde # +# From Paul Eggert (2018-02-16): # Shanks gives 1907 for the transition to +02. -# Perhaps the 1911-05-26 Portuguese decree -# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf -# merely made it official? +# For now, ignore that and follow the 1911-05-26 Portuguese decree +# (see Europe/Lisbon). # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Cape_Verde -1:34:04 - LMT 1907 # Praia +Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia -2:00 - -02 1942 Sep -2:00 1:00 -01 1945 Oct 15 -2:00 - -02 1975 Nov 25 2:00 @@ -370,15 +370,34 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # See Africa/Abidjan. # Ghana -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S + +# From Paul Eggert (2018-01-30): # Whitman says DST was observed from 1931 to "the present"; -# Shanks & Pottenger say 1936 to 1942; -# and September 1 to January 1 is given by: -# Scott Keltie J, Epstein M (eds), The Statesman's Year-Book, -# 57th ed. Macmillan, London (1920), OCLC 609408015, pp xxviii. -# For lack of better info, assume DST was observed from 1920 to 1942. -Rule Ghana 1920 1942 - Sep 1 0:00 0:20 GHST -Rule Ghana 1920 1942 - Dec 31 0:00 0 GMT +# Shanks & Pottenger say 1936 to 1942 with 20 minutes of DST, +# with transitions on 09-01 and 12-31 at 00:00. +# Page 33 of Parish GCB, Colonial Reports - Annual. No. 1066. Gold +# Coast. Report for 1919. (March 1921), OCLC 784024077 +# http://libsysdigi.library.illinois.edu/ilharvest/africana/books2011-05/5530214/5530214_1919/5530214_1919_opt.pdf +# lists the Determination of the Time Ordinance, 1919, No. 18, +# "to advance the time observed locally by the space of twenty minutes +# during the last four months of each year; the object in view being +# to extend during those months the period of daylight-time available +# for evening recreation after office hours." +# Vanessa Ogle, The Global Transformation of Time, 1870-1950 (2015), p 33, +# writes "In 1919, the Gold Coast (Ghana as of 1957) made Greenwich +# time its legal time and simultaneously legalized a summer time of +# UTC - 00:20 minutes from March to October."; a footnote lists +# the ordinance as being dated 1919-11-24. +# The Crown Colonist, Volume 12 (1942), p 176, says "the Government +# intend advancing Gold Coast time half an hour ahead of G.M.T. +# The actual date of the alteration has not yet been announced." +# These sources are incomplete and contradictory. Possibly what is +# now Ghana observed different DST regimes in different years. For +# lack of better info, use Shanks except treat the minus sign as a +# typo, and assume DST started in 1920 not 1936. +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Ghana 1920 1942 - Sep 1 0:00 0:20 - +Rule Ghana 1920 1942 - Dec 31 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Accra -0:00:52 - LMT 1918 0:00 Ghana GMT/+0020 @@ -388,13 +407,13 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # Guinea-Bissau # +# From Paul Eggert (2018-02-16): # Shanks gives 1911-05-26 for the transition to WAT, # evidently confusing the date of the Portuguese decree -# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf -# with the date that it took effect, namely 1912-01-01. +# (see Europe/Lisbon) with the date that it took effect. # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 +Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u -1:00 - -01 1975 0:00 - GMT @@ -590,9 +609,9 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 # at 2am (or 02:00) local time..." # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Mauritius 1982 only - Oct 10 0:00 1:00 S +Rule Mauritius 1982 only - Oct 10 0:00 1:00 - Rule Mauritius 1983 only - Mar 21 0:00 0 - -Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 S +Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 - Rule Mauritius 2009 only - Mar lastSun 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis @@ -1037,6 +1056,8 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # São Tomé and Príncipe +# See Europe/Lisbon for info about the 1912 transition. + # From Steffen Thorsen (2018-01-08): # Multiple sources tell that São Tomé changed from UTC to UTC+1 as # they entered the year 2018. @@ -1045,7 +1066,7 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 Zone Africa/Sao_Tome 0:26:56 - LMT 1884 - -0:36:45 - LMT 1912 # Lisbon Mean Time + -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 1:00 - WAT Modified: releng/10.3/contrib/tzdata/antarctica ============================================================================== --- releng/10.3/contrib/tzdata/antarctica Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/antarctica Wed Apr 4 05:40:48 2018 (r331986) @@ -75,7 +75,8 @@ Zone Antarctica/Casey 0 - -00 1969 8:00 - +08 2011 Oct 28 2:00 11:00 - +11 2012 Feb 21 17:00u 8:00 - +08 2016 Oct 22 - 11:00 - +11 + 11:00 - +11 2018 Mar 11 4:00 + 8:00 - +08 Zone Antarctica/Davis 0 - -00 1957 Jan 13 7:00 - +07 1964 Nov 0 - -00 1969 Feb Modified: releng/10.3/contrib/tzdata/asia ============================================================================== --- releng/10.3/contrib/tzdata/asia Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/asia Wed Apr 4 05:40:48 2018 (r331986) @@ -69,13 +69,13 @@ Rule EUAsia 1981 max - Mar lastSun 1:00u 1:00 S Rule EUAsia 1979 1995 - Sep lastSun 1:00u 0 - Rule EUAsia 1996 max - Oct lastSun 1:00u 0 - -Rule E-EurAsia 1981 max - Mar lastSun 0:00 1:00 S +Rule E-EurAsia 1981 max - Mar lastSun 0:00 1:00 - Rule E-EurAsia 1979 1995 - Sep lastSun 0:00 0 - Rule E-EurAsia 1996 max - Oct lastSun 0:00 0 - -Rule RussiaAsia 1981 1984 - Apr 1 0:00 1:00 S +Rule RussiaAsia 1981 1984 - Apr 1 0:00 1:00 - Rule RussiaAsia 1981 1983 - Oct 1 0:00 0 - Rule RussiaAsia 1984 1995 - Sep lastSun 2:00s 0 - -Rule RussiaAsia 1985 2010 - Mar lastSun 2:00s 1:00 S +Rule RussiaAsia 1985 2010 - Mar lastSun 2:00s 1:00 - Rule RussiaAsia 1996 2010 - Oct lastSun 2:00s 0 - # Afghanistan @@ -110,7 +110,7 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # (brief) # http://www.worldtimezone.com/dst_news/dst_news_armenia03.html # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 S +Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 - Rule Armenia 2011 only - Oct lastSun 2:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 @@ -136,7 +136,7 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 # http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 S +Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 - Rule Azer 1997 2015 - Oct lastSun 5:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 @@ -223,7 +223,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 # http://www.worldtimezone.com/dst_news/dst_news_bangladesh06.html # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Dhaka 2009 only - Jun 19 23:00 1:00 S +Rule Dhaka 2009 only - Jun 19 23:00 1:00 - Rule Dhaka 2009 only - Dec 31 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -764,8 +764,9 @@ Rule Macau 1974 1977 - Oct Sun>=15 3:30 0 S Rule Macau 1975 1977 - Apr Sun>=15 3:30 1:00 D Rule Macau 1978 1980 - Apr Sun>=15 0:00 1:00 D Rule Macau 1978 1980 - Oct Sun>=15 0:00 0 S +# See Europe/Lisbon for info about the 1912 transition. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1 +Zone Asia/Macau 7:34:20 - LMT 1911 Dec 31 16:00u 8:00 Macau C%sT @@ -1106,61 +1107,61 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 D -Rule Iran 1978 only - Oct 21 0:00 0 S -Rule Iran 1979 only - Sep 19 0:00 0 S -Rule Iran 1980 only - Sep 23 0:00 0 S -Rule Iran 1991 only - May 3 0:00 1:00 D -Rule Iran 1992 1995 - Mar 22 0:00 1:00 D -Rule Iran 1991 1995 - Sep 22 0:00 0 S -Rule Iran 1996 only - Mar 21 0:00 1:00 D -Rule Iran 1996 only - Sep 21 0:00 0 S -Rule Iran 1997 1999 - Mar 22 0:00 1:00 D -Rule Iran 1997 1999 - Sep 22 0:00 0 S -Rule Iran 2000 only - Mar 21 0:00 1:00 D -Rule Iran 2000 only - Sep 21 0:00 0 S -Rule Iran 2001 2003 - Mar 22 0:00 1:00 D -Rule Iran 2001 2003 - Sep 22 0:00 0 S -Rule Iran 2004 only - Mar 21 0:00 1:00 D -Rule Iran 2004 only - Sep 21 0:00 0 S -Rule Iran 2005 only - Mar 22 0:00 1:00 D -Rule Iran 2005 only - Sep 22 0:00 0 S -Rule Iran 2008 only - Mar 21 0:00 1:00 D -Rule Iran 2008 only - Sep 21 0:00 0 S -Rule Iran 2009 2011 - Mar 22 0:00 1:00 D -Rule Iran 2009 2011 - Sep 22 0:00 0 S -Rule Iran 2012 only - Mar 21 0:00 1:00 D -Rule Iran 2012 only - Sep 21 0:00 0 S -Rule Iran 2013 2015 - Mar 22 0:00 1:00 D -Rule Iran 2013 2015 - Sep 22 0:00 0 S -Rule Iran 2016 only - Mar 21 0:00 1:00 D -Rule Iran 2016 only - Sep 21 0:00 0 S -Rule Iran 2017 2019 - Mar 22 0:00 1:00 D -Rule Iran 2017 2019 - Sep 22 0:00 0 S -Rule Iran 2020 only - Mar 21 0:00 1:00 D -Rule Iran 2020 only - Sep 21 0:00 0 S -Rule Iran 2021 2023 - Mar 22 0:00 1:00 D -Rule Iran 2021 2023 - Sep 22 0:00 0 S -Rule Iran 2024 only - Mar 21 0:00 1:00 D -Rule Iran 2024 only - Sep 21 0:00 0 S -Rule Iran 2025 2027 - Mar 22 0:00 1:00 D -Rule Iran 2025 2027 - Sep 22 0:00 0 S -Rule Iran 2028 2029 - Mar 21 0:00 1:00 D -Rule Iran 2028 2029 - Sep 21 0:00 0 S -Rule Iran 2030 2031 - Mar 22 0:00 1:00 D -Rule Iran 2030 2031 - Sep 22 0:00 0 S -Rule Iran 2032 2033 - Mar 21 0:00 1:00 D -Rule Iran 2032 2033 - Sep 21 0:00 0 S -Rule Iran 2034 2035 - Mar 22 0:00 1:00 D -Rule Iran 2034 2035 - Sep 22 0:00 0 S +Rule Iran 1978 1980 - Mar 21 0:00 1:00 - +Rule Iran 1978 only - Oct 21 0:00 0 - +Rule Iran 1979 only - Sep 19 0:00 0 - +Rule Iran 1980 only - Sep 23 0:00 0 - +Rule Iran 1991 only - May 3 0:00 1:00 - +Rule Iran 1992 1995 - Mar 22 0:00 1:00 - +Rule Iran 1991 1995 - Sep 22 0:00 0 - +Rule Iran 1996 only - Mar 21 0:00 1:00 - +Rule Iran 1996 only - Sep 21 0:00 0 - +Rule Iran 1997 1999 - Mar 22 0:00 1:00 - +Rule Iran 1997 1999 - Sep 22 0:00 0 - +Rule Iran 2000 only - Mar 21 0:00 1:00 - +Rule Iran 2000 only - Sep 21 0:00 0 - +Rule Iran 2001 2003 - Mar 22 0:00 1:00 - +Rule Iran 2001 2003 - Sep 22 0:00 0 - +Rule Iran 2004 only - Mar 21 0:00 1:00 - +Rule Iran 2004 only - Sep 21 0:00 0 - +Rule Iran 2005 only - Mar 22 0:00 1:00 - +Rule Iran 2005 only - Sep 22 0:00 0 - +Rule Iran 2008 only - Mar 21 0:00 1:00 - +Rule Iran 2008 only - Sep 21 0:00 0 - +Rule Iran 2009 2011 - Mar 22 0:00 1:00 - +Rule Iran 2009 2011 - Sep 22 0:00 0 - +Rule Iran 2012 only - Mar 21 0:00 1:00 - +Rule Iran 2012 only - Sep 21 0:00 0 - +Rule Iran 2013 2015 - Mar 22 0:00 1:00 - +Rule Iran 2013 2015 - Sep 22 0:00 0 - +Rule Iran 2016 only - Mar 21 0:00 1:00 - +Rule Iran 2016 only - Sep 21 0:00 0 - +Rule Iran 2017 2019 - Mar 22 0:00 1:00 - +Rule Iran 2017 2019 - Sep 22 0:00 0 - +Rule Iran 2020 only - Mar 21 0:00 1:00 - +Rule Iran 2020 only - Sep 21 0:00 0 - +Rule Iran 2021 2023 - Mar 22 0:00 1:00 - +Rule Iran 2021 2023 - Sep 22 0:00 0 - +Rule Iran 2024 only - Mar 21 0:00 1:00 - +Rule Iran 2024 only - Sep 21 0:00 0 - +Rule Iran 2025 2027 - Mar 22 0:00 1:00 - +Rule Iran 2025 2027 - Sep 22 0:00 0 - +Rule Iran 2028 2029 - Mar 21 0:00 1:00 - +Rule Iran 2028 2029 - Sep 21 0:00 0 - +Rule Iran 2030 2031 - Mar 22 0:00 1:00 - +Rule Iran 2030 2031 - Sep 22 0:00 0 - +Rule Iran 2032 2033 - Mar 21 0:00 1:00 - +Rule Iran 2032 2033 - Sep 21 0:00 0 - +Rule Iran 2034 2035 - Mar 22 0:00 1:00 - +Rule Iran 2034 2035 - Sep 22 0:00 0 - # # The following rules are approximations starting in the year 2038. # These are the best post-2037 approximations available, given the # restrictions of a single rule using a Gregorian-based data format. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 D -Rule Iran 2036 max - Sep 21 0:00 0 S +Rule Iran 2036 max - Mar 21 0:00 1:00 - +Rule Iran 2036 max - Sep 21 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1196,17 +1197,17 @@ Zone Asia/Tehran 3:25:44 - LMT 1916 # https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iraq 1982 only - May 1 0:00 1:00 D -Rule Iraq 1982 1984 - Oct 1 0:00 0 S -Rule Iraq 1983 only - Mar 31 0:00 1:00 D -Rule Iraq 1984 1985 - Apr 1 0:00 1:00 D -Rule Iraq 1985 1990 - Sep lastSun 1:00s 0 S -Rule Iraq 1986 1990 - Mar lastSun 1:00s 1:00 D +Rule Iraq 1982 only - May 1 0:00 1:00 - +Rule Iraq 1982 1984 - Oct 1 0:00 0 - +Rule Iraq 1983 only - Mar 31 0:00 1:00 - +Rule Iraq 1984 1985 - Apr 1 0:00 1:00 - +Rule Iraq 1985 1990 - Sep lastSun 1:00s 0 - +Rule Iraq 1986 1990 - Mar lastSun 1:00s 1:00 - # IATA SSIM (1991/1996) says Apr 1 12:01am UTC; guess the ':01' is a typo. # Shanks & Pottenger say Iraq did not observe DST 1992/1997; ignore this. # -Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 D -Rule Iraq 1991 2007 - Oct 1 3:00s 0 S +Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 - +Rule Iraq 1991 2007 - Oct 1 3:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 2:57:36 - BMT 1918 # Baghdad Mean Time? @@ -1478,8 +1479,7 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # From Hideyuki Suzuki (1998-11-09): # 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139 degrees 44' 40.90" E (9h 18m 58.727s), -# 35 degrees 39' 16.0" N. +# Observatory: 139° 44' 40.90" E (9h 18m 58.727s), 35° 39' 16.0" N. # This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' # edited by National Astronomical Observatory of Japan.... # JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). @@ -1487,10 +1487,10 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # From Hideyuki Suzuki (1998-11-16): # The ordinance No. 51 (1886) established "standard time" in Japan, -# which stands for the time on 135 degrees E. +# which stands for the time on 135° E. # In the ordinance No. 167 (1895), "standard time" was renamed to "central # standard time". And the same ordinance also established "western standard -# time", which stands for the time on 120 degrees E.... But "western standard +# time", which stands for the time on 120° E.... But "western standard # time" was abolished in the ordinance No. 529 (1937). In the ordinance No. # 167, there is no mention regarding for what place western standard time is # standard.... @@ -1903,9 +1903,9 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk # From 2005-08-12 our GMT-offset is +6, w/o any daylight saving. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Kyrgyz 1992 1996 - Apr Sun>=7 0:00s 1:00 S +Rule Kyrgyz 1992 1996 - Apr Sun>=7 0:00s 1:00 - Rule Kyrgyz 1992 1996 - Sep lastSun 0:00 0 - -Rule Kyrgyz 1997 2005 - Mar lastSun 2:30 1:00 S +Rule Kyrgyz 1997 2005 - Mar lastSun 2:30 1:00 - Rule Kyrgyz 1997 2004 - Oct lastSun 2:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 @@ -2037,7 +2037,7 @@ Zone Asia/Beirut 2:22:00 - LMT 1880 # Malaysia # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule NBorneo 1935 1941 - Sep 14 0:00 0:20 TS # one-Third Summer +Rule NBorneo 1935 1941 - Sep 14 0:00 0:20 - Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # # peninsular Malaysia @@ -2182,7 +2182,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé # http://zasag.mn/news/view/8969 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Mongol 1983 1984 - Apr 1 0:00 1:00 S +Rule Mongol 1983 1984 - Apr 1 0:00 1:00 - Rule Mongol 1983 only - Oct 1 0:00 0 - # Shanks & Pottenger and IATA SSIM say 1990s switches occurred at 00:00, # but McDow says the 2001 switches occurred at 02:00. Also, IATA SSIM @@ -2199,13 +2199,13 @@ Rule Mongol 1983 only - Oct 1 0:00 0 - # Mongolian Government meeting has concluded today to cancel daylight # saving time adoption in Mongolia. Source: http://zasag.mn/news/view/16192 -Rule Mongol 1985 1998 - Mar lastSun 0:00 1:00 S +Rule Mongol 1985 1998 - Mar lastSun 0:00 1:00 - Rule Mongol 1984 1998 - Sep lastSun 0:00 0 - # IATA SSIM (1999-09) says Mongolia no longer observes DST. -Rule Mongol 2001 only - Apr lastSat 2:00 1:00 S +Rule Mongol 2001 only - Apr lastSat 2:00 1:00 - Rule Mongol 2001 2006 - Sep lastSat 2:00 0 - -Rule Mongol 2002 2006 - Mar lastSat 2:00 1:00 S -Rule Mongol 2015 2016 - Mar lastSat 2:00 1:00 S +Rule Mongol 2002 2006 - Mar lastSat 2:00 1:00 - +Rule Mongol 2015 2016 - Mar lastSat 2:00 1:00 - Rule Mongol 2015 2016 - Sep lastSat 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -2639,9 +2639,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # [Google translation]: "The Council also decided to start daylight # saving in Palestine as of one o'clock on Saturday morning, # 2016-03-26, to provide the clock 60 minutes ahead." -# -# From Paul Eggert (2016-03-12): -# Predict spring transitions on March's last Saturday at 01:00 from now on. # From Sharef Mustafa (2016-10-19): # [T]he Palestinian cabinet decision (Mar 8th 2016) published on @@ -2658,6 +2655,16 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # https://www.timeanddate.com/time/change/gaza-strip/gaza # https://www.timeanddate.com/time/change/west-bank/hebron +# From Sharef Mustafa (2018-03-16): +# Palestine summer time will start on Mar 24th 2018 by advancing the +# clock by 60 minutes as per Palestinian cabinet decision published on +# the offical website, though the decree did not specify the exact +# time of the time shift. +# http://www.palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e7a42ab7-ee23-435a-b9c8-a4f7e81f3817 +# +# From Paul Eggert (2018-03-16): +# For 2016 on, predict spring transitions on March's fourth Saturday at 01:00. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -2687,7 +2694,7 @@ Rule Palestine 2012 only - Sep 21 1:00 0 - Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S -Rule Palestine 2016 max - Mar lastSat 1:00 1:00 S +Rule Palestine 2016 max - Mar Sat>=22 1:00 1:00 S Rule Palestine 2016 max - Oct lastSat 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -2737,11 +2744,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 S +Rule Phil 1936 only - Nov 1 0:00 1:00 - Rule Phil 1937 only - Feb 1 0:00 0 - -Rule Phil 1954 only - Apr 12 0:00 1:00 S +Rule Phil 1954 only - Apr 12 0:00 1:00 - Rule Phil 1954 only - Jul 1 0:00 0 - -Rule Phil 1978 only - Mar 22 0:00 1:00 S +Rule Phil 1978 only - Mar 22 0:00 1:00 - Rule Phil 1978 only - Sep 21 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 @@ -3097,9 +3104,9 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # and is the basis for the information below. # # The 1906 transition was effective July 1 and standardized Indochina to -# Phù Liá»…n Observatory, legally 104 deg. 17'17" east of Paris. +# Phù Liá»…n Observatory, legally 104° 17' 17" east of Paris. # It's unclear whether this meant legal Paris Mean Time (00:09:21) or -# the Paris Meridian (2 deg. 20'14.03" E); the former yields 07:06:30.1333... +# the Paris Meridian (2° 20' 14.03" E); the former yields 07:06:30.1333... # and the latter 07:06:29.333... so either way it rounds to 07:06:30, # which is used below even though the modern-day Phù Liá»…n Observatory # is closer to 07:06:31. Abbreviate Phù Liá»…n Mean Time as PLMT. Modified: releng/10.3/contrib/tzdata/australasia ============================================================================== --- releng/10.3/contrib/tzdata/australasia Wed Apr 4 05:37:52 2018 (r331985) +++ releng/10.3/contrib/tzdata/australasia Wed Apr 4 05:40:48 2018 (r331986) @@ -196,20 +196,20 @@ Zone Australia/Broken_Hill 9:25:48 - LMT 1895 Feb # Lord Howe Island # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule LH 1981 1984 - Oct lastSun 2:00 1:00 D -Rule LH 1982 1985 - Mar Sun>=1 2:00 0 S -Rule LH 1985 only - Oct lastSun 2:00 0:30 D -Rule LH 1986 1989 - Mar Sun>=15 2:00 0 S -Rule LH 1986 only - Oct 19 2:00 0:30 D -Rule LH 1987 1999 - Oct lastSun 2:00 0:30 D -Rule LH 1990 1995 - Mar Sun>=1 2:00 0 S -Rule LH 1996 2005 - Mar lastSun 2:00 0 S -Rule LH 2000 only - Aug lastSun 2:00 0:30 D -Rule LH 2001 2007 - Oct lastSun 2:00 0:30 D -Rule LH 2006 only - Apr Sun>=1 2:00 0 S -Rule LH 2007 only - Mar lastSun 2:00 0 S -Rule LH 2008 max - Apr Sun>=1 2:00 0 S -Rule LH 2008 max - Oct Sun>=1 2:00 0:30 D +Rule LH 1981 1984 - Oct lastSun 2:00 1:00 - +Rule LH 1982 1985 - Mar Sun>=1 2:00 0 - +Rule LH 1985 only - Oct lastSun 2:00 0:30 - +Rule LH 1986 1989 - Mar Sun>=15 2:00 0 - +Rule LH 1986 only - Oct 19 2:00 0:30 - +Rule LH 1987 1999 - Oct lastSun 2:00 0:30 - +Rule LH 1990 1995 - Mar Sun>=1 2:00 0 - +Rule LH 1996 2005 - Mar lastSun 2:00 0 - +Rule LH 2000 only - Aug lastSun 2:00 0:30 - +Rule LH 2001 2007 - Oct lastSun 2:00 0:30 - +Rule LH 2006 only - Apr Sun>=1 2:00 0 - +Rule LH 2007 only - Mar lastSun 2:00 0 - +Rule LH 2008 max - Apr Sun>=1 2:00 0 - +Rule LH 2008 max - Oct Sun>=1 2:00 0:30 - Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb 10:00 - AEST 1981 Mar 10:30 LH +1030/+1130 1985 Jul @@ -367,15 +367,15 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # practice than guessing no DST. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S +Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - -Rule Fiji 2009 only - Nov 29 2:00 1:00 S +Rule Fiji 2009 only - Nov 29 2:00 1:00 - Rule Fiji 2010 only - Mar lastSun 3:00 0 - -Rule Fiji 2010 2013 - Oct Sun>=21 2:00 1:00 S +Rule Fiji 2010 2013 - Oct Sun>=21 2:00 1:00 - Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - -Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S +Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 - Rule Fiji 2015 max - Jan Sun>=14 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva @@ -406,11 +406,11 @@ Zone Pacific/Tarawa 11:32:04 - LMT 1901 # Bairiki 12:00 - +12 Zone Pacific/Enderbury -11:24:20 - LMT 1901 -12:00 - -12 1979 Oct - -11:00 - -11 1995 + -11:00 - -11 1994 Dec 31 13:00 - +13 Zone Pacific/Kiritimati -10:29:20 - LMT 1901 -10:40 - -1040 1979 Oct - -10:00 - -10 1995 + -10:00 - -10 1994 Dec 31 14:00 - +14 # N Mariana Is @@ -447,9 +447,9 @@ Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe # New Caledonia # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule NC 1977 1978 - Dec Sun>=1 0:00 1:00 S +Rule NC 1977 1978 - Dec Sun>=1 0:00 1:00 - Rule NC 1978 1979 - Feb 27 0:00 0 - -Rule NC 1996 only - Dec 1 2:00s 1:00 S +Rule NC 1996 only - Dec 1 2:00s 1:00 - # Shanks & Pottenger say the following was at 2:00; go with IATA. Rule NC 1997 only - Mar 2 2:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -469,27 +469,28 @@ Rule NZ 1929 1933 - Mar Sun>=15 2:00 0 M Rule NZ 1934 1940 - Apr lastSun 2:00 0 M Rule NZ 1934 1940 - Sep lastSun 2:00 0:30 S Rule NZ 1946 only - Jan 1 0:00 0 S -# Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no -# convenient single notation for the date and time of this transition -# so we must duplicate the Rule lines. +# Since 1957 Chatham has been 45 minutes ahead of NZ, but until 2018a +# there was no documented single notation for the date and time of this +# transition. Duplicate the Rule lines for now, to give the 2018a change *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 05:43:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D0BEF91C80; Wed, 4 Apr 2018 05:43:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BB108AD92; Wed, 4 Apr 2018 05:43:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10FF17854; Wed, 4 Apr 2018 05:43:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w345h60i021375; Wed, 4 Apr 2018 05:43:06 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w345h3Mp021321; Wed, 4 Apr 2018 05:43:03 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201804040543.w345h3Mp021321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 4 Apr 2018 05:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r331987 - in releng: 10.3/sys/compat/svr4 10.3/sys/dev/drm 10.3/sys/dev/hpt27xx 10.3/sys/dev/hptnr 10.3/sys/dev/hptrr 10.3/sys/i386/ibcs2 10.4/sys/compat/svr4 10.4/sys/dev/drm 10.4/sys/... X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 10.3/sys/compat/svr4 10.3/sys/dev/drm 10.3/sys/dev/hpt27xx 10.3/sys/dev/hptnr 10.3/sys/dev/hptrr 10.3/sys/i386/ibcs2 10.4/sys/compat/svr4 10.4/sys/dev/drm 10.4/sys/dev/hpt27xx 10.4/sys/dev/... X-SVN-Commit-Revision: 331987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 05:43:06 -0000 Author: gordon Date: Wed Apr 4 05:43:03 2018 New Revision: 331987 URL: https://svnweb.freebsd.org/changeset/base/331987 Log: Fix multiple small kernel memory disclosures. [EN-18:04.mem] Reported by: Ilja van Sprundel Approved by: so Security: CVE-2018-6919 Security: FreeBSD-EN-18:04.mem Modified: releng/10.3/sys/compat/svr4/svr4_misc.c releng/10.3/sys/dev/drm/drm_bufs.c releng/10.3/sys/dev/drm/drm_irq.c releng/10.3/sys/dev/hpt27xx/hpt27xx_osm_bsd.c releng/10.3/sys/dev/hptnr/hptnr_osm_bsd.c releng/10.3/sys/dev/hptrr/hptrr_osm_bsd.c releng/10.3/sys/i386/ibcs2/ibcs2_misc.c releng/10.4/sys/compat/svr4/svr4_misc.c releng/10.4/sys/dev/drm/drm_bufs.c releng/10.4/sys/dev/drm/drm_irq.c releng/10.4/sys/dev/hpt27xx/hpt27xx_osm_bsd.c releng/10.4/sys/dev/hptnr/hptnr_osm_bsd.c releng/10.4/sys/dev/hptrr/hptrr_osm_bsd.c releng/10.4/sys/i386/ibcs2/ibcs2_misc.c releng/11.1/sys/compat/svr4/svr4_misc.c releng/11.1/sys/dev/drm/drm_bufs.c releng/11.1/sys/dev/drm/drm_irq.c releng/11.1/sys/dev/hpt27xx/hpt27xx_osm_bsd.c releng/11.1/sys/dev/hptnr/hptnr_osm_bsd.c releng/11.1/sys/dev/hptrr/hptrr_osm_bsd.c releng/11.1/sys/i386/ibcs2/ibcs2_misc.c Modified: releng/10.3/sys/compat/svr4/svr4_misc.c ============================================================================== --- releng/10.3/sys/compat/svr4/svr4_misc.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/compat/svr4/svr4_misc.c Wed Apr 4 05:43:03 2018 (r331987) @@ -260,6 +260,7 @@ svr4_sys_getdents64(td, uap) u_long *cookies = NULL, *cookiep; int ncookies; + memset(&svr4_dirent, 0, sizeof(svr4_dirent)); DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n", uap->fd, uap->nbytes)); error = getvnode(td->td_proc->p_fd, uap->fd, Modified: releng/10.3/sys/dev/drm/drm_bufs.c ============================================================================== --- releng/10.3/sys/dev/drm/drm_bufs.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/dev/drm/drm_bufs.c Wed Apr 4 05:43:03 2018 (r331987) @@ -935,6 +935,7 @@ int drm_infobufs(struct drm_device *dev, void *data, s if (dma->bufs[i].buf_count) { struct drm_buf_desc from; + memset(&from, 0, sizeof(from)); from.count = dma->bufs[i].buf_count; from.size = dma->bufs[i].buf_size; from.low_mark = dma->bufs[i].freelist.low_mark; Modified: releng/10.3/sys/dev/drm/drm_irq.c ============================================================================== --- releng/10.3/sys/dev/drm/drm_irq.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/dev/drm/drm_irq.c Wed Apr 4 05:43:03 2018 (r331987) @@ -357,7 +357,7 @@ int drm_modeset_ctl(struct drm_device *dev, void *data goto out; crtc = modeset->crtc; - if (crtc >= dev->num_crtcs) { + if (crtc < 0 || crtc >= dev->num_crtcs) { ret = EINVAL; goto out; } Modified: releng/10.3/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- releng/10.3/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1402,7 +1402,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1432,7 +1432,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/10.3/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- releng/10.3/sys/dev/hptnr/hptnr_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/dev/hptnr/hptnr_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1584,7 +1584,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1614,7 +1614,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/10.3/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- releng/10.3/sys/dev/hptrr/hptrr_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/dev/hptrr/hptrr_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1231,7 +1231,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1261,7 +1261,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/10.3/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- releng/10.3/sys/i386/ibcs2/ibcs2_misc.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.3/sys/i386/ibcs2/ibcs2_misc.c Wed Apr 4 05:43:03 2018 (r331987) @@ -352,6 +352,7 @@ ibcs2_getdents(td, uap) #define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) + memset(&idb, 0, sizeof(idb)); error = getvnode(td->td_proc->p_fd, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) Modified: releng/10.4/sys/compat/svr4/svr4_misc.c ============================================================================== --- releng/10.4/sys/compat/svr4/svr4_misc.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/compat/svr4/svr4_misc.c Wed Apr 4 05:43:03 2018 (r331987) @@ -260,6 +260,7 @@ svr4_sys_getdents64(td, uap) u_long *cookies = NULL, *cookiep; int ncookies; + memset(&svr4_dirent, 0, sizeof(svr4_dirent)); DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n", uap->fd, uap->nbytes)); error = getvnode(td->td_proc->p_fd, uap->fd, Modified: releng/10.4/sys/dev/drm/drm_bufs.c ============================================================================== --- releng/10.4/sys/dev/drm/drm_bufs.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/dev/drm/drm_bufs.c Wed Apr 4 05:43:03 2018 (r331987) @@ -935,6 +935,7 @@ int drm_infobufs(struct drm_device *dev, void *data, s if (dma->bufs[i].buf_count) { struct drm_buf_desc from; + memset(&from, 0, sizeof(from)); from.count = dma->bufs[i].buf_count; from.size = dma->bufs[i].buf_size; from.low_mark = dma->bufs[i].freelist.low_mark; Modified: releng/10.4/sys/dev/drm/drm_irq.c ============================================================================== --- releng/10.4/sys/dev/drm/drm_irq.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/dev/drm/drm_irq.c Wed Apr 4 05:43:03 2018 (r331987) @@ -357,7 +357,7 @@ int drm_modeset_ctl(struct drm_device *dev, void *data goto out; crtc = modeset->crtc; - if (crtc >= dev->num_crtcs) { + if (crtc < 0 || crtc >= dev->num_crtcs) { ret = EINVAL; goto out; } Modified: releng/10.4/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- releng/10.4/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1402,7 +1402,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1432,7 +1432,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/10.4/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- releng/10.4/sys/dev/hptnr/hptnr_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/dev/hptnr/hptnr_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1584,7 +1584,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1614,7 +1614,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/10.4/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- releng/10.4/sys/dev/hptrr/hptrr_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/dev/hptrr/hptrr_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1231,7 +1231,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1261,7 +1261,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/10.4/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- releng/10.4/sys/i386/ibcs2/ibcs2_misc.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/10.4/sys/i386/ibcs2/ibcs2_misc.c Wed Apr 4 05:43:03 2018 (r331987) @@ -352,6 +352,7 @@ ibcs2_getdents(td, uap) #define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) + memset(&idb, 0, sizeof(idb)); error = getvnode(td->td_proc->p_fd, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) Modified: releng/11.1/sys/compat/svr4/svr4_misc.c ============================================================================== --- releng/11.1/sys/compat/svr4/svr4_misc.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/compat/svr4/svr4_misc.c Wed Apr 4 05:43:03 2018 (r331987) @@ -259,6 +259,7 @@ svr4_sys_getdents64(td, uap) u_long *cookies = NULL, *cookiep; int ncookies; + memset(&svr4_dirent, 0, sizeof(svr4_dirent)); DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n", uap->fd, uap->nbytes)); error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); Modified: releng/11.1/sys/dev/drm/drm_bufs.c ============================================================================== --- releng/11.1/sys/dev/drm/drm_bufs.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/dev/drm/drm_bufs.c Wed Apr 4 05:43:03 2018 (r331987) @@ -935,6 +935,7 @@ int drm_infobufs(struct drm_device *dev, void *data, s if (dma->bufs[i].buf_count) { struct drm_buf_desc from; + memset(&from, 0, sizeof(from)); from.count = dma->bufs[i].buf_count; from.size = dma->bufs[i].buf_size; from.low_mark = dma->bufs[i].freelist.low_mark; Modified: releng/11.1/sys/dev/drm/drm_irq.c ============================================================================== --- releng/11.1/sys/dev/drm/drm_irq.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/dev/drm/drm_irq.c Wed Apr 4 05:43:03 2018 (r331987) @@ -351,7 +351,7 @@ int drm_modeset_ctl(struct drm_device *dev, void *data goto out; crtc = modeset->crtc; - if (crtc >= dev->num_crtcs) { + if (crtc < 0 || crtc >= dev->num_crtcs) { ret = EINVAL; goto out; } Modified: releng/11.1/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- releng/11.1/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1402,7 +1402,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1432,7 +1432,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/11.1/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- releng/11.1/sys/dev/hptnr/hptnr_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/dev/hptnr/hptnr_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1584,7 +1584,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1614,7 +1614,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/11.1/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- releng/11.1/sys/dev/hptrr/hptrr_osm_bsd.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/dev/hptrr/hptrr_osm_bsd.c Wed Apr 4 05:43:03 2018 (r331987) @@ -1231,7 +1231,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad { PHPT_IOCTL_PARAM piop=(PHPT_IOCTL_PARAM)data; IOCTL_ARG ioctl_args; - HPT_U32 bytesReturned; + HPT_U32 bytesReturned = 0; switch (cmd){ case HPT_DO_IOCONTROL: @@ -1261,7 +1261,7 @@ static int hpt_ioctl(struct cdev *dev, u_long cmd, cad } if (ioctl_args.nOutBufferSize) { - ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK); + ioctl_args.lpOutBuffer = malloc(ioctl_args.nOutBufferSize, M_DEVBUF, M_WAITOK | M_ZERO); if (!ioctl_args.lpOutBuffer) goto invalid; } Modified: releng/11.1/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- releng/11.1/sys/i386/ibcs2/ibcs2_misc.c Wed Apr 4 05:40:48 2018 (r331986) +++ releng/11.1/sys/i386/ibcs2/ibcs2_misc.c Wed Apr 4 05:43:03 2018 (r331987) @@ -342,6 +342,7 @@ ibcs2_getdents(td, uap) #define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) + memset(&idb, 0, sizeof(idb)); error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); From owner-svn-src-all@freebsd.org Wed Apr 4 06:11:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E8F9F92FFC; Wed, 4 Apr 2018 06:11:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 303B48BCDC; Wed, 4 Apr 2018 06:11:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B1AB7BCA; Wed, 4 Apr 2018 06:11:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w346B65O054418; Wed, 4 Apr 2018 06:11:07 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w346B6Xq054410; Wed, 4 Apr 2018 06:11:06 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804040611.w346B6Xq054410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 06:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331988 - in stable/11/sys/arm: arm include X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in stable/11/sys/arm: arm include X-SVN-Commit-Revision: 331988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 06:11:07 -0000 Author: mmel Date: Wed Apr 4 06:11:05 2018 New Revision: 331988 URL: https://svnweb.freebsd.org/changeset/base/331988 Log: MFC r328467: Implement mitigation for Spectre version 2 attacks on ARMv7. Modified: stable/11/sys/arm/arm/cpuinfo.c stable/11/sys/arm/arm/genassym.c stable/11/sys/arm/arm/machdep.c stable/11/sys/arm/arm/mp_machdep.c stable/11/sys/arm/arm/swtch-v6.S stable/11/sys/arm/arm/trap-v6.c stable/11/sys/arm/include/cpuinfo.h stable/11/sys/arm/include/pcpu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/cpuinfo.c ============================================================================== --- stable/11/sys/arm/arm/cpuinfo.c Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/arm/cpuinfo.c Wed Apr 4 06:11:05 2018 (r331988) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -40,6 +42,9 @@ __FBSDID("$FreeBSD$"); #if __ARM_ARCH >= 6 void reinit_mmu(uint32_t ttb, uint32_t aux_clr, uint32_t aux_set); + +int disable_bp_hardening; +int spectre_v2_safe = 1; #endif struct cpuinfo cpuinfo = @@ -253,6 +258,7 @@ cpuinfo_get_actlr_modifier(uint32_t *actlr_mask, uint3 if (cpuinfo.implementer == CPU_IMPLEMENTER_ARM) { switch (cpuinfo.part_number) { + case CPU_ARCH_CORTEX_A75: case CPU_ARCH_CORTEX_A73: case CPU_ARCH_CORTEX_A72: case CPU_ARCH_CORTEX_A57: @@ -335,5 +341,198 @@ cpuinfo_reinit_mmu(uint32_t ttb) actlr_set |= cpu_quirks_actlr_set; reinit_mmu(ttb, actlr_mask, actlr_set); } + +static bool +modify_actlr(uint32_t clear, uint32_t set) +{ + uint32_t reg, newreg; + + reg = cp15_actlr_get(); + newreg = reg; + newreg &= ~clear; + newreg |= set; + if (reg == newreg) + return (true); + cp15_actlr_set(newreg); + + reg = cp15_actlr_get(); + if (reg == newreg) + return (true); + return (false); +} + +/* Apply/restore BP hardening on current core. */ +static int +apply_bp_hardening(bool enable, int kind, bool actrl, uint32_t set_mask) +{ + if (enable) { + if (actrl && !modify_actlr(0, set_mask)) + return (-1); + PCPU_SET(bp_harden_kind, kind); + } else { + PCPU_SET(bp_harden_kind, PCPU_BP_HARDEN_KIND_NONE); + if (actrl) + modify_actlr(~0, PCPU_GET(original_actlr)); + spectre_v2_safe = 0; + } + return (0); +} + +static void +handle_bp_hardening(bool enable) +{ + int kind; + char *kind_str; + + kind = PCPU_BP_HARDEN_KIND_NONE; + /* + * Note: Access to ACTRL is locked to secure world on most boards. + * This means that full BP hardening depends on updated u-boot/firmware + * or is impossible at all (if secure monitor is in on-chip ROM). + */ + if (cpuinfo.implementer == CPU_IMPLEMENTER_ARM) { + switch (cpuinfo.part_number) { + case CPU_ARCH_CORTEX_A8: + /* + * For Cortex-A8, IBE bit must be set otherwise + * BPIALL is effectively NOP. + * Unfortunately, Cortex-A is also affected by + * ARM erratum 687067 which causes non-working + * BPIALL if IBE bit is set and 'Instruction L1 System + * Array Debug Register 0' is not 0. + * This register is not reset on power-up and is + * accessible only from secure world, so we cannot do + * nothing (nor detect) to fix this issue. + * I afraid that on chip ROM based secure monitor on + * AM335x (BeagleBone) doesn't reset this debug + * register. + */ + kind = PCPU_BP_HARDEN_KIND_BPIALL; + if (apply_bp_hardening(enable, kind, true, 1 << 6) != 0) + goto actlr_err; + break; + break; + + case CPU_ARCH_CORTEX_A9: + case CPU_ARCH_CORTEX_A12: + case CPU_ARCH_CORTEX_A17: + case CPU_ARCH_CORTEX_A57: + case CPU_ARCH_CORTEX_A72: + case CPU_ARCH_CORTEX_A73: + case CPU_ARCH_CORTEX_A75: + kind = PCPU_BP_HARDEN_KIND_BPIALL; + if (apply_bp_hardening(enable, kind, false, 0) != 0) + goto actlr_err; + break; + + case CPU_ARCH_CORTEX_A15: + /* + * For Cortex-A15, set 'Enable invalidates of BTB' bit. + * Despite this, the BPIALL is still effectively NOP, + * but with this bit set, the ICIALLU also flushes + * branch predictor as side effect. + */ + kind = PCPU_BP_HARDEN_KIND_ICIALLU; + if (apply_bp_hardening(enable, kind, true, 1 << 0) != 0) + goto actlr_err; + break; + + default: + break; + } + } else if (cpuinfo.implementer == CPU_IMPLEMENTER_QCOM) { + printf("!!!WARNING!!! CPU(%d) is vulnerable to speculative " + "branch attacks. !!!\n" + "Qualcomm Krait cores are known (or believed) to be " + "vulnerable to \n" + "speculative branch attacks, no mitigation exists yet.\n", + PCPU_GET(cpuid)); + goto unkonown_mitigation; + } else { + goto unkonown_mitigation; + } + + if (bootverbose) { + switch (kind) { + case PCPU_BP_HARDEN_KIND_NONE: + kind_str = "not necessary"; + break; + case PCPU_BP_HARDEN_KIND_BPIALL: + kind_str = "BPIALL"; + break; + case PCPU_BP_HARDEN_KIND_ICIALLU: + kind_str = "ICIALLU"; + break; + default: + panic("Unknown BP hardering kind (%d).", kind); + } + printf("CPU(%d) applied BP hardening: %s\n", PCPU_GET(cpuid), + kind_str); + } + + return; + +unkonown_mitigation: + PCPU_SET(bp_harden_kind, PCPU_BP_HARDEN_KIND_NONE); + spectre_v2_safe = 0; + return; + +actlr_err: + PCPU_SET(bp_harden_kind, PCPU_BP_HARDEN_KIND_NONE); + spectre_v2_safe = 0; + printf("!!!WARNING!!! CPU(%d) is vulnerable to speculative branch " + "attacks. !!!\n" + "We cannot enable required bit(s) in ACTRL register\n" + "because it's locked by secure monitor and/or firmware.\n", + PCPU_GET(cpuid)); +} + +void +cpuinfo_init_bp_hardening(void) +{ + + /* + * Store original unmodified ACTRL, so we can restore it when + * BP hardening is disabled by sysctl. + */ + PCPU_SET(original_actlr, cp15_actlr_get()); + handle_bp_hardening(true); +} + +static void +bp_hardening_action(void *arg) +{ + + handle_bp_hardening(disable_bp_hardening == 0); +} + +static int +sysctl_disable_bp_hardening(SYSCTL_HANDLER_ARGS) +{ + int rv; + + rv = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); + + if (!rv && req->newptr) { + spectre_v2_safe = 1; + dmb(); +#ifdef SMP + smp_rendezvous_cpus(all_cpus, smp_no_rendezvous_barrier, + bp_hardening_action, NULL, NULL); +#else + bp_hardening_action(NULL); +#endif + } + + return (rv); +} + +SYSCTL_PROC(_machdep, OID_AUTO, disable_bp_hardening, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + &disable_bp_hardening, 0, sysctl_disable_bp_hardening, "I", + "Disable BP hardening mitigation."); + +SYSCTL_INT(_machdep, OID_AUTO, spectre_v2_safe, CTLFLAG_RD, + &spectre_v2_safe, 0, "System is safe to Spectre Version 2 attacks"); #endif /* __ARM_ARCH >= 6 */ Modified: stable/11/sys/arm/arm/genassym.c ============================================================================== --- stable/11/sys/arm/arm/genassym.c Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/arm/genassym.c Wed Apr 4 06:11:05 2018 (r331988) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,10 @@ ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate) #if __ARM_ARCH >= 6 ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); +ASSYM(PC_BP_HARDEN_KIND, offsetof(struct pcpu, pc_bp_harden_kind)); +ASSYM(PCPU_BP_HARDEN_KIND_NONE, PCPU_BP_HARDEN_KIND_NONE); +ASSYM(PCPU_BP_HARDEN_KIND_BPIALL, PCPU_BP_HARDEN_KIND_BPIALL); +ASSYM(PCPU_BP_HARDEN_KIND_ICIALLU, PCPU_BP_HARDEN_KIND_ICIALLU); #endif ASSYM(PAGE_SIZE, PAGE_SIZE); Modified: stable/11/sys/arm/arm/machdep.c ============================================================================== --- stable/11/sys/arm/arm/machdep.c Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/arm/machdep.c Wed Apr 4 06:11:05 2018 (r331988) @@ -1260,6 +1260,8 @@ initarm(struct arm_boot_params *abp) msgbufinit(msgbufp, msgbufsize); dbg_monitor_init(); arm_kdb_init(); + /* Apply possible BP hardening. */ + cpuinfo_init_bp_hardening(); return ((void *)STACKALIGN(thread0.td_pcb)); } Modified: stable/11/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/11/sys/arm/arm/mp_machdep.c Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/arm/mp_machdep.c Wed Apr 4 06:11:05 2018 (r331988) @@ -200,6 +200,9 @@ init_secondary(int cpu) /* Configure the interrupt controller */ intr_pic_init_secondary(); + /* Apply possible BP hardening */ + cpuinfo_init_bp_hardening(); + mtx_lock_spin(&ap_boot_mtx); atomic_add_rel_32(&smp_cpus, 1); Modified: stable/11/sys/arm/arm/swtch-v6.S ============================================================================== --- stable/11/sys/arm/arm/swtch-v6.S Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/arm/swtch-v6.S Wed Apr 4 06:11:05 2018 (r331988) @@ -145,7 +145,16 @@ ENTRY(cpu_context_switch) * predictors and Requirements for branch predictor maintenance * operations sections. */ - mcr CP15_BPIALL /* flush entire Branch Target Cache */ + /* + * Additionally, to mitigate mistrained branch predictor attack + * we must invalidate it on affected CPUs. Unfortunately, BPIALL + * is effectively NOP on Cortex-A15 so it needs special treatment. + */ + ldr r0, [r8, #PC_BP_HARDEN_KIND] + cmp r0, #PCPU_BP_HARDEN_KIND_ICIALLU + mcrne CP15_BPIALL /* Flush entire Branch Target Cache */ + mcreq CP15_ICIALLU /* This is the only way how to flush */ + /* Branch Target Cache on Cortex-A15. */ DSB mov pc, lr END(cpu_context_switch) Modified: stable/11/sys/arm/arm/trap-v6.c ============================================================================== --- stable/11/sys/arm/arm/trap-v6.c Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/arm/trap-v6.c Wed Apr 4 06:11:05 2018 (r331988) @@ -287,6 +287,7 @@ abort_handler(struct trapframe *tf, int prefetch) struct vmspace *vm; vm_prot_t ftype; bool usermode; + int bp_harden; #ifdef INVARIANTS void *onfault; #endif @@ -303,6 +304,20 @@ abort_handler(struct trapframe *tf, int prefetch) idx = FSR_TO_FAULT(fsr); usermode = TRAPF_USERMODE(tf); /* Abort came from user mode? */ + + /* + * Apply BP hardening by flushing the branch prediction cache + * for prefaults on kernel addresses. + */ + if (__predict_false(prefetch && far > VM_MAXUSER_ADDRESS && + (idx == FAULT_TRAN_L2 || idx == FAULT_PERM_L2))) { + bp_harden = PCPU_GET(bp_harden_kind); + if (bp_harden == PCPU_BP_HARDEN_KIND_BPIALL) + _CP15_BPIALL(); + else if (bp_harden == PCPU_BP_HARDEN_KIND_ICIALLU) + _CP15_ICIALLU(); + } + if (usermode) td->td_frame = tf; Modified: stable/11/sys/arm/include/cpuinfo.h ============================================================================== --- stable/11/sys/arm/include/cpuinfo.h Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/include/cpuinfo.h Wed Apr 4 06:11:05 2018 (r331988) @@ -49,6 +49,7 @@ #define CPU_ARCH_CORTEX_A57 0xD07 #define CPU_ARCH_CORTEX_A72 0xD08 #define CPU_ARCH_CORTEX_A73 0xD09 +#define CPU_ARCH_CORTEX_A75 0xD0A /* QCOM */ @@ -122,6 +123,7 @@ extern struct cpuinfo cpuinfo; void cpuinfo_init(void); #if __ARM_ARCH >= 6 +void cpuinfo_init_bp_hardening(void); void cpuinfo_reinit_mmu(uint32_t ttb); #endif #endif /* _MACHINE_CPUINFO_H_ */ Modified: stable/11/sys/arm/include/pcpu.h ============================================================================== --- stable/11/sys/arm/include/pcpu.h Wed Apr 4 05:43:03 2018 (r331987) +++ stable/11/sys/arm/include/pcpu.h Wed Apr 4 06:11:05 2018 (r331988) @@ -42,6 +42,10 @@ struct vmspace; #endif /* _KERNEL */ #if __ARM_ARCH >= 6 +/* Branch predictor hardening method */ +#define PCPU_BP_HARDEN_KIND_NONE 0 +#define PCPU_BP_HARDEN_KIND_BPIALL 1 +#define PCPU_BP_HARDEN_KIND_ICIALLU 2 #define PCPU_MD_FIELDS \ unsigned int pc_vfpsid; \ @@ -57,7 +61,9 @@ struct vmspace; void *pc_qmap_pte2p; \ unsigned int pc_dbreg[32]; \ int pc_dbreg_cmd; \ - char __pad[19] + int pc_bp_harden_kind; \ + uint32_t pc_original_actlr; \ + char __pad[11] #else #define PCPU_MD_FIELDS \ char __pad[157] From owner-svn-src-all@freebsd.org Wed Apr 4 06:30:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E332CF940F6; Wed, 4 Apr 2018 06:30:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 954CF8CA1D; Wed, 4 Apr 2018 06:30:06 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8DA5E17B38; Wed, 4 Apr 2018 06:30:06 +0000 (UTC) Date: Wed, 4 Apr 2018 06:30:06 +0000 From: Alexey Dokuchaev To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331988 - in stable/11/sys/arm: arm include Message-ID: <20180404063006.GA11981@FreeBSD.org> References: <201804040611.w346B6Xq054410@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804040611.w346B6Xq054410@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 06:30:07 -0000 On Wed, Apr 04, 2018 at 06:11:06AM +0000, Michal Meloun wrote: > New Revision: 331988 > URL: https://svnweb.freebsd.org/changeset/base/331988 > > Log: > MFC r328467: > > Implement mitigation for Spectre version 2 attacks on ARMv7. > > + case CPU_ARCH_CORTEX_A8: > + /* > + * For Cortex-A8, IBE bit must be set otherwise > + * BPIALL is effectively NOP. > + * Unfortunately, Cortex-A is also affected by > + * ARM erratum 687067 which causes non-working > + * BPIALL if IBE bit is set and 'Instruction L1 System > + * Array Debug Register 0' is not 0. > + * This register is not reset on power-up and is > + * accessible only from secure world, so we cannot do > + * nothing (nor detect) to fix this issue. > + * I afraid that on chip ROM based secure monitor on "I'm afraid", perhaps? > + printf("!!!WARNING!!! CPU(%d) is vulnerable to speculative " > + "branch attacks. !!!\n" > + "Qualcomm Krait cores are known (or believed) to be " > + "vulnerable to \n" > + "speculative branch attacks, no mitigation exists yet.\n", > + PCPU_GET(cpuid)); > + goto unkonown_mitigation; > + } else { > + goto unkonown_mitigation; unkonown? :-) ./danfe From owner-svn-src-all@freebsd.org Wed Apr 4 06:44:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4124F959E4; Wed, 4 Apr 2018 06:44:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 527D58E0E6; Wed, 4 Apr 2018 06:44:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D78D10225; Wed, 4 Apr 2018 06:44:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w346iPPe096284; Wed, 4 Apr 2018 06:44:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w346iP57096283; Wed, 4 Apr 2018 06:44:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804040644.w346iP57096283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 4 Apr 2018 06:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331989 - head/sys/dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/regulator X-SVN-Commit-Revision: 331989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 06:44:26 -0000 Author: manu Date: Wed Apr 4 06:44:24 2018 New Revision: 331989 URL: https://svnweb.freebsd.org/changeset/base/331989 Log: regulator: Disable unused regulator bootloaders such as u-boot might enable regulators, or simply regulators could be enabled by default by the PMIC, even if we don't have a driver for the device or subsystem. Disable unused regulators just before going to userland. A tunable hw.regulator.disable_unused is added to not disable them in case this causes problems on some board but the default behavior is to disable everything unused. I prefer to break thinks now and fix them rather than never switch to the case were we disable regulators. Tested on : Pine64-LTS (an idle board goes from ~0.33A to ~0.27A) Tested on : BananaPi M2 Differential Revision: https://reviews.freebsd.org/D14781 Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Wed Apr 4 06:11:05 2018 (r331988) +++ head/sys/dev/extres/regulator/regulator.c Wed Apr 4 06:44:24 2018 (r331989) @@ -71,6 +71,7 @@ static int regnode_method_status(struct regnode *regno static int regnode_method_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay); static int regnode_method_get_voltage(struct regnode *regnode, int *uvolt); +static void regulator_shutdown(void *dummy); /* * Regulator controller methods. @@ -150,6 +151,36 @@ SX_SYSINIT(regulator_topology, ®node_topo_lock, "Re #define REGNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) #define REGNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) #define REGNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +SYSINIT(regulator_shutdown, SI_SUB_LAST, SI_ORDER_ANY, regulator_shutdown, + NULL); + +/* + * Disable unused regulator + * We run this function at SI_SUB_LAST which mean that every driver that needs + * regulator should have already enable them. + * All the remaining regulators should be those left enabled by the bootloader + * or enable by default by the PMIC. + */ +static void +regulator_shutdown(void *dummy) +{ + struct regnode *entry; + int disable = 1; + + REG_TOPO_SLOCK(); + TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable); + TAILQ_FOREACH(entry, ®node_list, reglist_link) { + if (entry->enable_cnt == 0 && + entry->std_param.always_on == 0 && disable) { + if (bootverbose) + printf("regulator: shuting down %s\n", + entry->name); + regnode_stop(entry, 0); + } + } + REG_TOPO_UNLOCK(); +} /* * sysctl handler From owner-svn-src-all@freebsd.org Wed Apr 4 08:37:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1609F9E13E; Wed, 4 Apr 2018 08:37:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66DF46C120; Wed, 4 Apr 2018 08:37:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 617EA11485; Wed, 4 Apr 2018 08:37:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w348bOOS032507; Wed, 4 Apr 2018 08:37:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w348bOeZ032506; Wed, 4 Apr 2018 08:37:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804040837.w348bOeZ032506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Apr 2018 08:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331993 - stable/11/sys/dev/usb/input X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/input X-SVN-Commit-Revision: 331993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 08:37:24 -0000 Author: hselasky Date: Wed Apr 4 08:37:24 2018 New Revision: 331993 URL: https://svnweb.freebsd.org/changeset/base/331993 Log: MFC r331642: Add support for right and middle click with integrated button to WSP USB trackpad driver. Submitted by: James Wright PR: 226961 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/input/wsp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/input/wsp.c ============================================================================== --- stable/11/sys/dev/usb/input/wsp.c Wed Apr 4 08:09:25 2018 (r331992) +++ stable/11/sys/dev/usb/input/wsp.c Wed Apr 4 08:37:24 2018 (r331993) @@ -927,7 +927,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t e sc->sc_status.button = 0; if (ibt != 0) { - sc->sc_status.button |= MOUSE_BUTTON1DOWN; + if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 2) + sc->sc_status.button |= MOUSE_BUTTON3DOWN; + else if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 3) + sc->sc_status.button |= MOUSE_BUTTON2DOWN; + else + sc->sc_status.button |= MOUSE_BUTTON1DOWN; sc->ibtn = 1; } sc->intr_count++; From owner-svn-src-all@freebsd.org Wed Apr 4 08:40:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5036BF9E347; Wed, 4 Apr 2018 08:40:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB8366C3C2; Wed, 4 Apr 2018 08:39:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDCC711489; Wed, 4 Apr 2018 08:39:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w348dxjG034565; Wed, 4 Apr 2018 08:39:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w348dxt1034562; Wed, 4 Apr 2018 08:39:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804040839.w348dxt1034562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Apr 2018 08:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331994 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 331994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 08:40:00 -0000 Author: hselasky Date: Wed Apr 4 08:39:59 2018 New Revision: 331994 URL: https://svnweb.freebsd.org/changeset/base/331994 Log: MFC r331694: Swap two instances of regular macros with function macros in the LinuxKPI, to narrow down the substitution scope. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Wed Apr 4 08:37:24 2018 (r331993) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Wed Apr 4 08:39:59 2018 (r331994) @@ -538,7 +538,9 @@ struct msix_entry { * NB: define added to prevent this definition of pci_enable_msix from * clashing with the native FreeBSD version. */ -#define pci_enable_msix linux_pci_enable_msix +#define pci_enable_msix(...) \ + linux_pci_enable_msix(__VA_ARGS__) + static inline int pci_enable_msix(struct pci_dev *pdev, struct msix_entry *entries, int nreq) { @@ -572,7 +574,9 @@ pci_enable_msix(struct pci_dev *pdev, struct msix_entr return (0); } -#define pci_enable_msix_range linux_pci_enable_msix_range +#define pci_enable_msix_range(...) \ + linux_pci_enable_msix_range(__VA_ARGS__) + static inline int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int minvec, int maxvec) From owner-svn-src-all@freebsd.org Wed Apr 4 08:40:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99025F9E5D2; Wed, 4 Apr 2018 08:40:51 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3706C686; Wed, 4 Apr 2018 08:40:51 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4705A114A8; Wed, 4 Apr 2018 08:40:51 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w348epQn035139; Wed, 4 Apr 2018 08:40:51 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w348en4Y035106; Wed, 4 Apr 2018 08:40:49 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804040840.w348en4Y035106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 08:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331995 - in head/sys/arm: conf mv mv/armada38x mv/armadaxp X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm: conf mv mv/armada38x mv/armadaxp X-SVN-Commit-Revision: 331995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 08:40:52 -0000 Author: mw Date: Wed Apr 4 08:40:49 2018 New Revision: 331995 URL: https://svnweb.freebsd.org/changeset/base/331995 Log: Use PLATFORM for initializing Marvell ArmadaXP and Armada38X Spliting armv5 and armv7 machdep is necessary for adding Armada38X and ArmadaXP to GENERIC config. PLATFORM framework checks SOC type in FDT and will select proper initialization function implementation during runtime. Pointers to SoC specific implementation are stored in array of platform_method_t and provided to framework by FDT_PLATFORM_DEF macro. PLATFORM framework supports also reset function. To simplify implementation cpu_reset is moved from mv_common to armv5 and armv7 machdep. Armada38X and ArmadaXP share now common list of files, so resolve all dependencies as well. Submitted by: Rafal Kozik Marcin Wojtas Reviewed by: mw Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14744 Added: head/sys/arm/mv/armada38x/armada38x_pl310.h (contents, props changed) head/sys/arm/mv/armv5_machdep.c - copied, changed from r331994, head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mv_armv7_machdep.c (contents, props changed) Deleted: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/conf/ARMADAXP head/sys/arm/mv/armada38x/armada38x_mp.c head/sys/arm/mv/armada38x/armada38x_pl310.c head/sys/arm/mv/armada38x/std.armada38x head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/mv/armadaxp/std.mv78x60 head/sys/arm/mv/files.arm7 head/sys/arm/mv/files.mv head/sys/arm/mv/mv_common.c head/sys/arm/mv/std-pj4b.mv Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/conf/ARMADA38X Wed Apr 4 08:40:49 2018 (r331995) @@ -48,9 +48,6 @@ device neta # PCI device pci -# RTC -device mv_rtc - # Interrupt controllers device gic options INTRNG @@ -95,6 +92,8 @@ device cryptodev # L2 Cache device pl310 + +options PLATFORM # FDT options FDT Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/conf/ARMADAXP Wed Apr 4 08:40:49 2018 (r331995) @@ -90,3 +90,5 @@ options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=db78460.dts options INTRNG + +options PLATFORM Modified: head/sys/arm/mv/armada38x/armada38x_mp.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_mp.c Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/armada38x/armada38x_mp.c Wed Apr 4 08:40:49 2018 (r331995) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -43,9 +44,11 @@ __FBSDID("$FreeBSD$"); #include "pmsu.h" -int cpu_reset_deassert(void); +static int cpu_reset_deassert(void); +void mv_a38x_platform_mp_setmaxid(platform_t plate); +void mv_a38x_platform_mp_start_ap(platform_t plate); -int +static int cpu_reset_deassert(void) { bus_space_handle_t vaddr; @@ -122,7 +125,7 @@ platform_cnt_cpus(void) } void -platform_mp_setmaxid(void) +mv_a38x_platform_mp_setmaxid(platform_t plate) { /* Armada38x family supports maximum 2 cores */ @@ -131,7 +134,7 @@ platform_mp_setmaxid(void) } void -platform_mp_start_ap(void) +mv_a38x_platform_mp_start_ap(platform_t plate) { int rv; Modified: head/sys/arm/mv/armada38x/armada38x_pl310.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x_pl310.c Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/armada38x/armada38x_pl310.c Wed Apr 4 08:40:49 2018 (r331995) @@ -40,9 +40,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include "armada38x_pl310.h" +#include "platform_pl310_if.h" + void -platform_pl310_init(struct pl310_softc *sc) +mv_a38x_platform_pl310_init(platform_t plat, struct pl310_softc *sc) { uint32_t reg; @@ -63,14 +68,14 @@ platform_pl310_init(struct pl310_softc *sc) } void -platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) +mv_a38x_platform_pl310_write_ctrl(platform_t plat, 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) +mv_a38x_platform_pl310_write_debug(platform_t plat, struct pl310_softc *sc, uint32_t val) { pl310_write4(sc, PL310_DEBUG_CTRL, val); Added: head/sys/arm/mv/armada38x/armada38x_pl310.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/armada38x/armada38x_pl310.h Wed Apr 4 08:40:49 2018 (r331995) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Semihalf. + * Copyright (c) 2017 Stormshield. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef ARMADA38X_PL310_H +#define ARMADA38X_PL310_H +#include + +void mv_a38x_platform_pl310_init(platform_t plat, struct pl310_softc *sc); +void mv_a38x_platform_pl310_write_ctrl(platform_t plat, struct pl310_softc *sc, uint32_t val); +void mv_a38x_platform_pl310_write_debug(platform_t plat, struct pl310_softc *sc, uint32_t val); + +#endif Modified: head/sys/arm/mv/armada38x/std.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/std.armada38x Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/armada38x/std.armada38x Wed Apr 4 08:40:49 2018 (r331995) @@ -1,6 +1,4 @@ # $FreeBSD$ -files "../mv/armada38x/files.armada38x" -files "../mv/files.mv" files "../mv/files.arm7" cpu CPU_CORTEXA machine arm armv7 Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Wed Apr 4 08:40:49 2018 (r331995) @@ -49,6 +49,8 @@ #include +#include + #define MV_AXP_CPU_DIVCLK_BASE (MV_BASE + 0x18700) #define CPU_DIVCLK_CTRL0 0x00 #define CPU_DIVCLK_CTRL2_RATIO_FULL0 0x08 @@ -66,6 +68,9 @@ void armadaxp_init_coher_fabric(void); int platform_get_ncpus(void); +void mv_axp_platform_mp_setmaxid(platform_t plat); +void mv_axp_platform_mp_start_ap(platform_t plat); + /* Coherency Fabric registers */ static uint32_t read_cpu_clkdiv(uint32_t reg) @@ -82,7 +87,7 @@ write_cpu_clkdiv(uint32_t reg, uint32_t val) } void -platform_mp_setmaxid(void) +mv_axp_platform_mp_setmaxid(platform_t plat) { mp_ncpus = platform_get_ncpus(); @@ -94,7 +99,7 @@ void mptramp_end(void); extern vm_offset_t mptramp_pmu_boot; void -platform_mp_start_ap(void) +mv_axp_platform_mp_start_ap(platform_t plat) { uint32_t reg, *src, *dst, cpu_num, div_val, cputype; vm_offset_t pmu_boot_off; Modified: head/sys/arm/mv/armadaxp/std.mv78x60 ============================================================================== --- head/sys/arm/mv/armadaxp/std.mv78x60 Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/armadaxp/std.mv78x60 Wed Apr 4 08:40:49 2018 (r331995) @@ -2,4 +2,3 @@ include "../mv/std-pj4b.mv" include "../mv/armadaxp/std.armadaxp" -files "../mv/armadaxp/files.armadaxp" Copied and modified: head/sys/arm/mv/armv5_machdep.c (from r331994, head/sys/arm/mv/mv_machdep.c) ============================================================================== --- head/sys/arm/mv/mv_machdep.c Wed Apr 4 08:39:59 2018 (r331994, copy source) +++ head/sys/arm/mv/armv5_machdep.c Wed Apr 4 08:40:49 2018 (r331995) @@ -61,12 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if __ARM_ARCH < 6 #include -#else -#include -#include -#endif #include /* XXX */ #include /* XXX eventually this should be eliminated */ @@ -76,16 +71,7 @@ __FBSDID("$FreeBSD$"); #include static int platform_mpp_init(void); -#if defined(SOC_MV_ARMADAXP) -void armadaxp_init_coher_fabric(void); -void armadaxp_l2_init(void); -#endif -#if defined(SOC_MV_ARMADA38X) -int armada38x_win_set_iosync_barrier(void); -int armada38x_scu_enable(void); -int armada38x_open_bootrom_win(void); -int armada38x_mbus_optimization(void); -#endif +void cpu_reset(void); #define MPP_PIN_MAX 68 #define MPP_PIN_CELLS 2 @@ -291,46 +277,8 @@ platform_late_init(void) if (soc_decode_win() != 0) printf("WARNING: could not re-initialise decode windows! " "Running with existing settings...\n"); -#if defined(SOC_MV_ARMADAXP) -#if !defined(SMP) - /* For SMP case it should be initialized after APs are booted */ - armadaxp_init_coher_fabric(); -#endif - armadaxp_l2_init(); -#endif - -#if defined(SOC_MV_ARMADA38X) - /* Configure timers' base frequency */ - arm_tmr_change_frequency(get_cpu_freq() / 2); - - /* - * Workaround for Marvell Armada38X family HW issue - * between Cortex-A9 CPUs and on-chip devices that may - * cause hang on heavy load. - * To avoid that, map all registers including PCIe IO - * as strongly ordered instead of device memory. - */ - pmap_remap_vm_attr(VM_MEMATTR_DEVICE, VM_MEMATTR_SO); - - /* Set IO Sync Barrier bit for all Mbus devices */ - if (armada38x_win_set_iosync_barrier() != 0) - printf("WARNING: could not map CPU Subsystem registers\n"); - if (armada38x_mbus_optimization() != 0) - printf("WARNING: could not enable mbus optimization\n"); - if (armada38x_scu_enable() != 0) - printf("WARNING: could not enable SCU\n"); -#ifdef SMP - /* Open window to bootROM memory - needed for SMP */ - if (armada38x_open_bootrom_win() != 0) - printf("WARNING: could not open window to bootROM\n"); -#endif -#endif } -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX_ARMV7 + 2) -#else #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) -#endif static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, } }; @@ -338,20 +286,19 @@ static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] static int platform_sram_devmap(struct devmap_entry *map) { -#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X) phandle_t child, root; u_long base, size; /* * SRAM range. */ + if ((root = OF_finddevice("/")) == 0) + return (ENXIO); + if ((child = OF_finddevice("/sram")) != 0) if (ofw_bus_node_is_compatible(child, "mrvl,cesa-sram") || ofw_bus_node_is_compatible(child, "mrvl,scratchpad")) goto moveon; - if ((root = OF_finddevice("/")) == 0) - return (ENXIO); - if ((child = fdt_find_compatible(root, "mrvl,cesa-sram", 0)) == 0 && (child = fdt_find_compatible(root, "mrvl,scratchpad", 0)) == 0) goto out; @@ -366,7 +313,6 @@ moveon: return (0); out: -#endif return (ENOENT); } @@ -408,20 +354,10 @@ platform_devmap_init(void) i = 0; devmap_register_table(&fdt_devmap[0]); -#ifdef SOC_MV_ARMADAXP - vm_paddr_t cur_immr_pa; + if ((root = OF_finddevice("/")) == -1) + return (ENXIO); /* - * 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. */ fdt_devmap[i].pd_va = fdt_immr_va; @@ -440,8 +376,6 @@ platform_devmap_init(void) * PCI range(s). * PCI range(s) and localbus. */ - if ((root = OF_finddevice("/")) == -1) - return (ENXIO); for (child = OF_child(root); child != 0; child = OF_peer(child)) { if (fdt_is_type(child, "pci") || fdt_is_type(child, "pciep")) { /* @@ -485,7 +419,6 @@ platform_devmap_init(void) return (0); } -#if __ARM_ARCH < 6 struct arm32_dma_range * bus_dma_get_range(void) { @@ -499,9 +432,16 @@ bus_dma_get_range_nb(void) return (0); } -#endif -#if defined(CPU_MV_PJ4B) +void +cpu_reset(void) +{ + + write_cpu_ctrl(RSTOUTn_MASK, SOFT_RST_OUT_EN); + write_cpu_ctrl(SYSTEM_SOFT_RESET, SYS_SOFT_RST); + while(1); +} + #ifdef DDB #include @@ -557,5 +497,3 @@ DB_SHOW_COMMAND(vtop, db_show_vtop) db_printf("show vtop \n"); } #endif /* DDB */ -#endif /* CPU_MV_PJ4B */ - Modified: head/sys/arm/mv/files.arm7 ============================================================================== --- head/sys/arm/mv/files.arm7 Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/files.arm7 Wed Apr 4 08:40:49 2018 (r331995) @@ -1,3 +1,39 @@ # $FreeBSD$ arm/mv/armada38x/armada38x.c standard arm/mv/armadaxp/armadaxp.c standard + +arm/mv/gpio.c optional gpio +arm/mv/mv_common.c standard +arm/mv/mv_localbus.c standard +arm/mv/mv_armv7_machdep.c standard +arm/mv/mv_pci_ctrl.c optional pci | fdt +arm/mv/mv_pci.c optional pci +arm/mv/mv_ts.c standard +arm/mv/timer.c standard + +arm/mv/mpic.c standard +arm/mv/armada/thermal.c optional fdt +arm/mv/armada/wdt.c optional fdt +arm/mv/armada38x/armada38x_mp.c optional smp +arm/mv/armada38x/pmsu.c standard +arm/mv/armada38x/armada38x_rtc.c standard +arm/mv/armada38x/armada38x_pl310.c optional pl310 +dev/sdhci/sdhci_fdt.c optional sdhci + +arm/mv/rtc.c standard +arm/mv/armadaxp/armadaxp_mp.c optional smp +arm/mv/armadaxp/mptramp.S optional smp +dev/cesa/cesa.c optional cesa +dev/iicbus/twsi/mv_twsi.c optional twsi +dev/mge/if_mge.c optional mge +dev/neta/if_mvneta_fdt.c optional neta fdt +dev/neta/if_mvneta.c optional neta mdio mii +dev/nand/nfc_mv.c optional nand +dev/mvs/mvs_soc.c optional mvs +dev/uart/uart_dev_ns8250.c optional uart +dev/uart/uart_dev_snps.c optional uart +dev/usb/controller/ehci_mv.c optional ehci +dev/usb/controller/xhci_mv.c optional xhci +dev/ahci/ahci_mv_fdt.c optional ahci + +kern/kern_clocksource.c standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/files.mv Wed Apr 4 08:40:49 2018 (r331995) @@ -15,7 +15,7 @@ arm/mv/gpio.c optional gpio arm/mv/mv_common.c standard arm/mv/mv_localbus.c standard -arm/mv/mv_machdep.c standard +arm/mv/armv5_machdep.c standard arm/mv/mv_pci_ctrl.c optional pci | fdt arm/mv/mv_pci.c optional pci arm/mv/mv_ts.c standard Added: head/sys/arm/mv/mv_armv7_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/mv_armv7_machdep.c Wed Apr 4 08:40:49 2018 (r331995) @@ -0,0 +1,482 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 Semihalf. + * Copyright (c) 1994-1998 Mark Brinicombe. + * Copyright (c) 1994 Brini. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 + */ + +#include "opt_ddb.h" +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "opt_platform.h" +#include "platform_if.h" + +#if defined(SOC_MV_ARMADA38X) +#include "platform_pl310_if.h" +#include "armada38x/armada38x_pl310.h" +#endif + +static int platform_mpp_init(void); +int armada38x_win_set_iosync_barrier(void); +int armada38x_scu_enable(void); +int armada38x_open_bootrom_win(void); +int armada38x_mbus_optimization(void); + +static vm_offset_t mv_platform_lastaddr(platform_t plate); +static int mv_platform_probe_and_attach(platform_t plate); +static void mv_platform_gpio_init(platform_t plate); +static void mv_cpu_reset(platform_t plat); + +static void mv_a38x_platform_late_init(platform_t plate); +static int mv_a38x_platform_devmap_init(platform_t plate); +static void mv_axp_platform_late_init(platform_t plate); +static int mv_axp_platform_devmap_init(platform_t plate); + +void armadaxp_init_coher_fabric(void); +void armadaxp_l2_init(void); + +#ifdef SMP +void mv_a38x_platform_mp_setmaxid(platform_t plate); +void mv_a38x_platform_mp_start_ap(platform_t plate); +void mv_axp_platform_mp_setmaxid(platform_t plate); +void mv_axp_platform_mp_start_ap(platform_t plate); +#endif + +#define MPP_PIN_MAX 68 +#define MPP_PIN_CELLS 2 +#define MPP_PINS_PER_REG 8 +#define MPP_SEL(pin,func) (((func) & 0xf) << \ + (((pin) % MPP_PINS_PER_REG) * 4)) + +static void +mv_busdma_tag_init(void *arg __unused) +{ + phandle_t node; + bus_dma_tag_t dmat; + + /* + * If this platform has coherent DMA, create the parent DMA tag to pass + * down the coherent flag to all busses and devices on the platform, + * otherwise return without doing anything. By default create tag + * for all A38x-based platforms only. + */ + if ((node = OF_finddevice("/")) == -1){ + printf("no tree\n"); + return; + } + + if (ofw_bus_node_is_compatible(node, "marvell,armada380") == 0) + return; + + bus_dma_tag_create(NULL, /* No parent tag */ + 1, 0, /* alignment, bounds */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &dmat); + + nexus_set_dma_tag(dmat); + +} +SYSINIT(mv_busdma_tag, SI_SUB_DRIVERS, SI_ORDER_ANY, mv_busdma_tag_init, NULL); + +static int +platform_mpp_init(void) +{ + pcell_t pinmap[MPP_PIN_MAX * MPP_PIN_CELLS]; + int mpp[MPP_PIN_MAX]; + uint32_t ctrl_val, ctrl_offset; + pcell_t reg[4]; + u_long start, size; + phandle_t node; + pcell_t pin_cells, *pinmap_ptr, pin_count; + ssize_t len; + int par_addr_cells, par_size_cells; + int tuple_size, tuples, rv, pins, i, j; + int mpp_pin, mpp_function; + + /* + * Try to access the MPP node directly i.e. through /aliases/mpp. + */ + if ((node = OF_finddevice("mpp")) != -1) + if (ofw_bus_node_is_compatible(node, "mrvl,mpp")) + goto moveon; + /* + * Find the node the long way. + */ + if ((node = OF_finddevice("/")) == -1) + return (ENXIO); + + if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0) + return (ENXIO); + + if ((node = fdt_find_compatible(node, "mrvl,mpp", 0)) == 0) + /* + * No MPP node. Fall back to how MPP got set by the + * first-stage loader and try to continue booting. + */ + return (0); +moveon: + /* + * Process 'reg' prop. + */ + if ((rv = fdt_addrsize_cells(OF_parent(node), &par_addr_cells, + &par_size_cells)) != 0) + return(ENXIO); + + tuple_size = sizeof(pcell_t) * (par_addr_cells + par_size_cells); + len = OF_getprop(node, "reg", reg, sizeof(reg)); + tuples = len / tuple_size; + if (tuple_size <= 0) + return (EINVAL); + + rv = fdt_data_to_res(reg, par_addr_cells, par_size_cells, + &start, &size); + if (rv != 0) + return (rv); + start += fdt_immr_va; + + /* + * Process 'pin-count' and 'pin-map' props. + */ + if (OF_getencprop(node, "pin-count", &pin_count, sizeof(pin_count)) <= 0) + return (ENXIO); + if (pin_count > MPP_PIN_MAX) + return (ERANGE); + + if (OF_getencprop(node, "#pin-cells", &pin_cells, sizeof(pin_cells)) <= 0) + pin_cells = MPP_PIN_CELLS; + if (pin_cells > MPP_PIN_CELLS) + return (ERANGE); + tuple_size = sizeof(pcell_t) * pin_cells; + + bzero(pinmap, sizeof(pinmap)); + len = OF_getencprop(node, "pin-map", pinmap, sizeof(pinmap)); + if (len <= 0) + return (ERANGE); + if (len % tuple_size) + return (ERANGE); + pins = len / tuple_size; + if (pins > pin_count) + return (ERANGE); + /* + * Fill out a "mpp[pin] => function" table. All pins unspecified in + * the 'pin-map' property are defaulted to 0 function i.e. GPIO. + */ + bzero(mpp, sizeof(mpp)); + pinmap_ptr = pinmap; + for (i = 0; i < pins; i++) { + mpp_pin = *pinmap_ptr; + mpp_function = *(pinmap_ptr + 1); + mpp[mpp_pin] = mpp_function; + pinmap_ptr += pin_cells; + } + + /* + * Prepare and program MPP control register values. + */ + ctrl_offset = 0; + for (i = 0; i < pin_count;) { + ctrl_val = 0; + + for (j = 0; j < MPP_PINS_PER_REG; j++) { + if (i + j == pin_count - 1) + break; + ctrl_val |= MPP_SEL(i + j, mpp[i + j]); + } + i += MPP_PINS_PER_REG; + bus_space_write_4(fdtbus_bs_tag, start, ctrl_offset, + ctrl_val); + + ctrl_offset += 4; + } + + return (0); +} + +static vm_offset_t +mv_platform_lastaddr(platform_t plat) +{ + + return (fdt_immr_va); +} + +static int +mv_platform_probe_and_attach(platform_t plate) +{ + + if (fdt_immr_addr(MV_BASE) != 0) + while (1); + return (0); +} + +static void +mv_platform_gpio_init(platform_t plate) +{ + + /* + * Re-initialise MPP. It is important to call this prior to using + * console as the physical connection can be routed via MPP. + */ + if (platform_mpp_init() != 0) + while (1); +} + +static void +mv_a38x_platform_late_init(platform_t plate) +{ + + /* + * Re-initialise decode windows + */ + if (mv_check_soc_family() == MV_SOC_UNSUPPORTED) + panic("Unsupported SoC family\n"); + + if (soc_decode_win() != 0) + printf("WARNING: could not re-initialise decode windows! " + "Running with existing settings...\n"); + + /* Configure timers' base frequency */ + arm_tmr_change_frequency(get_cpu_freq() / 2); + + /* + * Workaround for Marvell Armada38X family HW issue + * between Cortex-A9 CPUs and on-chip devices that may + * cause hang on heavy load. + * To avoid that, map all registers including PCIe IO + * as strongly ordered instead of device memory. + */ + pmap_remap_vm_attr(VM_MEMATTR_DEVICE, VM_MEMATTR_SO); + + /* Set IO Sync Barrier bit for all Mbus devices */ + if (armada38x_win_set_iosync_barrier() != 0) + printf("WARNING: could not map CPU Subsystem registers\n"); + if (armada38x_mbus_optimization() != 0) + printf("WARNING: could not enable mbus optimization\n"); + if (armada38x_scu_enable() != 0) + printf("WARNING: could not enable SCU\n"); +#ifdef SMP + /* Open window to bootROM memory - needed for SMP */ + if (armada38x_open_bootrom_win() != 0) + printf("WARNING: could not open window to bootROM\n"); +#endif +} + +static void +mv_axp_platform_late_init(platform_t plate) +{ + phandle_t node; + /* + * Re-initialise decode windows + */ + if (soc_decode_win() != 0) + printf("WARNING: could not re-initialise decode windows! " + "Running with existing settings...\n"); + if ((node = OF_finddevice("/")) == -1) + return; + +#if !defined(SMP) + /* For SMP case it should be initialized after APs are booted */ + armadaxp_init_coher_fabric(); +#endif + armadaxp_l2_init(); +} + +#define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX_ARMV7 + 2) +static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { + { 0, 0, 0, } +}; + +static int +platform_sram_devmap(struct devmap_entry *map) +{ + + return (ENOENT); +} + +/* + * Construct devmap table with DT-derived config data. + */ +static int +mv_a38x_platform_devmap_init(platform_t plat) +{ + phandle_t root, child; + int i; + + i = 0; + devmap_register_table(&fdt_devmap[0]); + + if ((root = OF_finddevice("/")) == -1) + return (ENXIO); + + /* + * IMMR range. + */ + fdt_devmap[i].pd_va = fdt_immr_va; + fdt_devmap[i].pd_pa = fdt_immr_pa; + fdt_devmap[i].pd_size = fdt_immr_size; + i++; + + /* + * SRAM range. + */ + if (i < FDT_DEVMAP_MAX) + if (platform_sram_devmap(&fdt_devmap[i]) == 0) + i++; + + /* + * PCI range(s). + * PCI range(s) and localbus. + */ + for (child = OF_child(root); child != 0; child = OF_peer(child)) { + if (fdt_is_type(child, "pci") || fdt_is_type(child, "pciep")) { + /* + * Check space: each PCI node will consume 2 devmap + * entries. + */ + if (i + 1 >= FDT_DEVMAP_MAX) + return (ENOMEM); + + if (mv_pci_devmap(child, &fdt_devmap[i], MV_PCI_VA_IO_BASE, + MV_PCI_VA_MEM_BASE) != 0) + return (ENXIO); + i += 2; + } + } + + return (0); +} + +static int +mv_axp_platform_devmap_init(platform_t plate) +{ + 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; + + mv_a38x_platform_devmap_init(plate); + + return (0); +} + +static void +mv_cpu_reset(platform_t plat) +{ + + write_cpu_misc(RSTOUTn_MASK, SOFT_RST_OUT_EN); + write_cpu_misc(SYSTEM_SOFT_RESET, SYS_SOFT_RST); +} + +#if defined(SOC_MV_ARMADA38X) +static platform_method_t mv_a38x_methods[] = { + PLATFORMMETHOD(platform_devmap_init, mv_a38x_platform_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, mv_cpu_reset), + PLATFORMMETHOD(platform_lastaddr, mv_platform_lastaddr), + PLATFORMMETHOD(platform_attach, mv_platform_probe_and_attach), + PLATFORMMETHOD(platform_gpio_init, mv_platform_gpio_init), + PLATFORMMETHOD(platform_late_init, mv_a38x_platform_late_init), + PLATFORMMETHOD(platform_pl310_init, mv_a38x_platform_pl310_init), + PLATFORMMETHOD(platform_pl310_write_ctrl, mv_a38x_platform_pl310_write_ctrl), + PLATFORMMETHOD(platform_pl310_write_debug, mv_a38x_platform_pl310_write_debug), +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, mv_a38x_platform_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, mv_a38x_platform_mp_setmaxid), +#endif + + PLATFORMMETHOD_END, +}; +FDT_PLATFORM_DEF(mv_a38x, "mv_a38x", 0, "marvell,armada380", 100); +#endif + +static platform_method_t mv_axp_methods[] = { + PLATFORMMETHOD(platform_devmap_init, mv_axp_platform_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, mv_cpu_reset), + PLATFORMMETHOD(platform_lastaddr, mv_platform_lastaddr), + PLATFORMMETHOD(platform_attach, mv_platform_probe_and_attach), + PLATFORMMETHOD(platform_gpio_init, mv_platform_gpio_init), + PLATFORMMETHOD(platform_late_init, mv_axp_platform_late_init), +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, mv_axp_platform_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, mv_axp_platform_mp_setmaxid), +#endif + + PLATFORMMETHOD_END, +}; +FDT_PLATFORM_DEF(mv_axp, "mv_axp", 0, "marvell,armadaxp", 100); + Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/mv_common.c Wed Apr 4 08:40:49 2018 (r331995) @@ -588,20 +588,6 @@ write_cpu_misc(uint32_t reg, uint32_t val) bus_space_write_4(fdtbus_bs_tag, MV_MISC_BASE, reg, val); } -void -cpu_reset(void) -{ - -#if defined(SOC_MV_ARMADAXP) || defined (SOC_MV_ARMADA38X) - write_cpu_misc(RSTOUTn_MASK, SOFT_RST_OUT_EN); - write_cpu_misc(SYSTEM_SOFT_RESET, SYS_SOFT_RST); -#else - write_cpu_ctrl(RSTOUTn_MASK, SOFT_RST_OUT_EN); - write_cpu_ctrl(SYSTEM_SOFT_RESET, SYS_SOFT_RST); -#endif - while (1); -} - uint32_t cpu_extra_feat(void) { Modified: head/sys/arm/mv/std-pj4b.mv ============================================================================== --- head/sys/arm/mv/std-pj4b.mv Wed Apr 4 08:39:59 2018 (r331994) +++ head/sys/arm/mv/std-pj4b.mv Wed Apr 4 08:40:49 2018 (r331995) @@ -1,6 +1,5 @@ # $FreeBSD$ -files "../mv/files.mv" files "../mv/files.arm7" cpu CPU_MV_PJ4B machine arm armv7 From owner-svn-src-all@freebsd.org Wed Apr 4 08:41:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E15DDF9E658; Wed, 4 Apr 2018 08:41:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92D8F6C7FE; Wed, 4 Apr 2018 08:41:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAE5114D7; Wed, 4 Apr 2018 08:41:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w348fBbb037045; Wed, 4 Apr 2018 08:41:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w348fArw037034; Wed, 4 Apr 2018 08:41:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804040841.w348fArw037034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Apr 2018 08:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331996 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 331996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 08:41:12 -0000 Author: hselasky Date: Wed Apr 4 08:41:10 2018 New Revision: 331996 URL: https://svnweb.freebsd.org/changeset/base/331996 Log: MFC r331828: Optimise use of Giant in the LinuxKPI. - Make sure Giant is locked when calling PCI device methods. Newbus currently requires this. - Avoid unlocking Giant right before aquiring the sleepqueue lock. This can save a task switch. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/module.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/compat/linuxkpi/common/src/linux_pci.c stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/module.h Wed Apr 4 08:40:49 2018 (r331995) +++ stable/11/sys/compat/linuxkpi/common/include/linux/module.h Wed Apr 4 08:41:10 2018 (r331996) @@ -78,9 +78,7 @@ _module_run(void *arg) printf("Running %s (%p)\n", name, pc); #endif fn = arg; - DROP_GIANT(); fn(); - PICKUP_GIANT(); } #define module_init(fn) \ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Apr 4 08:40:49 2018 (r331995) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Apr 4 08:41:10 2018 (r331996) @@ -1804,8 +1804,6 @@ linux_wait_for_common(struct completion *c, int flags) if (SCHEDULER_STOPPED()) return (0); - DROP_GIANT(); - task = current; if (flags != 0) @@ -1819,22 +1817,25 @@ linux_wait_for_common(struct completion *c, int flags) break; sleepq_add(c, NULL, "completion", flags, 0); if (flags & SLEEPQ_INTERRUPTIBLE) { + DROP_GIANT(); error = -sleepq_wait_sig(c, 0); + PICKUP_GIANT(); if (error != 0) { linux_schedule_save_interrupt_value(task, error); error = -ERESTARTSYS; goto intr; } - } else + } else { + DROP_GIANT(); sleepq_wait(c, 0); + PICKUP_GIANT(); + } } if (c->done != UINT_MAX) c->done--; sleepq_release(c); intr: - PICKUP_GIANT(); - return (error); } @@ -1851,8 +1852,6 @@ linux_wait_for_timeout_common(struct completion *c, in if (SCHEDULER_STOPPED()) return (0); - DROP_GIANT(); - task = current; if (flags != 0) @@ -1866,10 +1865,14 @@ linux_wait_for_timeout_common(struct completion *c, in break; sleepq_add(c, NULL, "completion", flags, 0); sleepq_set_timeout(c, linux_timer_jiffies_until(end)); + + DROP_GIANT(); if (flags & SLEEPQ_INTERRUPTIBLE) error = -sleepq_timedwait_sig(c, 0); else error = -sleepq_timedwait(c, 0); + PICKUP_GIANT(); + if (error != 0) { /* check for timeout */ if (error == -EWOULDBLOCK) { @@ -1889,8 +1892,6 @@ linux_wait_for_timeout_common(struct completion *c, in /* return how many jiffies are left */ error = linux_timer_jiffies_until(end); done: - PICKUP_GIANT(); - return (error); } Modified: stable/11/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 4 08:40:49 2018 (r331995) +++ stable/11/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 4 08:41:10 2018 (r331996) @@ -171,12 +171,11 @@ linux_pci_attach(device_t dev) pdev->bus = pbus; } - DROP_GIANT(); spin_lock(&pci_lock); list_add(&pdev->links, &pci_devices); spin_unlock(&pci_lock); + error = pdrv->probe(pdev, id); - PICKUP_GIANT(); if (error) { spin_lock(&pci_lock); list_del(&pdev->links); @@ -194,9 +193,9 @@ linux_pci_detach(device_t dev) linux_set_current(curthread); pdev = device_get_softc(dev); - DROP_GIANT(); + pdev->pdrv->remove(pdev); - PICKUP_GIANT(); + spin_lock(&pci_lock); list_del(&pdev->links); spin_unlock(&pci_lock); @@ -258,11 +257,8 @@ linux_pci_shutdown(device_t dev) linux_set_current(curthread); pdev = device_get_softc(dev); - if (pdev->pdrv->shutdown != NULL) { - DROP_GIANT(); + if (pdev->pdrv->shutdown != NULL) pdev->pdrv->shutdown(pdev); - PICKUP_GIANT(); - } return (0); } Modified: stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c Wed Apr 4 08:40:49 2018 (r331995) +++ stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c Wed Apr 4 08:41:10 2018 (r331996) @@ -297,13 +297,13 @@ linux_synchronize_rcu(void) td = curthread; - DROP_GIANT(); - /* * Synchronizing RCU might change the CPU core this function * is running on. Save current values: */ thread_lock(td); + + DROP_GIANT(); old_cpu = PCPU_GET(cpuid); old_pinned = td->td_pinned; Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Wed Apr 4 08:40:49 2018 (r331995) +++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Wed Apr 4 08:41:10 2018 (r331996) @@ -55,6 +55,8 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc sleepq_add(wchan, NULL, wmesg, flags, 0); if (timeout != 0) sleepq_set_timeout(wchan, timeout); + + DROP_GIANT(); if ((state & TASK_INTERRUPTIBLE) != 0) { if (timeout == 0) ret = -sleepq_wait_sig(wchan, 0); @@ -67,6 +69,8 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc } else ret = -sleepq_timedwait(wchan, 0); } + PICKUP_GIANT(); + /* filter return value */ if (ret != 0 && ret != -EWOULDBLOCK) { linux_schedule_save_interrupt_value(task, ret); @@ -248,8 +252,6 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q if (lock != NULL) spin_unlock_irq(lock); - DROP_GIANT(); - /* range check timeout */ if (timeout < 1) timeout = 1; @@ -272,8 +274,6 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q } PRELE(task->task_thread->td_proc); - PICKUP_GIANT(); - if (lock != NULL) spin_lock_irq(lock); return (ret); @@ -297,8 +297,6 @@ linux_schedule_timeout(int timeout) remainder = ticks + timeout; - DROP_GIANT(); - sleepq_lock(task); state = atomic_read(&task->state); if (state != TASK_WAKING) { @@ -309,8 +307,6 @@ linux_schedule_timeout(int timeout) } set_task_state(task, TASK_RUNNING); - PICKUP_GIANT(); - if (timeout == 0) return (MAX_SCHEDULE_TIMEOUT); @@ -356,8 +352,6 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit void *wchan; int ret; - DROP_GIANT(); - /* range check timeout */ if (timeout < 1) timeout = 1; @@ -380,8 +374,6 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit } set_task_state(task, TASK_RUNNING); - PICKUP_GIANT(); - return (ret); } @@ -399,8 +391,6 @@ linux_wait_on_atomic_t(atomic_t *a, unsigned int state void *wchan; int ret; - DROP_GIANT(); - task = current; wchan = a; for (;;) { @@ -416,8 +406,6 @@ linux_wait_on_atomic_t(atomic_t *a, unsigned int state break; } set_task_state(task, TASK_RUNNING); - - PICKUP_GIANT(); return (ret); } From owner-svn-src-all@freebsd.org Wed Apr 4 08:45:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32F88F9E9F5; Wed, 4 Apr 2018 08:45:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8DE56CB4B; Wed, 4 Apr 2018 08:45:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3BDB11631; Wed, 4 Apr 2018 08:45:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w348jfgu043662; Wed, 4 Apr 2018 08:45:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w348jfNI043661; Wed, 4 Apr 2018 08:45:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804040845.w348jfNI043661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Apr 2018 08:45: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: r331997 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb/input X-SVN-Commit-Revision: 331997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 08:45:42 -0000 Author: hselasky Date: Wed Apr 4 08:45:41 2018 New Revision: 331997 URL: https://svnweb.freebsd.org/changeset/base/331997 Log: MFC r331642: Add support for right and middle click with integrated button to WSP USB trackpad driver. Submitted by: James Wright PR: 226961 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/input/wsp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/wsp.c ============================================================================== --- stable/10/sys/dev/usb/input/wsp.c Wed Apr 4 08:41:10 2018 (r331996) +++ stable/10/sys/dev/usb/input/wsp.c Wed Apr 4 08:45:41 2018 (r331997) @@ -922,7 +922,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t e sc->sc_status.button = 0; if (ibt != 0) { - sc->sc_status.button |= MOUSE_BUTTON1DOWN; + if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 2) + sc->sc_status.button |= MOUSE_BUTTON3DOWN; + else if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 3) + sc->sc_status.button |= MOUSE_BUTTON2DOWN; + else + sc->sc_status.button |= MOUSE_BUTTON1DOWN; sc->ibtn = 1; } sc->intr_count++; From owner-svn-src-all@freebsd.org Wed Apr 4 10:14:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DB8F80CA6; Wed, 4 Apr 2018 10:14:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9CF7091F; Wed, 4 Apr 2018 10:14:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4139912526; Wed, 4 Apr 2018 10:14:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34AEiMn049686; Wed, 4 Apr 2018 10:14:44 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34AEh7x049677; Wed, 4 Apr 2018 10:14:43 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041014.w34AEh7x049677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 10:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332002 - in head/sys/arm/mv: . armada X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm/mv: . armada X-SVN-Commit-Revision: 332002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 10:14:44 -0000 Author: mw Date: Wed Apr 4 10:14:43 2018 New Revision: 332002 URL: https://svnweb.freebsd.org/changeset/base/332002 Log: Make Marvell Armada reset registers usage generic Define reset registers for both Armada38X and ArmadaXP and choose proper one during runtime based on information from FDT. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14745 Modified: head/sys/arm/mv/armada/wdt.c head/sys/arm/mv/mv_armv7_machdep.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/armada/wdt.c ============================================================================== --- head/sys/arm/mv/armada/wdt.c Wed Apr 4 09:11:15 2018 (r332001) +++ head/sys/arm/mv/armada/wdt.c Wed Apr 4 10:14:43 2018 (r332002) @@ -245,9 +245,9 @@ mv_wdt_enable_armada_38x_xp_helper() val |= (WD_GLOBAL_MASK | WD_CPU0_MASK); write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); - val = read_cpu_misc(RSTOUTn_MASK); + val = read_cpu_misc(RSTOUTn_MASK_ARMV7); val &= ~RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, val); + write_cpu_misc(RSTOUTn_MASK_ARMV7, val); } static void @@ -305,9 +305,9 @@ mv_wdt_disable_armada_38x_xp_helper(void) val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK); write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); - val = read_cpu_misc(RSTOUTn_MASK); + val = read_cpu_misc(RSTOUTn_MASK_ARMV7); val |= RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD); + write_cpu_misc(RSTOUTn_MASK_ARMV7, RSTOUTn_MASK_WD); } static void Modified: head/sys/arm/mv/mv_armv7_machdep.c ============================================================================== --- head/sys/arm/mv/mv_armv7_machdep.c Wed Apr 4 09:11:15 2018 (r332001) +++ head/sys/arm/mv/mv_armv7_machdep.c Wed Apr 4 10:14:43 2018 (r332002) @@ -439,8 +439,8 @@ static void mv_cpu_reset(platform_t plat) { - write_cpu_misc(RSTOUTn_MASK, SOFT_RST_OUT_EN); - write_cpu_misc(SYSTEM_SOFT_RESET, SYS_SOFT_RST); + write_cpu_misc(RSTOUTn_MASK_ARMV7, SOFT_RST_OUT_EN_ARMV7); + write_cpu_misc(SYSTEM_SOFT_RESET_ARMV7, SYS_SOFT_RST_ARMV7); } #if defined(SOC_MV_ARMADA38X) Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Wed Apr 4 09:11:15 2018 (r332001) +++ head/sys/arm/mv/mvreg.h Wed Apr 4 10:14:43 2018 (r332002) @@ -103,17 +103,15 @@ /* * System reset */ -#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X) -#define RSTOUTn_MASK 0x60 -#define SYSTEM_SOFT_RESET 0x64 -#define SOFT_RST_OUT_EN 0x00000001 -#define SYS_SOFT_RST 0x00000001 -#else +#define RSTOUTn_MASK_ARMV7 0x60 +#define SYSTEM_SOFT_RESET_ARMV7 0x64 +#define SOFT_RST_OUT_EN_ARMV7 0x00000001 +#define SYS_SOFT_RST_ARMV7 0x00000001 + #define RSTOUTn_MASK 0x8 #define SOFT_RST_OUT_EN 0x00000004 #define SYSTEM_SOFT_RESET 0xc #define SYS_SOFT_RST 0x00000001 -#endif #define RSTOUTn_MASK_WD 0x400 #define WD_RSTOUTn_MASK 0x4 #define WD_GLOBAL_MASK 0x00000100 Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Wed Apr 4 09:11:15 2018 (r332001) +++ head/sys/arm/mv/timer.c Wed Apr 4 10:14:43 2018 (r332002) @@ -411,9 +411,9 @@ mv_watchdog_enable_armadaxp(void) val |= (WD_GLOBAL_MASK | WD_CPU0_MASK); write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); - val = read_cpu_misc(RSTOUTn_MASK); + val = read_cpu_misc(RSTOUTn_MASK_ARMV7); val &= ~RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, val); + write_cpu_misc(RSTOUTn_MASK_ARMV7, val); val = mv_get_timer_control(); val |= CPU_TIMER2_EN | CPU_TIMER2_AUTO | CPU_TIMER_WD_25MHZ_EN; @@ -451,9 +451,9 @@ mv_watchdog_disable_armadaxp(void) val &= ~(WD_GLOBAL_MASK | WD_CPU0_MASK); write_cpu_mp_clocks(WD_RSTOUTn_MASK, val); - val = read_cpu_misc(RSTOUTn_MASK); + val = read_cpu_misc(RSTOUTn_MASK_ARMV7); val |= RSTOUTn_MASK_WD; - write_cpu_misc(RSTOUTn_MASK, RSTOUTn_MASK_WD); + write_cpu_misc(RSTOUTn_MASK_ARMV7, RSTOUTn_MASK_WD); irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= IRQ_TIMER_WD_CLR; From owner-svn-src-all@freebsd.org Wed Apr 4 10:45:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57136F82CDD; Wed, 4 Apr 2018 10:45:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0316B71BF6; Wed, 4 Apr 2018 10:45:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDFEF12A16; Wed, 4 Apr 2018 10:45:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Aj6gQ085455; Wed, 4 Apr 2018 10:45:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Aj69t085454; Wed, 4 Apr 2018 10:45:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804041045.w34Aj69t085454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 4 Apr 2018 10:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332003 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 332003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 10:45:07 -0000 Author: hselasky Date: Wed Apr 4 10:45:06 2018 New Revision: 332003 URL: https://svnweb.freebsd.org/changeset/base/332003 Log: Bump driver version number in mlx5en(4). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Apr 4 10:14:43 2018 (r332002) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Apr 4 10:45:06 2018 (r332003) @@ -30,7 +30,9 @@ #include #include -#define ETH_DRIVER_VERSION "3.1.0-dev" +#ifndef ETH_DRIVER_VERSION +#define ETH_DRIVER_VERSION "3.4.1" +#endif char mlx5e_version[] = "Mellanox Ethernet driver" " (" ETH_DRIVER_VERSION ")"; From owner-svn-src-all@freebsd.org Wed Apr 4 11:30:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34BE9F85F9A; Wed, 4 Apr 2018 11:30:21 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA15374538; Wed, 4 Apr 2018 11:30:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA5DD130BF; Wed, 4 Apr 2018 11:30:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34BUK6i038110; Wed, 4 Apr 2018 11:30:20 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34BUKGk038103; Wed, 4 Apr 2018 11:30:20 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804041130.w34BUKGk038103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 11:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332010 - in stable/11/sys: arm/conf arm/nvidia arm/nvidia/drm2 arm/nvidia/tegra124 boot/fdt/dts/arm contrib/dev/nvidia gnu/dts/arm gnu/dts/include/dt-bindings/clock gnu/dts/include/dt-... X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in stable/11/sys: arm/conf arm/nvidia arm/nvidia/drm2 arm/nvidia/tegra124 boot/fdt/dts/arm contrib/dev/nvidia gnu/dts/arm gnu/dts/include/dt-bindings/clock gnu/dts/include/dt-bindings/gpio gnu/dts/inc... X-SVN-Commit-Revision: 332010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 11:30:21 -0000 Author: mmel Date: Wed Apr 4 11:30:20 2018 New Revision: 332010 URL: https://svnweb.freebsd.org/changeset/base/332010 Log: MFC (cherry pick)r306197,r306327,r306328,r308390,r308391,r310600,r314703: cherry pick from r306197: Nvidia Tegra 124 and Jetson TK1 related DTS. r306327: Update AHCI driver to match new dts tree r306328: Update PCI driver to match new dts tree r308390: Rework NVIDIA Tegra124 XUSBPAD driver. - Adapt it for new, incompatible, DT bindings introduced by r306197. - Add support for USB super speed pads/ports. r308391: Add NVIDIA Tegra XHCI driver and coresponding firmware blob. r310600: Implement drivers for NVIDIA tegra124 display controller, HDMI source and host1x module. Unfortunately, tegra124 SoC doesn't have 2D acceleration engine and 3D requires not yet started nouveau driver. r314703: Add support for card detect and write protect gpio pins to Tegra SDHCI. Added: stable/11/sys/arm/nvidia/drm2/ - copied from r310600, head/sys/arm/nvidia/drm2/ stable/11/sys/arm/nvidia/tegra_xhci.c - copied unchanged from r308391, head/sys/arm/nvidia/tegra_xhci.c stable/11/sys/contrib/dev/nvidia/ - copied from r308391, head/sys/contrib/dev/nvidia/ Modified: stable/11/sys/arm/conf/TEGRA124 stable/11/sys/arm/nvidia/tegra124/files.tegra124 stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c stable/11/sys/arm/nvidia/tegra_ahci.c stable/11/sys/arm/nvidia/tegra_pcie.c stable/11/sys/arm/nvidia/tegra_sdhci.c stable/11/sys/boot/fdt/dts/arm/tegra124-jetson-tk1-fbsd.dts stable/11/sys/gnu/dts/arm/tegra124-jetson-tk1-emc.dtsi (contents, props changed) stable/11/sys/gnu/dts/arm/tegra124-jetson-tk1.dts stable/11/sys/gnu/dts/arm/tegra124.dtsi stable/11/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h stable/11/sys/gnu/dts/include/dt-bindings/clock/tegra124-car.h stable/11/sys/gnu/dts/include/dt-bindings/gpio/tegra-gpio.h stable/11/sys/gnu/dts/include/dt-bindings/memory/tegra124-mc.h stable/11/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h stable/11/sys/gnu/dts/include/dt-bindings/reset/tegra124-car.h (contents, props changed) stable/11/sys/gnu/dts/include/dt-bindings/thermal/tegra124-soctherm.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/conf/TEGRA124 ============================================================================== --- stable/11/sys/arm/conf/TEGRA124 Wed Apr 4 11:14:27 2018 (r332009) +++ stable/11/sys/arm/conf/TEGRA124 Wed Apr 4 11:30:20 2018 (r332010) @@ -50,7 +50,7 @@ device vlan # 802.1Q VLAN support #device tun # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling -#device firmware # firmware assist module +device firmware # firmware assist module device ether # Ethernet support device miibus # Required for ethernet device bpf # Berkeley packet filter (required for DHCP) @@ -86,6 +86,8 @@ device pass # Passthrough device (direct ATA/SCSI a # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device ehci # EHCI USB interface +device xhci # XHCI USB interface +device tegra124_xusb_fw # Tegra XUSB firmware device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" @@ -121,11 +123,10 @@ device pci device re # RealTek 8139C+/8169/8169S/8110S # DRM2 -#device fbd -#device vt -#device splash -#device kbdmux -#device drm2 +device fbd +device vt +device kbdmux +device drm2 # Sound #device sound Modified: stable/11/sys/arm/nvidia/tegra124/files.tegra124 ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/files.tegra124 Wed Apr 4 11:14:27 2018 (r332009) +++ stable/11/sys/arm/nvidia/tegra124/files.tegra124 Wed Apr 4 11:30:20 2018 (r332010) @@ -24,6 +24,7 @@ arm/nvidia/tegra_uart.c optional uart arm/nvidia/tegra_sdhci.c optional sdhci arm/nvidia/tegra_gpio.c optional gpio arm/nvidia/tegra_ehci.c optional ehci +arm/nvidia/tegra_xhci.c optional xhci arm/nvidia/tegra_ahci.c optional ahci arm/nvidia/tegra_pcie.c optional pci arm/nvidia/tegra_i2c.c optional iic @@ -35,21 +36,35 @@ arm/nvidia/tegra_soctherm.c standard arm/nvidia/tegra_lic.c standard arm/nvidia/tegra_mc.c standard #arm/nvidia/tegra_hda.c optional snd_hda -#arm/nvidia/drm2/hdmi.c optional drm2 -#arm/nvidia/drm2/tegra_drm_if.m optional drm2 -#arm/nvidia/drm2/tegra_drm_subr.c optional drm2 -#arm/nvidia/drm2/tegra_host1x.c optional drm2 -#arm/nvidia/drm2/tegra_hdmi.c optional drm2 -#arm/nvidia/drm2/tegra_dc_if.m optional drm2 -#arm/nvidia/drm2/tegra_dc.c optional drm2 -#arm/nvidia/drm2/tegra_fb.c optional drm2 -#arm/nvidia/drm2/tegra_bo.c optional drm2 +arm/nvidia/drm2/hdmi.c optional drm2 +arm/nvidia/drm2/tegra_drm_if.m optional drm2 +arm/nvidia/drm2/tegra_drm_subr.c optional drm2 +arm/nvidia/drm2/tegra_host1x.c optional drm2 +arm/nvidia/drm2/tegra_hdmi.c optional drm2 +arm/nvidia/drm2/tegra_dc_if.m optional drm2 +arm/nvidia/drm2/tegra_dc.c optional drm2 +arm/nvidia/drm2/tegra_fb.c optional drm2 +arm/nvidia/drm2/tegra_bo.c optional drm2 # -# Optional devices. +# Firmware # - +tegra124_xusb_fw.c optional tegra124_xusb_fw \ + dependency "$S/arm/nvidia/tegra124/files.tegra124" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk tegra124_xusb.fw:tegra124_xusb_fw -mtegra124_xusb_fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "tegra124_xusb_fw.c" +tegra124_xusb.fwo optional tegra124_xusb_fw \ + dependency "tegra124_xusb.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "tegra124_xusb.fwo" +tegra124_xusb.fw optional tegra124_xusb_fw \ + dependency "$S/contrib/dev/nvidia/tegra124_xusb.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "tegra124_xusb.fw" # -# Temporary/ to be moved stuff +# Temporary/to be moved stuff # arm/nvidia/as3722.c optional iic arm/nvidia/as3722_regulators.c optional iic Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Wed Apr 4 11:14:27 2018 (r332009) +++ stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Wed Apr 4 11:30:20 2018 (r332010) @@ -39,26 +39,57 @@ #include #include +#include #include #include #include #include #include +#include + #include #include "phy_if.h" +/* FUSE calibration data. */ +#define FUSE_XUSB_CALIB 0x0F0 +#define FUSE_XUSB_CALIB_HS_CURR_LEVEL_123(x) (((x) >> 15) & 0x3F); +#define FUSE_XUSB_CALIB_HS_IREF_CAP(x) (((x) >> 13) & 0x03); +#define FUSE_XUSB_CALIB_HS_SQUELCH_LEVEL(x) (((x) >> 11) & 0x03); +#define FUSE_XUSB_CALIB_HS_TERM_RANGE_ADJ(x) (((x) >> 7) & 0x0F); +#define FUSE_XUSB_CALIB_HS_CURR_LEVEL_0(x) (((x) >> 0) & 0x3F); + + +/* Registers. */ #define XUSB_PADCTL_USB2_PAD_MUX 0x004 +#define XUSB_PADCTL_USB2_PORT_CAP 0x008 +#define USB2_PORT_CAP_ULPI_PORT_INTERNAL (1 << 25) +#define USB2_PORT_CAP_ULPI_PORT_CAP (1 << 24) +#define USB2_PORT_CAP_PORT_REVERSE_ID(p) (1 << (3 + (p) * 4)) +#define USB2_PORT_CAP_PORT_INTERNAL(p) (1 << (2 + (p) * 4)) +#define USB2_PORT_CAP_PORT_CAP(p, x) (((x) & 3) << ((p) * 4)) +#define USB2_PORT_CAP_PORT_CAP_OTG 0x3 +#define USB2_PORT_CAP_PORT_CAP_DEVICE 0x2 +#define USB2_PORT_CAP_PORT_CAP_HOST 0x1 +#define USB2_PORT_CAP_PORT_CAP_DISABLED 0x0 + +#define XUSB_PADCTL_SS_PORT_MAP 0x014 +#define SS_PORT_MAP_PORT_INTERNAL(p) (1 << (3 + (p) * 4)) +#define SS_PORT_MAP_PORT_MAP(p, x) (((x) & 7) << ((p) * 4)) + #define XUSB_PADCTL_ELPG_PROGRAM 0x01C #define ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN (1 << 26) #define ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY (1 << 25) #define ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN (1 << 24) +#define ELPG_PROGRAM_SSP_ELPG_VCORE_DOWN(x) (1 << (18 + (x) * 4)) +#define ELPG_PROGRAM_SSP_ELPG_CLAMP_EN_EARLY(x) (1 << (17 + (x) * 4)) +#define ELPG_PROGRAM_SSP_ELPG_CLAMP_EN(x) (1 << (16 + (x) * 4)) #define XUSB_PADCTL_IOPHY_PLL_P0_CTL1 0x040 #define IOPHY_PLL_P0_CTL1_PLL0_LOCKDET (1 << 19) -#define IOPHY_PLL_P0_CTL1_REFCLK_SEL_MASK (0xf<< 12) +#define IOPHY_PLL_P0_CTL1_REFCLK_SEL(x) (((x) & 0xF) << 12) #define IOPHY_PLL_P0_CTL1_PLL_RST (1 << 1) #define XUSB_PADCTL_IOPHY_PLL_P0_CTL2 0x044 @@ -66,9 +97,60 @@ #define IOPHY_PLL_P0_CTL2_TXCLKREF_EN (1 << 5) #define IOPHY_PLL_P0_CTL2_TXCLKREF_SEL (1 << 4) +#define XUSB_PADCTL_IOPHY_USB3_PAD_CTL2(x) (0x058 + (x) * 4) +#define IOPHY_USB3_PAD_CTL2_CDR_CNTL(x) (((x) & 0x00FF) << 4) +#define IOPHY_USB3_PAD_CTL2_RX_EQ(x) (((x) & 0xFFFF) << 8) +#define IOPHY_USB3_PAD_CTL2_RX_WANDER(x) (((x) & 0x000F) << 4) +#define IOPHY_USB3_PAD_CTL2_RX_TERM_CNTL(x) (((x) & 0x0003) << 2) +#define IOPHY_USB3_PAD_CTL2_TX_TERM_CNTL(x) (((x) & 0x0003) << 0) + +#define XUSB_PADCTL_IOPHY_USB3_PAD_CTL4(x) (0x068 + (x) * 4) + +#define XUSB_PADCTL_USB2_OTG_PAD_CTL0(x) (0x0A0 + (x) * 4) +#define USB2_OTG_PAD_CTL0_LSBIAS_SEL (1 << 23) +#define USB2_OTG_PAD_CTL0_DISCON_DETECT_METHOD (1 << 22) +#define USB2_OTG_PAD_CTL0_PD_ZI (1 << 21) +#define USB2_OTG_PAD_CTL0_PD2 (1 << 20) +#define USB2_OTG_PAD_CTL0_PD (1 << 19) +#define USB2_OTG_PAD_CTL0_TERM_EN (1 << 18) +#define USB2_OTG_PAD_CTL0_LS_LS_FSLEW(x) (((x) & 0x03) << 16) +#define USB2_OTG_PAD_CTL0_LS_RSLEW(x) (((x) & 0x03) << 14) +#define USB2_OTG_PAD_CTL0_FS_SLEW(x) (((x) & 0x03) << 12) +#define USB2_OTG_PAD_CTL0_HS_SLEW(x) (((x) & 0x3F) << 6) +#define USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(x) (((x) & 0x3F) << 0) + +#define XUSB_PADCTL_USB2_OTG_PAD_CTL1(x) (0x0AC + (x) * 4) +#define USB2_OTG_PAD_CTL1_RPU_RANGE_ADJ(x) (((x) & 0x3) << 11) +#define USB2_OTG_PAD_CTL1_HS_IREF_CAP(x) (((x) & 0x3) << 9) +#define USB2_OTG_PAD_CTL1_SPARE(x) (((x) & 0x3) << 7) +#define USB2_OTG_PAD_CTL1_TERM_RANGE_ADJ(x) (((x) & 0xF) << 3) +#define USB2_OTG_PAD_CTL1_PD_DR (1 << 2) +#define USB2_OTG_PAD_CTL1_PD_DISC_FORCE_POWERUP (1 << 1) +#define USB2_OTG_PAD_CTL1_PD_CHRP_FORCE_POWERUP (1 << 0) + +#define XUSB_PADCTL_USB2_BIAS_PAD_CTL0 0x0B8 +#define USB2_BIAS_PAD_CTL0_ADJRPU(x) (((x) & 0x7) << 14) +#define USB2_BIAS_PAD_CTL0_PD_TRK (1 << 13) +#define USB2_BIAS_PAD_CTL0_PD (1 << 12) +#define USB2_BIAS_PAD_CTL0_TERM_OFFSETL(x) (((x) & 0x3) << 9) +#define USB2_BIAS_PAD_CTL0_VBUS_LEVEL(x) (((x) & 0x3) << 7) +#define USB2_BIAS_PAD_CTL0_HS_CHIRP_LEVEL(x) (((x) & 0x3) << 5) +#define USB2_BIAS_PAD_CTL0_HS_DISCON_LEVEL(x) (((x) & 0x7) << 2) +#define USB2_BIAS_PAD_CTL0_HS_SQUELCH_LEVEL(x) (((x) & 0x3) << 0) + +#define XUSB_PADCTL_HSIC_PAD0_CTL0 0x0C8 +#define HSIC_PAD0_CTL0_HSIC_OPT(x) (((x) & 0xF) << 16) +#define HSIC_PAD0_CTL0_TX_SLEWN(x) (((x) & 0xF) << 12) +#define HSIC_PAD0_CTL0_TX_SLEWP(x) (((x) & 0xF) << 8) +#define HSIC_PAD0_CTL0_TX_RTUNEN(x) (((x) & 0xF) << 4) +#define HSIC_PAD0_CTL0_TX_RTUNEP(x) (((x) & 0xF) << 0) + #define XUSB_PADCTL_USB3_PAD_MUX 0x134 +#define USB3_PAD_MUX_PCIE_IDDQ_DISABLE(x) (1 << (1 + (x))) +#define USB3_PAD_MUX_SATA_IDDQ_DISABLE (1 << 6) + #define XUSB_PADCTL_IOPHY_PLL_S0_CTL1 0x138 #define IOPHY_PLL_S0_CTL1_PLL1_LOCKDET (1 << 27) #define IOPHY_PLL_S0_CTL1_PLL1_MODE (1 << 24) @@ -90,17 +172,25 @@ #define XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL5 0x158 #define XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL6 0x15C -struct lane_cfg { - char *function; - char **lanes; - int iddq; -}; -struct xusbpadctl_softc { +#define WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res, (_r), (_v)) +#define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_r)) + + +struct padctl_softc { device_t dev; struct resource *mem_res; - hwreset_t rst; + hwreset_t rst; int phy_ena_cnt; + + /* Fuses calibration data */ + uint32_t hs_curr_level_0; + uint32_t hs_curr_level_123; + uint32_t hs_iref_cap; + uint32_t hs_term_range_adj; + uint32_t hs_squelch_level; + + uint32_t hs_curr_level_offset; }; static struct ofw_compat_data compat_data[] = { @@ -108,274 +198,295 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; -struct padctl_lane { - const char *name; - bus_size_t reg; - uint32_t shift; - uint32_t mask; - int iddq; - char **mux; - int nmux; +/* Ports. */ +enum padctl_port_type { + PADCTL_PORT_USB2, + PADCTL_PORT_ULPI, + PADCTL_PORT_HSIC, + PADCTL_PORT_USB3, }; -static char *otg_mux[] = {"snps", "xusb", "uart", "rsvd"}; -static char *usb_mux[] = {"snps", "xusb"}; -static char *pci_mux[] = {"pcie", "usb3", "sata", "rsvd"}; +struct padctl_lane; +struct padctl_port { + enum padctl_port_type type; + const char *name; + const char *base_name; + int idx; + int (*init)(struct padctl_softc *sc, + struct padctl_port *port); -#define LANE(n, r, s, m, i, mx) \ -{ \ - .name = n, \ - .reg = r, \ - .shift = s, \ - .mask = m, \ - .iddq = i, \ - .mux = mx, \ - .nmux = nitems(mx), \ -} - -static const struct padctl_lane lanes_tbl[] = { - LANE("otg-0", XUSB_PADCTL_USB2_PAD_MUX, 0, 0x3, -1, otg_mux), - LANE("otg-1", XUSB_PADCTL_USB2_PAD_MUX, 2, 0x3, -1, otg_mux), - LANE("otg-2", XUSB_PADCTL_USB2_PAD_MUX, 4, 0x3, -1, otg_mux), - LANE("ulpi-0", XUSB_PADCTL_USB2_PAD_MUX, 12, 0x1, -1, usb_mux), - LANE("hsic-0", XUSB_PADCTL_USB2_PAD_MUX, 14, 0x1, -1, usb_mux), - LANE("hsic-1", XUSB_PADCTL_USB2_PAD_MUX, 15, 0x1, -1, usb_mux), - LANE("pcie-0", XUSB_PADCTL_USB3_PAD_MUX, 16, 0x3, 1, pci_mux), - LANE("pcie-1", XUSB_PADCTL_USB3_PAD_MUX, 18, 0x3, 2, pci_mux), - LANE("pcie-2", XUSB_PADCTL_USB3_PAD_MUX, 20, 0x3, 3, pci_mux), - LANE("pcie-3", XUSB_PADCTL_USB3_PAD_MUX, 22, 0x3, 4, pci_mux), - LANE("pcie-4", XUSB_PADCTL_USB3_PAD_MUX, 24, 0x3, 5, pci_mux), - LANE("sata-0", XUSB_PADCTL_USB3_PAD_MUX, 26, 0x3, 6, pci_mux), + /* Runtime data. */ + phandle_t xref; + bool enabled; + regulator_t supply_vbus; /* USB2, USB3 */ + bool internal; /* ULPI, USB2, USB3 */ + uint32_t companion; /* USB3 */ + struct padctl_lane *lane; }; -static int -xusbpadctl_mux_function(const struct padctl_lane *lane, char *fnc_name) -{ - int i; +static int usb3_port_init(struct padctl_softc *sc, struct padctl_port *port); - for (i = 0; i < lane->nmux; i++) { - if (strcmp(fnc_name, lane->mux[i]) == 0) - return (i); - } - - return (-1); +#define PORT(t, n, p, i) { \ + .type = t, \ + .name = n "-" #p, \ + .base_name = n, \ + .idx = p, \ + .init = i, \ } +static struct padctl_port ports_tbl[] = { + PORT(PADCTL_PORT_USB2, "usb2", 0, NULL), + PORT(PADCTL_PORT_USB2, "usb2", 1, NULL), + PORT(PADCTL_PORT_USB2, "usb2", 2, NULL), + PORT(PADCTL_PORT_ULPI, "ulpi", 0, NULL), + PORT(PADCTL_PORT_HSIC, "hsic", 0, NULL), + PORT(PADCTL_PORT_HSIC, "hsic", 1, NULL), + PORT(PADCTL_PORT_USB3, "usb3", 0, usb3_port_init), + PORT(PADCTL_PORT_USB3, "usb3", 1, usb3_port_init), +}; -static int -xusbpadctl_config_lane(struct xusbpadctl_softc *sc, char *lane_name, - const struct padctl_lane *lane, struct lane_cfg *cfg) -{ +/* Pads - a group of lannes. */ +enum padctl_pad_type { + PADCTL_PAD_USB2, + PADCTL_PAD_ULPI, + PADCTL_PAD_HSIC, + PADCTL_PAD_PCIE, + PADCTL_PAD_SATA, +}; - int tmp; - uint32_t reg; +struct padctl_lane; +struct padctl_pad { + const char *name; + enum padctl_pad_type type; + int (*powerup)(struct padctl_softc *sc, + struct padctl_lane *lane); + int (*powerdown)(struct padctl_softc *sc, + struct padctl_lane *lane); + /* Runtime data. */ + bool enabled; + struct padctl_lane *lanes[8]; /* Safe maximum value. */ + int nlanes; +}; - reg = bus_read_4(sc->mem_res, lane->reg); - if (cfg->function != NULL) { - tmp = xusbpadctl_mux_function(lane, cfg->function); - if (tmp == -1) { - device_printf(sc->dev, - "Unknown function %s for lane %s\n", cfg->function, - lane_name); - return (EINVAL); - } - reg &= ~(lane->mask << lane->shift); - reg |= (tmp & lane->mask) << lane->shift; - } - if (cfg->iddq != -1) { - if (lane->iddq == -1) { - device_printf(sc->dev, "Invalid IDDQ for lane %s\n", - lane_name); - return (EINVAL); - } - if (cfg->iddq != 0) - reg &= ~(1 << lane->iddq); - else - reg |= 1 << lane->iddq; - } +static int usb2_powerup(struct padctl_softc *sc, struct padctl_lane *lane); +static int usb2_powerdown(struct padctl_softc *sc, struct padctl_lane *lane); +static int pcie_powerup(struct padctl_softc *sc, struct padctl_lane *lane); +static int pcie_powerdown(struct padctl_softc *sc, struct padctl_lane *lane); +static int sata_powerup(struct padctl_softc *sc, struct padctl_lane *lane); +static int sata_powerdown(struct padctl_softc *sc, struct padctl_lane *lane); - bus_write_4(sc->mem_res, lane->reg, reg); - return (0); +#define PAD(n, t, u, d) { \ + .name = n, \ + .type = t, \ + .powerup = u, \ + .powerdown = d, \ } +static struct padctl_pad pads_tbl[] = { + PAD("usb2", PADCTL_PAD_USB2, usb2_powerup, usb2_powerdown), + PAD("ulpi", PADCTL_PAD_ULPI, NULL, NULL), + PAD("hsic", PADCTL_PAD_HSIC, NULL, NULL), + PAD("pcie", PADCTL_PAD_PCIE, pcie_powerup, pcie_powerdown), + PAD("sata", PADCTL_PAD_SATA, sata_powerup, sata_powerdown), +}; -static const struct padctl_lane * -xusbpadctl_search_lane(char *lane_name) -{ - int i; +/* Lanes. */ +static char *otg_mux[] = {"snps", "xusb", "uart", "rsvd"}; +static char *usb_mux[] = {"snps", "xusb"}; +static char *pci_mux[] = {"pcie", "usb3-ss", "sata", "rsvd"}; - for (i = 0; i < nitems(lanes_tbl); i++) { - if (strcmp(lane_name, lanes_tbl[i].name) == 0) - return (&lanes_tbl[i]); - } +struct padctl_lane { + const char *name; + int idx; + bus_size_t reg; + uint32_t shift; + uint32_t mask; + char **mux; + int nmux; + /* Runtime data. */ + bool enabled; + phandle_t xref; + struct padctl_pad *pad; + struct padctl_port *port; + int mux_idx; - return (NULL); -} +}; -static int -xusbpadctl_config_node(struct xusbpadctl_softc *sc, char *lane_name, - struct lane_cfg *cfg) -{ - const struct padctl_lane *lane; - int rv; - - lane = xusbpadctl_search_lane(lane_name); - if (lane == NULL) { - device_printf(sc->dev, "Unknown lane: %s\n", lane_name); - return (ENXIO); - } - rv = xusbpadctl_config_lane(sc, lane_name, lane, cfg); - return (rv); +#define LANE(n, p, r, s, m, mx) { \ + .name = n "-" #p, \ + .idx = p, \ + .reg = r, \ + .shift = s, \ + .mask = m, \ + .mux = mx, \ + .nmux = nitems(mx), \ } +static struct padctl_lane lanes_tbl[] = { + LANE("usb2", 0, XUSB_PADCTL_USB2_PAD_MUX, 0, 0x3, otg_mux), + LANE("usb2", 1, XUSB_PADCTL_USB2_PAD_MUX, 2, 0x3, otg_mux), + LANE("usb2", 2, XUSB_PADCTL_USB2_PAD_MUX, 4, 0x3, otg_mux), + LANE("ulpi", 0, XUSB_PADCTL_USB2_PAD_MUX, 12, 0x1, usb_mux), + LANE("hsic", 0, XUSB_PADCTL_USB2_PAD_MUX, 14, 0x1, usb_mux), + LANE("hsic", 1, XUSB_PADCTL_USB2_PAD_MUX, 15, 0x1, usb_mux), + LANE("pcie", 0, XUSB_PADCTL_USB3_PAD_MUX, 16, 0x3, pci_mux), + LANE("pcie", 1, XUSB_PADCTL_USB3_PAD_MUX, 18, 0x3, pci_mux), + LANE("pcie", 2, XUSB_PADCTL_USB3_PAD_MUX, 20, 0x3, pci_mux), + LANE("pcie", 3, XUSB_PADCTL_USB3_PAD_MUX, 22, 0x3, pci_mux), + LANE("pcie", 4, XUSB_PADCTL_USB3_PAD_MUX, 24, 0x3, pci_mux), + LANE("sata", 0, XUSB_PADCTL_USB3_PAD_MUX, 26, 0x3, pci_mux), +}; -static int -xusbpadctl_read_node(struct xusbpadctl_softc *sc, phandle_t node, - struct lane_cfg *cfg, char **lanes, int *llanes) -{ - int rv; +/* Define all possible mappings for USB3 port lanes */ +struct padctl_lane_map { + int port_idx; + enum padctl_pad_type pad_type; + int lane_idx; +}; - *llanes = OF_getprop_alloc(node, "nvidia,lanes", 1, (void **)lanes); - if (*llanes <= 0) - return (ENOENT); - - /* Read function (mux) settings. */ - rv = OF_getprop_alloc(node, "nvidia,function", 1, - (void **)&cfg->function); - if (rv <= 0) - cfg->function = NULL; - /* Read numeric properties. */ - rv = OF_getencprop(node, "nvidia,iddq", &cfg->iddq, - sizeof(cfg->iddq)); - if (rv <= 0) - cfg->iddq = -1; - return (0); +#define LANE_MAP(pi, pt, li) { \ + .port_idx = pi, \ + .pad_type = pt, \ + .lane_idx = li, \ } +static struct padctl_lane_map lane_map_tbl[] = { + LANE_MAP(0, PADCTL_PAD_PCIE, 0), /* port USB3-0 -> lane PCIE-0 */ + LANE_MAP(1, PADCTL_PAD_PCIE, 1), /* port USB3-1 -> lane PCIE-1 */ + /* -- or -- */ + LANE_MAP(1, PADCTL_PAD_SATA, 0), /* port USB3-1 -> lane SATA-0 */ +}; +static struct padctl_port *search_lane_port(struct padctl_softc *sc, + struct padctl_lane *lane); +/* ------------------------------------------------------------------------- + * + * PHY functions + */ static int -xusbpadctl_process_node(struct xusbpadctl_softc *sc, phandle_t node) +usb3_port_init(struct padctl_softc *sc, struct padctl_port *port) { - struct lane_cfg cfg; - char *lanes, *lname; - int i, len, llanes, rv; + uint32_t reg; - rv = xusbpadctl_read_node(sc, node, &cfg, &lanes, &llanes); - if (rv != 0) - return (rv); + reg = RD4(sc, XUSB_PADCTL_SS_PORT_MAP); + if (port->internal) + reg &= ~SS_PORT_MAP_PORT_INTERNAL(port->idx); + else + reg |= SS_PORT_MAP_PORT_INTERNAL(port->idx); + reg &= ~SS_PORT_MAP_PORT_MAP(port->idx, ~0); + reg |= SS_PORT_MAP_PORT_MAP(port->idx, port->companion); + WR4(sc, XUSB_PADCTL_SS_PORT_MAP, reg); - len = 0; - lname = lanes; - do { - i = strlen(lname) + 1; - rv = xusbpadctl_config_node(sc, lname, &cfg); - if (rv != 0) - device_printf(sc->dev, - "Cannot configure lane: %s: %d\n", lname, rv); + reg = RD4(sc, XUSB_PADCTL_IOPHY_USB3_PAD_CTL2(port->idx)); + reg &= ~IOPHY_USB3_PAD_CTL2_CDR_CNTL(~0); + reg &= ~IOPHY_USB3_PAD_CTL2_RX_EQ(~0); + reg &= ~IOPHY_USB3_PAD_CTL2_RX_WANDER(~0); + reg |= IOPHY_USB3_PAD_CTL2_CDR_CNTL(0x24); + reg |= IOPHY_USB3_PAD_CTL2_RX_EQ(0xF070); + reg |= IOPHY_USB3_PAD_CTL2_RX_WANDER(0xF); + WR4(sc, XUSB_PADCTL_IOPHY_USB3_PAD_CTL2(port->idx), reg); - len += i; - lname += i; - } while (len < llanes); + WR4(sc, XUSB_PADCTL_IOPHY_USB3_PAD_CTL4(port->idx), + 0x002008EE); - if (lanes != NULL) - OF_prop_free(lanes); - if (cfg.function != NULL) - OF_prop_free(cfg.function); - return (rv); -} + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_SSP_ELPG_VCORE_DOWN(port->idx); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_SSP_ELPG_CLAMP_EN_EARLY(port->idx); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); -static int -xusbpadctl_pinctrl_cfg(device_t dev, phandle_t cfgxref) -{ - struct xusbpadctl_softc *sc; - phandle_t node, cfgnode; - int rv; + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_SSP_ELPG_CLAMP_EN(port->idx); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); - sc = device_get_softc(dev); - cfgnode = OF_node_from_xref(cfgxref); - - rv = 0; - for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) { - if (!fdt_is_enabled(node)) - continue; - rv = xusbpadctl_process_node(sc, node); - if (rv != 0) - return (rv); - } - - return (rv); + return (0); } static int -xusbpadctl_phy_pcie_powerup(struct xusbpadctl_softc *sc) +pcie_powerup(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; int i; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); - reg &= ~IOPHY_PLL_P0_CTL1_REFCLK_SEL_MASK; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + reg &= ~IOPHY_PLL_P0_CTL1_REFCLK_SEL(~0); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL2); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL2); reg |= IOPHY_PLL_P0_CTL2_REFCLKBUF_EN; reg |= IOPHY_PLL_P0_CTL2_TXCLKREF_EN; reg |= IOPHY_PLL_P0_CTL2_TXCLKREF_SEL; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL2, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL2, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); reg |= IOPHY_PLL_P0_CTL1_PLL_RST; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); DELAY(100); - for (i = 0; i < 100; i++) { - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + for (i = 100; i > 0; i--) { + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); if (reg & IOPHY_PLL_P0_CTL1_PLL0_LOCKDET) - return (0); + break; DELAY(10); } + if (i <= 0) { + device_printf(sc->dev, "Failed to power up PCIe phy\n"); + return (ETIMEDOUT); + } + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg |= USB3_PAD_MUX_PCIE_IDDQ_DISABLE(lane->idx); + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); - return (ETIMEDOUT); + return (0); } - static int -xusbpadctl_phy_pcie_powerdown(struct xusbpadctl_softc *sc) +pcie_powerdown(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg &= ~USB3_PAD_MUX_PCIE_IDDQ_DISABLE(lane->idx); + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1); reg &= ~IOPHY_PLL_P0_CTL1_PLL_RST; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_P0_CTL1, reg); DELAY(100); + return (0); } static int -xusbpadctl_phy_sata_powerup(struct xusbpadctl_softc *sc) +sata_powerup(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; int i; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); reg &= ~IOPHY_MISC_PAD_S0_CTL1_IDDQ_OVRD; reg &= ~IOPHY_MISC_PAD_S0_CTL1_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg &= ~IOPHY_PLL_S0_CTL1_PLL_PWR_OVRD; reg &= ~IOPHY_PLL_S0_CTL1_PLL_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg |= IOPHY_PLL_S0_CTL1_PLL1_MODE; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg |= IOPHY_PLL_S0_CTL1_PLL_RST_L; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); for (i = 100; i >= 0; i--) { - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); if (reg & IOPHY_PLL_S0_CTL1_PLL1_LOCKDET) break; DELAY(100); @@ -384,128 +495,233 @@ xusbpadctl_phy_sata_powerup(struct xusbpadctl_softc *s device_printf(sc->dev, "Failed to power up SATA phy\n"); return (ETIMEDOUT); } + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg |= IOPHY_PLL_S0_CTL1_PLL_RST_L; + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg |= USB3_PAD_MUX_SATA_IDDQ_DISABLE; + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + return (0); } static int -xusbpadctl_phy_sata_powerdown(struct xusbpadctl_softc *sc) +sata_powerdown(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_USB3_PAD_MUX); + reg &= ~USB3_PAD_MUX_SATA_IDDQ_DISABLE; + WR4(sc, XUSB_PADCTL_USB3_PAD_MUX, reg); + + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg &= ~IOPHY_PLL_S0_CTL1_PLL_RST_L; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg &= ~IOPHY_PLL_S0_CTL1_PLL1_MODE; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1); reg |= IOPHY_PLL_S0_CTL1_PLL_PWR_OVRD; reg |= IOPHY_PLL_S0_CTL1_PLL_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_PLL_S0_CTL1, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); + reg = RD4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1); reg |= IOPHY_MISC_PAD_S0_CTL1_IDDQ_OVRD; reg |= IOPHY_MISC_PAD_S0_CTL1_IDDQ; - bus_write_4(sc->mem_res, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); + WR4(sc, XUSB_PADCTL_IOPHY_MISC_PAD_S0_CTL1, reg); DELAY(100); return (0); } static int -xusbpadctl_phy_powerup(struct xusbpadctl_softc *sc) +usb2_powerup(struct padctl_softc *sc, struct padctl_lane *lane) { uint32_t reg; + struct padctl_port *port; + int rv; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); + port = search_lane_port(sc, lane); + if (port == NULL) { + device_printf(sc->dev, "Cannot find port for lane: %s\n", + lane->name); + } + reg = RD4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); + reg &= ~USB2_BIAS_PAD_CTL0_HS_SQUELCH_LEVEL(~0); + reg &= ~USB2_BIAS_PAD_CTL0_HS_DISCON_LEVEL(~0); + reg |= USB2_BIAS_PAD_CTL0_HS_SQUELCH_LEVEL(sc->hs_squelch_level); + reg |= USB2_BIAS_PAD_CTL0_HS_DISCON_LEVEL(5); + WR4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0, reg); + + reg = RD4(sc, XUSB_PADCTL_USB2_PORT_CAP); + reg &= ~USB2_PORT_CAP_PORT_CAP(lane->idx, ~0); + reg |= USB2_PORT_CAP_PORT_CAP(lane->idx, USB2_PORT_CAP_PORT_CAP_HOST); + WR4(sc, XUSB_PADCTL_USB2_PORT_CAP, reg); + + reg = RD4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL0(lane->idx)); + reg &= ~USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(~0); + reg &= ~USB2_OTG_PAD_CTL0_HS_SLEW(~0); + reg &= ~USB2_OTG_PAD_CTL0_LS_RSLEW(~0); + reg &= ~USB2_OTG_PAD_CTL0_PD; + reg &= ~USB2_OTG_PAD_CTL0_PD2; + reg &= ~USB2_OTG_PAD_CTL0_PD_ZI; + + reg |= USB2_OTG_PAD_CTL0_HS_SLEW(14); + if (lane->idx == 0) { + reg |= USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(sc->hs_curr_level_0); + reg |= USB2_OTG_PAD_CTL0_LS_RSLEW(3); + } else { + reg |= USB2_OTG_PAD_CTL0_HS_CURR_LEVEL(sc->hs_curr_level_123); + reg |= USB2_OTG_PAD_CTL0_LS_RSLEW(0); + } + WR4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL0(lane->idx), reg); + + reg = RD4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL1(lane->idx)); + reg &= ~USB2_OTG_PAD_CTL1_TERM_RANGE_ADJ(~0); + reg &= ~USB2_OTG_PAD_CTL1_HS_IREF_CAP(~0); + reg &= ~USB2_OTG_PAD_CTL1_PD_DR; + reg &= ~USB2_OTG_PAD_CTL1_PD_DISC_FORCE_POWERUP; + reg &= ~USB2_OTG_PAD_CTL1_PD_CHRP_FORCE_POWERUP; + + reg |= USB2_OTG_PAD_CTL1_TERM_RANGE_ADJ(sc->hs_term_range_adj); + reg |= USB2_OTG_PAD_CTL1_HS_IREF_CAP(sc->hs_iref_cap); + WR4(sc, XUSB_PADCTL_USB2_OTG_PAD_CTL1(lane->idx), reg); + + if (port != NULL && port->supply_vbus != NULL) { + rv = regulator_enable(port->supply_vbus); + if (rv != 0) { + device_printf(sc->dev, + "Cannot enable vbus regulator\n"); + return (rv); + } + } + reg = RD4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); + reg &= ~USB2_BIAS_PAD_CTL0_PD; + WR4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0, reg); + + return (0); +} + +static int +usb2_powerdown(struct padctl_softc *sc, struct padctl_lane *lane) +{ + uint32_t reg; + struct padctl_port *port; + int rv; + + port = search_lane_port(sc, lane); + if (port == NULL) { + device_printf(sc->dev, "Cannot find port for lane: %s\n", + lane->name); + } + reg = RD4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0); + reg |= USB2_BIAS_PAD_CTL0_PD; + WR4(sc, XUSB_PADCTL_USB2_BIAS_PAD_CTL0, reg); + + if (port != NULL && port->supply_vbus != NULL) { + rv = regulator_enable(port->supply_vbus); + if (rv != 0) { + device_printf(sc->dev, + "Cannot disable vbus regulator\n"); + return (rv); + } + } + return (0); +} + + +static int +phy_powerup(struct padctl_softc *sc) +{ + uint32_t reg; + + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); + + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); - reg &= ~ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); - DELAY(100); - return (0); } static int -xusbpadctl_phy_powerdown(struct xusbpadctl_softc *sc) +phy_powerdown(struct padctl_softc *sc) { uint32_t reg; - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); - reg |= ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); - DELAY(100); - - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); reg |= ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); - reg = bus_read_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); reg |= ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN; - bus_write_4(sc->mem_res, XUSB_PADCTL_ELPG_PROGRAM, reg); + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); DELAY(100); + reg = RD4(sc, XUSB_PADCTL_ELPG_PROGRAM); + reg |= ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN; + WR4(sc, XUSB_PADCTL_ELPG_PROGRAM, reg); + DELAY(100); + return (0); } static int xusbpadctl_phy_enable(device_t dev, intptr_t id, bool enable) { - struct xusbpadctl_softc *sc; + struct padctl_softc *sc; + struct padctl_lane *lane; + struct padctl_pad *pad; int rv; sc = device_get_softc(dev); - if ((id != TEGRA_XUSB_PADCTL_PCIE) && - (id != TEGRA_XUSB_PADCTL_SATA)) { + if (id < 0 || id >= nitems(lanes_tbl)) { device_printf(dev, "Unknown phy: %d\n", id); return (ENXIO); } - - rv = 0; + lane = lanes_tbl + id; + if (!lane->enabled) { + device_printf(dev, "Lane is not enabled/configured: %s\n", + lane->name); + return (ENXIO); + } + pad = lane->pad; if (enable) { if (sc->phy_ena_cnt == 0) { - rv = xusbpadctl_phy_powerup(sc); + rv = phy_powerup(sc); if (rv != 0) return (rv); } sc->phy_ena_cnt++; } - if (id == TEGRA_XUSB_PADCTL_PCIE) { - if (enable) - rv = xusbpadctl_phy_pcie_powerup(sc); - else - rv = xusbpadctl_phy_pcie_powerdown(sc); - if (rv != 0) - return (rv); - } else if (id == TEGRA_XUSB_PADCTL_SATA) { - if (enable) - rv = xusbpadctl_phy_sata_powerup(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 12:30:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD5A9F8A7FC; Wed, 4 Apr 2018 12:30:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 714897752F; Wed, 4 Apr 2018 12:30:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C24313ABD; Wed, 4 Apr 2018 12:30:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34CUrSa010072; Wed, 4 Apr 2018 12:30:53 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34CUrL7010067; Wed, 4 Apr 2018 12:30:53 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041230.w34CUrL7010067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 12:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332011 - in head/sys/arm/mv: . armada X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys/arm/mv: . armada X-SVN-Commit-Revision: 332011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:30:54 -0000 Author: mw Date: Wed Apr 4 12:30:52 2018 New Revision: 332011 URL: https://svnweb.freebsd.org/changeset/base/332011 Log: Make Marvell armv7 timer and wdt registers definitions common Define timers registers for both SoCs and choose proper one during runtime based on information from FDT. In WDT driver there are different function for ArmadaXP and other ARMv5 SoCs. In timer driver registers definitions are stored in resource_spec structure and chosen during runtime. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14746 Modified: head/sys/arm/mv/armada/wdt.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/armada/wdt.c ============================================================================== --- head/sys/arm/mv/armada/wdt.c Wed Apr 4 11:30:20 2018 (r332010) +++ head/sys/arm/mv/armada/wdt.c Wed Apr 4 12:30:52 2018 (r332011) @@ -253,8 +253,12 @@ mv_wdt_enable_armada_38x_xp_helper() static void mv_wdt_enable_armada_38x(void) { - uint32_t val; + uint32_t val, irq_cause; + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); + irq_cause &= IRQ_TIMER_WD_CLR; + write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + mv_wdt_enable_armada_38x_xp_helper(); val = mv_get_timer_control(); @@ -265,7 +269,10 @@ mv_wdt_enable_armada_38x(void) static void mv_wdt_enable_armada_xp(void) { - uint32_t val; + uint32_t val, irq_cause; + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE_ARMADAXP); + irq_cause &= IRQ_TIMER_WD_CLR_ARMADAXP; + write_cpu_ctrl(BRIDGE_IRQ_CAUSE_ARMADAXP, irq_cause); mv_wdt_enable_armada_38x_xp_helper(); Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Wed Apr 4 11:30:20 2018 (r332010) +++ head/sys/arm/mv/mvreg.h Wed Apr 4 12:30:52 2018 (r332011) @@ -76,18 +76,16 @@ #define MSI_IRQ_NUM 32 #define IRQ_CPU_SELF 0x00000001 -#if defined(SOC_MV_ARMADAXP) -#define BRIDGE_IRQ_CAUSE 0x68 -#define IRQ_TIMER0 0x00000001 -#define IRQ_TIMER1 0x00000002 -#define IRQ_TIMER_WD 0x00000004 -#else +#define BRIDGE_IRQ_CAUSE_ARMADAXP 0x68 +#define IRQ_TIMER0_ARMADAXP 0x00000001 +#define IRQ_TIMER1_ARMADAXP 0x00000002 +#define IRQ_TIMER_WD_ARMADAXP 0x00000004 + #define BRIDGE_IRQ_CAUSE 0x10 #define IRQ_CPU_SELF 0x00000001 #define IRQ_TIMER0 0x00000002 #define IRQ_TIMER1 0x00000004 #define IRQ_TIMER_WD 0x00000008 -#endif #define BRIDGE_IRQ_MASK 0x14 #define IRQ_CPU_MASK 0x00000001 @@ -97,8 +95,10 @@ #define IRQ_CPU_SELF_CLR (~IRQ_CPU_SELF) #define IRQ_TIMER0_CLR (~IRQ_TIMER0) -#define IRQ_TIMER1_CLR (~IRQ_TIMER1) #define IRQ_TIMER_WD_CLR (~IRQ_TIMER_WD) + +#define IRQ_TIMER0_CLR_ARMADAXP (~IRQ_TIMER0_ARMADAXP) +#define IRQ_TIMER_WD_CLR_ARMADAXP (~IRQ_TIMER_WD_ARMADAXP) /* * System reset Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Wed Apr 4 11:30:20 2018 (r332010) +++ head/sys/arm/mv/timer.c Wed Apr 4 12:30:52 2018 (r332011) @@ -73,6 +73,9 @@ struct mv_timer_config { mv_watchdog_enable_t watchdog_enable; mv_watchdog_disable_t watchdog_disable; unsigned int clock_src; + uint32_t bridge_irq_cause; + uint32_t irq_timer0_clr; + uint32_t irq_timer_wd_clr; }; struct mv_timer_softc { @@ -132,6 +135,9 @@ static struct mv_timer_config timer_armadaxp_config = &mv_watchdog_enable_armadaxp, &mv_watchdog_disable_armadaxp, MV_CLOCK_SRC_ARMV7, + BRIDGE_IRQ_CAUSE_ARMADAXP, + IRQ_TIMER0_CLR_ARMADAXP, + IRQ_TIMER_WD_CLR_ARMADAXP, }; static struct mv_timer_config timer_armv5_config = { @@ -139,6 +145,9 @@ static struct mv_timer_config timer_armv5_config = &mv_watchdog_enable_armv5, &mv_watchdog_disable_armv5, 0, + BRIDGE_IRQ_CAUSE, + IRQ_TIMER0_CLR, + IRQ_TIMER_WD_CLR, }; static struct ofw_compat_data mv_timer_soc_config[] = { @@ -228,10 +237,10 @@ mv_timer_attach(device_t dev) mv_setup_timers(); if (sc->config->soc_family != MV_SOC_ARMADA_XP ) { - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER0_CLR; + irq_cause = read_cpu_ctrl(sc->config->bridge_irq_cause); + irq_cause &= sc->config->irq_timer0_clr; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + write_cpu_ctrl(sc->config->bridge_irq_cause, irq_cause); irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); irq_mask |= IRQ_TIMER0_MASK; irq_mask &= ~IRQ_TIMER1_MASK; @@ -263,9 +272,9 @@ mv_hardclock(void *arg) struct mv_timer_softc *sc; uint32_t irq_cause; - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER0_CLR; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); + irq_cause &= timer_softc->config->irq_timer0_clr; + write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); sc = (struct mv_timer_softc *)arg; if (sc->et.et_active) @@ -381,9 +390,9 @@ mv_watchdog_enable_armv5(void) { uint32_t val, irq_cause, irq_mask; - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER_WD_CLR; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); + irq_cause &= timer_softc->config->irq_timer_wd_clr; + write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); irq_mask |= IRQ_TIMER_WD_MASK; @@ -403,9 +412,9 @@ mv_watchdog_enable_armadaxp(void) { uint32_t irq_cause, val; - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER_WD_CLR; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); + irq_cause &= timer_softc->config->irq_timer_wd_clr; + write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); val = read_cpu_mp_clocks(WD_RSTOUTn_MASK); val |= (WD_GLOBAL_MASK | WD_CPU0_MASK); @@ -437,9 +446,9 @@ mv_watchdog_disable_armv5(void) irq_mask &= ~(IRQ_TIMER_WD_MASK); write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER_WD_CLR; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); + irq_cause &= timer_softc->config->irq_timer_wd_clr; + write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); } static void @@ -455,9 +464,9 @@ mv_watchdog_disable_armadaxp(void) val |= RSTOUTn_MASK_WD; write_cpu_misc(RSTOUTn_MASK_ARMV7, RSTOUTn_MASK_WD); - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= IRQ_TIMER_WD_CLR; - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_cause = read_cpu_ctrl(timer_softc->config->bridge_irq_cause); + irq_cause &= timer_softc->config->irq_timer_wd_clr; + write_cpu_ctrl(timer_softc->config->bridge_irq_cause, irq_cause); val = mv_get_timer_control(); val &= ~(CPU_TIMER2_EN | CPU_TIMER2_AUTO); From owner-svn-src-all@freebsd.org Wed Apr 4 12:33:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9B61F8ABF5; Wed, 4 Apr 2018 12:33:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9818577885; Wed, 4 Apr 2018 12:33:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 929EC13C42; Wed, 4 Apr 2018 12:33:47 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34CXlW0015748; Wed, 4 Apr 2018 12:33:47 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34CXleW015734; Wed, 4 Apr 2018 12:33:47 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804041233.w34CXleW015734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 4 Apr 2018 12:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/... X-SVN-Group: vendor X-SVN-Commit-Author: br X-SVN-Commit-Paths: in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/decoder/build/win-vs2015 ... X-SVN-Commit-Revision: 332012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:33:48 -0000 Author: br Date: Wed Apr 4 12:33:46 2018 New Revision: 332012 URL: https://svnweb.freebsd.org/changeset/base/332012 Log: Import OpenCSD -- an ARM CoreSight Trace Decode library. Git ID 900407e9d6400f6541138d6c2e483a9fc2d699a4 Sponsored by: DARPA, AFRL Added: vendor/opencsd/ vendor/opencsd/dist/ vendor/opencsd/dist/.gitignore vendor/opencsd/dist/HOWTO.md vendor/opencsd/dist/LICENSE vendor/opencsd/dist/README.md vendor/opencsd/dist/TODO vendor/opencsd/dist/decoder/ vendor/opencsd/dist/decoder/build/ vendor/opencsd/dist/decoder/build/linux/ vendor/opencsd/dist/decoder/build/linux/makefile (contents, props changed) vendor/opencsd/dist/decoder/build/linux/rctdl_c_api_lib/ vendor/opencsd/dist/decoder/build/linux/rctdl_c_api_lib/makefile (contents, props changed) vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/ vendor/opencsd/dist/decoder/build/linux/ref_trace_decode_lib/makefile (contents, props changed) vendor/opencsd/dist/decoder/build/win-vs2015/ vendor/opencsd/dist/decoder/build/win-vs2015/opencsd.props vendor/opencsd/dist/decoder/build/win-vs2015/rctdl_c_api_lib/ vendor/opencsd/dist/decoder/build/win-vs2015/rctdl_c_api_lib/rctdl_c_api_lib.vcxproj vendor/opencsd/dist/decoder/build/win-vs2015/rctdl_c_api_lib/rctdl_c_api_lib.vcxproj.filters vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.sln vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj vendor/opencsd/dist/decoder/build/win-vs2015/ref_trace_decode_lib/ref_trace_decode_lib.vcxproj.filters vendor/opencsd/dist/decoder/docs/ vendor/opencsd/dist/decoder/docs/build_libs.md vendor/opencsd/dist/decoder/docs/doxygen_config.dox vendor/opencsd/dist/decoder/docs/external_custom.md vendor/opencsd/dist/decoder/docs/specs/ vendor/opencsd/dist/decoder/docs/specs/ARM Trace and Debug Snapshot file format 0v2.pdf (contents, props changed) vendor/opencsd/dist/decoder/docs/test_progs.md vendor/opencsd/dist/decoder/include/ vendor/opencsd/dist/decoder/include/common/ vendor/opencsd/dist/decoder/include/common/comp_attach_notifier_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/comp_attach_pt_t.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_code_follower.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_dcd_mngr_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_dcd_tree.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_dcd_tree_elem.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_error.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_error_logger.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_gen_elem_list.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_lib_dcd_register.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_msg_logger.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_pe_context.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/ocsd_version.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_component.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_core_arch_map.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_cs_config.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_frame_deformatter.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_gen_elem.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_pkt_decode_base.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_pkt_elem_base.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_pkt_proc_base.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_printable_elem.h (contents, props changed) vendor/opencsd/dist/decoder/include/common/trc_ret_stack.h (contents, props changed) vendor/opencsd/dist/decoder/include/i_dec/ vendor/opencsd/dist/decoder/include/i_dec/trc_i_decode.h (contents, props changed) vendor/opencsd/dist/decoder/include/i_dec/trc_idec_arminst.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/ vendor/opencsd/dist/decoder/include/interfaces/trc_abs_typed_base_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_data_raw_in_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_data_rawframe_in_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_error_log_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_gen_elem_in_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_indexer_pkt_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_indexer_src_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_instr_decode_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_pkt_in_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_pkt_raw_in_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/interfaces/trc_tgt_mem_access_i.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/ vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_base.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_bufptr.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_cb.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_cb_if.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_file.h (contents, props changed) vendor/opencsd/dist/decoder/include/mem_acc/trc_mem_acc_mapper.h (contents, props changed) vendor/opencsd/dist/decoder/include/ocsd_if_version.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ vendor/opencsd/dist/decoder/include/opencsd.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/c_api/ vendor/opencsd/dist/decoder/include/opencsd/c_api/ocsd_c_api_cust_fact.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/c_api/ocsd_c_api_cust_impl.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/c_api/ocsd_c_api_custom.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/c_api/ocsd_c_api_types.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/c_api/opencsd_c_api.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/ vendor/opencsd/dist/decoder/include/opencsd/etmv3/etmv3_decoder.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_cmp_cfg_etmv3.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_dcd_mngr_etmv3.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_pkt_decode_etmv3.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_pkt_elem_etmv3.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_pkt_proc_etmv3.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv3/trc_pkt_types_etmv3.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/ vendor/opencsd/dist/decoder/include/opencsd/etmv4/etmv4_decoder.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_cmp_cfg_etmv4.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_dcd_mngr_etmv4i.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_etmv4_stack_elem.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_decode_etmv4i.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4d.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ocsd_if_types.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/ vendor/opencsd/dist/decoder/include/opencsd/ptm/ptm_decoder.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_cmp_cfg_ptm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_dcd_mngr_ptm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_pkt_decode_ptm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_pkt_elem_ptm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_pkt_proc_ptm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/ptm/trc_pkt_types_ptm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/ vendor/opencsd/dist/decoder/include/opencsd/stm/stm_decoder.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/trc_cmp_cfg_stm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/trc_dcd_mngr_stm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/trc_pkt_decode_stm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/trc_pkt_elem_stm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/trc_pkt_proc_stm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/stm/trc_pkt_types_stm.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/trc_gen_elem_types.h (contents, props changed) vendor/opencsd/dist/decoder/include/opencsd/trc_pkt_types.h (contents, props changed) vendor/opencsd/dist/decoder/include/pkt_printers/ vendor/opencsd/dist/decoder/include/pkt_printers/gen_elem_printer.h (contents, props changed) vendor/opencsd/dist/decoder/include/pkt_printers/item_printer.h (contents, props changed) vendor/opencsd/dist/decoder/include/pkt_printers/pkt_printer_t.h (contents, props changed) vendor/opencsd/dist/decoder/include/pkt_printers/raw_frame_printer.h (contents, props changed) vendor/opencsd/dist/decoder/include/pkt_printers/trc_pkt_printers.h (contents, props changed) vendor/opencsd/dist/decoder/include/pkt_printers/trc_print_fact.h (contents, props changed) vendor/opencsd/dist/decoder/source/ vendor/opencsd/dist/decoder/source/c_api/ vendor/opencsd/dist/decoder/source/c_api/ocsd_c_api.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/c_api/ocsd_c_api_custom_obj.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/c_api/ocsd_c_api_custom_obj.h (contents, props changed) vendor/opencsd/dist/decoder/source/c_api/ocsd_c_api_obj.h (contents, props changed) vendor/opencsd/dist/decoder/source/etmv3/ vendor/opencsd/dist/decoder/source/etmv3/trc_cmp_cfg_etmv3.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv3/trc_pkt_decode_etmv3.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv3/trc_pkt_elem_etmv3.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv3/trc_pkt_proc_etmv3.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv3/trc_pkt_proc_etmv3_impl.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv3/trc_pkt_proc_etmv3_impl.h (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/ vendor/opencsd/dist/decoder/source/etmv4/trc_cmp_cfg_etmv4.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_etmv4_stack_elem.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_elem_etmv4d.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_elem_etmv4i.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4d_impl.h (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.h (contents, props changed) vendor/opencsd/dist/decoder/source/i_dec/ vendor/opencsd/dist/decoder/source/i_dec/trc_i_decode.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/i_dec/trc_idec_arminst.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/mem_acc/ vendor/opencsd/dist/decoder/source/mem_acc/trc_mem_acc_base.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/mem_acc/trc_mem_acc_bufptr.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/mem_acc/trc_mem_acc_cb.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/mem_acc/trc_mem_acc_file.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/mem_acc/trc_mem_acc_mapper.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_code_follower.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_dcd_tree.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_error.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_error_logger.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_gen_elem_list.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_lib_dcd_register.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_msg_logger.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ocsd_version.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/pkt_printers/ vendor/opencsd/dist/decoder/source/pkt_printers/raw_frame_printer.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/pkt_printers/trc_print_fact.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ptm/ vendor/opencsd/dist/decoder/source/ptm/trc_cmp_cfg_ptm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ptm/trc_pkt_decode_ptm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ptm/trc_pkt_elem_ptm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/ptm/trc_pkt_proc_ptm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/stm/ vendor/opencsd/dist/decoder/source/stm/trc_pkt_decode_stm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/stm/trc_pkt_elem_stm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/stm/trc_pkt_proc_stm.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/trc_component.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/trc_core_arch_map.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/trc_frame_deformatter.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/trc_frame_deformatter_impl.h (contents, props changed) vendor/opencsd/dist/decoder/source/trc_gen_elem.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/trc_printable_elem.cpp (contents, props changed) vendor/opencsd/dist/decoder/source/trc_ret_stack.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/ vendor/opencsd/dist/decoder/tests/build/ vendor/opencsd/dist/decoder/tests/build/linux/ vendor/opencsd/dist/decoder/tests/build/linux/c_api_pkt_print_test/ vendor/opencsd/dist/decoder/tests/build/linux/c_api_pkt_print_test/makefile (contents, props changed) vendor/opencsd/dist/decoder/tests/build/linux/echo_test_dcd_lib/ vendor/opencsd/dist/decoder/tests/build/linux/echo_test_dcd_lib/makefile (contents, props changed) vendor/opencsd/dist/decoder/tests/build/linux/snapshot_parser_lib/ vendor/opencsd/dist/decoder/tests/build/linux/snapshot_parser_lib/makefile (contents, props changed) vendor/opencsd/dist/decoder/tests/build/linux/trc_pkt_lister/ vendor/opencsd/dist/decoder/tests/build/linux/trc_pkt_lister/makefile (contents, props changed) vendor/opencsd/dist/decoder/tests/build/win-vs2015/ vendor/opencsd/dist/decoder/tests/build/win-vs2015/c_api_pkt_print_test/ vendor/opencsd/dist/decoder/tests/build/win-vs2015/c_api_pkt_print_test/c_api_pkt_print_test.vcxproj vendor/opencsd/dist/decoder/tests/build/win-vs2015/c_api_pkt_print_test/c_api_pkt_print_test.vcxproj.filters vendor/opencsd/dist/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ vendor/opencsd/dist/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ext_dcd_echo_test.vcxproj vendor/opencsd/dist/decoder/tests/build/win-vs2015/ext_dcd_echo_test/ext_dcd_echo_test.vcxproj.filters vendor/opencsd/dist/decoder/tests/build/win-vs2015/snapshot_parser_lib/ vendor/opencsd/dist/decoder/tests/build/win-vs2015/snapshot_parser_lib/snapshot_parser_lib.vcxproj vendor/opencsd/dist/decoder/tests/build/win-vs2015/snapshot_parser_lib/snapshot_parser_lib.vcxproj.filters vendor/opencsd/dist/decoder/tests/build/win-vs2015/trc_pkt_lister/ vendor/opencsd/dist/decoder/tests/build/win-vs2015/trc_pkt_lister/trc_pkt_lister.vcxproj vendor/opencsd/dist/decoder/tests/build/win-vs2015/trc_pkt_lister/trc_pkt_lister.vcxproj.filters vendor/opencsd/dist/decoder/tests/ext_dcd_test_eg/ vendor/opencsd/dist/decoder/tests/ext_dcd_test_eg/c_api_echo_test/ vendor/opencsd/dist/decoder/tests/ext_dcd_test_eg/c_api_echo_test/ext_dcd_echo_test.c (contents, props changed) vendor/opencsd/dist/decoder/tests/ext_dcd_test_eg/c_api_echo_test/ext_dcd_echo_test.h (contents, props changed) vendor/opencsd/dist/decoder/tests/ext_dcd_test_eg/c_api_echo_test/ext_dcd_echo_test_fact.c (contents, props changed) vendor/opencsd/dist/decoder/tests/ext_dcd_test_eg/c_api_echo_test/ext_dcd_echo_test_fact.h (contents, props changed) vendor/opencsd/dist/decoder/tests/perf-test-scripts/ vendor/opencsd/dist/decoder/tests/perf-test-scripts/perf-setup-env.bash (contents, props changed) vendor/opencsd/dist/decoder/tests/perf-test-scripts/perf-test-report.bash (contents, props changed) vendor/opencsd/dist/decoder/tests/perf-test-scripts/perf-test-script.bash (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/ vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/ vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/device_info.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/device_parser.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/ini_section_names.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/snapshot_info.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/snapshot_parser.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/snapshot_parser_util.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/snapshot_reader.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/ss_key_value_names.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/ss_to_dcdtree.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/include/trace_snapshots.h (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/ vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/device_info.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/device_parser.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/snapshot_parser.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/snapshot_parser_util.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/snapshot_reader.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/snapshot_parser_lib/source/ss_to_dcdtree.cpp (contents, props changed) vendor/opencsd/dist/decoder/tests/source/ vendor/opencsd/dist/decoder/tests/source/c_api_pkt_print_test.c (contents, props changed) vendor/opencsd/dist/decoder/tests/source/trc_pkt_lister.cpp (contents, props changed) Added: vendor/opencsd/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/.gitignore Wed Apr 4 12:33:46 2018 (r332012) @@ -0,0 +1,76 @@ +# Object files +*.o +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ + +# Vc++ build files +*tlog +Debug/ +ipch/ +*.opensdf +*.sdf +*.suo +*.user +*.idb +*.pdb +*.exp +*.ilk + +# ignore emacs backup saves +*~ + +# ignore bin test directory +bin/ +*.log +ref_trace_decoder/build/win/rctdl_c_api_lib/Release/* +ref_trace_decoder/build/win/rctdl_c_api_lib/x64/Release/* +ref_trace_decoder/build/win/ref_trace_decode_lib/Release/* +ref_trace_decoder/build/win/ref_trace_decode_lib/x64/Release/* +ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/Release/* +ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/x64/Release/* +*.lastbuildstate +*.manifest +*.cache +ref_trace_decoder/docs/html/* +ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/Debug-dll/* +ref_trace_decoder/tests/build/win/simple_pkt_print_c_api/x64/Debug-dll/* +ref_trace_decoder/tests/build/win/trc_pkt_lister/Debug-dll/* +ref_trace_decoder/tests/build/win/trc_pkt_lister/Release-dll/* +ref_trace_decoder/tests/build/win/trc_pkt_lister/x64/Debug-dll/* +ref_trace_decoder/tests/build/win/trc_pkt_lister/x64/Release-dll/* +*.bak +*.orig +decoder/docs/html/* +*.orig +*.VC.db +*.VC.VC.opendb +*.iobj +*.ipdb Added: vendor/opencsd/dist/HOWTO.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/HOWTO.md Wed Apr 4 12:33:46 2018 (r332012) @@ -0,0 +1,661 @@ +HOWTO - using the library with perf {#howto_perf} +=================================== + +@brief Using command line perf and OpenCSD to collect and decode trace. + +This HOWTO explains how to use the perf cmd line tools and the openCSD +library to collect and extract program flow traces generated by the +CoreSight IP blocks on a Linux system. The examples have been generated using +an aarch64 Juno-r0 platform. All information is considered accurate and tested +using the latest version of the library and the `master` branch on the +[perf-opencsd github repository][1]. + + +On Target Trace Acquisition - Perf Record +----------------------------------------- +All the enhancement to the Perf tools that support the new `cs_etm` pmu have +not been upstreamed yet. To get the required functionality branch +`perf-opencsd-master` needs to be downloaded to the target system where +traces are to be collected. This branch is a vanilla upstream kernel +supplemented with modifications to the CoreSight framework and drivers to be +usable by the Perf core. The remaining out of tree patches are being +upstreamed incrementally. + +From there compiling the perf tools with `make -C tools/perf` will yield a +`perf` executable that will support CoreSight trace collection. Note that if +traces are to be decompressed *off* target, there is no need to download and +compile the openCSD library (on the target). + +Before launching a trace run a sink that will collect trace data needs to be +identified. All CoreSight blocks identified by the framework are registed in +sysFS: + + + linaro@linaro-nano:~$ ls /sys/bus/coresight/devices/ + 20010000.etf 20040000.main_funnel 22040000.etm 22140000.etm + 230c0000.A53_funnel 23240000.etm replicator@20020000 20030000.tpiu + 20070000.etr 220c0000.A57_funnel 23040000.etm 23140000.etm 23340000.etm + + +CoreSight blocks are listed in the device tree for a specific system and +discovered at boot time. Since tracers can be linked to more than one sink, +the sink that will recieve trace data needs to be identified and given as an +option on the perf command line. Once a sink has been identify trace collection +can start. An easy and yet interesting example is the `uname` command: + + linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -e cs_etm/@20070000.etr/ --per-thread uname + +This will generate a `perf.data` file where execution has been traced for both +user and kernel space. To narrow the field to either user or kernel space the +`u` and `k` options can be specified. For example the following will limit +traces to user space: + + + linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -vvv -e cs_etm/@20070000.etr/u --per-thread uname + Problems setting modules path maps, continuing anyway... + ----------------------------------------------------------- + perf_event_attr: + type 8 + size 112 + { sample_period, sample_freq } 1 + sample_type IP|TID|IDENTIFIER + read_format ID + disabled 1 + exclude_kernel 1 + exclude_hv 1 + enable_on_exec 1 + sample_id_all 1 + ------------------------------------------------------------ + sys_perf_event_open: pid 11375 cpu -1 group_fd -1 flags 0x8 + ------------------------------------------------------------ + perf_event_attr: + type 1 + size 112 + config 0x9 + { sample_period, sample_freq } 1 + sample_type IP|TID|IDENTIFIER + read_format ID + disabled 1 + exclude_kernel 1 + exclude_hv 1 + mmap 1 + comm 1 + enable_on_exec 1 + task 1 + sample_id_all 1 + mmap2 1 + comm_exec 1 + ------------------------------------------------------------ + sys_perf_event_open: pid 11375 cpu -1 group_fd -1 flags 0x8 + mmap size 266240B + AUX area mmap length 131072 + perf event ring buffer mmapped per thread + Synthesizing auxtrace information + Linux + auxtrace idx 0 old 0 head 0x11ea0 diff 0x11ea0 + [ perf record: Woken up 1 times to write data ] + overlapping maps: + 7f99daf000-7f99db0000 0 [vdso] + 7f99d84000-7f99db3000 0 /lib/aarch64-linux-gnu/ld-2.21.so + 7f99d84000-7f99daf000 0 /lib/aarch64-linux-gnu/ld-2.21.so + 7f99db0000-7f99db3000 0 /lib/aarch64-linux-gnu/ld-2.21.so + failed to write feature 8 + failed to write feature 9 + failed to write feature 14 + [ perf record: Captured and wrote 0.072 MB perf.data ] + + linaro@linaro-nano:~/kernel$ ls -l ~/.debug/ perf.data + _-rw------- 1 linaro linaro 77888 Mar 2 20:41 perf.data + + /home/linaro/.debug/: + total 16 + drwxr-xr-x 2 linaro linaro 4096 Mar 2 20:40 [kernel.kallsyms] + drwxr-xr-x 2 linaro linaro 4096 Mar 2 20:40 [vdso] + drwxr-xr-x 3 linaro linaro 4096 Mar 2 20:40 bin + drwxr-xr-x 3 linaro linaro 4096 Mar 2 20:40 lib + +Trace data filtering +-------------------- +The amount of traces generated by CoreSight tracers is staggering, event for +the most simple trace scenario. Reducing trace generation to specific areas +of interest is desirable to save trace buffer space and avoid getting lost in +the trace data that isn't relevant. Supplementing the 'k' and 'u' options +described above is the notion of address filters. + +On CoreSight two types of address filter have been implemented - address range +and start/stop filter: + +**Address range filters:** +With address range filters traces are generated if the instruction pointer +falls within the specified range. Any work done by the CPU outside of that +range will not be traced. Address range filters can be specified for both +user and kernel space session: + + perf record -e cs_etm/@20070000.etr/k --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname + + perf record -e cs_etm/@20070000.etr/u --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main + +When dealing with kernel space trace addresses are typically taken in the +'System.map' file. In user space addresses are relocatable and can be +extracted from an objdump output: + + $ aarch64-linux-gnu-objdump -d libcstest.so.1.0 + ... + ... + 000000000000072c : <------------ Beginning of traces + 72c: d10083ff sub sp, sp, #0x20 + 730: b9000fe0 str w0, [sp,#12] + 734: b9001fff str wzr, [sp,#28] + 738: 14000007 b 754 + 73c: b9400fe0 ldr w0, [sp,#12] + 740: 11000800 add w0, w0, #0x2 + 744: b9000fe0 str w0, [sp,#12] + 748: b9401fe0 ldr w0, [sp,#28] + 74c: 11000400 add w0, w0, #0x1 + 750: b9001fe0 str w0, [sp,#28] + 754: b9401fe0 ldr w0, [sp,#28] + 758: 7100101f cmp w0, #0x4 + 75c: 54ffff0d b.le 73c + 760: b9400fe0 ldr w0, [sp,#12] + 764: 910083ff add sp, sp, #0x20 + 768: d65f03c0 ret + ... + ... + +Following the address the amount of byte is specified and if tracing in user +space, the full path to the binary (or library) being traced. + +**Start/Stop filters:** +With start/stop filters traces are generated when the instruction pointer is +equal to the start address. Incidentally traces stop being generated when the +insruction pointer is equal to the stop address. Anything that happens between +there to events is traced: + + perf record -e cs_etm/@20070000.etr/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0' --per-thread uname + + perf record -vvv -e cs_etm/@20070000.etr/u --filter 'start 0x72c@/opt/lib/libcstest.so.1.0, \ + stop 0x40082c@/home/linaro/main' \ + --per-thread ./main + +**Limitation on address filters:** +The only limitation on address filters is the amount of address comparator +found on an implementation and the mutual exclusion between range and +start stop filters. As such the following example would _not_ work: + + perf record -e cs_etm/@20070000.etr/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0, \ // start/stop + filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' \ // address range + --per-thread uname + +Additional Trace Options +------------------------ +Additional options can be used during trace collection that add information to the captured trace. + +- Timestamps: These packets are added to the trace streams to allow correlation of different sources where tools support this. +- Cycle Counts: These packets are added to get a count of cycles for blocks of executed instructions. Adding cycle counts will considerably increase the amount of generated trace. +The relationship between cycle counts and executed instructions differs according to the trace protocol. +For example, the ETMv4 protocol will emit counts for groups of instructions according to a minimum count threshold. +Presently this threshold is fixed at 256 cycles for `perf record`. + +Command line options in `perf record` to use these features are part of the options for the `cs_etm` event: + + perf record -e cs_etm/timestamp,cycacc,@20070000.etr/ --per-thread uname + +At current version, `perf record` and `perf script` do not use this additional information. + +On Target Trace Collection +-------------------------- +The entire program flow will have been recorded in the `perf.data` file. +Information about libraries and executable is stored under `$HOME/.debug`: + + linaro@linaro-nano:~/kernel$ tree ~/.debug + .debug + ├── [kernel.kallsyms] + │   └── 0542921808098d591a7acba5a1163e8991897669 + │   └── kallsyms + ├── [vdso] + │   └── 551fbbe29579eb63be3178a04c16830b8d449769 + │   └── vdso + ├── bin + │   └── uname + │   └── ed95e81f97c4471fb2ccc21e356b780eb0c92676 + │   └── elf + └── lib + └── aarch64-linux-gnu + ├── ld-2.21.so + │   └── 94912dc5a1dc8c7ef2c4e4649d4b1639b6ebc8b7 + │   └── elf + └── libc-2.21.so + └── 169a143e9c40cfd9d09695333e45fd67743cd2d6 + └── elf + + 13 directories, 5 files + linaro@linaro-nano:~/kernel$ + + +All this information needs to be collected in order to successfully decode +traces off target: + + linaro@linaro-nano:~/kernel$ tar czf uname.trace.tgz perf.data ~/.debug + + +Note that file `vmlinux` should also be added to the bundle if kernel traces +have also been collected. + + +Off Target OpenCSD Compilation +------------------------------ +The openCSD library is not part of the perf tools. It is available on +[github][1] and needs to be compiled before the perf tools. Checkout the +required branch/tag version into a local directory. + + linaro@t430:~/linaro/coresight$ git clone -b v0.8 https://github.com/Linaro/OpenCSD.git my-opencsd + Cloning into 'OpenCSD'... + remote: Counting objects: 2063, done. + remote: Total 2063 (delta 0), reused 0 (delta 0), pack-reused 2063 + Receiving objects: 100% (2063/2063), 2.51 MiB | 1.24 MiB/s, done. + Resolving deltas: 100% (1399/1399), done. + Checking connectivity... done. + linaro@t430:~/linaro/coresight$ ls my-opencsd + decoder LICENSE README.md HOWTO.md TODO + +Once the source code has been acquired compilation of the openCSD library can +take place. For Linux two options are available, LINUX and LINUX64, based on +the host's (which has nothing to do with the target) architecture: + + linaro@t430:~/linaro/coresight/$ cd my-opencsd/decoder/build/linux/ + linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls + makefile rctdl_c_api_lib ref_trace_decode_lib + + linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ make LINUX64=1 DEBUG=1 + ... + ... + + linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls ../../lib/linux64/dbg/ + libopencsd.a libopencsd_c_api.a libopencsd_c_api.so libopencsd.so + +From there the header file and libraries need to be installed on the system, +something that requires root privileges. The default installation path is +/usr/include/opencsd for the header files and /usr/lib/ for the libraries: + + linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ sudo make install + linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls -l /usr/include/opencsd + total 60 + drwxr-xr-x 2 root root 4096 Dec 12 10:19 c_api + drwxr-xr-x 2 root root 4096 Dec 12 10:19 etmv3 + drwxr-xr-x 2 root root 4096 Dec 12 10:19 etmv4 + -rw-r--r-- 1 root root 28049 Dec 12 10:19 ocsd_if_types.h + drwxr-xr-x 2 root root 4096 Dec 12 10:19 ptm + drwxr-xr-x 2 root root 4096 Dec 12 10:19 stm + -rw-r--r-- 1 root root 7264 Dec 12 10:19 trc_gen_elem_types.h + -rw-r--r-- 1 root root 3972 Dec 12 10:19 trc_pkt_types.h + + linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls -l /usr/lib/libopencsd* + -rw-r--r-- 1 root root 598720 Dec 12 10:19 /usr/lib/libopencsd_c_api.so + -rw-r--r-- 1 root root 4692200 Dec 12 10:19 /usr/lib/libopencsd.so + +A "clean_install" target is also available so that openCSD installed files can +be removed from a system. Going forward the goal is to have the openCSD library +packaged as a Debian or RPM archive so that it can be installed from a +distribution without having to be compiled. + + +Off Target Perf Tools Compilation +--------------------------------- +As mentionned above the openCSD library is not part of the perf tools' code base +and needs to be installed on a system prior to compilation. Information about +the status of the openCSD library on a system is given at compile time by the +perf tools build script: + + linaro@t430:~/linaro/linux-kernel$ make VF=1 -C tools/perf + Auto-detecting system features: + ... dwarf: [ on ] + ... dwarf_getlocations: [ on ] + ... glibc: [ on ] + ... gtk2: [ on ] + ... libaudit: [ on ] + ... libbfd: [ OFF ] + ... libelf: [ on ] + ... libnuma: [ OFF ] + ... numa_num_possible_cpus: [ OFF ] + ... libperl: [ on ] + ... libpython: [ on ] + ... libslang: [ on ] + ... libcrypto: [ on ] + ... libunwind: [ OFF ] + ... libdw-dwarf-unwind: [ on ] + ... zlib: [ on ] + ... lzma: [ OFF ] + ... get_cpuid: [ on ] + ... bpf: [ on ] + ... libopencsd: [ on ] <------- + + +At the end of the compilation a new perf binary is available in `tools/perf/`: + + linaro@t430:~/linaro/linux-kernel$ ldd tools/perf/perf + linux-vdso.so.1 => (0x00007fff135db000) + libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f15f9176000) + librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f15f8f6e000) + libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f15f8c64000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f15f8a60000) + libopencsd_c_api.so => /usr/lib/libopencsd_c_api.so (0x00007f15f884e000) <------- + libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f15f8635000) + libdw.so.1 => /usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007f15f83ec000) + libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007f15f81c5000) + libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f15f7e38000) + libperl.so.5.22 => /usr/lib/x86_64-linux-gnu/libperl.so.5.22 (0x00007f15f7a5d000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f15f7693000) + libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f15f7104000) + libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f15f6eea000) + /lib64/ld-linux-x86-64.so.2 (0x0000559b88038000) + libopencsd.so => /usr/lib/libopencsd.so (0x00007f15f6c62000) <------- + libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f15f68df000) + libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f15f66c9000) + liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f15f64a6000) + libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f15f6296000) + libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f15f605e000) + libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f15f5e5a000) + + +Additional debug output from the decoder can be compiled in by setting the +`CSTRACE_RAW` environment variable. Setting this to `packed` gets trace frame +output as follows:- + + Frame Data; Index 576; RAW_PACKED; d6 d6 d6 d6 d6 d6 d6 d6 fc fb d6 d6 d6 d6 e0 7f + Frame Data; Index 576; ID_DATA[0x14]; d7 d6 d7 d6 d7 d6 d7 d6 fd fb d7 d6 d7 d6 e0 + +Set to any other value will remove the RAW_PACKED lines. + +Working with a debug version of the openCSD library +--------------------------------------------------- +When compiling the perf tools it is possible to reference another version of +the openCSD library than the one installed on the system. This is useful when +working with multiple development trees or having the desire to keep system +libraries intact. Two environment variable are available to tell the perf tools +build script where to get the header file and libraries, namely CSINCLUDES and +CSLIBS: + + linaro@t430:~/linaro/linux-kernel$ export CSINCLUDES=~/linaro/coresight/my-opencsd/decoder/include/ + linaro@t430:~/linaro/linux-kernel$ export CSLIBS=~/linaro/coresight/my-opencsd/decoder/lib/linux64-rel/ + linaro@t430:~/linaro/linux-kernel$ make VF=1 -C tools/perf + +This will have the effect of compiling and linking against the provided library. +Since the system's openCSD library is in the loader's search patch the +LD_LIBRARY_PATH environment variable needs to be set. + + linaro@t430:~/linaro/linux-kernel$ export LD_LIBRARY_PATH=$CSLIBS + + +Trace Decoding with Perf Report +------------------------------- +Before working with custom traces it is suggested to use a trace bundle that +is known to be working properly. A sample bundle has been made available +here [2]. Trace bundles can be extracted anywhere and have no dependencies on +where the perf tools and openCSD library have been compiled. + + linaro@t430:~/linaro/coresight$ mkdir sept20 + linaro@t430:~/linaro/coresight$ cd sept20 + linaro@t430:~/linaro/coresight/sept20$ wget http://people.linaro.org/~mathieu.poirier/openCSD/uname.v4.user.sept20.tgz + linaro@t430:~/linaro/coresight/sept20$ md5sum uname.v4.user.sept20.tgz + f53f11d687ce72bdbe9de2e67e960ec6 uname.v4.user.sept20.tgz + linaro@t430:~/linaro/coresight/sept20$ tar xf uname.v4.user.sept20.tgz + linaro@t430:~/linaro/coresight/sept20$ ls -la + total 1312 + drwxrwxr-x 3 linaro linaro 4096 Mar 3 10:26 . + drwxrwxr-x 5 linaro linaro 4096 Mar 3 10:13 .. + drwxr-xr-x 7 linaro linaro 4096 Feb 24 12:21 .debug + -rw------- 1 linaro linaro 78016 Feb 24 12:21 perf.data + -rw-rw-r-- 1 linaro linaro 1245881 Feb 24 12:25 uname.v4.user.sept20.tgz + +Perf is expecting files related to the trace capture (`perf.data`) to be located +under `~/.debug` [3]. This example will remove the current `~/.debug` directory +to be sure everything is clean. + + linaro@t430:~/linaro/coresight/sept20$ rm -rf ~/.debug + linaro@t430:~/linaro/coresight/sept20$ cp -dpR .debug ~/ + linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf report --stdio + + # To display the perf.data header info, please use --header/--header-only options. + # + # + # Total Lost Samples: 0 + # + # Samples: 0 of event 'cs_etm//u' + # Event count (approx.): 0 + # + # Children Self Command Shared Object Symbol + # ........ ........ ....... ............. ...... + # + + + # Samples: 0 of event 'dummy:u' + # Event count (approx.): 0 + # + # Children Self Command Shared Object Symbol + # ........ ........ ....... ............. ...... + # + + + # Samples: 115K of event 'instructions:u' + # Event count (approx.): 522009 + # + # Children Self Command Shared Object Symbol + # ........ ........ ....... ................ ...................... + # + 4.13% 4.13% uname libc-2.21.so [.] 0x0000000000078758 + 3.81% 3.81% uname libc-2.21.so [.] 0x0000000000078e50 + 2.06% 2.06% uname libc-2.21.so [.] 0x00000000000fcaf4 + 1.65% 1.65% uname libc-2.21.so [.] 0x00000000000fcae4 + 1.59% 1.59% uname ld-2.21.so [.] 0x000000000000a7f4 + 1.50% 1.50% uname libc-2.21.so [.] 0x0000000000078e40 + 1.43% 1.43% uname libc-2.21.so [.] 0x00000000000fcac4 + 1.31% 1.31% uname libc-2.21.so [.] 0x000000000002f0c0 + 1.26% 1.26% uname ld-2.21.so [.] 0x0000000000016888 + 1.24% 1.24% uname libc-2.21.so [.] 0x0000000000078e7c + 1.24% 1.24% uname libc-2.21.so [.] 0x00000000000fcab8 + ... + +Additional data can be obtained, which contains a dump of the trace packets received using the command + + mjl@ubuntu-vbox:./perf-opencsd-master/coresight/tools/perf/perf report --stdio --dump + +resulting a large amount of data, trace looking like:- + + 0x618 [0x30]: PERF_RECORD_AUXTRACE size: 0x11ef0 offset: 0 ref: 0x4d881c1f13216016 idx: 0 tid: 15244 cpu: -1 + + . ... CoreSight ETM Trace data: size 73456 bytes + + 0: I_ASYNC : Alignment Synchronisation. + 12: I_TRACE_INFO : Trace Info. + 17: I_TRACE_ON : Trace On. + 18: I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000007F89F24D80; Ctxt: AArch64,EL0, NS; + 28: I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE + 29: I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE + 30: I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE + 32: I_ATOM_F6 : Atom format 6.; EEEEN + 33: I_ATOM_F1 : Atom format 1.; E + 34: I_EXCEPT : Exception.; Data Fault; Ret Addr Follows; + 36: I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000007F89F2832C; + 45: I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0xFFFFFFC000083400; Ctxt: AArch64,EL1, NS; + 56: I_TRACE_ON : Trace On. + 57: I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000007F89F2832C; Ctxt: AArch64,EL0, NS; + 68: I_ATOM_F3 : Atom format 3.; NEE + 69: I_ATOM_F3 : Atom format 3.; NEN + 70: I_ATOM_F3 : Atom format 3.; NNE + 71: I_ATOM_F5 : Atom format 5.; ENENE + 72: I_ATOM_F5 : Atom format 5.; NENEN + 73: I_ATOM_F5 : Atom format 5.; ENENE + 74: I_ATOM_F5 : Atom format 5.; NENEN + 75: I_ATOM_F5 : Atom format 5.; ENENE + 76: I_ATOM_F3 : Atom format 3.; NNE + 77: I_ATOM_F3 : Atom format 3.; NNE + 78: I_ATOM_F3 : Atom format 3.; NNE + 80: I_ATOM_F3 : Atom format 3.; NNE + 81: I_ATOM_F3 : Atom format 3.; ENN + 82: I_EXCEPT : Exception.; Data Fault; Ret Addr Follows; + 84: I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000007F89F283F0; + 93: I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0xFFFFFFC000083400; Ctxt: AArch64,EL1, NS; + 104: I_TRACE_ON : Trace On. + 105: I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000007F89F283F0; Ctxt: AArch64,EL0, NS; + 116: I_ATOM_F5 : Atom format 5.; NNNNN + 117: I_ATOM_F5 : Atom format 5.; NNNNN + + +Trace Decoding with Perf Script +------------------------------- +Working with perf scripts needs more command line options but yields +interesting results. + + linaro@t430:~/linaro/coresight/sept20$ export EXEC_PATH=/home/linaro/coresight/perf-opencsd-master/tools/perf/ + linaro@t430:~/linaro/coresight/sept20$ export SCRIPT_PATH=$EXEC_PATH/scripts/python/ + linaro@t430:~/linaro/coresight/sept20$ export XTOOL_PATH=/your/aarch64/toolchain/path/bin/ + linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf --exec-path=${EXEC_PATH} script --script=python:${SCRIPT_PATH}/cs-trace-disasm.py -- -d ${XTOOL_PATH}/aarch64-linux-gnu-objdump + + 7f89f24d80: 910003e0 mov x0, sp + 7f89f24d84: 94000d53 bl 7f89f282d0 + 7f89f282d0: d11203ff sub sp, sp, #0x480 + 7f89f282d4: a9ba7bfd stp x29, x30, [sp,#-96]! + 7f89f282d8: 910003fd mov x29, sp + 7f89f282dc: a90363f7 stp x23, x24, [sp,#48] + 7f89f282e0: 9101e3b7 add x23, x29, #0x78 + 7f89f282e4: a90573fb stp x27, x28, [sp,#80] + 7f89f282e8: a90153f3 stp x19, x20, [sp,#16] + 7f89f282ec: aa0003fb mov x27, x0 + 7f89f282f0: 910a82e1 add x1, x23, #0x2a0 + 7f89f282f4: a9025bf5 stp x21, x22, [sp,#32] + 7f89f282f8: a9046bf9 stp x25, x26, [sp,#64] + 7f89f282fc: 910102e0 add x0, x23, #0x40 + 7f89f28300: f800841f str xzr, [x0],#8 + 7f89f28304: eb01001f cmp x0, x1 + 7f89f28308: 54ffffc1 b.ne 7f89f28300 + 7f89f28300: f800841f str xzr, [x0],#8 + 7f89f28304: eb01001f cmp x0, x1 + 7f89f28308: 54ffffc1 b.ne 7f89f28300 + 7f89f28300: f800841f str xzr, [x0],#8 + 7f89f28304: eb01001f cmp x0, x1 + 7f89f28308: 54ffffc1 b.ne 7f89f28300 + +Kernel Trace Decoding +--------------------- + +When dealing with kernel space traces the vmlinux file has to be communicated +explicitely to perf using the "--vmlinux" command line option: + + linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf report --stdio --vmlinux=./vmlinux + ... + ... + linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf script --vmlinux=./vmlinux + +When using scripts things get a little more convoluted. Using the same example +an above but for traces but for kernel traces, the command line becomes: + + linaro@t430:~/linaro/coresight/sept20$ export EXEC_PATH=/home/linaro/coresight/perf-opencsd-master/tools/perf/ + linaro@t430:~/linaro/coresight/sept20$ export SCRIPT_PATH=$EXEC_PATH/scripts/python/ + linaro@t430:~/linaro/coresight/sept20$ export XTOOL_PATH=/your/aarch64/toolchain/path/bin/ + linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf --exec-path=${EXEC_PATH} script \ + --vmlinux=./vmlinux \ + --script=python:${SCRIPT_PATH}/cs-trace-disasm.py -- \ + -d ${XTOOLS_PATH}/aarch64-linux-gnu-objdump \ + -k ./vmlinux + ... + ... + +The option "--vmlinux=./vmlinux" is interpreted by the "perf script" command +the same way it if for "perf report". The option "-k ./vmlinux" is dependant +on the script being executed and has no related to the "--vmlinux", though it +is highly advised to keep them synchronized. + + +Perf Test Environment Scripts +----------------------------- + +The decoder library comes with a number of `bash` scripts that ease the setting up of the +offline build and test environment for perf, and executing tests. + +These scripts can be found in + + decoder/tests/perf-test-scripts + +There are three scripts provided: + +- `perf-setup-env.bash` : this sets up all the environment variables mentioned above. +- `perf-test-report.bash` : this runs `perf report` - using the environment setup by `perf-setup-env.bash` +- `perf-test-script.bash` : this runs `perf script` - using the environment setup by `perf-setup-env.bash` + +Use as follows:- + +1. Prior to building perf, edit `perf-setup-env.bash` to conform to your environment. There are four lines at the top of the file that will require editing. + +2. Execute the script using the command + + source perf-setup-env.bash + + This will set up all the environment variables mentioned in the sections on building and running + perf above, and these are used by the `perf-test...` scripts to run the tests. + +3. Build perf as described above. +4. Follow the instructions for downloading the test capture, or create a capture from your target. +5. Copy the `perf-test...` scripts into the capture data directory -> the one that contains `perf.data`. + +6. The scripts can now be run. No options are required for the default operation, but any command line options will be added to the perf report / perf script command line. + +e.g. + + ./perf-test-report.bash --dump + +will add the --dump option to the end of the command line and run + + ${PERF_EXEC_PATH}/perf report --stdio --dump + + +Generating coverage files for Feedback Directed Optimization: AutoFDO +--------------------------------------------------------------------- + +Below is an example of using ARM ETM for autoFDO. The updates to the perf +support for this is experimental and available on the 'autoFDO' branch of +the [perf-opencsd github repository][1]. + +It also requires autofdo (https://github.com/google/autofdo) and gcc version 5. The bubble +sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tutorial). + + $ gcc-5 -O3 sort.c -o sort_optimized + $ taskset -c 2 ./sort_optimized + Bubble sorting array of 30000 elements + 5910 ms + + $ perf record -e cs_etm/@20070000.etr/u --per-thread taskset -c 2 ./sort + Bubble sorting array of 30000 elements + 12543 ms + [ perf record: Woken up 35 times to write data ] + [ perf record: Captured and wrote 69.640 MB perf.data ] + + $ perf inject -i perf.data -o inj.data --itrace=il64 --strip + $ create_gcov --binary=./sort --profile=inj.data --gcov=sort.gcov -gcov_version=1 + $ gcc-5 -O3 -fauto-profile=sort.gcov sort.c -o sort_autofdo + $ taskset -c 2 ./sort_autofdo + Bubble sorting array of 30000 elements + 5806 ms + + +The Linaro CoreSight Team +------------------------- +- Mike Leach +- Tor Jeremiassen +- Chunyan Zang +- Mathieu Poirier + + +One Last Thing +-------------- +We welcome help on this project. If you would like to add features or help +improve the way things work, we want to hear from you. + +Best regards, +*The Linaro CoreSight Team* + +-------------------------------------- +[1]: https://github.com/Linaro/perf-opencsd "perf-opencsd Github" + +[2]: http://people.linaro.org/~mathieu.poirier/openCSD/uname.v4.user.sept20.tgz + +[3]: Get in touch with us if you know a way to change this. Added: vendor/opencsd/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/LICENSE Wed Apr 4 12:33:46 2018 (r332012) @@ -0,0 +1,30 @@ + BSD 3Clause License + http://directory.fsf.org/wiki/License:BSD_3Clause + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3)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. Added: vendor/opencsd/dist/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/README.md Wed Apr 4 12:33:46 2018 (r332012) @@ -0,0 +1,132 @@ +OpenCSD - An open source CoreSight(tm) Trace Decode library {#mainpage} +=========================================================== + +This library provides an API suitable for the decode of ARM(r) CoreSight(tm) trace streams. + +The library will decode formatted trace in three stages: + +1. *Frame Deformatting* : Removal CoreSight frame formatting from individual trace streams. +2. *Packet Processing* : Separate individual trace streams into discrete packets. +3. *Packet Decode* : Convert the packets into fully decoded trace describing the program flow on a core. + +The library is implemented in C++ with an optional "C" API. + +Library Versioning +------------------ + +From version 0.4, library versioning will use a semantic versioning format +(per http://semver.org) of the form _Major.minor.patch_ (M.m.p). + +Internal library version calls, documentation and git repository will use this format moving forwards. +Where a patch version is not quoted, or quoted as .x then comments will apply to the entire release. + +Releases will be at M.m.0, with patch version incremented for bugfixes or documentation updates. + +Releases will appear on the master branch in the git repository with an appropriate version tag. + +CoreSight Trace Component Support. +---------------------------------- + +_Current Version 0.8.2_ + +### Current support: + +- ETMv4 (v4.1) instruction trace - packet processing and packet decode. +- PTM (v1.1) instruction trace - packet processing and packet decode. +- ETMv3 (v3.5) instruction trace - packet processing and packet decode. +- ETMv3 (v3.5) data trace - packet processing. +- STM (v1.1) software trace - packet processing and packet decode. + +- External Decoders - support for addition of external / custom decoders into the library. + +### Support to be added: + +- ITM software trace - packet processing and decode. +- ETMv3 data trace - packet decode. +- ETMv4 data trace - packet processing and decode. + +Note: for ITM and STM, packet decode is combining Master+Channel+Marker+Payload packets into a single generic +output packet. + + +Note on the Git Repository. +--------------------------- + +This git repository for OpenCSD contains only source for the OpenCSD decoder library. +From version 0.4, releases appear as versioned tags on the master branch. + +From version 0.7.4, the required updates to CoreSight drivers and perf, that are not +currently upstream in the linux kernel tree, are now contained in a separate +repository to be found at: + +https://github.com/Linaro/perf-opencsd + + +Documentation +------------- + +API Documentation is provided inline in the source header files, which use the __doxygen__ standard mark-up. +Run `doxygen` on the `./doxygen_config.dox` file located in the `./docs` directory.. + + doxygen ./doxygen_config.dox + +This will produce the documentation in the `./docs/html` directory. The doxygen configuration also includes +the `*.md` files as part of the documentation. + + +Building the Library +-------------------- + +See [build_libs.md](@ref build_lib) in the `./docs` directory for build details. + + +How the Library is used in Linux `perf` +--------------------------------------- +The library and additional infrastructure for programming CoreSight components has been integrated +with the standard linux perfomance analysis tool `perf`. + + +See [HOWTO.md](@ref howto_perf) for details. + + +Version and Modification Information +==================================== + +- _Version 0.001_: Library development - tested with `perf` tools integration - BKK16, 8th March 2016 +- _Version 0.002_: Library development - added in PTM decoder support. Restructure header dir, replaced ARM rctdl prefix with opencsd/ocsd. +- _Version 0.003_: Library development - added in ETMv3 instruction decoder support. +- _Version 0.4_ : Library development - updated decode tree and C-API for generic decoder handling. Switch to semantic versioning. +- _Version 0.4.1_: Minor Update & Bugfixes - fix to PTM decoder, ID checking on test program, adds NULL_TS support in STM packet processor. +- _Version 0.4.2_: Minor Update - Update to documentation for perf usage in 4.8 kernel branch. +- _Version 0.5.0_: Library Development - external decoder support. STM full decode. +- _Version 0.5.1_: Minor Update & Bugfixes - Update HOWTO for kernel 4.9. Build fixes for parallel builds +- _Version 0.5.2_: Minor Update & Bugfixes - Update trace info packet string o/p + Cycle count packet bugfixes. +- _Version 0.5.3_: Doc update for using AutoFDO with ETM and additional timestamp and cycle count options. +- _Version 0.5.4_: Updates: X-compile for arm/arm64. Remove deprecated VS2010 builds. Bugfix: GCC inline semantics in debug build. +- _Version 0.6.0_: Packet printers moved from tests into the main library. C++ and C APIs updated to allow clients to use them. + Update to allow perf to insert barrier packets (4xFSYNC) which the decoder can be made to use to reset the decode state. +- _Version 0.6.1_: Bugfix: instruction follower bug on A32 branch to T32. +- _Version 0.7.0_: Add handling for trace return stack feature to ETMv4 and PTM trace. +- _Version 0.7.1_: Bugfix: ETMv3 packet processor. +- _Version 0.7.2_: Bugfix: ETMv4 decoder - fix exact match packet address follower. +- _Version 0.7.3_: Bugfix: PTM decoder - issues with initialisation and ASYNC detection. +- _Version 0.7.4_: Notification of change of repository for perf extensions. gcc 6.x build fixes. +- _Version 0.7.5_: Bugfix: ETMv4 decoder memory leak. Linux build update - header dependencies force rebuild. +- _Version 0.8.0_: Header restructure and build update to enable linux version to install library and C-API headers in standard locations. + Library output naming changed from 'cstraced' to 'opencsd'. +- _Version 0.8.1_: Minor updates: Use install tool to copy headers. Changes to HOWTO for perf usage. +- _Version 0.8.2_: Bugfix: C++ init errors fixed for CLANG build process. + +Licence Information +=================== + +This library is licensed under the [BSD three clause licence.](http://directory.fsf.org/wiki/License:BSD_3Clause) + +A copy of this license is in the `LICENCE` file included with the source code. + +Contact +======= + +Using the github site: https://github.com/Linaro/OpenCSD + +Mailing list: coresight@lists.linaro.org Added: vendor/opencsd/dist/TODO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/TODO Wed Apr 4 12:33:46 2018 (r332012) @@ -0,0 +1,19 @@ +* ETMv4/PTM - decoder updates to handle advanced configuration. +-> Certain (currently unused by perf / current hardware) configuration settings + can alter the format of the trace output. One example is Return Stack - + settable in the control registers for PTM/ETMv4, and removes some inline + addresses. Decoder must use a follower to correctly trace when this is set. + +* ITM packet processing and decode. +-> ITM is primarily an M class SW trace module. I wouldn't expect to see it on + systems with STM, unless a companion M class was present. + +*Data trace - ETMv4 / ETMv3 +-> Differing solutions to data trace in v4/v3 - v4 is separate trace stream + completely, output at trace ID +1. ETMv3 is inline with + the instruction trace. + +Cortex-A cores do not support this architecturally. On R and M profile cores it +is an option. There are scenarios in future that could see linux on R cores, plus +on something like Juno it is possible to switch on trace for the SCP +(M class processor). So at some point data trace may be required. Added: vendor/opencsd/dist/decoder/build/linux/makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opencsd/dist/decoder/build/linux/makefile Wed Apr 4 12:33:46 2018 (r332012) @@ -0,0 +1,196 @@ +######################################################## +# Copyright 2015 ARM Limited. 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. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. +# +################################################################################# +# OpenCSD - master makefile for libraries and tests +# +# command line options +# DEBUG=1 create a debug build +# + +# Set project root - relative to build directory +ifeq ($(OCSD_ROOT),) +OCSD_ROOT := $(shell pwd | sed 's,/build/linux.*,,') +export OCSD_ROOT +endif + +# library names +LIB_BASE_NAME=opencsd +export LIB_BASE_NAME +LIB_CAPI_NAME=$(LIB_BASE_NAME)_c_api +export LIB_CAPI_NAME + +# determine base architecture, heavily borrowed from the Linux kernel v4.4's +# tools/perf/config/Makefile.arch +# For example, to compile for arm64 on a X86 PC, you can issue the command: +# "export ARCH=arm64" +ifndef ARCH +ARCH := $(shell uname -m 2>/dev/null || echo not) +endif + +# source root directories +export OCSD_LIB_ROOT=$(OCSD_ROOT)/lib + +export OCSD_INCLUDE=$(OCSD_ROOT)/include +export OCSD_SOURCE=$(OCSD_ROOT)/source + +export OCSD_TESTS=$(OCSD_ROOT)/tests + +export LIB_UAPI_INC_DIR=opencsd *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 12:35:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F1AF8ADB2; Wed, 4 Apr 2018 12:35:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17B7277A57; Wed, 4 Apr 2018 12:35:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC62813C45; Wed, 4 Apr 2018 12:35:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34CZShS016995; Wed, 4 Apr 2018 12:35:28 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34CZSj3016994; Wed, 4 Apr 2018 12:35:28 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804041235.w34CZSj3016994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 4 Apr 2018 12:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r332013 - vendor/opencsd/900407e9d6400f6541138d6c2e483a9fc2d699a4 X-SVN-Group: vendor X-SVN-Commit-Author: br X-SVN-Commit-Paths: vendor/opencsd/900407e9d6400f6541138d6c2e483a9fc2d699a4 X-SVN-Commit-Revision: 332013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:35:29 -0000 Author: br Date: Wed Apr 4 12:35:28 2018 New Revision: 332013 URL: https://svnweb.freebsd.org/changeset/base/332013 Log: Tag OpenCSD revision. Sponsored by: DARPA, AFRL Added: vendor/opencsd/900407e9d6400f6541138d6c2e483a9fc2d699a4/ - copied from r332012, vendor/opencsd/dist/ From owner-svn-src-all@freebsd.org Wed Apr 4 12:36:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8956DF8AF61; Wed, 4 Apr 2018 12:36:56 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DBE277C0C; Wed, 4 Apr 2018 12:36:56 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3895C13C49; Wed, 4 Apr 2018 12:36:56 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Cau4b018042; Wed, 4 Apr 2018 12:36:56 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34CatEl018041; Wed, 4 Apr 2018 12:36:55 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041236.w34CatEl018041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 12:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332014 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 332014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:36:56 -0000 Author: mw Date: Wed Apr 4 12:36:55 2018 New Revision: 332014 URL: https://svnweb.freebsd.org/changeset/base/332014 Log: Add support of PCI_RES_BUS to Marvell PCI driver GENERIC ARM config use NEW_PCIB driver (https://wiki.freebsd.org/NEW_PCIB). To satisfy it, allocation and deallocation of PCI_RES_BUS is necessary. Conditional compilation is added for backward compatibility with ARMv5 configs. Submitted by: Rafal Kozik Reviewed by: jhb Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14748 Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Wed Apr 4 12:35:28 2018 (r332013) +++ head/sys/arm/mv/mv_pci.c Wed Apr 4 12:36:55 2018 (r332014) @@ -312,6 +312,8 @@ struct mv_pcib_softc { int sc_skip_enable_procedure; int sc_enable_find_root_slot; struct ofw_bus_iinfo sc_pci_iinfo; + + int ap_segment; /* PCI domain */ }; /* Local forward prototypes */ @@ -441,6 +443,8 @@ mv_pcib_attach(device_t self) return(ENXIO); } + sc->ap_segment = port_id; + if (ofw_bus_node_is_compatible(node, "mrvl,pcie")) { sc->sc_type = MV_TYPE_PCIE; if (ofw_bus_node_is_compatible(parnode, "marvell,armada-370-pcie")) { @@ -879,6 +883,11 @@ mv_pcib_alloc_resource(device_t dev, device_t child, i case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; break; +#ifdef PCI_RES_BUS + case PCI_RES_BUS: + return (pci_domain_alloc_bus(sc->ap_segment, child, rid, start, + end, count, flags)); +#endif default: return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, type, rid, start, end, count, flags)); @@ -915,7 +924,12 @@ static int mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { +#ifdef PCI_RES_BUS + struct mv_pcib_softc *sc = device_get_softc(dev); + if (type == PCI_RES_BUS) + return (pci_domain_release_bus(sc->ap_segment, child, rid, res)); +#endif if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY) return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, rid, res)); From owner-svn-src-all@freebsd.org Wed Apr 4 12:41:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87F10F8B49E; Wed, 4 Apr 2018 12:41:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A8B377F6A; Wed, 4 Apr 2018 12:41:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 356C513D7B; Wed, 4 Apr 2018 12:41:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34CfhGj026183; Wed, 4 Apr 2018 12:41:43 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Cfg6g026175; Wed, 4 Apr 2018 12:41:42 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041241.w34Cfg6g026175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 12:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332015 - in head/sys: arm/mv dts/arm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dts/arm X-SVN-Commit-Revision: 332015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:41:43 -0000 Author: mw Date: Wed Apr 4 12:41:42 2018 New Revision: 332015 URL: https://svnweb.freebsd.org/changeset/base/332015 Log: Match Marvell Armada38X PCI compatible with Linux In Linux FDT pcie does not have compatible string. Configuration of windows in mv_common was based on fdt compatible. Now pcie windows are configured by their parent: pcie_controller. Processing is moved to fdt_win_process_child. fdt_win_process now only walk through the tree. SOC_NODE_PCI is position of pcie function in soc_node_spec array. PCIe probe cannot use ofw_bus_search_compatible, because it needs to check also device type and parents compatible. Submitted by: Rafal Kozik Reviewed by: manu [DT part] Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14749 Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_pci.c head/sys/dts/arm/armada-380.dtsi head/sys/dts/arm/armada-385.dtsi Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Wed Apr 4 12:36:55 2018 (r332014) +++ head/sys/arm/mv/mv_common.c Wed Apr 4 12:41:42 2018 (r332015) @@ -76,6 +76,8 @@ MALLOC_DEFINE(M_IDMA, "idma", "idma dma test memory"); #define MV_DUMP_WIN 0 #endif +struct soc_node_spec; + static enum soc_family soc_family; static int mv_win_cesa_attr(int wng_sel); @@ -174,6 +176,8 @@ int gic_decode_fdt(phandle_t iparent, pcell_t *intr, i static int win_cpu_from_dt(void); static int fdt_win_setup(void); +static int fdt_win_process_child(phandle_t, struct soc_node_spec *); + static uint32_t dev_mask = 0; static int cpu_wins_no = 0; static int eth_port = 0; @@ -225,6 +229,8 @@ static struct soc_node_spec soc_nodes[] = { { NULL, NULL, NULL, NULL }, }; +#define SOC_NODE_PCIE_ENTRY_IDX 11 + typedef uint32_t(*read_cpu_ctrl_t)(uint32_t); typedef void(*write_cpu_ctrl_t)(uint32_t, uint32_t); typedef uint32_t (*win_read_t)(int); @@ -2741,55 +2747,63 @@ moveon: static int fdt_win_process(phandle_t child) { - int i; - struct soc_node_spec *soc_node; - int addr_cells, size_cells; - pcell_t reg[8]; - u_long size, base; + int i, ret; for (i = 0; soc_nodes[i].compat != NULL; i++) { - - soc_node = &soc_nodes[i]; - /* Setup only for enabled devices */ if (ofw_bus_node_status_okay(child) == 0) continue; - if (!ofw_bus_node_is_compatible(child, soc_node->compat)) + if (!ofw_bus_node_is_compatible(child, soc_nodes[i].compat)) continue; - if (fdt_addrsize_cells(OF_parent(child), &addr_cells, - &size_cells)) - return (ENXIO); + ret = fdt_win_process_child(child, &soc_nodes[i]); + if (ret != 0) + return (ret); + } - if ((sizeof(pcell_t) * (addr_cells + size_cells)) > sizeof(reg)) - return (ENOMEM); + return (0); +} - if (OF_getprop(child, "reg", ®, sizeof(reg)) <= 0) - return (EINVAL); +static int +fdt_win_process_child(phandle_t child, struct soc_node_spec *soc_node) +{ + int addr_cells, size_cells; + pcell_t reg[8]; + u_long size, base; - if (addr_cells <= 2) - base = fdt_data_get(®[0], addr_cells); - else - base = fdt_data_get(®[addr_cells - 2], 2); - size = fdt_data_get(®[addr_cells], size_cells); + if (fdt_addrsize_cells(OF_parent(child), &addr_cells, + &size_cells)) + return (ENXIO); - if (soc_node->valid_handler != NULL) - if (!soc_node->valid_handler()) - return (EINVAL); + if ((sizeof(pcell_t) * (addr_cells + size_cells)) > sizeof(reg)) + return (ENOMEM); - base = (base & 0x000fffff) | fdt_immr_va; - if (soc_node->decode_handler != NULL) - soc_node->decode_handler(base); - else - return (ENXIO); + if (OF_getprop(child, "reg", ®, sizeof(reg)) <= 0) + return (EINVAL); - if (MV_DUMP_WIN && (soc_node->dump_handler != NULL)) - soc_node->dump_handler(base); - } + if (addr_cells <= 2) + base = fdt_data_get(®[0], addr_cells); + else + base = fdt_data_get(®[addr_cells - 2], 2); + size = fdt_data_get(®[addr_cells], size_cells); + if (soc_node->valid_handler != NULL) + if (!soc_node->valid_handler()) + return (EINVAL); + + base = (base & 0x000fffff) | fdt_immr_va; + if (soc_node->decode_handler != NULL) + soc_node->decode_handler(base); + else + return (ENXIO); + + if (MV_DUMP_WIN && (soc_node->dump_handler != NULL)) + soc_node->dump_handler(base); + return (0); } + static int fdt_win_setup(void) { @@ -2821,7 +2835,8 @@ fdt_win_setup(void) if (ofw_bus_node_is_compatible(child, "marvell,armada-370-pcie")) { child_pci = OF_child(child); while (child_pci != 0) { - err = fdt_win_process(child_pci); + err = fdt_win_process_child(child_pci, + &soc_nodes[SOC_NODE_PCIE_ENTRY_IDX]); if (err != 0) return (err); Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Wed Apr 4 12:36:55 2018 (r332014) +++ head/sys/arm/mv/mv_pci.c Wed Apr 4 12:41:42 2018 (r332015) @@ -413,7 +413,9 @@ mv_pcib_probe(device_t self) return (ENXIO); if (!(ofw_bus_is_compatible(self, "mrvl,pcie") || - ofw_bus_is_compatible(self, "mrvl,pci"))) + ofw_bus_is_compatible(self, "mrvl,pci") || + ofw_bus_node_is_compatible( + OF_parent(node), "marvell,armada-370-pcie"))) return (ENXIO); device_set_desc(self, "Marvell Integrated PCI/PCI-E Controller"); @@ -447,19 +449,18 @@ mv_pcib_attach(device_t self) if (ofw_bus_node_is_compatible(node, "mrvl,pcie")) { sc->sc_type = MV_TYPE_PCIE; - if (ofw_bus_node_is_compatible(parnode, "marvell,armada-370-pcie")) { - sc->sc_win_target = MV_WIN_PCIE_TARGET_ARMADA38X(port_id); - sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR_ARMADA38X(port_id); - sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR_ARMADA38X(port_id); - sc->sc_enable_find_root_slot = 1; - } else { - sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id); - sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id); - sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id); + sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id); + sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id); + sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id); #if __ARM_ARCH >= 6 - sc->sc_skip_enable_procedure = 1; + sc->sc_skip_enable_procedure = 1; #endif - } + } else if (ofw_bus_node_is_compatible(parnode, "marvell,armada-370-pcie")) { + sc->sc_type = MV_TYPE_PCIE; + sc->sc_win_target = MV_WIN_PCIE_TARGET_ARMADA38X(port_id); + sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR_ARMADA38X(port_id); + sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR_ARMADA38X(port_id); + sc->sc_enable_find_root_slot = 1; } else if (ofw_bus_node_is_compatible(node, "mrvl,pci")) { sc->sc_type = MV_TYPE_PCI; sc->sc_win_target = MV_WIN_PCI_TARGET; Modified: head/sys/dts/arm/armada-380.dtsi ============================================================================== --- head/sys/dts/arm/armada-380.dtsi Wed Apr 4 12:36:55 2018 (r332014) +++ head/sys/dts/arm/armada-380.dtsi Wed Apr 4 12:41:42 2018 (r332015) @@ -98,7 +98,6 @@ /* x1 port */ pcie@1,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; reg = <0x0 0x0 0x80000 0x0 0x2000>; @@ -119,7 +118,6 @@ /* x1 port */ pcie@2,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; reg = <0x0 0x0 0x40000 0x0 0x2000>; @@ -140,7 +138,6 @@ /* x1 port */ pcie@3,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; reg = <0x0 0x0 0x44000 0x0 0x2000>; Modified: head/sys/dts/arm/armada-385.dtsi ============================================================================== --- head/sys/dts/arm/armada-385.dtsi Wed Apr 4 12:36:55 2018 (r332014) +++ head/sys/dts/arm/armada-385.dtsi Wed Apr 4 12:41:42 2018 (r332015) @@ -110,7 +110,6 @@ * pcie@4,0 is not available. */ pcie@1,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; reg = <0x0 0x0 0x80000 0x0 0x2000>; @@ -131,7 +130,6 @@ /* x1 port */ pcie@2,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; reg = <0x0 0x0 0x40000 0x0 0x2000>; @@ -152,7 +150,6 @@ /* x1 port */ pcie@3,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; reg = <0x0 0x0 0x44000 0x0 0x2000>; @@ -176,7 +173,6 @@ * configured as a x1 port */ pcie@4,0 { - compatible = "mrvl,pcie"; device_type = "pci"; assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; reg = <0x0 0x0 0x48000 0x0 0x2000>; From owner-svn-src-all@freebsd.org Wed Apr 4 12:47:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9028CF8BA1F; Wed, 4 Apr 2018 12:47:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4688A7853C; Wed, 4 Apr 2018 12:47:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2433E13DED; Wed, 4 Apr 2018 12:47:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34ClfaX030446; Wed, 4 Apr 2018 12:47:41 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34ClfTU030442; Wed, 4 Apr 2018 12:47:41 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041247.w34ClfTU030442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 12:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332016 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 332016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:47:42 -0000 Author: mw Date: Wed Apr 4 12:47:41 2018 New Revision: 332016 URL: https://svnweb.freebsd.org/changeset/base/332016 Log: Add api for creating resource list based on 'assigned-addresses' According to device tree binding 'assigned-addresses' can refer to PCIE MMIO register space. New function ofw_bus_assigned_addresses_to_rl is provided to support it. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14750 Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Wed Apr 4 12:41:42 2018 (r332015) +++ head/sys/dev/ofw/ofw_bus_subr.c Wed Apr 4 12:47:41 2018 (r332016) @@ -489,9 +489,9 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand return (err); } -int -ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells, - struct resource_list *rl) +static int +ofw_bus_reg_to_rl_helper(device_t dev, phandle_t node, pcell_t acells, pcell_t scells, + struct resource_list *rl, const char *reg_source) { uint64_t phys, size; ssize_t i, j, rid, nreg, ret; @@ -506,7 +506,7 @@ ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_ if (ret == -1) name = NULL; - ret = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); + ret = OF_getencprop_alloc(node, reg_source, sizeof(*reg), (void **)®); nreg = (ret == -1) ? 0 : ret; if (nreg % (acells + scells) != 0) { @@ -535,6 +535,23 @@ ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_ free(reg, M_OFWPROP); return (0); +} + +int +ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells, + struct resource_list *rl) +{ + + return (ofw_bus_reg_to_rl_helper(dev, node, acells, scells, rl, "reg")); +} + +int +ofw_bus_assigned_addresses_to_rl(device_t dev, phandle_t node, pcell_t acells, + pcell_t scells, struct resource_list *rl) +{ + + return (ofw_bus_reg_to_rl_helper(dev, node, acells, scells, + rl, "assigned-addresses")); } /* Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Wed Apr 4 12:41:42 2018 (r332015) +++ head/sys/dev/ofw/ofw_bus_subr.h Wed Apr 4 12:47:41 2018 (r332016) @@ -95,6 +95,8 @@ int ofw_bus_msimap(phandle_t, uint16_t, phandle_t *, u /* Routines for parsing device-tree data into resource lists. */ int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t, struct resource_list *); +int ofw_bus_assigned_addresses_to_rl(device_t, phandle_t, pcell_t, pcell_t, + struct resource_list *); int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *); int ofw_bus_intr_by_rid(device_t, phandle_t, int, phandle_t *, int *, pcell_t **); From owner-svn-src-all@freebsd.org Wed Apr 4 12:54:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 489E6F8C35B; Wed, 4 Apr 2018 12:54:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE72F78F13; Wed, 4 Apr 2018 12:54:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E946513FA1; Wed, 4 Apr 2018 12:54:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34CsI7p040379; Wed, 4 Apr 2018 12:54:18 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34CsIwM040371; Wed, 4 Apr 2018 12:54:18 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041254.w34CsIwM040371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 12:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332017 - in head/sys: arm/mv dts/arm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dts/arm X-SVN-Commit-Revision: 332017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:54:19 -0000 Author: mw Date: Wed Apr 4 12:54:18 2018 New Revision: 332017 URL: https://svnweb.freebsd.org/changeset/base/332017 Log: Change reg in Marvell Armada38X pcie FDT Ranges in pcie-controller are unused, so could be changed to match Linux device tree represntation. Same with interrupt-cells and interrupt-parent. In PCI controller driver ocd_data are used for matching driver and choose proper resources acquisition function. fdt_win_process_child have new argument which provide information about fdt node containing addresses of MMIO registers. Submitted by: Rafal Kozik Reviewed by: manu [DT part] Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14751 Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_pci_ctrl.c head/sys/dts/arm/armada-380.dtsi head/sys/dts/arm/armada-385.dtsi Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Wed Apr 4 12:47:41 2018 (r332016) +++ head/sys/arm/mv/mv_common.c Wed Apr 4 12:54:18 2018 (r332017) @@ -176,7 +176,7 @@ int gic_decode_fdt(phandle_t iparent, pcell_t *intr, i static int win_cpu_from_dt(void); static int fdt_win_setup(void); -static int fdt_win_process_child(phandle_t, struct soc_node_spec *); +static int fdt_win_process_child(phandle_t, struct soc_node_spec *, const char*); static uint32_t dev_mask = 0; static int cpu_wins_no = 0; @@ -2757,7 +2757,7 @@ fdt_win_process(phandle_t child) if (!ofw_bus_node_is_compatible(child, soc_nodes[i].compat)) continue; - ret = fdt_win_process_child(child, &soc_nodes[i]); + ret = fdt_win_process_child(child, &soc_nodes[i], "reg"); if (ret != 0) return (ret); } @@ -2766,7 +2766,8 @@ fdt_win_process(phandle_t child) } static int -fdt_win_process_child(phandle_t child, struct soc_node_spec *soc_node) +fdt_win_process_child(phandle_t child, struct soc_node_spec *soc_node, + const char* mimo_reg_source) { int addr_cells, size_cells; pcell_t reg[8]; @@ -2778,8 +2779,7 @@ fdt_win_process_child(phandle_t child, struct soc_node if ((sizeof(pcell_t) * (addr_cells + size_cells)) > sizeof(reg)) return (ENOMEM); - - if (OF_getprop(child, "reg", ®, sizeof(reg)) <= 0) + if (OF_getprop(child, mimo_reg_source, ®, sizeof(reg)) <= 0) return (EINVAL); if (addr_cells <= 2) @@ -2836,7 +2836,8 @@ fdt_win_setup(void) child_pci = OF_child(child); while (child_pci != 0) { err = fdt_win_process_child(child_pci, - &soc_nodes[SOC_NODE_PCIE_ENTRY_IDX]); + &soc_nodes[SOC_NODE_PCIE_ENTRY_IDX], + "assigned-addresses"); if (err != 0) return (err); Modified: head/sys/arm/mv/mv_pci_ctrl.c ============================================================================== --- head/sys/arm/mv/mv_pci_ctrl.c Wed Apr 4 12:47:41 2018 (r332016) +++ head/sys/arm/mv/mv_pci_ctrl.c Wed Apr 4 12:54:18 2018 (r332017) @@ -67,6 +67,9 @@ struct mv_pcib_ctrl_range { uint64_t size; }; +typedef int (*get_rl_t)(device_t dev, phandle_t node, pcell_t acells, + pcell_t scells, struct resource_list *rl); + struct mv_pcib_ctrl_softc { pcell_t addr_cells; pcell_t size_cells; @@ -107,6 +110,13 @@ static device_method_t mv_pcib_ctrl_methods[] = { DEVMETHOD_END }; +static struct ofw_compat_data mv_pcib_ctrl_compat[] = { + {"mrvl,pcie-ctrl", (uintptr_t)&ofw_bus_reg_to_rl}, + {"marvell,armada-370-pcie", + (uintptr_t)&ofw_bus_assigned_addresses_to_rl}, + {NULL, (uintptr_t)NULL}, +}; + static driver_t mv_pcib_ctrl_driver = { "pcib_ctrl", mv_pcib_ctrl_methods, @@ -124,10 +134,12 @@ static int mv_pcib_ctrl_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "mrvl,pcie-ctrl") && - !ofw_bus_is_compatible(dev, "marvell,armada-370-pcie")) + if (!ofw_bus_status_okay(dev)) return (ENXIO); + if (!ofw_bus_search_compatible(dev, mv_pcib_ctrl_compat)->ocd_data) + return (ENXIO); + device_set_desc(dev, "Marvell Integrated PCIe Bus Controller"); return (BUS_PROBE_DEFAULT); } @@ -151,6 +163,7 @@ mv_pcib_ofw_bus_attach(device_t dev) struct mv_pcib_ctrl_softc *sc; device_t child; phandle_t parent, node; + get_rl_t get_rl; parent = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -189,8 +202,11 @@ mv_pcib_ofw_bus_attach(device_t dev) } resource_list_init(&di->di_rl); - ofw_bus_reg_to_rl(child, node, sc->addr_cells, - sc->size_cells, &di->di_rl); + get_rl = (get_rl_t) ofw_bus_search_compatible(dev, + mv_pcib_ctrl_compat)->ocd_data; + if (get_rl != NULL) + get_rl(child, node, sc->addr_cells, + sc->size_cells, &di->di_rl); device_set_ivars(child, di); } Modified: head/sys/dts/arm/armada-380.dtsi ============================================================================== --- head/sys/dts/arm/armada-380.dtsi Wed Apr 4 12:47:41 2018 (r332016) +++ head/sys/dts/arm/armada-380.dtsi Wed Apr 4 12:54:18 2018 (r332017) @@ -88,23 +88,21 @@ <0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 - 0x82000000 0x0 0xf1200000 MBUS_ID(0x08, 0xe8) 0xf1200000 0 0x00100000 /* Port 0 MEM */ - 0x81000000 0x0 0xf1300000 MBUS_ID(0x08, 0xe0) 0xf1300000 0 0x00100000 /* Port 0 IO */ - 0x82000000 0x0 0xf1400000 MBUS_ID(0x04, 0xe8) 0xf1400000 0 0x00100000 /* Port 1 MEM */ - 0x81000000 0x0 0xf1500000 MBUS_ID(0x04, 0xe0) 0xf1500000 0 0x00100000 /* Port 1 IO */ - 0x82000000 0x0 0xf1600000 MBUS_ID(0x04, 0xd8) 0xf1600000 0 0x00100000 /* Port 2 MEM */ - 0x81000000 0x0 0xf1700000 MBUS_ID(0x04, 0xd0) 0xf1700000 0 0x00100000 /* Port 2 IO */ - >; + 0x82000000 0x1 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 0 MEM */ + 0x81000000 0x1 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 0 IO */ + 0x82000000 0x2 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 1 MEM */ + 0x81000000 0x2 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 1 IO */ + 0x82000000 0x3 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 2 MEM */ + 0x81000000 0x3 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 2 IO */>; /* x1 port */ pcie@1,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; - reg = <0x0 0x0 0x80000 0x0 0x2000>; + reg = <0x0800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1200000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1300000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; @@ -120,11 +118,10 @@ pcie@2,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; - reg = <0x0 0x0 0x40000 0x0 0x2000>; + reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1400000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1500000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; @@ -140,11 +137,10 @@ pcie@3,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; - reg = <0x0 0x0 0x44000 0x0 0x2000>; + reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1600000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1700000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; Modified: head/sys/dts/arm/armada-385.dtsi ============================================================================== --- head/sys/dts/arm/armada-385.dtsi Wed Apr 4 12:47:41 2018 (r332016) +++ head/sys/dts/arm/armada-385.dtsi Wed Apr 4 12:54:18 2018 (r332017) @@ -94,15 +94,14 @@ 0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 - 0x82000000 0x0 0xf1200000 MBUS_ID(0x08, 0xe8) 0xf1200000 0 0x00100000 /* Port 0 MEM */ - 0x81000000 0x0 0xf1300000 MBUS_ID(0x08, 0xe0) 0xf1300000 0 0x00100000 /* Port 0 IO */ - 0x82000000 0x0 0xf1400000 MBUS_ID(0x04, 0xe8) 0xf1400000 0 0x00100000 /* Port 1 MEM */ - 0x81000000 0x0 0xf1500000 MBUS_ID(0x04, 0xe0) 0xf1500000 0 0x00100000 /* Port 1 IO */ - 0x82000000 0x0 0xf1600000 MBUS_ID(0x04, 0xd8) 0xf1600000 0 0x00100000 /* Port 2 MEM */ - 0x81000000 0x0 0xf1700000 MBUS_ID(0x04, 0xd0) 0xf1700000 0 0x00100000 /* Port 2 IO */ - 0x82000000 0x0 0xf1800000 MBUS_ID(0x04, 0xb8) 0xf1800000 0 0x00100000 /* Port 3 MEM */ - 0x81000000 0x0 0xf1900000 MBUS_ID(0x04, 0xb0) 0xf1900000 0 0x00100000 /* Port 3 IO */ - >; + 0x82000000 0x1 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 0 MEM */ + 0x81000000 0x1 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 0 IO */ + 0x82000000 0x2 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 1 MEM */ + 0x81000000 0x2 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 1 IO */ + 0x82000000 0x3 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 2 MEM */ + 0x81000000 0x3 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 2 IO */ + 0x82000000 0x4 0 MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 3 MEM */ + 0x81000000 0x4 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 3 IO */>; /* * This port can be either x4 or x1. When @@ -112,16 +111,14 @@ pcie@1,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; - reg = <0x0 0x0 0x80000 0x0 0x2000>; + reg = <0x0800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1200000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1300000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&gic>; marvell,pcie-port = <0>; marvell,pcie-lane = <0>; clocks = <&gateclk 8>; @@ -132,16 +129,14 @@ pcie@2,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; - reg = <0x0 0x0 0x40000 0x0 0x2000>; + reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1400000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1500000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&gic>; marvell,pcie-port = <1>; marvell,pcie-lane = <0>; clocks = <&gateclk 5>; @@ -152,16 +147,14 @@ pcie@3,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; - reg = <0x0 0x0 0x44000 0x0 0x2000>; + reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1600000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1700000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&gic>; marvell,pcie-port = <2>; marvell,pcie-lane = <0>; clocks = <&gateclk 6>; @@ -175,16 +168,14 @@ pcie@4,0 { device_type = "pci"; assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; - reg = <0x0 0x0 0x48000 0x0 0x2000>; + reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; - #interrupt-cells = <3>; - bus-range = <0 255>; + #interrupt-cells = <1>; ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1800000 0x0 0x00100000 0x81000000 0x0 0x0 0x81000000 0x0 0xf1900000 0x0 0x00100000>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; - interrupt-parent = <&gic>; marvell,pcie-port = <3>; marvell,pcie-lane = <0>; clocks = <&gateclk 7>; From owner-svn-src-all@freebsd.org Wed Apr 4 12:55:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A260F8C4D2; Wed, 4 Apr 2018 12:55:32 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1E4E790F0; Wed, 4 Apr 2018 12:55:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCAC313FA9; Wed, 4 Apr 2018 12:55:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34CtV93041324; Wed, 4 Apr 2018 12:55:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34CtVt8041323; Wed, 4 Apr 2018 12:55:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804041255.w34CtVt8041323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 4 Apr 2018 12:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332018 - in head/contrib/opencsd: . decoder decoder/include decoder/source X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/contrib/opencsd: . decoder decoder/include decoder/source X-SVN-Commit-Revision: 332018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 12:55:32 -0000 Author: br Date: Wed Apr 4 12:55:31 2018 New Revision: 332018 URL: https://svnweb.freebsd.org/changeset/base/332018 Log: Import OpenCSD -- an ARM CoreSight(tm) Trace Decode Library. Sponsored by: DARPA, AFRL Added: head/contrib/opencsd/ head/contrib/opencsd/decoder/ head/contrib/opencsd/decoder/include/ - copied from r332013, vendor/opencsd/dist/decoder/include/ head/contrib/opencsd/decoder/source/ - copied from r332013, vendor/opencsd/dist/decoder/source/ From owner-svn-src-all@freebsd.org Wed Apr 4 13:01:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF9A5F8CC68; Wed, 4 Apr 2018 13:01:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A164B7966E; Wed, 4 Apr 2018 13:01:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C456140DD; Wed, 4 Apr 2018 13:01:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34D1FjI045495; Wed, 4 Apr 2018 13:01:15 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34D1FGh045490; Wed, 4 Apr 2018 13:01:15 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041301.w34D1FGh045490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 13:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332019 - in head/sys: arm/mv dts/arm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dts/arm X-SVN-Commit-Revision: 332019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:01:16 -0000 Author: mw Date: Wed Apr 4 13:01:14 2018 New Revision: 332019 URL: https://svnweb.freebsd.org/changeset/base/332019 Log: Match Marvell Armada38X PCIE ranges in dts with Linux If driver cannot determine ranges based on fdt, it will calculate them based on number and type of current port. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14752 Modified: head/sys/arm/mv/mv_pci.c head/sys/dts/arm/armada-380.dtsi head/sys/dts/arm/armada-385.dtsi Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Wed Apr 4 12:55:31 2018 (r332018) +++ head/sys/arm/mv/mv_pci.c Wed Apr 4 13:01:14 2018 (r332019) @@ -100,6 +100,7 @@ struct mv_pci_range { }; #define FDT_RANGES_CELLS ((3 + 3 + 2) * 2) +#define PCI_SPACE_LEN 0x00100000 static void mv_pci_range_dump(struct mv_pci_range *range) @@ -122,6 +123,7 @@ mv_pci_ranges_decode(phandle_t node, struct mv_pci_ran pcell_t *rangesptr; pcell_t cell0, cell1, cell2; int tuple_size, tuples, i, rv, offset_cells, len; + int portid, is_io_space; /* * Retrieve 'ranges' property. @@ -163,11 +165,14 @@ mv_pci_ranges_decode(phandle_t node, struct mv_pci_ran rangesptr++; cell2 = fdt_data_get((void *)rangesptr, 1); rangesptr++; + portid = fdt_data_get((void *)(rangesptr+1), 1); if (cell0 & 0x02000000) { pci_space = mem_space; + is_io_space = 0; } else if (cell0 & 0x01000000) { pci_space = io_space; + is_io_space = 1; } else { rv = ERANGE; goto out; @@ -198,6 +203,12 @@ mv_pci_ranges_decode(phandle_t node, struct mv_pci_ran rangesptr += size_cells; pci_space->base_pci = cell2; + + if (pci_space->len == 0) { + pci_space->len = PCI_SPACE_LEN; + pci_space->base_parent = fdt_immr_va + + PCI_SPACE_LEN * ( 2 * portid + is_io_space); + } } rv = 0; out: Modified: head/sys/dts/arm/armada-380.dtsi ============================================================================== --- head/sys/dts/arm/armada-380.dtsi Wed Apr 4 12:55:31 2018 (r332018) +++ head/sys/dts/arm/armada-380.dtsi Wed Apr 4 13:01:14 2018 (r332019) @@ -103,8 +103,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1200000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1300000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 + 0x81000000 0 0 0x81000000 0x1 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&gic>; @@ -122,8 +122,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1400000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1500000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 + 0x81000000 0 0 0x81000000 0x2 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&gic>; @@ -141,8 +141,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1600000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1700000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 + 0x81000000 0 0 0x81000000 0x3 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&gic>; Modified: head/sys/dts/arm/armada-385.dtsi ============================================================================== --- head/sys/dts/arm/armada-385.dtsi Wed Apr 4 12:55:31 2018 (r332018) +++ head/sys/dts/arm/armada-385.dtsi Wed Apr 4 13:01:14 2018 (r332019) @@ -115,8 +115,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1200000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1300000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 + 0x81000000 0 0 0x81000000 0x1 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; @@ -133,8 +133,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1400000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1500000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 + 0x81000000 0 0 0x81000000 0x2 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <1>; @@ -151,8 +151,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1600000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1700000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 + 0x81000000 0 0 0x81000000 0x3 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <2>; @@ -172,8 +172,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1800000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1900000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 + 0x81000000 0 0 0x81000000 0x4 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <3>; From owner-svn-src-all@freebsd.org Wed Apr 4 13:08:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8664EF8D450; Wed, 4 Apr 2018 13:08:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30A3A79C9C; Wed, 4 Apr 2018 13:08:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 261A81414B; Wed, 4 Apr 2018 13:08:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34D8q1d055325; Wed, 4 Apr 2018 13:08:52 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34D8pMu055318; Wed, 4 Apr 2018 13:08:51 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041308.w34D8pMu055318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 13:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332020 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 332020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:08:52 -0000 Author: mw Date: Wed Apr 4 13:08:51 2018 New Revision: 332020 URL: https://svnweb.freebsd.org/changeset/base/332020 Log: Introduce port debouncing mechanism in mv_gpio driver This patch introduces gpio debouncing mechanism with fixed memory allocation in critical section. When you press button, value at gpio pin connected to button is changing many times which will cause in unexpected behaviour. Debouncing mechanism will prevent this phenomenon Submitted by: Patryk Duda Wojciech Macek Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14753 Modified: head/sys/arm/mv/gpio.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvvar.h Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Wed Apr 4 13:01:14 2018 (r332019) +++ head/sys/arm/mv/gpio.c Wed Apr 4 13:08:51 2018 (r332020) @@ -3,6 +3,7 @@ * * Copyright (c) 2006 Benno Rice. * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (c) 2017 Semihalf. * All rights reserved. * * Adapted and extended for Marvell SoCs by Semihalf. @@ -45,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -58,13 +61,26 @@ __FBSDID("$FreeBSD$"); #define GPIO_MAX_INTR_COUNT 8 #define GPIO_PINS_PER_REG 32 +#define DEBOUNCE_CHECK_MS 1 +#define DEBOUNCE_LO_HI_MS 2 +#define DEBOUNCE_HI_LO_MS 2 +#define DEBOUNCE_CHECK_TICKS ((hz / 1000) * DEBOUNCE_CHECK_MS) + struct mv_gpio_softc { struct resource * res[GPIO_MAX_INTR_COUNT + 1]; void *ih_cookie[GPIO_MAX_INTR_COUNT]; bus_space_tag_t bst; bus_space_handle_t bsh; + struct mtx mutex; uint8_t pin_num; /* number of GPIO pins */ uint8_t irq_num; /* number of real IRQs occupied by GPIO controller */ + uint8_t use_high; + + /* Used for debouncing. */ + uint32_t debounced_state_lo; + uint32_t debounced_state_hi; + struct callout **debounce_callouts; + int *debounce_counters; }; extern struct resource_spec mv_gpio_res[]; @@ -77,6 +93,17 @@ static int mv_gpio_attach(device_t); static int mv_gpio_intr(void *); static int mv_gpio_init(void); +static void mv_gpio_double_edge_init(int pin); + +static int mv_gpio_debounce_setup(int pin); +static int mv_gpio_debounce_init(int pin); +static void mv_gpio_debounce_start(int pin); +static int mv_gpio_debounce_prepare(int pin); +static void mv_gpio_debounce(void *arg); +static void mv_gpio_debounced_state_set(int pin, uint8_t new_state); +static uint32_t mv_gpio_debounced_state_get(int pin); + +static void mv_gpio_exec_intr_handlers(uint32_t status, int high); static void mv_gpio_intr_handler(int pin); static uint32_t mv_gpio_reg_read(uint32_t reg); static void mv_gpio_reg_write(uint32_t reg, uint32_t val); @@ -84,14 +111,18 @@ static void mv_gpio_reg_set(uint32_t reg, uint32_t val static void mv_gpio_reg_clear(uint32_t reg, uint32_t val); static void mv_gpio_blink(uint32_t pin, uint8_t enable); -static void mv_gpio_polarity(uint32_t pin, uint8_t enable); +static void mv_gpio_polarity(uint32_t pin, uint8_t enable, uint8_t toggle); static void mv_gpio_level(uint32_t pin, uint8_t enable); static void mv_gpio_edge(uint32_t pin, uint8_t enable); static void mv_gpio_out_en(uint32_t pin, uint8_t enable); static void mv_gpio_int_ack(uint32_t pin); static void mv_gpio_value_set(uint32_t pin, uint8_t val); -static uint32_t mv_gpio_value_get(uint32_t pin); +static uint32_t mv_gpio_value_get(uint32_t pin, uint8_t exclude_polar); +#define MV_GPIO_LOCK() mtx_lock_spin(&mv_gpio_softc->mutex) +#define MV_GPIO_UNLOCK() mtx_unlock_spin(&mv_gpio_softc->mutex) +#define MV_GPIO_ASSERT_LOCKED() mtx_assert(&mv_gpio_softc->mutex, MA_OWNED) + static device_method_t mv_gpio_methods[] = { DEVMETHOD(device_probe, mv_gpio_probe), DEVMETHOD(device_attach, mv_gpio_attach), @@ -148,6 +179,8 @@ mv_gpio_attach(device_t dev) if (sc == NULL) return (ENXIO); + if (mv_gpio_softc != NULL) + return (ENXIO); mv_gpio_softc = sc; /* Get chip id and revision */ @@ -159,19 +192,34 @@ mv_gpio_attach(device_t dev) dev_id == MV_DEV_MV78100_Z0 ) { sc->pin_num = 32; sc->irq_num = 4; + sc->use_high = 0; } else if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_88F6282) { sc->pin_num = 50; sc->irq_num = 7; + sc->use_high = 1; } else { device_printf(dev, "unknown chip id=0x%x\n", dev_id); return (ENXIO); } + sc->debounce_callouts = (struct callout **)malloc(sc->pin_num * + sizeof(struct callout *), M_DEVBUF, M_WAITOK | M_ZERO); + if (sc->debounce_callouts == NULL) + return (ENOMEM); + + sc->debounce_counters = (int *)malloc(sc->pin_num * sizeof(int), + M_DEVBUF, M_WAITOK); + if (sc->debounce_counters == NULL) + return (ENOMEM); + + mtx_init(&sc->mutex, device_get_nameunit(dev), NULL, MTX_SPIN); + error = bus_alloc_resources(dev, mv_gpio_res, sc->res); if (error) { + mtx_destroy(&sc->mutex); device_printf(dev, "could not allocate resources\n"); return (ENXIO); } @@ -179,12 +227,11 @@ mv_gpio_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); - /* Disable and clear all interrupts */ + /* Disable all interrupts */ bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_EDGE_MASK, 0); bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_LEV_MASK, 0); - bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_CAUSE, 0); - if (sc->pin_num > GPIO_PINS_PER_REG) { + if (sc->use_high) { bus_space_write_4(sc->bst, sc->bsh, GPIO_HI_INT_EDGE_MASK, 0); bus_space_write_4(sc->bst, sc->bsh, @@ -195,51 +242,67 @@ mv_gpio_attach(device_t dev) for (i = 0; i < sc->irq_num; i++) { if (bus_setup_intr(dev, sc->res[1 + i], - INTR_TYPE_MISC, mv_gpio_intr, NULL, + INTR_TYPE_MISC, + (driver_filter_t *)mv_gpio_intr, NULL, sc, &sc->ih_cookie[i]) != 0) { + mtx_destroy(&sc->mutex); bus_release_resources(dev, mv_gpio_res, sc->res); device_printf(dev, "could not set up intr %d\n", i); return (ENXIO); } } - return (mv_gpio_init()); + error = mv_gpio_init(); + if (error) { + device_printf(dev, "WARNING: failed to initialize GPIO pins, " + "error = %d\n", error); + } + + /* Clear interrupt status. */ + bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_CAUSE, 0); + + return (0); } static int mv_gpio_intr(void *arg) { uint32_t int_cause, gpio_val; - uint32_t int_cause_hi, gpio_val_hi = 0; - int i; + uint32_t int_cause_hi, gpio_val_hi; + MV_GPIO_LOCK(); + + /* + * According to documentation, edge sensitive interrupts are asserted + * when unmasked GPIO_INT_CAUSE register bits are set. + */ int_cause = mv_gpio_reg_read(GPIO_INT_CAUSE); + int_cause &= mv_gpio_reg_read(GPIO_INT_EDGE_MASK); + + /* + * Level sensitive interrupts are asserted when unmasked GPIO_DATA_IN + * register bits are set. + */ gpio_val = mv_gpio_reg_read(GPIO_DATA_IN); - gpio_val &= int_cause; - if (mv_gpio_softc->pin_num > GPIO_PINS_PER_REG) { + gpio_val &= mv_gpio_reg_read(GPIO_INT_LEV_MASK); + + int_cause_hi = 0; + gpio_val_hi = 0; + if (mv_gpio_softc->use_high) { int_cause_hi = mv_gpio_reg_read(GPIO_HI_INT_CAUSE); + int_cause_hi &= mv_gpio_reg_read(GPIO_HI_INT_EDGE_MASK); + gpio_val_hi = mv_gpio_reg_read(GPIO_HI_DATA_IN); - gpio_val_hi &= int_cause_hi; + gpio_val_hi &= mv_gpio_reg_read(GPIO_HI_INT_LEV_MASK); } - i = 0; - while (gpio_val != 0) { - if (gpio_val & 1) - mv_gpio_intr_handler(i); - gpio_val >>= 1; - i++; - } + mv_gpio_exec_intr_handlers(int_cause | gpio_val, 0); - if (mv_gpio_softc->pin_num > GPIO_PINS_PER_REG) { - i = 0; - while (gpio_val_hi != 0) { - if (gpio_val_hi & 1) - mv_gpio_intr_handler(i + GPIO_PINS_PER_REG); - gpio_val_hi >>= 1; - i++; - } - } + if (mv_gpio_softc->use_high) + mv_gpio_exec_intr_handlers(int_cause_hi | gpio_val_hi, 1); + MV_GPIO_UNLOCK(); + return (FILTER_HANDLED); } @@ -260,6 +323,17 @@ mv_gpio_setup_intrhandler(const char *name, driver_fil return (ENXIO); event = gpio_events[pin]; if (event == NULL) { + MV_GPIO_LOCK(); + if (gpio_setup[pin] & MV_GPIO_IN_DEBOUNCE) { + error = mv_gpio_debounce_init(pin); + if (error != 0) { + MV_GPIO_UNLOCK(); + return (error); + } + } else if (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE) + mv_gpio_double_edge_init(pin); + MV_GPIO_UNLOCK(); + error = intr_event_create(&event, (void *)pin, 0, pin, (void (*)(void *))mv_gpio_intr_mask, (void (*)(void *))mv_gpio_intr_unmask, @@ -283,10 +357,22 @@ mv_gpio_intr_mask(int pin) if (pin >= mv_gpio_softc->pin_num) return; - if (gpio_setup[pin] & MV_GPIO_IN_IRQ_EDGE) + MV_GPIO_LOCK(); + + if (gpio_setup[pin] & (MV_GPIO_IN_IRQ_EDGE | MV_GPIO_IN_IRQ_DOUBLE_EDGE)) mv_gpio_edge(pin, 0); else mv_gpio_level(pin, 0); + + /* + * The interrupt has to be acknowledged before scheduling an interrupt + * thread. This way we allow for interrupt source to trigger again + * (which can happen with shared IRQs e.g. PCI) while processing the + * current event. + */ + mv_gpio_int_ack(pin); + + MV_GPIO_UNLOCK(); } void @@ -296,17 +382,47 @@ mv_gpio_intr_unmask(int pin) if (pin >= mv_gpio_softc->pin_num) return; - if (gpio_setup[pin] & MV_GPIO_IN_IRQ_EDGE) + MV_GPIO_LOCK(); + + if (gpio_setup[pin] & (MV_GPIO_IN_IRQ_EDGE | MV_GPIO_IN_IRQ_DOUBLE_EDGE)) mv_gpio_edge(pin, 1); else mv_gpio_level(pin, 1); + + MV_GPIO_UNLOCK(); } static void +mv_gpio_exec_intr_handlers(uint32_t status, int high) +{ + int i, pin; + + MV_GPIO_ASSERT_LOCKED(); + + i = 0; + while (status != 0) { + if (status & 1) { + pin = (high ? (i + GPIO_PINS_PER_REG) : i); + if (gpio_setup[pin] & MV_GPIO_IN_DEBOUNCE) + mv_gpio_debounce_start(pin); + else if (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE) { + mv_gpio_polarity(pin, 0, 1); + mv_gpio_intr_handler(pin); + } else + mv_gpio_intr_handler(pin); + } + status >>= 1; + i++; + } +} + +static void mv_gpio_intr_handler(int pin) { struct intr_event *event; + MV_GPIO_ASSERT_LOCKED(); + event = gpio_events[pin]; if (event == NULL || TAILQ_EMPTY(&event->ie_handlers)) return; @@ -314,40 +430,286 @@ mv_gpio_intr_handler(int pin) intr_event_handle(event, NULL); } -static int -mv_gpio_configure(uint32_t pin, uint32_t flags) +int +mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask) { + int error; if (pin >= mv_gpio_softc->pin_num) return (EINVAL); - if (flags & MV_GPIO_OUT_BLINK) - mv_gpio_blink(pin, 1); - if (flags & MV_GPIO_IN_POL_LOW) - mv_gpio_polarity(pin, 1); - if (flags & MV_GPIO_IN_IRQ_EDGE) - mv_gpio_edge(pin, 1); - if (flags & MV_GPIO_IN_IRQ_LEVEL) - mv_gpio_level(pin, 1); + /* check flags consistency */ + if (((flags & mask) & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) + return (EINVAL); - gpio_setup[pin] = flags; + if (mask & MV_GPIO_IN_DEBOUNCE) { + error = mv_gpio_debounce_prepare(pin); + if (error != 0) + return (error); + } + MV_GPIO_LOCK(); + + if (mask & MV_GPIO_OUT_BLINK) + mv_gpio_blink(pin, flags & MV_GPIO_OUT_BLINK); + if (mask & MV_GPIO_IN_POL_LOW) + mv_gpio_polarity(pin, flags & MV_GPIO_IN_POL_LOW, 0); + if (mask & MV_GPIO_IN_DEBOUNCE) { + error = mv_gpio_debounce_setup(pin); + if (error) { + MV_GPIO_UNLOCK(); + return (error); + } + } + + gpio_setup[pin] &= ~(mask); + gpio_setup[pin] |= (flags & mask); + + MV_GPIO_UNLOCK(); + return (0); } +static void +mv_gpio_double_edge_init(int pin) +{ + uint8_t raw_read; + + MV_GPIO_ASSERT_LOCKED(); + + raw_read = (mv_gpio_value_get(pin, 1) ? 1 : 0); + + if (raw_read) + mv_gpio_polarity(pin, 1, 0); + else + mv_gpio_polarity(pin, 0, 0); +} + +static int +mv_gpio_debounce_setup(int pin) +{ + struct callout *c; + + MV_GPIO_ASSERT_LOCKED(); + + c = mv_gpio_softc->debounce_callouts[pin]; + if (c == NULL) + return (ENXIO); + + if (callout_active(c)) + callout_deactivate(c); + + callout_stop(c); + + return (0); +} + +static int +mv_gpio_debounce_prepare(int pin) +{ + struct callout *c; + struct mv_gpio_softc *sc; + + sc = (struct mv_gpio_softc *)mv_gpio_softc; + + c = sc->debounce_callouts[pin]; + if (c == NULL) { + c = (struct callout *)malloc(sizeof(struct callout), + M_DEVBUF, M_WAITOK); + sc->debounce_callouts[pin] = c; + if (c == NULL) + return (ENOMEM); + callout_init(c, 1); + } + + return (0); +} + +static int +mv_gpio_debounce_init(int pin) +{ + uint8_t raw_read; + int *cnt; + + MV_GPIO_ASSERT_LOCKED(); + + cnt = &mv_gpio_softc->debounce_counters[pin]; + + raw_read = (mv_gpio_value_get(pin, 1) ? 1 : 0); + if (raw_read) { + mv_gpio_polarity(pin, 1, 0); + *cnt = DEBOUNCE_HI_LO_MS / DEBOUNCE_CHECK_MS; + } else { + mv_gpio_polarity(pin, 0, 0); + *cnt = DEBOUNCE_LO_HI_MS / DEBOUNCE_CHECK_MS; + } + + mv_gpio_debounced_state_set(pin, raw_read); + + return (0); +} + +static void +mv_gpio_debounce_start(int pin) +{ + struct callout *c; + int *debounced_pin; + + MV_GPIO_ASSERT_LOCKED(); + + c = mv_gpio_softc->debounce_callouts[pin]; + if (c == NULL) { + mv_gpio_int_ack(pin); + return; + } + + if (callout_pending(c) || callout_active(c)) { + mv_gpio_int_ack(pin); + return; + } + + debounced_pin = (int *)malloc(sizeof(int), M_DEVBUF, + M_WAITOK); + if (debounced_pin == NULL) { + mv_gpio_int_ack(pin); + return; + } + *debounced_pin = pin; + + callout_reset(c, DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, + debounced_pin); +} + +static void +mv_gpio_debounce(void *arg) +{ + uint8_t raw_read, last_state; + int pin; + int *debounce_counter; + + pin = *((int *)arg); + + MV_GPIO_LOCK(); + + raw_read = (mv_gpio_value_get(pin, 1) ? 1 : 0); + last_state = (mv_gpio_debounced_state_get(pin) ? 1 : 0); + debounce_counter = &mv_gpio_softc->debounce_counters[pin]; + + if (raw_read == last_state) { + if (last_state) + *debounce_counter = DEBOUNCE_HI_LO_MS / + DEBOUNCE_CHECK_MS; + else + *debounce_counter = DEBOUNCE_LO_HI_MS / + DEBOUNCE_CHECK_MS; + + callout_reset(mv_gpio_softc->debounce_callouts[pin], + DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, arg); + } else { + *debounce_counter = *debounce_counter - 1; + if (*debounce_counter != 0) + callout_reset(mv_gpio_softc->debounce_callouts[pin], + DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, arg); + else { + mv_gpio_debounced_state_set(pin, raw_read); + + if (last_state) + *debounce_counter = DEBOUNCE_HI_LO_MS / + DEBOUNCE_CHECK_MS; + else + *debounce_counter = DEBOUNCE_LO_HI_MS / + DEBOUNCE_CHECK_MS; + + if (((gpio_setup[pin] & MV_GPIO_IN_POL_LOW) && + (raw_read == 0)) || + (((gpio_setup[pin] & MV_GPIO_IN_POL_LOW) == 0) && + raw_read) || + (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE)) + mv_gpio_intr_handler(pin); + + /* Toggle polarity for next edge. */ + mv_gpio_polarity(pin, 0, 1); + + free(arg, M_DEVBUF); + callout_deactivate(mv_gpio_softc-> + debounce_callouts[pin]); + } + } + + MV_GPIO_UNLOCK(); +} + +static void +mv_gpio_debounced_state_set(int pin, uint8_t new_state) +{ + uint32_t *old_state; + + MV_GPIO_ASSERT_LOCKED(); + + if (pin >= GPIO_PINS_PER_REG) { + old_state = &mv_gpio_softc->debounced_state_hi; + pin -= GPIO_PINS_PER_REG; + } else + old_state = &mv_gpio_softc->debounced_state_lo; + + if (new_state) + *old_state |= (1 << pin); + else + *old_state &= ~(1 << pin); +} + +static uint32_t +mv_gpio_debounced_state_get(int pin) +{ + uint32_t *state; + + MV_GPIO_ASSERT_LOCKED(); + + if (pin >= GPIO_PINS_PER_REG) { + state = &mv_gpio_softc->debounced_state_hi; + pin -= GPIO_PINS_PER_REG; + } else + state = &mv_gpio_softc->debounced_state_lo; + + return (*state & (1 << pin)); +} + void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable) { + MV_GPIO_LOCK(); + mv_gpio_value_set(pin, val); mv_gpio_out_en(pin, enable); + + MV_GPIO_UNLOCK(); } uint8_t mv_gpio_in(uint32_t pin) { + uint8_t state; - return (mv_gpio_value_get(pin) ? 1 : 0); + MV_GPIO_LOCK(); + + if (gpio_setup[pin] & MV_GPIO_IN_DEBOUNCE) { + if (gpio_setup[pin] & MV_GPIO_IN_POL_LOW) + state = (mv_gpio_debounced_state_get(pin) ? 0 : 1); + else + state = (mv_gpio_debounced_state_get(pin) ? 1 : 0); + } else if (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE) { + if (gpio_setup[pin] & MV_GPIO_IN_POL_LOW) + state = (mv_gpio_value_get(pin, 1) ? 0 : 1); + else + state = (mv_gpio_value_get(pin, 1) ? 1 : 0); + } else + state = (mv_gpio_value_get(pin, 0) ? 1 : 0); + + MV_GPIO_UNLOCK(); + + return (state); } static uint32_t @@ -427,9 +789,9 @@ mv_gpio_blink(uint32_t pin, uint8_t enable) } static void -mv_gpio_polarity(uint32_t pin, uint8_t enable) +mv_gpio_polarity(uint32_t pin, uint8_t enable, uint8_t toggle) { - uint32_t reg; + uint32_t reg, reg_val; if (pin >= mv_gpio_softc->pin_num) return; @@ -440,7 +802,13 @@ mv_gpio_polarity(uint32_t pin, uint8_t enable) } else reg = GPIO_DATA_IN_POLAR; - if (enable) + if (toggle) { + reg_val = mv_gpio_reg_read(reg) & GPIO(pin); + if (reg_val) + mv_gpio_reg_clear(reg, pin); + else + mv_gpio_reg_set(reg, pin); + } else if (enable) mv_gpio_reg_set(reg, pin); else mv_gpio_reg_clear(reg, pin); @@ -504,9 +872,9 @@ mv_gpio_int_ack(uint32_t pin) } static uint32_t -mv_gpio_value_get(uint32_t pin) +mv_gpio_value_get(uint32_t pin, uint8_t exclude_polar) { - uint32_t reg, reg_val; + uint32_t reg, polar_reg, reg_val, polar_reg_val; if (pin >= mv_gpio_softc->pin_num) return (0); @@ -514,12 +882,19 @@ mv_gpio_value_get(uint32_t pin) if (pin >= GPIO_PINS_PER_REG) { reg = GPIO_HI_DATA_IN; pin -= GPIO_PINS_PER_REG; - } else + polar_reg = GPIO_HI_DATA_IN_POLAR; + } else { reg = GPIO_DATA_IN; + polar_reg = GPIO_DATA_IN_POLAR; + } reg_val = mv_gpio_reg_read(reg); - return (reg_val & GPIO(pin)); + if (exclude_polar) { + polar_reg_val = mv_gpio_reg_read(polar_reg); + return ((reg_val & GPIO(pin)) ^ (polar_reg_val & GPIO(pin))); + } else + return (reg_val & GPIO(pin)); } static void @@ -583,7 +958,7 @@ mv_handle_gpios_prop(phandle_t ctrl, pcell_t *gpios, i dir = gpios[1]; flags = gpios[2]; - mv_gpio_configure(pin, flags); + mv_gpio_configure(pin, flags, ~0); if (dir == 1) /* Input. */ Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Wed Apr 4 13:01:14 2018 (r332019) +++ head/sys/arm/mv/mvreg.h Wed Apr 4 13:08:51 2018 (r332020) @@ -308,14 +308,16 @@ #define GPIO(n) (1 << (n)) #define MV_GPIO_MAX_NPINS 64 -#define MV_GPIO_IN_NONE 0x0 -#define MV_GPIO_IN_POL_LOW (1 << 16) -#define MV_GPIO_IN_IRQ_EDGE (2 << 16) -#define MV_GPIO_IN_IRQ_LEVEL (4 << 16) -#define MV_GPIO_OUT_NONE 0x0 -#define MV_GPIO_OUT_BLINK 0x1 -#define MV_GPIO_OUT_OPEN_DRAIN 0x2 -#define MV_GPIO_OUT_OPEN_SRC 0x4 +#define MV_GPIO_IN_NONE 0x0 +#define MV_GPIO_IN_POL_LOW (1 << 16) +#define MV_GPIO_IN_IRQ_EDGE (2 << 16) +#define MV_GPIO_IN_IRQ_LEVEL (4 << 16) +#define MV_GPIO_IN_IRQ_DOUBLE_EDGE (8 << 16) +#define MV_GPIO_IN_DEBOUNCE (16 << 16) +#define MV_GPIO_OUT_NONE 0x0 +#define MV_GPIO_OUT_BLINK 0x1 +#define MV_GPIO_OUT_OPEN_DRAIN 0x2 +#define MV_GPIO_OUT_OPEN_SRC 0x4 #define IS_GPIO_IRQ(irq) ((irq) >= NIRQ && (irq) < NIRQ + MV_GPIO_MAX_NPINS) #define GPIO2IRQ(gpio) ((gpio) + NIRQ) Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Wed Apr 4 13:01:14 2018 (r332019) +++ head/sys/arm/mv/mvvar.h Wed Apr 4 13:08:51 2018 (r332020) @@ -88,6 +88,7 @@ int mv_gpio_setup_intrhandler(const char *name, driver void (*hand)(void *), void *arg, int pin, int flags, void **cookiep); void mv_gpio_intr_mask(int pin); void mv_gpio_intr_unmask(int pin); +int mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask); void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); uint8_t mv_gpio_in(uint32_t pin); From owner-svn-src-all@freebsd.org Wed Apr 4 13:12:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4EFAF8DA70; Wed, 4 Apr 2018 13:12:50 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7046E7A2AA; Wed, 4 Apr 2018 13:12:50 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B281142FA; Wed, 4 Apr 2018 13:12:50 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DCoSx062710; Wed, 4 Apr 2018 13:12:50 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DCoWm062707; Wed, 4 Apr 2018 13:12:50 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041312.w34DCoWm062707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 13:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332021 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 332021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:12:51 -0000 Author: mw Date: Wed Apr 4 13:12:49 2018 New Revision: 332021 URL: https://svnweb.freebsd.org/changeset/base/332021 Log: Improve interrupt and resource allocation in Marvell GPIO driver This patch adds support for more than one interrupts in GPIO controller. It reads necessary information (such as cell size) from FDT, so there are no magic numbers. Note that interrupts are still not working, but this patch makes one good step in correct direction Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14754 Modified: head/sys/arm/mv/gpio.c head/sys/arm/mv/mvvar.h Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Wed Apr 4 13:08:51 2018 (r332020) +++ head/sys/arm/mv/gpio.c Wed Apr 4 13:12:49 2018 (r332021) @@ -67,7 +67,10 @@ __FBSDID("$FreeBSD$"); #define DEBOUNCE_CHECK_TICKS ((hz / 1000) * DEBOUNCE_CHECK_MS) struct mv_gpio_softc { - struct resource * res[GPIO_MAX_INTR_COUNT + 1]; + struct resource * mem_res; + int mem_rid; + struct resource * irq_res[GPIO_MAX_INTR_COUNT]; + int irq_rid[GPIO_MAX_INTR_COUNT]; void *ih_cookie[GPIO_MAX_INTR_COUNT]; bus_space_tag_t bst; bus_space_handle_t bsh; @@ -83,8 +86,6 @@ struct mv_gpio_softc { int *debounce_counters; }; -extern struct resource_spec mv_gpio_res[]; - static struct mv_gpio_softc *mv_gpio_softc = NULL; static uint32_t gpio_setup[MV_GPIO_MAX_NPINS]; @@ -119,6 +120,15 @@ static void mv_gpio_int_ack(uint32_t pin); static void mv_gpio_value_set(uint32_t pin, uint8_t val); static uint32_t mv_gpio_value_get(uint32_t pin, uint8_t exclude_polar); +static void mv_gpio_intr_mask(int pin); +static void mv_gpio_intr_unmask(int pin); +int mv_gpio_setup_intrhandler(const char *name, driver_filter_t *filt, + void (*hand)(void *), void *arg, int pin, int flags, void **cookiep); + +int mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask); +void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); +uint8_t mv_gpio_in(uint32_t pin); + #define MV_GPIO_LOCK() mtx_lock_spin(&mv_gpio_softc->mutex) #define MV_GPIO_UNLOCK() mtx_unlock_spin(&mv_gpio_softc->mutex) #define MV_GPIO_ASSERT_LOCKED() mtx_assert(&mv_gpio_softc->mutex, MA_OWNED) @@ -171,9 +181,12 @@ mv_gpio_probe(device_t dev) static int mv_gpio_attach(device_t dev) { - int error, i; + int error, i, size; struct mv_gpio_softc *sc; uint32_t dev_id, rev_id; + pcell_t pincnt = 0; + pcell_t irq_cells = 0; + phandle_t iparent; sc = (struct mv_gpio_softc *)device_get_softc(dev); if (sc == NULL) @@ -201,10 +214,45 @@ mv_gpio_attach(device_t dev) sc->use_high = 1; } else { - device_printf(dev, "unknown chip id=0x%x\n", dev_id); + if (OF_getencprop(ofw_bus_get_node(dev), "pin-count", &pincnt, + sizeof(pcell_t)) >= 0 || + OF_getencprop(ofw_bus_get_node(dev), "ngpios", &pincnt, + sizeof(pcell_t)) >= 0) { + sc->pin_num = pincnt; + device_printf(dev, "%d pins available\n", sc->pin_num); + } else { + device_printf(dev, "ERROR: no pin-count entry found!\n"); + return (ENXIO); + } + } + + /* Find root interrupt controller */ + iparent = ofw_bus_find_iparent(ofw_bus_get_node(dev)); + if (iparent == 0) { + device_printf(dev, "No interrupt-parrent found. " + "Error in DTB\n"); return (ENXIO); + } else { + /* While at parent - store interrupt cells prop */ + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &irq_cells, sizeof(irq_cells)) == -1) { + device_printf(dev, "DTB: Missing #interrupt-cells " + "property in interrupt parent node\n"); + return (ENXIO); + } } + size = OF_getproplen(ofw_bus_get_node(dev), "interrupts"); + if (size != -1) { + size = size / sizeof(pcell_t); + size = size / irq_cells; + sc->irq_num = size; + device_printf(dev, "%d IRQs available\n", sc->irq_num); + } else { + device_printf(dev, "ERROR: no interrupts entry found!\n"); + return (ENXIO); + } + sc->debounce_callouts = (struct callout **)malloc(sc->pin_num * sizeof(struct callout *), M_DEVBUF, M_WAITOK | M_ZERO); if (sc->debounce_callouts == NULL) @@ -217,16 +265,31 @@ mv_gpio_attach(device_t dev) mtx_init(&sc->mutex, device_get_nameunit(dev), NULL, MTX_SPIN); - error = bus_alloc_resources(dev, mv_gpio_res, sc->res); - if (error) { + sc->mem_rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + RF_ACTIVE); + + if (!sc->mem_res) { mtx_destroy(&sc->mutex); - device_printf(dev, "could not allocate resources\n"); + device_printf(dev, "could not allocate memory window\n"); return (ENXIO); } - sc->bst = rman_get_bustag(sc->res[0]); - sc->bsh = rman_get_bushandle(sc->res[0]); + sc->bst = rman_get_bustag(sc->mem_res); + sc->bsh = rman_get_bushandle(sc->mem_res); + for (i = 0; i < sc->irq_num; i++) { + sc->irq_rid[i] = i; + sc->irq_res[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->irq_rid[i], RF_ACTIVE); + if (!sc->irq_res[i]) { + mtx_destroy(&sc->mutex); + device_printf(dev, + "could not allocate gpio%d interrupt\n", i+1); + return (ENXIO); + } + } + /* Disable all interrupts */ bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_EDGE_MASK, 0); bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_LEV_MASK, 0); @@ -241,12 +304,13 @@ mv_gpio_attach(device_t dev) } for (i = 0; i < sc->irq_num; i++) { - if (bus_setup_intr(dev, sc->res[1 + i], + if (bus_setup_intr(dev, sc->irq_res[i], INTR_TYPE_MISC, (driver_filter_t *)mv_gpio_intr, NULL, sc, &sc->ih_cookie[i]) != 0) { mtx_destroy(&sc->mutex); - bus_release_resources(dev, mv_gpio_res, sc->res); + bus_release_resource(dev, SYS_RES_IRQ, + sc->irq_rid[i], sc->irq_res[i]); device_printf(dev, "could not set up intr %d\n", i); return (ENXIO); } @@ -419,15 +483,21 @@ mv_gpio_exec_intr_handlers(uint32_t status, int high) static void mv_gpio_intr_handler(int pin) { - struct intr_event *event; +#ifdef INTRNG + struct intr_irqsrc isrc; MV_GPIO_ASSERT_LOCKED(); - event = gpio_events[pin]; - if (event == NULL || TAILQ_EMPTY(&event->ie_handlers)) +#ifdef INTR_SOLO + isrc.isrc_filter = NULL; +#endif + isrc.isrc_event = gpio_events[pin]; + + if (isrc.isrc_event == NULL || TAILQ_EMPTY(&isrc.isrc_event->ie_handlers)) return; - intr_event_handle(event, NULL); + intr_isrc_dispatch(&isrc, NULL); +#endif } int Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Wed Apr 4 13:08:51 2018 (r332020) +++ head/sys/arm/mv/mvvar.h Wed Apr 4 13:12:49 2018 (r332021) @@ -83,15 +83,6 @@ extern const struct decode_win *xor_wins; extern int idma_wins_no; extern int xor_wins_no; -/* Function prototypes */ -int mv_gpio_setup_intrhandler(const char *name, driver_filter_t *filt, - void (*hand)(void *), void *arg, int pin, int flags, void **cookiep); -void mv_gpio_intr_mask(int pin); -void mv_gpio_intr_unmask(int pin); -int mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask); -void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); -uint8_t mv_gpio_in(uint32_t pin); - int soc_decode_win(void); void soc_id(uint32_t *dev, uint32_t *rev); void soc_dump_decode_win(void); From owner-svn-src-all@freebsd.org Wed Apr 4 13:15:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3D65F8DD04; Wed, 4 Apr 2018 13:15:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 925A27A4D2; Wed, 4 Apr 2018 13:15:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D58B1430E; Wed, 4 Apr 2018 13:15:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DFChS064311; Wed, 4 Apr 2018 13:15:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DFCAR064310; Wed, 4 Apr 2018 13:15:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041315.w34DFCAR064310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 13:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332022 - stable/11/sys/fs/fuse X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/fs/fuse X-SVN-Commit-Revision: 332022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:15:13 -0000 Author: emaste Date: Wed Apr 4 13:15:12 2018 New Revision: 332022 URL: https://svnweb.freebsd.org/changeset/base/332022 Log: MFC r330354 (eadler): sys/fuse: fix off by one error Reported by: Ilja Van Sprundel Submitted by: Domagoj Stolfa Modified: stable/11/sys/fs/fuse/fuse_internal.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/11/sys/fs/fuse/fuse_internal.c Wed Apr 4 13:12:49 2018 (r332021) +++ stable/11/sys/fs/fuse/fuse_internal.c Wed Apr 4 13:15:12 2018 (r332022) @@ -355,7 +355,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail] = '\0'; + ((char *)cookediov->base)[bytesavail - 1] = '\0'; err = uiomove(cookediov->base, cookediov->len, uio); if (err) { From owner-svn-src-all@freebsd.org Wed Apr 4 13:16:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 942BDF8DE44; Wed, 4 Apr 2018 13:16:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F947A63C; Wed, 4 Apr 2018 13:16:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CC3114311; Wed, 4 Apr 2018 13:16:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DG1Cg064947; Wed, 4 Apr 2018 13:16:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DG1EL064946; Wed, 4 Apr 2018 13:16:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041316.w34DG1EL064946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 13:16:01 +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: r332023 - stable/10/sys/fs/fuse X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/fs/fuse X-SVN-Commit-Revision: 332023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:16:01 -0000 Author: emaste Date: Wed Apr 4 13:16:00 2018 New Revision: 332023 URL: https://svnweb.freebsd.org/changeset/base/332023 Log: MFC r330354 (eadler): sys/fuse: fix off by one error Reported by: Ilja Van Sprundel Submitted by: Domagoj Stolfa Modified: stable/10/sys/fs/fuse/fuse_internal.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/10/sys/fs/fuse/fuse_internal.c Wed Apr 4 13:15:12 2018 (r332022) +++ stable/10/sys/fs/fuse/fuse_internal.c Wed Apr 4 13:16:00 2018 (r332023) @@ -355,7 +355,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail] = '\0'; + ((char *)cookediov->base)[bytesavail - 1] = '\0'; err = uiomove(cookediov->base, cookediov->len, uio); if (err) { From owner-svn-src-all@freebsd.org Wed Apr 4 13:20:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9560F8E372; Wed, 4 Apr 2018 13:20:29 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4987A96E; Wed, 4 Apr 2018 13:20:29 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87EA81431A; Wed, 4 Apr 2018 13:20:29 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DKTYP068128; Wed, 4 Apr 2018 13:20:29 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DKTYS068126; Wed, 4 Apr 2018 13:20:29 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804041320.w34DKTYS068126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Wed, 4 Apr 2018 13:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332024 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 332024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:20:30 -0000 Author: mw Date: Wed Apr 4 13:20:29 2018 New Revision: 332024 URL: https://svnweb.freebsd.org/changeset/base/332024 Log: Enable Marvell gpio driver to work with many controllers This patch moves all global data structures into mv_gpio_softc, and puts device_t parameter to functions calls everywhere where needed. As a result, we can create multiple driver instances. Removed names in function declaration to keep style. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14755 Modified: head/sys/arm/mv/gpio.c head/sys/arm/mv/mvreg.h Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Wed Apr 4 13:16:00 2018 (r332023) +++ head/sys/arm/mv/gpio.c Wed Apr 4 13:20:29 2018 (r332024) @@ -71,13 +71,14 @@ struct mv_gpio_softc { int mem_rid; struct resource * irq_res[GPIO_MAX_INTR_COUNT]; int irq_rid[GPIO_MAX_INTR_COUNT]; + struct intr_event * gpio_events[MV_GPIO_MAX_NPINS]; void *ih_cookie[GPIO_MAX_INTR_COUNT]; bus_space_tag_t bst; bus_space_handle_t bsh; struct mtx mutex; uint8_t pin_num; /* number of GPIO pins */ uint8_t irq_num; /* number of real IRQs occupied by GPIO controller */ - uint8_t use_high; + struct gpio_pin gpio_setup[MV_GPIO_MAX_NPINS]; /* Used for debouncing. */ uint32_t debounced_state_lo; @@ -86,52 +87,56 @@ struct mv_gpio_softc { int *debounce_counters; }; -static struct mv_gpio_softc *mv_gpio_softc = NULL; -static uint32_t gpio_setup[MV_GPIO_MAX_NPINS]; +struct mv_gpio_pindev { + device_t dev; + int pin; +}; static int mv_gpio_probe(device_t); static int mv_gpio_attach(device_t); -static int mv_gpio_intr(void *); -static int mv_gpio_init(void); +static int mv_gpio_intr(device_t, void *); +static int mv_gpio_init(device_t); -static void mv_gpio_double_edge_init(int pin); +static void mv_gpio_double_edge_init(device_t, int); -static int mv_gpio_debounce_setup(int pin); -static int mv_gpio_debounce_init(int pin); -static void mv_gpio_debounce_start(int pin); -static int mv_gpio_debounce_prepare(int pin); -static void mv_gpio_debounce(void *arg); -static void mv_gpio_debounced_state_set(int pin, uint8_t new_state); -static uint32_t mv_gpio_debounced_state_get(int pin); +static int mv_gpio_debounce_setup(device_t, int); +static int mv_gpio_debounce_prepare(device_t, int); +static int mv_gpio_debounce_init(device_t, int); +static void mv_gpio_debounce_start(device_t, int); +static void mv_gpio_debounce(void *); +static void mv_gpio_debounced_state_set(device_t, int, uint8_t); +static uint32_t mv_gpio_debounced_state_get(device_t, int); -static void mv_gpio_exec_intr_handlers(uint32_t status, int high); -static void mv_gpio_intr_handler(int pin); -static uint32_t mv_gpio_reg_read(uint32_t reg); -static void mv_gpio_reg_write(uint32_t reg, uint32_t val); -static void mv_gpio_reg_set(uint32_t reg, uint32_t val); -static void mv_gpio_reg_clear(uint32_t reg, uint32_t val); +static void mv_gpio_exec_intr_handlers(device_t, uint32_t, int); +static void mv_gpio_intr_handler(device_t, int); +static uint32_t mv_gpio_reg_read(device_t, uint32_t); +static void mv_gpio_reg_write(device_t, uint32_t, uint32_t); +static void mv_gpio_reg_set(device_t, uint32_t, uint32_t); +static void mv_gpio_reg_clear(device_t, uint32_t, uint32_t); -static void mv_gpio_blink(uint32_t pin, uint8_t enable); -static void mv_gpio_polarity(uint32_t pin, uint8_t enable, uint8_t toggle); -static void mv_gpio_level(uint32_t pin, uint8_t enable); -static void mv_gpio_edge(uint32_t pin, uint8_t enable); -static void mv_gpio_out_en(uint32_t pin, uint8_t enable); -static void mv_gpio_int_ack(uint32_t pin); -static void mv_gpio_value_set(uint32_t pin, uint8_t val); -static uint32_t mv_gpio_value_get(uint32_t pin, uint8_t exclude_polar); +static void mv_gpio_blink(device_t, uint32_t, uint8_t); +static void mv_gpio_polarity(device_t, uint32_t, uint8_t, uint8_t); +static void mv_gpio_level(device_t, uint32_t, uint8_t); +static void mv_gpio_edge(device_t, uint32_t, uint8_t); +static void mv_gpio_out_en(device_t, uint32_t, uint8_t); +static void mv_gpio_int_ack(struct mv_gpio_pindev *); +static void mv_gpio_value_set(device_t, uint32_t, uint8_t); +static uint32_t mv_gpio_value_get(device_t, uint32_t, uint8_t); -static void mv_gpio_intr_mask(int pin); -static void mv_gpio_intr_unmask(int pin); -int mv_gpio_setup_intrhandler(const char *name, driver_filter_t *filt, - void (*hand)(void *), void *arg, int pin, int flags, void **cookiep); +static void mv_gpio_intr_mask(struct mv_gpio_pindev *); +static void mv_gpio_intr_unmask(struct mv_gpio_pindev *); -int mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask); -void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); -uint8_t mv_gpio_in(uint32_t pin); +void mv_gpio_finish_intrhandler(struct mv_gpio_pindev *); +int mv_gpio_setup_intrhandler(device_t, const char *, + driver_filter_t *, void (*)(void *), void *, + int, int, void **); +int mv_gpio_configure(device_t, uint32_t, uint32_t, uint32_t); +void mv_gpio_out(device_t, uint32_t, uint8_t, uint8_t); +uint8_t mv_gpio_in(device_t, uint32_t); -#define MV_GPIO_LOCK() mtx_lock_spin(&mv_gpio_softc->mutex) -#define MV_GPIO_UNLOCK() mtx_unlock_spin(&mv_gpio_softc->mutex) -#define MV_GPIO_ASSERT_LOCKED() mtx_assert(&mv_gpio_softc->mutex, MA_OWNED) +#define MV_GPIO_LOCK() mtx_lock_spin(&sc->mutex) +#define MV_GPIO_UNLOCK() mtx_unlock_spin(&sc->mutex) +#define MV_GPIO_ASSERT_LOCKED() mtx_assert(&sc->mutex, MA_OWNED) static device_method_t mv_gpio_methods[] = { DEVMETHOD(device_probe, mv_gpio_probe), @@ -149,14 +154,14 @@ static devclass_t mv_gpio_devclass; DRIVER_MODULE(gpio, simplebus, mv_gpio_driver, mv_gpio_devclass, 0, 0); -typedef int (*gpios_phandler_t)(phandle_t, pcell_t *, int); +typedef int (*gpios_phandler_t)(device_t, phandle_t, pcell_t *, int); struct gpio_ctrl_entry { const char *compat; gpios_phandler_t handler; }; -static int mv_handle_gpios_prop(phandle_t ctrl, pcell_t *gpios, int len); +static int mv_handle_gpios_prop(device_t, phandle_t, pcell_t *, int); int gpio_get_config_from_dt(void); struct gpio_ctrl_entry gpio_controllers[] = { @@ -192,10 +197,6 @@ mv_gpio_attach(device_t dev) if (sc == NULL) return (ENXIO); - if (mv_gpio_softc != NULL) - return (ENXIO); - mv_gpio_softc = sc; - /* Get chip id and revision */ soc_id(&dev_id, &rev_id); @@ -205,13 +206,11 @@ mv_gpio_attach(device_t dev) dev_id == MV_DEV_MV78100_Z0 ) { sc->pin_num = 32; sc->irq_num = 4; - sc->use_high = 0; } else if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_88F6282) { sc->pin_num = 50; sc->irq_num = 7; - sc->use_high = 1; } else { if (OF_getencprop(ofw_bus_get_node(dev), "pin-count", &pincnt, @@ -294,15 +293,6 @@ mv_gpio_attach(device_t dev) bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_EDGE_MASK, 0); bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_LEV_MASK, 0); - if (sc->use_high) { - bus_space_write_4(sc->bst, sc->bsh, - GPIO_HI_INT_EDGE_MASK, 0); - bus_space_write_4(sc->bst, sc->bsh, - GPIO_HI_INT_LEV_MASK, 0); - bus_space_write_4(sc->bst, sc->bsh, - GPIO_HI_INT_CAUSE, 0); - } - for (i = 0; i < sc->irq_num; i++) { if (bus_setup_intr(dev, sc->irq_res[i], INTR_TYPE_MISC, @@ -316,7 +306,7 @@ mv_gpio_attach(device_t dev) } } - error = mv_gpio_init(); + error = mv_gpio_init(dev); if (error) { device_printf(dev, "WARNING: failed to initialize GPIO pins, " "error = %d\n", error); @@ -325,14 +315,18 @@ mv_gpio_attach(device_t dev) /* Clear interrupt status. */ bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_CAUSE, 0); + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (0); } static int -mv_gpio_intr(void *arg) +mv_gpio_intr(device_t dev, void *arg) { uint32_t int_cause, gpio_val; - uint32_t int_cause_hi, gpio_val_hi; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_LOCK(); @@ -340,31 +334,18 @@ mv_gpio_intr(void *arg) * According to documentation, edge sensitive interrupts are asserted * when unmasked GPIO_INT_CAUSE register bits are set. */ - int_cause = mv_gpio_reg_read(GPIO_INT_CAUSE); - int_cause &= mv_gpio_reg_read(GPIO_INT_EDGE_MASK); + int_cause = mv_gpio_reg_read(dev, GPIO_INT_CAUSE); + int_cause &= mv_gpio_reg_read(dev, GPIO_INT_EDGE_MASK); /* * Level sensitive interrupts are asserted when unmasked GPIO_DATA_IN * register bits are set. */ - gpio_val = mv_gpio_reg_read(GPIO_DATA_IN); - gpio_val &= mv_gpio_reg_read(GPIO_INT_LEV_MASK); + gpio_val = mv_gpio_reg_read(dev, GPIO_DATA_IN); + gpio_val &= mv_gpio_reg_read(dev, GPIO_INT_LEV_MASK); - int_cause_hi = 0; - gpio_val_hi = 0; - if (mv_gpio_softc->use_high) { - int_cause_hi = mv_gpio_reg_read(GPIO_HI_INT_CAUSE); - int_cause_hi &= mv_gpio_reg_read(GPIO_HI_INT_EDGE_MASK); + mv_gpio_exec_intr_handlers(dev, int_cause | gpio_val, 0); - gpio_val_hi = mv_gpio_reg_read(GPIO_HI_DATA_IN); - gpio_val_hi &= mv_gpio_reg_read(GPIO_HI_INT_LEV_MASK); - } - - mv_gpio_exec_intr_handlers(int_cause | gpio_val, 0); - - if (mv_gpio_softc->use_high) - mv_gpio_exec_intr_handlers(int_cause_hi | gpio_val_hi, 1); - MV_GPIO_UNLOCK(); return (FILTER_HANDLED); @@ -374,31 +355,47 @@ mv_gpio_intr(void *arg) * GPIO interrupt handling */ -static struct intr_event *gpio_events[MV_GPIO_MAX_NPINS]; +void +mv_gpio_finish_intrhandler(struct mv_gpio_pindev *s) +{ + /* When we acheive full interrupt support + * This function will be opposite to + * mv_gpio_setup_intrhandler + */ + /* Now it exists only to remind that + * there should be place to free mv_gpio_pindev + * allocated by mv_gpio_setup_intrhandler + */ + free(s, M_DEVBUF); +} + int -mv_gpio_setup_intrhandler(const char *name, driver_filter_t *filt, +mv_gpio_setup_intrhandler(device_t dev, const char *name, driver_filter_t *filt, void (*hand)(void *), void *arg, int pin, int flags, void **cookiep) { struct intr_event *event; int error; + struct mv_gpio_pindev *s; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); + s = malloc(sizeof(struct mv_gpio_pindev), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pin < 0 || pin >= mv_gpio_softc->pin_num) + if (pin < 0 || pin >= sc->pin_num) return (ENXIO); - event = gpio_events[pin]; + event = sc->gpio_events[pin]; if (event == NULL) { MV_GPIO_LOCK(); - if (gpio_setup[pin] & MV_GPIO_IN_DEBOUNCE) { - error = mv_gpio_debounce_init(pin); + if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_DEBOUNCE) { + error = mv_gpio_debounce_init(dev, pin); if (error != 0) { MV_GPIO_UNLOCK(); return (error); } - } else if (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE) - mv_gpio_double_edge_init(pin); + } else if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_IRQ_DOUBLE_EDGE) + mv_gpio_double_edge_init(dev, pin); MV_GPIO_UNLOCK(); - - error = intr_event_create(&event, (void *)pin, 0, pin, + error = intr_event_create(&event, (void *)s, 0, pin, (void (*)(void *))mv_gpio_intr_mask, (void (*)(void *))mv_gpio_intr_unmask, (void (*)(void *))mv_gpio_int_ack, @@ -406,7 +403,7 @@ mv_gpio_setup_intrhandler(const char *name, driver_fil "gpio%d:", pin); if (error != 0) return (error); - gpio_events[pin] = event; + sc->gpio_events[pin] = event; } intr_event_add_handler(event, name, filt, hand, arg, @@ -414,19 +411,22 @@ mv_gpio_setup_intrhandler(const char *name, driver_fil return (0); } -void -mv_gpio_intr_mask(int pin) +static void +mv_gpio_intr_mask(struct mv_gpio_pindev *s) { + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(s->dev); - if (pin >= mv_gpio_softc->pin_num) + if (s->pin >= sc->pin_num) return; MV_GPIO_LOCK(); - if (gpio_setup[pin] & (MV_GPIO_IN_IRQ_EDGE | MV_GPIO_IN_IRQ_DOUBLE_EDGE)) - mv_gpio_edge(pin, 0); + if (sc->gpio_setup[s->pin].gp_flags & (MV_GPIO_IN_IRQ_EDGE | + MV_GPIO_IN_IRQ_DOUBLE_EDGE)) + mv_gpio_edge(s->dev, s->pin, 0); else - mv_gpio_level(pin, 0); + mv_gpio_level(s->dev, s->pin, 0); /* * The interrupt has to be acknowledged before scheduling an interrupt @@ -434,32 +434,41 @@ mv_gpio_intr_mask(int pin) * (which can happen with shared IRQs e.g. PCI) while processing the * current event. */ - mv_gpio_int_ack(pin); + mv_gpio_int_ack(s); MV_GPIO_UNLOCK(); + + return; } -void -mv_gpio_intr_unmask(int pin) +static void +mv_gpio_intr_unmask(struct mv_gpio_pindev *s) { + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(s->dev); - if (pin >= mv_gpio_softc->pin_num) + if (s->pin >= sc->pin_num) return; MV_GPIO_LOCK(); - if (gpio_setup[pin] & (MV_GPIO_IN_IRQ_EDGE | MV_GPIO_IN_IRQ_DOUBLE_EDGE)) - mv_gpio_edge(pin, 1); + if (sc->gpio_setup[s->pin].gp_flags & (MV_GPIO_IN_IRQ_EDGE | + MV_GPIO_IN_IRQ_DOUBLE_EDGE)) + mv_gpio_edge(s->dev, s->pin, 1); else - mv_gpio_level(pin, 1); + mv_gpio_level(s->dev, s->pin, 1); MV_GPIO_UNLOCK(); + + return; } static void -mv_gpio_exec_intr_handlers(uint32_t status, int high) +mv_gpio_exec_intr_handlers(device_t dev, uint32_t status, int high) { int i, pin; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_ASSERT_LOCKED(); @@ -467,13 +476,13 @@ mv_gpio_exec_intr_handlers(uint32_t status, int high) while (status != 0) { if (status & 1) { pin = (high ? (i + GPIO_PINS_PER_REG) : i); - if (gpio_setup[pin] & MV_GPIO_IN_DEBOUNCE) - mv_gpio_debounce_start(pin); - else if (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE) { - mv_gpio_polarity(pin, 0, 1); - mv_gpio_intr_handler(pin); + if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_DEBOUNCE) + mv_gpio_debounce_start(dev, pin); + else if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_IRQ_DOUBLE_EDGE) { + mv_gpio_polarity(dev, pin, 0, 1); + mv_gpio_intr_handler(dev, pin); } else - mv_gpio_intr_handler(pin); + mv_gpio_intr_handler(dev, pin); } status >>= 1; i++; @@ -481,17 +490,19 @@ mv_gpio_exec_intr_handlers(uint32_t status, int high) } static void -mv_gpio_intr_handler(int pin) +mv_gpio_intr_handler(device_t dev, int pin) { #ifdef INTRNG struct intr_irqsrc isrc; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_ASSERT_LOCKED(); #ifdef INTR_SOLO isrc.isrc_filter = NULL; #endif - isrc.isrc_event = gpio_events[pin]; + isrc.isrc_event = sc->gpio_events[pin]; if (isrc.isrc_event == NULL || TAILQ_EMPTY(&isrc.isrc_event->ie_handlers)) return; @@ -501,11 +512,14 @@ mv_gpio_intr_handler(int pin) } int -mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask) +mv_gpio_configure(device_t dev, uint32_t pin, uint32_t flags, uint32_t mask) { int error; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); + error = 0; - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return (EINVAL); /* check flags consistency */ @@ -514,7 +528,7 @@ mv_gpio_configure(uint32_t pin, uint32_t flags, uint32 return (EINVAL); if (mask & MV_GPIO_IN_DEBOUNCE) { - error = mv_gpio_debounce_prepare(pin); + error = mv_gpio_debounce_prepare(dev, pin); if (error != 0) return (error); } @@ -522,19 +536,19 @@ mv_gpio_configure(uint32_t pin, uint32_t flags, uint32 MV_GPIO_LOCK(); if (mask & MV_GPIO_OUT_BLINK) - mv_gpio_blink(pin, flags & MV_GPIO_OUT_BLINK); + mv_gpio_blink(dev, pin, flags & MV_GPIO_OUT_BLINK); if (mask & MV_GPIO_IN_POL_LOW) - mv_gpio_polarity(pin, flags & MV_GPIO_IN_POL_LOW, 0); + mv_gpio_polarity(dev, pin, flags & MV_GPIO_IN_POL_LOW, 0); if (mask & MV_GPIO_IN_DEBOUNCE) { - error = mv_gpio_debounce_setup(pin); + error = mv_gpio_debounce_setup(dev, pin); if (error) { MV_GPIO_UNLOCK(); return (error); } } - gpio_setup[pin] &= ~(mask); - gpio_setup[pin] |= (flags & mask); + sc->gpio_setup[pin].gp_flags &= ~(mask); + sc->gpio_setup[pin].gp_flags |= (flags & mask); MV_GPIO_UNLOCK(); @@ -542,28 +556,33 @@ mv_gpio_configure(uint32_t pin, uint32_t flags, uint32 } static void -mv_gpio_double_edge_init(int pin) +mv_gpio_double_edge_init(device_t dev, int pin) { uint8_t raw_read; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_ASSERT_LOCKED(); - raw_read = (mv_gpio_value_get(pin, 1) ? 1 : 0); + raw_read = (mv_gpio_value_get(dev, pin, 1) ? 1 : 0); if (raw_read) - mv_gpio_polarity(pin, 1, 0); + mv_gpio_polarity(dev, pin, 1, 0); else - mv_gpio_polarity(pin, 0, 0); + mv_gpio_polarity(dev, pin, 0, 0); } static int -mv_gpio_debounce_setup(int pin) +mv_gpio_debounce_setup(device_t dev, int pin) { struct callout *c; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); + MV_GPIO_ASSERT_LOCKED(); - c = mv_gpio_softc->debounce_callouts[pin]; + c = sc->debounce_callouts[pin]; if (c == NULL) return (ENXIO); @@ -576,12 +595,12 @@ mv_gpio_debounce_setup(int pin) } static int -mv_gpio_debounce_prepare(int pin) +mv_gpio_debounce_prepare(device_t dev, int pin) { struct callout *c; struct mv_gpio_softc *sc; - sc = (struct mv_gpio_softc *)mv_gpio_softc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); c = sc->debounce_callouts[pin]; if (c == NULL) { @@ -597,58 +616,63 @@ mv_gpio_debounce_prepare(int pin) } static int -mv_gpio_debounce_init(int pin) +mv_gpio_debounce_init(device_t dev, int pin) { uint8_t raw_read; int *cnt; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); + MV_GPIO_ASSERT_LOCKED(); - cnt = &mv_gpio_softc->debounce_counters[pin]; - - raw_read = (mv_gpio_value_get(pin, 1) ? 1 : 0); + cnt = &sc->debounce_counters[pin]; + raw_read = (mv_gpio_value_get(dev, pin, 1) ? 1 : 0); if (raw_read) { - mv_gpio_polarity(pin, 1, 0); + mv_gpio_polarity(dev, pin, 1, 0); *cnt = DEBOUNCE_HI_LO_MS / DEBOUNCE_CHECK_MS; } else { - mv_gpio_polarity(pin, 0, 0); + mv_gpio_polarity(dev, pin, 0, 0); *cnt = DEBOUNCE_LO_HI_MS / DEBOUNCE_CHECK_MS; } - mv_gpio_debounced_state_set(pin, raw_read); + mv_gpio_debounced_state_set(dev, pin, raw_read); return (0); } static void -mv_gpio_debounce_start(int pin) +mv_gpio_debounce_start(device_t dev, int pin) { struct callout *c; - int *debounced_pin; + struct mv_gpio_pindev s = {dev, pin}; + struct mv_gpio_pindev *sd; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_ASSERT_LOCKED(); - c = mv_gpio_softc->debounce_callouts[pin]; + c = sc->debounce_callouts[pin]; if (c == NULL) { - mv_gpio_int_ack(pin); + mv_gpio_int_ack(&s); return; } if (callout_pending(c) || callout_active(c)) { - mv_gpio_int_ack(pin); + mv_gpio_int_ack(&s); return; } - debounced_pin = (int *)malloc(sizeof(int), M_DEVBUF, - M_WAITOK); - if (debounced_pin == NULL) { - mv_gpio_int_ack(pin); + sd = (struct mv_gpio_pindev *)malloc(sizeof(struct mv_gpio_pindev), + M_DEVBUF, M_WAITOK); + if (sd == NULL) { + mv_gpio_int_ack(&s); return; } - *debounced_pin = pin; + sd->pin = pin; + sd->dev = dev; - callout_reset(c, DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, - debounced_pin); + callout_reset(c, DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, sd); } static void @@ -656,15 +680,21 @@ mv_gpio_debounce(void *arg) { uint8_t raw_read, last_state; int pin; + device_t dev; int *debounce_counter; + struct mv_gpio_softc *sc; + struct mv_gpio_pindev *s; - pin = *((int *)arg); + s = (struct mv_gpio_pindev *)arg; + dev = s->dev; + pin = s->pin; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_LOCK(); - raw_read = (mv_gpio_value_get(pin, 1) ? 1 : 0); - last_state = (mv_gpio_debounced_state_get(pin) ? 1 : 0); - debounce_counter = &mv_gpio_softc->debounce_counters[pin]; + raw_read = (mv_gpio_value_get(dev, pin, 1) ? 1 : 0); + last_state = (mv_gpio_debounced_state_get(dev, pin) ? 1 : 0); + debounce_counter = &sc->debounce_counters[pin]; if (raw_read == last_state) { if (last_state) @@ -674,15 +704,15 @@ mv_gpio_debounce(void *arg) *debounce_counter = DEBOUNCE_LO_HI_MS / DEBOUNCE_CHECK_MS; - callout_reset(mv_gpio_softc->debounce_callouts[pin], + callout_reset(sc->debounce_callouts[pin], DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, arg); } else { *debounce_counter = *debounce_counter - 1; if (*debounce_counter != 0) - callout_reset(mv_gpio_softc->debounce_callouts[pin], + callout_reset(sc->debounce_callouts[pin], DEBOUNCE_CHECK_TICKS, mv_gpio_debounce, arg); else { - mv_gpio_debounced_state_set(pin, raw_read); + mv_gpio_debounced_state_set(dev, pin, raw_read); if (last_state) *debounce_counter = DEBOUNCE_HI_LO_MS / @@ -691,19 +721,18 @@ mv_gpio_debounce(void *arg) *debounce_counter = DEBOUNCE_LO_HI_MS / DEBOUNCE_CHECK_MS; - if (((gpio_setup[pin] & MV_GPIO_IN_POL_LOW) && + if (((sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_POL_LOW) && (raw_read == 0)) || - (((gpio_setup[pin] & MV_GPIO_IN_POL_LOW) == 0) && + (((sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_POL_LOW) == 0) && raw_read) || - (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE)) - mv_gpio_intr_handler(pin); + (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_IRQ_DOUBLE_EDGE)) + mv_gpio_intr_handler(dev, pin); /* Toggle polarity for next edge. */ - mv_gpio_polarity(pin, 0, 1); + mv_gpio_polarity(dev, pin, 0, 1); free(arg, M_DEVBUF); - callout_deactivate(mv_gpio_softc-> - debounce_callouts[pin]); + callout_deactivate(sc->debounce_callouts[pin]); } } @@ -711,17 +740,19 @@ mv_gpio_debounce(void *arg) } static void -mv_gpio_debounced_state_set(int pin, uint8_t new_state) +mv_gpio_debounced_state_set(device_t dev, int pin, uint8_t new_state) { uint32_t *old_state; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_ASSERT_LOCKED(); if (pin >= GPIO_PINS_PER_REG) { - old_state = &mv_gpio_softc->debounced_state_hi; + old_state = &sc->debounced_state_hi; pin -= GPIO_PINS_PER_REG; } else - old_state = &mv_gpio_softc->debounced_state_lo; + old_state = &sc->debounced_state_lo; if (new_state) *old_state |= (1 << pin); @@ -730,265 +761,255 @@ mv_gpio_debounced_state_set(int pin, uint8_t new_state } static uint32_t -mv_gpio_debounced_state_get(int pin) +mv_gpio_debounced_state_get(device_t dev, int pin) { uint32_t *state; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_ASSERT_LOCKED(); if (pin >= GPIO_PINS_PER_REG) { - state = &mv_gpio_softc->debounced_state_hi; + state = &sc->debounced_state_hi; pin -= GPIO_PINS_PER_REG; } else - state = &mv_gpio_softc->debounced_state_lo; + state = &sc->debounced_state_lo; return (*state & (1 << pin)); } void -mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable) +mv_gpio_out(device_t dev, uint32_t pin, uint8_t val, uint8_t enable) { + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_LOCK(); - mv_gpio_value_set(pin, val); - mv_gpio_out_en(pin, enable); + mv_gpio_value_set(dev, pin, val); + mv_gpio_out_en(dev, pin, enable); MV_GPIO_UNLOCK(); } uint8_t -mv_gpio_in(uint32_t pin) +mv_gpio_in(device_t dev, uint32_t pin) { uint8_t state; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); MV_GPIO_LOCK(); - if (gpio_setup[pin] & MV_GPIO_IN_DEBOUNCE) { - if (gpio_setup[pin] & MV_GPIO_IN_POL_LOW) - state = (mv_gpio_debounced_state_get(pin) ? 0 : 1); + if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_DEBOUNCE) { + if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_POL_LOW) + state = (mv_gpio_debounced_state_get(dev, pin) ? 0 : 1); else - state = (mv_gpio_debounced_state_get(pin) ? 1 : 0); - } else if (gpio_setup[pin] & MV_GPIO_IN_IRQ_DOUBLE_EDGE) { - if (gpio_setup[pin] & MV_GPIO_IN_POL_LOW) - state = (mv_gpio_value_get(pin, 1) ? 0 : 1); + state = (mv_gpio_debounced_state_get(dev, pin) ? 1 : 0); + } else if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_IRQ_DOUBLE_EDGE) { + if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_POL_LOW) + state = (mv_gpio_value_get(dev, pin, 1) ? 0 : 1); else - state = (mv_gpio_value_get(pin, 1) ? 1 : 0); + state = (mv_gpio_value_get(dev, pin, 1) ? 1 : 0); } else - state = (mv_gpio_value_get(pin, 0) ? 1 : 0); + state = (mv_gpio_value_get(dev, pin, 0) ? 1 : 0); - MV_GPIO_UNLOCK(); return (state); } static uint32_t -mv_gpio_reg_read(uint32_t reg) +mv_gpio_reg_read(device_t dev, uint32_t reg) { + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - return (bus_space_read_4(mv_gpio_softc->bst, - mv_gpio_softc->bsh, reg)); + return (bus_space_read_4(sc->bst, sc->bsh, reg)); } static void -mv_gpio_reg_write(uint32_t reg, uint32_t val) +mv_gpio_reg_write(device_t dev, uint32_t reg, uint32_t val) { + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - bus_space_write_4(mv_gpio_softc->bst, - mv_gpio_softc->bsh, reg, val); + bus_space_write_4(sc->bst, sc->bsh, reg, val); } static void -mv_gpio_reg_set(uint32_t reg, uint32_t pin) +mv_gpio_reg_set(device_t dev, uint32_t reg, uint32_t pin) { uint32_t reg_val; - reg_val = mv_gpio_reg_read(reg); + reg_val = mv_gpio_reg_read(dev, reg); reg_val |= GPIO(pin); - mv_gpio_reg_write(reg, reg_val); + mv_gpio_reg_write(dev, reg, reg_val); } static void -mv_gpio_reg_clear(uint32_t reg, uint32_t pin) +mv_gpio_reg_clear(device_t dev, uint32_t reg, uint32_t pin) { uint32_t reg_val; - reg_val = mv_gpio_reg_read(reg); + reg_val = mv_gpio_reg_read(dev, reg); reg_val &= ~(GPIO(pin)); - mv_gpio_reg_write(reg, reg_val); + mv_gpio_reg_write(dev, reg, reg_val); } static void -mv_gpio_out_en(uint32_t pin, uint8_t enable) +mv_gpio_out_en(device_t dev, uint32_t pin, uint8_t enable) { uint32_t reg; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return; - if (pin >= GPIO_PINS_PER_REG) { - reg = GPIO_HI_DATA_OUT_EN_CTRL; - pin -= GPIO_PINS_PER_REG; - } else - reg = GPIO_DATA_OUT_EN_CTRL; + reg = GPIO_DATA_OUT_EN_CTRL; if (enable) - mv_gpio_reg_clear(reg, pin); + mv_gpio_reg_clear(dev, reg, pin); else - mv_gpio_reg_set(reg, pin); + mv_gpio_reg_set(dev, reg, pin); } static void -mv_gpio_blink(uint32_t pin, uint8_t enable) +mv_gpio_blink(device_t dev, uint32_t pin, uint8_t enable) { uint32_t reg; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return; - if (pin >= GPIO_PINS_PER_REG) { - reg = GPIO_HI_BLINK_EN; - pin -= GPIO_PINS_PER_REG; - } else - reg = GPIO_BLINK_EN; + reg = GPIO_BLINK_EN; if (enable) - mv_gpio_reg_set(reg, pin); + mv_gpio_reg_set(dev, reg, pin); else - mv_gpio_reg_clear(reg, pin); + mv_gpio_reg_clear(dev, reg, pin); } static void -mv_gpio_polarity(uint32_t pin, uint8_t enable, uint8_t toggle) +mv_gpio_polarity(device_t dev, uint32_t pin, uint8_t enable, uint8_t toggle) { uint32_t reg, reg_val; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return; - if (pin >= GPIO_PINS_PER_REG) { - reg = GPIO_HI_DATA_IN_POLAR; - pin -= GPIO_PINS_PER_REG; - } else - reg = GPIO_DATA_IN_POLAR; + reg = GPIO_DATA_IN_POLAR; if (toggle) { - reg_val = mv_gpio_reg_read(reg) & GPIO(pin); + reg_val = mv_gpio_reg_read(dev, reg) & GPIO(pin); if (reg_val) - mv_gpio_reg_clear(reg, pin); + mv_gpio_reg_clear(dev, reg, pin); else - mv_gpio_reg_set(reg, pin); + mv_gpio_reg_set(dev, reg, pin); } else if (enable) - mv_gpio_reg_set(reg, pin); + mv_gpio_reg_set(dev, reg, pin); else - mv_gpio_reg_clear(reg, pin); + mv_gpio_reg_clear(dev, reg, pin); } static void -mv_gpio_level(uint32_t pin, uint8_t enable) +mv_gpio_level(device_t dev, uint32_t pin, uint8_t enable) { uint32_t reg; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return; - if (pin >= GPIO_PINS_PER_REG) { - reg = GPIO_HI_INT_LEV_MASK; - pin -= GPIO_PINS_PER_REG; - } else - reg = GPIO_INT_LEV_MASK; + reg = GPIO_INT_LEV_MASK; if (enable) - mv_gpio_reg_set(reg, pin); + mv_gpio_reg_set(dev, reg, pin); else - mv_gpio_reg_clear(reg, pin); + mv_gpio_reg_clear(dev, reg, pin); } static void -mv_gpio_edge(uint32_t pin, uint8_t enable) +mv_gpio_edge(device_t dev, uint32_t pin, uint8_t enable) { uint32_t reg; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(dev); - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return; - if (pin >= GPIO_PINS_PER_REG) { - reg = GPIO_HI_INT_EDGE_MASK; - pin -= GPIO_PINS_PER_REG; - } else - reg = GPIO_INT_EDGE_MASK; + reg = GPIO_INT_EDGE_MASK; if (enable) - mv_gpio_reg_set(reg, pin); + mv_gpio_reg_set(dev, reg, pin); else - mv_gpio_reg_clear(reg, pin); + mv_gpio_reg_clear(dev, reg, pin); } static void -mv_gpio_int_ack(uint32_t pin) +mv_gpio_int_ack(struct mv_gpio_pindev *s) { - uint32_t reg; + uint32_t reg, pin; + struct mv_gpio_softc *sc; + sc = (struct mv_gpio_softc *)device_get_softc(s->dev); + pin = s->pin; - if (pin >= mv_gpio_softc->pin_num) + if (pin >= sc->pin_num) return; - if (pin >= GPIO_PINS_PER_REG) { - reg = GPIO_HI_INT_CAUSE; - pin -= GPIO_PINS_PER_REG; - } else - reg = GPIO_INT_CAUSE; + reg = GPIO_INT_CAUSE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 13:23:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59232F8E74C; Wed, 4 Apr 2018 13:23:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E1157AFE8; Wed, 4 Apr 2018 13:23:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08188144C3; Wed, 4 Apr 2018 13:23:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DN8v4074927; Wed, 4 Apr 2018 13:23:08 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DN6lF074902; Wed, 4 Apr 2018 13:23:06 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201804041323.w34DN6lF074902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 4 Apr 2018 13:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332025 - in stable/11/sys: arm/allwinner arm/nvidia arm/nvidia/tegra124 conf dev/extres/phy dev/usb/controller X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in stable/11/sys: arm/allwinner arm/nvidia arm/nvidia/tegra124 conf dev/extres/phy dev/usb/controller X-SVN-Commit-Revision: 332025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:23:08 -0000 Author: mmel Date: Wed Apr 4 13:23:06 2018 New Revision: 332025 URL: https://svnweb.freebsd.org/changeset/base/332025 Log: MFC r328201: Convert extres/phy to kobj model. Similarly as other extres pseudo-drivers, implement phy by using kobj model. This detaches it from provider device, so single device driver can export multiple different phys. Additionally, this allows phy to be subclassed to more specialized drivers, like is USB OTG phy, or PCIe phy with hot-plug capability. Added: stable/11/sys/dev/extres/phy/phydev_if.m - copied unchanged from r328201, head/sys/dev/extres/phy/phydev_if.m stable/11/sys/dev/extres/phy/phynode_if.m - copied unchanged from r328201, head/sys/dev/extres/phy/phynode_if.m Deleted: stable/11/sys/dev/extres/phy/phy_if.m Modified: stable/11/sys/arm/allwinner/a10_ehci.c stable/11/sys/arm/allwinner/aw_usbphy.c stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c stable/11/sys/arm/nvidia/tegra_ahci.c stable/11/sys/arm/nvidia/tegra_ehci.c stable/11/sys/arm/nvidia/tegra_pcie.c stable/11/sys/arm/nvidia/tegra_usbphy.c stable/11/sys/arm/nvidia/tegra_xhci.c stable/11/sys/conf/files stable/11/sys/dev/extres/phy/phy.c stable/11/sys/dev/extres/phy/phy.h stable/11/sys/dev/usb/controller/generic_ohci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/a10_ehci.c ============================================================================== --- stable/11/sys/arm/allwinner/a10_ehci.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/allwinner/a10_ehci.c Wed Apr 4 13:23:06 2018 (r332025) @@ -231,7 +231,7 @@ a10_ehci_attach(device_t self) device_printf(self, "Could not get phy\n"); goto error; } - err = phy_enable(self, aw_sc->phy); + err = phy_enable(aw_sc->phy); if (err != 0) { device_printf(self, "Could not enable phy\n"); goto error; Modified: stable/11/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- stable/11/sys/arm/allwinner/aw_usbphy.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/allwinner/aw_usbphy.c Wed Apr 4 13:23:06 2018 (r332025) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "phy_if.h" +#include "phynode_if.h" #define USBPHY_NPHYS 4 @@ -72,6 +72,16 @@ struct awusbphy_softc { int vbus_det_valid; }; + /* Phy class and methods. */ +static int awusbphy_phy_enable(struct phynode *phy, bool enable); +static phynode_method_t awusbphy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, awusbphy_phy_enable), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_class, awusbphy_phynode_methods, + 0, phynode_class); + static int awusbphy_init(device_t dev) { @@ -148,12 +158,18 @@ awusbphy_vbus_detect(device_t dev, int *val) } static int -awusbphy_phy_enable(device_t dev, intptr_t phy, bool enable) +awusbphy_phy_enable(struct phynode *phynode, bool enable) { + device_t dev; + intptr_t phy; struct awusbphy_softc *sc; regulator_t reg; int error, vbus_det; + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + if (phy < 0 || phy >= USBPHY_NPHYS) return (ERANGE); @@ -203,6 +219,9 @@ static int awusbphy_attach(device_t dev) { int error; + struct phynode *phynode; + struct phynode_init_def phy_init; + int i; error = awusbphy_init(dev); if (error) { @@ -211,7 +230,22 @@ awusbphy_attach(device_t dev) return (error); } - phy_register_provider(dev); + /* Create and register phys. */ + for (i = 0; i < USBPHY_NPHYS; i++) { + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = i; + phy_init.ofw_node = ofw_bus_get_node(dev); + phynode = phynode_create(dev, &awusbphy_phynode_class, + &phy_init); + if (phynode == NULL) { + device_printf(dev, "failed to create USB PHY\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(dev, "failed to create USB PHY\n"); + return (ENXIO); + } + } return (error); } @@ -220,9 +254,6 @@ static device_method_t awusbphy_methods[] = { /* Device interface */ DEVMETHOD(device_probe, awusbphy_probe), DEVMETHOD(device_attach, awusbphy_attach), - - /* PHY interface */ - DEVMETHOD(phy_enable, awusbphy_phy_enable), DEVMETHOD_END }; Modified: stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Wed Apr 4 13:23:06 2018 (r332025) @@ -22,10 +22,11 @@ * 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 @@ -50,7 +51,7 @@ #include -#include "phy_if.h" +#include "phydev_if.h" /* FUSE calibration data. */ #define FUSE_XUSB_CALIB 0x0F0 @@ -216,7 +217,6 @@ struct padctl_port { struct padctl_port *port); /* Runtime data. */ - phandle_t xref; bool enabled; regulator_t supply_vbus; /* USB2, USB3 */ bool internal; /* ULPI, USB2, USB3 */ @@ -303,7 +303,6 @@ struct padctl_lane { int nmux; /* Runtime data. */ bool enabled; - phandle_t xref; struct padctl_pad *pad; struct padctl_port *port; int mux_idx; @@ -353,6 +352,16 @@ static struct padctl_lane_map lane_map_tbl[] = { LANE_MAP(1, PADCTL_PAD_SATA, 0), /* port USB3-1 -> lane SATA-0 */ }; + /* Phy class and methods. */ +static int xusbpadctl_phy_enable(struct phynode *phy, bool enable); +static phynode_method_t xusbpadctl_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, xusbpadctl_phy_enable), + PHYNODEMETHOD_END + +}; +DEFINE_CLASS_1(xusbpadctl_phynode, xusbpadctl_phynode_class, + xusbpadctl_phynode_methods, 0, phynode_class); + static struct padctl_port *search_lane_port(struct padctl_softc *sc, struct padctl_lane *lane); /* ------------------------------------------------------------------------- @@ -683,13 +692,17 @@ phy_powerdown(struct padctl_softc *sc) } static int -xusbpadctl_phy_enable(device_t dev, intptr_t id, bool enable) +xusbpadctl_phy_enable(struct phynode *phy, bool enable) { + device_t dev; + intptr_t id; struct padctl_softc *sc; struct padctl_lane *lane; struct padctl_pad *pad; int rv; + dev = phynode_get_device(phy); + id = phynode_get_id(phy); sc = device_get_softc(dev); if (id < 0 || id >= nitems(lanes_tbl)) { @@ -731,24 +744,6 @@ xusbpadctl_phy_enable(device_t dev, intptr_t id, bool return (0); } -static int -xusbpadctl_phy_map(device_t provider, phandle_t xref, int ncells, - pcell_t *cells, intptr_t *id) -{ - int i; - - if (ncells != 0) - return (ERANGE); - - for (i = 0; i < nitems(lanes_tbl); i++) { - if (lanes_tbl[i].xref == xref) { - *id = i; - return (0); - } - } - return (ENXIO); -} - /* ------------------------------------------------------------------------- * * FDT processing @@ -871,6 +866,8 @@ static int process_lane(struct padctl_softc *sc, phandle_t node, struct padctl_pad *pad) { struct padctl_lane *lane; + struct phynode *phynode; + struct phynode_init_def phy_init; char *name; char *function; int rv; @@ -913,10 +910,25 @@ process_lane(struct padctl_softc *sc, phandle_t node, rv = ENXIO; goto end; } - lane->xref = OF_xref_from_node(node); lane->pad = pad; lane->enabled = true; pad->lanes[pad->nlanes++] = lane; + + /* Create and register phy. */ + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = lane - lanes_tbl; + phy_init.ofw_node = node; + phynode = phynode_create(sc->dev, &xusbpadctl_phynode_class, &phy_init); + if (phynode == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + rv = ENXIO; + goto end; + } + if (phynode_register(phynode) == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + return (ENXIO); + } + rv = 0; end: @@ -930,7 +942,6 @@ end: static int process_pad(struct padctl_softc *sc, phandle_t node) { - phandle_t xref; struct padctl_pad *pad; char *name; int rv; @@ -963,9 +974,6 @@ process_pad(struct padctl_softc *sc, phandle_t node) rv = process_lane(sc, node, pad); if (rv != 0) goto end; - - xref = OF_xref_from_node(node); - OF_device_register_xref(xref, sc->dev); } pad->enabled = true; rv = 0; @@ -1193,10 +1201,6 @@ static device_method_t tegra_xusbpadctl_methods[] = { DEVMETHOD(device_probe, xusbpadctl_probe), DEVMETHOD(device_attach, xusbpadctl_attach), DEVMETHOD(device_detach, xusbpadctl_detach), - - /* phy interface */ - DEVMETHOD(phy_enable, xusbpadctl_phy_enable), - DEVMETHOD(phy_map, xusbpadctl_phy_map), DEVMETHOD_END }; Modified: stable/11/sys/arm/nvidia/tegra_ahci.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_ahci.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/nvidia/tegra_ahci.c Wed Apr 4 13:23:06 2018 (r332025) @@ -372,7 +372,7 @@ enable_fdt_resources(struct tegra_ahci_sc *sc) return (rv); } - rv = phy_enable(sc->dev, sc->phy); + rv = phy_enable(sc->phy); if (rv != 0) { device_printf(sc->dev, "Cannot enable SATA phy\n"); return (rv); Modified: stable/11/sys/arm/nvidia/tegra_ehci.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_ehci.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/nvidia/tegra_ehci.c Wed Apr 4 13:23:06 2018 (r332025) @@ -214,7 +214,7 @@ tegra_ehci_attach(device_t dev) goto out; } - rv = phy_enable(sc->dev, sc->phy); + rv = phy_enable(sc->phy); if (rv != 0) { device_printf(dev, "Cannot enable phy: %d\n", rv); goto out; Modified: stable/11/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_pcie.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/nvidia/tegra_pcie.c Wed Apr 4 13:23:06 2018 (r332025) @@ -1310,7 +1310,7 @@ tegra_pcib_enable(struct tegra_pcib_softc *sc) for (i = 0; i < TEGRA_PCIB_MAX_PORTS; i++) { if (sc->ports[i] != NULL) { - rv = phy_enable(sc->dev, sc->ports[i]->phy); + rv = phy_enable(sc->ports[i]->phy); if (rv != 0) { device_printf(sc->dev, "Cannot enable phy for port %d\n", Modified: stable/11/sys/arm/nvidia/tegra_usbphy.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_usbphy.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/nvidia/tegra_usbphy.c Wed Apr 4 13:23:06 2018 (r332025) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "phy_if.h" +#include "phynode_if.h" #define CTRL_ICUSB_CTRL 0x15c #define ICUSB_CTR_IC_ENB1 (1 << 3) @@ -300,6 +300,16 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0}, }; + /* Phy controller class and methods. */ +static int usbphy_phy_enable(struct phynode *phy, bool enable); +static phynode_method_t usbphy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, usbphy_phy_enable), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_1(usbphy_phynode, usbphy_phynode_class, usbphy_phynode_methods, + 0, phynode_class); + #define RD4(sc, offs) \ bus_read_4(sc->mem_res, offs) @@ -555,11 +565,13 @@ usbphy_utmi_disable(struct usbphy_softc *sc) } static int -usbphy_phy_enable(device_t dev, int id, bool enable) +usbphy_phy_enable(struct phynode *phy, bool enable) { + device_t dev; struct usbphy_softc *sc; int rv = 0; + dev = phynode_get_device(phy); sc = device_get_softc(dev); if (sc->ifc_type != USB_IFC_TYPE_UTMI) { @@ -701,9 +713,11 @@ usbphy_probe(device_t dev) static int usbphy_attach(device_t dev) { - struct usbphy_softc * sc; + struct usbphy_softc *sc; int rid, rv; phandle_t node; + struct phynode *phynode; + struct phynode_init_def phy_init; sc = device_get_softc(dev); sc->dev = dev; @@ -803,7 +817,20 @@ usbphy_attach(device_t dev) } } - phy_register_provider(dev); + /* Create and register phy. */ + bzero(&phy_init, sizeof(phy_init)); + phy_init.id = 1; + phy_init.ofw_node = node; + phynode = phynode_create(dev, &usbphy_phynode_class, &phy_init); + if (phynode == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(sc->dev, "Cannot create phy\n"); + return (ENXIO); + } + return (0); } @@ -820,9 +847,6 @@ static device_method_t tegra_usbphy_methods[] = { DEVMETHOD(device_probe, usbphy_probe), DEVMETHOD(device_attach, usbphy_attach), DEVMETHOD(device_detach, usbphy_detach), - - /* phy interface */ - DEVMETHOD(phy_enable, usbphy_phy_enable), DEVMETHOD_END }; Modified: stable/11/sys/arm/nvidia/tegra_xhci.c ============================================================================== --- stable/11/sys/arm/nvidia/tegra_xhci.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/arm/nvidia/tegra_xhci.c Wed Apr 4 13:23:06 2018 (r332025) @@ -583,22 +583,22 @@ enable_fdt_resources(struct tegra_xhci_softc *sc) return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb2_0); + rv = phy_enable(sc->phy_usb2_0); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB2_0 phy\n"); return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb2_1); + rv = phy_enable(sc->phy_usb2_1); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB2_1 phy\n"); return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb2_2); + rv = phy_enable(sc->phy_usb2_2); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB2_2 phy\n"); return (rv); } - rv = phy_enable(sc->dev, sc->phy_usb3_0); + rv = phy_enable(sc->phy_usb3_0); if (rv != 0) { device_printf(sc->dev, "Cannot enable USB3_0 phy\n"); return (rv); Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/conf/files Wed Apr 4 13:23:06 2018 (r332025) @@ -1682,7 +1682,8 @@ dev/extres/clk/clk_fixed.c optional ext_resources clk dev/extres/clk/clk_gate.c optional ext_resources clk dev/extres/clk/clk_mux.c optional ext_resources clk dev/extres/phy/phy.c optional ext_resources phy -dev/extres/phy/phy_if.m optional ext_resources phy +dev/extres/phy/phydev_if.m optional ext_resources phy +dev/extres/phy/phynode_if.m optional ext_resources phy dev/extres/hwreset/hwreset.c optional ext_resources hwreset dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset dev/extres/regulator/regdev_if.m optional ext_resources regulator Modified: stable/11/sys/dev/extres/phy/phy.c ============================================================================== --- stable/11/sys/dev/extres/phy/phy.c Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/dev/extres/phy/phy.c Wed Apr 4 13:23:06 2018 (r332025) @@ -22,15 +22,20 @@ * 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 "opt_platform.h" -#include #include #include +#include +#include #include +#include #include +#include #ifdef FDT #include @@ -39,88 +44,452 @@ #include -#include "phy_if.h" +#include "phydev_if.h" +MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); + +/* Forward declarations. */ +struct phy; +struct phynode; + +typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; +typedef TAILQ_HEAD(phy_list, phy) phy_list_t; + +/* Default phy methods. */ +static int phynode_method_init(struct phynode *phynode); +static int phynode_method_enable(struct phynode *phynode, bool disable); +static int phynode_method_status(struct phynode *phynode, int *status); + + +/* + * Phy controller methods. + */ +static phynode_method_t phynode_methods[] = { + PHYNODEMETHOD(phynode_init, phynode_method_init), + PHYNODEMETHOD(phynode_enable, phynode_method_enable), + PHYNODEMETHOD(phynode_status, phynode_method_status), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); + +/* + * Phy node + */ +struct phynode { + KOBJ_FIELDS; + + TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ + phy_list_t consumers_list; /* Consumers list */ + + + /* Details of this device. */ + const char *name; /* Globally unique name */ + + device_t pdev; /* Producer device_t */ + void *softc; /* Producer softc */ + intptr_t id; /* Per producer unique id */ +#ifdef FDT + phandle_t ofw_node; /* OFW node of phy */ +#endif + struct sx lock; /* Lock for this phy */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ +}; + struct phy { - device_t consumer_dev; /* consumer device*/ - device_t provider_dev; /* provider device*/ - uintptr_t phy_id; /* phy id */ + device_t cdev; /* consumer device*/ + struct phynode *phynode; + TAILQ_ENTRY(phy) link; /* Consumers list entry */ + + int enable_cnt; }; -MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); +static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); +static struct sx phynode_topo_lock; +SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); + +#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) +#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) +#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) +#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) +#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) + +#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +/* ---------------------------------------------------------------------------- + * + * Default phy methods for base class. + * + */ + +static int +phynode_method_init(struct phynode *phynode) +{ + + return (0); +} + +static int +phynode_method_enable(struct phynode *phynode, bool enable) +{ + + if (!enable) + return (ENXIO); + + return (0); +} + +static int +phynode_method_status(struct phynode *phynode, int *status) +{ + *status = PHY_STATUS_ENABLED; + return (0); +} + +/* ---------------------------------------------------------------------------- + * + * Internal functions. + * + */ +/* + * Create and initialize phy object, but do not register it. + */ +struct phynode * +phynode_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_init_def *def) +{ + struct phynode *phynode; + + + /* Create object and initialize it. */ + phynode = malloc(sizeof(struct phynode), M_PHY, M_WAITOK | M_ZERO); + kobj_init((kobj_t)phynode, (kobj_class_t)phynode_class); + sx_init(&phynode->lock, "Phy node lock"); + + /* Allocate softc if required. */ + if (phynode_class->size > 0) { + phynode->softc = malloc(phynode_class->size, M_PHY, + M_WAITOK | M_ZERO); + } + + /* Rest of init. */ + TAILQ_INIT(&phynode->consumers_list); + phynode->id = def->id; + phynode->pdev = pdev; +#ifdef FDT + phynode->ofw_node = def->ofw_node; +#endif + + return (phynode); +} + +/* Register phy object. */ +struct phynode * +phynode_register(struct phynode *phynode) +{ + int rv; + +#ifdef FDT + if (phynode->ofw_node <= 0) + phynode->ofw_node = ofw_bus_get_node(phynode->pdev); + if (phynode->ofw_node <= 0) + return (NULL); +#endif + + rv = PHYNODE_INIT(phynode); + if (rv != 0) { + printf("PHYNODE_INIT failed: %d\n", rv); + return (NULL); + } + + PHY_TOPO_XLOCK(); + TAILQ_INSERT_TAIL(&phynode_list, phynode, phylist_link); + PHY_TOPO_UNLOCK(); +#ifdef FDT + OF_device_register_xref(OF_xref_from_node(phynode->ofw_node), + phynode->pdev); +#endif + return (phynode); +} + +static struct phynode * +phynode_find_by_id(device_t dev, intptr_t id) +{ + struct phynode *entry; + + PHY_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, &phynode_list, phylist_link) { + if ((entry->pdev == dev) && (entry->id == id)) + return (entry); + } + + return (NULL); +} + +/* -------------------------------------------------------------------------- + * + * Phy providers interface + * + */ + +void * +phynode_get_softc(struct phynode *phynode) +{ + + return (phynode->softc); +} + +device_t +phynode_get_device(struct phynode *phynode) +{ + + return (phynode->pdev); +} + +intptr_t phynode_get_id(struct phynode *phynode) +{ + + return (phynode->id); +} + +#ifdef FDT +phandle_t +phynode_get_ofw_node(struct phynode *phynode) +{ + + return (phynode->ofw_node); +} +#endif + +/* -------------------------------------------------------------------------- + * + * Real consumers executive + * + */ + +/* + * Enable phy. + */ int -phy_init(device_t consumer, phy_t phy) +phynode_enable(struct phynode *phynode) { + int rv; - return (PHY_INIT(phy->provider_dev, phy->phy_id, true)); + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + if (phynode->enable_cnt == 0) { + rv = PHYNODE_ENABLE(phynode, true); + if (rv != 0) { + PHYNODE_UNLOCK(phynode); + return (rv); + } + } + phynode->enable_cnt++; + PHYNODE_UNLOCK(phynode); + return (0); } +/* + * Disable phy. + */ int -phy_deinit(device_t consumer, phy_t phy) +phynode_disable(struct phynode *phynode) { + int rv; - return (PHY_INIT(phy->provider_dev, phy->phy_id, false)); + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + if (phynode->enable_cnt == 1) { + rv = PHYNODE_ENABLE(phynode, false); + if (rv != 0) { + PHYNODE_UNLOCK(phynode); + return (rv); + } + } + phynode->enable_cnt--; + PHYNODE_UNLOCK(phynode); + return (0); } +/* + * Get phy status. (PHY_STATUS_*) + */ int -phy_enable(device_t consumer, phy_t phy) +phynode_status(struct phynode *phynode, int *status) { + int rv; - return (PHY_ENABLE(phy->provider_dev, phy->phy_id, true)); + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_STATUS(phynode, status); + PHYNODE_UNLOCK(phynode); + return (rv); } + /* -------------------------------------------------------------------------- + * + * Phy consumers interface. + * + */ + +/* Helper function for phy_get*() */ +static phy_t +phy_create(struct phynode *phynode, device_t cdev) +{ + struct phy *phy; + + PHY_TOPO_ASSERT(); + + phy = malloc(sizeof(struct phy), M_PHY, M_WAITOK | M_ZERO); + phy->cdev = cdev; + phy->phynode = phynode; + phy->enable_cnt = 0; + + PHYNODE_XLOCK(phynode); + phynode->ref_cnt++; + TAILQ_INSERT_TAIL(&phynode->consumers_list, phy, link); + PHYNODE_UNLOCK(phynode); + + return (phy); +} + int -phy_disable(device_t consumer, phy_t phy) +phy_enable(phy_t phy) { + int rv; + struct phynode *phynode; - return (PHY_ENABLE(phy->provider_dev, phy->phy_id, false)); + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_enable(phynode); + if (rv == 0) + phy->enable_cnt++; + PHY_TOPO_UNLOCK(); + return (rv); } int -phy_status(device_t consumer, phy_t phy, int *value) +phy_disable(phy_t phy) { + int rv; + struct phynode *phynode; - return (PHY_STATUS(phy->provider_dev, phy->phy_id, value)); + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + KASSERT(phy->enable_cnt > 0, + ("Attempt to disable already disabled phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_disable(phynode); + if (rv == 0) + phy->enable_cnt--; + PHY_TOPO_UNLOCK(); + return (rv); } int +phy_status(phy_t phy, int *status) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_status(phynode, status); + PHY_TOPO_UNLOCK(); + return (rv); +} + +int phy_get_by_id(device_t consumer_dev, device_t provider_dev, intptr_t id, - phy_t *phy_out) + phy_t *phy) { - phy_t phy; + struct phynode *phynode; - /* Create handle */ - phy = malloc(sizeof(struct phy), M_PHY, - M_WAITOK | M_ZERO); - phy->consumer_dev = consumer_dev; - phy->provider_dev = provider_dev; - phy->phy_id = id; - *phy_out = phy; + PHY_TOPO_SLOCK(); + + phynode = phynode_find_by_id(provider_dev, id); + if (phynode == NULL) { + PHY_TOPO_UNLOCK(); + return (ENODEV); + } + *phy = phy_create(phynode, consumer_dev); + PHY_TOPO_UNLOCK(); + return (0); } void phy_release(phy_t phy) { + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + while (phy->enable_cnt > 0) { + phynode_disable(phynode); + phy->enable_cnt--; + } + PHYNODE_XLOCK(phynode); + TAILQ_REMOVE(&phynode->consumers_list, phy, link); + phynode->ref_cnt--; + PHYNODE_UNLOCK(phynode); + PHY_TOPO_UNLOCK(); + free(phy, M_PHY); } - #ifdef FDT -int phy_default_map(device_t provider, phandle_t xref, int ncells, +int phydev_default_ofw_map(device_t provider, phandle_t xref, int ncells, pcell_t *cells, intptr_t *id) { + struct phynode *entry; + phandle_t node; - if (ncells == 0) - *id = 1; - else if (ncells == 1) + /* Single device can register multiple subnodes. */ + if (ncells == 0) { + + node = OF_node_from_xref(xref); + PHY_TOPO_XLOCK(); + TAILQ_FOREACH(entry, &phynode_list, phylist_link) { + if ((entry->pdev == provider) && + (entry->ofw_node == node)) { + *id = entry->id; + PHY_TOPO_UNLOCK(); + return (0); + } + } + PHY_TOPO_UNLOCK(); + return (ERANGE); + } + + /* First cell is ID. */ + if (ncells == 1) { *id = cells[0]; - else - return (ERANGE); + return (0); + } - return (0); + /* No default way how to get ID, custom mapper is required. */ + return (ERANGE); } int @@ -151,7 +520,7 @@ phy_get_by_ofw_idx(device_t consumer_dev, phandle_t cn return (ENODEV); } /* Map phy to number. */ - rv = PHY_MAP(phydev, xnode, ncells, cells, &id); + rv = PHYDEV_MAP(phydev, xnode, ncells, cells, &id); OF_prop_free(cells); if (rv != 0) return (rv); @@ -206,33 +575,11 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle return (ENODEV); } /* Map phy to number. */ - rv = PHY_MAP(phydev, cells[0], ncells - 1 , cells + 1, &id); + rv = PHYDEV_MAP(phydev, cells[0], ncells - 1 , cells + 1, &id); OF_prop_free(cells); if (rv != 0) return (rv); return (phy_get_by_id(consumer_dev, phydev, id, phy)); -} - -void -phy_register_provider(device_t provider_dev) -{ - phandle_t xref, node; - - node = ofw_bus_get_node(provider_dev); - if (node <= 0) - panic("%s called on not ofw based device.\n", __func__); - - xref = OF_xref_from_node(node); - OF_device_register_xref(xref, provider_dev); -} - -void -phy_unregister_provider(device_t provider_dev) -{ - phandle_t xref; - - xref = OF_xref_from_device(provider_dev); - OF_device_register_xref(xref, NULL); } #endif Modified: stable/11/sys/dev/extres/phy/phy.h ============================================================================== --- stable/11/sys/dev/extres/phy/phy.h Wed Apr 4 13:20:29 2018 (r332024) +++ stable/11/sys/dev/extres/phy/phy.h Wed Apr 4 13:23:06 2018 (r332025) @@ -27,21 +27,49 @@ #ifndef DEV_EXTRES_PHY_H #define DEV_EXTRES_PHY_H - #include "opt_platform.h" -#include + +#include #ifdef FDT #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 13:38:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A51FBF8F7C8; Wed, 4 Apr 2018 13:38:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 587D17BA2B; Wed, 4 Apr 2018 13:38:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52AB814680; Wed, 4 Apr 2018 13:38:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Dc0H5089660; Wed, 4 Apr 2018 13:38:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Dbxpb089645; Wed, 4 Apr 2018 13:37:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804041337.w34Dbxpb089645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 4 Apr 2018 13:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332026 - in head/sys: arm/mv dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/mv dev/fdt X-SVN-Commit-Revision: 332026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:38:00 -0000 Author: andrew Date: Wed Apr 4 13:37:59 2018 New Revision: 332026 URL: https://svnweb.freebsd.org/changeset/base/332026 Log: Remove fdt_pm_is_enabled as it's Marvell specific. Replace the only call to it with a call to the helper function fdt_pm_is_enabled would call. Sponsored by: DARPA, AFRL Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mvvar.h head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Wed Apr 4 13:23:06 2018 (r332025) +++ head/sys/arm/mv/mv_common.c Wed Apr 4 13:37:59 2018 (r332026) @@ -484,7 +484,7 @@ pm_disable_device(int mask) } int -fdt_pm(phandle_t node) +mv_fdt_pm(phandle_t node) { uint32_t cpu_pm_ctrl; int i, ena, compat; Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Wed Apr 4 13:23:06 2018 (r332025) +++ head/sys/arm/mv/mv_localbus.c Wed Apr 4 13:37:59 2018 (r332026) @@ -275,7 +275,7 @@ localbus_attach(device_t dev) if (!(ofw_bus_node_status_okay(dt_child))) continue; - if (!(fdt_pm_is_enabled(dt_child))) + if (!(mv_fdt_pm(dt_child))) continue; di = malloc(sizeof(*di), M_LOCALBUS, M_WAITOK | M_ZERO); Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Wed Apr 4 13:23:06 2018 (r332025) +++ head/sys/arm/mv/mvvar.h Wed Apr 4 13:37:59 2018 (r332026) @@ -141,6 +141,8 @@ int mv_pci_devmap(phandle_t, struct devmap_entry *, vm int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *); enum soc_family mv_check_soc_family(void); +int mv_fdt_pm(phandle_t); + uint32_t get_tclk_armadaxp(void); uint32_t get_tclk_armada38x(void); uint32_t get_cpu_freq_armadaxp(void); Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Wed Apr 4 13:23:06 2018 (r332025) +++ head/sys/dev/fdt/fdt_common.c Wed Apr 4 13:37:59 2018 (r332026) @@ -365,19 +365,6 @@ fdt_parent_addr_cells(phandle_t node) return ((int)fdt32_to_cpu(addr_cells)); } -int -fdt_pm_is_enabled(phandle_t node) -{ - int ret; - - ret = 1; - -#if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) - ret = fdt_pm(node); -#endif - return (ret); -} - u_long fdt_data_get(void *data, int cells) { Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Wed Apr 4 13:23:06 2018 (r332025) +++ head/sys/dev/fdt/fdt_common.h Wed Apr 4 13:37:59 2018 (r332026) @@ -91,10 +91,8 @@ int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_is_compatible_strict(phandle_t, const char *); -int fdt_pm_is_enabled(phandle_t); int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); -int fdt_pm(phandle_t); int fdt_get_chosen_bootargs(char *bootargs, size_t max_size); #endif /* _FDT_COMMON_H_ */ From owner-svn-src-all@freebsd.org Wed Apr 4 13:54:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3037F90B63; Wed, 4 Apr 2018 13:54:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A85AF7CAFA; Wed, 4 Apr 2018 13:54:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A347F149C2; Wed, 4 Apr 2018 13:54:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Dspft010901; Wed, 4 Apr 2018 13:54:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DspCc010900; Wed, 4 Apr 2018 13:54:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804041354.w34DspCc010900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 13:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332027 - stable/11/lib/libdl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libdl X-SVN-Commit-Revision: 332027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:54:52 -0000 Author: kevans Date: Wed Apr 4 13:54:51 2018 New Revision: 332027 URL: https://svnweb.freebsd.org/changeset/base/332027 Log: MFC r331743: Add libdl to clibs package libdl is a filter on libc, and pretty lightweight. Add it to the 'clibs' package with libc, effectively tying them together in a pkgbase world. Modified: stable/11/lib/libdl/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libdl/Makefile ============================================================================== --- stable/11/lib/libdl/Makefile Wed Apr 4 13:37:59 2018 (r332026) +++ stable/11/lib/libdl/Makefile Wed Apr 4 13:54:51 2018 (r332027) @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE=clibs LIB=dl SHLIB_MAJOR=1 From owner-svn-src-all@freebsd.org Wed Apr 4 13:58:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BCEF90F3D; Wed, 4 Apr 2018 13:58:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31E7B7CDA4; Wed, 4 Apr 2018 13:58:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C565149C5; Wed, 4 Apr 2018 13:58:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DwJ2i013414; Wed, 4 Apr 2018 13:58:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34DwI6j013403; Wed, 4 Apr 2018 13:58:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804041358.w34DwI6j013403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 13:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332028 - in stable/11: stand/efi/loader sys/amd64/amd64 sys/dev/efidev X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/efi/loader sys/amd64/amd64 sys/dev/efidev X-SVN-Commit-Revision: 332028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:58:19 -0000 Author: kevans Date: Wed Apr 4 13:58:18 2018 New Revision: 332028 URL: https://svnweb.freebsd.org/changeset/base/332028 Log: MFC r330868, r331241, r331361, r331365: EFIRT Fixes r330868: EFIRT: SetVirtualAddressMap with 1:1 mapping after exiting boot services This fixes a problem encountered on the Lenovo Thinkpad X220/Yoga 11e where runtime services would try to inexplicably jump to other parts of memory where it shouldn't be when attempting to enumerate EFI vars, causing a panic. The virtual mapping is enabled by default and can be disabled by setting efi_disable_vmap in loader.conf(5). r331241: Check if the gettime runtime service is valid. The U-Boot efi runtime service expects us to set the address map before calling any runtime services. It will then remap a few functions to their runtime version. One of these is the gettime function. If we call into this without having set a runtime map we get a page fault. Add a check to see if this is valid in efi_init() so we don't try to use the possibly invalid pointer. r331361: Enter into the EFI environment before dereferencing the runtime services pointer. This may be within the EFI address space and not the FreeBSD kernel address space. r331365: Re-work efidev ordering to fix efirt preloaded by loader on amd64 On amd64, efi_enter calls fpu_kern_enter(). This may not be called until fpuinitstate has been invoked, resulting in a kernel panic with efirt_load="YES" in loader.conf(5). Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at SI_SUB_DRIVER, SI_ORDER_ANY. The not immediately obvious dependency of fpuinitstate by efirt has been noted in both places. Modified: stable/11/stand/efi/loader/bootinfo.c stable/11/sys/amd64/amd64/efirt_machdep.c stable/11/sys/amd64/amd64/fpu.c stable/11/sys/dev/efidev/efidev.c stable/11/sys/dev/efidev/efirt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/loader/bootinfo.c ============================================================================== --- stable/11/stand/efi/loader/bootinfo.c Wed Apr 4 13:54:51 2018 (r332027) +++ stable/11/stand/efi/loader/bootinfo.c Wed Apr 4 13:58:18 2018 (r332028) @@ -236,17 +236,48 @@ bi_copymodules(vm_offset_t addr) return(addr); } +static EFI_STATUS +efi_do_vmap(EFI_MEMORY_DESCRIPTOR *mm, UINTN sz, UINTN mmsz, UINT32 mmver) +{ + EFI_MEMORY_DESCRIPTOR *desc, *viter, *vmap; + EFI_STATUS ret; + int curr, ndesc, nset; + + nset = 0; + desc = mm; + ndesc = sz / mmsz; + vmap = malloc(sz); + if (vmap == NULL) + /* This isn't really an EFI error case, but pretend it is */ + return (EFI_OUT_OF_RESOURCES); + viter = vmap; + for (curr = 0; curr < ndesc; + curr++, desc = NextMemoryDescriptor(desc, mmsz)) { + if ((desc->Attribute & EFI_MEMORY_RUNTIME) != 0) { + ++nset; + desc->VirtualStart = desc->PhysicalStart; + *viter = *desc; + viter = NextMemoryDescriptor(viter, mmsz); + } + } + ret = RS->SetVirtualAddressMap(nset * mmsz, mmsz, mmver, vmap); + free(vmap); + return (ret); +} + static int bi_load_efi_data(struct preloaded_file *kfp) { EFI_MEMORY_DESCRIPTOR *mm; EFI_PHYSICAL_ADDRESS addr; EFI_STATUS status; + const char *efi_novmap; size_t efisz; UINTN efi_mapkey; UINTN mmsz, pages, retry, sz; UINT32 mmver; struct efi_map_header *efihdr; + bool do_vmap; #if defined(__amd64__) || defined(__aarch64__) struct efi_fb efifb; @@ -266,6 +297,11 @@ bi_load_efi_data(struct preloaded_file *kfp) } #endif + do_vmap = true; + efi_novmap = getenv("efi_disable_vmap"); + if (efi_novmap != NULL) + do_vmap = strcasecmp(efi_novmap, "YES") != 0; + efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; /* @@ -321,6 +357,13 @@ bi_load_efi_data(struct preloaded_file *kfp) } status = BS->ExitBootServices(IH, efi_mapkey); if (EFI_ERROR(status) == 0) { + /* + * This may be disabled by setting efi_disable_vmap in + * loader.conf(5). By default we will setup the virtual + * map entries. + */ + if (do_vmap) + efi_do_vmap(mm, sz, mmsz, mmver); efihdr->memory_size = sz; efihdr->descriptor_size = mmsz; efihdr->descriptor_version = mmver; Modified: stable/11/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/efirt_machdep.c Wed Apr 4 13:54:51 2018 (r332027) +++ stable/11/sys/amd64/amd64/efirt_machdep.c Wed Apr 4 13:58:18 2018 (r332028) @@ -166,7 +166,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)) { if ((p->md_attr & EFI_MD_ATTR_RT) == 0) continue; - if (p->md_virt != NULL) { + if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { if (bootverbose) printf("EFI Runtime entry %d is mapped\n", i); goto fail; Modified: stable/11/sys/amd64/amd64/fpu.c ============================================================================== --- stable/11/sys/amd64/amd64/fpu.c Wed Apr 4 13:54:51 2018 (r332027) +++ stable/11/sys/amd64/amd64/fpu.c Wed Apr 4 13:58:18 2018 (r332028) @@ -357,7 +357,8 @@ fpuinitstate(void *arg __unused) start_emulating(); intr_restore(saveintr); } -SYSINIT(fpuinitstate, SI_SUB_DRIVERS, SI_ORDER_ANY, fpuinitstate, NULL); +/* EFIRT needs this to be initialized before we can enter our EFI environment */ +SYSINIT(fpuinitstate, SI_SUB_DRIVERS, SI_ORDER_FIRST, fpuinitstate, NULL); /* * Free coprocessor (if we have it). Modified: stable/11/sys/dev/efidev/efidev.c ============================================================================== --- stable/11/sys/dev/efidev/efidev.c Wed Apr 4 13:54:51 2018 (r332027) +++ stable/11/sys/dev/efidev/efidev.c Wed Apr 4 13:58:18 2018 (r332028) @@ -216,6 +216,6 @@ static moduledata_t efidev_moddata = { .priv = NULL, }; -DECLARE_MODULE(efidev, efidev_moddata, SI_SUB_DEVFS, SI_ORDER_ANY); +DECLARE_MODULE(efidev, efidev_moddata, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(efidev, 1); MODULE_DEPEND(efidev, efirt, 1, 1, 1); Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Wed Apr 4 13:54:51 2018 (r332027) +++ stable/11/sys/dev/efidev/efirt.c Wed Apr 4 13:58:18 2018 (r332028) @@ -88,6 +88,9 @@ static int efi_status2err[25] = { EPROTO /* EFI_PROTOCOL_ERROR */ }; +static int efi_enter(void); +static void efi_leave(void); + static int efi_status_to_errno(efi_status status) { @@ -99,6 +102,25 @@ efi_status_to_errno(efi_status status) static struct mtx efi_lock; +static bool +efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr) +{ + struct efi_md *p; + int i; + + for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, + descsz)) { + if ((p->md_attr & EFI_MD_ATTR_RT) == 0) + continue; + + if (addr >= (uintptr_t)p->md_virt && + addr < (uintptr_t)p->md_virt + p->md_pages * PAGE_SIZE) + return (true); + } + + return (false); +} + static int efi_init(void) { @@ -159,6 +181,30 @@ efi_init(void) return (ENXIO); } + /* + * Some UEFI implementations have multiple implementations of the + * RS->GetTime function. They switch from one we can only use early + * in the boot process to one valid as a RunTime service only when we + * call RS->SetVirtualAddressMap. As this is not always the case, e.g. + * with an old loader.efi, check if the RS->GetTime function is within + * the EFI map, and fail to attach if not. + * + * We need to enter into the EFI environment as efi_runtime may point + * to an EFI address. + */ + efi_enter(); + if (!efi_is_in_map(map, efihdr->memory_size / efihdr->descriptor_size, + efihdr->descriptor_size, (vm_offset_t)efi_runtime->rt_gettime)) { + efi_leave(); + if (bootverbose) + printf( + "EFI runtime services table has an invalid pointer\n"); + efi_runtime = NULL; + efi_destroy_1t1_map(); + return (ENXIO); + } + efi_leave(); + return (0); } @@ -405,5 +451,6 @@ static moduledata_t efirt_moddata = { .evhand = efirt_modevents, .priv = NULL, }; -DECLARE_MODULE(efirt, efirt_moddata, SI_SUB_VM_CONF, SI_ORDER_ANY); +/* After fpuinitstate, before efidev */ +DECLARE_MODULE(efirt, efirt_moddata, SI_SUB_DRIVERS, SI_ORDER_SECOND); MODULE_VERSION(efirt, 1); From owner-svn-src-all@freebsd.org Wed Apr 4 13:59:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CF11F91105; Wed, 4 Apr 2018 13:59:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3C6E7CF7F; Wed, 4 Apr 2018 13:59:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEAE7149C8; Wed, 4 Apr 2018 13:59:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34DxgPi014432; Wed, 4 Apr 2018 13:59:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Dxg9n014431; Wed, 4 Apr 2018 13:59:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804041359.w34Dxg9n014431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 13:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332029 - stable/11/sys/dev/efidev X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/dev/efidev X-SVN-Commit-Revision: 332029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 13:59:43 -0000 Author: kevans Date: Wed Apr 4 13:59:42 2018 New Revision: 332029 URL: https://svnweb.freebsd.org/changeset/base/332029 Log: MFC r330844: Correct minor typo in comment, efi_dmcap -> efi_tmcap Modified: stable/11/sys/dev/efidev/efirt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Wed Apr 4 13:58:18 2018 (r332028) +++ stable/11/sys/dev/efidev/efirt.c Wed Apr 4 13:59:42 2018 (r332029) @@ -315,7 +315,7 @@ efi_get_time(struct efi_tm *tm) /* * UEFI spec states that the Capabilities argument to GetTime is * optional, but some UEFI implementations choke when passed a NULL - * pointer. Pass a dummy efi_dmcap, even though we won't use it, + * pointer. Pass a dummy efi_tmcap, even though we won't use it, * to workaround such implementations. */ error = efi_get_time_locked(tm, &dummy); From owner-svn-src-all@freebsd.org Wed Apr 4 14:01:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42812F91440; Wed, 4 Apr 2018 14:01:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5B117D1CE; Wed, 4 Apr 2018 14:01:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0ACC149F4; Wed, 4 Apr 2018 14:01:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34E1AuO016262; Wed, 4 Apr 2018 14:01:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34E1ASS016260; Wed, 4 Apr 2018 14:01:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804041401.w34E1ASS016260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 14:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332030 - stable/11/sys/dev/efidev X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/dev/efidev X-SVN-Commit-Revision: 332030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 14:01:11 -0000 Author: kevans Date: Wed Apr 4 14:01:10 2018 New Revision: 332030 URL: https://svnweb.freebsd.org/changeset/base/332030 Log: MFC r331413: efidev: Drop a quick note in about efi_cfgtbl/efi_runtime There's no real annotation for it, so it's not immediately obvious to the unfamiliar that these pointers are to locations in the EFI runtime map unlike the system table pointer immediately above them. Modified: stable/11/sys/dev/efidev/efirt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Wed Apr 4 13:59:42 2018 (r332029) +++ stable/11/sys/dev/efidev/efirt.c Wed Apr 4 14:01:10 2018 (r332030) @@ -57,6 +57,11 @@ __FBSDID("$FreeBSD$"); #include static struct efi_systbl *efi_systbl; +/* + * The following pointers point to tables in the EFI runtime service data pages. + * Care should be taken to make sure that we've properly entered the EFI runtime + * environment (efi_enter()) before dereferencing them. + */ static struct efi_cfgtbl *efi_cfgtbl; static struct efi_rt *efi_runtime; From owner-svn-src-all@freebsd.org Wed Apr 4 14:09:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9948FF91BA5; Wed, 4 Apr 2018 14:09:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5077D7CF; Wed, 4 Apr 2018 14:09:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 451DA14B7C; Wed, 4 Apr 2018 14:09:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34E9jvj026092; Wed, 4 Apr 2018 14:09:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34E9jZw026090; Wed, 4 Apr 2018 14:09:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041409.w34E9jZw026090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 14:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332031 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 332031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 14:09:45 -0000 Author: emaste Date: Wed Apr 4 14:09:44 2018 New Revision: 332031 URL: https://svnweb.freebsd.org/changeset/base/332031 Log: MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC admbugs: 765, 812, 813, 814 Submitted by: Domagoj Stolfa Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Modified: stable/11/sys/compat/linux/linux_ipc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Wed Apr 4 14:01:10 2018 (r332030) +++ stable/11/sys/compat/linux/linux_ipc.c Wed Apr 4 14:09:44 2018 (r332031) @@ -548,6 +548,9 @@ linux_semctl(struct thread *td, struct linux_semctl_ar register_t rval; int cmd, error; + memset(&linux_seminfo, 0, sizeof(linux_seminfo)); + memset(&linux_semid64, 0, sizeof(linux_semid64)); + switch (args->cmd & ~LINUX_IPC_64) { case LINUX_IPC_RMID: cmd = IPC_RMID; @@ -702,12 +705,15 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar struct l_msqid64_ds linux_msqid64; struct msqid_ds bsd_msqid; + memset(&linux_msqid64, 0, sizeof(linux_msqid64)); + bsd_cmd = args->cmd & ~LINUX_IPC_64; switch (bsd_cmd) { case LINUX_IPC_INFO: case LINUX_MSG_INFO: { struct l_msginfo linux_msginfo; + memset(&linux_msginfo, 0, sizeof(linux_msginfo)); /* * XXX MSG_INFO uses the same data structure but returns different * dynamic counters in msgpool, msgmap, and msgtql fields. @@ -832,6 +838,10 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar struct l_shm_info linux_shm_info; struct shmid_ds bsd_shmid; int error; + + memset(&linux_shm_info, 0, sizeof(linux_shm_info)); + memset(&linux_shmid64, 0, sizeof(linux_shmid64)); + memset(&linux_shminfo64, 0, sizeof(linux_shminfo64)); switch (args->cmd & ~LINUX_IPC_64) { From owner-svn-src-all@freebsd.org Wed Apr 4 14:12:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117F3F92044; Wed, 4 Apr 2018 14:12:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA34B7DBFF; Wed, 4 Apr 2018 14:12:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B539914CEE; Wed, 4 Apr 2018 14:12:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34EC7Yp031742; Wed, 4 Apr 2018 14:12:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34EC7lh031741; Wed, 4 Apr 2018 14:12:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041412.w34EC7lh031741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 14:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332032 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 332032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 14:12:08 -0000 Author: emaste Date: Wed Apr 4 14:12:07 2018 New Revision: 332032 URL: https://svnweb.freebsd.org/changeset/base/332032 Log: MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC admbugs: 765, 812, 813, 814 Submitted by: Domagoj Stolfa Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Modified: stable/10/sys/compat/linux/linux_ipc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/10/sys/compat/linux/linux_ipc.c Wed Apr 4 14:09:44 2018 (r332031) +++ stable/10/sys/compat/linux/linux_ipc.c Wed Apr 4 14:12:07 2018 (r332032) @@ -516,6 +516,9 @@ linux_semctl(struct thread *td, struct linux_semctl_ar register_t rval; int cmd, error; + memset(&linux_seminfo, 0, sizeof(linux_seminfo)); + memset(&linux_semid64, 0, sizeof(linux_semid64)); + switch (args->cmd & ~LINUX_IPC_64) { case LINUX_IPC_RMID: cmd = IPC_RMID; @@ -661,12 +664,15 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar struct l_msqid_ds linux_msqid; struct msqid_ds bsd_msqid; + memset(&linux_msqid64, 0, sizeof(linux_msqid64)); + bsd_cmd = args->cmd & ~LINUX_IPC_64; switch (bsd_cmd) { case LINUX_IPC_INFO: case LINUX_MSG_INFO: { struct l_msginfo linux_msginfo; + memset(&linux_msginfo, 0, sizeof(linux_msginfo)); /* * XXX MSG_INFO uses the same data structure but returns different * dynamic counters in msgpool, msgmap, and msgtql fields. @@ -788,6 +794,10 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar struct l_shm_info linux_shm_info; struct shmid_ds bsd_shmid; int error; + + memset(&linux_shm_info, 0, sizeof(linux_shm_info)); + memset(&linux_shmid64, 0, sizeof(linux_shmid64)); + memset(&linux_shminfo64, 0, sizeof(linux_shminfo64)); switch (args->cmd & ~LINUX_IPC_64) { From owner-svn-src-all@freebsd.org Wed Apr 4 14:31:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86533F93359; Wed, 4 Apr 2018 14:31:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 390287E826; Wed, 4 Apr 2018 14:31:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33D6614F1D; Wed, 4 Apr 2018 14:31:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34EVvBO054624; Wed, 4 Apr 2018 14:31:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34EVuEQ054613; Wed, 4 Apr 2018 14:31:56 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804041431.w34EVuEQ054613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 4 Apr 2018 14:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332033 - in head: etc/mtree lib lib/libopencsd share/mk X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head: etc/mtree lib lib/libopencsd share/mk X-SVN-Commit-Revision: 332033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 14:31:57 -0000 Author: br Date: Wed Apr 4 14:31:56 2018 New Revision: 332033 URL: https://svnweb.freebsd.org/changeset/base/332033 Log: Add new shared library -- libopencsd. OpenCSD is an ARM CoreSight(tm) trace packets decoder. - Connect libopencsd to the arm64 build. - Install opencsd headers to /usr/include/opencsd/ Sponsored by: DARPA, AFRL Added: head/lib/libopencsd/ head/lib/libopencsd/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Wed Apr 4 14:12:07 2018 (r332032) +++ head/etc/mtree/BSD.include.dist Wed Apr 4 14:31:56 2018 (r332033) @@ -317,6 +317,18 @@ .. nfsserver .. + opencsd + c_api + .. + etmv3 + .. + etmv4 + .. + ptm + .. + stm + .. + .. openssl .. pcap Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Apr 4 14:12:07 2018 (r332032) +++ head/lib/Makefile Wed Apr 4 14:31:56 2018 (r332033) @@ -175,6 +175,10 @@ SUBDIR.${MK_NIS}+= libypclnt _libvgl= libvgl .endif +.if ${MACHINE_CPUARCH} == "aarch64" +SUBDIR.${MK_PMC}+= libopencsd +.endif + .if ${MACHINE_CPUARCH} == "amd64" SUBDIR.${MK_PMC}+= libipt SUBDIR.${MK_BHYVE}+= libvmmapi Added: head/lib/libopencsd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libopencsd/Makefile Wed Apr 4 14:31:56 2018 (r332033) @@ -0,0 +1,175 @@ +# $FreeBSD$ + +PACKAGE=lib${LIB} +SHLIBDIR?= /lib + +.include + +OPENCSDSRC= ${SRCTOP}/contrib/opencsd + +.PATH: ${OPENCSDSRC}/decoder/source/etmv4/ \ + ${OPENCSDSRC}/decoder/source/etmv3/ \ + ${OPENCSDSRC}/decoder/source/pkt_printers/ \ + ${OPENCSDSRC}/decoder/source/mem_acc/ \ + ${OPENCSDSRC}/decoder/source/i_dec/ \ + ${OPENCSDSRC}/decoder/source/c_api/ \ + ${OPENCSDSRC}/decoder/source/ptm/ \ + ${OPENCSDSRC}/decoder/source/stm/ \ + ${OPENCSDSRC}/decoder/source/ \ + ${OPENCSDSRC}/decoder/include/opencsd/etmv4/ \ + ${OPENCSDSRC}/decoder/include/opencsd/etmv3/ \ + ${OPENCSDSRC}/decoder/include/opencsd/stm/ \ + ${OPENCSDSRC}/decoder/include/opencsd/ptm/ \ + ${OPENCSDSRC}/decoder/include/opencsd/c_api/ \ + ${OPENCSDSRC}/decoder/include/opencsd/ \ + ${OPENCSDSRC}/decoder/include + +LIB= opencsd +SHLIB_MAJOR=0 + +# ETMv3 +SRCS= \ + trc_cmp_cfg_etmv3.cpp \ + trc_pkt_decode_etmv3.cpp \ + trc_pkt_elem_etmv3.cpp \ + trc_pkt_proc_etmv3.cpp \ + trc_pkt_proc_etmv3_impl.cpp + +# ETMv4 +SRCS+= \ + trc_cmp_cfg_etmv4.cpp \ + trc_etmv4_stack_elem.cpp \ + trc_pkt_decode_etmv4i.cpp \ + trc_pkt_elem_etmv4d.cpp \ + trc_pkt_elem_etmv4i.cpp \ + trc_pkt_proc_etmv4.cpp \ + trc_pkt_proc_etmv4i_impl.cpp + +# PKT_PRINTERS +SRCS+= \ + raw_frame_printer.cpp \ + trc_print_fact.cpp + +# PTM +SRCS+= \ + trc_cmp_cfg_ptm.cpp \ + trc_pkt_decode_ptm.cpp \ + trc_pkt_elem_ptm.cpp \ + trc_pkt_proc_ptm.cpp + +# STM +SRCS+= \ + trc_pkt_decode_stm.cpp \ + trc_pkt_elem_stm.cpp \ + trc_pkt_proc_stm.cpp + +# C_API +SRCS+= \ + ocsd_c_api_custom_obj.cpp \ + ocsd_c_api.cpp + +# SRC +SRCS+= \ + ocsd_code_follower.cpp \ + ocsd_dcd_tree.cpp \ + ocsd_error.cpp \ + ocsd_error_logger.cpp \ + ocsd_gen_elem_list.cpp \ + ocsd_lib_dcd_register.cpp \ + ocsd_msg_logger.cpp \ + ocsd_version.cpp \ + trc_component.cpp \ + trc_core_arch_map.cpp \ + trc_frame_deformatter.cpp \ + trc_gen_elem.cpp \ + trc_printable_elem.cpp \ + trc_ret_stack.cpp + +# MEM_ACC +SRCS+= \ + trc_mem_acc_base.cpp \ + trc_mem_acc_cb.cpp \ + trc_mem_acc_mapper.cpp \ + trc_mem_acc_bufptr.cpp \ + trc_mem_acc_file.cpp + +# I_DEC +SRCS+= \ + trc_i_decode.cpp \ + trc_idec_arminst.cpp + +CFLAGS+= \ + -I${OPENCSDSRC}/decoder/include/ \ + -I${.CURDIR} + +INCS= \ + ocsd_if_types.h \ + trc_gen_elem_types.h \ + trc_pkt_types.h + +INCSDIR=${INCLUDEDIR}/opencsd + +APIINCS= \ + ocsd_c_api_cust_fact.h \ + ocsd_c_api_cust_impl.h \ + ocsd_c_api_custom.h \ + ocsd_c_api_types.h \ + opencsd_c_api.h + +APIINCSDIR=${INCLUDEDIR}/opencsd/c_api/ + +ETMV4INCS= \ + etmv4_decoder.h \ + trc_cmp_cfg_etmv4.h \ + trc_dcd_mngr_etmv4i.h \ + trc_etmv4_stack_elem.h \ + trc_pkt_decode_etmv4i.h \ + trc_pkt_elem_etmv4d.h \ + trc_pkt_elem_etmv4i.h \ + trc_pkt_proc_etmv4.h \ + trc_pkt_types_etmv4.h + +ETMV4INCSDIR=${INCLUDEDIR}/opencsd/etmv4/ + +ETMV3INCS= \ + etmv3_decoder.h \ + trc_cmp_cfg_etmv3.h \ + trc_dcd_mngr_etmv3.h \ + trc_pkt_decode_etmv3.h \ + trc_pkt_elem_etmv3.h \ + trc_pkt_proc_etmv3.h \ + trc_pkt_types_etmv3.h + +ETMV3INCSDIR=${INCLUDEDIR}/opencsd/etmv3/ + +PTMINCS= \ + ptm_decoder.h \ + trc_cmp_cfg_ptm.h \ + trc_dcd_mngr_ptm.h \ + trc_pkt_decode_ptm.h \ + trc_pkt_elem_ptm.h \ + trc_pkt_proc_ptm.h \ + trc_pkt_types_ptm.h + +PTMINCSDIR=${INCLUDEDIR}/opencsd/ptm/ + +STMINCS= \ + stm_decoder.h \ + trc_cmp_cfg_stm.h \ + trc_dcd_mngr_stm.h \ + trc_pkt_decode_stm.h \ + trc_pkt_elem_stm.h \ + trc_pkt_proc_stm.h \ + trc_pkt_types_stm.h + +STMINCSDIR=${INCLUDEDIR}/opencsd/stm/ + +INCSGROUPS=INCS APIINCS ETMV3INCS ETMV4INCS PTMINCS STMINCS + +LIBADD= cxxrt + +WARNS?= 1 + +HAS_TESTS= + +.include Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Wed Apr 4 14:12:07 2018 (r332032) +++ head/share/mk/bsd.libnames.mk Wed Apr 4 14:31:56 2018 (r332033) @@ -118,6 +118,7 @@ LIBNETGRAPH?= ${LIBDESTDIR}${LIBDIR_BASE}/libnetgraph. LIBNGATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libngatm.a LIBNV?= ${LIBDESTDIR}${LIBDIR_BASE}/libnv.a LIBNVPAIR?= ${LIBDESTDIR}${LIBDIR_BASE}/libnvpair.a +LIBOPENCSD?= ${LIBDESTDIR}${LIBDIR_BASE}/libopencsd.a LIBOPENSM?= ${LIBDESTDIR}${LIBDIR_BASE}/libopensm.a LIBOPIE?= ${LIBDESTDIR}${LIBDIR_BASE}/libopie.a LIBOSMCOMP?= ${LIBDESTDIR}${LIBDIR_BASE}/libosmcomp.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Apr 4 14:12:07 2018 (r332032) +++ head/share/mk/src.libnames.mk Wed Apr 4 14:31:56 2018 (r332033) @@ -135,6 +135,7 @@ _LIBRARIES= \ ngatm \ nv \ nvpair \ + opencsd \ opie \ pam \ panel \ @@ -307,6 +308,7 @@ _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_er _DP_lzma= pthread _DP_ucl= m _DP_vmmapi= util +_DP_opencsd= cxxrt _DP_ctf= z _DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util From owner-svn-src-all@freebsd.org Wed Apr 4 14:41:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC2AF94045; Wed, 4 Apr 2018 14:41:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33C387F2A9; Wed, 4 Apr 2018 14:41:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EB18151B0; Wed, 4 Apr 2018 14:41:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Efn3d065077; Wed, 4 Apr 2018 14:41:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Efn4C065076; Wed, 4 Apr 2018 14:41:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041441.w34Efn4C065076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 14:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332034 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 332034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 14:41:49 -0000 Author: emaste Date: Wed Apr 4 14:41:48 2018 New Revision: 332034 URL: https://svnweb.freebsd.org/changeset/base/332034 Log: linux_ioctl_hdio: fix kernel memory disclosure Stack-allocated struct linux_hd_big_geometry has undeclared padding copied to userland. admbugs: 765 Reported by: Vlad Tsyrklevich MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Wed Apr 4 14:31:56 2018 (r332033) +++ head/sys/compat/linux/linux_ioctl.c Wed Apr 4 14:41:48 2018 (r332034) @@ -253,6 +253,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl } else if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO_BIG) { struct linux_hd_big_geometry hdbg; + memset(&hdbg, 0, sizeof(hdbg)); hdbg.cylinders = fwcylinders; hdbg.heads = fwheads; hdbg.sectors = fwsectors; From owner-svn-src-all@freebsd.org Wed Apr 4 15:02:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 690B1F95430; Wed, 4 Apr 2018 15:02:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86DDA80093; Wed, 4 Apr 2018 15:02:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w34F24hf092936; Wed, 4 Apr 2018 08:02:04 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w34F248U092935; Wed, 4 Apr 2018 08:02:04 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804041502.w34F248U092935@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/... In-Reply-To: <201804041233.w34CXleW015734@repo.freebsd.org> To: Ruslan Bukin Date: Wed, 4 Apr 2018 08:02:04 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 15:02:07 -0000 > Author: br > Date: Wed Apr 4 12:33:46 2018 > New Revision: 332012 > URL: https://svnweb.freebsd.org/changeset/base/332012 > > Log: > Import OpenCSD -- an ARM CoreSight Trace Decode library. Why does this need to be in base? Is there some reason it can not live as a port? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Apr 4 15:16:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA9AEF96238; Wed, 4 Apr 2018 15:16:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C50680ACF; Wed, 4 Apr 2018 15:16:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 872A0156D4; Wed, 4 Apr 2018 15:16:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34FG4X4002718; Wed, 4 Apr 2018 15:16:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34FG47Z002717; Wed, 4 Apr 2018 15:16:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201804041516.w34FG47Z002717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 4 Apr 2018 15:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332035 - head/include X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 332035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 15:16:05 -0000 Author: pfg Date: Wed Apr 4 15:16:04 2018 New Revision: 332035 URL: https://svnweb.freebsd.org/changeset/base/332035 Log: pthread.h: minor indentation cleanups. No functional change. X-MFC with: r331969 Modified: head/include/pthread.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Wed Apr 4 14:41:48 2018 (r332034) +++ head/include/pthread.h Wed Apr 4 15:16:04 2018 (r332035) @@ -175,8 +175,7 @@ int pthread_barrierattr_destroy(pthread_barrierattr_t int pthread_barrierattr_getpshared( const pthread_barrierattr_t *, int *); int pthread_barrierattr_init(pthread_barrierattr_t *); -int pthread_barrierattr_setpshared(pthread_barrierattr_t *, - int); +int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ { \ @@ -194,16 +193,13 @@ int pthread_barrierattr_setpshared(pthread_barrieratt int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_getclock(const pthread_condattr_t *, clockid_t *); -int pthread_condattr_getpshared(const pthread_condattr_t *, - int *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); int pthread_condattr_init(pthread_condattr_t *); -int pthread_condattr_setclock(pthread_condattr_t *, - clockid_t); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); int pthread_condattr_setpshared(pthread_condattr_t *, int); int pthread_cond_broadcast(pthread_cond_t *); int pthread_cond_destroy(pthread_cond_t *); -int pthread_cond_init(pthread_cond_t *, - const pthread_condattr_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); int pthread_cond_signal(pthread_cond_t *); int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t * __mutex, @@ -219,18 +215,15 @@ void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); -int pthread_key_create(pthread_key_t *, - void (*) (void *)); +int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); int pthread_mutexattr_init(pthread_mutexattr_t *); int pthread_mutexattr_destroy(pthread_mutexattr_t *); -int pthread_mutexattr_getpshared( - const pthread_mutexattr_t *, int *); -int pthread_mutexattr_gettype(pthread_mutexattr_t *, +int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); int pthread_mutexattr_settype(pthread_mutexattr_t *, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t *, - int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); int pthread_mutex_destroy(pthread_mutex_t * __mutex) @@ -247,8 +240,7 @@ int pthread_mutex_timedlock(pthread_mutex_t * __mutex __trylocks_exclusive(0, *__mutex); int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); -int pthread_once(pthread_once_t *, - void (*) (void)); +int pthread_once(pthread_once_t *, void (*) (void)); int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); int pthread_rwlock_init(pthread_rwlock_t * __rwlock, @@ -271,15 +263,14 @@ int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __locks_exclusive(*__rwlock); int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); -int pthread_rwlockattr_getkind_np( - const pthread_rwlockattr_t *, int *); -int pthread_rwlockattr_getpshared( - const pthread_rwlockattr_t *, int *); +int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, + int *); int pthread_rwlockattr_init(pthread_rwlockattr_t *); int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, - int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); @@ -314,16 +305,13 @@ int pthread_mutexattr_setprotocol(pthread_mutexattr_t int pthread_mutexattr_getrobust( pthread_mutexattr_t * __restrict, int * __restrict); -int pthread_mutexattr_setrobust(pthread_mutexattr_t *, - int); +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); int pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *); -int pthread_attr_getschedpolicy(const pthread_attr_t *, - int *); -int pthread_attr_getscope(const pthread_attr_t *, - int *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param *); From owner-svn-src-all@freebsd.org Wed Apr 4 15:52:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17FCEF98B91; Wed, 4 Apr 2018 15:52:33 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-31.csi.cam.ac.uk (ppsw-31.csi.cam.ac.uk [131.111.8.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B74B82809; Wed, 4 Apr 2018 15:52:32 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:14181) by ppsw-31.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1f3ki7-0007qs-Jd (Exim 4.89_2) (return-path ); Wed, 04 Apr 2018 16:52:31 +0100 Date: Wed, 4 Apr 2018 16:43:20 +0100 From: Ruslan Bukin To: rgrimes@freebsd.org Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/... Message-ID: <20180404154320.GA72125@bsdpad.com> References: <201804041233.w34CXleW015734@repo.freebsd.org> <201804041502.w34F248U092935@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201804041502.w34F248U092935@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 15:52:33 -0000 On Wed, Apr 04, 2018 at 08:02:04AM -0700, Rodney W. Grimes wrote: > > Author: br > > Date: Wed Apr 4 12:33:46 2018 > > New Revision: 332012 > > URL: https://svnweb.freebsd.org/changeset/base/332012 > > > > Log: > > Import OpenCSD -- an ARM CoreSight Trace Decode library. > > Why does this need to be in base? > Is there some reason it can not live as a port? > Yes opencsd is a dependancy for pmctrace(1) -- new HWPMC tracing tool. pmctrace(1) is currently on review: https://reviews.freebsd.org/D12875 https://reviews.freebsd.org/D14618 Thanks Rusoan From owner-svn-src-all@freebsd.org Wed Apr 4 16:12:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97459F99E9A; Wed, 4 Apr 2018 16:12:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18FDE834E5; Wed, 4 Apr 2018 16:12:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w34GBTsh093290; Wed, 4 Apr 2018 09:11:29 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w34GBTOi093289; Wed, 4 Apr 2018 09:11:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804041611.w34GBTOi093289@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/... In-Reply-To: <20180404154320.GA72125@bsdpad.com> To: Ruslan Bukin Date: Wed, 4 Apr 2018 09:11:29 -0700 (PDT) CC: rgrimes@freebsd.org, Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 16:12:07 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, Apr 04, 2018 at 08:02:04AM -0700, Rodney W. Grimes wrote: > > > Author: br > > > Date: Wed Apr 4 12:33:46 2018 > > > New Revision: 332012 > > > URL: https://svnweb.freebsd.org/changeset/base/332012 > > > > > > Log: > > > Import OpenCSD -- an ARM CoreSight Trace Decode library. > > > > Why does this need to be in base? > > Is there some reason it can not live as a port? > > > > Yes opencsd is a dependancy for pmctrace(1) -- new HWPMC tracing tool. Why does pmctrace(1) need to be in base? I can see that there is kernel driver code to support this, is it to keep the userland pmctrace(1) closely coupled to the kernel hwpmc(4) code? I shall assert this code also has a broken license form, if you read LICENSE there is no copyright "above" to retain, or print for a binary release. As a consumer of that LICENSE technically I have to display nothing. I am sure that is not the desired intent. I believe this is still under review without formal policy from core. > pmctrace(1) is currently on review: > https://reviews.freebsd.org/D12875 > https://reviews.freebsd.org/D14618 > > Thanks > > Rusoan > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Apr 4 16:28:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E80A6F9AEE7; Wed, 4 Apr 2018 16:28:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 948C0842D8; Wed, 4 Apr 2018 16:28:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F3371624C; Wed, 4 Apr 2018 16:28:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34GSUJd083333; Wed, 4 Apr 2018 16:28:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34GSUEf083332; Wed, 4 Apr 2018 16:28:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041628.w34GSUEf083332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 16:28: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: r332036 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 332036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 16:28:31 -0000 Author: emaste Date: Wed Apr 4 16:28:30 2018 New Revision: 332036 URL: https://svnweb.freebsd.org/changeset/base/332036 Log: Fix build: use correct variable name on stable/10 r332032 merged r330356 from HEAD but did not account for a renamed variable (of a different type) between stable/10 and HEAD. Reported by: lwhsu Modified: stable/10/sys/compat/linux/linux_ipc.c Modified: stable/10/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/10/sys/compat/linux/linux_ipc.c Wed Apr 4 15:16:04 2018 (r332035) +++ stable/10/sys/compat/linux/linux_ipc.c Wed Apr 4 16:28:30 2018 (r332036) @@ -517,7 +517,7 @@ linux_semctl(struct thread *td, struct linux_semctl_ar int cmd, error; memset(&linux_seminfo, 0, sizeof(linux_seminfo)); - memset(&linux_semid64, 0, sizeof(linux_semid64)); + memset(&linux_semid, 0, sizeof(linux_semid)); switch (args->cmd & ~LINUX_IPC_64) { case LINUX_IPC_RMID: From owner-svn-src-all@freebsd.org Wed Apr 4 16:59:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C231F9CDD1; Wed, 4 Apr 2018 16:59:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D820D85BCF; Wed, 4 Apr 2018 16:59:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2E8816766; Wed, 4 Apr 2018 16:59:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34GxADK018404; Wed, 4 Apr 2018 16:59:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34GxAep018403; Wed, 4 Apr 2018 16:59:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804041659.w34GxAep018403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 16:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332037 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 332037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 16:59:11 -0000 Author: kevans Date: Wed Apr 4 16:59:10 2018 New Revision: 332037 URL: https://svnweb.freebsd.org/changeset/base/332037 Log: MFC r307826,r328949: Firstboot fs mount changes MFC r307826: Use checkyesno instead of rolling my own.. MFC r328949: Fix firstboot fs mount logic The firstboot logic has an error which causes the filesystem to be mounted readonly even though root_rw_mount=YES. This fixes the error to ensure that the root filesystem is mounted rw as expected after the run of the firstboot scripts. Modified: stable/11/etc/rc Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc ============================================================================== --- stable/11/etc/rc Wed Apr 4 16:28:30 2018 (r332036) +++ stable/11/etc/rc Wed Apr 4 16:59:10 2018 (r332037) @@ -135,16 +135,16 @@ done # Note: this assumes firstboot_sentinel is on / when we have # a read-only /, or that it is on media that's writable. if [ -e ${firstboot_sentinel} ]; then - [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / + checkyesno root_rw_mount && mount -uw / chflags -R 0 ${firstboot_sentinel} rm -rf ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / + checkyesno root_rw_mount || mount -ur / kill -INT 1 fi - [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / + checkyesno root_rw_mount || mount -ur / fi echo '' From owner-svn-src-all@freebsd.org Wed Apr 4 17:00:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31AF3F9CE9C; Wed, 4 Apr 2018 17:00:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF06285D38; Wed, 4 Apr 2018 17:00:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9D1A1676A; Wed, 4 Apr 2018 17:00:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34H0IYZ019281; Wed, 4 Apr 2018 17:00:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34H0Ipd019280; Wed, 4 Apr 2018 17:00:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804041700.w34H0Ipd019280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 17:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332038 - stable/11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc/rc.d X-SVN-Commit-Revision: 332038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 17:00:19 -0000 Author: kevans Date: Wed Apr 4 17:00:18 2018 New Revision: 332038 URL: https://svnweb.freebsd.org/changeset/base/332038 Log: MFC r328951: Refactor cleanvar to remove shell expansion vulnerability If any process creates a directory named "-P" in /var/run or /var/spool/lock it will cause the purgedir function to start to rm -r /. Simplify a lot of complicated shell logic by leveraging find(1). Modified: stable/11/etc/rc.d/cleanvar Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/cleanvar ============================================================================== --- stable/11/etc/rc.d/cleanvar Wed Apr 4 16:59:10 2018 (r332037) +++ stable/11/etc/rc.d/cleanvar Wed Apr 4 17:00:18 2018 (r332038) @@ -19,34 +19,6 @@ stop_cmd=":" extra_commands="reload" reload_cmd="${name}_start" -purgedir() -{ - local dir file - - if [ $# -eq 0 ]; then - purgedir . - else - for dir - do - ( - cd "$dir" && for file in .* * - do - # Skip over logging sockets - [ -S "$file" -a "$file" = "log" ] && continue - [ -S "$file" -a "$file" = "logpriv" ] && continue - [ ."$file" = .. -o ."$file" = ... ] && continue - if [ -d "$file" -a ! -L "$file" ] - then - purgedir "$file" - else - rm -f -- "$file" - fi - done - ) - done - fi -} - cleanvar_prestart() { # These files must be removed only the first time this script is run @@ -58,14 +30,17 @@ cleanvar_prestart() cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then - purgedir /var/run + # Skip over logging sockets + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - purgedir /var/spool/lock + find /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi - rm -rf /var/spool/uucp/.Temp/* + if [ -d /var/spool/uucp/.Temp ]; then + find /var/spool/uucp/.Temp -delete + fi } load_rc_config $name From owner-svn-src-all@freebsd.org Wed Apr 4 17:22:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 880C2F9E4F4; Wed, 4 Apr 2018 17:22:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1730C86F60; Wed, 4 Apr 2018 17:22:11 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x235.google.com with SMTP id f6-v6so17965070ita.2; Wed, 04 Apr 2018 10:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=X/F5Q8JIcFIimeD8M8l72jCgzvDsobiu5UN4Kah96c8=; b=TS6uqQGcqrlMRcLFACBQRBUvIN7meIlYLWUfhfH1WsITVClJD1QuefI0dPZSg0BmSN tWhBiE36eAA4hlEJwYnEk68sQx1IRGoWboNGn8iXKzxP4OCFFhQnShBoTeewRMduqgt/ X7vfvKm5YGYydhuoFAROPPoVbZ4lqbInTFyHxURrMzVeBzMTP41xPVWRVta2n9QAG395 JstTwtJFN0b46/wT11OL8TmCGXAHOhCc6+9/0U6OagkD56lZu3JpeORH8VZ+orKH7GSZ 65+VK/SS/C/Voh3xIR8DyBfHeD6tPoIM4NlefWD00aoTClvBSO0aeb051QD3O7OLF5AI sFDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=X/F5Q8JIcFIimeD8M8l72jCgzvDsobiu5UN4Kah96c8=; b=C3DrbsC4D/0UwJJSsFjPJnCoY6mFso9C5F6h50/ugDQ3cdakPo2PZnVP56xhrpevVP zOv0HXst3MaeKHXGqCssw3Oy8Ba7SsEiCNWa7D7zfwNSpRmIlNI+IsAGM1YCvtWjjT6O WOVrmb0DlIUF7xfhzZr+jHsst81hYpHpyYYOACjEq+ssjBPpDVjtIT9aAACuwPl0xtbZ 3Je/35Qm19AKiVLYs5O9k6RgIv1PixenrF32COYWHQnvNRpdN+4dn3oQGIOfdHJzDKYj eBYc53EBgTiL1CRYfS0KRsIrVk0VEgxm/mjWQVudXmTrugvbIY6rLQ3QguD0namCuEgG 8fdw== X-Gm-Message-State: AElRT7GIRk8D2YngjJHF5TOsaAuts9f/1ZLamTfEKEOy1KU24t4IwFR5 E9fdiDuWhrh1zOn0PFANMq6gsQ/9tdXZD6Ve0Bn1tA== X-Google-Smtp-Source: AIpwx4+mfn6KqCqyqs2U/ozSumkE81BhkytPCeBZR1O/lJ3td+eg7p0Vh24nhwgt8g6nlAgNdMq7YQUBHSGYtI1Xn+w= X-Received: by 2002:a24:dfc3:: with SMTP id r186-v6mr10082973itg.114.1522862530268; Wed, 04 Apr 2018 10:22:10 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Wed, 4 Apr 2018 10:21:49 -0700 (PDT) In-Reply-To: <201804041412.w34EC7lh031741@repo.freebsd.org> References: <201804041412.w34EC7lh031741@repo.freebsd.org> From: Ed Maste Date: Wed, 4 Apr 2018 13:21:49 -0400 X-Google-Sender-Auth: -NT6kbGRBmKaQoVpLAYaU2VzWr0 Message-ID: Subject: Re: svn commit: r332032 - stable/10/sys/compat/linux To: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 17:22:14 -0000 On 4 April 2018 at 10:12, Ed Maste wrote: > Author: emaste > Date: Wed Apr 4 14:12:07 2018 > New Revision: 332032 > URL: https://svnweb.freebsd.org/changeset/base/332032 > > Log: > MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC stable/10 is still broken because of this change; I'll have a fix committed soon. From owner-svn-src-all@freebsd.org Wed Apr 4 17:45:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29AEDF9F9EB; Wed, 4 Apr 2018 17:45:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C525587DA0; Wed, 4 Apr 2018 17:45:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFF9216FCA; Wed, 4 Apr 2018 17:45:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Hj5Jt067329; Wed, 4 Apr 2018 17:45:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Hj5Rp067328; Wed, 4 Apr 2018 17:45:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041745.w34Hj5Rp067328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 17:45:05 +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: r332039 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 332039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 17:45:06 -0000 Author: emaste Date: Wed Apr 4 17:45:05 2018 New Revision: 332039 URL: https://svnweb.freebsd.org/changeset/base/332039 Log: Fix build: correct variable names on stable/10 r332032 merged r330356 from HEAD but did not account for a renamed variable (of a different type) between stable/10 and HEAD. Further fix to r332036. Modified: stable/10/sys/compat/linux/linux_ipc.c Modified: stable/10/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/10/sys/compat/linux/linux_ipc.c Wed Apr 4 17:00:18 2018 (r332038) +++ stable/10/sys/compat/linux/linux_ipc.c Wed Apr 4 17:45:05 2018 (r332039) @@ -664,7 +664,7 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar struct l_msqid_ds linux_msqid; struct msqid_ds bsd_msqid; - memset(&linux_msqid64, 0, sizeof(linux_msqid64)); + memset(&linux_msqid, 0, sizeof(linux_msqid)); bsd_cmd = args->cmd & ~LINUX_IPC_64; switch (bsd_cmd) { @@ -796,8 +796,8 @@ linux_shmctl(struct thread *td, struct linux_shmctl_ar int error; memset(&linux_shm_info, 0, sizeof(linux_shm_info)); - memset(&linux_shmid64, 0, sizeof(linux_shmid64)); - memset(&linux_shminfo64, 0, sizeof(linux_shminfo64)); + memset(&linux_shmid, 0, sizeof(linux_shmid)); + memset(&linux_shminfo, 0, sizeof(linux_shminfo)); switch (args->cmd & ~LINUX_IPC_64) { From owner-svn-src-all@freebsd.org Wed Apr 4 18:06:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9E62F532EC; Wed, 4 Apr 2018 18:06:53 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5182768CF0; Wed, 4 Apr 2018 18:06:53 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B5E41730F; Wed, 4 Apr 2018 18:06:53 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34I6rOI084565; Wed, 4 Apr 2018 18:06:53 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34I6qQU084556; Wed, 4 Apr 2018 18:06:52 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201804041806.w34I6qQU084556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 4 Apr 2018 18:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332040 - in stable/11: share/man/man4 sys/amd64/conf sys/conf sys/dev/ocs_fc sys/modules sys/modules/ocs_fc X-SVN-Group: stable-11 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/amd64/conf sys/conf sys/dev/ocs_fc sys/modules sys/modules/ocs_fc X-SVN-Commit-Revision: 332040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 18:06:53 -0000 Author: ken Date: Wed Apr 4 18:06:52 2018 New Revision: 332040 URL: https://svnweb.freebsd.org/changeset/base/332040 Log: MFC r331766, r331768: ------------------------------------------------------------------------ r331766 | ken | 2018-03-30 09:28:25 -0600 (Fri, 30 Mar 2018) | 25 lines Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4). The ocs_fc(4) driver supports the following hardware: Emulex 16/8G FC GEN 5 HBAS LPe15004 FC Host Bus Adapters LPe160XX FC Host Bus Adapters Emulex 32/16G FC GEN 6 HBAS LPe3100X FC Host Bus Adapters LPe3200X FC Host Bus Adapters The driver supports target and initiator mode, and also supports FC-Tape. Note that the driver only currently works on little endian platforms. It is only included in the module build for amd64 and i386, and in GENERIC on amd64 only. Submitted by: Ram Kishore Vegesna Reviewed by: mav Relnotes: yes Sponsored by: Broadcom Differential Revision: https://reviews.freebsd.org/D11423 ------------------------------------------------------------------------ r331768 | cem | 2018-03-30 10:44:54 -0600 (Fri, 30 Mar 2018) | 9 lines ocs_fc(4): Fix GCC build (-Wredundant-decls) These objects are defined earlier in the same file; an extern declaration after definition is redundant. Broken in r331766 (introduction of ocs_fc(4)). Sponsored by: Dell EMC Isilon ------------------------------------------------------------------------ Differential Revision: https://reviews.freebsd.org/D11423 Relnotes: yes Added: stable/11/share/man/man4/ocs_fc.4 - copied unchanged from r331766, head/share/man/man4/ocs_fc.4 stable/11/sys/dev/ocs_fc/ - copied from r331766, head/sys/dev/ocs_fc/ stable/11/sys/modules/ocs_fc/ - copied from r331766, head/sys/modules/ocs_fc/ Modified: stable/11/share/man/man4/Makefile stable/11/sys/amd64/conf/GENERIC stable/11/sys/conf/files stable/11/sys/dev/ocs_fc/sli4.c stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Wed Apr 4 17:45:05 2018 (r332039) +++ stable/11/share/man/man4/Makefile Wed Apr 4 18:06:52 2018 (r332040) @@ -402,6 +402,7 @@ MAN= aac.4 \ ${_nvram2env.4} \ ${_nxge.4} \ oce.4 \ + ocs_fc.4\ ohci.4 \ orm.4 \ ow.4 \ Copied: stable/11/share/man/man4/ocs_fc.4 (from r331766, head/share/man/man4/ocs_fc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/ocs_fc.4 Wed Apr 4 18:06:52 2018 (r332040, copy of r331766, head/share/man/man4/ocs_fc.4) @@ -0,0 +1,194 @@ +.\" Copyright (c) 2017 Broadcom. All rights reserved. +.\" The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright notice, +.\" this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright notice, +.\" this list of conditions and the following disclaimer in the documentation +.\" and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of the copyright holder nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 30, 2018 +.Dt OCS_FC 4 +.Os +.Sh NAME +.Nm ocs_fc +.Nd "Device driver for Emulex Fibre Channel Host Adapters" +.Sh SYNOPSIS +To compile this driver into the kernel, add this line to the +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ocs_fc" +.Ed +.Pp +To load the driver as a module at boot, add this line to +.Xr loader.conf 5 : +.Bd -literal -offset indent +ocs_fc_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides access to Fibre Channel SCSI devices. +.Pp +The +.Nm +driver supports initiator and target modes. +Support is available for Arbitrated loops, Point-to-Point, +and Fabric connections. +FC-Tape is highly recommended for connections to tape drives that support +it. +FC-Tape includes four elements from the T-10 FCP-4 specification: +.Bl -bullet -offset indent +.It +Precise Delivery of Commands +.It +Confirmed Completion of FCP I/O Operations +.It +Retransmission of Unsuccessfully Transmitted IUs +.It +Task Retry Identification +.El +.Pp +Together these features allow for link level error recovery with tape +devices. +Without link level error recovery, an initiator cannot, for instance, tell whether a tape write +command that has timed out resulted in all, part, or none of the data going to +the tape drive. +FC-Tape is automatically enabled when both the controller and target support it. + +.Sh HARDWARE +The +.Nm +driver supports these Fibre Channel adapters: +.Bl -tag -width xxxxxx -offset indent +.It Emulex 16/8G FC GEN 5 HBAS +.Bd -literal -offset indent +LPe15004 FC Host Bus Adapters +LPe160XX FC Host Bus Adapters +.Ed +.It Emulex 32/16G FC GEN 6 HBAS +.Bd -literal -offset indent +LPe3100X FC Host Bus Adapters +LPe3200X FC Host Bus Adapters +.Ed +.El +.Sh UPDATING FIRMWARE +Adapter firmware updates are persistent. +.Pp +Firmware can be updated by following these steps: +.Bl -enum +.It +Copy this code to a +.Pa Makefile : +.Bd -literal -offset indent +KMOD=ocsflash +FIRMWS=imagename.grp:ocsflash +\&.include +.Ed +.It +Replace +.Pa imagename +with the name of the GRP file. +.It +Copy the +.Pa Makefile +and GRP file to a local directory +.It +Execute +.Cm make +and copy the generated +.Pa ocsflash.ko +file to +.Pa /lib/modules +.It +.Cm sysctl dev.ocs_fc..fw_upgrade=ocsflash +.It +Check kernel messages regarding status of the operation +.It +Reboot the machine +.El +.Pp +.Sh BOOT OPTIONS +Options are controlled by setting values in +.Pa /boot/device.hints . +.Pp +They are: +.Bl -tag -width indent +.It Va hint.ocs_fc.N.initiator +Enable initiator functionality. +Default 1 (enabled), 0 to disable. +.It Va hint.ocs_fc.N.target +Enable target functionality. +Default 1 (enabled), 0 to disable. +.It Va hint.ocs_fc.N.topology +Topology: 0 for Auto, 1 for NPort only, 2 for Loop only. +.It Va hint.ocs_fc.N.speed +Link speed in megabits per second. +Possible values include: +0 Auto-speed negotiation (default), 4000 (4GFC), 8000 (8GFC), 16000 (16GFC). +.El +.Sh SYSCTL OPTIONS +.Bl -tag -width indent +.It Va dev.ocs_fc.N.port_state +Port state (read/write). +Valid values are +.Li online +and +.Li offline . +.It Va dev.ocs_fc.N.wwpn +World Wide Port Name (read/write). +.It Va dev.ocs_fc.N.wwnn +World Wide Node Name (read/write). +.It Va dev.ocs_fc.N.fwrev +Firmware revision (read-only). +.It Va dev.ocs_fc.N.sn +Adapter serial number (read-only). +.It Va dev.ocs_fc.N.configured_speed +Configured Port Speed (read/write). +Valid values are: +0 Auto-speed negotiation (default), 4000 (4GFC), 8000 (8GFC), 16000 (16GFC). +.It Va dev.ocs_fc.N.configured_topology +Configured Port Topology (read/write). +Valid values are: +0-Auto; 1-NPort; 2-Loop. +.It Va dev.ocs_fc.N.current_speed +Current Port Speed (read-only). +.It Va dev.ocs_fc.N.current_topology +Current Port Topology (read-only). +.El +.Sh SUPPORT +For general information and support, +go to the Broadcom website at: +.Pa http://www.broadcom.com/ +or E-Mail at +.Pa ocs-driver-team.pdl@broadcom.com. +.Sh SEE ALSO +.Xr ifconfig 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Broadcom. Modified: stable/11/sys/amd64/conf/GENERIC ============================================================================== --- stable/11/sys/amd64/conf/GENERIC Wed Apr 4 17:45:05 2018 (r332039) +++ stable/11/sys/amd64/conf/GENERIC Wed Apr 4 18:06:52 2018 (r332040) @@ -130,6 +130,7 @@ device adw # Advansys wide SCSI adapters device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. device bt # Buslogic/Mylex MultiMaster SCSI adapters device isci # Intel C600 SAS controller +device ocs_fc # Emulex FC adapters # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Apr 4 17:45:05 2018 (r332039) +++ stable/11/sys/conf/files Wed Apr 4 18:06:52 2018 (r332040) @@ -2498,6 +2498,27 @@ dev/oce/oce_mbox.c optional oce pci dev/oce/oce_queue.c optional oce pci dev/oce/oce_sysctl.c optional oce pci dev/oce/oce_util.c optional oce pci +dev/ocs_fc/ocs_pci.c optional ocs_fc pci +dev/ocs_fc/ocs_ioctl.c optional ocs_fc pci +dev/ocs_fc/ocs_os.c optional ocs_fc pci +dev/ocs_fc/ocs_utils.c optional ocs_fc pci +dev/ocs_fc/ocs_hw.c optional ocs_fc pci +dev/ocs_fc/ocs_hw_queues.c optional ocs_fc pci +dev/ocs_fc/sli4.c optional ocs_fc pci +dev/ocs_fc/ocs_sm.c optional ocs_fc pci +dev/ocs_fc/ocs_device.c optional ocs_fc pci +dev/ocs_fc/ocs_xport.c optional ocs_fc pci +dev/ocs_fc/ocs_domain.c optional ocs_fc pci +dev/ocs_fc/ocs_sport.c optional ocs_fc pci +dev/ocs_fc/ocs_els.c optional ocs_fc pci +dev/ocs_fc/ocs_fabric.c optional ocs_fc pci +dev/ocs_fc/ocs_io.c optional ocs_fc pci +dev/ocs_fc/ocs_node.c optional ocs_fc pci +dev/ocs_fc/ocs_scsi.c optional ocs_fc pci +dev/ocs_fc/ocs_unsol.c optional ocs_fc pci +dev/ocs_fc/ocs_ddump.c optional ocs_fc pci +dev/ocs_fc/ocs_mgmt.c optional ocs_fc pci +dev/ocs_fc/ocs_cam.c optional ocs_fc pci dev/ofw/ofw_bus_if.m optional fdt dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt Modified: stable/11/sys/dev/ocs_fc/sli4.c ============================================================================== --- head/sys/dev/ocs_fc/sli4.c Fri Mar 30 15:28:25 2018 (r331766) +++ stable/11/sys/dev/ocs_fc/sli4.c Wed Apr 4 18:06:52 2018 (r332040) @@ -5758,9 +5758,6 @@ int32_t sli_link_is_configurable(sli4_t *sli) /* vim: set noexpandtab textwidth=120: */ -extern const char *SLI_QNAME[]; -extern const sli4_reg_t regmap[SLI4_REG_MAX][SLI4_MAX_IF_TYPES]; - /** * @ingroup sli_fc * @brief Write an FCOE_WQ_CREATE command. Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Wed Apr 4 17:45:05 2018 (r332039) +++ stable/11/sys/modules/Makefile Wed Apr 4 18:06:52 2018 (r332040) @@ -294,6 +294,7 @@ SUBDIR= \ ${_nvram} \ ${_nxge} \ oce \ + ${_ocs_fc} \ otus \ ${_otusfw} \ ow \ @@ -609,6 +610,7 @@ _lio= lio .endif _nctgpio= nctgpio _ndis= ndis +_ocs_fc= ocs_fc _pccard= pccard .if ${MK_OFED} != "no" || defined(ALL_MODULES) _rdma= rdma From owner-svn-src-all@freebsd.org Wed Apr 4 18:27:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A50DF57F49; Wed, 4 Apr 2018 18:27:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3686469D8D; Wed, 4 Apr 2018 18:27:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA0817670; Wed, 4 Apr 2018 18:27:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34IRIZs001487; Wed, 4 Apr 2018 18:27:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34IRINd001484; Wed, 4 Apr 2018 18:27:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804041827.w34IRINd001484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 4 Apr 2018 18:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r332041 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: mav X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 332041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 18:27:19 -0000 Author: mav Date: Wed Apr 4 18:27:18 2018 New Revision: 332041 URL: https://svnweb.freebsd.org/changeset/base/332041 Log: Restore Sean Eric Fagan (sef) src commit bit. I (mav) will be his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Apr 4 18:06:52 2018 (r332040) +++ svnadmin/conf/access Wed Apr 4 18:27:18 2018 (r332041) @@ -192,6 +192,7 @@ scf schweikh scottl se +sef sephe sgalabov shurd Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Apr 4 18:06:52 2018 (r332040) +++ svnadmin/conf/mentors Wed Apr 4 18:27:18 2018 (r332041) @@ -27,6 +27,7 @@ mahrens mckusick mjoras rstone peterj jhb Co-mentor: grog rgrimes grehan +sef mav slavash kib Co-mentor: hselasky slm ken Co-mentor: scottl, ambrisko wosch cem From owner-svn-src-all@freebsd.org Wed Apr 4 19:58:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBB75F71912; Wed, 4 Apr 2018 19:58:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79AA8707B6; Wed, 4 Apr 2018 19:58:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 706FD1853C; Wed, 4 Apr 2018 19:58:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34JwPu1082548; Wed, 4 Apr 2018 19:58:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34JwPhW082547; Wed, 4 Apr 2018 19:58:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804041958.w34JwPhW082547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 19:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332042 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 332042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 19:58:26 -0000 Author: emaste Date: Wed Apr 4 19:58:25 2018 New Revision: 332042 URL: https://svnweb.freebsd.org/changeset/base/332042 Log: Fix kernel memory disclosure in linux_ioctl_socket strlcpy is used to copy a string into a buffer to be copied to userland, previously leaving uninitialized data after the terminating NUL. Zero the buffer first to avoid a kernel memory disclosure. admbugs: 765, 811 MFC after: 1 day Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Wed Apr 4 18:27:18 2018 (r332041) +++ head/sys/compat/linux/linux_ioctl.c Wed Apr 4 19:58:25 2018 (r332042) @@ -2478,6 +2478,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioc printf("%s(): ioctl %d on %.*s\n", __func__, args->cmd & 0xffff, LINUX_IFNAMSIZ, lifname); #endif + memset(ifname, 0, sizeof(ifname)); ifp = ifname_linux_to_bsd(td, lifname, ifname); if (ifp == NULL) return (EINVAL); From owner-svn-src-all@freebsd.org Wed Apr 4 20:15:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2136EF7303C; Wed, 4 Apr 2018 20:15:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC4EB7172C; Wed, 4 Apr 2018 20:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C32BE18879; Wed, 4 Apr 2018 20:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34KFfY7097617; Wed, 4 Apr 2018 20:15:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34KFfnT097616; Wed, 4 Apr 2018 20:15:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804042015.w34KFfnT097616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 4 Apr 2018 20:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332043 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 332043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 20:15:42 -0000 Author: markj Date: Wed Apr 4 20:15:41 2018 New Revision: 332043 URL: https://svnweb.freebsd.org/changeset/base/332043 Log: Typo. MFC after: 3 days Modified: head/share/man/man9/timeout.9 Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Wed Apr 4 19:58:25 2018 (r332042) +++ head/share/man/man9/timeout.9 Wed Apr 4 20:15:41 2018 (r332043) @@ -327,7 +327,6 @@ The .Fa drain function itself is called from the context of the completing callout i.e. softclock or hardclock, just like a callout itself. -p .Pp The function .Fn callout_drain From owner-svn-src-all@freebsd.org Wed Apr 4 20:29:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777F1F73F7B; Wed, 4 Apr 2018 20:29:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27BAF72185; Wed, 4 Apr 2018 20:29:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E16A18A14; Wed, 4 Apr 2018 20:29:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34KTtfb007946; Wed, 4 Apr 2018 20:29:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34KTt2l007945; Wed, 4 Apr 2018 20:29:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804042029.w34KTt2l007945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 4 Apr 2018 20:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332044 - stable/11/share/termcap X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/share/termcap X-SVN-Commit-Revision: 332044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 20:29:56 -0000 Author: bapt Date: Wed Apr 4 20:29:55 2018 New Revision: 332044 URL: https://svnweb.freebsd.org/changeset/base/332044 Log: MFC r331005-r331006 r331005: Fix tab vs space indentation r331006: Add termcap entries for the st terminal (https://st.suckless.org) Modified: stable/11/share/termcap/termcap Directory Properties: stable/11/ (props changed) Modified: stable/11/share/termcap/termcap ============================================================================== --- stable/11/share/termcap/termcap Wed Apr 4 20:15:41 2018 (r332043) +++ stable/11/share/termcap/termcap Wed Apr 4 20:29:55 2018 (r332044) @@ -4664,24 +4664,61 @@ Eterm|Eterm Terminal Emulator (X11 Window System):\ # Termcap for xterm-termite xterm-termite|VTE-based terminal:\ - :NP:am:hs:mi:ms:ut:xn:\ - :Co#256:co#80:it#8:li#24:pa#32767:\ - :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\ - :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\ - :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\ - :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\ - :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\ - :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ - :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\ - :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ - :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ - :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\ - :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\ - :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\ - :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\ - :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\ - :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ - :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: + :NP:am:hs:mi:ms:ut:xn:\ + :Co#256:co#80:it#8:li#24:pa#32767:\ + :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\ + :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\ + :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\ + :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\ + :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\ + :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ + :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\ + :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\ + :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\ + :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\ + :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\ + :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\ + :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\ + :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l: + +# Termcap for st terminal taken from the st-0.8 sources +st|simpleterm:\ + :am:hs:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ + :K1=\E[1~:K2=\EOu:K3=\E[5~:K4=\E[4~:K5=\E[6~:LE=\E[%dD:\ + :RI=\E[%dC:SF=\E[%dS:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:\ + :bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\ + :dl=\E[M:do=\n:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\ + :is=\E[4l\E>\E[?1034l:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ + :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ + :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\ + :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ + :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:mh=\E[2m:\ + :mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:\ + :sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:ts=\E]0;:\ + :ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\ + :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?25h: + +st-256color|simpleterm with 256 colors:\ + :cc:\ + :Co#256:pa#32767:\ + :AB=\E[48;5;%dm:AF=\E[38;5;%dm:\ + :..Ic=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\:\ + :oc=\E]104\007:tc=st: + +st-meta|simpleterm with meta key:\ + :km:\ + :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\ + :rs=\E[4l\E>\E[?1034h:tc=st: + +st-meta-256color|simpleterm with meta key and 256 colors:\ + :km:\ + :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\ + :rs=\E[4l\E>\E[?1034h:tc=st-256color: # # END OF TERMCAP From owner-svn-src-all@freebsd.org Wed Apr 4 21:12:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C632FF76B8D; Wed, 4 Apr 2018 21:12:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF5274212; Wed, 4 Apr 2018 21:12:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76E0619236; Wed, 4 Apr 2018 21:12:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34LCZgt046342; Wed, 4 Apr 2018 21:12:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34LCZ8g046341; Wed, 4 Apr 2018 21:12:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804042112.w34LCZ8g046341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 4 Apr 2018 21:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332045 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 21:12:35 -0000 Author: emaste Date: Wed Apr 4 21:12:35 2018 New Revision: 332045 URL: https://svnweb.freebsd.org/changeset/base/332045 Log: Fix kernel memory disclosure in tcp_ctloutput strcpy was used to copy a string into a buffer copied to userland, which left uninitialized data after the terminating 0-byte. Use the same approach as in tcp_subr.c: strncpy and explicit '\0'. admbugs: 765, 822 MFC after: 1 day Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Apr 4 20:29:55 2018 (r332044) +++ head/sys/netinet/tcp_usrreq.c Wed Apr 4 21:12:35 2018 (r332045) @@ -1533,7 +1533,9 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt) return (error); } else if ((sopt->sopt_dir == SOPT_GET) && (sopt->sopt_name == TCP_FUNCTION_BLK)) { - strcpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name); + strncpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name, + TCP_FUNCTION_NAME_LEN_MAX); + fsn.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; fsn.pcbcnt = tp->t_fb->tfb_refcnt; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &fsn, sizeof fsn); From owner-svn-src-all@freebsd.org Wed Apr 4 21:19:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BC7FF773B4; Wed, 4 Apr 2018 21:19:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC5C5747D3; Wed, 4 Apr 2018 21:19:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E753A19242; Wed, 4 Apr 2018 21:19:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34LJXQI048845; Wed, 4 Apr 2018 21:19:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34LJXXH048844; Wed, 4 Apr 2018 21:19:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804042119.w34LJXXH048844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 4 Apr 2018 21:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332046 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 21:19:34 -0000 Author: ian Date: Wed Apr 4 21:19:33 2018 New Revision: 332046 URL: https://svnweb.freebsd.org/changeset/base/332046 Log: Add a missing MODULE_DEPEND(). Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Wed Apr 4 21:12:35 2018 (r332045) +++ head/sys/dev/spibus/spigen.c Wed Apr 4 21:19:33 2018 (r332046) @@ -456,3 +456,4 @@ static driver_t spigen_driver = { }; DRIVER_MODULE(spigen, spibus, spigen_driver, spigen_devclass, 0, 0); +MODULE_DEPEND(spigen, spibus, 1, 1, 1); From owner-svn-src-all@freebsd.org Wed Apr 4 21:31:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30AD4F7808B; Wed, 4 Apr 2018 21:31:13 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0A9975133; Wed, 4 Apr 2018 21:31:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB21D19516; Wed, 4 Apr 2018 21:31:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34LVCTu060014; Wed, 4 Apr 2018 21:31:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34LVCKp060008; Wed, 4 Apr 2018 21:31:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201804042131.w34LVCKp060008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 4 Apr 2018 21:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332047 - in head/sys: dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: dev/netmap net X-SVN-Commit-Revision: 332047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 21:31:13 -0000 Author: vmaffione Date: Wed Apr 4 21:31:12 2018 New Revision: 332047 URL: https://svnweb.freebsd.org/changeset/base/332047 Log: netmap: align if_ptnet guest driver to the upstream code (commit 0e15788) The change upgrades the driver to use the split Communication Status Block (CSB) format. In this way the variables written by the guest and read by the host are allocated in a different cacheline than the variables written by the host and read by the guest; this is needed to avoid cache thrashing. Approved by: hrs (mentor) Modified: head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_pt.c head/sys/net/netmap_virt.h Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Wed Apr 4 21:19:33 2018 (r332046) +++ head/sys/dev/netmap/if_ptnet.c Wed Apr 4 21:31:12 2018 (r332047) @@ -88,10 +88,6 @@ #include #include -#ifndef PTNET_CSB_ALLOC -#error "No support for on-device CSB" -#endif - #ifndef INET #error "INET not defined, cannot support offloadings" #endif @@ -132,7 +128,8 @@ struct ptnet_queue { struct resource *irq; void *cookie; int kring_id; - struct ptnet_ring *ptring; + struct ptnet_csb_gh *ptgh; + struct ptnet_csb_hg *pthg; unsigned int kick; struct mtx lock; struct buf_ring *bufring; /* for TX queues */ @@ -169,7 +166,8 @@ struct ptnet_softc { unsigned int num_tx_rings; struct ptnet_queue *queues; struct ptnet_queue *rxqueues; - struct ptnet_csb *csb; + struct ptnet_csb_gh *csb_gh; + struct ptnet_csb_hg *csb_hg; unsigned int min_tx_space; @@ -323,33 +321,48 @@ ptnet_attach(device_t dev) ptfeatures = bus_read_4(sc->iomem, PTNET_IO_PTFEAT); /* acked */ sc->ptfeatures = ptfeatures; - /* Allocate CSB and carry out CSB allocation protocol (CSBBAH first, - * then CSBBAL). */ - sc->csb = malloc(sizeof(struct ptnet_csb), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (sc->csb == NULL) { + num_tx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS); + num_rx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS); + sc->num_rings = num_tx_rings + num_rx_rings; + sc->num_tx_rings = num_tx_rings; + + if (sc->num_rings * sizeof(struct ptnet_csb_gh) > PAGE_SIZE) { + device_printf(dev, "CSB cannot handle that many rings (%u)\n", + sc->num_rings); + err = ENOMEM; + goto err_path; + } + + /* Allocate CSB and carry out CSB allocation protocol. */ + sc->csb_gh = contigmalloc(2*PAGE_SIZE, M_DEVBUF, M_NOWAIT | M_ZERO, + (size_t)0, -1UL, PAGE_SIZE, 0); + if (sc->csb_gh == NULL) { device_printf(dev, "Failed to allocate CSB\n"); err = ENOMEM; goto err_path; } + sc->csb_hg = (struct ptnet_csb_hg *)(((char *)sc->csb_gh) + PAGE_SIZE); { /* * We use uint64_t rather than vm_paddr_t since we * need 64 bit addresses even on 32 bit platforms. */ - uint64_t paddr = vtophys(sc->csb); + uint64_t paddr = vtophys(sc->csb_gh); - bus_write_4(sc->iomem, PTNET_IO_CSBBAH, - (paddr >> 32) & 0xffffffff); - bus_write_4(sc->iomem, PTNET_IO_CSBBAL, paddr & 0xffffffff); + /* CSB allocation protocol: write to BAH first, then + * to BAL (for both GH and HG sections). */ + bus_write_4(sc->iomem, PTNET_IO_CSB_GH_BAH, + (paddr >> 32) & 0xffffffff); + bus_write_4(sc->iomem, PTNET_IO_CSB_GH_BAL, + paddr & 0xffffffff); + paddr = vtophys(sc->csb_hg); + bus_write_4(sc->iomem, PTNET_IO_CSB_HG_BAH, + (paddr >> 32) & 0xffffffff); + bus_write_4(sc->iomem, PTNET_IO_CSB_HG_BAL, + paddr & 0xffffffff); } - num_tx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS); - num_rx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS); - sc->num_rings = num_tx_rings + num_rx_rings; - sc->num_tx_rings = num_tx_rings; - /* Allocate and initialize per-queue data structures. */ sc->queues = malloc(sizeof(struct ptnet_queue) * sc->num_rings, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -365,7 +378,8 @@ ptnet_attach(device_t dev) pq->sc = sc; pq->kring_id = i; pq->kick = PTNET_IO_KICK_BASE + 4 * i; - pq->ptring = sc->csb->rings + i; + pq->ptgh = sc->csb_gh + i; + pq->pthg = sc->csb_hg + i; snprintf(pq->lock_name, sizeof(pq->lock_name), "%s-%d", device_get_nameunit(dev), i); mtx_init(&pq->lock, pq->lock_name, NULL, MTX_DEF); @@ -467,7 +481,7 @@ ptnet_attach(device_t dev) na_arg.nm_txsync = ptnet_nm_txsync; na_arg.nm_rxsync = ptnet_nm_rxsync; - netmap_pt_guest_attach(&na_arg, sc->csb, nifp_offset, + netmap_pt_guest_attach(&na_arg, nifp_offset, bus_read_4(sc->iomem, PTNET_IO_HOSTMEMID)); /* Now a netmap adapter for this ifp has been allocated, and it @@ -526,11 +540,14 @@ ptnet_detach(device_t dev) ptnet_irqs_fini(sc); - if (sc->csb) { - bus_write_4(sc->iomem, PTNET_IO_CSBBAH, 0); - bus_write_4(sc->iomem, PTNET_IO_CSBBAL, 0); - free(sc->csb, M_DEVBUF); - sc->csb = NULL; + if (sc->csb_gh) { + bus_write_4(sc->iomem, PTNET_IO_CSB_GH_BAH, 0); + bus_write_4(sc->iomem, PTNET_IO_CSB_GH_BAL, 0); + bus_write_4(sc->iomem, PTNET_IO_CSB_HG_BAH, 0); + bus_write_4(sc->iomem, PTNET_IO_CSB_HG_BAL, 0); + contigfree(sc->csb_gh, 2*PAGE_SIZE, M_DEVBUF); + sc->csb_gh = NULL; + sc->csb_hg = NULL; } if (sc->queues) { @@ -777,7 +794,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) /* Make sure the worker sees the * IFF_DRV_RUNNING down. */ PTNET_Q_LOCK(pq); - pq->ptring->guest_need_kick = 0; + pq->ptgh->guest_need_kick = 0; PTNET_Q_UNLOCK(pq); /* Wait for rescheduling to finish. */ if (pq->taskq) { @@ -791,7 +808,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) for (i = 0; i < sc->num_rings; i++) { pq = sc-> queues + i; PTNET_Q_LOCK(pq); - pq->ptring->guest_need_kick = 1; + pq->ptgh->guest_need_kick = 1; PTNET_Q_UNLOCK(pq); } } @@ -1109,7 +1126,8 @@ ptnet_sync_from_csb(struct ptnet_softc *sc, struct net /* Sync krings from the host, reading from * CSB. */ for (i = 0; i < sc->num_rings; i++) { - struct ptnet_ring *ptring = sc->queues[i].ptring; + struct ptnet_csb_gh *ptgh = sc->queues[i].ptgh; + struct ptnet_csb_hg *pthg = sc->queues[i].pthg; struct netmap_kring *kring; if (i < na->num_tx_rings) { @@ -1117,15 +1135,15 @@ ptnet_sync_from_csb(struct ptnet_softc *sc, struct net } else { kring = na->rx_rings + i - na->num_tx_rings; } - kring->rhead = kring->ring->head = ptring->head; - kring->rcur = kring->ring->cur = ptring->cur; - kring->nr_hwcur = ptring->hwcur; + kring->rhead = kring->ring->head = ptgh->head; + kring->rcur = kring->ring->cur = ptgh->cur; + kring->nr_hwcur = pthg->hwcur; kring->nr_hwtail = kring->rtail = - kring->ring->tail = ptring->hwtail; + kring->ring->tail = pthg->hwtail; ND("%d,%d: csb {hc %u h %u c %u ht %u}", t, i, - ptring->hwcur, ptring->head, ptring->cur, - ptring->hwtail); + pthg->hwcur, ptgh->head, ptgh->cur, + pthg->hwtail); ND("%d,%d: kring {hc %u rh %u rc %u h %u c %u ht %u rt %u t %u}", t, i, kring->nr_hwcur, kring->rhead, kring->rcur, kring->ring->head, kring->ring->cur, kring->nr_hwtail, @@ -1169,7 +1187,7 @@ ptnet_nm_register(struct netmap_adapter *na, int onoff D("Exit netmap mode, re-enable interrupts"); for (i = 0; i < sc->num_rings; i++) { pq = sc->queues + i; - pq->ptring->guest_need_kick = 1; + pq->ptgh->guest_need_kick = 1; } } @@ -1178,8 +1196,8 @@ ptnet_nm_register(struct netmap_adapter *na, int onoff /* Initialize notification enable fields in the CSB. */ for (i = 0; i < sc->num_rings; i++) { pq = sc->queues + i; - pq->ptring->host_need_kick = 1; - pq->ptring->guest_need_kick = + pq->pthg->host_need_kick = 1; + pq->ptgh->guest_need_kick = (!(ifp->if_capenable & IFCAP_POLLING) && i >= sc->num_tx_rings); } @@ -1257,7 +1275,7 @@ ptnet_nm_txsync(struct netmap_kring *kring, int flags) struct ptnet_queue *pq = sc->queues + kring->ring_id; bool notify; - notify = netmap_pt_guest_txsync(pq->ptring, kring, flags); + notify = netmap_pt_guest_txsync(pq->ptgh, pq->pthg, kring, flags); if (notify) { ptnet_kick(pq); } @@ -1272,7 +1290,7 @@ ptnet_nm_rxsync(struct netmap_kring *kring, int flags) struct ptnet_queue *pq = sc->rxqueues + kring->ring_id; bool notify; - notify = netmap_pt_guest_rxsync(pq->ptring, kring, flags); + notify = netmap_pt_guest_rxsync(pq->ptgh, pq->pthg, kring, flags); if (notify) { ptnet_kick(pq); } @@ -1643,12 +1661,12 @@ ptnet_rx_csum(struct mbuf *m, struct virtio_net_hdr *h /* End of offloading-related functions to be shared with vtnet. */ static inline void -ptnet_sync_tail(struct ptnet_ring *ptring, struct netmap_kring *kring) +ptnet_sync_tail(struct ptnet_csb_hg *pthg, struct netmap_kring *kring) { struct netmap_ring *ring = kring->ring; /* Update hwcur and hwtail as known by the host. */ - ptnetmap_guest_read_kring_csb(ptring, kring); + ptnetmap_guest_read_kring_csb(pthg, kring); /* nm_sync_finalize */ ring->tail = kring->rtail = kring->nr_hwtail; @@ -1659,7 +1677,8 @@ ptnet_ring_update(struct ptnet_queue *pq, struct netma unsigned int head, unsigned int sync_flags) { struct netmap_ring *ring = kring->ring; - struct ptnet_ring *ptring = pq->ptring; + struct ptnet_csb_gh *ptgh = pq->ptgh; + struct ptnet_csb_hg *pthg = pq->pthg; /* Some packets have been pushed to the netmap ring. We have * to tell the host to process the new packets, updating cur @@ -1669,11 +1688,11 @@ ptnet_ring_update(struct ptnet_queue *pq, struct netma /* Mimic nm_txsync_prologue/nm_rxsync_prologue. */ kring->rcur = kring->rhead = head; - ptnetmap_guest_write_kring_csb(ptring, kring->rcur, kring->rhead); + ptnetmap_guest_write_kring_csb(ptgh, kring->rcur, kring->rhead); /* Kick the host if needed. */ - if (NM_ACCESS_ONCE(ptring->host_need_kick)) { - ptring->sync_flags = sync_flags; + if (NM_ACCESS_ONCE(pthg->host_need_kick)) { + ptgh->sync_flags = sync_flags; ptnet_kick(pq); } } @@ -1693,7 +1712,8 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns struct netmap_adapter *na = &sc->ptna->dr.up; if_t ifp = sc->ifp; unsigned int batch_count = 0; - struct ptnet_ring *ptring; + struct ptnet_csb_gh *ptgh; + struct ptnet_csb_hg *pthg; struct netmap_kring *kring; struct netmap_ring *ring; struct netmap_slot *slot; @@ -1722,7 +1742,8 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns return ENETDOWN; } - ptring = pq->ptring; + ptgh = pq->ptgh; + pthg = pq->pthg; kring = na->tx_rings + pq->kring_id; ring = kring->ring; lim = kring->nkr_num_slots - 1; @@ -1734,17 +1755,17 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns /* We ran out of slot, let's see if the host has * freed up some, by reading hwcur and hwtail from * the CSB. */ - ptnet_sync_tail(ptring, kring); + ptnet_sync_tail(pthg, kring); if (PTNET_TX_NOSPACE(head, kring, minspace)) { /* Still no slots available. Reactivate the * interrupts so that we can be notified * when some free slots are made available by * the host. */ - ptring->guest_need_kick = 1; + ptgh->guest_need_kick = 1; /* Double-check. */ - ptnet_sync_tail(ptring, kring); + ptnet_sync_tail(pthg, kring); if (likely(PTNET_TX_NOSPACE(head, kring, minspace))) { break; @@ -1753,7 +1774,7 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns RD(1, "Found more slots by doublecheck"); /* More slots were freed before reactivating * the interrupts. */ - ptring->guest_need_kick = 0; + ptgh->guest_need_kick = 0; } } @@ -1983,15 +2004,16 @@ ptnet_rx_eof(struct ptnet_queue *pq, unsigned int budg { struct ptnet_softc *sc = pq->sc; bool have_vnet_hdr = sc->vnet_hdr_len; - struct ptnet_ring *ptring = pq->ptring; + struct ptnet_csb_gh *ptgh = pq->ptgh; + struct ptnet_csb_hg *pthg = pq->pthg; struct netmap_adapter *na = &sc->ptna->dr.up; struct netmap_kring *kring = na->rx_rings + pq->kring_id; struct netmap_ring *ring = kring->ring; unsigned int const lim = kring->nkr_num_slots - 1; - unsigned int head = ring->head; unsigned int batch_count = 0; if_t ifp = sc->ifp; unsigned int count = 0; + uint32_t head; PTNET_Q_LOCK(pq); @@ -2001,33 +2023,35 @@ ptnet_rx_eof(struct ptnet_queue *pq, unsigned int budg kring->nr_kflags &= ~NKR_PENDINTR; + head = ring->head; while (count < budget) { - unsigned int prev_head = head; + uint32_t prev_head = head; struct mbuf *mhead, *mtail; struct virtio_net_hdr *vh; struct netmap_slot *slot; unsigned int nmbuf_len; uint8_t *nmbuf; + int deliver = 1; /* the mbuf to the network stack. */ host_sync: if (head == ring->tail) { /* We ran out of slot, let's see if the host has * added some, by reading hwcur and hwtail from * the CSB. */ - ptnet_sync_tail(ptring, kring); + ptnet_sync_tail(pthg, kring); if (head == ring->tail) { /* Still no slots available. Reactivate * interrupts as they were disabled by the * host thread right before issuing the * last interrupt. */ - ptring->guest_need_kick = 1; + ptgh->guest_need_kick = 1; /* Double-check. */ - ptnet_sync_tail(ptring, kring); + ptnet_sync_tail(pthg, kring); if (likely(head == ring->tail)) { break; } - ptring->guest_need_kick = 0; + ptgh->guest_need_kick = 0; } } @@ -2046,6 +2070,7 @@ host_sync: RD(1, "Fragmented vnet-hdr: dropping"); head = ptnet_rx_discard(kring, head); pq->stats.iqdrops ++; + deliver = 0; goto skip; } ND(1, "%s: vnet hdr: flags %x csum_start %u " @@ -2152,30 +2177,39 @@ host_sync: m_freem(mhead); RD(1, "Csum offload error: dropping"); pq->stats.iqdrops ++; - goto skip; + deliver = 0; } } - pq->stats.packets ++; - pq->stats.bytes += mhead->m_pkthdr.len; - - PTNET_Q_UNLOCK(pq); - (*ifp->if_input)(ifp, mhead); - PTNET_Q_LOCK(pq); - - if (unlikely(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { - /* The interface has gone down while we didn't - * have the lock. Stop any processing and exit. */ - goto unlock; - } skip: count ++; - if (++batch_count == PTNET_RX_BATCH) { - /* Some packets have been pushed to the network stack. - * We need to update the CSB to tell the host about the new - * ring->cur and ring->head (RX buffer refill). */ + if (++batch_count >= PTNET_RX_BATCH) { + /* Some packets have been (or will be) pushed to the network + * stack. We need to update the CSB to tell the host about + * the new ring->cur and ring->head (RX buffer refill). */ ptnet_ring_update(pq, kring, head, NAF_FORCE_READ); batch_count = 0; + } + + if (likely(deliver)) { + pq->stats.packets ++; + pq->stats.bytes += mhead->m_pkthdr.len; + + PTNET_Q_UNLOCK(pq); + (*ifp->if_input)(ifp, mhead); + PTNET_Q_LOCK(pq); + /* The ring->head index (and related indices) are + * updated under pq lock by ptnet_ring_update(). + * Since we dropped the lock to call if_input(), we + * must reload ring->head and restart processing the + * ring from there. */ + head = ring->head; + + if (unlikely(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { + /* The interface has gone down while we didn't + * have the lock. Stop any processing and exit. */ + goto unlock; + } } } escape: Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Apr 4 21:19:33 2018 (r332046) +++ head/sys/dev/netmap/netmap_kern.h Wed Apr 4 21:31:12 2018 (r332047) @@ -2126,8 +2126,6 @@ struct netmap_pt_guest_adapter { /* The netmap adapter to be used by the driver. */ struct netmap_hw_adapter dr; - void *csb; - /* Reference counter to track users of backend netmap port: the * network stack and netmap clients. * Used to decide when we need (de)allocate krings/rings and @@ -2136,13 +2134,18 @@ struct netmap_pt_guest_adapter { }; -int netmap_pt_guest_attach(struct netmap_adapter *na, void *csb, - unsigned int nifp_offset, unsigned int memid); -struct ptnet_ring; -bool netmap_pt_guest_txsync(struct ptnet_ring *ptring, struct netmap_kring *kring, - int flags); -bool netmap_pt_guest_rxsync(struct ptnet_ring *ptring, struct netmap_kring *kring, - int flags); +int netmap_pt_guest_attach(struct netmap_adapter *na, + unsigned int nifp_offset, + unsigned int memid); +struct ptnet_csb_gh; +struct ptnet_csb_hg; +bool netmap_pt_guest_txsync(struct ptnet_csb_gh *ptgh, + struct ptnet_csb_hg *pthg, + struct netmap_kring *kring, + int flags); +bool netmap_pt_guest_rxsync(struct ptnet_csb_gh *ptgh, + struct ptnet_csb_hg *pthg, + struct netmap_kring *kring, int flags); int ptnet_nm_krings_create(struct netmap_adapter *na); void ptnet_nm_krings_delete(struct netmap_adapter *na); void ptnet_nm_dtor(struct netmap_adapter *na); Modified: head/sys/dev/netmap/netmap_pt.c ============================================================================== --- head/sys/dev/netmap/netmap_pt.c Wed Apr 4 21:19:33 2018 (r332046) +++ head/sys/dev/netmap/netmap_pt.c Wed Apr 4 21:31:12 2018 (r332047) @@ -172,8 +172,9 @@ struct ptnetmap_state { /* Kthreads. */ struct nm_kctx **kctxs; - /* Shared memory with the guest (TX/RX) */ - struct ptnet_ring __user *ptrings; + /* Shared memory with the guest (TX/RX) */ + struct ptnet_csb_gh __user *csb_gh; + struct ptnet_csb_hg __user *csb_hg; bool stopped; @@ -200,29 +201,22 @@ ptnetmap_kring_dump(const char *title, const struct ne /* Enable or disable guest --> host kicks. */ static inline void -ptring_kick_enable(struct ptnet_ring __user *ptring, uint32_t val) +pthg_kick_enable(struct ptnet_csb_hg __user *pthg, uint32_t val) { - CSB_WRITE(ptring, host_need_kick, val); + CSB_WRITE(pthg, host_need_kick, val); } /* Are guest interrupt enabled or disabled? */ static inline uint32_t -ptring_intr_enabled(struct ptnet_ring __user *ptring) +ptgh_intr_enabled(struct ptnet_csb_gh __user *ptgh) { uint32_t v; - CSB_READ(ptring, guest_need_kick, v); + CSB_READ(ptgh, guest_need_kick, v); return v; } -/* Enable or disable guest interrupts. */ -static inline void -ptring_intr_enable(struct ptnet_ring __user *ptring, uint32_t val) -{ - CSB_WRITE(ptring, guest_need_kick, val); -} - /* Handle TX events: from the guest or from the backend */ static void ptnetmap_tx_handler(void *data, int is_kthread) @@ -231,7 +225,8 @@ ptnetmap_tx_handler(void *data, int is_kthread) struct netmap_pt_host_adapter *pth_na = (struct netmap_pt_host_adapter *)kring->na->na_private; struct ptnetmap_state *ptns = pth_na->ptns; - struct ptnet_ring __user *ptring; + struct ptnet_csb_gh __user *ptgh; + struct ptnet_csb_hg __user *pthg; struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ bool more_txspace = false; struct nm_kctx *kth; @@ -257,18 +252,17 @@ ptnetmap_tx_handler(void *data, int is_kthread) /* This is a guess, to be fixed in the rate callback. */ IFRATE(ptns->rate_ctx.new.gtxk++); - /* Get TX ptring pointer from the CSB. */ - ptring = ptns->ptrings + kring->ring_id; + /* Get TX ptgh/pthg pointer from the CSB. */ + ptgh = ptns->csb_gh + kring->ring_id; + pthg = ptns->csb_hg + kring->ring_id; kth = ptns->kctxs[kring->ring_id]; num_slots = kring->nkr_num_slots; - shadow_ring.head = kring->rhead; - shadow_ring.cur = kring->rcur; /* Disable guest --> host notifications. */ - ptring_kick_enable(ptring, 0); + pthg_kick_enable(pthg, 0); /* Copy the guest kring pointers from the CSB */ - ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + ptnetmap_host_read_kring_csb(ptgh, &shadow_ring, num_slots); for (;;) { /* If guest moves ahead too fast, let's cut the move so @@ -299,7 +293,7 @@ ptnetmap_tx_handler(void *data, int is_kthread) if (unlikely(nm_txsync_prologue(kring, &shadow_ring) >= num_slots)) { /* Reinit ring and enable notifications. */ netmap_ring_reinit(kring); - ptring_kick_enable(ptring, 1); + pthg_kick_enable(pthg, 1); break; } @@ -310,7 +304,7 @@ ptnetmap_tx_handler(void *data, int is_kthread) IFRATE(pre_tail = kring->rtail); if (unlikely(kring->nm_sync(kring, shadow_ring.flags))) { /* Reenable notifications. */ - ptring_kick_enable(ptring, 1); + pthg_kick_enable(pthg, 1); D("ERROR txsync()"); break; } @@ -320,7 +314,7 @@ ptnetmap_tx_handler(void *data, int is_kthread) * Copy host hwcur and hwtail into the CSB for the guest sync(), and * do the nm_sync_finalize. */ - ptnetmap_host_write_kring_csb(ptring, kring->nr_hwcur, + ptnetmap_host_write_kring_csb(pthg, kring->nr_hwcur, kring->nr_hwtail); if (kring->rtail != kring->nr_hwtail) { /* Some more room available in the parent adapter. */ @@ -337,16 +331,15 @@ ptnetmap_tx_handler(void *data, int is_kthread) #ifndef BUSY_WAIT /* Interrupt the guest if needed. */ - if (more_txspace && ptring_intr_enabled(ptring) && is_kthread) { + if (more_txspace && ptgh_intr_enabled(ptgh) && is_kthread) { /* Disable guest kick to avoid sending unnecessary kicks */ - ptring_intr_enable(ptring, 0); nm_os_kctx_send_irq(kth); IFRATE(ptns->rate_ctx.new.htxk++); more_txspace = false; } #endif /* Read CSB to see if there is more work to do. */ - ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + ptnetmap_host_read_kring_csb(ptgh, &shadow_ring, num_slots); #ifndef BUSY_WAIT if (shadow_ring.head == kring->rhead) { /* @@ -358,13 +351,13 @@ ptnetmap_tx_handler(void *data, int is_kthread) usleep_range(1,1); } /* Reenable notifications. */ - ptring_kick_enable(ptring, 1); + pthg_kick_enable(pthg, 1); /* Doublecheck. */ - ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + ptnetmap_host_read_kring_csb(ptgh, &shadow_ring, num_slots); if (shadow_ring.head != kring->rhead) { /* We won the race condition, there are more packets to * transmit. Disable notifications and do another cycle */ - ptring_kick_enable(ptring, 0); + pthg_kick_enable(pthg, 0); continue; } break; @@ -385,8 +378,7 @@ ptnetmap_tx_handler(void *data, int is_kthread) nm_kr_put(kring); - if (more_txspace && ptring_intr_enabled(ptring) && is_kthread) { - ptring_intr_enable(ptring, 0); + if (more_txspace && ptgh_intr_enabled(ptgh) && is_kthread) { nm_os_kctx_send_irq(kth); IFRATE(ptns->rate_ctx.new.htxk++); } @@ -411,12 +403,12 @@ ptnetmap_tx_nothread_notify(void *data) return; } - /* We cannot access the CSB here (to check ptring->guest_need_kick), + /* We cannot access the CSB here (to check ptgh->guest_need_kick), * unless we switch address space to the one of the guest. For now * we unconditionally inject an interrupt. */ - nm_os_kctx_send_irq(ptns->kctxs[kring->ring_id]); - IFRATE(ptns->rate_ctx.new.htxk++); - ND(1, "%s interrupt", kring->name); + nm_os_kctx_send_irq(ptns->kctxs[kring->ring_id]); + IFRATE(ptns->rate_ctx.new.htxk++); + ND(1, "%s interrupt", kring->name); } /* @@ -440,7 +432,8 @@ ptnetmap_rx_handler(void *data, int is_kthread) struct netmap_pt_host_adapter *pth_na = (struct netmap_pt_host_adapter *)kring->na->na_private; struct ptnetmap_state *ptns = pth_na->ptns; - struct ptnet_ring __user *ptring; + struct ptnet_csb_gh __user *ptgh; + struct ptnet_csb_hg __user *pthg; struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ struct nm_kctx *kth; uint32_t num_slots; @@ -467,18 +460,17 @@ ptnetmap_rx_handler(void *data, int is_kthread) /* This is a guess, to be fixed in the rate callback. */ IFRATE(ptns->rate_ctx.new.grxk++); - /* Get RX ptring pointer from the CSB. */ - ptring = ptns->ptrings + (pth_na->up.num_tx_rings + kring->ring_id); + /* Get RX ptgh and pthg pointers from the CSB. */ + ptgh = ptns->csb_gh + (pth_na->up.num_tx_rings + kring->ring_id); + pthg = ptns->csb_hg + (pth_na->up.num_tx_rings + kring->ring_id); kth = ptns->kctxs[pth_na->up.num_tx_rings + kring->ring_id]; num_slots = kring->nkr_num_slots; - shadow_ring.head = kring->rhead; - shadow_ring.cur = kring->rcur; /* Disable notifications. */ - ptring_kick_enable(ptring, 0); + pthg_kick_enable(pthg, 0); /* Copy the guest kring pointers from the CSB */ - ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + ptnetmap_host_read_kring_csb(ptgh, &shadow_ring, num_slots); for (;;) { uint32_t hwtail; @@ -488,7 +480,7 @@ ptnetmap_rx_handler(void *data, int is_kthread) if (unlikely(nm_rxsync_prologue(kring, &shadow_ring) >= num_slots)) { /* Reinit ring and enable notifications. */ netmap_ring_reinit(kring); - ptring_kick_enable(ptring, 1); + pthg_kick_enable(pthg, 1); break; } @@ -499,7 +491,7 @@ ptnetmap_rx_handler(void *data, int is_kthread) IFRATE(pre_tail = kring->rtail); if (unlikely(kring->nm_sync(kring, shadow_ring.flags))) { /* Reenable notifications. */ - ptring_kick_enable(ptring, 1); + pthg_kick_enable(pthg, 1); D("ERROR rxsync()"); break; } @@ -508,7 +500,7 @@ ptnetmap_rx_handler(void *data, int is_kthread) * Copy host hwcur and hwtail into the CSB for the guest sync() */ hwtail = NM_ACCESS_ONCE(kring->nr_hwtail); - ptnetmap_host_write_kring_csb(ptring, kring->nr_hwcur, hwtail); + ptnetmap_host_write_kring_csb(pthg, kring->nr_hwcur, hwtail); if (kring->rtail != hwtail) { kring->rtail = hwtail; some_recvd = true; @@ -526,16 +518,15 @@ ptnetmap_rx_handler(void *data, int is_kthread) #ifndef BUSY_WAIT /* Interrupt the guest if needed. */ - if (some_recvd && ptring_intr_enabled(ptring)) { + if (some_recvd && ptgh_intr_enabled(ptgh)) { /* Disable guest kick to avoid sending unnecessary kicks */ - ptring_intr_enable(ptring, 0); nm_os_kctx_send_irq(kth); IFRATE(ptns->rate_ctx.new.hrxk++); some_recvd = false; } #endif /* Read CSB to see if there is more work to do. */ - ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + ptnetmap_host_read_kring_csb(ptgh, &shadow_ring, num_slots); #ifndef BUSY_WAIT if (ptnetmap_norxslots(kring, shadow_ring.head)) { /* @@ -545,13 +536,13 @@ ptnetmap_rx_handler(void *data, int is_kthread) */ usleep_range(1,1); /* Reenable notifications. */ - ptring_kick_enable(ptring, 1); + pthg_kick_enable(pthg, 1); /* Doublecheck. */ - ptnetmap_host_read_kring_csb(ptring, &shadow_ring, num_slots); + ptnetmap_host_read_kring_csb(ptgh, &shadow_ring, num_slots); if (!ptnetmap_norxslots(kring, shadow_ring.head)) { /* We won the race condition, more slots are available. Disable * notifications and do another cycle. */ - ptring_kick_enable(ptring, 0); + pthg_kick_enable(pthg, 0); continue; } break; @@ -576,8 +567,7 @@ ptnetmap_rx_handler(void *data, int is_kthread) nm_kr_put(kring); /* Interrupt the guest if needed. */ - if (some_recvd && ptring_intr_enabled(ptring)) { - ptring_intr_enable(ptring, 0); + if (some_recvd && ptgh_intr_enabled(ptgh)) { nm_os_kctx_send_irq(kth); IFRATE(ptns->rate_ctx.new.hrxk++); } @@ -590,8 +580,8 @@ ptnetmap_print_configuration(struct ptnetmap_cfg *cfg) int k; D("ptnetmap configuration:"); - D(" CSB ptrings @%p, num_rings=%u, cfgtype %08x", cfg->ptrings, - cfg->num_rings, cfg->cfgtype); + D(" CSB @%p@:%p, num_rings=%u, cfgtype %08x", cfg->csb_gh, + cfg->csb_hg, cfg->num_rings, cfg->cfgtype); for (k = 0; k < cfg->num_rings; k++) { switch (cfg->cfgtype) { case PTNETMAP_CFGTYPE_QEMU: { @@ -624,16 +614,18 @@ ptnetmap_print_configuration(struct ptnetmap_cfg *cfg) /* Copy actual state of the host ring into the CSB for the guest init */ static int -ptnetmap_kring_snapshot(struct netmap_kring *kring, struct ptnet_ring __user *ptring) +ptnetmap_kring_snapshot(struct netmap_kring *kring, + struct ptnet_csb_gh __user *ptgh, + struct ptnet_csb_hg __user *pthg) { - if (CSB_WRITE(ptring, head, kring->rhead)) + if (CSB_WRITE(ptgh, head, kring->rhead)) goto err; - if (CSB_WRITE(ptring, cur, kring->rcur)) + if (CSB_WRITE(ptgh, cur, kring->rcur)) goto err; - if (CSB_WRITE(ptring, hwcur, kring->nr_hwcur)) + if (CSB_WRITE(pthg, hwcur, kring->nr_hwcur)) goto err; - if (CSB_WRITE(ptring, hwtail, NM_ACCESS_ONCE(kring->nr_hwtail))) + if (CSB_WRITE(pthg, hwtail, NM_ACCESS_ONCE(kring->nr_hwtail))) goto err; DBG(ptnetmap_kring_dump("ptnetmap_kring_snapshot", kring);) @@ -665,7 +657,8 @@ ptnetmap_krings_snapshot(struct netmap_pt_host_adapter for (k = 0; k < num_rings; k++) { kring = ptnetmap_kring(pth_na, k); - err |= ptnetmap_kring_snapshot(kring, ptns->ptrings + k); + err |= ptnetmap_kring_snapshot(kring, ptns->csb_gh + k, + ptns->csb_hg + k); } return err; @@ -842,7 +835,8 @@ ptnetmap_create(struct netmap_pt_host_adapter *pth_na, ptns->pth_na = pth_na; /* Store the CSB address provided by the hypervisor. */ - ptns->ptrings = cfg->ptrings; + ptns->csb_gh = cfg->csb_gh; + ptns->csb_hg = cfg->csb_hg; DBG(ptnetmap_print_configuration(cfg)); @@ -1321,26 +1315,26 @@ put_out_noputparent: * block (no space in the ring). */ bool -netmap_pt_guest_txsync(struct ptnet_ring *ptring, struct netmap_kring *kring, - int flags) +netmap_pt_guest_txsync(struct ptnet_csb_gh *ptgh, struct ptnet_csb_hg *pthg, + struct netmap_kring *kring, int flags) { bool notify = false; /* Disable notifications */ - ptring->guest_need_kick = 0; + ptgh->guest_need_kick = 0; /* * First part: tell the host (updating the CSB) to process the new * packets. */ - kring->nr_hwcur = ptring->hwcur; - ptnetmap_guest_write_kring_csb(ptring, kring->rcur, kring->rhead); + kring->nr_hwcur = pthg->hwcur; + ptnetmap_guest_write_kring_csb(ptgh, kring->rcur, kring->rhead); /* Ask for a kick from a guest to the host if needed. */ if (((kring->rhead != kring->nr_hwcur || nm_kr_txempty(kring)) - && NM_ACCESS_ONCE(ptring->host_need_kick)) || + && NM_ACCESS_ONCE(pthg->host_need_kick)) || (flags & NAF_FORCE_RECLAIM)) { - ptring->sync_flags = flags; + ptgh->sync_flags = flags; notify = true; } @@ -1348,7 +1342,7 @@ netmap_pt_guest_txsync(struct ptnet_ring *ptring, stru * Second part: reclaim buffers for completed transmissions. */ if (nm_kr_txempty(kring) || (flags & NAF_FORCE_RECLAIM)) { - ptnetmap_guest_read_kring_csb(ptring, kring); + ptnetmap_guest_read_kring_csb(pthg, kring); } /* @@ -1358,17 +1352,17 @@ netmap_pt_guest_txsync(struct ptnet_ring *ptring, stru */ if (nm_kr_txempty(kring)) { /* Reenable notifications. */ - ptring->guest_need_kick = 1; + ptgh->guest_need_kick = 1; /* Double check */ - ptnetmap_guest_read_kring_csb(ptring, kring); + ptnetmap_guest_read_kring_csb(pthg, kring); /* If there is new free space, disable notifications */ if (unlikely(!nm_kr_txempty(kring))) { - ptring->guest_need_kick = 0; + ptgh->guest_need_kick = 0; } } ND(1, "%s CSB(head:%u cur:%u hwtail:%u) KRING(head:%u cur:%u tail:%u)", - kring->name, ptring->head, ptring->cur, ptring->hwtail, + kring->name, ptgh->head, ptgh->cur, pthg->hwtail, kring->rhead, kring->rcur, kring->nr_hwtail); return notify; @@ -1386,20 +1380,20 @@ netmap_pt_guest_txsync(struct ptnet_ring *ptring, stru * block (no more completed slots in the ring). */ bool -netmap_pt_guest_rxsync(struct ptnet_ring *ptring, struct netmap_kring *kring, - int flags) +netmap_pt_guest_rxsync(struct ptnet_csb_gh *ptgh, struct ptnet_csb_hg *pthg, + struct netmap_kring *kring, int flags) { bool notify = false; /* Disable notifications */ - ptring->guest_need_kick = 0; + ptgh->guest_need_kick = 0; /* * First part: import newly received packets, by updating the kring * hwtail to the hwtail known from the host (read from the CSB). * This also updates the kring hwcur. */ - ptnetmap_guest_read_kring_csb(ptring, kring); + ptnetmap_guest_read_kring_csb(pthg, kring); kring->nr_kflags &= ~NKR_PENDINTR; /* @@ -1407,11 +1401,11 @@ netmap_pt_guest_rxsync(struct ptnet_ring *ptring, stru * released, by updating cur and head in the CSB. */ if (kring->rhead != kring->nr_hwcur) { - ptnetmap_guest_write_kring_csb(ptring, kring->rcur, + ptnetmap_guest_write_kring_csb(ptgh, kring->rcur, kring->rhead); /* Ask for a kick from the guest to the host if needed. */ - if (NM_ACCESS_ONCE(ptring->host_need_kick)) { - ptring->sync_flags = flags; + if (NM_ACCESS_ONCE(pthg->host_need_kick)) { + ptgh->sync_flags = flags; notify = true; } } @@ -1423,17 +1417,17 @@ netmap_pt_guest_rxsync(struct ptnet_ring *ptring, stru */ if (nm_kr_rxempty(kring)) { /* Reenable notifications. */ - ptring->guest_need_kick = 1; + ptgh->guest_need_kick = 1; /* Double check */ - ptnetmap_guest_read_kring_csb(ptring, kring); + ptnetmap_guest_read_kring_csb(pthg, kring); /* If there are new slots, disable notifications. */ if (!nm_kr_rxempty(kring)) { - ptring->guest_need_kick = 0; + ptgh->guest_need_kick = 0; } } ND(1, "%s CSB(head:%u cur:%u hwtail:%u) KRING(head:%u cur:%u tail:%u)", - kring->name, ptring->head, ptring->cur, ptring->hwtail, + kring->name, ptgh->head, ptgh->cur, pthg->hwtail, kring->rhead, kring->rcur, kring->nr_hwtail); return notify; @@ -1492,13 +1486,13 @@ ptnet_nm_dtor(struct netmap_adapter *na) struct netmap_pt_guest_adapter *ptna = (struct netmap_pt_guest_adapter *)na; - netmap_mem_put(ptna->dr.up.nm_mem); // XXX is this needed? + netmap_mem_put(ptna->dr.up.nm_mem); memset(&ptna->dr, 0, sizeof(ptna->dr)); netmap_mem_pt_guest_ifp_del(na->nm_mem, na->ifp); } int -netmap_pt_guest_attach(struct netmap_adapter *arg, void *csb, +netmap_pt_guest_attach(struct netmap_adapter *arg, unsigned int nifp_offset, unsigned int memid) { struct netmap_pt_guest_adapter *ptna; @@ -1516,7 +1510,6 @@ netmap_pt_guest_attach(struct netmap_adapter *arg, voi /* get the netmap_pt_guest_adapter */ ptna = (struct netmap_pt_guest_adapter *) NA(ifp); - ptna->csb = csb; /* Initialize a separate pass-through netmap adapter that is going to * be used by the ptnet driver only, and so never exposed to netmap Modified: head/sys/net/netmap_virt.h ============================================================================== --- head/sys/net/netmap_virt.h Wed Apr 4 21:19:33 2018 (r332046) +++ head/sys/net/netmap_virt.h Wed Apr 4 21:31:12 2018 (r332047) @@ -85,7 +85,8 @@ struct ptnetmap_cfg { uint16_t cfgtype; /* how to interpret the cfg entries */ uint16_t entry_size; /* size of a config entry */ uint32_t num_rings; /* number of config entries */ - void *ptrings; /* ptrings inside CSB */ + void *csb_gh; /* CSB for guest --> host communication */ + void *csb_hg; /* CSB for host --> guest communication */ /* Configuration entries are allocated right after the struct. */ }; @@ -146,8 +147,8 @@ nmreq_pointer_put(struct nmreq *nmr, void *userptr) #define PTNET_IO_PTCTL 4 #define PTNET_IO_MAC_LO 8 #define PTNET_IO_MAC_HI 12 -#define PTNET_IO_CSBBAH 16 -#define PTNET_IO_CSBBAL 20 +#define PTNET_IO_CSBBAH 16 /* deprecated */ +#define PTNET_IO_CSBBAL 20 /* deprecated */ #define PTNET_IO_NIFP_OFS 24 #define PTNET_IO_NUM_TX_RINGS 28 #define PTNET_IO_NUM_RX_RINGS 32 @@ -155,7 +156,11 @@ nmreq_pointer_put(struct nmreq *nmr, void *userptr) #define PTNET_IO_NUM_RX_SLOTS 40 #define PTNET_IO_VNET_HDR_LEN 44 #define PTNET_IO_HOSTMEMID 48 -#define PTNET_IO_END 52 +#define PTNET_IO_CSB_GH_BAH 52 +#define PTNET_IO_CSB_GH_BAL 56 +#define PTNET_IO_CSB_HG_BAH 60 +#define PTNET_IO_CSB_HG_BAL 64 +#define PTNET_IO_END 68 #define PTNET_IO_KICK_BASE 128 #define PTNET_IO_MASK 0xff @@ -163,28 +168,21 @@ nmreq_pointer_put(struct nmreq *nmr, void *userptr) #define PTNETMAP_PTCTL_CREATE 1 #define PTNETMAP_PTCTL_DELETE 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 4 22:45:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E71F7CC5B; Wed, 4 Apr 2018 22:45:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3F877EE9; Wed, 4 Apr 2018 22:45:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31E8C1A117; Wed, 4 Apr 2018 22:45:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34Mj9vJ020159; Wed, 4 Apr 2018 22:45:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34Mj8o1020153; Wed, 4 Apr 2018 22:45:08 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804042245.w34Mj8o1020153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 4 Apr 2018 22:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332048 - in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys riscv/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys riscv/sys X-SVN-Commit-Revision: 332048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 22:45:09 -0000 Author: brooks Date: Wed Apr 4 22:45:08 2018 New Revision: 332048 URL: https://svnweb.freebsd.org/changeset/base/332048 Log: Remove architecture specific sigreturn.S files. All of these files are identical (modulo license blocks and VCS IDs) to the files generated by lib/libc/sys/Makefile.inc and serve no purpose. Reported by: Ali Mashtizadeh Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14953 Deleted: head/lib/libc/aarch64/sys/sigreturn.S head/lib/libc/amd64/sys/sigreturn.S head/lib/libc/arm/sys/sigreturn.S head/lib/libc/i386/sys/sigreturn.S head/lib/libc/riscv/sys/sigreturn.S Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Wed Apr 4 21:31:12 2018 (r332047) +++ head/lib/libc/aarch64/sys/Makefile.inc Wed Apr 4 22:45:08 2018 (r332048) @@ -6,7 +6,6 @@ SRCS+= __vdso_gettc.c MDASM= cerror.S \ shmat.S \ - sigreturn.S \ syscall.S \ vfork.S Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Wed Apr 4 21:31:12 2018 (r332047) +++ head/lib/libc/amd64/sys/Makefile.inc Wed Apr 4 22:45:08 2018 (r332048) @@ -9,7 +9,7 @@ SRCS+= \ amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S sigreturn.S + sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Wed Apr 4 21:31:12 2018 (r332047) +++ head/lib/libc/arm/sys/Makefile.inc Wed Apr 4 22:45:08 2018 (r332048) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Wed Apr 4 21:31:12 2018 (r332047) +++ head/lib/libc/i386/sys/Makefile.inc Wed Apr 4 22:45:08 2018 (r332048) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_io i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S sigreturn.S syscall.S + sbrk.S setlogin.S syscall.S NOASM+= vfork.o Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Wed Apr 4 21:31:12 2018 (r332047) +++ head/lib/libc/riscv/sys/Makefile.inc Wed Apr 4 22:45:08 2018 (r332048) @@ -5,7 +5,6 @@ SRCS+= trivial-vdso_tc.c #MDASM= ptrace.S MDASM= cerror.S \ shmat.S \ - sigreturn.S \ syscall.S \ vfork.S From owner-svn-src-all@freebsd.org Wed Apr 4 22:46:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470DCF7CE43; Wed, 4 Apr 2018 22:46:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2105780B8; Wed, 4 Apr 2018 22:46:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED0AA1A121; Wed, 4 Apr 2018 22:46:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34MkUqu020656; Wed, 4 Apr 2018 22:46:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34MkUYB020655; Wed, 4 Apr 2018 22:46:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804042246.w34MkUYB020655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 4 Apr 2018 22:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332049 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 22:46:31 -0000 Author: brooks Date: Wed Apr 4 22:46:30 2018 New Revision: 332049 URL: https://svnweb.freebsd.org/changeset/base/332049 Log: Allow -DNO_CLEAN builds over r332048. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Apr 4 22:45:08 2018 (r332048) +++ head/Makefile.inc1 Wed Apr 4 22:46:30 2018 (r332049) @@ -802,11 +802,12 @@ _sanity_check: .PHONY .MAKE # tree changes, particularly with respect to removing source files and # replacing generated files. Handle these cases here in an ad-hoc fashion. _cleanobj_fast_depend_hack: .PHONY -# Syscall stubs rewritten in C +# Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls # 20160829 r305012 ptrace # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs -.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace statfs +# 20180404 r332048 sigreturn +.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-all@freebsd.org Wed Apr 4 22:52:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A351DF7D489; Wed, 4 Apr 2018 22:52:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56F6978673; Wed, 4 Apr 2018 22:52:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5181E1A2A8; Wed, 4 Apr 2018 22:52:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34MqOOm026644; Wed, 4 Apr 2018 22:52:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34MqOx5026643; Wed, 4 Apr 2018 22:52:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804042252.w34MqOx5026643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 4 Apr 2018 22:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332050 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 332050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 22:52:24 -0000 Author: np Date: Wed Apr 4 22:52:24 2018 New Revision: 332050 URL: https://svnweb.freebsd.org/changeset/base/332050 Log: cxgbe(4): Always display an error message if SIOCSIFFLAGS will leave IFF_UP and IFF_DRV_RUNNING out of sync. ifhwioctl in the kernel pays no attention to the return code from the driver ioctl during SIOCSIFFLAGS so these messages are the only indication that the ioctl was called but failed. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Apr 4 22:46:30 2018 (r332049) +++ head/sys/dev/cxgbe/t4_main.c Wed Apr 4 22:52:24 2018 (r332050) @@ -1636,8 +1636,13 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd redo_sifflags: rc = begin_synchronized_op(sc, vi, can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg"); - if (rc) + if (rc) { + if_printf(ifp, "%ssleepable synch operation failed: %d." + " if_flags 0x%08x, if_drv_flags 0x%08x\n", + can_sleep ? "" : "non-", rc, ifp->if_flags, + ifp->if_drv_flags); return (rc); + } if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { @@ -4306,8 +4311,13 @@ cxgbe_uninit_synchronized(struct vi_info *vi) ASSERT_SYNCHRONIZED_OP(sc); if (!(vi->flags & VI_INIT_DONE)) { - KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING), - ("uninited VI is running")); + if (__predict_false(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + KASSERT(0, ("uninited VI is running")); + if_printf(ifp, "uninited VI with running ifnet. " + "vi->flags 0x%016lx, if_flags 0x%08x, " + "if_drv_flags 0x%08x\n", vi->flags, ifp->if_flags, + ifp->if_drv_flags); + } return (0); } From owner-svn-src-all@freebsd.org Wed Apr 4 23:30:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 539E4F7FA22; Wed, 4 Apr 2018 23:30:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0610279E98; Wed, 4 Apr 2018 23:30:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00FE11A7AF; Wed, 4 Apr 2018 23:30:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34NUJhN053515; Wed, 4 Apr 2018 23:30:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34NUJHV053514; Wed, 4 Apr 2018 23:30:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804042330.w34NUJHV053514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 4 Apr 2018 23:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332051 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 332051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 23:30:20 -0000 Author: kevans Date: Wed Apr 4 23:30:19 2018 New Revision: 332051 URL: https://svnweb.freebsd.org/changeset/base/332051 Log: Record-only MFC of r325365, r325564 r325365 fixed a bug in patch(1) that would cause a match if we ran out of context, say, at the beginning/end of a file. r325564 reverted it at the request of antoine until an exp-run could be completed to fix all of the ports with broken patches. r325365 was later committed as r326084, which has already been MFC'd. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Wed Apr 4 23:53:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1A0BF810A8; Wed, 4 Apr 2018 23:53:30 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EAD87ACD7; Wed, 4 Apr 2018 23:53:30 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86B351AC7A; Wed, 4 Apr 2018 23:53:30 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34NrUAT075217; Wed, 4 Apr 2018 23:53:30 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34NrTxq075208; Wed, 4 Apr 2018 23:53:29 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201804042353.w34NrTxq075208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 4 Apr 2018 23:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332052 - stable/11/sys/dev/qlxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/11/sys/dev/qlxgbe X-SVN-Commit-Revision: 332052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 23:53:31 -0000 Author: davidcs Date: Wed Apr 4 23:53:29 2018 New Revision: 332052 URL: https://svnweb.freebsd.org/changeset/base/332052 Log: MFC r331739 1. Add additional debug prints. 2. Break transmit when IFF_DRV_RUNNING is OFF. 3. set desc_count=0 for default case in switch in ql_rcv_isr() Modified: stable/11/sys/dev/qlxgbe/ql_dbg.h stable/11/sys/dev/qlxgbe/ql_hw.c stable/11/sys/dev/qlxgbe/ql_ioctl.c stable/11/sys/dev/qlxgbe/ql_isr.c stable/11/sys/dev/qlxgbe/ql_os.c stable/11/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_dbg.h ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_dbg.h Wed Apr 4 23:30:19 2018 (r332051) +++ stable/11/sys/dev/qlxgbe/ql_dbg.h Wed Apr 4 23:53:29 2018 (r332052) @@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char * #define INJCT_SGL_RCV_INV_DESC_COUNT 0x0000D #define INJCT_SGL_LRO_INV_DESC_COUNT 0x0000E #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY 0x0000F +#define INJCT_TXBUF_MBUF_NON_NULL 0x00010 #ifdef QL_DBG Modified: stable/11/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:30:19 2018 (r332051) +++ stable/11/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:53:29 2018 (r332052) @@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 8: mbx: mailbox command failure\n" "\t\t\t 9: heartbeat failure\n" "\t\t\t A: temperature failure\n" - "\t\t\t 11: m_getcl or m_getjcl failure\n" ); + "\t\t\t 11: m_getcl or m_getjcl failure\n" + "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n" + "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n" + "\t\t\t 15: peer port error recovery failure\n" + "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2904,7 +2908,7 @@ ql_del_hw_if_exit: void qla_confirm_9kb_enable(qla_host_t *ha) { - uint32_t supports_9kb = 0; +// uint32_t supports_9kb = 0; ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX); @@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha) WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2); WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0); +#if 0 qla_get_nic_partition(ha, &supports_9kb, NULL); if (!supports_9kb) - ha->hw.enable_9kb = 0; +#endif + ha->hw.enable_9kb = 0; return; } @@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast) bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN); mcast = mcast + ETHER_ADDR_LEN; count++; + + device_printf(ha->pci_dev, + "%s: %x:%x:%x:%x:%x:%x \n", + __func__, ha->hw.mcast[i].addr[0], + ha->hw.mcast[i].addr[1], ha->hw.mcast[i].addr[2], + ha->hw.mcast[i].addr[3], ha->hw.mcast[i].addr[4], + ha->hw.mcast[i].addr[5]); if (count == Q8_MAX_MAC_ADDRS) { if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr, @@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx) } hw_tx_cntxt->txr_free += comp_count; + + if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS) + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d" + "txr_next = %d txr_comp = %d\n", __func__, __LINE__, + txr_idx, hw_tx_cntxt->txr_free, + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp); + + QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \ + ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = %d\n",\ + __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \ + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp)); + return; } @@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha) if (err) { device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); - } + } else { + device_printf(dev, "%s: successful\n", __func__); + } return 0; } Modified: stable/11/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:30:19 2018 (r332051) +++ stable/11/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:53:29 2018 (r332052) @@ -267,7 +267,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } } else { - if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) { +#define QLA_LOCK_MDUMP_MS_TIMEOUT (QLA_LOCK_DEFAULT_MS_TIMEOUT * 5) + if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) { if (!ha->hw.mdump_done) { fw_dump->saved = 0; QL_INITIATE_RECOVERY(ha); @@ -301,7 +302,7 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } fw_dump->usec_ts = ha->hw.mdump_usec_ts; - if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) { + if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) { ha->hw.mdump_done = 0; QLA_UNLOCK(ha, __func__); } else { Modified: stable/11/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_isr.c Wed Apr 4 23:30:19 2018 (r332051) +++ stable/11/sys/dev/qlxgbe/ql_isr.c Wed Apr 4 23:53:29 2018 (r332052) @@ -701,6 +701,7 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t break; default: + desc_count = 0; device_printf(dev, "%s: default 0x%llx!\n", __func__, (long long unsigned int)sdesc->data[0]); break; Modified: stable/11/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_os.c Wed Apr 4 23:30:19 2018 (r332051) +++ stable/11/sys/dev/qlxgbe/ql_os.c Wed Apr 4 23:53:29 2018 (r332052) @@ -1287,13 +1287,20 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; - if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + if ((NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) || + (QL_ERR_INJECT(ha, INJCT_TXBUF_MBUF_NON_NULL))){ QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\ "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\ ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d " + "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx, + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head); + if (m_head) m_freem(m_head); *m_headp = NULL; + QL_INITIATE_RECOVERY(ha); return (ret); } @@ -1426,8 +1433,8 @@ qla_fp_taskqueue(void *context, int pending) qla_tx_fp_t *fp; qla_host_t *ha; struct ifnet *ifp; - struct mbuf *mp; - int ret; + struct mbuf *mp = NULL; + int ret = 0; uint32_t txr_idx; uint32_t iscsi_pdu = 0; uint32_t rx_pkts_left = -1; @@ -1451,7 +1458,7 @@ qla_fp_taskqueue(void *context, int pending) } while (rx_pkts_left && !ha->stop_rcv && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) && ha->hw.link_up) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1496,13 +1503,18 @@ qla_fp_taskqueue(void *context, int pending) /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, mp); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + + if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || + (!ha->hw.link_up)) break; mp = drbr_peek(ifp, fp->tx_br); } } mtx_unlock(&fp->tx_mtx); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto qla_fp_taskqueue_exit; qla_fp_taskqueue_exit0: Modified: stable/11/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/11/sys/dev/qlxgbe/ql_ver.h Wed Apr 4 23:30:19 2018 (r332051) +++ stable/11/sys/dev/qlxgbe/ql_ver.h Wed Apr 4 23:53:29 2018 (r332052) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 36 +#define QLA_VERSION_BUILD 37 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Wed Apr 4 23:58:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41E46F816B7; Wed, 4 Apr 2018 23:58:37 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E199A7AFD5; Wed, 4 Apr 2018 23:58:36 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAC181AC7E; Wed, 4 Apr 2018 23:58:36 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w34NwaoI076979; Wed, 4 Apr 2018 23:58:36 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w34NwaxA076970; Wed, 4 Apr 2018 23:58:36 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201804042358.w34NwaxA076970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 4 Apr 2018 23:58: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: r332053 - stable/10/sys/dev/qlxgbe X-SVN-Group: stable-10 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/10/sys/dev/qlxgbe X-SVN-Commit-Revision: 332053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Apr 2018 23:58:37 -0000 Author: davidcs Date: Wed Apr 4 23:58:35 2018 New Revision: 332053 URL: https://svnweb.freebsd.org/changeset/base/332053 Log: MFC r331739 1. Add additional debug prints. 2. Break transmit when IFF_DRV_RUNNING is OFF. 3. set desc_count=0 for default case in switch in ql_rcv_isr() Modified: stable/10/sys/dev/qlxgbe/ql_dbg.h stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_ioctl.c stable/10/sys/dev/qlxgbe/ql_isr.c stable/10/sys/dev/qlxgbe/ql_os.c stable/10/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_dbg.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_dbg.h Wed Apr 4 23:53:29 2018 (r332052) +++ stable/10/sys/dev/qlxgbe/ql_dbg.h Wed Apr 4 23:58:35 2018 (r332053) @@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char * #define INJCT_SGL_RCV_INV_DESC_COUNT 0x0000D #define INJCT_SGL_LRO_INV_DESC_COUNT 0x0000E #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY 0x0000F +#define INJCT_TXBUF_MBUF_NON_NULL 0x00010 #ifdef QL_DBG Modified: stable/10/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:53:29 2018 (r332052) +++ stable/10/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:58:35 2018 (r332053) @@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 8: mbx: mailbox command failure\n" "\t\t\t 9: heartbeat failure\n" "\t\t\t A: temperature failure\n" - "\t\t\t 11: m_getcl or m_getjcl failure\n" ); + "\t\t\t 11: m_getcl or m_getjcl failure\n" + "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n" + "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n" + "\t\t\t 15: peer port error recovery failure\n" + "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2904,7 +2908,7 @@ ql_del_hw_if_exit: void qla_confirm_9kb_enable(qla_host_t *ha) { - uint32_t supports_9kb = 0; +// uint32_t supports_9kb = 0; ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX); @@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha) WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2); WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0); +#if 0 qla_get_nic_partition(ha, &supports_9kb, NULL); if (!supports_9kb) - ha->hw.enable_9kb = 0; +#endif + ha->hw.enable_9kb = 0; return; } @@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast) bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN); mcast = mcast + ETHER_ADDR_LEN; count++; + + device_printf(ha->pci_dev, + "%s: %x:%x:%x:%x:%x:%x \n", + __func__, ha->hw.mcast[i].addr[0], + ha->hw.mcast[i].addr[1], ha->hw.mcast[i].addr[2], + ha->hw.mcast[i].addr[3], ha->hw.mcast[i].addr[4], + ha->hw.mcast[i].addr[5]); if (count == Q8_MAX_MAC_ADDRS) { if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr, @@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx) } hw_tx_cntxt->txr_free += comp_count; + + if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS) + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d" + "txr_next = %d txr_comp = %d\n", __func__, __LINE__, + txr_idx, hw_tx_cntxt->txr_free, + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp); + + QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \ + ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = %d\n",\ + __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \ + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp)); + return; } @@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha) if (err) { device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); - } + } else { + device_printf(dev, "%s: successful\n", __func__); + } return 0; } Modified: stable/10/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:53:29 2018 (r332052) +++ stable/10/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:58:35 2018 (r332053) @@ -267,7 +267,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } } else { - if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) { +#define QLA_LOCK_MDUMP_MS_TIMEOUT (QLA_LOCK_DEFAULT_MS_TIMEOUT * 5) + if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) { if (!ha->hw.mdump_done) { fw_dump->saved = 0; QL_INITIATE_RECOVERY(ha); @@ -301,7 +302,7 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } fw_dump->usec_ts = ha->hw.mdump_usec_ts; - if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) { + if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) { ha->hw.mdump_done = 0; QLA_UNLOCK(ha, __func__); } else { Modified: stable/10/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_isr.c Wed Apr 4 23:53:29 2018 (r332052) +++ stable/10/sys/dev/qlxgbe/ql_isr.c Wed Apr 4 23:58:35 2018 (r332053) @@ -702,6 +702,7 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t break; default: + desc_count = 0; device_printf(dev, "%s: default 0x%llx!\n", __func__, (long long unsigned int)sdesc->data[0]); break; Modified: stable/10/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_os.c Wed Apr 4 23:53:29 2018 (r332052) +++ stable/10/sys/dev/qlxgbe/ql_os.c Wed Apr 4 23:58:35 2018 (r332053) @@ -1292,13 +1292,20 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; - if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + if ((NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) || + (QL_ERR_INJECT(ha, INJCT_TXBUF_MBUF_NON_NULL))){ QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\ "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\ ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d " + "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx, + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head); + if (m_head) m_freem(m_head); *m_headp = NULL; + QL_INITIATE_RECOVERY(ha); return (ret); } @@ -1431,8 +1438,8 @@ qla_fp_taskqueue(void *context, int pending) qla_tx_fp_t *fp; qla_host_t *ha; struct ifnet *ifp; - struct mbuf *mp; - int ret; + struct mbuf *mp = NULL; + int ret = 0; uint32_t txr_idx; uint32_t iscsi_pdu = 0; uint32_t rx_pkts_left = -1; @@ -1456,7 +1463,7 @@ qla_fp_taskqueue(void *context, int pending) } while (rx_pkts_left && !ha->stop_rcv && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) && ha->hw.link_up) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1501,13 +1508,18 @@ qla_fp_taskqueue(void *context, int pending) /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, mp); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + + if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || + (!ha->hw.link_up)) break; mp = drbr_peek(ifp, fp->tx_br); } } mtx_unlock(&fp->tx_mtx); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto qla_fp_taskqueue_exit; qla_fp_taskqueue_exit0: Modified: stable/10/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_ver.h Wed Apr 4 23:53:29 2018 (r332052) +++ stable/10/sys/dev/qlxgbe/ql_ver.h Wed Apr 4 23:58:35 2018 (r332053) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 36 +#define QLA_VERSION_BUILD 37 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Thu Apr 5 00:03:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA5F1F81C2E; Thu, 5 Apr 2018 00:03:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A9CC7B5E7; Thu, 5 Apr 2018 00:03:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64F981AE2C; Thu, 5 Apr 2018 00:03:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3503d70083657; Thu, 5 Apr 2018 00:03:39 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3503cNA083648; Thu, 5 Apr 2018 00:03:38 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201804050003.w3503cNA083648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 5 Apr 2018 00:03:38 +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: r332054 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/9/sys/dev/qlxgbe X-SVN-Commit-Revision: 332054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 00:03:40 -0000 Author: davidcs Date: Thu Apr 5 00:03:38 2018 New Revision: 332054 URL: https://svnweb.freebsd.org/changeset/base/332054 Log: MFC r331739 1. Add additional debug prints. 2. Break transmit when IFF_DRV_RUNNING is OFF. 3. set desc_count=0 for default case in switch in ql_rcv_isr() Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_dbg.h Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_dbg.h Thu Apr 5 00:03:38 2018 (r332054) @@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char * #define INJCT_SGL_RCV_INV_DESC_COUNT 0x0000D #define INJCT_SGL_LRO_INV_DESC_COUNT 0x0000E #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY 0x0000F +#define INJCT_TXBUF_MBUF_NON_NULL 0x00010 #ifdef QL_DBG Modified: stable/9/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Apr 5 00:03:38 2018 (r332054) @@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 8: mbx: mailbox command failure\n" "\t\t\t 9: heartbeat failure\n" "\t\t\t A: temperature failure\n" - "\t\t\t 11: m_getcl or m_getjcl failure\n" ); + "\t\t\t 11: m_getcl or m_getjcl failure\n" + "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n" + "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n" + "\t\t\t 15: peer port error recovery failure\n" + "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2904,7 +2908,7 @@ ql_del_hw_if_exit: void qla_confirm_9kb_enable(qla_host_t *ha) { - uint32_t supports_9kb = 0; +// uint32_t supports_9kb = 0; ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX); @@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha) WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2); WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0); +#if 0 qla_get_nic_partition(ha, &supports_9kb, NULL); if (!supports_9kb) - ha->hw.enable_9kb = 0; +#endif + ha->hw.enable_9kb = 0; return; } @@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast) bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN); mcast = mcast + ETHER_ADDR_LEN; count++; + + device_printf(ha->pci_dev, + "%s: %x:%x:%x:%x:%x:%x \n", + __func__, ha->hw.mcast[i].addr[0], + ha->hw.mcast[i].addr[1], ha->hw.mcast[i].addr[2], + ha->hw.mcast[i].addr[3], ha->hw.mcast[i].addr[4], + ha->hw.mcast[i].addr[5]); if (count == Q8_MAX_MAC_ADDRS) { if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr, @@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx) } hw_tx_cntxt->txr_free += comp_count; + + if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS) + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d" + "txr_next = %d txr_comp = %d\n", __func__, __LINE__, + txr_idx, hw_tx_cntxt->txr_free, + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp); + + QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \ + ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = %d\n",\ + __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \ + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp)); + return; } @@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha) if (err) { device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); - } + } else { + device_printf(dev, "%s: successful\n", __func__); + } return 0; } Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_ioctl.c Thu Apr 5 00:03:38 2018 (r332054) @@ -267,7 +267,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } } else { - if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) { +#define QLA_LOCK_MDUMP_MS_TIMEOUT (QLA_LOCK_DEFAULT_MS_TIMEOUT * 5) + if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) { if (!ha->hw.mdump_done) { fw_dump->saved = 0; QL_INITIATE_RECOVERY(ha); @@ -301,7 +302,7 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } fw_dump->usec_ts = ha->hw.mdump_usec_ts; - if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) { + if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) { ha->hw.mdump_done = 0; QLA_UNLOCK(ha, __func__); } else { Modified: stable/9/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_isr.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_isr.c Thu Apr 5 00:03:38 2018 (r332054) @@ -703,6 +703,7 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t break; default: + desc_count = 0; device_printf(dev, "%s: default 0x%llx!\n", __func__, (long long unsigned int)sdesc->data[0]); break; Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_os.c Thu Apr 5 00:03:38 2018 (r332054) @@ -1308,13 +1308,20 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; - if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + if ((NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) || + (QL_ERR_INJECT(ha, INJCT_TXBUF_MBUF_NON_NULL))){ QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\ "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\ ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d " + "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx, + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head); + if (m_head) m_freem(m_head); *m_headp = NULL; + QL_INITIATE_RECOVERY(ha); return (ret); } @@ -1472,7 +1479,7 @@ qla_fp_taskqueue(void *context, int pending) } while (rx_pkts_left && !ha->stop_rcv && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) && ha->hw.link_up) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1517,13 +1524,18 @@ qla_fp_taskqueue(void *context, int pending) /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, mp); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + + if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || + (!ha->hw.link_up)) break; mp = drbr_peek(ifp, fp->tx_br); } } mtx_unlock(&fp->tx_mtx); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto qla_fp_taskqueue_exit; qla_fp_taskqueue_exit0: Modified: stable/9/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ver.h Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_ver.h Thu Apr 5 00:03:38 2018 (r332054) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 36 +#define QLA_VERSION_BUILD 37 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Thu Apr 5 00:32:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D128F83567; Thu, 5 Apr 2018 00:32:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B70727C4E8; Thu, 5 Apr 2018 00:32:01 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1DF71B2D0; Thu, 5 Apr 2018 00:32:01 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w350W1n6005994; Thu, 5 Apr 2018 00:32:01 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w350W196005991; Thu, 5 Apr 2018 00:32:01 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804050032.w350W196005991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 5 Apr 2018 00:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332055 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 332055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 00:32:02 -0000 Author: mckusick Date: Thu Apr 5 00:32:01 2018 New Revision: 332055 URL: https://svnweb.freebsd.org/changeset/base/332055 Log: Renumber soft-update types starting at 1 instead of 0 to avoid confusion of zero'ed memory appearing to have a valid soft-update type. Also correct some comments. Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Apr 5 00:03:38 2018 (r332054) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Apr 5 00:32:01 2018 (r332055) @@ -688,6 +688,7 @@ static MALLOC_DEFINE(M_MOUNTDATA, "softdep", "Softdep * MUST match the defines above, such that memtype[D_XXX] == M_XXX */ static struct malloc_type *memtype[] = { + NULL, M_PAGEDEP, M_INODEDEP, M_BMSAFEMAP, @@ -724,7 +725,8 @@ static struct malloc_type *memtype[] = { * Names of malloc types. */ #define TYPENAME(type) \ - ((unsigned)(type) <= D_LAST ? memtype[type]->ks_shortdesc : "???") + ((unsigned)(type) <= D_LAST && (unsigned)(type) >= D_FIRST ? \ + memtype[type]->ks_shortdesc : "???") /* * End system adaptation definitions. */ @@ -12960,7 +12962,7 @@ flush_newblk_dep(vp, mp, lbn) break; } if (newblk->nb_list.wk_type != D_ALLOCDIRECT) - panic("flush_newblk_deps: Bad newblk %p", newblk); + panic("flush_newblk_dep: Bad newblk %p", newblk); /* * Flush the journal. */ Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Thu Apr 5 00:03:38 2018 (r332054) +++ head/sys/ufs/ffs/softdep.h Thu Apr 5 00:32:01 2018 (r332055) @@ -146,37 +146,45 @@ #define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE) +#define PRINT_SOFTDEP_FLAGS "\20\27writesucceeded\26unlinkonlist" \ + "\25unlinkprev\24unlinknext\23unlinked\22ondeplist\21iowaiting" \ + "\20onworklist\17extdata\16ufs1fmt\15inprogress\14newblock" \ + "\13delayedfree\12iostarted\11goingaway\10dirchg\7rmdir\6mkdir_body" \ + "\5mkdir_parent\4depcomplete\3complete\2undone\1attached" + /* * Values for each of the soft dependency types. */ -#define D_PAGEDEP 0 -#define D_INODEDEP 1 -#define D_BMSAFEMAP 2 -#define D_NEWBLK 3 -#define D_ALLOCDIRECT 4 -#define D_INDIRDEP 5 -#define D_ALLOCINDIR 6 -#define D_FREEFRAG 7 -#define D_FREEBLKS 8 -#define D_FREEFILE 9 -#define D_DIRADD 10 -#define D_MKDIR 11 -#define D_DIRREM 12 -#define D_NEWDIRBLK 13 -#define D_FREEWORK 14 -#define D_FREEDEP 15 -#define D_JADDREF 16 -#define D_JREMREF 17 -#define D_JMVREF 18 -#define D_JNEWBLK 19 -#define D_JFREEBLK 20 -#define D_JFREEFRAG 21 -#define D_JSEG 22 -#define D_JSEGDEP 23 -#define D_SBDEP 24 -#define D_JTRUNC 25 -#define D_JFSYNC 26 -#define D_SENTINEL 27 +#define D_UNUSED 0 +#define D_FIRST D_PAGEDEP +#define D_PAGEDEP 1 +#define D_INODEDEP 2 +#define D_BMSAFEMAP 3 +#define D_NEWBLK 4 +#define D_ALLOCDIRECT 5 +#define D_INDIRDEP 6 +#define D_ALLOCINDIR 7 +#define D_FREEFRAG 8 +#define D_FREEBLKS 9 +#define D_FREEFILE 10 +#define D_DIRADD 11 +#define D_MKDIR 12 +#define D_DIRREM 13 +#define D_NEWDIRBLK 14 +#define D_FREEWORK 15 +#define D_FREEDEP 16 +#define D_JADDREF 17 +#define D_JREMREF 18 +#define D_JMVREF 19 +#define D_JNEWBLK 20 +#define D_JFREEBLK 21 +#define D_JFREEFRAG 22 +#define D_JSEG 23 +#define D_JSEGDEP 24 +#define D_SBDEP 25 +#define D_JTRUNC 26 +#define D_JFSYNC 27 +#define D_SENTINEL 28 #define D_LAST D_SENTINEL /* @@ -469,17 +477,17 @@ struct allocdirect { * A single "indirdep" structure manages all allocation dependencies for * pointers in an indirect block. The up-to-date state of the indirect * block is stored in ir_savedata. The set of pointers that may be safely - * written to the disk is stored in ir_safecopy. The state field is used + * written to the disk is stored in ir_savebp. The state field is used * only to track whether the buffer is currently being written (in which - * case it is not safe to update ir_safecopy). Ir_deplisthd contains the + * case it is not safe to update ir_savebp). Ir_deplisthd contains the * list of allocindir structures, one for each block that needs to be * written to disk. Once the block and its bitmap allocation have been * written the safecopy can be updated to reflect the allocation and the * allocindir structure freed. If ir_state indicates that an I/O on the - * indirect block is in progress when ir_safecopy is to be updated, the + * indirect block is in progress when ir_savebp is to be updated, the * update is deferred by placing the allocindir on the ir_donehd list. * When the I/O on the indirect block completes, the entries on the - * ir_donehd list are processed by updating their corresponding ir_safecopy + * ir_donehd list are processed by updating their corresponding ir_savebp * pointers and then freeing the allocindir structure. */ struct indirdep { From owner-svn-src-all@freebsd.org Thu Apr 5 00:41:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21EC0F83F92; Thu, 5 Apr 2018 00:41:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA6577CCD1; Thu, 5 Apr 2018 00:41:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B54B51B434; Thu, 5 Apr 2018 00:41:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w350fX9C009885; Thu, 5 Apr 2018 00:41:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w350fXF1009884; Thu, 5 Apr 2018 00:41:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804050041.w350fXF1009884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 5 Apr 2018 00:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332056 - stable/11/stand/i386/libi386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/i386/libi386 X-SVN-Commit-Revision: 332056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 00:41:34 -0000 Author: kevans Date: Thu Apr 5 00:41:33 2018 New Revision: 332056 URL: https://svnweb.freebsd.org/changeset/base/332056 Log: MFC r331718: stand: Add workaround for HP BIOS issues hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to boot immediately after installation with the claim that it can't work out which disk they are booting from. They tracked it down to a buffer overrun, and found that it could be alleviated by doing a dummy read before-hand. Modified: stable/11/stand/i386/libi386/biosdisk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/11/stand/i386/libi386/biosdisk.c Thu Apr 5 00:32:01 2018 (r332055) +++ stable/11/stand/i386/libi386/biosdisk.c Thu Apr 5 00:41:33 2018 (r332056) @@ -122,6 +122,8 @@ static int nbdinfo = 0; #define BD(dev) (bdinfo[(dev)->d_unit]) +static void bd_io_workaround(struct disk_devdesc *dev); + static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest); static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, @@ -726,6 +728,15 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int return (0); } +static void +bd_io_workaround(struct disk_devdesc *dev) +{ + uint8_t buf[8 * 1024]; + + bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, 0); +} + + static int bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write) { @@ -738,6 +749,17 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks resid = blks; p = dest; + + /* + * Workaround for a problem with some HP ProLiant BIOS failing to work out + * the boot disk after installation. hrs and kuriyama discovered this + * problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and discovered + * that an int13h call seems to cause a buffer overrun in the bios. The + * problem is alleviated by doing an extra read before the buggy read. It + * is not immediately known whether other models are similarly affected. + */ + if (dblk >= 0x100000000) + bd_io_workaround(dev); /* Decide whether we have to bounce */ if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && From owner-svn-src-all@freebsd.org Thu Apr 5 03:26:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66230F82D82; Thu, 5 Apr 2018 03:26:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF9A683F1F; Thu, 5 Apr 2018 03:26:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA7091D03D; Thu, 5 Apr 2018 03:26:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w353QgA1042419; Thu, 5 Apr 2018 03:26:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w353Qgsh042418; Thu, 5 Apr 2018 03:26:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804050326.w353Qgsh042418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 03:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332057 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 03:26:43 -0000 Author: emaste Date: Thu Apr 5 03:26:42 2018 New Revision: 332057 URL: https://svnweb.freebsd.org/changeset/base/332057 Log: remove special handling for stale ptrace dependencies r318957 added special handling for stale ptrace dependency files to support a -DNO_CLEAN build in a tree last built before r305012. That revision is now over a year and a half old, so retire the special case. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 5 00:41:33 2018 (r332056) +++ head/Makefile.inc1 Thu Apr 5 03:26:42 2018 (r332057) @@ -804,10 +804,9 @@ _sanity_check: .PHONY .MAKE _cleanobj_fast_depend_hack: .PHONY # Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls -# 20160829 r305012 ptrace # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs # 20180404 r332048 sigreturn -.for f in fstat fstatat fstatfs getdirentries getfsstat ptrace sigreturn statfs +.for f in fstat fstatat fstatfs getdirentries getfsstat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-all@freebsd.org Thu Apr 5 11:03:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CEAF9E75B; Thu, 5 Apr 2018 11:03:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9B8875B1E; Thu, 5 Apr 2018 11:03:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C30E421C53; Thu, 5 Apr 2018 11:03:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35B35U8093636; Thu, 5 Apr 2018 11:03:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35B35dt093635; Thu, 5 Apr 2018 11:03:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804051103.w35B35dt093635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Apr 2018 11:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332060 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 332060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 11:03:06 -0000 Author: kib Date: Thu Apr 5 11:03:05 2018 New Revision: 332060 URL: https://svnweb.freebsd.org/changeset/base/332060 Log: Make the INTO instruction operational in 32bit mode. Having the IDT entry specify ring 0 DPL caused delivery of #GP instead of #OF. The instruction is not valid in 64bit mode, which probably explains why the IDT entry for #OF was initially set this way. It is interesting to note that the BOUND instruction works with the IDT #BR entry DPL 0, most likely CPU considers #BR from BOUND as generated by a machine, not user. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Apr 5 06:21:51 2018 (r332059) +++ head/sys/amd64/amd64/machdep.c Thu Apr 5 11:03:05 2018 (r332060) @@ -1636,7 +1636,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_BP, pti ? &IDTVEC(bpt_pti) : &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); setidt(IDT_OF, pti ? &IDTVEC(ofl_pti) : &IDTVEC(ofl), SDT_SYSIGT, - SEL_KPL, 0); + SEL_UPL, 0); setidt(IDT_BR, pti ? &IDTVEC(bnd_pti) : &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_UD, pti ? &IDTVEC(ill_pti) : &IDTVEC(ill), SDT_SYSIGT, From owner-svn-src-all@freebsd.org Thu Apr 5 11:03:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F34FFF9E7A5; Thu, 5 Apr 2018 11:03:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B1375C2E; Thu, 5 Apr 2018 11:03:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2C121C54; Thu, 5 Apr 2018 11:03:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35B3LiQ093756; Thu, 5 Apr 2018 11:03:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35B3LTU093755; Thu, 5 Apr 2018 11:03:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804051103.w35B3LTU093755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Apr 2018 11:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332061 - head/sys/amd64/ia32 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/ia32 X-SVN-Commit-Revision: 332061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 11:03:22 -0000 Author: kib Date: Thu Apr 5 11:03:21 2018 New Revision: 332061 URL: https://svnweb.freebsd.org/changeset/base/332061 Log: Fix ERESTART for lcall $7,$0 syscalls. The lcall trampoline enters kernel by int $0x80, which sets up invalid length of the instruction for %rip rewind. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/ia32/ia32_syscall.c Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Thu Apr 5 11:03:05 2018 (r332060) +++ head/sys/amd64/ia32/ia32_syscall.c Thu Apr 5 11:03:21 2018 (r332061) @@ -146,6 +146,7 @@ ia32_fetch_syscall_args(struct thread *td) frame->tf_rip = eip; frame->tf_cs = cs; frame->tf_rsp += 2 * sizeof(u_int32_t); + frame->tf_err = 7; /* size of lcall $7,$0 */ } #endif From owner-svn-src-all@freebsd.org Thu Apr 5 12:21:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9032AF810D3; Thu, 5 Apr 2018 12:21:03 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E5C978720; Thu, 5 Apr 2018 12:21:02 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm0-f54.google.com with SMTP id r82so6609265wme.0; Thu, 05 Apr 2018 05:21:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Wn4KEboqAFjk/AZVAKMlJUEKfxSKXWyWAxPw5z2YUGo=; b=SWr6gut7rc0yMe1kEfkeR7EL6JT1vyRCYEXrr64/Qk7gDJM5WxHFMAOyHxMg9YIDeo sLtk/jfvDmPUJ7cOtl0ydPzgHJklo0M1rwjDr2VvHTRET4SRG+TqFX7tbOiqmDRozFUM P0RafSS8TxGFEgjvbO58koreWmRpsAXl+zKSl8lFmh8P/wV7IU+OoJ7RFjkbjFOgxop6 20tqr5h/XWu0KtAc1dZiKTWKXC0Nc4qBaSWofrQheoo5HnQx46t6nobLsmwl1LWBzXCl Rtn52O31MmaU4OXttAizM2krgWGKiiUuP7dflFaV6tyInVuoN4+dlsnM5eISuFmzZb5r e0cQ== X-Gm-Message-State: ALQs6tANzt95DVjOgPMbNvGhy6a9H5PHy24DS4rjk3rJQv+tuPhGAJaD HbmUExxMdr5eOdFrQfJmWI6ZvtH3CpQ= X-Google-Smtp-Source: AIpwx48J5renmz/75lzrE3cd8ZP4D+kQ+qE+hn0bpxSQ8HyNYt3MOGombe0os56BAIellKCqSlpvLA== X-Received: by 10.46.150.132 with SMTP id q4mr3852886lji.45.1522930855619; Thu, 05 Apr 2018 05:20:55 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 81sm1279084ljz.67.2018.04.05.05.20.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 05:20:54 -0700 (PDT) Subject: Re: svn commit: r331701 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensol... To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803282201.w2SM1RTe029674@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Thu, 5 Apr 2018 15:20:53 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201803282201.w2SM1RTe029674@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 12:21:03 -0000 On 29/03/2018 01:01, Alexander Motin wrote: > MFV r331695, 331700: 9166 zfs storage pool checkpoint > > illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4 > > The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with > exactly that. It can be thought of as a “pool-wide snapshot†(or a > variation of extreme rewind that doesn’t corrupt your data). It remembers > the entire state of the pool at the point that it was taken and the user > can revert back to it later or discard it. Its generic use case is an > administrator that is about to perform a set of destructive actions to ZFS > as part of a critical procedure. She takes a checkpoint of the pool before > performing the actions, then rewinds back to it if one of them fails or puts > the pool into an unexpected state. Otherwise, she discards it. With the > assumption that no one else is making modifications to ZFS, she basically > wraps all these actions into a “high-level transactionâ€. A small nit: > /* check options */ > - while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:T:VX")) != -1) { > + while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX", > + long_options, NULL)) != -1) { > switch (c) { It seems that on illumos zpool import has an undocumented option with no effect, -r. I think that we removed that option from FreeBSD. This commit restored it. I am actually indifferent about having it. Just pointing out this possibly unintended change. -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Apr 5 12:48:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD72F82C62; Thu, 5 Apr 2018 12:48:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6149879B0C; Thu, 5 Apr 2018 12:48:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C3C522C94; Thu, 5 Apr 2018 12:48:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35Cmw42070314; Thu, 5 Apr 2018 12:48:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35Cmw0M070313; Thu, 5 Apr 2018 12:48:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051248.w35Cmw0M070313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332062 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 332062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:48:58 -0000 Author: emaste Date: Thu Apr 5 12:48:58 2018 New Revision: 332062 URL: https://svnweb.freebsd.org/changeset/base/332062 Log: MFC r332034: linux_ioctl_hdio: fix kernel memory disclosure Stack-allocated struct linux_hd_big_geometry has undeclared padding copied to userland. admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/compat/linux/linux_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Thu Apr 5 11:03:21 2018 (r332061) +++ stable/11/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:48:58 2018 (r332062) @@ -253,6 +253,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl } else if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO_BIG) { struct linux_hd_big_geometry hdbg; + memset(&hdbg, 0, sizeof(hdbg)); hdbg.cylinders = fwcylinders; hdbg.heads = fwheads; hdbg.sectors = fwsectors; From owner-svn-src-all@freebsd.org Thu Apr 5 12:50:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFCA5F82E9C; Thu, 5 Apr 2018 12:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92F2F79DA1; Thu, 5 Apr 2018 12:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DDA022CA7; Thu, 5 Apr 2018 12:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35ColAY071041; Thu, 5 Apr 2018 12:50:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35Colph071040; Thu, 5 Apr 2018 12:50:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051250.w35Colph071040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332063 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 332063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:50:48 -0000 Author: emaste Date: Thu Apr 5 12:50:47 2018 New Revision: 332063 URL: https://svnweb.freebsd.org/changeset/base/332063 Log: MFC r332034: linux_ioctl_hdio: fix kernel memory disclosure Stack-allocated struct linux_hd_big_geometry has undeclared padding copied to userland. admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:48:58 2018 (r332062) +++ stable/10/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:50:47 2018 (r332063) @@ -246,6 +246,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl } else if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO_BIG) { struct linux_hd_big_geometry hdbg; + memset(&hdbg, 0, sizeof(hdbg)); hdbg.cylinders = fwcylinders; hdbg.heads = fwheads; hdbg.sectors = fwsectors; From owner-svn-src-all@freebsd.org Thu Apr 5 12:54:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E07CF832B0; Thu, 5 Apr 2018 12:54:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8577A1C8; Thu, 5 Apr 2018 12:54:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1859222E28; Thu, 5 Apr 2018 12:54:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35CsAu2076430; Thu, 5 Apr 2018 12:54:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35CsAwh076429; Thu, 5 Apr 2018 12:54:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051254.w35CsAwh076429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:54: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: r332064 - stable/10/sys/compat/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/compat/linux X-SVN-Commit-Revision: 332064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:54:11 -0000 Author: emaste Date: Thu Apr 5 12:54:10 2018 New Revision: 332064 URL: https://svnweb.freebsd.org/changeset/base/332064 Log: MFC r332042: Fix kernel memory disclosure in linux_ioctl_socket strlcpy is used to copy a string into a buffer to be copied to userland, previously leaving uninitialized data after the terminating NUL. Zero the buffer first to avoid a kernel memory disclosure. admbugs: 765, 811 Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:50:47 2018 (r332063) +++ stable/10/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:54:10 2018 (r332064) @@ -2427,6 +2427,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioc printf("%s(): ioctl %d on %.*s\n", __func__, args->cmd & 0xffff, LINUX_IFNAMSIZ, lifname); #endif + memset(ifname, 0, sizeof(ifname)); ifp = ifname_linux_to_bsd(td, lifname, ifname); if (ifp == NULL) return (EINVAL); From owner-svn-src-all@freebsd.org Thu Apr 5 12:54:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B2D6F832CC; Thu, 5 Apr 2018 12:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6337A1D4; Thu, 5 Apr 2018 12:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3972E22E29; Thu, 5 Apr 2018 12:54:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35CsDfd076486; Thu, 5 Apr 2018 12:54:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35CsD8o076485; Thu, 5 Apr 2018 12:54:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051254.w35CsD8o076485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332065 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 332065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:54:13 -0000 Author: emaste Date: Thu Apr 5 12:54:12 2018 New Revision: 332065 URL: https://svnweb.freebsd.org/changeset/base/332065 Log: MFC r332042: Fix kernel memory disclosure in linux_ioctl_socket strlcpy is used to copy a string into a buffer to be copied to userland, previously leaving uninitialized data after the terminating NUL. Zero the buffer first to avoid a kernel memory disclosure. admbugs: 765, 811 Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/compat/linux/linux_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:54:10 2018 (r332064) +++ stable/11/sys/compat/linux/linux_ioctl.c Thu Apr 5 12:54:12 2018 (r332065) @@ -2478,6 +2478,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioc printf("%s(): ioctl %d on %.*s\n", __func__, args->cmd & 0xffff, LINUX_IFNAMSIZ, lifname); #endif + memset(ifname, 0, sizeof(ifname)); ifp = ifname_linux_to_bsd(td, lifname, ifname); if (ifp == NULL) return (EINVAL); From owner-svn-src-all@freebsd.org Thu Apr 5 12:56:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D4C6F8366F; Thu, 5 Apr 2018 12:56:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3EDD7A623; Thu, 5 Apr 2018 12:56:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AED1122E2C; Thu, 5 Apr 2018 12:56:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35CuecH077385; Thu, 5 Apr 2018 12:56:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35CueRZ077384; Thu, 5 Apr 2018 12:56:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051256.w35CueRZ077384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332066 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:56:41 -0000 Author: emaste Date: Thu Apr 5 12:56:40 2018 New Revision: 332066 URL: https://svnweb.freebsd.org/changeset/base/332066 Log: MFC r332045: Fix kernel memory disclosure in tcp_ctloutput strcpy was used to copy a string into a buffer copied to userland, which left uninitialized data after the terminating 0-byte. Use the same approach as in tcp_subr.c: strncpy and explicit '\0'. admbugs: 765, 822 Reported by: Ilja Van Sprundel Reported by: Vlad Tsyrklevich Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/netinet/tcp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/11/sys/netinet/tcp_usrreq.c Thu Apr 5 12:54:12 2018 (r332065) +++ stable/11/sys/netinet/tcp_usrreq.c Thu Apr 5 12:56:40 2018 (r332066) @@ -1495,7 +1495,9 @@ tcp_ctloutput(struct socket *so, struct sockopt *sopt) return (error); } else if ((sopt->sopt_dir == SOPT_GET) && (sopt->sopt_name == TCP_FUNCTION_BLK)) { - strcpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name); + strncpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name, + TCP_FUNCTION_NAME_LEN_MAX); + fsn.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; fsn.pcbcnt = tp->t_fb->tfb_refcnt; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &fsn, sizeof fsn); From owner-svn-src-all@freebsd.org Thu Apr 5 12:59:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B86F83992; Thu, 5 Apr 2018 12:59:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83F3B7A869; Thu, 5 Apr 2018 12:59:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AB8022E2E; Thu, 5 Apr 2018 12:59:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35Cxna7078378; Thu, 5 Apr 2018 12:59:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35CxnLo078377; Thu, 5 Apr 2018 12:59:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051259.w35CxnLo078377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332067 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 332067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:59:50 -0000 Author: emaste Date: Thu Apr 5 12:59:49 2018 New Revision: 332067 URL: https://svnweb.freebsd.org/changeset/base/332067 Log: MFC r331757: Correct comment typo in Hyper-V PR: 226665 Submitted by: Ryo ONODERA Modified: stable/10/sys/dev/hyperv/vmbus/hyperv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hyperv.c Thu Apr 5 12:56:40 2018 (r332066) +++ stable/10/sys/dev/hyperv/vmbus/hyperv.c Thu Apr 5 12:59:49 2018 (r332067) @@ -27,7 +27,7 @@ */ /** - * Implements low-level interactions with Hypver-V/Azure + * Implements low-level interactions with Hyper-V/Azure */ #include __FBSDID("$FreeBSD$"); From owner-svn-src-all@freebsd.org Thu Apr 5 12:59:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 863F2F83998; Thu, 5 Apr 2018 12:59:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0554A7A86D; Thu, 5 Apr 2018 12:59:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 000A022E30; Thu, 5 Apr 2018 12:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35CxoS8078445; Thu, 5 Apr 2018 12:59:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35Cxo40078443; Thu, 5 Apr 2018 12:59:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051259.w35Cxo40078443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 12:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332068 - stable/11/sys/dev/hyperv/vmbus X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 332068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 12:59:51 -0000 Author: emaste Date: Thu Apr 5 12:59:50 2018 New Revision: 332068 URL: https://svnweb.freebsd.org/changeset/base/332068 Log: MFC r331757: Correct comment typo in Hyper-V PR: 226665 Submitted by: Ryo ONODERA Modified: stable/11/sys/dev/hyperv/vmbus/hyperv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/hyperv.c Thu Apr 5 12:59:49 2018 (r332067) +++ stable/11/sys/dev/hyperv/vmbus/hyperv.c Thu Apr 5 12:59:50 2018 (r332068) @@ -27,7 +27,7 @@ */ /** - * Implements low-level interactions with Hypver-V/Azure + * Implements low-level interactions with Hyper-V/Azure */ #include __FBSDID("$FreeBSD$"); From owner-svn-src-all@freebsd.org Thu Apr 5 13:39:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C567CF8641B; Thu, 5 Apr 2018 13:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74EBA7C426; Thu, 5 Apr 2018 13:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F887234C1; Thu, 5 Apr 2018 13:39:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35DdrZc008286; Thu, 5 Apr 2018 13:39:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35DdrwI008285; Thu, 5 Apr 2018 13:39:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804051339.w35DdrwI008285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Apr 2018 13:39: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: r332069 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/amd64/amd64 X-SVN-Commit-Revision: 332069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 13:39:53 -0000 Author: kib Date: Thu Apr 5 13:39:53 2018 New Revision: 332069 URL: https://svnweb.freebsd.org/changeset/base/332069 Log: MFC r331374: Fixes for ptrace(PT_GETXSTATE_INFO) related to the padding in struct ptrace_xstate_info). Modified: stable/10/sys/amd64/amd64/ptrace_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/ptrace_machdep.c Thu Apr 5 12:59:50 2018 (r332068) +++ stable/10/sys/amd64/amd64/ptrace_machdep.c Thu Apr 5 13:39:53 2018 (r332069) @@ -43,10 +43,20 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef COMPAT_FREEBSD32 +struct ptrace_xstate_info32 { + uint32_t xsave_mask1, xsave_mask2; + uint32_t xsave_len; +}; +#endif + static int cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) { struct ptrace_xstate_info info; +#ifdef COMPAT_FREEBSD32 + struct ptrace_xstate_info32 info32; +#endif char *savefpu; int error; @@ -76,13 +86,28 @@ cpu_ptrace_xstate(struct thread *td, int req, void *ad break; case PT_GETXSTATE_INFO: - if (data != sizeof(info)) { - error = EINVAL; - break; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { + if (data != sizeof(info32)) { + error = EINVAL; + } else { + info32.xsave_len = cpu_max_ext_state_size; + info32.xsave_mask1 = xsave_mask; + info32.xsave_mask2 = xsave_mask >> 32; + error = copyout(&info32, addr, data); + } + } else +#endif + { + if (data != sizeof(info)) { + error = EINVAL; + } else { + bzero(&info, sizeof(info)); + info.xsave_len = cpu_max_ext_state_size; + info.xsave_mask = xsave_mask; + error = copyout(&info, addr, data); + } } - info.xsave_len = cpu_max_ext_state_size; - info.xsave_mask = xsave_mask; - error = copyout(&info, addr, data); break; case PT_GETXSTATE: From owner-svn-src-all@freebsd.org Thu Apr 5 13:56:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D47F87400; Thu, 5 Apr 2018 13:56:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D46787CF72; Thu, 5 Apr 2018 13:56:40 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD8CE237EF; Thu, 5 Apr 2018 13:56:40 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35DueDw022534; Thu, 5 Apr 2018 13:56:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35Duexg022529; Thu, 5 Apr 2018 13:56:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804051356.w35Duexg022529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 5 Apr 2018 13:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332070 - in head/sys/geom: . label raid X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys/geom: . label raid X-SVN-Commit-Revision: 332070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 13:56:41 -0000 Author: sbruno Date: Thu Apr 5 13:56:40 2018 New Revision: 332070 URL: https://svnweb.freebsd.org/changeset/base/332070 Log: Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. Display attribute in future error strings and differentiate g_handleattr() error messages for ease of debugging in the future. "g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT" Reported by: swills Reviewed by: imp cem avg Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14962 Modified: head/sys/geom/geom_subr.c head/sys/geom/label/g_label_disk_ident.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Thu Apr 5 13:39:53 2018 (r332069) +++ head/sys/geom/geom_subr.c Thu Apr 5 13:56:40 2018 (r332070) @@ -1050,16 +1050,16 @@ g_handleattr(struct bio *bp, const char *attribute, co bzero(bp->bio_data, bp->bio_length); if (strlcpy(bp->bio_data, val, bp->bio_length) >= bp->bio_length) { - printf("%s: %s bio_length %jd len %zu -> EFAULT\n", - __func__, bp->bio_to->name, + printf("%s: %s %s bio_length %jd strlen %zu -> EFAULT\n", + __func__, bp->bio_to->name, attribute, (intmax_t)bp->bio_length, strlen(val)); error = EFAULT; } } else if (bp->bio_length == len) { bcopy(val, bp->bio_data, len); } else { - printf("%s: %s bio_length %jd len %d -> EFAULT\n", __func__, - bp->bio_to->name, (intmax_t)bp->bio_length, len); + printf("%s: %s %s bio_length %jd len %d -> EFAULT\n", __func__, + bp->bio_to->name, attribute, (intmax_t)bp->bio_length, len); error = EFAULT; } if (error == 0) Modified: head/sys/geom/label/g_label_disk_ident.c ============================================================================== --- head/sys/geom/label/g_label_disk_ident.c Thu Apr 5 13:39:53 2018 (r332069) +++ head/sys/geom/label/g_label_disk_ident.c Thu Apr 5 13:56:40 2018 (r332070) @@ -49,7 +49,7 @@ static void g_label_disk_ident_taste(struct g_consumer *cp, char *label, size_t size) { struct g_class *cls; - char ident[100]; + char ident[DISK_IDENT_SIZE]; int ident_len, found, i; g_topology_assert_not(); Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Thu Apr 5 13:39:53 2018 (r332069) +++ head/sys/geom/raid/md_ddf.c Thu Apr 5 13:56:40 2018 (r332070) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "geom/raid/g_raid.h" #include "geom/raid/md_ddf.h" @@ -572,7 +573,7 @@ ddf_meta_create(struct g_raid_disk *disk, struct ddf_m off_t anchorlba; u_int ss, pos, size; int len, error; - char serial_buffer[24]; + char serial_buffer[DISK_IDENT_SIZE]; if (sample->hdr == NULL) sample = NULL; Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Thu Apr 5 13:39:53 2018 (r332069) +++ head/sys/geom/raid/md_intel.c Thu Apr 5 13:56:40 2018 (r332070) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" @@ -1450,7 +1451,7 @@ g_raid_md_create_intel(struct g_raid_md_object *md, st static int g_raid_md_get_label(struct g_consumer *cp, char *serial, int serlen) { - char serial_buffer[24]; + char serial_buffer[DISK_IDENT_SIZE]; int len, error; len = sizeof(serial_buffer); From owner-svn-src-all@freebsd.org Thu Apr 5 14:25:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B15DF897BE; Thu, 5 Apr 2018 14:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DAA27E9D6; Thu, 5 Apr 2018 14:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38A1523D00; Thu, 5 Apr 2018 14:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35EPeYP044460; Thu, 5 Apr 2018 14:25:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35EPe2R044458; Thu, 5 Apr 2018 14:25:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804051425.w35EPe2R044458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 5 Apr 2018 14:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332071 - in stable/11/sys/amd64: linux linux32 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/sys/amd64: linux linux32 X-SVN-Commit-Revision: 332071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 14:25:40 -0000 Author: emaste Date: Thu Apr 5 14:25:39 2018 New Revision: 332071 URL: https://svnweb.freebsd.org/changeset/base/332071 Log: MFC r331442: Fixup return style(9) in amd64 linux*_sysvec.c Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Thu Apr 5 13:56:40 2018 (r332070) +++ stable/11/sys/amd64/linux/linux_sysvec.c Thu Apr 5 14:25:39 2018 (r332071) @@ -204,15 +204,15 @@ translate_traps(int signal, int trap_code) { if (signal != SIGBUS) - return signal; + return (signal); switch (trap_code) { case T_PROTFLT: case T_TSSFLT: case T_DOUBLEFLT: case T_PAGEFLT: - return SIGSEGV; + return (SIGSEGV); default: - return signal; + return (signal); } } Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Thu Apr 5 13:56:40 2018 (r332070) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Thu Apr 5 14:25:39 2018 (r332071) @@ -211,15 +211,15 @@ static int translate_traps(int signal, int trap_code) { if (signal != SIGBUS) - return signal; + return (signal); switch (trap_code) { case T_PROTFLT: case T_TSSFLT: case T_DOUBLEFLT: case T_PAGEFLT: - return SIGSEGV; + return (SIGSEGV); default: - return signal; + return (signal); } } From owner-svn-src-all@freebsd.org Thu Apr 5 14:31:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A167F89E02; Thu, 5 Apr 2018 14:31:55 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4826D7F063; Thu, 5 Apr 2018 14:31:55 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4309E23E67; Thu, 5 Apr 2018 14:31:55 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35EVt3e047912; Thu, 5 Apr 2018 14:31:55 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35EVtg4047897; Thu, 5 Apr 2018 14:31:55 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201804051431.w35EVtg4047897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 5 Apr 2018 14:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332072 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 332072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 14:31:55 -0000 Author: royger Date: Thu Apr 5 14:31:54 2018 New Revision: 332072 URL: https://svnweb.freebsd.org/changeset/base/332072 Log: introduce GiB and MiB macros This macros convert from GiB or MiB into bytes. Sponsored by: Citrix Systems R&D Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Apr 5 14:25:39 2018 (r332071) +++ head/sys/sys/param.h Thu Apr 5 14:31:54 2018 (r332072) @@ -362,4 +362,8 @@ __END_DECLS */ #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) +/* Unit conversion macros. */ +#define GiB(v) (v ## ULL << 30) +#define MiB(v) (v ## ULL << 20) + #endif /* _SYS_PARAM_H_ */ From owner-svn-src-all@freebsd.org Thu Apr 5 14:39:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDC8BF8A6A0; Thu, 5 Apr 2018 14:39:52 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2D3B7F50A; Thu, 5 Apr 2018 14:39:52 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB2223E9C; Thu, 5 Apr 2018 14:39:52 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35EdqJN049568; Thu, 5 Apr 2018 14:39:52 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35EdpMM049557; Thu, 5 Apr 2018 14:39:51 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201804051439.w35EdpMM049557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 5 Apr 2018 14:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332073 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 X-SVN-Commit-Revision: 332073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 14:39:53 -0000 Author: royger Date: Thu Apr 5 14:39:51 2018 New Revision: 332073 URL: https://svnweb.freebsd.org/changeset/base/332073 Log: x86: improve reservation of AP trampoline memory So that it doesn't rely on physmap[1] containing an address below 1MiB. Instead scan the full physmap and search for a suitable address to place the trampoline code (below 1MiB) and the initial memory pages (below 4GiB). Sponsored by: Citrix Systems R&D Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14878 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/mpboot.S head/sys/amd64/include/smp.h head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/include/smp.h head/sys/x86/include/init.h head/sys/x86/include/x86_smp.h head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/amd64/machdep.c Thu Apr 5 14:39:51 2018 (r332073) @@ -1246,14 +1246,10 @@ getmemsize(caddr_t kmdp, u_int64_t first) * Make hole for "AP -> long mode" bootstrap code. The * mp_bootaddress vector is only available when the kernel * is configured to support APs and APs for the system start - * in 32bit mode (e.g. SMP bare metal). + * in real mode mode (e.g. SMP bare metal). */ - if (init_ops.mp_bootaddress) { - if (physmap[1] >= 0x100000000) - panic( - "Basemem segment is not suitable for AP bootstrap code!"); - physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024); - } + if (init_ops.mp_bootaddress) + init_ops.mp_bootaddress(physmap, &physmap_idx); /* * Maxmem isn't the "maximum memory", it's one larger than the Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/amd64/mp_machdep.c Thu Apr 5 14:39:51 2018 (r332073) @@ -96,24 +96,45 @@ char *nmi_stack; static int start_ap(int apic_id); -static u_int bootMP_size; -static u_int boot_address; - /* * Calculate usable address in base memory for AP trampoline code. */ -u_int -mp_bootaddress(u_int basemem) +void +mp_bootaddress(vm_paddr_t *physmap, unsigned int *physmap_idx) { + unsigned int i; + bool allocated; - bootMP_size = mptramp_end - mptramp_start; - boot_address = trunc_page(basemem * 1024); /* round down to 4k boundary */ - if (((basemem * 1024) - boot_address) < bootMP_size) - boot_address -= PAGE_SIZE; /* not enough, lower by 4k */ - /* 3 levels of page table pages */ - mptramp_pagetables = boot_address - (PAGE_SIZE * 3); + alloc_ap_trampoline(physmap, physmap_idx); - return mptramp_pagetables; + allocated = false; + for (i = *physmap_idx; i <= *physmap_idx; i -= 2) { + /* + * Find a memory region big enough below the 4GB boundary to + * store the initial page tables. Note that it needs to be + * aligned to a page boundary. + */ + if (physmap[i] >= GiB(4) || + (physmap[i + 1] - round_page(physmap[i])) < (PAGE_SIZE * 3)) + continue; + + allocated = true; + mptramp_pagetables = round_page(physmap[i]); + physmap[i] = round_page(physmap[i]) + (PAGE_SIZE * 3); + if (physmap[i] == physmap[i + 1] && *physmap_idx != 0) { + memmove(&physmap[i], &physmap[i + 2], + sizeof(*physmap) * (*physmap_idx - i + 2)); + *physmap_idx -= 2; + } + } + + if (!allocated) { + mptramp_pagetables = trunc_page(boot_address) - (PAGE_SIZE * 3); + if (bootverbose) + printf( +"Cannot find enough space for the initial AP page tables, placing them at %#x", + mptramp_pagetables); + } } /* Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/amd64/mpboot.S Thu Apr 5 14:39:51 2018 (r332073) @@ -216,8 +216,14 @@ lgdt_desc: .word gdtend-gdt /* Length */ .long gdt-mptramp_start /* Offset plus %ds << 4 */ - .globl mptramp_end mptramp_end: + /* + * The size of the trampoline code that needs to be relocated + * below the 1MiB boundary. + */ + .globl bootMP_size +bootMP_size: + .long mptramp_end - mptramp_start /* * From here on down is executed in the kernel .text section. Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/amd64/include/smp.h Thu Apr 5 14:39:51 2018 (r332073) @@ -23,7 +23,6 @@ /* global symbols in mpboot.S */ extern char mptramp_start[]; -extern char mptramp_end[]; extern u_int32_t mptramp_pagetables; /* IPI handlers */ @@ -59,6 +58,7 @@ void invlpg_pcid_handler(void); void invlrng_invpcid_handler(void); void invlrng_pcid_handler(void); int native_start_all_aps(void); +void mp_bootaddress(vm_paddr_t *, unsigned int *); #endif /* !LOCORE */ #endif /* SMP */ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/i386/i386/machdep.c Thu Apr 5 14:39:51 2018 (r332073) @@ -1903,7 +1903,7 @@ physmap_done: #ifdef SMP /* make hole for AP bootstrap code */ - physmap[1] = mp_bootaddress(physmap[1]); + alloc_ap_trampoline(physmap, &physmap_idx); #endif /* Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/i386/i386/mp_machdep.c Thu Apr 5 14:39:51 2018 (r332073) @@ -139,22 +139,6 @@ static void install_ap_tramp(void); static int start_all_aps(void); static int start_ap(int apic_id); -static u_int boot_address; - -/* - * Calculate usable address in base memory for AP trampoline code. - */ -u_int -mp_bootaddress(u_int basemem) -{ - - boot_address = trunc_page(basemem); /* round down to 4k boundary */ - if ((basemem - boot_address) < bootMP_size) - boot_address -= PAGE_SIZE; /* not enough, lower by 4k */ - - return boot_address; -} - /* * Initialize the IPI handlers and start up the AP's. */ Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/i386/include/smp.h Thu Apr 5 14:39:51 2018 (r332073) @@ -27,9 +27,6 @@ #include #include -/* global data in mpboot.s */ -extern int bootMP_size; - /* functions in mpboot.s */ void bootMP(void); Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/x86/include/init.h Thu Apr 5 14:39:51 2018 (r332073) @@ -41,7 +41,7 @@ struct init_ops { void (*early_clock_source_init)(void); void (*early_delay)(int); void (*parse_memmap)(caddr_t, vm_paddr_t *, int *); - u_int (*mp_bootaddress)(u_int); + void (*mp_bootaddress)(vm_paddr_t *, unsigned int *); int (*start_all_aps)(void); void (*msi_init)(void); }; Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/x86/include/x86_smp.h Thu Apr 5 14:39:51 2018 (r332073) @@ -32,6 +32,8 @@ extern int bootAP; extern void *dpcpu; extern char *bootSTK; extern void *bootstacks[]; +extern unsigned int boot_address; +extern unsigned int bootMP_size; extern volatile u_int cpu_ipi_pending[]; extern volatile int aps_ready; extern struct mtx ap_boot_mtx; @@ -83,6 +85,7 @@ void assign_cpu_ids(void); void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void cpususpend_handler(void); +void alloc_ap_trampoline(vm_paddr_t *physmap, unsigned int *physmap_idx); void init_secondary_tail(void); void invltlb_handler(void); void invlpg_handler(void); @@ -95,7 +98,6 @@ void ipi_bitmap_handler(struct trapframe frame); void ipi_cpu(int cpu, u_int ipi); int ipi_nmi_handler(void); void ipi_selected(cpuset_t cpus, u_int ipi); -u_int mp_bootaddress(u_int); void set_interrupt_apic_ids(void); void smp_cache_flush(void); void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr, struct pmap *pmap); Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Thu Apr 5 14:31:54 2018 (r332072) +++ head/sys/x86/x86/mp_x86.c Thu Apr 5 14:39:51 2018 (r332073) @@ -158,6 +158,8 @@ struct cache_info { int present; } static caches[MAX_CACHE_LEVELS]; +unsigned int boot_address; + void mem_range_AP_init(void) { @@ -903,6 +905,55 @@ cpu_mp_probe(void) */ CPU_SETOF(0, &all_cpus); return (mp_ncpus > 1); +} + +/* Allocate memory for the AP trampoline. */ +void +alloc_ap_trampoline(vm_paddr_t *physmap, unsigned int *physmap_idx) +{ + unsigned int i; + bool allocated; + + allocated = false; + for (i = *physmap_idx; i <= *physmap_idx; i -= 2) { + /* + * Find a memory region big enough and below the 1MB boundary + * for the trampoline code. + * NB: needs to be page aligned. + */ + if (physmap[i] >= MiB(1) || + (trunc_page(physmap[i + 1]) - round_page(physmap[i])) < + round_page(bootMP_size)) + continue; + + allocated = true; + /* + * Try to steal from the end of the region to mimic previous + * behaviour, else fallback to steal from the start. + */ + if (physmap[i + 1] < MiB(1)) { + boot_address = trunc_page(physmap[i + 1]); + if ((physmap[i + 1] - boot_address) < bootMP_size) + boot_address -= round_page(bootMP_size); + physmap[i + 1] = boot_address; + } else { + boot_address = round_page(physmap[i]); + physmap[i] = boot_address + round_page(bootMP_size); + } + if (physmap[i] == physmap[i + 1] && *physmap_idx != 0) { + memmove(&physmap[i], &physmap[i + 2], + sizeof(*physmap) * (*physmap_idx - i + 2)); + *physmap_idx -= 2; + } + } + + if (!allocated) { + boot_address = basemem * 1024 - bootMP_size; + if (bootverbose) + printf( +"Cannot find enough space for the boot trampoline, placing it at %#x", + boot_address); + } } /* From owner-svn-src-all@freebsd.org Thu Apr 5 14:55:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3886CF8B732; Thu, 5 Apr 2018 14:55:45 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBD0780053; Thu, 5 Apr 2018 14:55:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6467241DA; Thu, 5 Apr 2018 14:55:44 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35EtiAJ059241; Thu, 5 Apr 2018 14:55:44 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35Eti5u059240; Thu, 5 Apr 2018 14:55:44 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804051455.w35Eti5u059240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 5 Apr 2018 14:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332074 - stable/11/sys/i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: stable/11/sys/i386/include X-SVN-Commit-Revision: 332074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 14:55:45 -0000 Author: rgrimes Date: Thu Apr 5 14:55:44 2018 New Revision: 332074 URL: https://svnweb.freebsd.org/changeset/base/332074 Log: MFC: r304147(bde) Remove duplicate definition of get_pcb_td(). gcc works for detecting this error. Approved by: bde (mentor) Modified: stable/11/sys/i386/include/md_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/include/md_var.h ============================================================================== --- stable/11/sys/i386/include/md_var.h Thu Apr 5 14:39:51 2018 (r332073) +++ stable/11/sys/i386/include/md_var.h Thu Apr 5 14:55:44 2018 (r332074) @@ -71,6 +71,5 @@ void set_gsbase(struct thread *td, uint32_t base); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); -struct pcb *get_pcb_td(struct thread *td); #endif /* !_MACHINE_MD_VAR_H_ */ From owner-svn-src-all@freebsd.org Thu Apr 5 15:00:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AF70F8BB12; Thu, 5 Apr 2018 15:00:09 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2947580373; Thu, 5 Apr 2018 15:00:09 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2000A241DF; Thu, 5 Apr 2018 15:00:09 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35F08J4059483; Thu, 5 Apr 2018 15:00:08 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35F08kG059482; Thu, 5 Apr 2018 15:00:08 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804051500.w35F08kG059482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 5 Apr 2018 15:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332075 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 332075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 15:00:09 -0000 Author: rgrimes Date: Thu Apr 5 15:00:08 2018 New Revision: 332075 URL: https://svnweb.freebsd.org/changeset/base/332075 Log: Exit with usage when extra arguments are on command line preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor), phk (mentor) MFC after: 1 week Modified: head/sbin/reboot/reboot.c Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Thu Apr 5 14:55:44 2018 (r332074) +++ head/sbin/reboot/reboot.c Thu Apr 5 15:00:08 2018 (r332075) @@ -116,6 +116,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (argc != 0) + usage(); if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); From owner-svn-src-all@freebsd.org Thu Apr 5 15:16:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1996F8CE05; Thu, 5 Apr 2018 15:16:24 +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 1A6C4810DC; Thu, 5 Apr 2018 15:16:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 62EA2D49D39; Fri, 6 Apr 2018 01:16:22 +1000 (AEST) Date: Fri, 6 Apr 2018 01:16:22 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332073 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 In-Reply-To: <201804051439.w35EdpMM049557@repo.freebsd.org> Message-ID: <20180406005848.S3128@besplex.bde.org> References: <201804051439.w35EdpMM049557@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=Eqv2rDMv4T5AlZsafwoA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:16:24 -0000 On Thu, 5 Apr 2018, [UTF-8] Roger Pau Monn=C3=A9 wrote: > Log: > x86: improve reservation of AP trampoline memory This has lots of style bugs. Mainly changing the KNF spelling of 'unsigned' as u_int to the verbose 'unsigned int' in code that used to be careful to use the KNF spelling. Bruce From owner-svn-src-all@freebsd.org Thu Apr 5 15:22:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67665F8D534; Thu, 5 Apr 2018 15:22:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D16A18189A; Thu, 5 Apr 2018 15:22:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w35FM4aS039936 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Apr 2018 18:22:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w35FM4aS039936 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w35FM4Hq039935; Thu, 5 Apr 2018 18:22:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 5 Apr 2018 18:22:04 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331976 - head/sys/modules/cam Message-ID: <20180405152204.GV1774@kib.kiev.ua> References: <201804040237.w342b5EA074884@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804040237.w342b5EA074884@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:22:16 -0000 On Wed, Apr 04, 2018 at 02:37:05AM +0000, Warner Losh wrote: > Author: imp > Date: Wed Apr 4 02:37:05 2018 > New Revision: 331976 > URL: https://svnweb.freebsd.org/changeset/base/331976 > > Log: > Add nvme_da back. > > Now that it can co-exist in the kernel with nvd, add it back to the > cam module. > > Sponsored by: Netflix > > Modified: > head/sys/modules/cam/Makefile > > Modified: head/sys/modules/cam/Makefile > ============================================================================== > --- head/sys/modules/cam/Makefile Wed Apr 4 02:35:48 2018 (r331975) > +++ head/sys/modules/cam/Makefile Wed Apr 4 02:37:05 2018 (r331976) > @@ -46,6 +46,7 @@ SRCS+= ata_machdep.c > SRCS+= ata_pmp.c > SRCS+= nvme_all.c > SRCS+= nvme_xpt.c > +SRCS+= nvme_da.c > > EXPORT_SYMS= YES # XXX evaluate This change resulted in the following: Preloaded elf obj module "/boot/kernel/cam.ko" at 0xffffffff812bb898. link_elf_obj: symbol nvme_strvis undefined KLD file cam.ko - could not finalize loading KLD file ahci.ko - cannot find dependency "cam" From owner-svn-src-all@freebsd.org Thu Apr 5 15:23:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3072F8D67D; Thu, 5 Apr 2018 15:23:10 +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 2ED6281A5D; Thu, 5 Apr 2018 15:23:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 5FA6D10474D1; Fri, 6 Apr 2018 00:58:43 +1000 (AEST) Date: Fri, 6 Apr 2018 00:58:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332072 - head/sys/sys In-Reply-To: <201804051431.w35EVtg4047897@repo.freebsd.org> Message-ID: <20180406005023.Y3128@besplex.bde.org> References: <201804051431.w35EVtg4047897@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=br4i30Z5CdPjGGWIS_YA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:23:10 -0000 On Thu, 5 Apr 2018, [UTF-8] Roger Pau Monn=C3=A9 wrote: > Log: > introduce GiB and MiB macros > > This macros convert from GiB or MiB into bytes. This is undocumented namspace pollution with bad names and worse types. The better names GB and MB would be more likely to conflicted with code not written by disk marketers. > Modified: head/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/param.h=09Thu Apr 5 14:25:39 2018=09(r332071) > +++ head/sys/sys/param.h=09Thu Apr 5 14:31:54 2018=09(r332072) > @@ -362,4 +362,8 @@ __END_DECLS > */ > #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offs= et]) Old style bug: space instead of tab after #define. > > +/* Unit conversion macros. */ > +#define GiB(v) (v ## ULL << 30) > +#define MiB(v) (v ## ULL << 20) > + New style bugs: - space instead of tab after #define - use of the long long abomination Type error: - the abomination doesn't have the same type of carefully typedefed types like vm_size_t on any supported arch. > #endif=09/* _SYS_PARAM_H_ */ Old style bugs: - tab instead of space before comment on #endif. - backwards comment on #endif. Bruce From owner-svn-src-all@freebsd.org Thu Apr 5 15:33:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4009F8E0A9 for ; Thu, 5 Apr 2018 15:33:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0A9820F1 for ; Thu, 5 Apr 2018 15:33:05 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6f4e4b6f-38e6-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 6f4e4b6f-38e6-11e8-b951-f99fef315fd9; Thu, 05 Apr 2018 15:31:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w35FWvYE087640; Thu, 5 Apr 2018 09:32:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1522942377.49673.245.camel@freebsd.org> Subject: Re: svn commit: r332072 - head/sys/sys From: Ian Lepore To: Roger Pau =?ISO-8859-1?Q?Monn=E9?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 05 Apr 2018 09:32:57 -0600 In-Reply-To: <201804051431.w35EVtg4047897@repo.freebsd.org> References: <201804051431.w35EVtg4047897@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:33:06 -0000 On Thu, 2018-04-05 at 14:31 +0000, Roger Pau Monné wrote: > Author: royger > Date: Thu Apr  5 14:31:54 2018 > New Revision: 332072 > URL: https://svnweb.freebsd.org/changeset/base/332072 > > Log: >   introduce GiB and MiB macros >    >   This macros convert from GiB or MiB into bytes. >    >   Sponsored by: Citrix Systems R&D > > Modified: >   head/sys/sys/param.h > > Modified: head/sys/sys/param.h > ============================================================================== > --- head/sys/sys/param.h Thu Apr  5 14:25:39 2018 (r332071) > +++ head/sys/sys/param.h Thu Apr  5 14:31:54 2018 (r332072) > @@ -362,4 +362,8 @@ __END_DECLS >   */ >  #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) >   > +/* Unit conversion macros. */ > +#define GiB(v) (v ## ULL << 30) > +#define MiB(v) (v ## ULL << 20) > + >  #endif /* _SYS_PARAM_H_ */ > These names don't make it clear whether the conversion is bytes->GiB or GiB->bytes.  The names seem way too generic for a public namespace in a file as heavily included behind your back as param.h is. Also, this completely reasonable usage won't work, likely with confusing compile error messages:   int bytes, gibytes;   ...   bytes = GiB(gibytes); -- Ian From owner-svn-src-all@freebsd.org Thu Apr 5 15:37:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42AD6F8E42F; Thu, 5 Apr 2018 15:37:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E81CE82360; Thu, 5 Apr 2018 15:37:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2F8F24859; Thu, 5 Apr 2018 15:37:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35FbnW1079532; Thu, 5 Apr 2018 15:37:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35FbnCh079531; Thu, 5 Apr 2018 15:37:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804051537.w35FbnCh079531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 5 Apr 2018 15:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332076 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 332076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 15:37:50 -0000 Author: markj Date: Thu Apr 5 15:37:49 2018 New Revision: 332076 URL: https://svnweb.freebsd.org/changeset/base/332076 Log: MFC r331738, r331853: Have TD_LOCKS_DEC() assert that td_locks is positive. Modified: stable/11/sys/sys/proc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Thu Apr 5 15:00:08 2018 (r332075) +++ stable/11/sys/sys/proc.h Thu Apr 5 15:37:49 2018 (r332076) @@ -377,7 +377,11 @@ do { \ } while (0) #define TD_LOCKS_INC(td) ((td)->td_locks++) -#define TD_LOCKS_DEC(td) ((td)->td_locks--) +#define TD_LOCKS_DEC(td) do { \ + KASSERT(SCHEDULER_STOPPED_TD(td) || (td)->td_locks > 0, \ + ("thread %p owns no locks", (td))); \ + (td)->td_locks--; \ +} while (0) #else #define THREAD_LOCKPTR_ASSERT(td, lock) From owner-svn-src-all@freebsd.org Thu Apr 5 15:43:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D00F8E973 for ; Thu, 5 Apr 2018 15:43:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C69F982866 for ; Thu, 5 Apr 2018 15:43:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id h143-v6so3292908ita.4 for ; Thu, 05 Apr 2018 08:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JtTQgxGl/eQurIde6fKwNkIW6kYqXxzOUsw68qZVqzk=; b=Bm5+KSJX5fIFe64ziuIROA4xG803fqMfhzGy+W4g2BF/wMjBvgql5IvN9s3PTcCpQ4 teqe2VfNRa8cEX/bO77XNWhx54FfglbOS4YgrieoEJLo72Zhy9dFKLAumY/h1deaMOsP rceixD1YaaSrXqBeNJj0FA5NgwpIFRH5FaKLKDGwKl1NMrSeXl3I9PqqtwD1LQubIX0Q C/gZc3GHmQZaH5foiKBkVTpzysBbAYPi/hUjdvwuE0txxALJmm1r6paOIKFLYhLp2JEL MsJMK51arUyDnCHL027QTD7qpKRBzHQl6J0I3YB7bqsm49VtAq0hMiJ6O1SPFUwhSGJD w6Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JtTQgxGl/eQurIde6fKwNkIW6kYqXxzOUsw68qZVqzk=; b=SX8eeiBH+VeGKtQDdk024j24AIY+c+UBIaAIPYzL7NEOwO3Fl0ljQwfI6RYCCuRJSK GhbzBgS5a94RkXlaTwC1ZfF0NTbZpxhQzk6g8l8FuxBAWRjNcPRJiWKr+z+uhGbdoAew WOlA8HgMIDi+lRDav4jC5fbc18KH7GpkAaYc0EfFK8MTTMb0ab4cm1gdkKsBYWtnW+DY yD2w7IDNq4NllVGM8qGS2RRfx3e0aFiRrn8L5tYPAhyxk5GMquVfw1lspU1aqdNqSHWo bmqw6aeUEt7rmYI1ZVh925/OQ8n7bg+BQZrEpvRxIFvUpq/peHBQCdv88O5AEUQ6Tb6k A7Hw== X-Gm-Message-State: ALQs6tCGzGIuObLTWeeFGKTo9As3cqcRfXhLl1SiuywLxC4mYllia8lp fN6jlRdu13auuDYkWtmUODAU7DGfddoQOUK42jvgxQ== X-Google-Smtp-Source: AIpwx497GNgdsNuJKj8qjZqMBZ/tCXjUbUo/Q6VaGXZyFXStOd+ExXBecOYHO7pjbl5m9J2GrkcZm9Dj2z3jYtoq3GY= X-Received: by 2002:a24:fa83:: with SMTP id v125-v6mr14339685ith.36.1522943010003; Thu, 05 Apr 2018 08:43:30 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Thu, 5 Apr 2018 08:43:29 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180405152204.GV1774@kib.kiev.ua> References: <201804040237.w342b5EA074884@repo.freebsd.org> <20180405152204.GV1774@kib.kiev.ua> From: Warner Losh Date: Thu, 5 Apr 2018 09:43:29 -0600 X-Google-Sender-Auth: ID164NBgfszhmEXs6zh8GE0cntA Message-ID: Subject: Re: svn commit: r331976 - head/sys/modules/cam To: Konstantin Belousov Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:43:31 -0000 Thanks.... I'll attend to that. Warner On Thu, Apr 5, 2018 at 9:22 AM, Konstantin Belousov wrote: > On Wed, Apr 04, 2018 at 02:37:05AM +0000, Warner Losh wrote: > > Author: imp > > Date: Wed Apr 4 02:37:05 2018 > > New Revision: 331976 > > URL: https://svnweb.freebsd.org/changeset/base/331976 > > > > Log: > > Add nvme_da back. > > > > Now that it can co-exist in the kernel with nvd, add it back to the > > cam module. > > > > Sponsored by: Netflix > > > > Modified: > > head/sys/modules/cam/Makefile > > > > Modified: head/sys/modules/cam/Makefile > > ============================================================ > ================== > > --- head/sys/modules/cam/Makefile Wed Apr 4 02:35:48 2018 > (r331975) > > +++ head/sys/modules/cam/Makefile Wed Apr 4 02:37:05 2018 > (r331976) > > @@ -46,6 +46,7 @@ SRCS+= ata_machdep.c > > SRCS+= ata_pmp.c > > SRCS+= nvme_all.c > > SRCS+= nvme_xpt.c > > +SRCS+= nvme_da.c > > > > EXPORT_SYMS= YES # XXX evaluate > > This change resulted in the following: > > Preloaded elf obj module "/boot/kernel/cam.ko" at 0xffffffff812bb898. > link_elf_obj: symbol nvme_strvis undefined > KLD file cam.ko - could not finalize loading > KLD file ahci.ko - cannot find dependency "cam" > From owner-svn-src-all@freebsd.org Thu Apr 5 15:45:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E777F8EBD3; Thu, 5 Apr 2018 15:45:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40F0882A74; Thu, 5 Apr 2018 15:45:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37B8C249F4; Thu, 5 Apr 2018 15:45:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35Fjtf7084285; Thu, 5 Apr 2018 15:45:55 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35FjsUU084278; Thu, 5 Apr 2018 15:45:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804051545.w35FjsUU084278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 5 Apr 2018 15:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332077 - in head/sys: arm64/coresight conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm64/coresight conf X-SVN-Commit-Revision: 332077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 15:45:55 -0000 Author: br Date: Thu Apr 5 15:45:54 2018 New Revision: 332077 URL: https://svnweb.freebsd.org/changeset/base/332077 Log: Add support for the Coresight technology from ARM Ltd. ARM Coresight is a solution for debug and trace of complex SoC designs. This includes a collection of drivers for ARM Coresight interconnect devices within a small Coresight framework. Supported devices are: o Embedded Trace Macrocell v4 (ETMv4) o Funnel o Dynamic Replicator o Trace Memory Controller (TMC) o CPU debug module Devices are connected to each other internally in SoC and the configuration of each device endpoints is described in FDT. Typical trace flow (as found on Qualcomm Snapdragon 410e): CPU0 -> ETM0 -> funnel1 -> funnel0 -> ETF -> replicator -> ETR -> DRAM CPU1 -> ETM1 -^ CPU2 -> ETM2 -^ CPU3 -> ETM3 -^ Note that both Embedded Trace FIFO (ETF) and Embedded Trace Router (ETR) are hardware configurations of TMC. This is required for upcoming HWPMC tracing support. This is tested on single-core system only. Reviewed by: andrew (partially) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14618 Added: head/sys/arm64/coresight/ head/sys/arm64/coresight/coresight-cmd.c (contents, props changed) head/sys/arm64/coresight/coresight-cpu-debug.c (contents, props changed) head/sys/arm64/coresight/coresight-dynamic-replicator.c (contents, props changed) head/sys/arm64/coresight/coresight-etm4x.c (contents, props changed) head/sys/arm64/coresight/coresight-etm4x.h (contents, props changed) head/sys/arm64/coresight/coresight-funnel.c (contents, props changed) head/sys/arm64/coresight/coresight-funnel.h (contents, props changed) head/sys/arm64/coresight/coresight-tmc.c (contents, props changed) head/sys/arm64/coresight/coresight-tmc.h (contents, props changed) head/sys/arm64/coresight/coresight.c (contents, props changed) head/sys/arm64/coresight/coresight.h (contents, props changed) head/sys/arm64/coresight/coresight_if.m (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm64/coresight/coresight-cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-cmd.c Thu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,156 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "coresight_if.h" + +extern struct coresight_device_list cs_devs; + +static struct coresight_device * +coresight_next_device(struct coresight_device *cs_dev, + struct coresight_event *event) +{ + struct coresight_device *out; + struct endpoint *out_endp; + struct endpoint *endp; + + TAILQ_FOREACH(endp, &cs_dev->pdata->endpoints, link) { + if (endp->slave != 0) + continue; + + out = coresight_get_output_device(endp, &out_endp); + if (out != NULL) { + if (LIST_EMPTY(&event->endplist)) { + /* Add source device */ + endp->cs_dev = cs_dev; + LIST_INSERT_HEAD(&event->endplist, endp, + endplink); + } + + /* Add output device */ + out_endp->cs_dev = out; + LIST_INSERT_HEAD(&event->endplist, out_endp, endplink); + + return (out); + } + } + + return (NULL); +} + +static int +coresight_build_list(struct coresight_device *cs_dev, + struct coresight_event *event) +{ + struct coresight_device *out; + + out = cs_dev; + while (out != NULL) + out = coresight_next_device(out, event); + + return (0); +} + +int +coresight_init_event(int cpu, struct coresight_event *event) +{ + struct coresight_device *cs_dev; + struct endpoint *endp; + + /* Start building path from source device */ + TAILQ_FOREACH(cs_dev, &cs_devs, link) { + if (cs_dev->dev_type == event->src && + cs_dev->pdata->cpu == cpu) { + LIST_INIT(&event->endplist); + coresight_build_list(cs_dev, event); + break; + } + } + + /* Ensure Coresight is initialized for the CPU */ + TAILQ_FOREACH(cs_dev, &cs_devs, link) { + if (cs_dev->dev_type == CORESIGHT_CPU_DEBUG && + cs_dev->pdata->cpu == cpu) + CORESIGHT_INIT(cs_dev->dev); + } + + /* Init all devices in the path */ + LIST_FOREACH(endp, &event->endplist, endplink) { + cs_dev = endp->cs_dev; + CORESIGHT_INIT(cs_dev->dev); + } + + return (0); +} + +void +coresight_enable(int cpu, struct coresight_event *event) +{ + struct coresight_device *cs_dev; + struct endpoint *endp; + + LIST_FOREACH(endp, &event->endplist, endplink) { + cs_dev = endp->cs_dev; + CORESIGHT_ENABLE(cs_dev->dev, endp, event); + } +} + +void +coresight_disable(int cpu, struct coresight_event *event) +{ + struct coresight_device *cs_dev; + struct endpoint *endp; + + LIST_FOREACH(endp, &event->endplist, endplink) { + cs_dev = endp->cs_dev; + CORESIGHT_DISABLE(cs_dev->dev, endp, event); + } +} + +void +coresight_read(int cpu, struct coresight_event *event) +{ + struct endpoint *endp; + + LIST_FOREACH(endp, &event->endplist, endplink) + CORESIGHT_READ(endp->cs_dev->dev, endp, event); +} Added: head/sys/arm64/coresight/coresight-cpu-debug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-cpu-debug.c Thu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,164 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "coresight_if.h" + +#define EDPCSR 0x0a0 +#define EDCIDSR 0x0a4 +#define EDVIDSR 0x0a8 +#define EDPCSR_HI 0x0ac +#define EDOSLAR 0x300 +#define EDPRCR 0x310 +#define EDPRCR_COREPURQ (1 << 3) +#define EDPRCR_CORENPDRQ (1 << 0) +#define EDPRSR 0x314 +#define EDDEVID1 0xfc4 +#define EDDEVID 0xfc8 + +static struct ofw_compat_data compat_data[] = { + { "arm,coresight-cpu-debug", 1 }, + { NULL, 0 } +}; + +struct debug_softc { + struct resource *res; + struct coresight_platform_data *pdata; +}; + +static struct resource_spec debug_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +debug_init(device_t dev) +{ + struct debug_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + /* Unlock Coresight */ + bus_write_4(sc->res, CORESIGHT_LAR, CORESIGHT_UNLOCK); + + /* Unlock Debug */ + bus_write_4(sc->res, EDOSLAR, 0); + + /* Already initialized? */ + reg = bus_read_4(sc->res, EDPRCR); + if (reg & EDPRCR_CORENPDRQ) + return (0); + + /* Enable power */ + reg |= EDPRCR_COREPURQ; + bus_write_4(sc->res, EDPRCR, reg); + + do { + reg = bus_read_4(sc->res, EDPRSR); + } while ((reg & EDPRCR_CORENPDRQ) == 0); + + return (0); +} + +static int +debug_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Coresight CPU Debug"); + + return (BUS_PROBE_DEFAULT); +} + +static int +debug_attach(device_t dev) +{ + struct coresight_desc desc; + struct debug_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, debug_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + sc->pdata = coresight_get_platform_data(dev); + desc.pdata = sc->pdata; + desc.dev = dev; + desc.dev_type = CORESIGHT_CPU_DEBUG; + coresight_register(&desc); + + return (0); +} + +static device_method_t debug_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, debug_probe), + DEVMETHOD(device_attach, debug_attach), + + /* Coresight interface */ + DEVMETHOD(coresight_init, debug_init), + DEVMETHOD_END +}; + +static driver_t debug_driver = { + "debug", + debug_methods, + sizeof(struct debug_softc), +}; + +static devclass_t debug_devclass; + +EARLY_DRIVER_MODULE(debug, simplebus, debug_driver, debug_devclass, + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LATE); +MODULE_VERSION(debug, 1); Added: head/sys/arm64/coresight/coresight-dynamic-replicator.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-dynamic-replicator.c Thu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "coresight_if.h" + +#define REPLICATOR_IDFILTER0 0x00 +#define REPLICATOR_IDFILTER1 0x04 + +static struct ofw_compat_data compat_data[] = { + { "arm,coresight-dynamic-replicator", 1 }, + { NULL, 0 } +}; + +struct replicator_softc { + struct resource *res; + struct coresight_platform_data *pdata; +}; + +static struct resource_spec replicator_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +replicator_init(device_t dev) +{ + struct replicator_softc *sc; + + sc = device_get_softc(dev); + + /* Unlock Coresight */ + bus_write_4(sc->res, CORESIGHT_LAR, CORESIGHT_UNLOCK); + + return (0); +} + +static int +replicator_enable(device_t dev, struct endpoint *endp, + struct coresight_event *event) +{ + struct replicator_softc *sc; + + sc = device_get_softc(dev); + + /* Enable the port. Keep the other port disabled */ + if (endp->reg == 0) { + bus_write_4(sc->res, REPLICATOR_IDFILTER0, 0x00); + bus_write_4(sc->res, REPLICATOR_IDFILTER1, 0xff); + } else { + bus_write_4(sc->res, REPLICATOR_IDFILTER0, 0xff); + bus_write_4(sc->res, REPLICATOR_IDFILTER1, 0x00); + } + + return (0); +} + +static void +replicator_disable(device_t dev, struct endpoint *endp, + struct coresight_event *event) +{ + struct replicator_softc *sc; + + sc = device_get_softc(dev); + + bus_write_4(sc->res, REPLICATOR_IDFILTER0, 0xff); + bus_write_4(sc->res, REPLICATOR_IDFILTER1, 0xff); +} + +static int +replicator_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Coresight Dynamic Replicator"); + + return (BUS_PROBE_DEFAULT); +} + +static int +replicator_attach(device_t dev) +{ + struct replicator_softc *sc; + struct coresight_desc desc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, replicator_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + sc->pdata = coresight_get_platform_data(dev); + desc.pdata = sc->pdata; + desc.dev = dev; + desc.dev_type = CORESIGHT_DYNAMIC_REPLICATOR; + coresight_register(&desc); + + return (0); +} + +static device_method_t replicator_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, replicator_probe), + DEVMETHOD(device_attach, replicator_attach), + + /* Coresight interface */ + DEVMETHOD(coresight_init, replicator_init), + DEVMETHOD(coresight_enable, replicator_enable), + DEVMETHOD(coresight_disable, replicator_disable), + DEVMETHOD_END +}; + +static driver_t replicator_driver = { + "replicator", + replicator_methods, + sizeof(struct replicator_softc), +}; + +static devclass_t replicator_devclass; + +DRIVER_MODULE(replicator, simplebus, replicator_driver, replicator_devclass, + 0, 0); +MODULE_VERSION(replicator, 1); Added: head/sys/arm64/coresight/coresight-etm4x.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-etm4x.c Thu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,307 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "coresight_if.h" + +#define ETM_DEBUG +#undef ETM_DEBUG + +#ifdef ETM_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +/* + * Typical trace flow: + * + * CPU0 -> ETM0 -> funnel1 -> funnel0 -> ETF -> replicator -> ETR -> DRAM + * CPU1 -> ETM1 -> funnel1 -^ + * CPU2 -> ETM2 -> funnel1 -^ + * CPU3 -> ETM3 -> funnel1 -^ + */ + +static struct ofw_compat_data compat_data[] = { + { "arm,coresight-etm4x", 1 }, + { NULL, 0 } +}; + +struct etm_softc { + struct resource *res; + struct coresight_platform_data *pdata; +}; + +static struct resource_spec etm_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +etm_prepare(device_t dev, struct coresight_event *event) +{ + struct etm_softc *sc; + uint32_t reg; + int i; + + sc = device_get_softc(dev); + + /* Configure ETM */ + + /* + * Enable the return stack, global timestamping, + * Context ID, and Virtual context identifier tracing. + */ + reg = TRCCONFIGR_RS | TRCCONFIGR_TS; + reg |= TRCCONFIGR_CID | TRCCONFIGR_VMID; + reg |= TRCCONFIGR_INSTP0_LDRSTR; + reg |= TRCCONFIGR_COND_ALL; + bus_write_4(sc->res, TRCCONFIGR, reg); + + /* Disable all event tracing. */ + bus_write_4(sc->res, TRCEVENTCTL0R, 0); + bus_write_4(sc->res, TRCEVENTCTL1R, 0); + + /* Disable stalling, if implemented. */ + bus_write_4(sc->res, TRCSTALLCTLR, 0); + + /* Enable trace synchronization every 4096 bytes of trace. */ + bus_write_4(sc->res, TRCSYNCPR, TRCSYNCPR_4K); + + /* Set a value for the trace ID */ + bus_write_4(sc->res, TRCTRACEIDR, event->etm.trace_id); + + /* + * Disable the timestamp event. The trace unit still generates + * timestamps due to other reasons such as trace synchronization. + */ + bus_write_4(sc->res, TRCTSCTLR, 0); + + /* + * Enable ViewInst to trace everything, with the start/stop + * logic started. + */ + reg = TRCVICTLR_SSSTATUS; + + /* The number of the single resource used to activate the event. */ + reg |= (1 << EVENT_SEL_S); + + if (event->excp_level > 2) + return (-1); + + reg |= TRCVICTLR_EXLEVEL_NS_M; + reg &= ~TRCVICTLR_EXLEVEL_NS(event->excp_level); + reg |= TRCVICTLR_EXLEVEL_S_M; + reg &= ~TRCVICTLR_EXLEVEL_S(event->excp_level); + bus_write_4(sc->res, TRCVICTLR, reg); + + for (i = 0; i < event->naddr * 2; i++) { + dprintf("configure range %d, address %lx\n", + i, event->addr[i]); + bus_write_8(sc->res, TRCACVR(i), event->addr[i]); + + reg = 0; + /* Secure state */ + reg |= TRCACATR_EXLEVEL_S_M; + reg &= ~TRCACATR_EXLEVEL_S(event->excp_level); + /* Non-secure state */ + reg |= TRCACATR_EXLEVEL_NS_M; + reg &= ~TRCACATR_EXLEVEL_NS(event->excp_level); + bus_write_4(sc->res, TRCACATR(i), reg); + + /* Address range is included */ + reg = bus_read_4(sc->res, TRCVIIECTLR); + reg |= (1 << (TRCVIIECTLR_INCLUDE_S + i / 2)); + bus_write_4(sc->res, TRCVIIECTLR, reg); + } + + /* No address filtering for ViewData. */ + bus_write_4(sc->res, TRCVDARCCTLR, 0); + + /* Clear the STATUS bit to zero */ + bus_write_4(sc->res, TRCSSCSR(0), 0); + + if (event->naddr == 0) { + /* No address range filtering for ViewInst. */ + bus_write_4(sc->res, TRCVIIECTLR, 0); + } + + /* No start or stop points for ViewInst. */ + bus_write_4(sc->res, TRCVISSCTLR, 0); + + /* Disable ViewData */ + bus_write_4(sc->res, TRCVDCTLR, 0); + + /* No address filtering for ViewData. */ + bus_write_4(sc->res, TRCVDSACCTLR, 0); + + return (0); +} + +static int +etm_init(device_t dev) +{ + struct etm_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + /* Unlocking Coresight */ + bus_write_4(sc->res, CORESIGHT_LAR, CORESIGHT_UNLOCK); + + /* Unlocking ETM */ + bus_write_4(sc->res, TRCOSLAR, 0); + + reg = bus_read_4(sc->res, TRCIDR(1)); + dprintf("ETM Version: %d.%d\n", + (reg & TRCIDR1_TRCARCHMAJ_M) >> TRCIDR1_TRCARCHMAJ_S, + (reg & TRCIDR1_TRCARCHMIN_M) >> TRCIDR1_TRCARCHMIN_S); + + return (0); +} + +static int +etm_enable(device_t dev, struct endpoint *endp, + struct coresight_event *event) +{ + struct etm_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + etm_prepare(dev, event); + + /* Enable the trace unit */ + bus_write_4(sc->res, TRCPRGCTLR, TRCPRGCTLR_EN); + + /* Wait for an IDLE bit to be LOW */ + do { + reg = bus_read_4(sc->res, TRCSTATR); + } while ((reg & TRCSTATR_IDLE) == 1); + + if ((bus_read_4(sc->res, TRCPRGCTLR) & TRCPRGCTLR_EN) == 0) + panic("etm is not enabled\n"); + + return (0); +} + +static void +etm_disable(device_t dev, struct endpoint *endp, + struct coresight_event *event) +{ + struct etm_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + /* Disable the trace unit */ + bus_write_4(sc->res, TRCPRGCTLR, 0); + + /* Wait for an IDLE bit */ + do { + reg = bus_read_4(sc->res, TRCSTATR); + } while ((reg & TRCSTATR_IDLE) == 0); +} + +static int +etm_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "AArch64 Embedded Trace Macrocell"); + + return (BUS_PROBE_DEFAULT); +} + +static int +etm_attach(device_t dev) +{ + struct coresight_desc desc; + struct etm_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, etm_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + sc->pdata = coresight_get_platform_data(dev); + desc.pdata = sc->pdata; + desc.dev = dev; + desc.dev_type = CORESIGHT_ETMV4; + coresight_register(&desc); + + return (0); +} + +static device_method_t etm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, etm_probe), + DEVMETHOD(device_attach, etm_attach), + + /* Coresight interface */ + DEVMETHOD(coresight_init, etm_init), + DEVMETHOD(coresight_enable, etm_enable), + DEVMETHOD(coresight_disable, etm_disable), + DEVMETHOD_END +}; + +static driver_t etm_driver = { + "etm", + etm_methods, + sizeof(struct etm_softc), +}; + +static devclass_t etm_devclass; + +DRIVER_MODULE(etm, simplebus, etm_driver, etm_devclass, 0, 0); +MODULE_VERSION(etm, 1); Added: head/sys/arm64/coresight/coresight-etm4x.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-etm4x.h Thu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,175 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARM64_CORESIGHT_ETM4X_H_ +#define _ARM64_CORESIGHT_ETM4X_H_ + +#define TRCPRGCTLR 0x004 /* Trace Programming Control Register */ +#define TRCPRGCTLR_EN (1 << 0) /* Trace unit enable bit */ +#define TRCPROCSELR 0x008 /* Trace PE Select Control Register */ +#define TRCSTATR 0x00C /* Trace Trace Status Register */ +#define TRCSTATR_PMSTABLE (1 << 1) /* The programmers' model is stable. */ +#define TRCSTATR_IDLE (1 << 0) /* The trace unit is idle. */ +#define TRCCONFIGR 0x010 /* Trace Trace Configuration Register */ +#define TRCCONFIGR_DV (1 << 17) /* Data value tracing is enabled when INSTP0 is not 0b00 */ +#define TRCCONFIGR_DA (1 << 16) /* Data address tracing is enabled when INSTP0 is not 0b00. */ +#define TRCCONFIGR_VMIDOPT (1 << 15) /* Control bit to configure the Virtual context identifier value */ +#define TRCCONFIGR_QE_S 13 /* Q element enable field */ +#define TRCCONFIGR_QE_M (0x3 << TRCCONFIGR_QE_S) +#define TRCCONFIGR_RS (1 << 12) /* Return stack enable bit */ +#define TRCCONFIGR_TS (1 << 11) /* Global timestamp tracing is enabled. */ +#define TRCCONFIGR_COND_S 8 /* Conditional instruction tracing bit. */ +#define TRCCONFIGR_COND_M (0x7 << TRCCONFIGR_COND_S) +#define TRCCONFIGR_COND_DIS 0 +#define TRCCONFIGR_COND_LDR (1 << TRCCONFIGR_COND_S) /* Conditional load instructions are traced. */ +#define TRCCONFIGR_COND_STR (2 << TRCCONFIGR_COND_S) /* Conditional store instructions are traced. */ +#define TRCCONFIGR_COND_LDRSTR (3 << TRCCONFIGR_COND_S) /* Conditional load and store instructions are traced. */ +#define TRCCONFIGR_COND_ALL (7 << TRCCONFIGR_COND_S) /* All conditional instructions are traced. */ +#define TRCCONFIGR_VMID (1 << 7) /* Virtual context identifier tracing is enabled. */ +#define TRCCONFIGR_CID (1 << 6) /* Context ID tracing is enabled. */ +#define TRCCONFIGR_CCI (1 << 4) /* Cycle counting in the instruction trace is enabled. */ +#define TRCCONFIGR_BB (1 << 3) /* Branch broadcast mode is enabled. */ +#define TRCCONFIGR_INSTP0_S 1 /* Instruction P0 field. */ +#define TRCCONFIGR_INSTP0_M (0x3 << TRCCONFIGR_INSTP0_S) +#define TRCCONFIGR_INSTP0_NONE 0 /* Do not trace load and store instructions as P0 instructions. */ +#define TRCCONFIGR_INSTP0_LDR (1 << TRCCONFIGR_INSTP0_S) /* Trace load instructions as P0 instructions. */ +#define TRCCONFIGR_INSTP0_STR (2 << TRCCONFIGR_INSTP0_S) /* Trace store instructions as P0 instructions. */ +#define TRCCONFIGR_INSTP0_LDRSTR (3 << TRCCONFIGR_INSTP0_S) /* Trace load and store instructions as P0 instr. */ +#define TRCAUXCTLR 0x018 /* Trace Auxiliary Control Register */ +#define TRCEVENTCTL0R 0x020 /* Trace Event Control 0 Register */ +#define TRCEVENTCTL1R 0x024 /* Trace Event Control 1 Register */ +#define TRCSTALLCTLR 0x02C /* Trace Stall Control Register */ +#define TRCTSCTLR 0x030 /* Trace Global Timestamp Control Register */ +#define TRCSYNCPR 0x034 /* Trace Synchronization Period Register */ +#define TRCSYNCPR_PERIOD_S 0 +#define TRCSYNCPR_PERIOD_M 0x1f +#define TRCSYNCPR_1K (10 << TRCSYNCPR_PERIOD_S) +#define TRCSYNCPR_2K (11 << TRCSYNCPR_PERIOD_S) +#define TRCSYNCPR_4K (12 << TRCSYNCPR_PERIOD_S) +#define TRCCCCTLR 0x038 /* Trace Cycle Count Control Register */ +#define TRCBBCTLR 0x03C /* Trace Branch Broadcast Control Register */ +#define TRCTRACEIDR 0x040 /* Trace Trace ID Register */ +#define TRCQCTLR 0x044 /* Trace Q Element Control Register */ +#define TRCQCTLR_MODE_INC (1 << 8) /* Include mode. */ +#define TRCVICTLR 0x080 /* Trace ViewInst Main Control Register */ +#define TRCVICTLR_SSSTATUS (1 << 9) /* The start/stop logic is in the started state. */ +#define TRCVICTLR_EXLEVEL_NS_S 20 +#define TRCVICTLR_EXLEVEL_NS_M (0xf << TRCVICTLR_EXLEVEL_NS_S) +#define TRCVICTLR_EXLEVEL_NS(n) (0x1 << ((n) + TRCVICTLR_EXLEVEL_NS_S)) +#define TRCVICTLR_EXLEVEL_S_S 16 +#define TRCVICTLR_EXLEVEL_S_M (0xf << TRCVICTLR_EXLEVEL_S_S) +#define TRCVICTLR_EXLEVEL_S(n) (0x1 << ((n) + TRCVICTLR_EXLEVEL_S_S)) +#define EVENT_SEL_S 0 +#define EVENT_SEL_M (0x1f << EVENT_SEL_S) +#define TRCVIIECTLR 0x084 /* Trace ViewInst Include/Exclude Control Register */ +#define TRCVIIECTLR_INCLUDE_S 0 +#define TRCVISSCTLR 0x088 /* Trace ViewInst Start/Stop Control Register */ +#define TRCVIPCSSCTLR 0x08C /* Trace ViewInst Start/Stop PE Comparator Control Register */ +#define TRCVDCTLR 0x0A0 /* Trace ViewData Main Control Register */ +#define TRCVDCTLR_TRCEXDATA (1 << 12) /* Exception and exception return data transfers are traced */ +#define TRCVDCTLR_TBI (1 << 11) /* The trace unit assigns bits[63:56] to have the same value as bits[63:56] of the data address. */ +#define TRCVDCTLR_PCREL (1 << 10) /* The trace unit does not trace the address or value portions of PC-relative transfers. */ +#define TRCVDCTLR_SPREL_S 8 +#define TRCVDCTLR_SPREL_M (0x3 << TRCVDCTLR_SPREL_S) +#define TRCVDCTLR_EVENT_S 0 +#define TRCVDCTLR_EVENT_M (0xff << TRCVDCTLR_EVENT_S) +#define TRCVDSACCTLR 0x0A4 /* Trace ViewData Include/Exclude Single Address Comparator Control Register */ +#define TRCVDARCCTLR 0x0A8 /* Trace ViewData Include/Exclude Address Range Comparator Control Register */ +#define TRCSEQEVR(n) (0x100 + (n) * 0x4) /* Trace Sequencer State Transition Control Register [n=0-2] */ +#define TRCSEQRSTEVR 0x118 /* Trace Sequencer Reset Control Register */ +#define TRCSEQSTR 0x11C /* Trace Sequencer State Register */ +#define TRCEXTINSELR 0x120 /* Trace External Input Select Register */ +#define TRCCNTRLDVR(n) (0x140 + (n) * 0x4) /* 32 Trace Counter Reload Value Register [n=0-3] */ +#define TRCCNTCTLR(n) (0x150 + (n) * 0x4) /* 32 Trace Counter Control Register [n=0-3] */ +#define TRCCNTVR(n) (0x160 + (n) * 0x4) /* 32 Trace Counter Value Register [n=0-3] */ +#define TRCIMSPEC(n) (0x1C0 + (n) * 0x4) /* Trace IMPLEMENTATION DEFINED register [n=0-7] */ + +#define TRCIDR0(n) (0x1E0 + 0x4 * (n)) +#define TRCIDR8(n) (0x180 + 0x4 * (n)) +#define TRCIDR(n) ((n > 7) ? TRCIDR8(n) : TRCIDR0(n)) +#define TRCIDR1_TRCARCHMAJ_S 8 +#define TRCIDR1_TRCARCHMAJ_M (0xf << TRCIDR1_TRCARCHMAJ_S) +#define TRCIDR1_TRCARCHMIN_S 4 +#define TRCIDR1_TRCARCHMIN_M (0xf << TRCIDR1_TRCARCHMIN_S) + +#define TRCRSCTLR(n) (0x200 + (n) * 0x4) /* Trace Resource Selection Control Register [n=2-31] */ +#define TRCSSCCR(n) (0x280 + (n) * 0x4) /* Trace Single-shot Comparator Control Register [n=0-7] */ +#define TRCSSCSR(n) (0x2A0 + (n) * 0x4) /* Trace Single-shot Comparator Status Register [n=0-7] */ +#define TRCSSPCICR(n) (0x2C0 + (n) * 0x4) /* Trace Single-shot PE Comparator Input Control [n=0-7] */ +#define TRCOSLAR 0x300 /* Management OS Lock Access Register */ +#define TRCOSLSR 0x304 /* Management OS Lock Status Register */ +#define TRCPDCR 0x310 /* Management PowerDown Control Register */ +#define TRCPDSR 0x314 /* Management PowerDown Status Register */ +#define TRCACVR(n) (0x400 + (n) * 0x8) /* Trace Address Comparator Value Register [n=0-15] */ +#define TRCACATR(n) (0x480 + (n) * 0x8) /* Trace Address Comparator Access Type Register [n=0-15] */ +#define TRCACATR_DTBM (1 << 21) +#define TRCACATR_DATARANGE (1 << 20) +#define TRCACATR_DATASIZE_S 18 +#define TRCACATR_DATASIZE_M (0x3 << TRCACATR_DATASIZE_S) +#define TRCACATR_DATASIZE_B (0x0 << TRCACATR_DATASIZE_S) +#define TRCACATR_DATASIZE_HW (0x1 << TRCACATR_DATASIZE_S) +#define TRCACATR_DATASIZE_W (0x2 << TRCACATR_DATASIZE_S) +#define TRCACATR_DATASIZE_DW (0x3 << TRCACATR_DATASIZE_S) +#define TRCACATR_DATAMATCH_S 16 +#define TRCACATR_DATAMATCH_M (0x3 << TRCACATR_DATAMATCH_S) +#define TRCACATR_EXLEVEL_S_S 8 +#define TRCACATR_EXLEVEL_S_M (0xf << TRCACATR_EXLEVEL_S_S) +#define TRCACATR_EXLEVEL_S(n) (0x1 << ((n) + TRCACATR_EXLEVEL_S_S)) +#define TRCACATR_EXLEVEL_NS_S 12 +#define TRCACATR_EXLEVEL_NS_M (0xf << TRCACATR_EXLEVEL_NS_S) +#define TRCACATR_EXLEVEL_NS(n) (0x1 << ((n) + TRCACATR_EXLEVEL_NS_S)) +#define TRCDVCVR(n) (0x500 + (n) * 0x8) /* Trace Data Value Comparator Value Register [n=0-7] */ +#define TRCDVCMR(n) (0x580 + (n) * 0x8) /* Trace Data Value Comparator Mask Register [n=0-7] */ +#define TRCCIDCVR(n) (0x600 + (n) * 0x8) /* Trace Context ID Comparator Value Register [n=0-7] */ +#define TRCVMIDCVR(n) (0x640 + (n) * 0x8) /* Trace Virtual context identifier Comparator Value [n=0-7] */ +#define TRCCIDCCTLR0 0x680 /* Trace Context ID Comparator Control Register 0 */ +#define TRCCIDCCTLR1 0x684 /* Trace Context ID Comparator Control Register 1 */ +#define TRCVMIDCCTLR0 0x688 /* Trace Virtual context identifier Comparator Control Register 0 */ +#define TRCVMIDCCTLR1 0x68C /* Trace Virtual context identifier Comparator Control Register 1 */ +#define TRCITCTRL 0xF00 /* Management Integration Mode Control register */ +#define TRCCLAIMSET 0xFA0 /* Trace Claim Tag Set register */ +#define TRCCLAIMCLR 0xFA4 /* Trace Claim Tag Clear register */ +#define TRCDEVAFF0 0xFA8 /* Management Device Affinity register 0 */ +#define TRCDEVAFF1 0xFAC /* Management Device Affinity register 1 */ +#define TRCLAR 0xFB0 /* Management Software Lock Access Register */ +#define TRCLSR 0xFB4 /* Management Software Lock Status Register */ +#define TRCAUTHSTATUS 0xFB8 /* Management Authentication Status register */ +#define TRCDEVARCH 0xFBC /* Management Device Architecture register */ +#define TRCDEVID 0xFC8 /* Management Device ID register */ +#define TRCDEVTYPE 0xFCC /* Management Device Type register */ +#define TRCPIDR4 0xFD0 /* Management Peripheral ID4 Register */ +#define TRCPIDR(n) (0xFE0 + (n) * 0x4) /* Management Peripheral IDn Register [n=0-3] */ +#define TRCPIDR567(n) (0xFD4 + ((n) - 5) * 0x4) /* Management Peripheral ID5 to Peripheral ID7 Registers */ +#define TRCCIDR(n) (0xFF0 + (n) * 0x4) /* Management Component IDn Register [n=0-4] */ + +#endif /* !_ARM64_CORESIGHT_ETM4X_H_ */ Added: head/sys/arm64/coresight/coresight-funnel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/coresight/coresight-funnel.c Thu Apr 5 15:45:54 2018 (r332077) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 5 15:46:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B0F7F8EC70; Thu, 5 Apr 2018 15:46:25 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 089B382BCC; Thu, 5 Apr 2018 15:46:25 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id b127so6980758wmf.5; Thu, 05 Apr 2018 08:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=+iQBHN6MuEXXuH5MHTqc3xzybLKCp18b5mC8LLkvkOc=; b=YBEzVE13rOrepXug3vKUDBUSvDeOPo9TAikGAQeuJIKGQRn4BA+Gn78C3Uh6gm0+tx Ptjqb7iySuwTPy2ur/1kyFCXEtXNTEIJf4rYtoPNhWUDPdrhk/SJTXYO9uH3GA1jmqKL H5SoB3eZtAHHNSM9K/I9Wg7EzSSog4hZHpWS3qH3QEdaL5crKkTTViMR7DKO3+4FHrVG TVI6ipTyTNZKLPf7XYIL0QB1UNODbTrr8XfVU/5olkhP+UIo0oGJMII4I7lz04t4S32q DygxX1hDQToJ2vGjZhGNxP7NeV8lpEahuYkH7DzMIIazW0slbs75a8BnAhv7vqAwW6nG h+4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=+iQBHN6MuEXXuH5MHTqc3xzybLKCp18b5mC8LLkvkOc=; b=JRMnZkIQmylmPrnVSkcELHnLch9GiPZbn9EY880Urhr2AYKQXW/58HAxRPleo0GYsO DhNsVuddkXuSH+JuAmhxmePpXuhMvwOMQqt1yZogy2/iSwnqZYc2FxLfeUe28+JBV8Zx FCnVEIVvCMnTPHVRyQqb9wfdV0cu0gD+bNNmJDEHWVZwVHuvZifC0qtDc5M+NFk5tEN5 D+wDuUX6ic2YE+vzWvbV5/sVHvSLLri1FbMm7iHnDHmWaIAjIsSFDWhdWKlf6d8zx7xV xwoF+cP6VG9xs+agNNTw5+3aml76HnNoSPk2P5OV58SKCZLen22TJe7NDPBGcd7adZIp gvew== X-Gm-Message-State: ALQs6tCljR6S/Hb8Gk31xjtbuM+zdxL1//1FvzFzcw0LDrkx8K2dNrdy lZRqM1p4H7RM9c1OWsgutoezzA== X-Google-Smtp-Source: AIpwx48tmlEY5nzJC+dvJ6p31wwfmTj2oriRf2gAHtys3K8tyj6lK28CL1Np05nU/a7b/vR26JNSbA== X-Received: by 10.80.243.4 with SMTP id p4mr3411790edm.131.1522943183714; Thu, 05 Apr 2018 08:46:23 -0700 (PDT) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id y6sm4719240edh.3.2018.04.05.08.46.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 08:46:22 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 5 Apr 2018 16:46:19 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332072 - head/sys/sys Message-ID: <20180405154619.q3blip266qa3z5ut@MacBook-Pro-de-Roger.local> References: <201804051431.w35EVtg4047897@repo.freebsd.org> <1522942377.49673.245.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1522942377.49673.245.camel@freebsd.org> User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 15:46:26 -0000 On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > On Thu, 2018-04-05 at 14:31 +0000, Roger Pau Monné wrote: > > Author: royger > > Date: Thu Apr  5 14:31:54 2018 > > New Revision: 332072 > > URL: https://svnweb.freebsd.org/changeset/base/332072 > > > > Log: > >   introduce GiB and MiB macros > >    > >   This macros convert from GiB or MiB into bytes. > >    > >   Sponsored by: Citrix Systems R&D > > > > Modified: > >   head/sys/sys/param.h > > > > Modified: head/sys/sys/param.h > > ============================================================================== > > --- head/sys/sys/param.h Thu Apr  5 14:25:39 2018 (r332071) > > +++ head/sys/sys/param.h Thu Apr  5 14:31:54 2018 (r332072) > > @@ -362,4 +362,8 @@ __END_DECLS > >   */ > >  #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) > >   > > +/* Unit conversion macros. */ > > +#define GiB(v) (v ## ULL << 30) > > +#define MiB(v) (v ## ULL << 20) > > + > >  #endif /* _SYS_PARAM_H_ */ > > > > These names don't make it clear whether the conversion is bytes->GiB or > GiB->bytes.  The names seem way too generic for a public namespace in a > file as heavily included behind your back as param.h is. > > Also, this completely reasonable usage won't work, likely with > confusing compile error messages: > >   int bytes, gibytes; >   ... >   bytes = GiB(gibytes); I find those helpful for their specific usage. I could introduce static inline functions like: size_t gb_to_bytes(size_t)... But I assume this is also going to cause further discussion. Roger. From owner-svn-src-all@freebsd.org Thu Apr 5 15:52:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B54F8F2AF; Thu, 5 Apr 2018 15:52:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60C028306C; Thu, 5 Apr 2018 15:52:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42FBB24B8D; Thu, 5 Apr 2018 15:52:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35FqLMt088907; Thu, 5 Apr 2018 15:52:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35FqLUP088905; Thu, 5 Apr 2018 15:52:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804051552.w35FqLUP088905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 5 Apr 2018 15:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332078 - in stable/11/sys: kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys: kern sys X-SVN-Commit-Revision: 332078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 15:52:22 -0000 Author: markj Date: Thu Apr 5 15:52:20 2018 New Revision: 332078 URL: https://svnweb.freebsd.org/changeset/base/332078 Log: MFC r331245: Drop KTR_CONTENTION. Modified: stable/11/sys/kern/kern_mutex.c stable/11/sys/sys/ktr_class.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mutex.c ============================================================================== --- stable/11/sys/kern/kern_mutex.c Thu Apr 5 15:45:54 2018 (r332077) +++ stable/11/sys/kern/kern_mutex.c Thu Apr 5 15:52:20 2018 (r332078) @@ -471,9 +471,6 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) struct turnstile *ts; uintptr_t tid; struct thread *owner; -#ifdef KTR - int cont_logged = 0; -#endif #ifdef LOCK_PROFILING int contested = 0; uint64_t waittime = 0; @@ -617,17 +614,6 @@ retry_turnstile: */ mtx_assert(m, MA_NOTOWNED); -#ifdef KTR - if (!cont_logged) { - CTR6(KTR_CONTENTION, - "contention: %p at %s:%d wants %s, taken by %s:%d", - (void *)tid, file, line, m->lock_object.lo_name, - WITNESS_FILE(&m->lock_object), - WITNESS_LINE(&m->lock_object)); - cont_logged = 1; - } -#endif - /* * Block on the turnstile. */ @@ -645,13 +631,6 @@ retry_turnstile: #endif v = MTX_READ_VALUE(m); } -#ifdef KTR - if (cont_logged) { - CTR4(KTR_CONTENTION, - "contention end: %s acquired by %p at %s:%d", - m->lock_object.lo_name, (void *)tid, file, line); - } -#endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) if (__predict_true(!doing_lockprof)) return; Modified: stable/11/sys/sys/ktr_class.h ============================================================================== --- stable/11/sys/sys/ktr_class.h Thu Apr 5 15:45:54 2018 (r332077) +++ stable/11/sys/sys/ktr_class.h Thu Apr 5 15:52:20 2018 (r332078) @@ -63,7 +63,7 @@ #define KTR_VM 0x00100000 /* The virtual memory system */ #define KTR_INET 0x00200000 /* IPv4 stack */ #define KTR_RUNQ 0x00400000 /* Run queue */ -#define KTR_CONTENTION 0x00800000 /* Lock contention */ +#define KTR_SPARE5 0x00800000 #define KTR_UMA 0x01000000 /* UMA slab allocator */ #define KTR_CALLOUT 0x02000000 /* Callouts and timeouts */ #define KTR_GEOM 0x04000000 /* GEOM I/O events */ From owner-svn-src-all@freebsd.org Thu Apr 5 15:58:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AEAAF8F80D for ; Thu, 5 Apr 2018 15:58:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7CF8353E for ; Thu, 5 Apr 2018 15:58:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id y128so31188732iod.4 for ; Thu, 05 Apr 2018 08:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YLfxFBoSQGkqIW65V6UOkbgjI8VF/Dcc1eUDnlivCTY=; b=OaEKY9r8SEWlvZGUCgftNma7j3ZQYreN0E4fP5J/W84/LU9NF/3yfp9XfmlYHWvo47 zn9Q68wuKMzsFNzzE+fT8NRpx0+RwfsjAzTSqXGcOIf4PEiSNiKGNMXz3nHpm95jMwNM JGj5ZSsQj55ow7rW30DL8qC/F2E7tiaFVzsDzmpqJTNPOxdlKui+V15VKDPC/WV0R8bA WxU0auijCOLVCaehK0FME/s/EtMg9x0W/uDN4jDPrSxg/kUtbiLywp355kMU0eP+N66I hw/eAdwZbM4htNBeHKJ9Yr+cwMpSmWzi6k9PjkIKCn3ZA8KfKtjDkgXUU9g6bLpw03Az VB5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YLfxFBoSQGkqIW65V6UOkbgjI8VF/Dcc1eUDnlivCTY=; b=YcG0dYCgc3jdoYK04NISiQBmJkA7UuO0OAiXxJBpy8LmsDUl3plRFVJ6PYtSrkAiOW a4eiI2wctWzAtJKIyeK1CjTIwPdxwRA7VSQc7ZIwpR+bplhwkYqtObjyztarmgJTC+0m 8QHrvC+eBVpUPiFE3pxJkOhxtGFwDgbcW1e4pcFbbHBG6gv7UFHuCT9CLdazrHF1wenL wwgQ19vuQHC6KnqilO3Pw8fr8z7IswwHd0zz/sWBa/N2mCcwCPSVXCc5jkkBp8RajkSr rpoxPfkK4s7yYDcxOYfVQ1845OPQkxGjLIJw9zXzgLxY36gBkqr/vlsg0BiroQH/YL3h AerA== X-Gm-Message-State: ALQs6tD+56HvvfuG7iIuP9ATLXnrLzMNwQd9spEG+rrr9OZPF2vB+gKG zgrFBgFQAFZ+tq+hJ3Iw4Tw3VSOHaDohvGQ5QvlnIg== X-Google-Smtp-Source: AIpwx48OAVYzY0JqVlQnMYHBFyMwGNmLcwSYX6vI6O2RhjKlbu3eWjQDmhjIca2vESzvuQOK45+/D52vJ0nIlBkiTQA= X-Received: by 10.107.144.11 with SMTP id s11mr21298407iod.37.1522943917285; Thu, 05 Apr 2018 08:58:37 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Thu, 5 Apr 2018 08:58:36 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180405154619.q3blip266qa3z5ut@MacBook-Pro-de-Roger.local> References: <201804051431.w35EVtg4047897@repo.freebsd.org> <1522942377.49673.245.camel@freebsd.org> <20180405154619.q3blip266qa3z5ut@MacBook-Pro-de-Roger.local> From: Warner Losh Date: Thu, 5 Apr 2018 09:58:36 -0600 X-Google-Sender-Auth: 4xnmOBh0savK7uMhUlT9cEVyNhE Message-ID: Subject: Re: svn commit: r332072 - head/sys/sys To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 15:58:38 -0000 On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monn=C3=A9 w= rote: > On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > > On Thu, 2018-04-05 at 14:31 +0000, Roger Pau Monn=C3=A9 wrote: > > > Author: royger > > > Date: Thu Apr 5 14:31:54 2018 > > > New Revision: 332072 > > > URL: https://svnweb.freebsd.org/changeset/base/332072 > > > > > > Log: > > > introduce GiB and MiB macros > > > > > > This macros convert from GiB or MiB into bytes. > > > > > > Sponsored by: Citrix Systems R&D > > > > > > Modified: > > > head/sys/sys/param.h > > > > > > Modified: head/sys/sys/param.h > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > --- head/sys/sys/param.h Thu Apr 5 14:25:39 2018 (r332071) > > > +++ head/sys/sys/param.h Thu Apr 5 14:31:54 2018 (r332072) > > > @@ -362,4 +362,8 @@ __END_DECLS > > > */ > > > #define __PAST_END(array, offset) (((__typeof__(*(array)) > *)(array))[offset]) > > > > > > +/* Unit conversion macros. */ > > > +#define GiB(v) (v ## ULL << 30) > > > +#define MiB(v) (v ## ULL << 20) > > > + > > > #endif /* _SYS_PARAM_H_ */ > > > > > > > These names don't make it clear whether the conversion is bytes->GiB or > > GiB->bytes. The names seem way too generic for a public namespace in a > > file as heavily included behind your back as param.h is. > > > > Also, this completely reasonable usage won't work, likely with > > confusing compile error messages: > > > > int bytes, gibytes; > > ... > > bytes =3D GiB(gibytes); > > I find those helpful for their specific usage. I could introduce > static inline functions like: > > size_t gb_to_bytes(size_t)... > > But I assume this is also going to cause further discussion. > Yea, traditional macro names would be "gibtob" and "btogib" but I didn't just reply to bikeshed a name: But you don't need to specify a type, consider the current btodb macro: #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ (sizeof (bytes) > sizeof(long) \ ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) which shows how to do this in a macro, which is orthogonal to any name you may choose. I can also bikeshed function vs macro :) Warner From owner-svn-src-all@freebsd.org Thu Apr 5 16:07:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23332F900B5; Thu, 5 Apr 2018 16:07:41 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CADE83B98; Thu, 5 Apr 2018 16:07:40 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id b127so7156184wmf.5; Thu, 05 Apr 2018 09:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Z0b91rhCRGZ1zQOMu/vTjTE7YhkSU99B1x+iPm20ReU=; b=tI77K8KsvFgTS9MCWUUVV2uPFpa4d+qm+/MMrdXN3RQsUVi16O8d72hBWbzU+l80ij lpp9qrX6E3CPfwek/FQJFKysJvHPCUxYeZHkqD8yoYfErDZZIbd9tIOsny2N4n1BiwzO /buyQua1AvNh2MbhRWPbx8O5YyRr9QLKo87FoI/AdxMIgi7M9/oaSUNPoBpFGcH/Lnd0 uG5n8PDo7NRg0JDS3TTV0VCwk1C8ZFIc//EuqQZZnGQQgRtmY8jq7xOzy16DDeghTAeG BT4jYZuPP2JBSWl186XTZfQCakakMWPzjpawboto5qOEEYgerG73tF+zULPTD8EEvohu rZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Z0b91rhCRGZ1zQOMu/vTjTE7YhkSU99B1x+iPm20ReU=; b=UISoxshLgtTks60qNJ+/z6TXm4otzAKZUUvpfCtTkbxXJMYWjS4+UYe9OOD2gA0NdS IRZRLKY6nMpDTi1trWgP1/yYSzfmbiXpoaMPs8CIXHmrhvKp1AjBL812BNfZNxHmJj/d uv0gHmjp2vr3MRHfV2QZBIx1FCy+7jxCxuIXpi15rLSOfHbxWujG058pSnjRaYvbC8Qn K3acLTvys4vf0sy10tFVPKp/IFHgld1Rx0wFcLTmaD51btYQq9+aDIWIA27HHqb2emEt j9CKyjUYsKL70aK6GNhEEpVvxrMo2+kiBKBBnDHO9rluJVvtaZRAfWMfaZ3NeeSor/pk 2pfg== X-Gm-Message-State: ALQs6tBEPYqgbyVd/bDE31LiD+yHWuegwcrnonrszuKNJVY6m8wj0dnK HO+CVLuASBJuHnn/jQ7Ug+YhAA== X-Google-Smtp-Source: AIpwx49nJLP4KjsODhBvbPCZfzMBt7PFywSWZ8WT33mWPk38Qi4iMzNWxDKWE/L0SSeR1/i82NfkVA== X-Received: by 10.80.242.135 with SMTP id f7mr3485546edm.169.1522944459508; Thu, 05 Apr 2018 09:07:39 -0700 (PDT) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id n21sm4387374eda.73.2018.04.05.09.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 09:07:38 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 5 Apr 2018 17:07:35 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Warner Losh Cc: Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332072 - head/sys/sys Message-ID: <20180405160735.wkpsqqiyoyh7ewuk@MacBook-Pro-de-Roger.local> References: <201804051431.w35EVtg4047897@repo.freebsd.org> <1522942377.49673.245.camel@freebsd.org> <20180405154619.q3blip266qa3z5ut@MacBook-Pro-de-Roger.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 16:07:41 -0000 On Thu, Apr 05, 2018 at 09:58:36AM -0600, Warner Losh wrote: > On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monné wrote: > > > On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > > > On Thu, 2018-04-05 at 14:31 +0000, Roger Pau Monné wrote: > > > > Author: royger > > > > Date: Thu Apr 5 14:31:54 2018 > > > > New Revision: 332072 > > > > URL: https://svnweb.freebsd.org/changeset/base/332072 > > > > > > > > Log: > > > > introduce GiB and MiB macros > > > > > > > > This macros convert from GiB or MiB into bytes. > > > > > > > > Sponsored by: Citrix Systems R&D > > > > > > > > Modified: > > > > head/sys/sys/param.h > > > > > > > > Modified: head/sys/sys/param.h > > > > ============================================================ > > ================== > > > > --- head/sys/sys/param.h Thu Apr 5 14:25:39 2018 (r332071) > > > > +++ head/sys/sys/param.h Thu Apr 5 14:31:54 2018 (r332072) > > > > @@ -362,4 +362,8 @@ __END_DECLS > > > > */ > > > > #define __PAST_END(array, offset) (((__typeof__(*(array)) > > *)(array))[offset]) > > > > > > > > +/* Unit conversion macros. */ > > > > +#define GiB(v) (v ## ULL << 30) > > > > +#define MiB(v) (v ## ULL << 20) > > > > + > > > > #endif /* _SYS_PARAM_H_ */ > > > > > > > > > > These names don't make it clear whether the conversion is bytes->GiB or > > > GiB->bytes. The names seem way too generic for a public namespace in a > > > file as heavily included behind your back as param.h is. > > > > > > Also, this completely reasonable usage won't work, likely with > > > confusing compile error messages: > > > > > > int bytes, gibytes; > > > ... > > > bytes = GiB(gibytes); > > > > I find those helpful for their specific usage. I could introduce > > static inline functions like: > > > > size_t gb_to_bytes(size_t)... > > > > But I assume this is also going to cause further discussion. > > > > Yea, traditional macro names would be "gibtob" and "btogib" but I didn't > just reply to bikeshed a name: > > But you don't need to specify a type, consider the current btodb macro: > #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) > */ \ > (sizeof (bytes) > sizeof(long) \ > ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ > : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) > > which shows how to do this in a macro, which is orthogonal to any name you > may choose. I can also bikeshed function vs macro :) I was just going to remove those from here and place them in the files where I use them, but I can also change them to: #define gibtob(gib) ((unsigned long long)(gib) << 30) #define mibtob(mib) ((unsigned long long)(mib) << 20) If it's not going to start a bikeshed. Thanks, Roger. From owner-svn-src-all@freebsd.org Thu Apr 5 17:26:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C80AF94A8C; Thu, 5 Apr 2018 17:26:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2F1874BF; Thu, 5 Apr 2018 17:26:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1455D25A89; Thu, 5 Apr 2018 17:26:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35HQ3X6034992; Thu, 5 Apr 2018 17:26:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35HQ3d3034991; Thu, 5 Apr 2018 17:26:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804051726.w35HQ3d3034991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 5 Apr 2018 17:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332079 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 332079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 17:26:04 -0000 Author: markj Date: Thu Apr 5 17:26:03 2018 New Revision: 332079 URL: https://svnweb.freebsd.org/changeset/base/332079 Log: Fix the definitions of get_cpu() and put_cpu(). They are supposed to disable preemption. Reported by: rstone MFC after: 5 days Modified: head/sys/compat/linuxkpi/common/include/asm/smp.h Modified: head/sys/compat/linuxkpi/common/include/asm/smp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/smp.h Thu Apr 5 15:52:20 2018 (r332078) +++ head/sys/compat/linuxkpi/common/include/asm/smp.h Thu Apr 5 17:26:03 2018 (r332079) @@ -38,11 +38,11 @@ int linux_wbinvd_on_all_cpus(void); #endif #define get_cpu() ({ \ - sched_pin(); \ + critical_enter(); \ PCPU_GET(cpuid); \ }) #define put_cpu() \ - sched_unpin() + critical_exit() #endif /* _ASM_SMP_H_ */ From owner-svn-src-all@freebsd.org Thu Apr 5 17:31:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59CE2F950C7; Thu, 5 Apr 2018 17:31:33 +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 9C34287825; Thu, 5 Apr 2018 17:31:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 55AD11A2B5E; Fri, 6 Apr 2018 03:12:08 +1000 (AEST) Date: Fri, 6 Apr 2018 03:12:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332072 - head/sys/sys In-Reply-To: Message-ID: <20180406022720.I3453@besplex.bde.org> References: <201804051431.w35EVtg4047897@repo.freebsd.org> <1522942377.49673.245.camel@freebsd.org> <20180405154619.q3blip266qa3z5ut@MacBook-Pro-de-Roger.local> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=cmksfQnWNKoHR5D7ljQA:9 a=QqayTtpXsOdycEfu:21 a=1076iIFNQwPqjI9_:21 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 17:31:33 -0000 On Thu, 5 Apr 2018, Warner Losh wrote: > On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monn=C3=A9 = wrote: > >> On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: >>> On Thu, 2018-04-05 at 14:31 +0000, Roger Pau Monn=C3=A9 wrote: >>>> Log: >>>> introduce GiB and MiB macros >>>> ... >>>> +/* Unit conversion macros. */ >>>> +#define GiB(v) (v ## ULL << 30) >>>> +#define MiB(v) (v ## ULL << 20) >>>> + >>>> #endif /* _SYS_PARAM_H_ */ >>> >>> These names don't make it clear whether the conversion is bytes->GiB or >>> GiB->bytes. The names seem way too generic for a public namespace in a >>> file as heavily included behind your back as param.h is. >>> >>> Also, this completely reasonable usage won't work, likely with >>> confusing compile error messages: >>> >>> int bytes, gibytes; >>> ... >>> bytes =3D GiB(gibytes); >> >> I find those helpful for their specific usage. I could introduce >> static inline functions like: >> >> size_t gb_to_bytes(size_t)... >> >> But I assume this is also going to cause further discussion. Yes, it gives even more namespace pollution and type errors. Macros at least don't expose their internals if they are not used. size_t is actually already part of the undocumented namespace pollution in . The type errors are restriction to just one type in another way. Type- generic APIs that avoid such restrictions are much harder to implement using inline functions than macros. > Yea, traditional macro names would be "gibtob" and "btogib" but I didn't > just reply to bikeshed a name: > > But you don't need to specify a type, consider the current btodb macro: > #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) > */ \ > (sizeof (bytes) > sizeof(long) \ > ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ > : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) > > which shows how to do this in a macro, which is orthogonal to any name yo= u > may choose. I can also bikeshed function vs macro :) This macro is mostly my mistake in 1995-1996. The long long abominations in it were supposed to be temporary (until C99 standardized something better). It was originally MD for i386 only and then the sizes of almost all types are known and fixed so it is easier to hard-code minimal sizes that work. The optimization of avoiding using 64-bit types was more needed in 1995-1996 since CPUs were slower and compilers did less strength reducti= on. btodb() is much easier than dbtob() since it shifts right, so it can't overflow unless the cast of 'bytes' is wrong so that it truncations. dbtob() doesn't try hard to be optimal. It just always upcasts to off_t. jake later convinced me (in connection with his PAE and sparc64 work) that it should be the caller's responsibility to avoid overflow. Any casts in the macro limits it to the types in it. This is why the page to byte conversion macros don't have any casts in them. PAE usually needs 64-bit results, but this would just be a pessimization for normal i386, and deciding the casts in the macro as above is complicated. So correct GB() macros would look like ((v) << 30), where the caller must cast v to a large enough type. E.g., for variable v which might be larger than 4, on 32-bit systems, the caller must write something like GB((uintmax_t)v). But it is easier for writing to just multiply v by 1G. This is also easier for reading since it is unclear that GB() is even a conversion or which direction it goes in. A longer descriptive name would be about as clear and long as an explicit multiplication. I usually write 1G as ((type)1024 * 1024 * 1024) since the decimal and even hex values of 1G have too many digits to be clear, and multiplication is clearer than shifting and allows the type to be in the factor. Disk block size conversions need to use macros since the DEV_BSIZE =3D 512 was variable in theory (in practice this is now a fixed virtual size). Conversions to G don't need macros since the magic number in them is no more magic than the G in their name. Bruce From owner-svn-src-all@freebsd.org Thu Apr 5 18:17:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D343F97FF8; Thu, 5 Apr 2018 18:17:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4B416961B; Thu, 5 Apr 2018 18:17:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF24F262CC; Thu, 5 Apr 2018 18:17:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35IHkin059733; Thu, 5 Apr 2018 18:17:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35IHkau059730; Thu, 5 Apr 2018 18:17:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804051817.w35IHkau059730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Apr 2018 18:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332080 - in head/lib/libc: aarch64/sys arm/sys mips/sys riscv/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/lib/libc: aarch64/sys arm/sys mips/sys riscv/sys X-SVN-Commit-Revision: 332080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 18:17:47 -0000 Author: brooks Date: Thu Apr 5 18:17:46 2018 New Revision: 332080 URL: https://svnweb.freebsd.org/changeset/base/332080 Log: Remove architecture specific shmat.S files. These files are identical to the generated system calls. In the case of MIPS, the file was already disconnected from the build. Submitted by: Ali Mashtizadeh Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14976 Deleted: head/lib/libc/aarch64/sys/shmat.S head/lib/libc/arm/sys/shmat.S head/lib/libc/mips/sys/shmat.S head/lib/libc/riscv/sys/shmat.S Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Thu Apr 5 17:26:03 2018 (r332079) +++ head/lib/libc/aarch64/sys/Makefile.inc Thu Apr 5 18:17:46 2018 (r332080) @@ -5,7 +5,6 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c MDASM= cerror.S \ - shmat.S \ syscall.S \ vfork.S Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Thu Apr 5 17:26:03 2018 (r332079) +++ head/lib/libc/arm/sys/Makefile.inc Thu Apr 5 18:17:46 2018 (r332080) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Thu Apr 5 17:26:03 2018 (r332079) +++ head/lib/libc/riscv/sys/Makefile.inc Thu Apr 5 18:17:46 2018 (r332080) @@ -2,9 +2,7 @@ SRCS+= trivial-vdso_tc.c -#MDASM= ptrace.S MDASM= cerror.S \ - shmat.S \ syscall.S \ vfork.S From owner-svn-src-all@freebsd.org Thu Apr 5 18:19:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE68EF98287; Thu, 5 Apr 2018 18:19:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C88869860; Thu, 5 Apr 2018 18:19:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53196262D3; Thu, 5 Apr 2018 18:19:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35IJmwb059840; Thu, 5 Apr 2018 18:19:48 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35IJmf3059839; Thu, 5 Apr 2018 18:19:48 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804051819.w35IJmf3059839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Apr 2018 18:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332081 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 18:19:48 -0000 Author: brooks Date: Thu Apr 5 18:19:48 2018 New Revision: 332081 URL: https://svnweb.freebsd.org/changeset/base/332081 Log: Allow -DNO_CLEAN buildworld after r332080. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 5 18:17:46 2018 (r332080) +++ head/Makefile.inc1 Thu Apr 5 18:19:48 2018 (r332081) @@ -806,7 +806,8 @@ _cleanobj_fast_depend_hack: .PHONY # Date SVN Rev Syscalls # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs # 20180404 r332048 sigreturn -.for f in fstat fstatat fstatfs getdirentries getfsstat sigreturn statfs +# 20180405 r332080 shmat +.for f in fstat fstatat fstatfs getdirentries getfsstat shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-all@freebsd.org Thu Apr 5 19:27:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F35F9C817; Thu, 5 Apr 2018 19:27:25 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21EC56CA1E; Thu, 5 Apr 2018 19:27:25 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC59426E2D; Thu, 5 Apr 2018 19:27:24 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35JROoe096310; Thu, 5 Apr 2018 19:27:24 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35JROAt096309; Thu, 5 Apr 2018 19:27:24 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804051927.w35JROAt096309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 5 Apr 2018 19:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332082 - head/stand/i386/gptboot X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/i386/gptboot X-SVN-Commit-Revision: 332082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 19:27:25 -0000 Author: benno Date: Thu Apr 5 19:27:24 2018 New Revision: 332082 URL: https://svnweb.freebsd.org/changeset/base/332082 Log: Use consistent whitespace. Reviewed by: strip --strip-debug -o - gptboot.o | md5 Sponsored by: iXsystems, Inc. Modified: head/stand/i386/gptboot/gptboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Thu Apr 5 18:19:48 2018 (r332081) +++ head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:27:24 2018 (r332082) @@ -132,87 +132,93 @@ xfsread(ufs_ino_t inode, void *buf, size_t nbyte) static void bios_getmem(void) { - uint64_t size; + uint64_t size; - /* Parse system memory map */ - v86.ebx = 0; - do { - v86.ctl = V86_FLAGS; - v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ - v86.eax = 0xe820; - v86.ecx = sizeof(struct bios_smap); - v86.edx = SMAP_SIG; - v86.es = VTOPSEG(&smap); - v86.edi = VTOPOFF(&smap); - v86int(); - if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) - break; - /* look for a low-memory segment that's large enough */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && - (smap.length >= (512 * 1024))) - bios_basemem = smap.length; - /* look for the first segment in 'extended' memory */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { - bios_extmem = smap.length; - } + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base == 0x100000)) { + bios_extmem = smap.length; + } - /* - * Look for the largest segment in 'extended' memory beyond - * 1MB but below 4GB. - */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && - (smap.base < 0x100000000ull)) { - size = smap.length; + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base > 0x100000) && (smap.base < 0x100000000ull)) { + size = smap.length; - /* - * If this segment crosses the 4GB boundary, truncate it. - */ - if (smap.base + size > 0x100000000ull) - size = 0x100000000ull - smap.base; + /* + * If this segment crosses the 4GB boundary, + * truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; - if (size > high_heap_size) { - high_heap_size = size; - high_heap_base = smap.base; - } - } - } while (v86.ebx != 0); + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); - /* Fall back to the old compatibility function for base memory */ - if (bios_basemem == 0) { - v86.ctl = 0; - v86.addr = 0x12; /* int 0x12 */ - v86int(); + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); - bios_basemem = (v86.eax & 0xffff) * 1024; - } + bios_basemem = (v86.eax & 0xffff) * 1024; + } - /* Fall back through several compatibility functions for extended memory */ - if (bios_extmem == 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x15; /* int 0x15 function 0xe801*/ - v86.eax = 0xe801; - v86int(); - if (!(v86.efl & 1)) { - bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + /* + * Fall back through several compatibility functions for extended + * memory + */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + + ((v86.edx & 0xffff) * 64)) * 1024; + } } - } - if (bios_extmem == 0) { - v86.ctl = 0; - v86.addr = 0x15; /* int 0x15 function 0x88*/ - v86.eax = 0x8800; - v86int(); - bios_extmem = (v86.eax & 0xffff) * 1024; - } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } - /* - * If we have extended memory and did not find a suitable heap - * region in the SMAP, use the last 3MB of 'extended' memory as a - * high heap candidate. - */ - if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { - high_heap_size = HEAP_MIN; - high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; - } + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } } static int @@ -371,207 +377,215 @@ exit(int x) static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr, x; - int fmt, i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr, x; + int fmt, i, j; - if (!(ino = lookup(kname))) { - if (!ls) { - printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, - kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - dsk.part); - } - return; - } - if (xfsread(ino, &hdr, sizeof(hdr))) - return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) + if (!(ino = lookup(kname))) { + if (!ls) { + printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, + kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], + dsk.unit, + dsk.part); + } return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; } - } else { - fs_off = hdr.eh.e_phoff; - for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) + if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (ep[j].p_type == PT_LOAD) - j++; - } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) + if (N_GETMAGIC(hdr.ex) == ZMAGIC) + fmt = 0; + else if (IS_ELF(hdr.eh)) + fmt = 1; + else { + printf("Invalid %s\n", "format"); return; } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) - return; - for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } + if (fmt == 0) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + p += sizeof(hdr.ex.a_syms); + if (hdr.ex.a_syms) { + if (xfsread(ino, p, hdr.ex.a_syms)) + return; + p += hdr.ex.a_syms; + if (xfsread(ino, p, sizeof(int))) + return; + x = *(uint32_t *)p; + p += sizeof(int); + x -= sizeof(int); + if (xfsread(ino, p, x)) + return; + p += x; + } + } else { + fs_off = hdr.eh.e_phoff; + for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + memcpy(p, &es[i].sh_size, + sizeof(es[i].sh_size)); + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } + addr = hdr.eh.e_entry & 0xffffff; } - addr = hdr.eh.e_entry & 0xffffff; - } - bootinfo.bi_esymtab = VTOP(p); - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; + bootinfo.bi_esymtab = VTOP(p); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; #ifdef LOADER_GELI_SUPPORT - geliargs.size = sizeof(geliargs); - explicit_bzero(gelipw, sizeof(gelipw)); - gelibuf = malloc(sizeof(struct keybuf) + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); - geli_fill_keybuf(gelibuf); - geliargs.notapw = '\0'; - geliargs.keybuf_sentinel = KEYBUF_SENTINEL; - geliargs.keybuf = gelibuf; + geliargs.size = sizeof(geliargs); + explicit_bzero(gelipw, sizeof(gelipw)); + gelibuf = malloc(sizeof(struct keybuf) + + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); + geli_fill_keybuf(gelibuf); + geliargs.notapw = '\0'; + geliargs.keybuf_sentinel = KEYBUF_SENTINEL; + geliargs.keybuf = gelibuf; #endif - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) #ifdef LOADER_GELI_SUPPORT - , geliargs + , geliargs #endif - ); + ); } static int parse_cmds(char *cmdstr, int *dskupdated) { - char *arg = cmdstr; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; + char *arg = cmdstr; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; - *dskupdated = 0; - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; - } else if (c == 'S') { - j = 0; - while ((unsigned int)(i = *arg++ - '0') <= 9) - j = j * 10 + i; - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* Fall through to error below ('S' not in optstr[]). */ + *dskupdated = 0; + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | + OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') + <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* + * Fall through to error below + * ('S' not in optstr[]). + */ + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return -1; + opts ^= OPT_SET(flags[i]); + } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; + } + if (q - arg != 2) + return -1; + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return -1; + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != 'p' || dsk.unit > 9) + return -1; + arg += 2; + dsk.part = *arg - '0'; + if (dsk.part < 1 || dsk.part > 9) + return -1; + arg++; + if (arg[0] != ')') + return -1; + arg++; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + *dskupdated = 1; + } + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(kname)) + return -1; + memcpy(kname, arg, i + 1); + } } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } - ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; - } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return -1; - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != 'p' || dsk.unit > 9) - return -1; - arg += 2; - dsk.part = *arg - '0'; - if (dsk.part < 1 || dsk.part > 9) - return -1; - arg++; - if (arg[0] != ')') - return -1; - arg++; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - *dskupdated = 1; - } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + arg = p; } - arg = p; - } - return 0; + return 0; } static int From owner-svn-src-all@freebsd.org Thu Apr 5 19:29:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2BFFF9CA25; Thu, 5 Apr 2018 19:29:23 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 615256CBEF; Thu, 5 Apr 2018 19:29:23 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C25426E30; Thu, 5 Apr 2018 19:29:23 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35JTNqr096423; Thu, 5 Apr 2018 19:29:23 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35JTNOH096422; Thu, 5 Apr 2018 19:29:23 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804051929.w35JTNOH096422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 5 Apr 2018 19:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332083 - head/stand/i386/gptboot X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/i386/gptboot X-SVN-Commit-Revision: 332083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 19:29:24 -0000 Author: benno Date: Thu Apr 5 19:29:22 2018 New Revision: 332083 URL: https://svnweb.freebsd.org/changeset/base/332083 Log: Various style(9) fixes. Reviewed by: strip --strip-debug -o - gptboot.o | md5 Sponsored by: iXsystems, Inc. Modified: head/stand/i386/gptboot/gptboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:27:24 2018 (r332082) +++ head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:29:22 2018 (r332083) @@ -370,6 +370,7 @@ main(void) void exit(int x) { + while (1); __unreachable(); } @@ -491,12 +492,13 @@ load(void) static int parse_cmds(char *cmdstr, int *dskupdated) { - char *arg = cmdstr; + char *arg; char *ep, *p, *q; const char *cp; unsigned int drv; int c, i, j; + arg = cmdstr; *dskupdated = 0; while ((c = *arg++)) { if (c == ' ' || c == '\t' || c == '\n') @@ -533,7 +535,7 @@ parse_cmds(char *cmdstr, int *dskupdated) } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) - return -1; + return (-1); opts ^= OPT_SET(flags[i]); } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : @@ -553,23 +555,23 @@ parse_cmds(char *cmdstr, int *dskupdated) arg += 2; } if (q - arg != 2) - return -1; + return (-1); for (i = 0; arg[0] != dev_nm[i][0] || arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) - return -1; + return (-1); dsk.type = i; arg += 3; dsk.unit = *arg - '0'; if (arg[1] != 'p' || dsk.unit > 9) - return -1; + return (-1); arg += 2; dsk.part = *arg - '0'; if (dsk.part < 1 || dsk.part > 9) - return -1; + return (-1); arg++; if (arg[0] != ')') - return -1; + return (-1); arg++; if (drv == -1) drv = dsk.unit; @@ -579,13 +581,13 @@ parse_cmds(char *cmdstr, int *dskupdated) } if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) - return -1; + return (-1); memcpy(kname, arg, i + 1); } } arg = p; } - return 0; + return (0); } static int @@ -617,7 +619,9 @@ vdev_read(void *vdev __unused, void *priv, off_t off, char *p; daddr_t lba; unsigned int nb; - struct dsk *dskp = (struct dsk *) priv; + struct dsk *dskp; + + dskp = (struct dsk *)priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) return (-1); From owner-svn-src-all@freebsd.org Thu Apr 5 19:40:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 975E5F9D3A3; Thu, 5 Apr 2018 19:40:47 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 442806D46A; Thu, 5 Apr 2018 19:40:47 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ED6326FE5; Thu, 5 Apr 2018 19:40:47 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35Jelck001771; Thu, 5 Apr 2018 19:40:47 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35JekjT001765; Thu, 5 Apr 2018 19:40:46 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804051940.w35JekjT001765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 5 Apr 2018 19:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332084 - in head: stand/i386 stand/i386/isoboot stand/libsa sys/fs/cd9660 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in head: stand/i386 stand/i386/isoboot stand/libsa sys/fs/cd9660 X-SVN-Commit-Revision: 332084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 19:40:47 -0000 Author: benno Date: Thu Apr 5 19:40:46 2018 New Revision: 332084 URL: https://svnweb.freebsd.org/changeset/base/332084 Log: Add isoboot(8) for booting BIOS systems from HDDs containing ISO images. This is part of a project for adding the ability to create hybrid CD/USB boot images. In the BIOS case when booting from something that isn't a CD we need some extra boot code to actually find our next stage (loader) within an ISO9660 filesystem. This code will reside in a GPT partition (similar to gptboot(8) from which it is derived) and looks for /boot/loader in an ISO9660 filesystem on the image. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14914 Added: head/stand/i386/isoboot/ head/stand/i386/isoboot/Makefile - copied, changed from r332081, head/stand/i386/gptboot/Makefile head/stand/i386/isoboot/isoboot.8 (contents, props changed) head/stand/i386/isoboot/isoboot.c - copied, changed from r332083, head/stand/i386/gptboot/gptboot.c head/stand/libsa/cd9660read.c (contents, props changed) Modified: head/stand/i386/Makefile head/sys/fs/cd9660/iso.h Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Thu Apr 5 19:29:22 2018 (r332083) +++ head/stand/i386/Makefile Thu Apr 5 19:40:46 2018 (r332084) @@ -5,7 +5,7 @@ NO_OBJ=t .include SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - libi386 + isoboot libi386 SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire Copied and modified: head/stand/i386/isoboot/Makefile (from r332081, head/stand/i386/gptboot/Makefile) ============================================================================== --- head/stand/i386/gptboot/Makefile Thu Apr 5 18:19:48 2018 (r332081, copy source) +++ head/stand/i386/isoboot/Makefile Thu Apr 5 19:40:46 2018 (r332084) @@ -4,10 +4,11 @@ HAVE_GELI= yes .include -.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ + ${BOOTSRC}/i386/common ${SASRC} -FILES= gptboot -MAN= gptboot.8 +FILES= isoboot +MAN= isoboot.8 NM?= nm @@ -19,15 +20,10 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 -# Decide level of UFS support. -GPTBOOT_UFS?= UFS1_AND_UFS2 -#GPTBOOT_UFS?= UFS2_ONLY -#GPTBOOT_UFS?= UFS1_ONLY +ISOBOOTSIZE?= 30720 -CFLAGS+=-DBOOTPROG=\"gptboot\" \ +CFLAGS+=-DBOOTPROG=\"isoboot\" \ -O1 \ - -DGPT \ - -D${GPTBOOT_UFS} \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ @@ -40,14 +36,17 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 +CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES+= gptboot +CLEANFILES+= isoboot -gptboot: gptldr.bin gptboot.bin ${BTXKERN} +isoboot: gptldr.bin isoboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ - -o ${.TARGET} gptboot.bin + -o ${.TARGET} isoboot.bin + @set -- `ls -l ${.TARGET}`; x=$$((${ISOBOOTSIZE}-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 CLEANFILES+= gptldr.bin gptldr.out gptldr.o @@ -57,16 +56,13 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o -CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \ +CLEANFILES+= isoboot.bin isoboot.out isoboot.o sio.o crc32.o drv.o \ cons.o ${OPENCRYPTO_XTS} -gptboot.bin: gptboot.out - ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} +isoboot.bin: isoboot.out + ${OBJCOPY} -S -O binary isoboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} +isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.gptldr.S= ${CLANG_NO_IAS} Added: head/stand/i386/isoboot/isoboot.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/isoboot/isoboot.8 Thu Apr 5 19:40:46 2018 (r332084) @@ -0,0 +1,69 @@ +.\" Copyright (c) 2018 iXsystems, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 30, 2018 +.Dt ISOBOOT 8 +.Os +.Sh NAME +.Nm isoboot +.Nd Boot code for hybrid ISO/USB images on BIOS-based computers +.Sh DESCRIPTION +.Nm +is used on BIOS-based computers to boot from an ISO image that has +been written to a USB flash drive or other HDD-like device. +.Nm +is installed in a +.Cm freebsd-boot +partition with +.Xr mkimg 1 . +.Sh IMPLEMENTATION NOTES +The El Torito standard for bootable CDs provides a 32KB "System Area" +at the beginning of an image. +To create an image that is able to be booted by the BIOS as either a +CD-ROM ("ISO") and as a more HDD-like image (e.g. on a USB flash drive) +it is necessary to have both a standard El Torito boot catalog +containing a HDD-style partition table and boot code. +.Nm +is intended to be placed in a GPT partition to allow the system to find +the standard +.Fx +.Xr loader 8 +in the ISO filesystem later in the image. +.Sh BOOTING +.Nm +looks for an ISO filesystem image on the device it was booted from and +seeks to read either the primary +.Fx +.Xr loader 8 +or kernel from there. +.Sh SEE ALSO +.Xr mkimg 1 +.Sh HISTORY +.Nm +appeared in FreeBSD 12.0. +.Sh AUTHORS +This manual page written by +.An Benno Rice Aq benno@FreeBSD.org . Copied and modified: head/stand/i386/isoboot/isoboot.c (from r332083, head/stand/i386/gptboot/gptboot.c) ============================================================================== --- head/stand/i386/gptboot/gptboot.c Thu Apr 5 19:29:22 2018 (r332083, copy source) +++ head/stand/i386/isoboot/isoboot.c Thu Apr 5 19:40:46 2018 (r332084) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); extern uint32_t _end; -static const uuid_t freebsd_ufs_uuid = GPT_ENT_TYPE_FREEBSD_UFS; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { RBX_DUAL, @@ -85,9 +84,6 @@ static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -#ifdef LOADER_GELI_SUPPORT -static struct geli_boot_args geliargs; -#endif static vm_offset_t high_heap_base; static uint32_t bios_basemem, bios_extmem, high_heap_size; @@ -102,27 +98,21 @@ static struct bios_smap smap; static char *heap_next; static char *heap_end; +int main(void); + static void load(void); static int parse_cmds(char *, int *); -static int dskread(void *, daddr_t, unsigned); -#ifdef LOADER_GELI_SUPPORT -static int vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, - size_t bytes); -#endif -#include "ufsread.c" -#include "gpt.c" -#ifdef LOADER_GELI_SUPPORT -#include "geliboot.c" -static char gelipw[GELI_PW_MAXLEN]; -static struct keybuf *gelibuf; -#endif +static uint8_t ls, dsk_meta; +static uint32_t fs_off; +#include "cd9660read.c" + static inline int -xfsread(ufs_ino_t inode, void *buf, size_t nbyte) +xfsread(uint64_t inode, void *buf, size_t nbyte) { - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + if ((size_t)cd9660_fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); return (-1); } @@ -221,52 +211,22 @@ bios_getmem(void) } } -static int -gptinit(void) -{ - - if (gptread(&freebsd_ufs_uuid, &dsk, dmadat->secbuf) == -1) { - printf("%s: unable to load GPT\n", BOOTPROG); - return (-1); - } - if (gptfind(&freebsd_ufs_uuid, &dsk, dsk.part) == -1) { - printf("%s: no UFS partition was found\n", BOOTPROG); - return (-1); - } -#ifdef LOADER_GELI_SUPPORT - if (geli_taste(vdev_read, &dsk, (gpttable[curent].ent_lba_end - - gpttable[curent].ent_lba_start)) == 0) { - if (geli_havekey(&dsk) != 0 && geli_passphrase(gelipw, - dsk.unit, 'p', curent + 1, &dsk) != 0) { - printf("%s: unable to decrypt GELI key\n", BOOTPROG); - return (-1); - } - } -#endif - - dsk_meta = 0; - return (0); -} - -int main(void); - int main(void) { char cmd[512], cmdtmp[512]; ssize_t sz; int autoboot, dskupdated; - ufs_ino_t ino; + uint64_t ino; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - bios_getmem(); if (high_heap_size > 0) { heap_end = PTOV(high_heap_base + high_heap_size); heap_next = PTOV(high_heap_base); } else { - heap_next = (char *)dmadat + sizeof(*dmadat); + heap_next = (char *) + (roundup2(__base + (int32_t)&_end, 0x10000) - __base); heap_end = (char *)PTOV(bios_basemem); } setheap(heap_next, heap_end); @@ -285,30 +245,20 @@ main(void) bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk.drive; -#ifdef LOADER_GELI_SUPPORT - geli_init(); -#endif - /* Process configuration file */ - - if (gptinit() != 0) - return (-1); - autoboot = 1; *cmd = '\0'; for (;;) { *kname = '\0'; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - sz = fsread(ino, cmd, sizeof(cmd) - 1); + if ((ino = cd9660_lookup(PATH_CONFIG)) || + (ino = cd9660_lookup(PATH_DOTCONFIG))) { + sz = cd9660_fsread(ino, cmd, sizeof(cmd) - 1); cmd[(sz < 0) ? 0 : sz] = '\0'; } if (*cmd != '\0') { memcpy(cmdtmp, cmd, sizeof(cmdtmp)); if (parse_cmds(cmdtmp, &dskupdated)) break; - if (dskupdated && gptinit() != 0) - break; if (!OPT_CHECK(RBX_QUIET)) printf("%s: %s", PATH_CONFIG, cmd); *cmd = '\0'; @@ -332,9 +282,6 @@ main(void) load(); memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); load(); - gptbootfailed(&dsk); - if (gptfind(&freebsd_ufs_uuid, &dsk, -1) == -1) - break; dsk_meta = 0; } @@ -359,14 +306,12 @@ main(void) putchar('\a'); continue; } - if (dskupdated && gptinit() != 0) - continue; load(); } /* NOTREACHED */ } -/* XXX - Needed for btxld to link the boot2 binary; do not remove. */ +/* Needed so btxld can link us properly; do not remove. */ void exit(int x) { @@ -385,11 +330,11 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ufs_ino_t ino; + uint64_t ino; uint32_t addr, x; int fmt, i, j; - if (!(ino = lookup(kname))) { + if (!(ino = cd9660_lookup(kname))) { if (!ls) { printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], @@ -470,23 +415,9 @@ load(void) bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; -#ifdef LOADER_GELI_SUPPORT - geliargs.size = sizeof(geliargs); - explicit_bzero(gelipw, sizeof(gelipw)); - gelibuf = malloc(sizeof(struct keybuf) + - (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); - geli_fill_keybuf(gelibuf); - geliargs.notapw = '\0'; - geliargs.keybuf_sentinel = KEYBUF_SENTINEL; - geliargs.keybuf = gelibuf; -#endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) -#ifdef LOADER_GELI_SUPPORT - , geliargs -#endif - ); + MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); } static int @@ -589,59 +520,3 @@ parse_cmds(char *cmdstr, int *dskupdated) } return (0); } - -static int -dskread(void *buf, daddr_t lba, unsigned nblk) -{ - int err; - - err = drvread(&dsk, buf, lba + dsk.start, nblk); - -#ifdef LOADER_GELI_SUPPORT - if (err == 0 && is_geli(&dsk) == 0) { - /* Decrypt */ - if (geli_read(&dsk, lba * DEV_BSIZE, buf, nblk * DEV_BSIZE)) - return (err); - } -#endif - - return (err); -} - -#ifdef LOADER_GELI_SUPPORT -/* - * Read function compartible with the ZFS callback, required to keep the GELI - * Implementation the same for both UFS and ZFS - */ -static int -vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, size_t bytes) -{ - char *p; - daddr_t lba; - unsigned int nb; - struct dsk *dskp; - - dskp = (struct dsk *)priv; - - if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) - return (-1); - - p = buf; - lba = off / DEV_BSIZE; - lba += dskp->start; - - while (bytes > 0) { - nb = bytes / DEV_BSIZE; - if (nb > VBLKSIZE / DEV_BSIZE) - nb = VBLKSIZE / DEV_BSIZE; - if (drvread(dskp, dmadat->blkbuf, lba, nb)) - return (-1); - memcpy(p, dmadat->blkbuf, nb * DEV_BSIZE); - p += nb * DEV_BSIZE; - lba += nb; - bytes -= nb * DEV_BSIZE; - } - - return (0); -} -#endif /* LOADER_GELI_SUPPORT */ Added: head/stand/libsa/cd9660read.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/libsa/cd9660read.c Thu Apr 5 19:40:46 2018 (r332084) @@ -0,0 +1,364 @@ +/* + * Copyright (C) 1996 Wolfgang Solfrank. + * Copyright (C) 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ + +/* Originally derived from libsa/cd9660.c: */ +/* $NetBSD: cd9660.c,v 1.5 1997/06/26 19:11:33 drochner Exp $ */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +static uint64_t cd9660_lookup(const char *); +static ssize_t cd9660_fsread(uint64_t, void *, size_t); + +#define SUSP_CONTINUATION "CE" +#define SUSP_PRESENT "SP" +#define SUSP_STOP "ST" +#define SUSP_EXTREF "ER" +#define RRIP_NAME "NM" + +typedef struct { + ISO_SUSP_HEADER h; + u_char signature [ISODCL ( 5, 6)]; + u_char len_skp [ISODCL ( 7, 7)]; /* 711 */ +} ISO_SUSP_PRESENT; + +static int +read_iso_block(void *buffer, daddr_t blkno) +{ + + return (drvread(&dsk, buffer, blkno * 4, 4)); +} + +static ISO_SUSP_HEADER * +susp_lookup_record(const char *identifier, struct iso_directory_record *dp, + int lenskip) +{ + static char susp_buffer[ISO_DEFAULT_BLOCK_SIZE]; + ISO_SUSP_HEADER *sh; + ISO_RRIP_CONT *shc; + char *p, *end; + int error; + + p = dp->name + isonum_711(dp->name_len) + lenskip; + /* Names of even length have a padding byte after the name. */ + if ((isonum_711(dp->name_len) & 1) == 0) + p++; + end = (char *)dp + isonum_711(dp->length); + while (p + 3 < end) { + sh = (ISO_SUSP_HEADER *)p; + if (bcmp(sh->type, identifier, 2) == 0) + return (sh); + if (bcmp(sh->type, SUSP_STOP, 2) == 0) + return (NULL); + if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) { + shc = (ISO_RRIP_CONT *)sh; + error = read_iso_block(susp_buffer, + isonum_733(shc->location)); + + /* Bail if it fails. */ + if (error != 0) + return (NULL); + p = susp_buffer + isonum_733(shc->offset); + end = p + isonum_733(shc->length); + } else { + /* Ignore this record and skip to the next. */ + p += isonum_711(sh->length); + + /* Avoid infinite loops with corrupted file systems */ + if (isonum_711(sh->length) == 0) + return (NULL); + } + } + return (NULL); +} + +static const char * +rrip_lookup_name(struct iso_directory_record *dp, int lenskip, size_t *len) +{ + ISO_RRIP_ALTNAME *p; + + if (len == NULL) + return (NULL); + + p = (ISO_RRIP_ALTNAME *)susp_lookup_record(RRIP_NAME, dp, lenskip); + if (p == NULL) + return (NULL); + switch (*p->flags) { + case ISO_SUSP_CFLAG_CURRENT: + *len = 1; + return ("."); + case ISO_SUSP_CFLAG_PARENT: + *len = 2; + return (".."); + case 0: + *len = isonum_711(p->h.length) - 5; + return ((char *)p + 5); + default: + /* + * We don't handle hostnames or continued names as they are + * too hard, so just bail and use the default name. + */ + return (NULL); + } +} + +static int +rrip_check(struct iso_directory_record *dp, int *lenskip) +{ + ISO_SUSP_PRESENT *sp; + ISO_RRIP_EXTREF *er; + char *p; + + /* First, see if we can find a SP field. */ + p = dp->name + isonum_711(dp->name_len); + if (p > (char *)dp + isonum_711(dp->length)) { + return (0); + } + sp = (ISO_SUSP_PRESENT *)p; + if (bcmp(sp->h.type, SUSP_PRESENT, 2) != 0) { + return (0); + } + if (isonum_711(sp->h.length) != sizeof(ISO_SUSP_PRESENT)) { + return (0); + } + if (sp->signature[0] != 0xbe || sp->signature[1] != 0xef) { + return (0); + } + *lenskip = isonum_711(sp->len_skp); + + /* + * Now look for an ER field. If RRIP is present, then there must + * be at least one of these. It would be more pedantic to walk + * through the list of fields looking for a Rock Ridge ER field. + */ + er = (ISO_RRIP_EXTREF *)susp_lookup_record(SUSP_EXTREF, dp, 0); + if (er == NULL) { + return (0); + } + return (1); +} + +static int +dirmatch(const char *path, struct iso_directory_record *dp, int use_rrip, + int lenskip) +{ + size_t len; + const char *cp = NULL, *name = NULL; + int i, icase; + + if (use_rrip) + cp = rrip_lookup_name(dp, lenskip, &len); + else + cp = NULL; + if (cp == NULL) { + len = isonum_711(dp->name_len); + cp = dp->name; + icase = 1; + } else + icase = 0; + name = cp; + for (i = len; --i >= 0; path++, cp++) { + if (!*path || *path == '/') + break; + if (*path == *cp) + continue; + if (!icase && toupper(*path) == *cp) + continue; + return 0; + } + if (*path && *path != '/') { + return 0; + } + /* + * Allow stripping of trailing dots and the version number. + * Note that this will find the first instead of the last version + * of a file. + */ + if (i >= 0 && (*cp == ';' || *cp == '.')) { + /* This is to prevent matching of numeric extensions */ + if (*cp == '.' && cp[1] != ';') { + return 0; + } + while (--i >= 0) + if (*++cp != ';' && (*cp < '0' || *cp > '9')) { + return 0; + } + } + return 1; +} + +static uint64_t +cd9660_lookup(const char *path) +{ + static char blkbuf[ISO_DEFAULT_BLOCK_SIZE]; + struct iso_primary_descriptor *vd; + struct iso_directory_record rec; + struct iso_directory_record *dp = NULL; + size_t dsize, off; + daddr_t bno, boff; + int rc, first, use_rrip, lenskip; + uint64_t cookie; + + for (bno = 16;; bno++) { + rc = read_iso_block(blkbuf, bno); + vd = (struct iso_primary_descriptor *)blkbuf; + + if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) + return (0); + if (isonum_711(vd->type) == ISO_VD_END) + return (0); + if (isonum_711(vd->type) == ISO_VD_PRIMARY) + break; + } + + rec = *(struct iso_directory_record *) vd->root_directory_record; + if (*path == '/') path++; /* eat leading '/' */ + + first = 1; + use_rrip = 0; + while (*path) { + bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); + dsize = isonum_733(rec.size); + off = 0; + boff = 0; + + while (off < dsize) { + if ((off % ISO_DEFAULT_BLOCK_SIZE) == 0) { + rc = read_iso_block(blkbuf, bno + boff); + if (rc) { + return (0); + } + boff++; + dp = (struct iso_directory_record *) blkbuf; + } + if (isonum_711(dp->length) == 0) { + /* skip to next block, if any */ + off = boff * ISO_DEFAULT_BLOCK_SIZE; + continue; + } + + /* See if RRIP is in use. */ + if (first) + use_rrip = rrip_check(dp, &lenskip); + + if (dirmatch(path, dp, use_rrip, + first ? 0 : lenskip)) { + first = 0; + break; + } else + first = 0; + + dp = (struct iso_directory_record *) + ((char *) dp + isonum_711(dp->length)); + /* If the new block has zero length, it is padding. */ + if (isonum_711(dp->length) == 0) { + /* Skip to next block, if any. */ + off = boff * ISO_DEFAULT_BLOCK_SIZE; + continue; + } + off += isonum_711(dp->length); + } + if (off >= dsize) { + return (0); + } + + rec = *dp; + while (*path && *path != '/') /* look for next component */ + path++; + if (*path) path++; /* skip '/' */ + } + + if ((isonum_711(rec.flags) & 2) != 0) { + return (0); + } + + cookie = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); + cookie = (cookie << 32) | isonum_733(rec.size); + + return (cookie); +} + +static ssize_t +cd9660_fsread(uint64_t cookie, void *buf, size_t nbytes) +{ + static char blkbuf[ISO_DEFAULT_BLOCK_SIZE]; + static daddr_t curstart = 0, curblk = 0; + daddr_t blk, blk_off; + off_t byte_off; + size_t size, remaining, n; + char *s; + + size = cookie & 0xffffffff; + blk = (cookie >> 32) & 0xffffffff; + + /* Make sure we're looking at the right file. */ + if (((blk << 32) | size) != cookie) { + return (-1); + } + + if (blk != curstart) { + curstart = blk; + fs_off = 0; + } + + size -= fs_off; + if (size < nbytes) { + nbytes = size; + } + remaining = nbytes; + s = buf; + + while (remaining > 0) { + blk_off = fs_off >> ISO_DEFAULT_BLOCK_SHIFT; + byte_off = fs_off & (ISO_DEFAULT_BLOCK_SIZE - 1); + + if (curblk != curstart + blk_off) { + curblk = curstart + blk_off; + read_iso_block(blkbuf, curblk); + } + + if (remaining < ISO_DEFAULT_BLOCK_SIZE - byte_off) { + n = remaining; + } else { + n = ISO_DEFAULT_BLOCK_SIZE - byte_off; + } + memcpy(s, blkbuf + byte_off, n); + remaining -= n; + s += n; + + fs_off += n; + } + + return (nbytes); +} Modified: head/sys/fs/cd9660/iso.h ============================================================================== --- head/sys/fs/cd9660/iso.h Thu Apr 5 19:29:22 2018 (r332083) +++ head/sys/fs/cd9660/iso.h Thu Apr 5 19:40:46 2018 (r332084) @@ -95,7 +95,8 @@ struct iso_primary_descriptor { char application_data [ISODCL (884, 1395)]; char unused5 [ISODCL (1396, 2048)]; }; -#define ISO_DEFAULT_BLOCK_SIZE 2048 +#define ISO_DEFAULT_BLOCK_SHIFT 11 +#define ISO_DEFAULT_BLOCK_SIZE (1 << ISO_DEFAULT_BLOCK_SHIFT) /* * Used by Microsoft Joliet extension to ISO9660. Almost the same From owner-svn-src-all@freebsd.org Thu Apr 5 19:45:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6839F9D904; Thu, 5 Apr 2018 19:45:31 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B6A6D9A4; Thu, 5 Apr 2018 19:45:31 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E85627198; Thu, 5 Apr 2018 19:45:31 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35JjVN9006987; Thu, 5 Apr 2018 19:45:31 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35JjVDJ006984; Thu, 5 Apr 2018 19:45:31 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804051945.w35JjVDJ006984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 5 Apr 2018 19:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332085 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 332085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 19:45:32 -0000 Author: benno Date: Thu Apr 5 19:45:30 2018 New Revision: 332085 URL: https://svnweb.freebsd.org/changeset/base/332085 Log: Add an ISO9660 "partition table" type to loader. When booted via isoboot(8) loader will be handed a disk that simply contains an ISO9660 image. Currently this confuses it greatly. Teach it how to spot that it's in this situation and that ISO9660 has one "partition" covering the whole disk. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14915 Modified: head/stand/common/disk.c head/stand/common/part.c head/stand/common/part.h Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Thu Apr 5 19:40:46 2018 (r332084) +++ head/stand/common/disk.c Thu Apr 5 19:45:30 2018 (r332085) @@ -270,6 +270,9 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize dev->d_offset = part.start; od->entrysize = part.end - part.start + 1; } + } else if (ptable_gettype(od->table) == PTABLE_ISO9660) { + dev->d_offset = 0; + od->entrysize = mediasize; } else if (slice >= 0) { /* Try to get information about partition */ if (slice == 0) Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Thu Apr 5 19:40:46 2018 (r332084) +++ head/stand/common/part.c Thu Apr 5 19:45:30 2018 (r332085) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -97,6 +99,7 @@ static struct parttypes { { PART_LINUX, "Linux" }, { PART_LINUX_SWAP, "Linux swap" }, { PART_DOS, "DOS/Windows" }, + { PART_ISO9660, "ISO9660" }, }; const char * @@ -603,6 +606,45 @@ out: } #endif /* LOADER_VTOC8_SUPPORT */ +#define cdb2devb(bno) ((bno) * ISO_DEFAULT_BLOCK_SIZE / table->sectorsize) + +static struct ptable * +ptable_iso9660read(struct ptable *table, void *dev, diskread_t dread) +{ + uint8_t *buf; + struct iso_primary_descriptor *vd; + struct pentry *entry; + + buf = malloc(table->sectorsize); + if (buf == NULL) + return (table); + + if (dread(dev, buf, 1, cdb2devb(16)) != 0) { + DEBUG("read failed"); + ptable_close(table); + table = NULL; + goto out; + } + vd = (struct iso_primary_descriptor *)buf; + if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) + goto out; + + entry = malloc(sizeof(*entry)); + if (entry == NULL) + goto out; + entry->part.start = 0; + entry->part.end = table->sectors; + entry->part.type = PART_ISO9660; + entry->part.index = 0; + STAILQ_INSERT_TAIL(&table->entries, entry, entry); + + table->type = PTABLE_ISO9660; + +out: + free(buf); + return (table); +} + struct ptable * ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize, diskread_t *dread) @@ -633,6 +675,11 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect table->sectorsize = sectorsize; table->type = PTABLE_NONE; STAILQ_INIT(&table->entries); + + if (ptable_iso9660read(table, dev, dread) != NULL) { + if (table->type == PTABLE_ISO9660) + goto out; + } #ifdef LOADER_VTOC8_SUPPORT if (be16dec(buf + offsetof(struct vtoc8, magic)) == VTOC_MAGIC) { Modified: head/stand/common/part.h ============================================================================== --- head/stand/common/part.h Thu Apr 5 19:40:46 2018 (r332084) +++ head/stand/common/part.h Thu Apr 5 19:45:30 2018 (r332085) @@ -36,7 +36,8 @@ enum ptable_type { PTABLE_BSD, PTABLE_MBR, PTABLE_GPT, - PTABLE_VTOC8 + PTABLE_VTOC8, + PTABLE_ISO9660 }; enum partition_type { @@ -52,6 +53,7 @@ enum partition_type { PART_LINUX, PART_LINUX_SWAP, PART_DOS, + PART_ISO9660 }; struct ptable_entry { From owner-svn-src-all@freebsd.org Thu Apr 5 20:31:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DE7FA0A79; Thu, 5 Apr 2018 20:31:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76F256FCD5; Thu, 5 Apr 2018 20:31:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71A092789C; Thu, 5 Apr 2018 20:31:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35KVjCF032633; Thu, 5 Apr 2018 20:31:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35KVjQE032631; Thu, 5 Apr 2018 20:31:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804052031.w35KVjQE032631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Apr 2018 20:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332086 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 20:31:46 -0000 Author: brooks Date: Thu Apr 5 20:31:45 2018 New Revision: 332086 URL: https://svnweb.freebsd.org/changeset/base/332086 Log: Added SAL annotatations to system calls. Modify makesyscalls.sh to strip out SAL annotations. No functional change. This is based on work I started in CheriBSD and use to validate fat pointers at the syscall boundary. Tal Garfinkel reviewed the changes, added annotations to COMPAT* syscalls and is using them in a record and playback framework. One can envision other uses such as a WITNESS-like validator for copyin/out as speculated on in the review. As this time we are only annotating sys/kern/syscalls.master as that is sufficient for userspace work. If kernel use cases materialize, we can annotate other syscalls.master as needed. Submitted by: Tal Garfinkel Sponsored by: DARPA, AFRL (in part) Differential Revision: https://reviews.freebsd.org/D14285 Modified: head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Thu Apr 5 19:45:30 2018 (r332085) +++ head/sys/kern/makesyscalls.sh Thu Apr 5 20:31:45 2018 (r332086) @@ -400,6 +400,16 @@ sed -e ' } if (argtype[argc] == "") parserr($f, "argument definition") + + # The parser adds space around parens. + # Remove it from annotations. + gsub(/ \( /, "(", argtype[argc]); + gsub(/ \)/, ")", argtype[argc]); + + #remove annotations + gsub(/_In[^ ]*[_)] /, "", argtype[argc]); + gsub(/_Out[^ ]*[_)] /, "", argtype[argc]); + argname[argc]=$f; f += 2; # skip name, and any comma } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Apr 5 19:45:30 2018 (r332085) +++ head/sys/kern/syscalls.master Thu Apr 5 20:31:45 2018 (r332086) @@ -43,7 +43,32 @@ ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. ; NOTSTATIC syscall is loadable + +; annotations: +; SAL 2.0 annotations are used to specify how system calls treat +; arguments that are passed using pointers. There are three basic +; annotations. ; +; _In_ Object pointed to will be read and not modified. +; _Out_ Object pointed to will be written and not read. +; _Inout_ Object pointed to will be written and read. +; +; These annotations are used alone when the pointer refers to a single +; object i.e. scalar types, structs, and pointers, and not NULL. Adding +; the _opt_ suffix, e.g. _In_opt_, implies that the pointer may also +; refer to NULL. +; +; For pointers to arrays, additional suffixes are added: +; +; _In_z_, _Out_z_, _Inout_z_: +; for a NUL terminated array e.g. a string. +; _In_reads_z_(n),_Out_writes_z_(n), _Inout_updates_z_(n): +; for a NUL terminated array e.g. a string, of known length n bytes. +; _In_reads_(n),_Out_writes_(n),_Inout_updates_(n): +; for an array of n elements. +; _In_reads_bytes_(n), _Out_writes_bytes_(n), _Inout_updates_bytes(n): +; for a buffer of n-bytes. + ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master @@ -63,143 +88,181 @@ 1 AUE_EXIT STD { void sys_exit(int rval); } exit \ sys_exit_args void 2 AUE_FORK STD { int fork(void); } -3 AUE_READ STD { ssize_t read(int fd, void *buf, \ +3 AUE_READ STD { ssize_t read(int fd, \ + _Out_writes_bytes_(nbyte) void *buf, \ size_t nbyte); } -4 AUE_WRITE STD { ssize_t write(int fd, const void *buf, \ +4 AUE_WRITE STD { ssize_t write(int fd, \ + _In_reads_bytes_(nbyte) const void *buf, \ size_t nbyte); } -5 AUE_OPEN_RWTC STD { int open(char *path, int flags, int mode); } +5 AUE_OPEN_RWTC STD { int open( \ + _In_z_ char *path, \ + int flags, \ + int mode); } ; XXX should be { int open(const char *path, int flags, ...); } ; but we're not ready for `const' or varargs. ; XXX man page says `mode_t mode'. 6 AUE_CLOSE STD { int close(int fd); } -7 AUE_WAIT4 STD { int wait4(int pid, int *status, \ - int options, struct rusage *rusage); } -8 AUE_CREAT COMPAT { int creat(char *path, int mode); } -9 AUE_LINK STD { int link(char *path, char *link); } -10 AUE_UNLINK STD { int unlink(char *path); } +7 AUE_WAIT4 STD { int wait4(int pid, \ + _Out_opt_ int *status, \ + int options, \ + _Out_opt_ struct rusage *rusage); } +8 AUE_CREAT COMPAT { int creat(_In_z_ char *path, int mode); } +9 AUE_LINK STD { int link(_In_z_ char *path, \ + _In_z_ char *link); } +10 AUE_UNLINK STD { int unlink(_In_z_ char *path); } 11 AUE_NULL OBSOL execv -12 AUE_CHDIR STD { int chdir(char *path); } +12 AUE_CHDIR STD { int chdir(_In_z_ char *path); } 13 AUE_FCHDIR STD { int fchdir(int fd); } -14 AUE_MKNOD COMPAT11 { int mknod(char *path, int mode, int dev); } -15 AUE_CHMOD STD { int chmod(char *path, int mode); } -16 AUE_CHOWN STD { int chown(char *path, int uid, int gid); } -17 AUE_NULL STD { int obreak(char *nsize); } break \ +14 AUE_MKNOD COMPAT11 { int mknod(_In_z_ char *path, int mode, \ + int dev); } +15 AUE_CHMOD STD { int chmod(_In_z_ char *path, int mode); } +16 AUE_CHOWN STD { int chown(_In_z_ char *path, \ + int uid, int gid); } +17 AUE_NULL STD { int obreak(_In_ char *nsize); } break \ obreak_args int -18 AUE_GETFSSTAT COMPAT4 { int getfsstat(struct ostatfs *buf, \ +18 AUE_GETFSSTAT COMPAT4 { int getfsstat( \ + _Out_writes_bytes_opt_(bufsize) \ + struct ostatfs *buf, \ long bufsize, int mode); } 19 AUE_LSEEK COMPAT { long lseek(int fd, long offset, \ int whence); } 20 AUE_GETPID STD { pid_t getpid(void); } -21 AUE_MOUNT STD { int mount(char *type, char *path, \ - int flags, caddr_t data); } +21 AUE_MOUNT STD { int mount(_In_z_ char *type, \ + _In_z_ char *path, int flags, \ + _In_opt_ caddr_t data); } ; XXX `path' should have type `const char *' but we're not ready for that. -22 AUE_UMOUNT STD { int unmount(char *path, int flags); } +22 AUE_UMOUNT STD { int unmount(_In_z_ char *path, int flags); } 23 AUE_SETUID STD { int setuid(uid_t uid); } 24 AUE_GETUID STD { uid_t getuid(void); } 25 AUE_GETEUID STD { uid_t geteuid(void); } 26 AUE_PTRACE STD { int ptrace(int req, pid_t pid, \ - caddr_t addr, int data); } -27 AUE_RECVMSG STD { int recvmsg(int s, struct msghdr *msg, \ + _Inout_opt_ caddr_t addr, int data); } +27 AUE_RECVMSG STD { int recvmsg(int s, \ + _Inout_ struct msghdr *msg, int flags); } +28 AUE_SENDMSG STD { int sendmsg(int s, _In_ struct msghdr *msg, \ int flags); } -28 AUE_SENDMSG STD { int sendmsg(int s, struct msghdr *msg, \ - int flags); } -29 AUE_RECVFROM STD { int recvfrom(int s, caddr_t buf, \ +29 AUE_RECVFROM STD { int recvfrom(int s, \ + _Out_writes_bytes_(len) caddr_t buf, \ size_t len, int flags, \ + _Out_writes_bytes_opt_(*fromlenaddr) \ struct sockaddr * __restrict from, \ + _Inout_opt_ \ __socklen_t * __restrict fromlenaddr); } 30 AUE_ACCEPT STD { int accept(int s, \ + _Out_writes_bytes_opt_(*anamelen) \ struct sockaddr * __restrict name, \ + _Inout_opt_ \ __socklen_t * __restrict anamelen); } 31 AUE_GETPEERNAME STD { int getpeername(int fdes, \ + _Out_writes_bytes_(*alen) \ struct sockaddr * __restrict asa, \ + _Inout_opt_ \ __socklen_t * __restrict alen); } 32 AUE_GETSOCKNAME STD { int getsockname(int fdes, \ + _Out_writes_bytes_(*alen) \ struct sockaddr * __restrict asa, \ - __socklen_t * __restrict alen); } -33 AUE_ACCESS STD { int access(char *path, int amode); } -34 AUE_CHFLAGS STD { int chflags(const char *path, u_long flags); } + _Inout_ __socklen_t * __restrict alen); } +33 AUE_ACCESS STD { int access(_In_z_ char *path, int amode); } +34 AUE_CHFLAGS STD { int chflags(_In_z_ const char *path, \ + u_long flags); } 35 AUE_FCHFLAGS STD { int fchflags(int fd, u_long flags); } 36 AUE_SYNC STD { int sync(void); } 37 AUE_KILL STD { int kill(int pid, int signum); } -38 AUE_STAT COMPAT { int stat(char *path, struct ostat *ub); } +38 AUE_STAT COMPAT { int stat(_In_z_ char *path, \ + _Out_ struct ostat *ub); } 39 AUE_GETPPID STD { pid_t getppid(void); } -40 AUE_LSTAT COMPAT { int lstat(char *path, struct ostat *ub); } +40 AUE_LSTAT COMPAT { int lstat(_In_z_ char *path, \ + _Out_ struct ostat *ub); } 41 AUE_DUP STD { int dup(u_int fd); } 42 AUE_PIPE COMPAT10 { int pipe(void); } 43 AUE_GETEGID STD { gid_t getegid(void); } -44 AUE_PROFILE STD { int profil(caddr_t samples, size_t size, \ - size_t offset, u_int scale); } -45 AUE_KTRACE STD { int ktrace(const char *fname, int ops, \ - int facs, int pid); } +44 AUE_PROFILE STD { int profil( \ + _Out_writes_bytes_(size) caddr_t samples, \ + size_t size, size_t offset, u_int scale); } +45 AUE_KTRACE STD { int ktrace(_In_z_ const char *fname, \ + int ops, int facs, int pid); } 46 AUE_SIGACTION COMPAT { int sigaction(int signum, \ - struct osigaction *nsa, \ - struct osigaction *osa); } + _In_opt_ struct osigaction *nsa, \ + _Out_opt_ struct osigaction *osa); } 47 AUE_GETGID STD { gid_t getgid(void); } 48 AUE_SIGPROCMASK COMPAT { int sigprocmask(int how, osigset_t mask); } ; XXX note nonstandard (bogus) calling convention - the libc stub passes ; us the mask, not a pointer to it, and we return the old mask as the ; (int) return value. -49 AUE_GETLOGIN STD { int getlogin(char *namebuf, u_int \ - namelen); } -50 AUE_SETLOGIN STD { int setlogin(char *namebuf); } -51 AUE_ACCT STD { int acct(char *path); } +49 AUE_GETLOGIN STD { int getlogin( \ + _Out_writes_z_(namelen) char *namebuf, \ + u_int namelen); } +50 AUE_SETLOGIN STD { int setlogin(_In_z_ char *namebuf); } +51 AUE_ACCT STD { int acct(_In_z_ char *path); } 52 AUE_SIGPENDING COMPAT { int sigpending(void); } -53 AUE_SIGALTSTACK STD { int sigaltstack(stack_t *ss, \ - stack_t *oss); } +53 AUE_SIGALTSTACK STD { int sigaltstack(_In_opt_ stack_t *ss, \ + _Out_opt_ stack_t *oss); } 54 AUE_IOCTL STD { int ioctl(int fd, u_long com, \ - caddr_t data); } + _Inout_opt_ caddr_t data); } 55 AUE_REBOOT STD { int reboot(int opt); } -56 AUE_REVOKE STD { int revoke(char *path); } -57 AUE_SYMLINK STD { int symlink(char *path, char *link); } -58 AUE_READLINK STD { ssize_t readlink(char *path, char *buf, \ +56 AUE_REVOKE STD { int revoke(_In_z_ char *path); } +57 AUE_SYMLINK STD { int symlink(_In_z_ char *path, \ + _In_z_ char *link); } +58 AUE_READLINK STD { ssize_t readlink(_In_z_ char *path, \ + _Out_writes_z_(count) char *buf, \ size_t count); } -59 AUE_EXECVE STD { int execve(char *fname, char **argv, \ - char **envv); } +59 AUE_EXECVE STD { int execve( \ + _In_z_ char *fname, \ + _In_z_ char **argv, \ + _In_z_ char **envv); } 60 AUE_UMASK STD { int umask(int newmask); } umask umask_args \ int -61 AUE_CHROOT STD { int chroot(char *path); } -62 AUE_FSTAT COMPAT { int fstat(int fd, struct ostat *sb); } -63 AUE_NULL COMPAT { int getkerninfo(int op, char *where, \ - size_t *size, int arg); } getkerninfo \ - getkerninfo_args int +61 AUE_CHROOT STD { int chroot(_In_z_ char *path); } +62 AUE_FSTAT COMPAT { int fstat(int fd, _Out_ struct ostat *sb); } +63 AUE_NULL COMPAT { int getkerninfo(int op, \ + _Out_writes_bytes_opt(*size) char *where, \ + _Inout_opt_ size_t *size, \ + int arg); } getkerninfo getkerninfo_args int 64 AUE_NULL COMPAT { int getpagesize(void); } getpagesize \ getpagesize_args int -65 AUE_MSYNC STD { int msync(void *addr, size_t len, \ +65 AUE_MSYNC STD { int msync(_In_ void *addr, size_t len, \ int flags); } 66 AUE_VFORK STD { int vfork(void); } 67 AUE_NULL OBSOL vread 68 AUE_NULL OBSOL vwrite 69 AUE_SBRK STD { int sbrk(int incr); } 70 AUE_SSTK STD { int sstk(int incr); } -71 AUE_MMAP COMPAT { int mmap(void *addr, int len, int prot, \ +71 AUE_MMAP COMPAT { int mmap(_In_ void *addr, int len, int prot, \ int flags, int fd, long pos); } 72 AUE_O_VADVISE STD { int ovadvise(int anom); } vadvise \ ovadvise_args int -73 AUE_MUNMAP STD { int munmap(void *addr, size_t len); } -74 AUE_MPROTECT STD { int mprotect(void *addr, size_t len, \ - int prot); } -75 AUE_MADVISE STD { int madvise(void *addr, size_t len, \ - int behav); } +73 AUE_MUNMAP STD { int munmap(_In_ void *addr, size_t len); } +74 AUE_MPROTECT STD { int mprotect(_In_ void *addr, \ + size_t len, int prot); } +75 AUE_MADVISE STD { int madvise(_In_ void *addr, \ + size_t len, int behav); } 76 AUE_NULL OBSOL vhangup 77 AUE_NULL OBSOL vlimit -78 AUE_MINCORE STD { int mincore(const void *addr, size_t len, \ +78 AUE_MINCORE STD { int mincore( \ + _In_ const void *addr, \ + size_t len, \ + _Out_writes_bytes_(len/PAGE_SIZE) \ char *vec); } 79 AUE_GETGROUPS STD { int getgroups(u_int gidsetsize, \ + _Out_writes_opt_(gidsetsize) \ gid_t *gidset); } 80 AUE_SETGROUPS STD { int setgroups(u_int gidsetsize, \ - gid_t *gidset); } + _In_reads_(gidsetsize) gid_t *gidset); } 81 AUE_GETPGRP STD { int getpgrp(void); } 82 AUE_SETPGRP STD { int setpgid(int pid, int pgid); } -83 AUE_SETITIMER STD { int setitimer(u_int which, struct \ - itimerval *itv, struct itimerval *oitv); } +83 AUE_SETITIMER STD { int setitimer(u_int which, \ + _In_ struct itimerval *itv, \ + _Out_opt_ struct itimerval *oitv); } 84 AUE_WAIT4 COMPAT { int wait(void); } -85 AUE_SWAPON STD { int swapon(char *name); } +85 AUE_SWAPON STD { int swapon(_In_z_ char *name); } 86 AUE_GETITIMER STD { int getitimer(u_int which, \ - struct itimerval *itv); } -87 AUE_SYSCTL COMPAT { int gethostname(char *hostname, \ + _Out_ struct itimerval *itv); } +87 AUE_SYSCTL COMPAT { int gethostname( \ + _Out_writes_z_(len) char *hostname, \ u_int len); } gethostname \ gethostname_args int -88 AUE_SYSCTL COMPAT { int sethostname(char *hostname, \ +88 AUE_SYSCTL COMPAT { int sethostname( \ + _In_reads_z_(len) char *hostname, \ u_int len); } sethostname \ sethostname_args int 89 AUE_GETDTABLESIZE STD { int getdtablesize(void); } @@ -208,98 +271,129 @@ 92 AUE_FCNTL STD { int fcntl(int fd, int cmd, long arg); } ; XXX should be { int fcntl(int fd, int cmd, ...); } ; but we're not ready for varargs. -93 AUE_SELECT STD { int select(int nd, fd_set *in, fd_set *ou, \ - fd_set *ex, struct timeval *tv); } +93 AUE_SELECT STD { int select(int nd, \ + _Inout_opt_ fd_set *in, \ + _Inout_opt_ fd_set *ou, \ + _Inout_opt_ fd_set *ex, \ + _In_opt_ struct timeval *tv); } 94 AUE_NULL UNIMPL setdopt 95 AUE_FSYNC STD { int fsync(int fd); } 96 AUE_SETPRIORITY STD { int setpriority(int which, int who, \ int prio); } 97 AUE_SOCKET STD { int socket(int domain, int type, \ int protocol); } -98 AUE_CONNECT STD { int connect(int s, caddr_t name, \ +98 AUE_CONNECT STD { int connect(int s, \ + _In_reads_bytes_(namelen) caddr_t name, \ int namelen); } -99 AUE_ACCEPT COMPAT|NOARGS { int accept(int s, caddr_t name, \ - int *anamelen); } accept accept_args int +99 AUE_ACCEPT COMPAT|NOARGS { int accept(int s, \ + _Out_writes_bytes_opt_(*anamelen) \ + caddr_t name, int *anamelen); } \ + accept accept_args int 100 AUE_GETPRIORITY STD { int getpriority(int which, int who); } -101 AUE_SEND COMPAT { int send(int s, caddr_t buf, int len, \ +101 AUE_SEND COMPAT { int send(int s, \ + _In_reads_bytes_(len) caddr_t buf, \ + int len, \ int flags); } -102 AUE_RECV COMPAT { int recv(int s, caddr_t buf, int len, \ - int flags); } +102 AUE_RECV COMPAT { int recv(int s, \ + _Out_writes_bytes_(len) caddr_t buf, \ + int len, int flags); } 103 AUE_SIGRETURN COMPAT { int sigreturn( \ - struct osigcontext *sigcntxp); } -104 AUE_BIND STD { int bind(int s, caddr_t name, \ + _In_ struct osigcontext *sigcntxp); } +104 AUE_BIND STD { int bind(int s, \ + _In_reads_bytes_(namelen) caddr_t name, \ int namelen); } 105 AUE_SETSOCKOPT STD { int setsockopt(int s, int level, int name, \ - caddr_t val, int valsize); } + _In_reads_bytes_opt_(valsize) caddr_t val, \ + int valsize); } 106 AUE_LISTEN STD { int listen(int s, int backlog); } 107 AUE_NULL OBSOL vtimes -108 AUE_NULL COMPAT { int sigvec(int signum, struct sigvec *nsv, \ - struct sigvec *osv); } +108 AUE_NULL COMPAT { int sigvec(int signum, \ + _In_opt_ struct sigvec *nsv, \ + _Out_opt_ struct sigvec *osv); } 109 AUE_NULL COMPAT { int sigblock(int mask); } 110 AUE_NULL COMPAT { int sigsetmask(int mask); } 111 AUE_NULL COMPAT { int sigsuspend(osigset_t mask); } ; XXX note nonstandard (bogus) calling convention - the libc stub passes ; us the mask, not a pointer to it. -112 AUE_NULL COMPAT { int sigstack(struct sigstack *nss, \ - struct sigstack *oss); } -113 AUE_RECVMSG COMPAT { int recvmsg(int s, struct omsghdr *msg, \ +112 AUE_NULL COMPAT { int sigstack(_In_opt_ struct sigstack *nss, \ + _Out_opt_ struct sigstack *oss); } +113 AUE_RECVMSG COMPAT { int recvmsg(int s, \ + _Inout_ struct omsghdr *msg, \ int flags); } -114 AUE_SENDMSG COMPAT { int sendmsg(int s, caddr_t msg, \ +114 AUE_SENDMSG COMPAT { int sendmsg(int s, _In_ caddr_t msg, \ int flags); } 115 AUE_NULL OBSOL vtrace -116 AUE_GETTIMEOFDAY STD { int gettimeofday(struct timeval *tp, \ - struct timezone *tzp); } +116 AUE_GETTIMEOFDAY STD { int gettimeofday( \ + _Out_ struct timeval *tp, \ + _Out_opt_ struct timezone *tzp); } 117 AUE_GETRUSAGE STD { int getrusage(int who, \ - struct rusage *rusage); } + _Out_ struct rusage *rusage); } 118 AUE_GETSOCKOPT STD { int getsockopt(int s, int level, int name, \ - caddr_t val, int *avalsize); } + _Out_writes_bytes_opt_(*avalsize) \ + caddr_t val, _Inout_ int *avalsize); } 119 AUE_NULL UNIMPL resuba (BSD/OS 2.x) -120 AUE_READV STD { int readv(int fd, struct iovec *iovp, \ +120 AUE_READV STD { int readv(int fd, \ + _Inout_updates_(iovcnt) struct iovec *iovp, \ + u_int iovcnt); } +121 AUE_WRITEV STD { int writev(int fd, \ + _In_reads_opt_(iovcnt) struct iovec *iovp, \ u_int iovcnt); } -121 AUE_WRITEV STD { int writev(int fd, struct iovec *iovp, \ - u_int iovcnt); } -122 AUE_SETTIMEOFDAY STD { int settimeofday(struct timeval *tv, \ - struct timezone *tzp); } +122 AUE_SETTIMEOFDAY STD { int settimeofday( \ + _In_ struct timeval *tv, \ + _In_opt_ struct timezone *tzp); } 123 AUE_FCHOWN STD { int fchown(int fd, int uid, int gid); } 124 AUE_FCHMOD STD { int fchmod(int fd, int mode); } -125 AUE_RECVFROM COMPAT|NOARGS { int recvfrom(int s, caddr_t buf, \ - size_t len, int flags, caddr_t from, int \ - *fromlenaddr); } recvfrom recvfrom_args \ - int +125 AUE_RECVFROM COMPAT|NOARGS { int recvfrom(int s, \ + _Out_writes_(len) caddr_t buf, \ + size_t len, int flags, \ + _Out_writes_bytes_(*fromlenaddr) \ + caddr_t from, \ + _Inout_ int *fromlenaddr); } \ + recvfrom recvfrom_args int 126 AUE_SETREUID STD { int setreuid(int ruid, int euid); } 127 AUE_SETREGID STD { int setregid(int rgid, int egid); } -128 AUE_RENAME STD { int rename(char *from, char *to); } -129 AUE_TRUNCATE COMPAT { int truncate(char *path, long length); } +128 AUE_RENAME STD { int rename(_In_z_ char *from, \ + _In_z_ char *to); } +129 AUE_TRUNCATE COMPAT { int truncate(_In_z_ char *path, \ + long length); } 130 AUE_FTRUNCATE COMPAT { int ftruncate(int fd, long length); } 131 AUE_FLOCK STD { int flock(int fd, int how); } -132 AUE_MKFIFO STD { int mkfifo(char *path, int mode); } -133 AUE_SENDTO STD { int sendto(int s, caddr_t buf, size_t len, \ - int flags, caddr_t to, int tolen); } +132 AUE_MKFIFO STD { int mkfifo(_In_z_ char *path, int mode); } +133 AUE_SENDTO STD { int sendto(int s, \ + _In_reads_bytes_(len) caddr_t buf, \ + size_t len, int flags, \ + _In_reads_bytes_opt_(tolen) caddr_t to, \ + int tolen); } 134 AUE_SHUTDOWN STD { int shutdown(int s, int how); } 135 AUE_SOCKETPAIR STD { int socketpair(int domain, int type, \ - int protocol, int *rsv); } -136 AUE_MKDIR STD { int mkdir(char *path, int mode); } -137 AUE_RMDIR STD { int rmdir(char *path); } -138 AUE_UTIMES STD { int utimes(char *path, \ - struct timeval *tptr); } + int protocol, _Out_writes_(2) int *rsv); } +136 AUE_MKDIR STD { int mkdir(_In_z_ char *path, int mode); } +137 AUE_RMDIR STD { int rmdir(_In_z_ char *path); } +138 AUE_UTIMES STD { int utimes(_In_z_ char *path, \ + _In_ struct timeval *tptr); } 139 AUE_NULL OBSOL 4.2 sigreturn -140 AUE_ADJTIME STD { int adjtime(struct timeval *delta, \ - struct timeval *olddelta); } -141 AUE_GETPEERNAME COMPAT { int getpeername(int fdes, caddr_t asa, \ - int *alen); } +140 AUE_ADJTIME STD { int adjtime(_In_ struct timeval *delta, \ + _Out_opt_ struct timeval *olddelta); } +141 AUE_GETPEERNAME COMPAT { int getpeername(int fdes, \ + _Out_writes_bytes_(*alen) \ + caddr_t asa, \ + _Inout_opt_ int *alen); } 142 AUE_SYSCTL COMPAT { long gethostid(void); } 143 AUE_SYSCTL COMPAT { int sethostid(long hostid); } -144 AUE_GETRLIMIT COMPAT { int getrlimit(u_int which, struct \ +144 AUE_GETRLIMIT COMPAT { int getrlimit(u_int which, _Out_ struct \ orlimit *rlp); } 145 AUE_SETRLIMIT COMPAT { int setrlimit(u_int which, \ - struct orlimit *rlp); } + _Out_ struct orlimit *rlp); } 146 AUE_KILLPG COMPAT { int killpg(int pgid, int signum); } 147 AUE_SETSID STD { int setsid(void); } -148 AUE_QUOTACTL STD { int quotactl(char *path, int cmd, int uid, \ - caddr_t arg); } +148 AUE_QUOTACTL STD { int quotactl( \ + _In_z_ char *path, int cmd, int uid, \ + _In_ caddr_t arg); } 149 AUE_O_QUOTA COMPAT { int quota(void); } 150 AUE_GETSOCKNAME COMPAT|NOARGS { int getsockname(int fdec, \ - caddr_t asa, int *alen); } getsockname \ + _Out_writes_bytes_(*alen) \ + caddr_t asa, \ + _Inout_ int *alen); } getsockname \ getsockname_args int ; Syscalls 151-180 inclusive are reserved for vendor-specific @@ -310,28 +404,34 @@ 152 AUE_NULL UNIMPL sem_wakeup (BSD/OS 2.x) 153 AUE_NULL UNIMPL asyncdaemon (BSD/OS 2.x) ; 154 is initialised by the NLM code, if present. -154 AUE_NULL NOSTD { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } +154 AUE_NULL NOSTD { int nlm_syscall(int debug_level, \ + int grace_period, int addr_count, \ + _In_reads_(addr_count) \ + char **addrs); } ; 155 is initialized by the NFS code, if present. -155 AUE_NFS_SVC NOSTD { int nfssvc(int flag, caddr_t argp); } -156 AUE_GETDIRENTRIES COMPAT { int getdirentries(int fd, char *buf, \ - u_int count, long *basep); } -157 AUE_STATFS COMPAT4 { int statfs(char *path, \ - struct ostatfs *buf); } +155 AUE_NFS_SVC NOSTD { int nfssvc(int flag, _In_ caddr_t argp); } +156 AUE_GETDIRENTRIES COMPAT { int getdirentries(int fd, \ + _Out_writes_bytes_(count) char *buf, \ + u_int count, _Out_ long *basep); } +157 AUE_STATFS COMPAT4 { int statfs(_In_z_ char *path, \ + _Out_ struct ostatfs *buf); } 158 AUE_FSTATFS COMPAT4 { int fstatfs(int fd, \ - struct ostatfs *buf); } + _Out_ struct ostatfs *buf); } 159 AUE_NULL UNIMPL nosys -160 AUE_LGETFH STD { int lgetfh(char *fname, \ - struct fhandle *fhp); } -161 AUE_NFS_GETFH STD { int getfh(char *fname, \ - struct fhandle *fhp); } -162 AUE_SYSCTL COMPAT4 { int getdomainname(char *domainname, \ +160 AUE_LGETFH STD { int lgetfh(_In_z_ char *fname, \ + _Out_ struct fhandle *fhp); } +161 AUE_NFS_GETFH STD { int getfh(_In_z_ char *fname, \ + _Out_ struct fhandle *fhp); } +162 AUE_SYSCTL COMPAT4 { int getdomainname( \ + _Out_writes_z_(len) char *domainname, \ int len); } -163 AUE_SYSCTL COMPAT4 { int setdomainname(char *domainname, \ +163 AUE_SYSCTL COMPAT4 { int setdomainname( \ + _In_reads_z_(len) char *domainname, \ int len); } -164 AUE_NULL COMPAT4 { int uname(struct utsname *name); } -165 AUE_SYSARCH STD { int sysarch(int op, char *parms); } +164 AUE_NULL COMPAT4 { int uname(_Out_ struct utsname *name); } +165 AUE_SYSARCH STD { int sysarch(int op, _In_z_ char *parms); } 166 AUE_RTPRIO STD { int rtprio(int function, pid_t pid, \ - struct rtprio *rtp); } + _Inout_ struct rtprio *rtp); } 167 AUE_NULL UNIMPL nosys 168 AUE_NULL UNIMPL nosys 169 AUE_SEMSYS NOSTD { int semsys(int which, int a2, int a3, \ @@ -344,13 +444,15 @@ int a4); } ; XXX should be { int shmsys(int which, ...); } 172 AUE_NULL UNIMPL nosys -173 AUE_PREAD COMPAT6 { ssize_t pread(int fd, void *buf, \ +173 AUE_PREAD COMPAT6 { ssize_t pread(int fd, \ + _Out_writes_bytes_(nbyte) void *buf, \ size_t nbyte, int pad, off_t offset); } 174 AUE_PWRITE COMPAT6 { ssize_t pwrite(int fd, \ + _In_reads_bytes_(nbyte) \ const void *buf, \ size_t nbyte, int pad, off_t offset); } 175 AUE_SETFIB STD { int setfib(int fibnum); } -176 AUE_NTP_ADJTIME STD { int ntp_adjtime(struct timex *tp); } +176 AUE_NTP_ADJTIME STD { int ntp_adjtime(_Inout_ struct timex *tp); } 177 AUE_NULL UNIMPL sfork (BSD/OS 2.x) 178 AUE_NULL UNIMPL getdescriptor (BSD/OS 2.x) 179 AUE_NULL UNIMPL setdescriptor (BSD/OS 2.x) @@ -364,46 +466,58 @@ 185 AUE_NULL UNIMPL lfs_markv 186 AUE_NULL UNIMPL lfs_segclean 187 AUE_NULL UNIMPL lfs_segwait -188 AUE_STAT COMPAT11 { int stat(char *path, \ - struct freebsd11_stat *ub); } +188 AUE_STAT COMPAT11 { int stat(_In_z_ char *path, \ + _Out_ struct freebsd11_stat *ub); } 189 AUE_FSTAT COMPAT11 { int fstat(int fd, \ - struct freebsd11_stat *sb); } -190 AUE_LSTAT COMPAT11 { int lstat(char *path, \ - struct freebsd11_stat *ub); } -191 AUE_PATHCONF STD { int pathconf(char *path, int name); } + _Out_ struct freebsd11_stat *sb); } +190 AUE_LSTAT COMPAT11 { int lstat(_In_z_ char *path, \ + _Out_ struct freebsd11_stat *ub); } +191 AUE_PATHCONF STD { int pathconf(_In_z_ char *path, int name); } 192 AUE_FPATHCONF STD { int fpathconf(int fd, int name); } 193 AUE_NULL UNIMPL nosys 194 AUE_GETRLIMIT STD { int getrlimit(u_int which, \ - struct rlimit *rlp); } getrlimit \ + _Out_ struct rlimit *rlp); } getrlimit \ __getrlimit_args int 195 AUE_SETRLIMIT STD { int setrlimit(u_int which, \ - struct rlimit *rlp); } setrlimit \ + _In_ struct rlimit *rlp); } setrlimit \ __setrlimit_args int -196 AUE_GETDIRENTRIES COMPAT11 { int getdirentries(int fd, char *buf, \ - u_int count, long *basep); } -197 AUE_MMAP COMPAT6 { caddr_t mmap(caddr_t addr, \ - size_t len, int prot, int flags, int fd, \ - int pad, off_t pos); } +196 AUE_GETDIRENTRIES COMPAT11 { int getdirentries(int fd, \ + _Out_writes_bytes_(count) char *buf, \ + u_int count, _Out_ long *basep); } +197 AUE_MMAP COMPAT6 { caddr_t mmap(_In_ caddr_t addr, size_t len, \ + int prot, int flags, int fd, int pad, \ + off_t pos); } 198 AUE_NULL NOPROTO { int nosys(void); } __syscall \ __syscall_args int 199 AUE_LSEEK COMPAT6 { off_t lseek(int fd, int pad, \ off_t offset, int whence); } -200 AUE_TRUNCATE COMPAT6 { int truncate(char *path, int pad, \ +200 AUE_TRUNCATE COMPAT6 { int truncate(_In_z_ char *path, int pad, \ off_t length); } 201 AUE_FTRUNCATE COMPAT6 { int ftruncate(int fd, int pad, \ off_t length); } -202 AUE_SYSCTL STD { int __sysctl(int *name, u_int namelen, \ - void *old, size_t *oldlenp, void *new, \ - size_t newlen); } __sysctl sysctl_args int -203 AUE_MLOCK STD { int mlock(const void *addr, size_t len); } -204 AUE_MUNLOCK STD { int munlock(const void *addr, size_t len); } -205 AUE_UNDELETE STD { int undelete(char *path); } -206 AUE_FUTIMES STD { int futimes(int fd, struct timeval *tptr); } +202 AUE_SYSCTL STD { int __sysctl( \ + _In_reads_(namelen) int *name, \ + u_int namelen, \ + _Out_writes_bytes_opt_(*oldlenp) \ + void *old, \ + _Inout_opt_ size_t *oldlenp, \ + _In_reads_bytes_opt_(newlen) \ + void *new, \ + size_t newlen); } \ + __sysctl sysctl_args int +203 AUE_MLOCK STD { int mlock(_In_ const void *addr, \ + size_t len); } +204 AUE_MUNLOCK STD { int munlock(_In_ const void *addr, \ + size_t len); } +205 AUE_UNDELETE STD { int undelete(_In_z_ char *path); } +206 AUE_FUTIMES STD { int futimes(int fd, \ + _In_reads_(2) struct timeval *tptr); } 207 AUE_GETPGID STD { int getpgid(pid_t pid); } 208 AUE_NULL UNIMPL nosys -209 AUE_POLL STD { int poll(struct pollfd *fds, u_int nfds, \ - int timeout); } - +209 AUE_POLL STD { int poll( \ + _Inout_updates_(nfds) \ + struct pollfd *fds, \ + u_int nfds, int timeout); } ; ; The following are reserved for loadable syscalls ; @@ -422,67 +536,84 @@ int cmd, union semun_old *arg); } 221 AUE_SEMGET NOSTD { int semget(key_t key, int nsems, \ int semflg); } -222 AUE_SEMOP NOSTD { int semop(int semid, struct sembuf *sops, \ +222 AUE_SEMOP NOSTD { int semop(int semid, \ + _In_reads_(nsops) struct sembuf *sops, \ size_t nsops); } 223 AUE_NULL UNIMPL semconfig 224 AUE_MSGCTL COMPAT7|NOSTD { int msgctl(int msqid, int cmd, \ struct msqid_ds_old *buf); } 225 AUE_MSGGET NOSTD { int msgget(key_t key, int msgflg); } -226 AUE_MSGSND NOSTD { int msgsnd(int msqid, const void *msgp, \ +226 AUE_MSGSND NOSTD { int msgsnd(int msqid, \ + _In_reads_bytes_(msgsz) const void *msgp, \ size_t msgsz, int msgflg); } -227 AUE_MSGRCV NOSTD { ssize_t msgrcv(int msqid, void *msgp, \ +227 AUE_MSGRCV NOSTD { ssize_t msgrcv(int msqid, \ + _Out_writes_bytes_(msgsz) void *msgp, \ size_t msgsz, long msgtyp, int msgflg); } -228 AUE_SHMAT NOSTD { int shmat(int shmid, const void *shmaddr, \ +228 AUE_SHMAT NOSTD { int shmat(int shmid, \ + _In_ const void *shmaddr, \ int shmflg); } 229 AUE_SHMCTL COMPAT7|NOSTD { int shmctl(int shmid, int cmd, \ struct shmid_ds_old *buf); } -230 AUE_SHMDT NOSTD { int shmdt(const void *shmaddr); } +230 AUE_SHMDT NOSTD { int shmdt(_In_ const void *shmaddr); } 231 AUE_SHMGET NOSTD { int shmget(key_t key, size_t size, \ int shmflg); } ; 232 AUE_NULL STD { int clock_gettime(clockid_t clock_id, \ - struct timespec *tp); } -233 AUE_CLOCK_SETTIME STD { int clock_settime( \ - clockid_t clock_id, \ - const struct timespec *tp); } + _Out_ struct timespec *tp); } +233 AUE_CLOCK_SETTIME STD { int clock_settime(clockid_t clock_id, \ + _In_ const struct timespec *tp); } 234 AUE_NULL STD { int clock_getres(clockid_t clock_id, \ - struct timespec *tp); } -235 AUE_NULL STD { int ktimer_create(clockid_t clock_id, \ - struct sigevent *evp, int *timerid); } + _Out_ struct timespec *tp); } +235 AUE_NULL STD { int ktimer_create( \ + clockid_t clock_id, \ + _In_ struct sigevent *evp, \ + _Out_ int *timerid); } 236 AUE_NULL STD { int ktimer_delete(int timerid); } -237 AUE_NULL STD { int ktimer_settime(int timerid, int flags, \ - const struct itimerspec *value, \ - struct itimerspec *ovalue); } -238 AUE_NULL STD { int ktimer_gettime(int timerid, struct \ - itimerspec *value); } +237 AUE_NULL STD { int ktimer_settime(int timerid, \ + int flags, \ + _In_ const struct itimerspec *value, \ + _Out_opt_ struct itimerspec *ovalue); } +238 AUE_NULL STD { int ktimer_gettime(int timerid, \ + _Out_ struct itimerspec *value); } 239 AUE_NULL STD { int ktimer_getoverrun(int timerid); } -240 AUE_NULL STD { int nanosleep(const struct timespec *rqtp, \ - struct timespec *rmtp); } -241 AUE_NULL STD { int ffclock_getcounter(ffcounter *ffcount); } +240 AUE_NULL STD { int nanosleep( \ + _In_ const struct timespec *rqtp, \ + _Out_opt_ struct timespec *rmtp); } +241 AUE_NULL STD { int ffclock_getcounter( \ + _Out_ ffcounter *ffcount); } 242 AUE_NULL STD { int ffclock_setestimate( \ - struct ffclock_estimate *cest); } + _In_ struct ffclock_estimate *cest); } 243 AUE_NULL STD { int ffclock_getestimate( \ - struct ffclock_estimate *cest); } + _Out_ struct ffclock_estimate *cest); } 244 AUE_NULL STD { int clock_nanosleep(clockid_t clock_id, \ - int flags, const struct timespec *rqtp, \ - struct timespec *rmtp); } + int flags, \ + _In_ const struct timespec *rqtp, \ + _Out_opt_ struct timespec *rmtp); } 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys -247 AUE_NULL STD { int clock_getcpuclockid2(id_t id,\ - int which, clockid_t *clock_id); } -248 AUE_NULL STD { int ntp_gettime(struct ntptimeval *ntvp); } +247 AUE_NULL STD { int clock_getcpuclockid2(id_t id, \ + int which, _Out_ clockid_t *clock_id); } +248 AUE_NULL STD { int ntp_gettime( \ + _Out_ struct ntptimeval *ntvp); } 249 AUE_NULL UNIMPL nosys -250 AUE_MINHERIT STD { int minherit(void *addr, size_t len, \ - int inherit); } +; syscall numbers initially used in OpenBSD +250 AUE_MINHERIT STD { int minherit( \ + _In_ void *addr, \ + size_t len, int inherit); } 251 AUE_RFORK STD { int rfork(int flags); } 252 AUE_POLL OBSOL openbsd_poll 253 AUE_ISSETUGID STD { int issetugid(void); } -254 AUE_LCHOWN STD { int lchown(char *path, int uid, int gid); } -255 AUE_AIO_READ STD { int aio_read(struct aiocb *aiocbp); } -256 AUE_AIO_WRITE STD { int aio_write(struct aiocb *aiocbp); } +254 AUE_LCHOWN STD { int lchown(_In_z_ char *path, int uid, \ + int gid); } +255 AUE_AIO_READ STD { int aio_read( \ + _Inout_ struct aiocb *aiocbp); } +256 AUE_AIO_WRITE STD { int aio_write( \ + _Inout_ struct aiocb *aiocbp); } 257 AUE_LIO_LISTIO STD { int lio_listio(int mode, \ - struct aiocb * const *acb_list, \ - int nent, struct sigevent *sig); } + _Inout_updates_(nent) \ + struct aiocb* const *acb_list, \ + int nent, \ + _In_opt_ struct sigevent *sig); } 258 AUE_NULL UNIMPL nosys 259 AUE_NULL UNIMPL nosys 260 AUE_NULL UNIMPL nosys @@ -497,20 +628,23 @@ 269 AUE_NULL UNIMPL nosys 270 AUE_NULL UNIMPL nosys 271 AUE_NULL UNIMPL nosys -272 AUE_O_GETDENTS COMPAT11 { int getdents(int fd, char *buf, \ +272 AUE_O_GETDENTS COMPAT11 { int getdents(int fd, \ + _Out_writes_bytes_(count) char *buf, \ size_t count); } 273 AUE_NULL UNIMPL nosys -274 AUE_LCHMOD STD { int lchmod(char *path, mode_t mode); } +274 AUE_LCHMOD STD { int lchmod(_In_z_ char *path, mode_t mode); } 275 AUE_LCHOWN NOPROTO { int lchown(char *path, uid_t uid, \ gid_t gid); } netbsd_lchown lchown_args \ int -276 AUE_LUTIMES STD { int lutimes(char *path, \ - struct timeval *tptr); } -277 AUE_MSYNC NOPROTO { int msync(void *addr, size_t len, \ +276 AUE_LUTIMES STD { int lutimes(_In_z_ char *path, \ + _In_ struct timeval *tptr); } +277 AUE_MSYNC NOPROTO { int msync(_In_ void *addr, size_t len, \ int flags); } netbsd_msync msync_args int -278 AUE_STAT COMPAT11 { int nstat(char *path, struct nstat *ub); } -279 AUE_FSTAT COMPAT11 { int nfstat(int fd, struct nstat *sb); } -280 AUE_LSTAT COMPAT11 { int nlstat(char *path, struct nstat *ub); } +278 AUE_STAT COMPAT11 { int nstat(_In_z_ char *path, \ + _Out_ struct nstat *ub); } +279 AUE_FSTAT COMPAT11 { int nfstat(int fd, _Out_ struct nstat *sb); } +280 AUE_LSTAT COMPAT11 { int nlstat(_In_z_ char *path, \ + _Out_ struct nstat *ub); } 281 AUE_NULL UNIMPL nosys 282 AUE_NULL UNIMPL nosys 283 AUE_NULL UNIMPL nosys @@ -519,10 +653,13 @@ 286 AUE_NULL UNIMPL nosys 287 AUE_NULL UNIMPL nosys 288 AUE_NULL UNIMPL nosys -289 AUE_PREADV STD { ssize_t preadv(int fd, struct iovec *iovp, \ - u_int iovcnt, off_t offset); } -290 AUE_PWRITEV STD { ssize_t pwritev(int fd, struct iovec *iovp, \ - u_int iovcnt, off_t offset); } +289 AUE_PREADV STD { ssize_t preadv(int fd, \ + _In_reads_(iovcnt) \ + struct iovec *iovp, \ + u_int iovcnt, off_t offset); } +290 AUE_PWRITEV STD { ssize_t pwritev(int fd, \ + _In_reads_(iovcnt) struct iovec *iovp, \ + u_int iovcnt, off_t offset); } 291 AUE_NULL UNIMPL nosys 292 AUE_NULL UNIMPL nosys 293 AUE_NULL UNIMPL nosys @@ -530,23 +667,25 @@ 295 AUE_NULL UNIMPL nosys 296 AUE_NULL UNIMPL nosys 297 AUE_FHSTATFS COMPAT4 { int fhstatfs( \ - const struct fhandle *u_fhp, \ - struct ostatfs *buf); } -298 AUE_FHOPEN STD { int fhopen(const struct fhandle *u_fhp, \ + _In_ const struct fhandle *u_fhp, \ + _Out_ struct ostatfs *buf); } +298 AUE_FHOPEN STD { int fhopen( \ + _In_ const struct fhandle *u_fhp, \ int flags); } -299 AUE_FHSTAT COMPAT11 { int fhstat(const struct fhandle *u_fhp, \ - struct freebsd11_stat *sb); } +299 AUE_FHSTAT COMPAT11 { int fhstat( \ + _In_ const struct fhandle *u_fhp, \ + _Out_ struct freebsd11_stat *sb); } 300 AUE_NULL STD { int modnext(int modid); } 301 AUE_NULL STD { int modstat(int modid, \ - struct module_stat *stat); } + _Out_ struct module_stat* stat); } 302 AUE_NULL STD { int modfnext(int modid); } -303 AUE_NULL STD { int modfind(const char *name); } -304 AUE_MODLOAD STD { int kldload(const char *file); } +303 AUE_NULL STD { int modfind(_In_z_ const char *name); } +304 AUE_MODLOAD STD { int kldload(_In_z_ const char *file); } 305 AUE_MODUNLOAD STD { int kldunload(int fileid); } -306 AUE_NULL STD { int kldfind(const char *file); } +306 AUE_NULL STD { int kldfind(_In_z_ const char *file); } 307 AUE_NULL STD { int kldnext(int fileid); } -308 AUE_NULL STD { int kldstat(int fileid, struct \ - kld_file_stat* stat); } +308 AUE_NULL STD { int kldstat(int fileid, \ + _Out_ struct kld_file_stat *stat); } 309 AUE_NULL STD { int kldfirstmod(int fileid); } 310 AUE_GETSID STD { int getsid(pid_t pid); } 311 AUE_SETRESUID STD { int setresuid(uid_t ruid, uid_t euid, \ @@ -554,109 +693,140 @@ 312 AUE_SETRESGID STD { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_AIO_RETURN STD { ssize_t aio_return(struct aiocb *aiocbp); } +314 AUE_AIO_RETURN STD { ssize_t aio_return( \ + _Inout_ struct aiocb *aiocbp); } 315 AUE_AIO_SUSPEND STD { int aio_suspend( \ - struct aiocb * const * aiocbp, int nent, \ + _Inout_updates_(nent) \ + struct aiocb * const * aiocbp, \ + int nent, \ + _In_opt_ \ const struct timespec *timeout); } 316 AUE_AIO_CANCEL STD { int aio_cancel(int fd, \ - struct aiocb *aiocbp); } -317 AUE_AIO_ERROR STD { int aio_error(struct aiocb *aiocbp); } -318 AUE_AIO_READ COMPAT6 { int aio_read(struct oaiocb *aiocbp); } -319 AUE_AIO_WRITE COMPAT6 { int aio_write(struct oaiocb *aiocbp); } + _In_opt_ struct aiocb *aiocbp); } +317 AUE_AIO_ERROR STD { int aio_error( \ + _In_ struct aiocb *aiocbp); } +318 AUE_AIO_READ COMPAT6 { int aio_read( \ + _Inout_ struct oaiocb *aiocbp); } +319 AUE_AIO_WRITE COMPAT6 { int aio_write( \ + _Inout_ struct oaiocb *aiocbp); } 320 AUE_LIO_LISTIO COMPAT6 { int lio_listio(int mode, \ + _Inout_updates_(nent) \ struct oaiocb * const *acb_list, \ - int nent, struct osigevent *sig); } + int nent, \ + _In_opt_ struct osigevent *sig); } 321 AUE_NULL STD { int yield(void); } 322 AUE_NULL OBSOL thr_sleep 323 AUE_NULL OBSOL thr_wakeup 324 AUE_MLOCKALL STD { int mlockall(int how); } 325 AUE_MUNLOCKALL STD { int munlockall(void); } -326 AUE_GETCWD STD { int __getcwd(char *buf, size_t buflen); } - +326 AUE_GETCWD STD { int __getcwd( \ + _Out_writes_z_(buflen) char *buf, \ + size_t buflen); } 327 AUE_NULL STD { int sched_setparam (pid_t pid, \ - const struct sched_param *param); } -328 AUE_NULL STD { int sched_getparam (pid_t pid, struct \ - sched_param *param); } - + _In_ const struct sched_param *param); } +328 AUE_NULL STD { int sched_getparam (pid_t pid, \ + _Out_ struct sched_param *param); } 329 AUE_NULL STD { int sched_setscheduler (pid_t pid, int \ - policy, const struct sched_param \ + policy, _In_ const struct sched_param \ *param); } 330 AUE_NULL STD { int sched_getscheduler (pid_t pid); } - 331 AUE_NULL STD { int sched_yield (void); } 332 AUE_NULL STD { int sched_get_priority_max (int policy); } 333 AUE_NULL STD { int sched_get_priority_min (int policy); } 334 AUE_NULL STD { int sched_rr_get_interval (pid_t pid, \ - struct timespec *interval); } -335 AUE_NULL STD { int utrace(const void *addr, size_t len); } + _Out_ struct timespec *interval); } +335 AUE_NULL STD { int utrace( \ + _In_reads_bytes_(len) const void *addr, \ + size_t len); } 336 AUE_SENDFILE COMPAT4 { int sendfile(int fd, int s, \ off_t offset, size_t nbytes, \ - struct sf_hdtr *hdtr, off_t *sbytes, \ - int flags); } + _In_opt_ struct sf_hdtr *hdtr, \ + _Out_opt_ off_t *sbytes, int flags); } 337 AUE_NULL STD { int kldsym(int fileid, int cmd, \ - void *data); } -338 AUE_JAIL STD { int jail(struct jail *jail); } + _In_ void *data); } +338 AUE_JAIL STD { int jail( \ + _In_ struct jail *jail); } + 339 AUE_NULL NOSTD|NOTSTATIC { int nnpfs_syscall(int operation, \ char *a_pathP, int a_opcode, \ - void *a_paramsP, int a_followSymlinks); } + void *a_paramsP, \ + int a_followSymlinks); } 340 AUE_SIGPROCMASK STD { int sigprocmask(int how, \ - const sigset_t *set, sigset_t *oset); } -341 AUE_SIGSUSPEND STD { int sigsuspend(const sigset_t *sigmask); } -342 AUE_SIGACTION COMPAT4 { int sigaction(int sig, const \ - struct sigaction *act, \ - struct sigaction *oact); } -343 AUE_SIGPENDING STD { int sigpending(sigset_t *set); } + _In_opt_ const sigset_t *set, \ + _Out_opt_ sigset_t *oset); } +341 AUE_SIGSUSPEND STD { int sigsuspend( \ + _In_ const sigset_t *sigmask); } +342 AUE_SIGACTION COMPAT4 { int sigaction(int sig, \ + _In_opt_ const struct sigaction *act, \ + _Out_opt_ struct sigaction *oact); } +343 AUE_SIGPENDING STD { int sigpending(_In_ sigset_t *set); } 344 AUE_SIGRETURN COMPAT4 { int sigreturn( \ - const struct ucontext4 *sigcntxp); } -345 AUE_SIGWAIT STD { int sigtimedwait(const sigset_t *set, \ - siginfo_t *info, \ - const struct timespec *timeout); } -346 AUE_NULL STD { int sigwaitinfo(const sigset_t *set, \ - siginfo_t *info); } -347 AUE_ACL_GET_FILE STD { int __acl_get_file(const char *path, \ - acl_type_t type, struct acl *aclp); } -348 AUE_ACL_SET_FILE STD { int __acl_set_file(const char *path, \ - acl_type_t type, struct acl *aclp); } + _In_ const struct ucontext4 *sigcntxp); } +345 AUE_SIGWAIT STD { int sigtimedwait(_In_ const sigset_t *set, \ + _Out_opt_ siginfo_t *info, \ + _In_opt_ const struct timespec *timeout); } +346 AUE_NULL STD { int sigwaitinfo(_In_ const sigset_t *set, \ + _Out_opt_ siginfo_t *info); } +347 AUE_ACL_GET_FILE STD { int __acl_get_file( \ + _In_z_ const char *path, \ + acl_type_t type, \ + _Out_ struct acl *aclp); } +348 AUE_ACL_SET_FILE STD { int __acl_set_file( \ + _In_z_ const char *path, \ + acl_type_t type, _In_ struct acl *aclp); } 349 AUE_ACL_GET_FD STD { int __acl_get_fd(int filedes, \ - acl_type_t type, struct acl *aclp); } + acl_type_t type, _Out_ struct acl *aclp); } 350 AUE_ACL_SET_FD STD { int __acl_set_fd(int filedes, \ - acl_type_t type, struct acl *aclp); } -351 AUE_ACL_DELETE_FILE STD { int __acl_delete_file(const char *path, \ + acl_type_t type, _In_ struct acl *aclp); } +351 AUE_ACL_DELETE_FILE STD { int __acl_delete_file( \ + _In_z_ const char *path, \ acl_type_t type); } 352 AUE_ACL_DELETE_FD STD { int __acl_delete_fd(int filedes, \ acl_type_t type); } -353 AUE_ACL_CHECK_FILE STD { int __acl_aclcheck_file(const char *path, \ - acl_type_t type, struct acl *aclp); } +353 AUE_ACL_CHECK_FILE STD { int __acl_aclcheck_file( \ + _In_z_ const char *path, \ + acl_type_t type, _In_ struct acl *aclp); } 354 AUE_ACL_CHECK_FD STD { int __acl_aclcheck_fd(int filedes, \ - acl_type_t type, struct acl *aclp); } -355 AUE_EXTATTRCTL STD { int extattrctl(const char *path, int cmd, \ - const char *filename, int attrnamespace, \ - const char *attrname); } + acl_type_t type, _In_ struct acl *aclp); } +355 AUE_EXTATTRCTL STD { int extattrctl(_In_z_ const char *path, \ + int cmd, _In_z_opt_ const char *filename, \ + int attrnamespace, \ + _In_z_ const char *attrname); } 356 AUE_EXTATTR_SET_FILE STD { ssize_t extattr_set_file( \ - const char *path, int attrnamespace, \ - const char *attrname, void *data, \ + _In_z_ const char *path, \ + int attrnamespace, \ + _In_z_ const char *attrname, \ + _In_reads_bytes_(nbytes) void *data, \ size_t nbytes); } 357 AUE_EXTATTR_GET_FILE STD { ssize_t extattr_get_file( \ - const char *path, int attrnamespace, \ - const char *attrname, void *data, \ + _In_z_ const char *path, \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 5 20:33:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C54A9FA0C0A; Thu, 5 Apr 2018 20:33:01 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 725EB6FF73; Thu, 5 Apr 2018 20:33:00 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 43AA55A9F15; Thu, 5 Apr 2018 20:33:00 +0000 (UTC) Date: Thu, 5 Apr 2018 20:33:00 +0000 From: Brooks Davis To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332086 - head/sys/kern Message-ID: <20180405203300.GE23904@spindle.one-eyed-alien.net> References: <201804052031.w35KVjQE032631@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HG+GLK89HZ1zG0kk" Content-Disposition: inline In-Reply-To: <201804052031.w35KVjQE032631@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 20:33:02 -0000 --HG+GLK89HZ1zG0kk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 05, 2018 at 08:31:45PM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Apr 5 20:31:45 2018 > New Revision: 332086 > URL: https://svnweb.freebsd.org/changeset/base/332086 >=20 > Log: > Added SAL annotatations to system calls. > =20 > Modify makesyscalls.sh to strip out SAL annotations. > =20 > No functional change. > =20 > This is based on work I started in CheriBSD and use to validate fat > pointers at the syscall boundary. Tal Garfinkel reviewed the changes, > added annotations to COMPAT* syscalls and is using them in a record and > playback framework. One can envision other uses such as a WITNESS-like > validator for copyin/out as speculated on in the review. > =20 > As this time we are only annotating sys/kern/syscalls.master as that is > sufficient for userspace work. If kernel use cases materialize, we can > annotate other syscalls.master as needed. > =20 > Submitted by: Tal Garfinkel > Sponsored by: DARPA, AFRL (in part) > Differential Revision: https://reviews.freebsd.org/D14285 Sorry, I misplaced a: Reviewed by: cem (prior version) -- Brooks --HG+GLK89HZ1zG0kk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaxof7AAoJEKzQXbSebgfANEEIAJ8v7vEFEkv4I8aXo/4qNy8j Tf/68uJO7tfiK1uwTdrtvILrE0se6DhuizyQTJblDIigLUER/IQBXvcNn9fyxjtW kSVz2Ev0zD4BoYtaAtm5Q34VFo0BGMRaIX1WRysWXOJtl+0ozAHJV5N2ttX1JhPC 05ip4fmckJopQKo7hmsp95j6lV/zktdOYuvNOaXsXkuYvgg+sh4627MdnFh50K7O PsMTYMTngGXMfPpc6w2/MXDLxYaiU1GWaAc5oruXpjjx2vU+IT1EPD91gc34ig00 Whi9UJgH4RR4/pSqCFYbd4zGXs/FHt9hLjLE+w7K5RS1I2Mh7TWBq+u458LSvAA= =f1Hz -----END PGP SIGNATURE----- --HG+GLK89HZ1zG0kk-- From owner-svn-src-all@freebsd.org Thu Apr 5 21:58:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C4C9F84A1F; Thu, 5 Apr 2018 21:58:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B697273B32; Thu, 5 Apr 2018 21:58:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1820790; Thu, 5 Apr 2018 21:58:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35LwSBJ073871; Thu, 5 Apr 2018 21:58:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35LwSFN073870; Thu, 5 Apr 2018 21:58:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804052158.w35LwSFN073870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Apr 2018 21:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332087 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 21:58:29 -0000 Author: brooks Date: Thu Apr 5 21:58:28 2018 New Revision: 332087 URL: https://svnweb.freebsd.org/changeset/base/332087 Log: ifconf(): Always zero the whole struct ifreq. The previous split of zeroing ifr_name and ifr_addr seperately is safe on current architectures, but would be unsafe if pointers were larger than 8 bytes. Combining the zeroing adds no real cost (a few instructions) and makes the security property easier to verify. Reviewed by: kib, emaste Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14912 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 5 20:31:45 2018 (r332086) +++ head/sys/net/if.c Thu Apr 5 21:58:28 2018 (r332087) @@ -3129,10 +3129,10 @@ again: int addrs; /* - * Zero the ifr_name buffer to make sure we don't - * disclose the contents of the stack. + * Zero the ifr to make sure we don't disclose the contents + * of the stack. */ - memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name)); + memset(&ifr, 0, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) { @@ -3166,7 +3166,6 @@ again: } IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { - bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); From owner-svn-src-all@freebsd.org Thu Apr 5 22:14:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5932F859D4; Thu, 5 Apr 2018 22:14:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87E3F74532; Thu, 5 Apr 2018 22:14:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64A8AAF4; Thu, 5 Apr 2018 22:14:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w35MEudC083672; Thu, 5 Apr 2018 22:14:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w35MEubl083670; Thu, 5 Apr 2018 22:14:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804052214.w35MEubl083670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 5 Apr 2018 22:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332088 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Apr 2018 22:14:57 -0000 Author: brooks Date: Thu Apr 5 22:14:55 2018 New Revision: 332088 URL: https://svnweb.freebsd.org/changeset/base/332088 Log: Add 32-bit compat for ioctls that take struct ifgroupreq. Use an accessor to access ifgr_group and ifgr_groups. Use an macro CASE_IOC_IFGROUPREQ(cmd) in place of case statements such as "case SIOCAIFGROUP:". This avoids poluting the switch statements with large numbers of #ifdefs. Reviewed by: kib Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14960 Modified: head/sys/net/if.c head/sys/net/if.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 5 21:58:28 2018 (r332087) +++ head/sys/net/if.c Thu Apr 5 22:14:55 2018 (r332088) @@ -142,8 +142,25 @@ struct ifreq32 { CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32)); CTASSERT(__offsetof(struct ifreq, ifr_ifru) == __offsetof(struct ifreq32, ifr_ifru)); -#endif +struct ifgroupreq32 { + char ifgr_name[IFNAMSIZ]; + u_int ifgr_len; + union { + char ifgru_group[IFNAMSIZ]; + uint32_t ifgru_groups; + } ifgr_ifgru; +}; +#define _CASE_IOC_IFGROUPREQ_32(cmd) \ + case _IOC_NEWTYPE((cmd), struct ifgroupreq32): +#else +#define _CASE_IOC_IFGROUPREQ_32(cmd) +#endif /* COMPAT_FREEBSD32 */ + +#define CASE_IOC_IFGROUPREQ(cmd) \ + _CASE_IOC_IFGROUPREQ_32(cmd) \ + case (cmd) + union ifreq_union { struct ifreq ifr; #ifdef COMPAT_FREEBSD32 @@ -151,6 +168,13 @@ union ifreq_union { #endif }; +union ifgroupreq_union { + struct ifgroupreq ifgr; +#ifdef COMPAT_FREEBSD32 + struct ifgroupreq32 ifgr32; +#endif +}; + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -1500,17 +1524,42 @@ if_delgroups(struct ifnet *ifp) IFNET_WUNLOCK(); } +static char * +ifgr_group_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (&ifgrup->ifgr32.ifgr_ifgru.ifgru_group[0]); +#endif + return (&ifgrup->ifgr.ifgr_ifgru.ifgru_group[0]); +} + +static struct ifg_req * +ifgr_groups_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((struct ifg_req *)(uintptr_t) + ifgrup->ifgr32.ifgr_ifgru.ifgru_groups); +#endif + return (ifgrup->ifgr.ifgr_ifgru.ifgru_groups); +} + /* - * Stores all groups from an interface in memory pointed - * to by data + * Stores all groups from an interface in memory pointed to by ifgr. */ static int -if_getgroup(struct ifgroupreq *data, struct ifnet *ifp) +if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) { int len, error; struct ifg_list *ifgl; struct ifg_req ifgrq, *ifgp; - struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { IF_ADDR_RLOCK(ifp); @@ -1521,7 +1570,7 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); /* XXX: wire */ IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { @@ -1545,12 +1594,11 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } /* - * Stores all members of a group in memory pointed to by data + * Stores all members of a group in memory pointed to by igfr */ static int -if_getgroupmembers(struct ifgroupreq *data) +if_getgroupmembers(struct ifgroupreq *ifgr) { - struct ifgroupreq *ifgr = data; struct ifg_group *ifg; struct ifg_member *ifgm; struct ifg_req ifgrq, *ifgp; @@ -1573,7 +1621,7 @@ if_getgroupmembers(struct ifgroupreq *data) } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); TAILQ_FOREACH(ifgm, &ifg->ifg_members, ifgm_next) { if (len < sizeof(ifgrq)) { IFNET_RUNLOCK(); @@ -2803,34 +2851,28 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = if_gethwaddr(ifp, ifr); break; - case SIOCAIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): error = priv_check(td, PRIV_NET_ADDIFGROUP); if (error) return (error); - if ((error = if_addgroup(ifp, ifgr->ifgr_group))) + if ((error = if_addgroup(ifp, + ifgr_group_get((struct ifgroupreq *)data)))) return (error); break; - } - case SIOCGIFGROUP: - if ((error = if_getgroup((struct ifgroupreq *)ifr, ifp))) + CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): + if ((error = if_getgroup((struct ifgroupreq *)data, ifp))) return (error); break; - case SIOCDIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): error = priv_check(td, PRIV_NET_DELIFGROUP); if (error) return (error); - if ((error = if_delgroup(ifp, ifgr->ifgr_group))) + if ((error = if_delgroup(ifp, + ifgr_group_get((struct ifgroupreq *)data)))) return (error); break; - } default: error = ENOIOCTL; @@ -2932,7 +2974,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_list((struct if_clonereq *)data); CURVNET_RESTORE(); return (error); - case SIOCGIFGMEMB: + CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): error = if_getgroupmembers((struct ifgroupreq *)data); CURVNET_RESTORE(); return (error); Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Thu Apr 5 21:58:28 2018 (r332087) +++ head/sys/net/if.h Thu Apr 5 22:14:55 2018 (r332088) @@ -517,8 +517,10 @@ struct ifgroupreq { char ifgru_group[IFNAMSIZ]; struct ifg_req *ifgru_groups; } ifgr_ifgru; +#ifndef _KERNEL #define ifgr_group ifgr_ifgru.ifgru_group #define ifgr_groups ifgr_ifgru.ifgru_groups +#endif }; /* From owner-svn-src-all@freebsd.org Fri Apr 6 01:08:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42E34F92098; Fri, 6 Apr 2018 01:08:09 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFE3E7B2BD; Fri, 6 Apr 2018 01:08:08 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 7D91E14B01; Fri, 6 Apr 2018 01:08:02 +0000 (UTC) Subject: Re: svn commit: r332070 - in head/sys/geom: . label raid To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804051356.w35Duexg022529@repo.freebsd.org> From: Allan Jude Message-ID: <4cd9a49c-2d75-bfac-20df-72e8c80eded4@freebsd.org> Date: Thu, 5 Apr 2018 21:08:06 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201804051356.w35Duexg022529@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m1i1JxhQNEm7dh9MBpO8sdv62rRxP7VgF" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 01:08:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m1i1JxhQNEm7dh9MBpO8sdv62rRxP7VgF Content-Type: multipart/mixed; boundary="XnlaW1AVcJD5GE6LFCC0nZCPKLxsauuRA"; protected-headers="v1" From: Allan Jude To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <4cd9a49c-2d75-bfac-20df-72e8c80eded4@freebsd.org> Subject: Re: svn commit: r332070 - in head/sys/geom: . label raid References: <201804051356.w35Duexg022529@repo.freebsd.org> In-Reply-To: <201804051356.w35Duexg022529@repo.freebsd.org> --XnlaW1AVcJD5GE6LFCC0nZCPKLxsauuRA Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-04-05 09:56, Sean Bruno wrote: > Author: sbruno > Date: Thu Apr 5 13:56:40 2018 > New Revision: 332070 > URL: https://svnweb.freebsd.org/changeset/base/332070 >=20 > Log: > Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. > =20 > Display attribute in future error strings and differentiate g_handlea= ttr() > error messages for ease of debugging in the future. > =20 > "g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT" > =20 > Reported by: swills > Reviewed by: imp cem avg > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D14962 >=20 > Modified: > head/sys/geom/geom_subr.c > head/sys/geom/label/g_label_disk_ident.c > head/sys/geom/raid/md_ddf.c > head/sys/geom/raid/md_intel.c >=20 I might be missing something here, but it seems like you didn't actually change the side of struct md_s { =2E.. char ident[32]; =2E.. } And I don't see where the destination buffer went from 24 bytes to a larger value. --=20 Allan Jude --XnlaW1AVcJD5GE6LFCC0nZCPKLxsauuRA-- --m1i1JxhQNEm7dh9MBpO8sdv62rRxP7VgF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJaxsh6AAoJEBmVNT4SmAt+wVIQANPF9051t2hgxr1iIE5OWAl9 8zLRjumgIhvUZdmYERa/yUnoFANfoAGpMdnst5pkFlHYO9lWgTicNjfa9nGJ85uO IuFbZqeb4l2RI+5C9vlSuJTJiVStCDiJl+c25OJ4dkExNsGskqYiWSZ2XOkcku4e 1KGffT1cZRPYXFnkZJEPh8c8Ewa4gPFx2kBu6RMeCD3vKX4sW5SoCFmgG56UeqM6 NxqUU8zGD9hXYZi2q3wA7qDTflZ8ggR4MQG+Gh8CXUMMjJoZ6cztyj6sjvK20WtW G56VuNe/ZI+GE5yxCceo5DflMO5atxK9rUDRz4uZCcv+w5NtSZzeBRJVvdXiqhs3 CYUzoNNSdZYglTciRW5oleT5mULxtjC/tKJcZfgyFzT3jfeWlgWaap6rekOBtNCO ImRJ1YTI5bbIq6PjdSgtXd/2b165GsbmT8fPvbthzgwSo7wWnmwNRf0PsHw7VZDX nkZIFoIEYIHgi7AFH8wJN3zx8Mc06CFGf0p9xk/97wzqkMRML8K3dvSiwmt4Py69 NUF+NhF7OIqMibAr39yjAaUTrvWGUxfFafP8JEgw6Qtf3hwwRCS6bN2rR6c+1k63 ST8hkJfyWXMs4AsC+XGceGhFfGZez7Ac/HTc4QWrhsJNuf95pb7ocL1sSHsZcliV pigA3J5R564C3FfUTde3 =k4iY -----END PGP SIGNATURE----- --m1i1JxhQNEm7dh9MBpO8sdv62rRxP7VgF-- From owner-svn-src-all@freebsd.org Fri Apr 6 01:20:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB185F92E4F; Fri, 6 Apr 2018 01:20:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 814637BB15; Fri, 6 Apr 2018 01:20:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id h143-v6so4870036ita.4; Thu, 05 Apr 2018 18:20:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=/R4YNQiGbc/hpwXkslh3X6H58lCsMMInmc/Uwb6xY1M=; b=GFW2GZDn76WUiQ3P/xPFnPUIcGo2qP7HjRWcEACDdS9D8p/VYUr4jkDBsIJbqTlZPh POQlxAoEjzuckIK/L7ML+nD2JSKUVnV/CVD3Bsx1SNAUVAKzC1r6pNdSsFCEELSik6IU un3AsAE6DPE7/3eNn0YHGXzfnPuBUCNBuriwBXgMXy9fj6B0d2WKBFw8yFzQtkOq4RBX hyxxPhRxb9SLnWvUdxyIN9rTKafvZI1jZDKh0VzpPYLGWZcKrtVv5986h5JOUXNf9+fn IhlKakhnb5pbBl7Lhi5ErvEEAmwsjEydUclU0ddSGCVJfnUFHrdBYFvW0V1RUvxxtR46 7qdw== X-Gm-Message-State: ALQs6tDEHQLiVxjQZHWbLrPhYFhhjoUpzUqkST+EJQgZ6DTj4EzLnEDj Wjy1j7Iy2TFW6mgw2BD+UL7LoGQZ X-Google-Smtp-Source: AIpwx49zAlSGv87o26QClhvAap3P7dYHQSAH3tlJzudOInQMePneW6cSy4blC9pKYfE2TJPkHJqmug== X-Received: by 2002:a24:730e:: with SMTP id y14-v6mr15882260itb.70.1522977651501; Thu, 05 Apr 2018 18:20:51 -0700 (PDT) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com. [209.85.223.177]) by smtp.gmail.com with ESMTPSA id t10sm5720986ioa.29.2018.04.05.18.20.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 18:20:51 -0700 (PDT) Received: by mail-io0-f177.google.com with SMTP id q84so32798009iod.10; Thu, 05 Apr 2018 18:20:51 -0700 (PDT) X-Received: by 10.107.168.78 with SMTP id r75mr22626481ioe.143.1522977651146; Thu, 05 Apr 2018 18:20:51 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.62.19 with HTTP; Thu, 5 Apr 2018 18:20:50 -0700 (PDT) In-Reply-To: <4cd9a49c-2d75-bfac-20df-72e8c80eded4@freebsd.org> References: <201804051356.w35Duexg022529@repo.freebsd.org> <4cd9a49c-2d75-bfac-20df-72e8c80eded4@freebsd.org> From: Conrad Meyer Date: Thu, 5 Apr 2018 18:20:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332070 - in head/sys/geom: . label raid To: Allan Jude Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 01:20:53 -0000 On Thu, Apr 5, 2018 at 6:08 PM, Allan Jude wrote: > On 2018-04-05 09:56, Sean Bruno wrote: >> Author: sbruno >> Date: Thu Apr 5 13:56:40 2018 >> New Revision: 332070 >> URL: https://svnweb.freebsd.org/changeset/base/332070 >> >> Log: >> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. >> >> ... > I might be missing something here, but it seems like you didn't actually > change the side of > ... > struct md_s The md side can be as small as it likes. It's the caller who needs to provide the large buffer, for other providers of the GEOM::ident attribute. > And I don't see where the destination buffer went from 24 bytes to a > larger value. Check the change in md_intel.c. Best, Conrad From owner-svn-src-all@freebsd.org Fri Apr 6 01:29:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA063F9361F; Fri, 6 Apr 2018 01:29:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 661277C0A7; Fri, 6 Apr 2018 01:29:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id A17F014B2F; Fri, 6 Apr 2018 01:29:32 +0000 (UTC) Subject: Re: svn commit: r332070 - in head/sys/geom: . label raid To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804051356.w35Duexg022529@repo.freebsd.org> <4cd9a49c-2d75-bfac-20df-72e8c80eded4@freebsd.org> From: Allan Jude Message-ID: Date: Thu, 5 Apr 2018 21:29:40 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 01:29:33 -0000 On 2018-04-05 21:20, Conrad Meyer wrote: > On Thu, Apr 5, 2018 at 6:08 PM, Allan Jude wrote: >> On 2018-04-05 09:56, Sean Bruno wrote: >>> Author: sbruno >>> Date: Thu Apr 5 13:56:40 2018 >>> New Revision: 332070 >>> URL: https://svnweb.freebsd.org/changeset/base/332070 >>> >>> Log: >>> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. >>> >>> ... >> I might be missing something here, but it seems like you didn't actually >> change the side of >> ... >> struct md_s > > The md side can be as small as it likes. It's the caller who needs to > provide the large buffer, for other providers of the GEOM::ident > attribute. > >> And I don't see where the destination buffer went from 24 bytes to a >> larger value. > > Check the change in md_intel.c. > > Best, > Conrad > Right, but md_intel.c is for intel BIOS raid. I don't see the change that increased the size of the buffer in the caller from 24 bytes to something more useful? Or was it md_intel tasting the md(4) device? -- Allan Jude From owner-svn-src-all@freebsd.org Fri Apr 6 01:34:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AB98F93C5D; Fri, 6 Apr 2018 01:34:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06FBC7C60B; Fri, 6 Apr 2018 01:34:50 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id u62-v6so6708124ita.5; Thu, 05 Apr 2018 18:34:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=Z1/A8z/8vW91CPaXvqowPIxeSPR0pqN5W9sTaTZ/lpM=; b=RfxYNgf8E5P9e74LKkmDV0/A6YCLJyCchmqbKVjx+md6WVTYlJrG94BSpM4CGKYGIy N1+4/JJXotltpH1cW8VHF6GUxE5GkRRuIjbhPxbqlBFSihcchin3LOD2dmav7dfES+iI KUzCN2oBY7W1s7BT3Q2ZxdIA3TGc7lM1ucYaZ0rH274Yy/sM5AF7GyWxIxVzqY9TceGV IkQTbuCsDs4uC0+HgevSP0bSH6Ub4bbLW2W9O13Ho7uxCY0pHxViOvw8e/MyK7olefdJ ujUh/duL6Utmut+aCCViGUcsWaDZwQBYsb8F7rYNUN1kbYko7r96ehE3mBYTPxMiW+WE F/KQ== X-Gm-Message-State: ALQs6tD+gB5ldMeBg2vAiEj4upQhTNor4YTQgeZrP+ijxdj8TP81aSKi P4VvGHev4tjUXKq7npJNyU5ssTav X-Google-Smtp-Source: AIpwx48LMA9k0Xo9bT0aH33gzMazgIFBYe4duwsb2KuO/7cuXNKFlICapQwhiAjq/hVAexBGzQl4sw== X-Received: by 2002:a24:428f:: with SMTP id i137-v6mr16767391itb.33.1522978490141; Thu, 05 Apr 2018 18:34:50 -0700 (PDT) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com. [209.85.223.180]) by smtp.gmail.com with ESMTPSA id b72-v6sm5000433iti.17.2018.04.05.18.34.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 18:34:49 -0700 (PDT) Received: by mail-io0-f180.google.com with SMTP id q84so32825432iod.10; Thu, 05 Apr 2018 18:34:49 -0700 (PDT) X-Received: by 10.107.168.78 with SMTP id r75mr22651924ioe.143.1522978489737; Thu, 05 Apr 2018 18:34:49 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.62.19 with HTTP; Thu, 5 Apr 2018 18:34:49 -0700 (PDT) In-Reply-To: References: <201804051356.w35Duexg022529@repo.freebsd.org> <4cd9a49c-2d75-bfac-20df-72e8c80eded4@freebsd.org> From: Conrad Meyer Date: Thu, 5 Apr 2018 18:34:49 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332070 - in head/sys/geom: . label raid To: Allan Jude Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 01:34:51 -0000 Yep, exactly =E2=80=94 md_intel was tasting the md(4) device. md_intel invokes g_raid_md_get_label() early on in its taste routine. On Thu, Apr 5, 2018 at 6:29 PM, Allan Jude wrote: > On 2018-04-05 21:20, Conrad Meyer wrote: >> On Thu, Apr 5, 2018 at 6:08 PM, Allan Jude wrote= : >>> On 2018-04-05 09:56, Sean Bruno wrote: >>>> Author: sbruno >>>> Date: Thu Apr 5 13:56:40 2018 >>>> New Revision: 332070 >>>> URL: https://svnweb.freebsd.org/changeset/base/332070 >>>> >>>> Log: >>>> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE. >>>> >>>> ... >>> I might be missing something here, but it seems like you didn't actuall= y >>> change the side of >>> ... >>> struct md_s >> >> The md side can be as small as it likes. It's the caller who needs to >> provide the large buffer, for other providers of the GEOM::ident >> attribute. >> >>> And I don't see where the destination buffer went from 24 bytes to a >>> larger value. >> >> Check the change in md_intel.c. >> >> Best, >> Conrad >> > > Right, but md_intel.c is for intel BIOS raid. > > I don't see the change that increased the size of the buffer in the > caller from 24 bytes to something more useful? > > Or was it md_intel tasting the md(4) device? > > -- > Allan Jude From owner-svn-src-all@freebsd.org Fri Apr 6 02:47:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA747F98F05; Fri, 6 Apr 2018 02:47:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BF547F67B; Fri, 6 Apr 2018 02:47:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56E6B3BCF; Fri, 6 Apr 2018 02:47:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w362lhwZ017936; Fri, 6 Apr 2018 02:47:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w362lhVQ017935; Fri, 6 Apr 2018 02:47:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804060247.w362lhVQ017935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 02:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332089 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 332089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 02:47:43 -0000 Author: kevans Date: Fri Apr 6 02:47:43 2018 New Revision: 332089 URL: https://svnweb.freebsd.org/changeset/base/332089 Log: stable/11: Bump FreeBSD_Version for recent rc ${name}_limits bits Some ports had their own interpretation of _limits that conflicted with the new definition as of r328331. r331880 was an MFC of this commit to stable/11. Bump FreeBSD_Version in stable/11 following r331880 so that ports can do the right thing. This is a direct commit to stable/11 Reported by: 0mp Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Thu Apr 5 22:14:55 2018 (r332088) +++ stable/11/sys/sys/param.h Fri Apr 6 02:47:43 2018 (r332089) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1101513 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101514 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Apr 6 02:57:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596A9F99A52; Fri, 6 Apr 2018 02:57:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A3277FCF9; Fri, 6 Apr 2018 02:57:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0522D3D85; Fri, 6 Apr 2018 02:57:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w362vwpE023159; Fri, 6 Apr 2018 02:57:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w362vwi3023158; Fri, 6 Apr 2018 02:57:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804060257.w362vwi3023158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 6 Apr 2018 02:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332090 - head/stand/i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/stand/i386 X-SVN-Commit-Revision: 332090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 02:57:59 -0000 Author: emaste Date: Fri Apr 6 02:57:58 2018 New Revision: 332090 URL: https://svnweb.freebsd.org/changeset/base/332090 Log: stand: pass --no-rosegment for i386 bits when linking with lld btxld does not correctly handle input with other than 2 PT_LOAD segments. Passing --no-rosegment lets lld produce output eqivalent to ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO. PR: 225775 MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14956 Modified: head/stand/i386/Makefile.inc Modified: head/stand/i386/Makefile.inc ============================================================================== --- head/stand/i386/Makefile.inc Fri Apr 6 02:47:43 2018 (r332089) +++ head/stand/i386/Makefile.inc Fri Apr 6 02:57:58 2018 (r332090) @@ -2,8 +2,13 @@ # # $FreeBSD$ +.sinclude + LOADER_ADDRESS?=0x200000 LDFLAGS+= -nostdlib +.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld" +LDFLAGS+= -Wl,--no-rosegment +.endif # BTX components BTXDIR= ${BOOTOBJ}/i386/btx From owner-svn-src-all@freebsd.org Fri Apr 6 09:25:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88291F95A42; Fri, 6 Apr 2018 09:25:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1BD6F80D; Fri, 6 Apr 2018 09:25:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 361807DED; Fri, 6 Apr 2018 09:25:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w369P91C019560; Fri, 6 Apr 2018 09:25:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w369P8c2019558; Fri, 6 Apr 2018 09:25:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804060925.w369P8c2019558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 6 Apr 2018 09:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332091 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 332091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 09:25:09 -0000 Author: kib Date: Fri Apr 6 09:25:08 2018 New Revision: 332091 URL: https://svnweb.freebsd.org/changeset/base/332091 Log: MFC r331760: Make vm_map_max/min/pmap KBI stable. Modified: stable/11/sys/vm/vm_map.c stable/11/sys/vm/vm_map.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Fri Apr 6 02:57:58 2018 (r332090) +++ stable/11/sys/vm/vm_map.c Fri Apr 6 09:25:08 2018 (r332091) @@ -4257,6 +4257,27 @@ vm_map_lookup_done(vm_map_t map, vm_map_entry_t entry) vm_map_unlock_read(map); } +vm_offset_t +vm_map_max_KBI(const struct vm_map *map) +{ + + return (map->max_offset); +} + +vm_offset_t +vm_map_min_KBI(const struct vm_map *map) +{ + + return (map->min_offset); +} + +pmap_t +vm_map_pmap_KBI(vm_map_t map) +{ + + return (map->pmap); +} + #include "opt_ddb.h" #ifdef DDB #include Modified: stable/11/sys/vm/vm_map.h ============================================================================== --- stable/11/sys/vm/vm_map.h Fri Apr 6 02:57:58 2018 (r332090) +++ stable/11/sys/vm/vm_map.h Fri Apr 6 09:25:08 2018 (r332091) @@ -205,6 +205,11 @@ struct vm_map { #define MAP_BUSY_WAKEUP 0x02 #ifdef _KERNEL +#ifdef KLD_MODULE +#define vm_map_max(map) vm_map_max_KBI((map)) +#define vm_map_min(map) vm_map_min_KBI((map)) +#define vm_map_pmap(map) vm_map_pmap_KBI((map)) +#else static __inline vm_offset_t vm_map_max(const struct vm_map *map) { @@ -228,6 +233,7 @@ vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags { map->flags = (map->flags | set) & ~clear; } +#endif /* KLD_MODULE */ #endif /* _KERNEL */ /* @@ -288,6 +294,9 @@ void vm_map_wakeup(vm_map_t map); void vm_map_busy(vm_map_t map); void vm_map_unbusy(vm_map_t map); void vm_map_wait_busy(vm_map_t map); +vm_offset_t vm_map_max_KBI(const struct vm_map *map); +vm_offset_t vm_map_min_KBI(const struct vm_map *map); +pmap_t vm_map_pmap_KBI(vm_map_t map); #define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE) From owner-svn-src-all@freebsd.org Fri Apr 6 10:04:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E20F980BA; Fri, 6 Apr 2018 10:04:27 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74B36719B9; Fri, 6 Apr 2018 10:04:27 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id x82so2214069wmg.1; Fri, 06 Apr 2018 03:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=24vXZUxjJXNFWRN1uqGdqSgXSgZYv+YZQMRxR9RZFlM=; b=KyGRCkvRMGA4c4haE2mH7+7Z3uaMKSmOJpMVAedyQvFF46C9AnjWORQ0xL9aRS0UiA HWwJdInP+CrHgq0yiJ0NeizVWxzf+uMom91B79HDJIu3gvDNyYCCkQmMn8/ezgAMQhnF v1ktienTN0CB+hmQ8jQrZ8R3992X6KBVZDkyyQ0PRpgIDKBEiKlYkgE5WP8a8a49YwE/ CKHlFbOXgbU+S1K0xT+FNDFZwloExMto7XMKXTD+2jJvux/kFU9J1OedXrVQ7NIkUNQ3 w3Ey6RZXInrf2fRLOhigoPkQCh1XXV0k8F5sqXTfOuiVlVnJ59EtwTY8ePEgsJhKjcV6 nEXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=24vXZUxjJXNFWRN1uqGdqSgXSgZYv+YZQMRxR9RZFlM=; b=QKdrhmQPw6I0zEF9M4q0RwLYbXMPt398SAdbRDwJn3KE+hDoZ7hBHsALyDsyjNar1/ yvX/v+tBtgiaWL2In11z5ZVq2ZKj99WwvVAi7fQ7vsLp/Cns5r5ld9wt7BnNrPKfW++t zSrbkQzHbPM6e2DqoQy929x6oiKxdRMMty6RTje5PFoVi7uoPnk0U8A+9yn2zoxMclL2 8nUEXPvZ3kE7N5+c75Py/JGs4uV8InxohroY53md2lxqNp2H3qeRuqYN1HLH7kR4lMwJ LsEWJm8r5hVrQdV5z9nMe0aZWwVc1WgtAItTEhkyN73X8U01McQ88/bLReqxXg6DUIgi atZA== X-Gm-Message-State: ALQs6tAQtf4H6PQu2b1inR/4qxLzfBJhQpMn9MuHPUTOIvMw1IuPDAIA iORU07flWCyctHpxtY1y7wE= X-Google-Smtp-Source: AIpwx493igUMeWgIwHlAJ74/BjuB33ANKWdoHhFAUojDeSC0YMswG95/MB2/1khm6z55MrTOnofiHw== X-Received: by 10.80.137.149 with SMTP id g21mr6234846edg.25.1523009065774; Fri, 06 Apr 2018 03:04:25 -0700 (PDT) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id r16sm6157859edb.22.2018.04.06.03.04.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 03:04:24 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Fri, 6 Apr 2018 11:04:21 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Bruce Evans Cc: Warner Losh , Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332072 - head/sys/sys Message-ID: <20180406100421.kumj77n6sfgagozx@MacBook-Pro-de-Roger.local> References: <201804051431.w35EVtg4047897@repo.freebsd.org> <1522942377.49673.245.camel@freebsd.org> <20180405154619.q3blip266qa3z5ut@MacBook-Pro-de-Roger.local> <20180406022720.I3453@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180406022720.I3453@besplex.bde.org> User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 10:04:28 -0000 On Fri, Apr 06, 2018 at 03:12:08AM +1000, Bruce Evans wrote: > On Thu, 5 Apr 2018, Warner Losh wrote: > > > On Thu, Apr 5, 2018 at 9:46 AM, Roger Pau Monné wrote: > > > > > On Thu, Apr 05, 2018 at 09:32:57AM -0600, Ian Lepore wrote: > > > > On Thu, 2018-04-05 at 14:31 +0000, Roger Pau Monné wrote: > > > > > Log: > > > > > introduce GiB and MiB macros > > > > > ... > > > > > +/* Unit conversion macros. */ > > > > > +#define GiB(v) (v ## ULL << 30) > > > > > +#define MiB(v) (v ## ULL << 20) > > > > > + > > > > > #endif /* _SYS_PARAM_H_ */ > > > > > > > > These names don't make it clear whether the conversion is bytes->GiB or > > > > GiB->bytes. The names seem way too generic for a public namespace in a > > > > file as heavily included behind your back as param.h is. > > > > > > > > Also, this completely reasonable usage won't work, likely with > > > > confusing compile error messages: > > > > > > > > int bytes, gibytes; > > > > ... > > > > bytes = GiB(gibytes); > > > > > > I find those helpful for their specific usage. I could introduce > > > static inline functions like: > > > > > > size_t gb_to_bytes(size_t)... > > > > > > But I assume this is also going to cause further discussion. > > Yes, it gives even more namespace pollution and type errors. Macros > at least don't expose their internals if they are not used. > > size_t is actually already part of the undocumented namespace pollution > in . > > The type errors are restriction to just one type in another way. Type- > generic APIs that avoid such restrictions are much harder to implement > using inline functions than macros. > > > Yea, traditional macro names would be "gibtob" and "btogib" but I didn't > > just reply to bikeshed a name: > > > > But you don't need to specify a type, consider the current btodb macro: > > #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) > > */ \ > > (sizeof (bytes) > sizeof(long) \ > > ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ > > : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) > > > > which shows how to do this in a macro, which is orthogonal to any name you > > may choose. I can also bikeshed function vs macro :) > > This macro is mostly my mistake in 1995-1996. The long long abominations > in it were supposed to be temporary (until C99 standardized something > better). It was originally MD for i386 only and then the sizes of almost > all types are known and fixed so it is easier to hard-code minimal sizes > that work. The optimization of avoiding using 64-bit types was more needed > in 1995-1996 since CPUs were slower and compilers did less strength reduction. > > btodb() is much easier than dbtob() since it shifts right, so it can't > overflow unless the cast of 'bytes' is wrong so that it truncations. > dbtob() doesn't try hard to be optimal. It just always upcasts to > off_t. > > jake later convinced me (in connection with his PAE and sparc64 work) that > it should be the caller's responsibility to avoid overflow. Any casts in > the macro limits it to the types in it. This is why the page to byte > conversion macros don't have any casts in them. PAE usually needs 64-bit > results, but this would just be a pessimization for normal i386, and > deciding the casts in the macro as above is complicated. > > So correct GB() macros would look like ((v) << 30), where the caller must > cast v to a large enough type. E.g., for variable v which might be larger > than 4, on 32-bit systems, the caller must write something like > GB((uintmax_t)v). But it is easier for writing to just multiply v by 1G. > This is also easier for reading since it is unclear that GB() is even a > conversion or which direction it goes in. A longer descriptive name would > be about as clear and long as an explicit multiplication. > > I usually write 1G as ((type)1024 * 1024 * 1024) since the decimal and > even hex values of 1G have too many digits to be clear, and > multiplication is clearer than shifting and allows the type to be in > the factor. > > Disk block size conversions need to use macros since the DEV_BSIZE = 512 > was variable in theory (in practice this is now a fixed virtual size). > Conversions to G don't need macros since the magic number in them is no > more magic than the G in their name. I personally find the following chunk: if (addr < GiB(4)) ... Much more easier to read and parse than: if (addr < (4 * 1024 * 1024 * 1024)) ... But I won't insist anymore. I will revert this and introduce the macros locally where I need them. Roger. From owner-svn-src-all@freebsd.org Fri Apr 6 10:08:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 368B8F9851D; Fri, 6 Apr 2018 10:08:34 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5F3571D0E; Fri, 6 Apr 2018 10:08:33 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:41450) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1f4OIK-000caL-dP (Exim 4.89_2) (return-path ); Fri, 06 Apr 2018 11:08:32 +0100 Date: Fri, 6 Apr 2018 10:59:19 +0100 From: Ruslan Bukin To: rgrimes@freebsd.org Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r332012 - in vendor/opencsd: . dist dist/decoder dist/decoder/build dist/decoder/build/linux dist/decoder/build/linux/rctdl_c_api_lib dist/decoder/build/linux/ref_trace_decode_lib dist/... Message-ID: <20180406095919.GA10840@bsdpad.com> References: <20180404154320.GA72125@bsdpad.com> <201804041611.w34GBTOi093289@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201804041611.w34GBTOi093289@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 10:08:34 -0000 On Wed, Apr 04, 2018 at 09:11:29AM -0700, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Wed, Apr 04, 2018 at 08:02:04AM -0700, Rodney W. Grimes wrote: > > > > Author: br > > > > Date: Wed Apr 4 12:33:46 2018 > > > > New Revision: 332012 > > > > URL: https://svnweb.freebsd.org/changeset/base/332012 > > > > > > > > Log: > > > > Import OpenCSD -- an ARM CoreSight Trace Decode library. > > > > > > Why does this need to be in base? > > > Is there some reason it can not live as a port? > > > > > > > Yes opencsd is a dependancy for pmctrace(1) -- new HWPMC tracing tool. > > Why does pmctrace(1) need to be in base? > I can see that there is kernel driver code to support this, > is it to keep the userland pmctrace(1) closely coupled to > the kernel hwpmc(4) code? > pmctrace(1) is part of hwpmc, i.e. it is using its facilities, similar to pmcstat(1). > I shall assert this code also has a broken license form, > if you read LICENSE there is no copyright "above" to > retain, or print for a binary release. As a consumer of > that LICENSE technically I have to display nothing. > I am sure that is not the desired intent. > > I believe this is still under review without formal policy > from core. You are right. I just asked maintainter to fix this. Thanks Ruslan From owner-svn-src-all@freebsd.org Fri Apr 6 11:20:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42005F9D604; Fri, 6 Apr 2018 11:20:07 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1BD474E77; Fri, 6 Apr 2018 11:20:06 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D53311105D; Fri, 6 Apr 2018 11:20:06 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36BK6Dx074638; Fri, 6 Apr 2018 11:20:06 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36BK6s6074635; Fri, 6 Apr 2018 11:20:06 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201804061120.w36BK6s6074635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 6 Apr 2018 11:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head/sys: amd64/amd64 sys x86/x86 X-SVN-Commit-Revision: 332092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 11:20:07 -0000 Author: royger Date: Fri Apr 6 11:20:06 2018 New Revision: 332092 URL: https://svnweb.freebsd.org/changeset/base/332092 Log: remove GiB/MiB macros from param.h And instead define them in the files where they are used. Requested by: bde Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/sys/param.h head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Apr 6 09:25:08 2018 (r332091) +++ head/sys/amd64/amd64/mp_machdep.c Fri Apr 6 11:20:06 2018 (r332092) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #define BIOS_RESET (0x0f) #define BIOS_WARM (0x0a) +#define GiB(v) (v ## ULL << 30) + extern struct pcpu __pcpu[]; /* Temporary variables for init_secondary() */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Apr 6 09:25:08 2018 (r332091) +++ head/sys/sys/param.h Fri Apr 6 11:20:06 2018 (r332092) @@ -362,8 +362,4 @@ __END_DECLS */ #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) -/* Unit conversion macros. */ -#define GiB(v) (v ## ULL << 30) -#define MiB(v) (v ## ULL << 20) - #endif /* _SYS_PARAM_H_ */ Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Apr 6 09:25:08 2018 (r332091) +++ head/sys/x86/x86/mp_x86.c Fri Apr 6 11:20:06 2018 (r332092) @@ -160,6 +160,8 @@ struct cache_info { unsigned int boot_address; +#define MiB(v) (v ## ULL << 20) + void mem_range_AP_init(void) { From owner-svn-src-all@freebsd.org Fri Apr 6 11:42:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E72F9EE89; Fri, 6 Apr 2018 11:42:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 358F075CF7; Fri, 6 Apr 2018 11:42:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3080A11421; Fri, 6 Apr 2018 11:42:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Bg9RE089296; Fri, 6 Apr 2018 11:42:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Bg9Rh089295; Fri, 6 Apr 2018 11:42:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804061142.w36Bg9Rh089295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Apr 2018 11:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332093 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 332093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 11:42:09 -0000 Author: avg Date: Fri Apr 6 11:42:08 2018 New Revision: 332093 URL: https://svnweb.freebsd.org/changeset/base/332093 Log: MFC r330295: ZFS: fix adding vdevs to very large pools PR: 226096 Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Apr 6 11:20:06 2018 (r332092) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Apr 6 11:42:08 2018 (r332093) @@ -916,6 +916,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; + errno = ENOENT; return (-1); } From owner-svn-src-all@freebsd.org Fri Apr 6 11:48:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 315C6F9F405; Fri, 6 Apr 2018 11:48:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D37DD76132; Fri, 6 Apr 2018 11:48:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA43011559; Fri, 6 Apr 2018 11:48:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36BmCoE089629; Fri, 6 Apr 2018 11:48:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36BmCWf089628; Fri, 6 Apr 2018 11:48:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804061148.w36BmCWf089628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Apr 2018 11:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332094 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 332094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 11:48:13 -0000 Author: avg Date: Fri Apr 6 11:48:12 2018 New Revision: 332094 URL: https://svnweb.freebsd.org/changeset/base/332094 Log: MFC r330295: ZFS: fix adding vdevs to very large pools PR: 226096 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Apr 6 11:42:08 2018 (r332093) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Apr 6 11:48:12 2018 (r332094) @@ -911,6 +911,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; + errno = ENOENT; return (-1); } From owner-svn-src-all@freebsd.org Fri Apr 6 12:13:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3101FFA19F9; Fri, 6 Apr 2018 12:13:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5E2B7778A; Fri, 6 Apr 2018 12:13:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D007B11A29; Fri, 6 Apr 2018 12:13:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36CDWMw004773; Fri, 6 Apr 2018 12:13:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36CDWJ7004771; Fri, 6 Apr 2018 12:13:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804061213.w36CDWJ7004771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Apr 2018 12:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332095 - stable/11/sys/geom X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/geom X-SVN-Commit-Revision: 332095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 12:13:33 -0000 Author: avg Date: Fri Apr 6 12:13:32 2018 New Revision: 332095 URL: https://svnweb.freebsd.org/changeset/base/332095 Log: MFC r330977: g_access: deal with races created by geoms that drop the topology lock PR: 225960 Modified: stable/11/sys/geom/geom.h stable/11/sys/geom/geom_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/geom.h ============================================================================== --- stable/11/sys/geom/geom.h Fri Apr 6 11:48:12 2018 (r332094) +++ stable/11/sys/geom/geom.h Fri Apr 6 12:13:32 2018 (r332095) @@ -148,8 +148,10 @@ struct g_geom { void *spare1; void *softc; unsigned flags; -#define G_GEOM_WITHER 1 -#define G_GEOM_VOLATILE_BIO 2 +#define G_GEOM_WITHER 0x01 +#define G_GEOM_VOLATILE_BIO 0x02 +#define G_GEOM_IN_ACCESS 0x04 +#define G_GEOM_ACCESS_WAIT 0x08 }; /* Modified: stable/11/sys/geom/geom_subr.c ============================================================================== --- stable/11/sys/geom/geom_subr.c Fri Apr 6 11:48:12 2018 (r332094) +++ stable/11/sys/geom/geom_subr.c Fri Apr 6 12:13:32 2018 (r332095) @@ -862,7 +862,11 @@ int g_access(struct g_consumer *cp, int dcr, int dcw, int dce) { struct g_provider *pp; - int pr,pw,pe; + struct g_geom *gp; + int pw, pe; +#ifdef INVARIANTS + int sr, sw, se; +#endif int error; g_topology_assert(); @@ -870,6 +874,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int pp = cp->provider; KASSERT(pp != NULL, ("access but not attached")); G_VALID_PROVIDER(pp); + gp = pp->geom; g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)", cp, pp->name, dcr, dcw, dce); @@ -878,7 +883,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int KASSERT(cp->acw + dcw >= 0, ("access resulting in negative acw")); KASSERT(cp->ace + dce >= 0, ("access resulting in negative ace")); KASSERT(dcr != 0 || dcw != 0 || dce != 0, ("NOP access request")); - KASSERT(pp->geom->access != NULL, ("NULL geom->access")); + KASSERT(gp->access != NULL, ("NULL geom->access")); /* * If our class cares about being spoiled, and we have been, we @@ -890,10 +895,30 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int return (ENXIO); /* + * A number of GEOM classes either need to perform an I/O on the first + * open or to acquire a different subsystem's lock. To do that they + * may have to drop the topology lock. + * Other GEOM classes perform special actions when opening a lower rank + * geom for the first time. As a result, more than one thread may + * end up performing the special actions. + * So, we prevent concurrent "first" opens by marking the consumer with + * special flag. + * + * Note that if the geom's access method never drops the topology lock, + * then we will never see G_GEOM_IN_ACCESS here. + */ + while ((gp->flags & G_GEOM_IN_ACCESS) != 0) { + g_trace(G_T_ACCESS, + "%s: race on geom %s via provider %s and consumer of %s", + __func__, gp->name, pp->name, cp->geom->name); + gp->flags |= G_GEOM_ACCESS_WAIT; + g_topology_sleep(gp, 0); + } + + /* * Figure out what counts the provider would have had, if this * consumer had (r0w0e0) at this time. */ - pr = pp->acr - cp->acr; pw = pp->acw - cp->acw; pe = pp->ace - cp->ace; @@ -905,7 +930,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int pp, pp->name); /* If foot-shooting is enabled, any open on rank#1 is OK */ - if ((g_debugflags & 16) && pp->geom->rank == 1) + if ((g_debugflags & 16) && gp->rank == 1) ; /* If we try exclusive but already write: fail */ else if (dce > 0 && pw > 0) @@ -922,11 +947,27 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int /* Ok then... */ - error = pp->geom->access(pp, dcr, dcw, dce); +#ifdef INVARIANTS + sr = cp->acr; + sw = cp->acw; + se = cp->ace; +#endif + gp->flags |= G_GEOM_IN_ACCESS; + error = gp->access(pp, dcr, dcw, dce); KASSERT(dcr > 0 || dcw > 0 || dce > 0 || error == 0, ("Geom provider %s::%s dcr=%d dcw=%d dce=%d error=%d failed " - "closing ->access()", pp->geom->class->name, pp->name, dcr, dcw, + "closing ->access()", gp->class->name, pp->name, dcr, dcw, dce, error)); + + g_topology_assert(); + gp->flags &= ~G_GEOM_IN_ACCESS; + KASSERT(cp->acr == sr && cp->acw == sw && cp->ace == se, + ("Access counts changed during geom->access")); + if ((gp->flags & G_GEOM_ACCESS_WAIT) != 0) { + gp->flags &= ~G_GEOM_ACCESS_WAIT; + wakeup(gp); + } + if (!error) { /* * If we open first write, spoil any partner consumers. @@ -936,7 +977,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int if (pp->acw == 0 && dcw != 0) g_spoil(pp, cp); else if (pp->acw != 0 && pp->acw == -dcw && pp->error == 0 && - !(pp->geom->flags & G_GEOM_WITHER)) + !(gp->flags & G_GEOM_WITHER)) g_post_event(g_new_provider_event, pp, M_WAITOK, pp, NULL); From owner-svn-src-all@freebsd.org Fri Apr 6 12:15:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E7C8FA1BC8; Fri, 6 Apr 2018 12:15:06 +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 5515377A41; Fri, 6 Apr 2018 12:15:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0A19210479ED; Fri, 6 Apr 2018 22:15:01 +1000 (AEST) Date: Fri, 6 Apr 2018 22:15:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 In-Reply-To: <201804061120.w36BK6s6074635@repo.freebsd.org> Message-ID: <20180406213913.G2230@besplex.bde.org> References: <201804061120.w36BK6s6074635@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=lUc6861xcdqJ360VjMYA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 12:15:07 -0000 On Fri, 6 Apr 2018, [UTF-8] Roger Pau Monn=C3=A9 wrote: > Log: > remove GiB/MiB macros from param.h > > And instead define them in the files where they are used. > > Requested by: bde Thanks, but these files have a negative need for the macros. > Modified: head/sys/amd64/amd64/mp_machdep.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/amd64/amd64/mp_machdep.c=09Fri Apr 6 09:25:08 2018=09(r3320= 91) > +++ head/sys/amd64/amd64/mp_machdep.c=09Fri Apr 6 11:20:06 2018=09(r3320= 92) > @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); > #define BIOS_RESET=09=09(0x0f) > #define BIOS_WARM=09=09(0x0a) > > +#define GiB(v)=09=09=09(v ## ULL << 30) > + In this file, the macro is used only once. It takes about 4 times as much code to define and use the macro once as to write (vm_paddr_t)4 << 30. Much more than 4 times longer to read, since some searching is needed to find the macro and some decoding is needed to understand it. More to see that the wrong type returned by the macro is not a problem. The value can be written more consisely as 4L << 30 after doing a similar type analysis. 1G is normally written as 1024 * 1024 * 1024 since this is a bit clearer than 1 << 30. This depends n a similar type analysis -- the multipliction and the shift don't overflow 32-bit ints. But care must be taken with multiplication by another 4 or even 2. > Modified: head/sys/x86/x86/mp_x86.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/x86/x86/mp_x86.c=09Fri Apr 6 09:25:08 2018=09(r332091) > +++ head/sys/x86/x86/mp_x86.c=09Fri Apr 6 11:20:06 2018=09(r332092) > @@ -160,6 +160,8 @@ struct cache_info { > > unsigned int boot_address; > > +#define MiB(v)=09(v ## ULL << 20) > + In this file, the macro is used twice with v =3D 1. Defining and using it takes only about twice as much code and time to read as (vm_paddr_t)1 << 20= =2E Here it is more important to use vm_paddr_t since this code is shared by amd64, i386 and i386-PAE so the size of vm_paddr_t is variable. However, since 1MB is far below INT_MAX, it doesn't take much type analysis to see than the shorter 1 << 20 is safe. 2 copies of the clearer 1024 * 1024 is also shorter than the macro and 2 calls to it. The macro name doesn't match the comment. The comment still says 1MB. The fix is not to break the comment. Later in the file, basemem is converted from K to bytes by multiplying by 1024. Now 1024 is shorter and clearer than 1 << 10 or 0x400 or a macro with many undocmented details. The type analysis to show that multiplying by 1024 doesn't overflow is slightly more complicated since basemem is a variable. It is only easy to see that this doesn't overflow because basemem is an old real-mode value. 640K was large enough for anyone, and basemem in bytes is less than that. 640K was 20 times INT_MAX, but is now 1/3276 of INT_MAX. Bruce From owner-svn-src-all@freebsd.org Fri Apr 6 12:24:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88D1F806FA; Fri, 6 Apr 2018 12:24:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AF4C781EE; Fri, 6 Apr 2018 12:24:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65CF511BD5; Fri, 6 Apr 2018 12:24:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36CO0B5009952; Fri, 6 Apr 2018 12:24:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36CO0me009950; Fri, 6 Apr 2018 12:24:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804061224.w36CO0me009950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Apr 2018 12:24: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: r332096 - stable/10/sys/geom X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/geom X-SVN-Commit-Revision: 332096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 12:24:01 -0000 Author: avg Date: Fri Apr 6 12:23:59 2018 New Revision: 332096 URL: https://svnweb.freebsd.org/changeset/base/332096 Log: MFC r330977: g_access: deal with races created by geoms that drop the topology lock PR: 225960 Modified: stable/10/sys/geom/geom.h stable/10/sys/geom/geom_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom.h ============================================================================== --- stable/10/sys/geom/geom.h Fri Apr 6 12:13:32 2018 (r332095) +++ stable/10/sys/geom/geom.h Fri Apr 6 12:23:59 2018 (r332096) @@ -147,8 +147,10 @@ struct g_geom { void *spare1; void *softc; unsigned flags; -#define G_GEOM_WITHER 1 -#define G_GEOM_VOLATILE_BIO 2 +#define G_GEOM_WITHER 0x01 +#define G_GEOM_VOLATILE_BIO 0x02 +#define G_GEOM_IN_ACCESS 0x04 +#define G_GEOM_ACCESS_WAIT 0x08 }; /* Modified: stable/10/sys/geom/geom_subr.c ============================================================================== --- stable/10/sys/geom/geom_subr.c Fri Apr 6 12:13:32 2018 (r332095) +++ stable/10/sys/geom/geom_subr.c Fri Apr 6 12:23:59 2018 (r332096) @@ -859,7 +859,11 @@ int g_access(struct g_consumer *cp, int dcr, int dcw, int dce) { struct g_provider *pp; - int pr,pw,pe; + struct g_geom *gp; + int pw, pe; +#ifdef INVARIANTS + int sr, sw, se; +#endif int error; g_topology_assert(); @@ -867,6 +871,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int pp = cp->provider; KASSERT(pp != NULL, ("access but not attached")); G_VALID_PROVIDER(pp); + gp = pp->geom; g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)", cp, pp->name, dcr, dcw, dce); @@ -875,7 +880,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int KASSERT(cp->acw + dcw >= 0, ("access resulting in negative acw")); KASSERT(cp->ace + dce >= 0, ("access resulting in negative ace")); KASSERT(dcr != 0 || dcw != 0 || dce != 0, ("NOP access request")); - KASSERT(pp->geom->access != NULL, ("NULL geom->access")); + KASSERT(gp->access != NULL, ("NULL geom->access")); /* * If our class cares about being spoiled, and we have been, we @@ -887,10 +892,30 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int return (ENXIO); /* + * A number of GEOM classes either need to perform an I/O on the first + * open or to acquire a different subsystem's lock. To do that they + * may have to drop the topology lock. + * Other GEOM classes perform special actions when opening a lower rank + * geom for the first time. As a result, more than one thread may + * end up performing the special actions. + * So, we prevent concurrent "first" opens by marking the consumer with + * special flag. + * + * Note that if the geom's access method never drops the topology lock, + * then we will never see G_GEOM_IN_ACCESS here. + */ + while ((gp->flags & G_GEOM_IN_ACCESS) != 0) { + g_trace(G_T_ACCESS, + "%s: race on geom %s via provider %s and consumer of %s", + __func__, gp->name, pp->name, cp->geom->name); + gp->flags |= G_GEOM_ACCESS_WAIT; + g_topology_sleep(gp, 0); + } + + /* * Figure out what counts the provider would have had, if this * consumer had (r0w0e0) at this time. */ - pr = pp->acr - cp->acr; pw = pp->acw - cp->acw; pe = pp->ace - cp->ace; @@ -902,7 +927,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int pp, pp->name); /* If foot-shooting is enabled, any open on rank#1 is OK */ - if ((g_debugflags & 16) && pp->geom->rank == 1) + if ((g_debugflags & 16) && gp->rank == 1) ; /* If we try exclusive but already write: fail */ else if (dce > 0 && pw > 0) @@ -916,11 +941,27 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int /* Ok then... */ - error = pp->geom->access(pp, dcr, dcw, dce); +#ifdef INVARIANTS + sr = cp->acr; + sw = cp->acw; + se = cp->ace; +#endif + gp->flags |= G_GEOM_IN_ACCESS; + error = gp->access(pp, dcr, dcw, dce); KASSERT(dcr > 0 || dcw > 0 || dce > 0 || error == 0, ("Geom provider %s::%s dcr=%d dcw=%d dce=%d error=%d failed " - "closing ->access()", pp->geom->class->name, pp->name, dcr, dcw, + "closing ->access()", gp->class->name, pp->name, dcr, dcw, dce, error)); + + g_topology_assert(); + gp->flags &= ~G_GEOM_IN_ACCESS; + KASSERT(cp->acr == sr && cp->acw == sw && cp->ace == se, + ("Access counts changed during geom->access")); + if ((gp->flags & G_GEOM_ACCESS_WAIT) != 0) { + gp->flags &= ~G_GEOM_ACCESS_WAIT; + wakeup(gp); + } + if (!error) { /* * If we open first write, spoil any partner consumers. @@ -930,7 +971,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int if (pp->acw == 0 && dcw != 0) g_spoil(pp, cp); else if (pp->acw != 0 && pp->acw == -dcw && pp->error == 0 && - !(pp->geom->flags & G_GEOM_WITHER)) + !(gp->flags & G_GEOM_WITHER)) g_post_event(g_new_provider_event, pp, M_WAITOK, pp, NULL); From owner-svn-src-all@freebsd.org Fri Apr 6 12:39:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E8FFF81D8A; Fri, 6 Apr 2018 12:39:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0C978DAC; Fri, 6 Apr 2018 12:39:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F6E11D6E; Fri, 6 Apr 2018 12:39:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36CdX53015118; Fri, 6 Apr 2018 12:39:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36CdX1l015117; Fri, 6 Apr 2018 12:39:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804061239.w36CdX1l015117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Apr 2018 12:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332097 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/i386/i386 X-SVN-Commit-Revision: 332097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 12:39:34 -0000 Author: avg Date: Fri Apr 6 12:39:33 2018 New Revision: 332097 URL: https://svnweb.freebsd.org/changeset/base/332097 Log: MFC r331761: align i386 cpu_reset() with amd64 version Modified: stable/11/sys/i386/i386/vm_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/11/sys/i386/i386/vm_machdep.c Fri Apr 6 12:23:59 2018 (r332096) +++ stable/11/sys/i386/i386/vm_machdep.c Fri Apr 6 12:39:33 2018 (r332097) @@ -594,7 +594,8 @@ cpu_reset_proxy() cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) - ; /* Wait for other cpu to see that we've started */ + ia32_pause(); /* Wait for other cpu to see that we've started */ + CPU_SETOF(cpu_reset_proxyid, &tcrp); stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); @@ -634,19 +635,21 @@ cpu_reset() printf("cpu_reset: Restarting BSP\n"); /* Restart CPU #0. */ - /* XXX: restart_cpus(1 << 0); */ CPU_SETOF(0, &started_cpus); wmb(); cnt = 0; - while (cpu_reset_proxy_active == 0 && cnt < 10000000) + while (cpu_reset_proxy_active == 0 && cnt < 10000000) { + ia32_pause(); cnt++; /* Wait for BSP to announce restart */ + } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); enable_intr(); cpu_reset_proxy_active = 2; - while (1); + while (1) + ia32_pause(); /* NOTREACHED */ } From owner-svn-src-all@freebsd.org Fri Apr 6 12:39:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19174F81E09; Fri, 6 Apr 2018 12:39:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFFB978EC2; Fri, 6 Apr 2018 12:39:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BABB011D6F; Fri, 6 Apr 2018 12:39:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Cdlnv015174; Fri, 6 Apr 2018 12:39:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36CdlEk015173; Fri, 6 Apr 2018 12:39:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804061239.w36CdlEk015173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 6 Apr 2018 12:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332098 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/i386/i386 X-SVN-Commit-Revision: 332098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 12:39:48 -0000 Author: avg Date: Fri Apr 6 12:39:47 2018 New Revision: 332098 URL: https://svnweb.freebsd.org/changeset/base/332098 Log: MFC r331761: align i386 cpu_reset() with amd64 version Modified: stable/10/sys/i386/i386/vm_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/10/sys/i386/i386/vm_machdep.c Fri Apr 6 12:39:33 2018 (r332097) +++ stable/10/sys/i386/i386/vm_machdep.c Fri Apr 6 12:39:47 2018 (r332098) @@ -649,7 +649,8 @@ cpu_reset_proxy() cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) - ; /* Wait for other cpu to see that we've started */ + ia32_pause(); /* Wait for other cpu to see that we've started */ + CPU_SETOF(cpu_reset_proxyid, &tcrp); stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); @@ -689,19 +690,21 @@ cpu_reset() printf("cpu_reset: Restarting BSP\n"); /* Restart CPU #0. */ - /* XXX: restart_cpus(1 << 0); */ CPU_SETOF(0, &started_cpus); wmb(); cnt = 0; - while (cpu_reset_proxy_active == 0 && cnt < 10000000) + while (cpu_reset_proxy_active == 0 && cnt < 10000000) { + ia32_pause(); cnt++; /* Wait for BSP to announce restart */ + } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); enable_intr(); cpu_reset_proxy_active = 2; - while (1); + while (1) + ia32_pause(); /* NOTREACHED */ } From owner-svn-src-all@freebsd.org Fri Apr 6 12:57:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDABFF834D8; Fri, 6 Apr 2018 12:57:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0A8279DED; Fri, 6 Apr 2018 12:57:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AE511209C; Fri, 6 Apr 2018 12:57:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Cv1kN025124; Fri, 6 Apr 2018 12:57:01 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Cv1ks025123; Fri, 6 Apr 2018 12:57:01 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804061257.w36Cv1ks025123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 6 Apr 2018 12:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332099 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 12:57:02 -0000 Author: ed Date: Fri Apr 6 12:57:01 2018 New Revision: 332099 URL: https://svnweb.freebsd.org/changeset/base/332099 Log: Add RFC 5424 syslog message parsing to syslogd. Syslogd currently uses the RFC 3164 format for its log messages.One limitation of RFC 3164 is that it cannot be used to log entries with sub-second precision timestamps. One of our users has expressed a desire for doing this for doing some basic performance measurements. This change attempts to make a first cut at switching to RFC 5424 based logging. The first step is to alter syslogd's input path to properly parse such messages. It alters the logmsg() prototype to match the fields of RFC 5424. The parsemsg() function is extended to parse both RFC 3164 and 5424 messages and call into logmsg() accordingly. Additional changes include: - Introducing proper parsing of timestamps, so that they can be printed in any desired output format. This means we need to infer the year and timezone for RFC 3164 timestamps. - Removing ISKERNEL. This can now be realised by simply providing an APP-NAME (== "kernel"). - Extending RFC 3164 parsing to trim off the TAG prefix and using that to derive APP-NAME and PROCID. - Increase MAXLINE. RFC 5424 mentions we should support 2k messages. Differential Revision: https://reviews.freebsd.org/D14926 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Apr 6 12:39:47 2018 (r332098) +++ head/usr.sbin/syslogd/syslogd.c Fri Apr 6 12:57:01 2018 (r332099) @@ -28,6 +28,33 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Prodrive Technologies, https://prodrive-technologies.com/ + * Author: Ed Schouten + * + * 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. + */ #ifndef lint static const char copyright[] = @@ -71,8 +98,7 @@ __FBSDID("$FreeBSD$"); */ /* Maximum number of characters in time of last occurrence */ -#define MAXDATELEN 16 -#define MAXLINE 1024 /* maximum line length */ +#define MAXLINE 2048 /* maximum line length */ #define MAXSVLINE MAXLINE /* maximum saved line length */ #define DEFUPRI (LOG_USER|LOG_NOTICE) #define DEFSPRI (LOG_KERN|LOG_CRIT) @@ -97,8 +123,8 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include +#include #include #include #include @@ -107,6 +133,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -174,8 +201,17 @@ static STAILQ_HEAD(, socklist) shead = STAILQ_HEAD_INI #define IGN_CONS 0x001 /* don't print on console */ #define SYNC_FILE 0x002 /* do fsync on file after printing */ #define MARK 0x008 /* this message is a mark */ -#define ISKERNEL 0x010 /* kernel generated message */ +/* Timestamps of log entries. */ +struct logtime { + struct tm tm; + suseconds_t usec; +}; + +/* Traditional syslog timestamp format. */ +#define RFC3164_DATELEN 15 +#define RFC3164_DATEFMT "%b %e %H:%M:%S" + /* * This structure represents the files that will have log * copies printed. @@ -215,10 +251,10 @@ struct filed { #define fu_pipe_pname f_un.f_pipe.f_pname #define fu_pipe_pid f_un.f_pipe.f_pid char f_prevline[MAXSVLINE]; /* last message logged */ - char f_lasttime[MAXDATELEN]; /* time of last occurrence */ + struct logtime f_lasttime; /* time of last occurrence */ char f_prevhost[MAXHOSTNAMELEN]; /* host from which recd. */ int f_prevpri; /* pri of f_prevline */ - int f_prevlen; /* length of f_prevline */ + size_t f_prevlen; /* length of f_prevline */ int f_prevcount; /* repetition cnt of prevline */ u_int f_repeatcount; /* number of "repeated" msgs */ int f_flags; /* file-specific flags */ @@ -352,7 +388,8 @@ static void domark(int); static void fprintlog(struct filed *, int, const char *); static void init(int); static void logerror(const char *); -static void logmsg(int, const char *, const char *, const char *, int); +static void logmsg(int, const struct logtime *, const char *, const char *, + const char *, const char *, const char *, const char *, int); static void log_deadchild(pid_t, int, const char *); static void markit(void); static int socksetup(struct peer *); @@ -852,17 +889,352 @@ usage(void) } /* - * Take a raw input line, extract PRI, TIMESTAMP and HOSTNAME from the message, - * and print the message on the appropriate log files. + * Removes characters from log messages that are unsafe to display. + * TODO: Permit UTF-8 strings that include a BOM per RFC 5424? */ static void +parsemsg_remove_unsafe_characters(const char *in, char *out, size_t outlen) +{ + char *q; + int c; + + q = out; + while ((c = (unsigned char)*in++) != '\0' && q < out + outlen - 4) { + if (mask_C1 && (c & 0x80) && c < 0xA0) { + c &= 0x7F; + *q++ = 'M'; + *q++ = '-'; + } + if (isascii(c) && iscntrl(c)) { + if (c == '\n') { + *q++ = ' '; + } else if (c == '\t') { + *q++ = '\t'; + } else { + *q++ = '^'; + *q++ = c ^ 0100; + } + } else { + *q++ = c; + } + } + *q = '\0'; +} + +/* + * Parses a syslog message according to RFC 5424, assuming that PRI and + * VERSION (i.e., "<%d>1 ") have already been parsed by parsemsg(). The + * parsed result is passed to logmsg(). + */ +static void +parsemsg_rfc5424(const char *from, int pri, char *msg) +{ + const struct logtime *timestamp; + struct logtime timestamp_remote = { 0 }; + const char *omsg, *hostname, *app_name, *procid, *msgid, + *structured_data; + char line[MAXLINE + 1]; + +#define FAIL_IF(field, expr) do { \ + if (expr) { \ + dprintf("Failed to parse " field " from %s: %s\n", \ + from, omsg); \ + return; \ + } \ +} while (0) +#define PARSE_CHAR(field, sep) do { \ + FAIL_IF(field, *msg != sep); \ + ++msg; \ +} while (0) +#define IF_NOT_NILVALUE(var) \ + if (msg[0] == '-' && msg[1] == ' ') { \ + msg += 2; \ + var = NULL; \ + } else if (msg[0] == '-' && msg[1] == '\0') { \ + ++msg; \ + var = NULL; \ + } else + + omsg = msg; + IF_NOT_NILVALUE(timestamp) { + /* Parse RFC 3339-like timestamp. */ +#define PARSE_NUMBER(dest, length, min, max) do { \ + int i, v; \ + \ + v = 0; \ + for (i = 0; i < length; ++i) { \ + FAIL_IF("TIMESTAMP", *msg < '0' || *msg > '9'); \ + v = v * 10 + *msg++ - '0'; \ + } \ + FAIL_IF("TIMESTAMP", v < min || v > max); \ + dest = v; \ +} while (0) + /* Date and time. */ + PARSE_NUMBER(timestamp_remote.tm.tm_year, 4, 0, 9999); + timestamp_remote.tm.tm_year -= 1900; + PARSE_CHAR("TIMESTAMP", '-'); + PARSE_NUMBER(timestamp_remote.tm.tm_mon, 2, 1, 12); + --timestamp_remote.tm.tm_mon; + PARSE_CHAR("TIMESTAMP", '-'); + PARSE_NUMBER(timestamp_remote.tm.tm_mday, 2, 1, 31); + PARSE_CHAR("TIMESTAMP", 'T'); + PARSE_NUMBER(timestamp_remote.tm.tm_hour, 2, 0, 23); + PARSE_CHAR("TIMESTAMP", ':'); + PARSE_NUMBER(timestamp_remote.tm.tm_min, 2, 0, 59); + PARSE_CHAR("TIMESTAMP", ':'); + PARSE_NUMBER(timestamp_remote.tm.tm_sec, 2, 0, 59); + /* Perform normalization. */ + timegm(×tamp_remote.tm); + /* Optional: fractional seconds. */ + if (msg[0] == '.' && msg[1] >= '0' && msg[1] <= '9') { + int i; + + ++msg; + for (i = 100000; i != 0; i /= 10) { + if (*msg < '0' || *msg > '9') + break; + timestamp_remote.usec += (*msg++ - '0') * i; + } + } + /* Timezone. */ + if (*msg == 'Z') { + /* UTC. */ + ++msg; + } else { + int sign, tz_hour, tz_min; + + /* Local time zone offset. */ + FAIL_IF("TIMESTAMP", *msg != '-' && *msg != '+'); + sign = *msg++ == '-' ? -1 : 1; + PARSE_NUMBER(tz_hour, 2, 0, 23); + PARSE_CHAR("TIMESTAMP", ':'); + PARSE_NUMBER(tz_min, 2, 0, 59); + timestamp_remote.tm.tm_gmtoff = + sign * (tz_hour * 3600 + tz_min * 60); + } +#undef PARSE_NUMBER + PARSE_CHAR("TIMESTAMP", ' '); + timestamp = RemoteAddDate ? NULL : ×tamp_remote; + } + + /* String fields part of the HEADER. */ +#define PARSE_STRING(field, var) \ + IF_NOT_NILVALUE(var) { \ + var = msg; \ + while (*msg >= '!' && *msg <= '~') \ + ++msg; \ + FAIL_IF(field, var == msg); \ + PARSE_CHAR(field, ' '); \ + msg[-1] = '\0'; \ + } + PARSE_STRING("HOSTNAME", hostname); + PARSE_STRING("APP-NAME", app_name); + PARSE_STRING("PROCID", procid); + PARSE_STRING("MSGID", msgid); +#undef PARSE_STRING + + /* Structured data. */ +#define PARSE_SD_NAME() do { \ + const char *start; \ + \ + start = msg; \ + while (*msg >= '!' && *msg <= '~' && *msg != '=' && \ + *msg != ']' && *msg != '"') \ + ++msg; \ + FAIL_IF("STRUCTURED-NAME", start == msg); \ +} while (0) + IF_NOT_NILVALUE(structured_data) { + /* SD-ELEMENT. */ + while (*msg == '[') { + ++msg; + /* SD-ID. */ + PARSE_SD_NAME(); + /* SD-PARAM. */ + while (*msg == ' ') { + ++msg; + /* PARAM-NAME. */ + PARSE_SD_NAME(); + PARSE_CHAR("STRUCTURED-NAME", '='); + PARSE_CHAR("STRUCTURED-NAME", '"'); + while (*msg != '"') { + FAIL_IF("STRUCTURED-NAME", + *msg == '\0'); + if (*msg++ == '\\') { + FAIL_IF("STRUCTURED-NAME", + *msg == '\0'); + ++msg; + } + } + ++msg; + } + PARSE_CHAR("STRUCTURED-NAME", ']'); + } + PARSE_CHAR("STRUCTURED-NAME", ' '); + msg[-1] = '\0'; + } +#undef PARSE_SD_NAME + +#undef FAIL_IF +#undef PARSE_CHAR +#undef IF_NOT_NILVALUE + + parsemsg_remove_unsafe_characters(msg, line, sizeof(line)); + logmsg(pri, timestamp, from, app_name, procid, msgid, + structured_data, line, 0); +} + +/* + * Trims the application name ("TAG" in RFC 3164 terminology) and + * process ID from a message if present. + */ +static void +parsemsg_rfc3164_app_name_procid(char **msg, const char **app_name, + const char **procid) { + char *m, *app_name_begin, *procid_begin; + size_t app_name_length, procid_length; + + m = *msg; + + /* Application name. */ + app_name_begin = m; + app_name_length = strspn(m, + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789" + "_-"); + if (app_name_length == 0) + goto bad; + m += app_name_length; + + /* Process identifier (optional). */ + if (*m == '[') { + procid_begin = ++m; + procid_length = strspn(m, "0123456789"); + if (procid_length == 0) + goto bad; + m += procid_length; + if (*m++ != ']') + goto bad; + } else { + procid_begin = NULL; + procid_length = 0; + } + + /* Separator. */ + if (m[0] != ':' || m[1] != ' ') + goto bad; + + /* Split strings from input. */ + app_name_begin[app_name_length] = '\0'; + if (procid_begin != 0) + procid_begin[procid_length] = '\0'; + + *msg = m + 2; + *app_name = app_name_begin; + *procid = procid_begin; + return; +bad: + *app_name = NULL; + *procid = NULL; +} + +/* + * Parses a syslog message according to RFC 3164, assuming that PRI + * (i.e., "<%d>") has already been parsed by parsemsg(). The parsed + * result is passed to logmsg(). + */ +static void +parsemsg_rfc3164(const char *from, int pri, char *msg) +{ + struct tm tm_parsed; + const struct logtime *timestamp; + struct logtime timestamp_remote = { 0 }; + const char *app_name, *procid; + size_t i, msglen; + char line[MAXLINE + 1]; + + /* Parse the timestamp provided by the remote side. */ + if (strptime(msg, RFC3164_DATEFMT, &tm_parsed) != + msg + RFC3164_DATELEN || msg[RFC3164_DATELEN] != ' ') { + dprintf("Failed to parse TIMESTAMP from %s: %s\n", from, msg); + return; + } + msg += RFC3164_DATELEN + 1; + + if (!RemoteAddDate) { + struct tm tm_now; + time_t t_now; + int year; + + /* + * As the timestamp does not contain the year number, + * daylight saving time information, nor a time zone, + * attempt to infer it. Due to clock skews, the + * timestamp may even be part of the next year. Use the + * last year for which the timestamp is at most one week + * in the future. + * + * This loop can only run for at most three iterations + * before terminating. + */ + t_now = time(NULL); + localtime_r(&t_now, &tm_now); + for (year = tm_now.tm_year + 1;; --year) { + assert(year >= tm_now.tm_year - 1); + timestamp_remote.tm = tm_parsed; + timestamp_remote.tm.tm_year = year; + timestamp_remote.tm.tm_isdst = -1; + if (mktime(×tamp_remote.tm) < + t_now + 7 * 24 * 60 * 60) + break; + } + timestamp = ×tamp_remote; + } else + timestamp = NULL; + + /* + * A single space character MUST also follow the HOSTNAME field. + */ + msglen = strlen(msg); + for (i = 0; i < MIN(MAXHOSTNAMELEN, msglen); i++) { + if (msg[i] == ' ') { + if (RemoteHostname) { + msg[i] = '\0'; + from = msg; + } + msg += i + 1; + break; + } + /* + * Support non RFC compliant messages, without hostname. + */ + if (msg[i] == ':') + break; + } + if (i == MIN(MAXHOSTNAMELEN, msglen)) { + dprintf("Invalid HOSTNAME from %s: %s\n", from, msg); + return; + } + + /* Remove the TAG, if present. */ + parsemsg_rfc3164_app_name_procid(&msg, &app_name, &procid); + parsemsg_remove_unsafe_characters(msg, line, sizeof(line)); + logmsg(pri, timestamp, from, app_name, procid, NULL, NULL, line, 0); +} + +/* + * Takes a raw input line, extracts PRI and determines whether the + * message is formatted according to RFC 3164 or RFC 5424. Continues + * parsing of addition fields in the message according to those + * standards and prints the message on the appropriate log files. + */ +static void parsemsg(const char *from, char *msg) { - const char *timestamp; char *q; long n; - int i, c, pri, msglen; - char line[MAXLINE + 1]; + size_t i; + int pri; /* Parse PRI. */ if (msg[0] != '<' || !isdigit(msg[1])) { @@ -900,75 +1272,12 @@ parsemsg(const char *from, char *msg) if ((pri & LOG_FACMASK) == LOG_KERN && !KeepKernFac) pri = LOG_MAKEPRI(LOG_USER, LOG_PRI(pri)); - /* - * The TIMESTAMP field is the local time and is in the format of - * "Mmm dd hh:mm:ss" (without the quote marks). - * A single space character MUST follow the TIMESTAMP field. - * - * XXXGL: the check can be improved. - */ + /* Parse VERSION. */ msg += i + 1; - msglen = strlen(msg); - if (msglen < MAXDATELEN || msg[3] != ' ' || msg[6] != ' ' || - msg[9] != ':' || msg[12] != ':' || msg[15] != ' ') { - dprintf("Invalid TIMESTAMP from %s: %s\n", from, msg); - return; - } - - if (!RemoteAddDate) - timestamp = msg; + if (msg[0] == '1' && msg[1] == ' ') + parsemsg_rfc5424(from, pri, msg + 2); else - timestamp = NULL; - msg += MAXDATELEN; - msglen -= MAXDATELEN; - - /* - * A single space character MUST also follow the HOSTNAME field. - */ - for (i = 0; i < MIN(MAXHOSTNAMELEN, msglen); i++) { - if (msg[i] == ' ') { - if (RemoteHostname) { - msg[i] = '\0'; - from = msg; - } - msg += i + 1; - break; - } - /* - * Support non RFC compliant messages, without hostname. - */ - if (msg[i] == ':') - break; - } - if (i == MIN(MAXHOSTNAMELEN, msglen)) { - dprintf("Invalid HOSTNAME from %s: %s\n", from, msg); - return; - } - - q = line; - while ((c = (unsigned char)*msg++) != '\0' && - q < &line[sizeof(line) - 4]) { - if (mask_C1 && (c & 0x80) && c < 0xA0) { - c &= 0x7F; - *q++ = 'M'; - *q++ = '-'; - } - if (isascii(c) && iscntrl(c)) { - if (c == '\n') { - *q++ = ' '; - } else if (c == '\t') { - *q++ = '\t'; - } else { - *q++ = '^'; - *q++ = c ^ 0100; - } - } else { - *q++ = c; - } - } - *q = '\0'; - - logmsg(pri, timestamp, line, from, 0); + parsemsg_rfc3164(from, pri, msg); } /* @@ -1022,7 +1331,7 @@ printsys(char *msg) long n; int flags, isprintf, pri; - flags = ISKERNEL | SYNC_FILE; /* fsync after write */ + flags = SYNC_FILE; /* fsync after write */ p = msg; pri = DEFSPRI; isprintf = 1; @@ -1043,7 +1352,7 @@ printsys(char *msg) flags |= IGN_CONS; if (pri &~ (LOG_FACMASK|LOG_PRIMASK)) pri = DEFSPRI; - logmsg(pri, NULL, p, LocalHostName, flags); + logmsg(pri, NULL, LocalHostName, "kernel", NULL, NULL, NULL, p, flags); } static time_t now; @@ -1094,24 +1403,33 @@ skip_message(const char *name, const char *spec, int c } /* - * Log a message to the appropriate log files, users, etc. based on - * the priority. + * Logs a message to the appropriate log files, users, etc. based on the + * priority. Log messages are always formatted according to RFC 3164, + * even if they were in RFC 5424 format originally, The MSGID and + * STRUCTURED-DATA fields are thus discarded for the time being. */ static void -logmsg(int pri, const char *timestamp, const char *msg, const char *from, - int flags) +logmsg(int pri, const struct logtime *timestamp, const char *from, + const char *app_name, const char *procid, const char *msgid __unused, + const char *structured_data __unused, const char *msg, int flags) { + struct timeval tv; + struct logtime timestamp_now; struct filed *f; - int i, fac, msglen, prilev; - char prog[NAME_MAX+1]; + size_t msglen; + int fac, prilev; char buf[MAXLINE+1]; dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", pri, flags, from, msg); - (void)time(&now); - if (timestamp == NULL) - timestamp = ctime(&now) + 4; + (void)gettimeofday(&tv, NULL); + now = tv.tv_sec; + if (timestamp == NULL) { + localtime_r(&now, ×tamp_now.tm); + timestamp_now.usec = tv.tv_usec; + timestamp = ×tamp_now; + } /* extract facility and priority level */ if (flags & MARK) @@ -1125,22 +1443,17 @@ logmsg(int pri, const char *timestamp, const char *msg prilev = LOG_PRI(pri); - /* Extract TAG part of the message (usually program name). */ - for (i = 0; i < NAME_MAX; i++) { - if (!isprint(msg[i]) || msg[i] == ':' || msg[i] == '[' || - msg[i] == '/' || isspace(msg[i])) - break; - prog[i] = msg[i]; - } - prog[i] = 0; - - /* add kernel prefix for kernel messages */ - if (flags & ISKERNEL) { - snprintf(buf, sizeof(buf), "%s: %s", - use_bootfile ? bootfile : "kernel", msg); + /* Prepend the application name to the message if provided. */ + if (app_name != NULL) { + if (procid != NULL) + msglen = snprintf(buf, sizeof(buf), "%s[%s]: %s", + app_name, procid, msg); + else + msglen = snprintf(buf, sizeof(buf), "%s: %s", + app_name, msg); msg = buf; - } - msglen = strlen(msg); + } else + msglen = strlen(msg); /* log the message to the particular outputs */ if (!Initialized) { @@ -1152,8 +1465,7 @@ logmsg(int pri, const char *timestamp, const char *msg f->f_file = open(ctty, O_WRONLY | O_NONBLOCK, 0); if (f->f_file >= 0) { - (void)strlcpy(f->f_lasttime, timestamp, - sizeof(f->f_lasttime)); + f->f_lasttime = *timestamp; fprintlog(f, flags, msg); close(f->f_file); f->f_file = -1; @@ -1174,7 +1486,8 @@ logmsg(int pri, const char *timestamp, const char *msg continue; /* skip messages with the incorrect program name */ - if (skip_message(prog, f->f_program, 1)) + if (skip_message(app_name == NULL ? "" : app_name, + f->f_program, 1)) continue; /* skip message to console if it has already been printed */ @@ -1192,8 +1505,7 @@ logmsg(int pri, const char *timestamp, const char *msg (flags & MARK) == 0 && msglen == f->f_prevlen && !strcmp(msg, f->f_prevline) && !strcasecmp(from, f->f_prevhost)) { - (void)strlcpy(f->f_lasttime, timestamp, - sizeof(f->f_lasttime)); + f->f_lasttime = *timestamp; f->f_prevcount++; dprintf("msg repeated %d times, %ld sec of %d\n", f->f_prevcount, (long)(now - f->f_time), @@ -1214,8 +1526,7 @@ logmsg(int pri, const char *timestamp, const char *msg fprintlog(f, 0, (char *)NULL); f->f_repeatcount = 0; f->f_prevpri = pri; - (void)strlcpy(f->f_lasttime, timestamp, - sizeof(f->f_lasttime)); + f->f_lasttime = *timestamp; (void)strlcpy(f->f_prevhost, from, sizeof(f->f_prevhost)); if (msglen < MAXSVLINE) { @@ -1254,8 +1565,12 @@ fprintlog(struct filed *f, int flags, const char *msg) int l, lsent = 0; char line[MAXLINE + 1], repbuf[80], greetings[200], *wmsg = NULL; char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n"; + char timebuf[RFC3164_DATELEN + 1]; const char *msgret; + if (strftime(timebuf, sizeof(timebuf), RFC3164_DATEFMT, + &f->f_lasttime.tm) == 0) + timebuf[0] = '\0'; if (f->f_type == F_WALL) { /* The time displayed is not synchornized with the other log * destinations (like messages). Following fragment was using @@ -1267,7 +1582,7 @@ fprintlog(struct filed *f, int flags, const char *msg) .iov_len = snprintf(greetings, sizeof(greetings), "\r\n\7Message from syslogd@%s " "at %.24s ...\r\n", - f->f_prevhost, f->f_lasttime) + f->f_prevhost, timebuf) }; if (iov[0].iov_len >= sizeof(greetings)) iov[0].iov_len = sizeof(greetings) - 1; @@ -1277,8 +1592,8 @@ fprintlog(struct filed *f, int flags, const char *msg) }; } else { iov[0] = (struct iovec){ - .iov_base = f->f_lasttime, - .iov_len = strlen(f->f_lasttime) + .iov_base = timebuf, + .iov_len = strlen(timebuf) }; iov[1] = (struct iovec){ .iov_base = space, @@ -1690,7 +2005,8 @@ logerror(const char *type) (void)snprintf(buf, sizeof buf, "syslogd: %s", type); errno = 0; dprintf("%s\n", buf); - logmsg(LOG_SYSLOG|LOG_ERR, NULL, buf, LocalHostName, 0); + logmsg(LOG_SYSLOG|LOG_ERR, NULL, LocalHostName, NULL, NULL, NULL, + NULL, buf, 0); recursed--; } @@ -2037,7 +2353,8 @@ init(int signo) } } - logmsg(LOG_SYSLOG|LOG_INFO, NULL, "syslogd: restart", LocalHostName, 0); + logmsg(LOG_SYSLOG|LOG_INFO, NULL, LocalHostName, NULL, NULL, NULL, + NULL, "syslogd: restart", 0); dprintf("syslogd: restarted\n"); /* * Log a change in hostname, but only on a restart. @@ -2046,7 +2363,8 @@ init(int signo) (void)snprintf(hostMsg, sizeof(hostMsg), "syslogd: hostname changed, \"%s\" to \"%s\"", oldLocalHostName, LocalHostName); - logmsg(LOG_SYSLOG|LOG_INFO, NULL, hostMsg, LocalHostName, 0); + logmsg(LOG_SYSLOG|LOG_INFO, NULL, LocalHostName, NULL, NULL, + NULL, NULL, hostMsg, 0); dprintf("%s\n", hostMsg); } /* @@ -2056,7 +2374,8 @@ init(int signo) if (signo == 0 && !use_bootfile) { (void)snprintf(bootfileMsg, sizeof(bootfileMsg), "syslogd: kernel boot file is %s", bootfile); - logmsg(LOG_KERN|LOG_INFO, NULL, bootfileMsg, LocalHostName, 0); + logmsg(LOG_KERN|LOG_INFO, NULL, LocalHostName, NULL, NULL, + NULL, NULL, bootfileMsg, 0); dprintf("%s\n", bootfileMsg); } } @@ -2365,7 +2684,8 @@ markit(void) now = time((time_t *)NULL); MarkSeq += TIMERINTVL; if (MarkSeq >= MarkInterval) { - logmsg(LOG_INFO, NULL, "-- MARK --", LocalHostName, MARK); + logmsg(LOG_INFO, NULL, LocalHostName, NULL, NULL, NULL, NULL, + "-- MARK --", MARK); MarkSeq = 0; } From owner-svn-src-all@freebsd.org Fri Apr 6 13:00:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B1FF839CA; Fri, 6 Apr 2018 13:00:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 117D27A179; Fri, 6 Apr 2018 13:00:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08284120B4; Fri, 6 Apr 2018 13:00:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36D0jFo025334; Fri, 6 Apr 2018 13:00:45 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36D0jTT025330; Fri, 6 Apr 2018 13:00:45 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804061300.w36D0jTT025330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 6 Apr 2018 13:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332100 - in head: . lib/libc/gen sys/sys X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head: . lib/libc/gen sys/sys X-SVN-Commit-Revision: 332100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 13:00:46 -0000 Author: ed Date: Fri Apr 6 13:00:45 2018 New Revision: 332100 URL: https://svnweb.freebsd.org/changeset/base/332100 Log: Let syslog(3) use RFC 5424. With r332099 changing syslogd(8) to parse RFC 5424 formatted syslog messages, go ahead and also change the syslog(3) libc function to generate them. Compared to RFC 3164, RFC 5424 has various advantages, such as sub-second precision for log entry timestamps. As this change could have adverse effects when not updating syslogd(8) or using a different system logging daemon, add a notice to UPDATING and increase __FreeBSD_version. Differential Revision: https://reviews.freebsd.org/D14926 Modified: head/UPDATING head/lib/libc/gen/syslog.3 head/lib/libc/gen/syslog.c head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 6 12:57:01 2018 (r332099) +++ head/UPDATING Fri Apr 6 13:00:45 2018 (r332100) @@ -51,6 +51,45 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180406: + In addition to supporting RFC 3164 formatted messages, the + syslogd(8) service is now capable of parsing RFC 5424 formatted + log messages. The main benefit of using RFC 5424 is that clients + may now send log messages with timestamps containing year numbers, + microseconds and time zone offsets. + + Similarly, the syslog(3) C library function has been altered to + send RFC 5424 formatted messages to the local system logging + daemon. On systems using syslogd(8), this change should have no + negative impact, as long as syslogd(8) and the C library are + updated at the same time. On systems using a different system + logging daemon, it may be necessary to make configuration + adjustments, depending on the software used. + + When using syslog-ng, add the 'syslog-protocol' flag to local + input sources to enable parsing of RFC 5424 formatted messages: + + source src { + unix-dgram("/var/run/log" flags(syslog-protocol)); + } + + When using rsyslog, disable the 'SysSock.UseSpecialParser' option + of the 'imuxsock' module to let messages be processed by the + regular RFC 3164/5424 parsing pipeline: + + module(load="imuxsock" SysSock.UseSpecialParser="off") + + Do note that these changes only affect communication between local + applications and syslogd(8). The format that syslogd(8) uses to + store messages on disk or forward messages to other systems + remains unchanged. syslogd(8) still uses RFC 3164 for these + purposes. Options to customize this behaviour will be added in the + future. Utilities that process log files stored in /var/log are + thus expected to continue to function as before. + + __FreeBSD_version has been incremented to 1200061 to denote this + change. + 20180328: Support for token ring networks has been removed. If you have "device token" in your kernel config you should remove Modified: head/lib/libc/gen/syslog.3 ============================================================================== --- head/lib/libc/gen/syslog.3 Fri Apr 6 12:57:01 2018 (r332099) +++ head/lib/libc/gen/syslog.3 Fri Apr 6 13:00:45 2018 (r332100) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 5, 2017 +.Dd April 6, 2018 .Dt SYSLOG 3 .Os .Sh NAME @@ -156,6 +156,9 @@ Write the message to standard error output as well to .It Dv LOG_PID Log the process id with each message: useful for identifying instantiations of daemons. +On +.Fx , +this option is enabled by default. .El .Pp The Modified: head/lib/libc/gen/syslog.c ============================================================================== --- head/lib/libc/gen/syslog.c Fri Apr 6 12:57:01 2018 (r332099) +++ head/lib/libc/gen/syslog.c Fri Apr 6 13:00:45 2018 (r332100) @@ -36,9 +36,10 @@ static char sccsid[] = "@(#)syslog.c 8.5 (Berkeley) 4/ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include +#include #include #include +#include #include #include #include @@ -134,11 +135,13 @@ syslog(int pri, const char *fmt, ...) static void vsyslog1(int pri, const char *fmt, va_list ap) { - int cnt; + struct timeval now; + struct tm tm; char ch, *p; - time_t now; - int fd, saved_errno; - char *stdp, tbuf[2048], fmt_cpy[1024], timbuf[26], errstr[64]; + long tz_offset; + int cnt, fd, saved_errno; + char hostname[MAXHOSTNAMELEN], *stdp, tbuf[2048], fmt_cpy[1024], + errstr[64], tz_sign; FILE *fp, *fmt_fp; struct bufcookie tbuf_cookie; struct bufcookie fmt_cookie; @@ -168,24 +171,46 @@ vsyslog1(int pri, const char *fmt, va_list ap) if (fp == NULL) return; - /* Build the message. */ - (void)time(&now); - (void)fprintf(fp, "<%d>", pri); - (void)fprintf(fp, "%.15s ", ctime_r(&now, timbuf) + 4); + /* Build the message according to RFC 5424. Tag and version. */ + (void)fprintf(fp, "<%d>1 ", pri); + /* Timestamp similar to RFC 3339. */ + if (gettimeofday(&now, NULL) == 0 && + localtime_r(&now.tv_sec, &tm) != NULL) { + if (tm.tm_gmtoff < 0) { + tz_sign = '-'; + tz_offset = -tm.tm_gmtoff; + } else { + tz_sign = '+'; + tz_offset = tm.tm_gmtoff; + } + + (void)fprintf(fp, + "%04d-%02d-%02d" /* Date. */ + "T%02d:%02d:%02d.%06ld" /* Time. */ + "%c%02ld:%02ld ", /* Time zone offset. */ + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, now.tv_usec, + tz_sign, tz_offset / 3600, (tz_offset % 3600) / 60); + } else + (void)fprintf(fp, "- "); + /* Hostname. */ + (void)gethostname(hostname, sizeof(hostname)); + (void)fprintf(fp, "%s ", hostname); if (LogStat & LOG_PERROR) { /* Transfer to string buffer */ (void)fflush(fp); stdp = tbuf + (sizeof(tbuf) - tbuf_cookie.left); } + /* + * Application name, process ID, message ID and structured data. + * Provide the process ID regardless of whether LOG_PID has been + * specified, as it provides valuable information. Many + * applications tend not to use this, even though they should. + */ if (LogTag == NULL) LogTag = _getprogname(); - if (LogTag != NULL) - (void)fprintf(fp, "%s", LogTag); - if (LogStat & LOG_PID) - (void)fprintf(fp, "[%d]", getpid()); - if (LogTag != NULL) { - (void)fprintf(fp, ": "); - } + (void)fprintf(fp, "%s %d - - ", + LogTag == NULL ? "-" : LogTag, getpid()); /* Check to see if we can skip expanding the %m */ if (strstr(fmt, "%m")) { @@ -313,7 +338,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) struct iovec iov[2]; struct iovec *v = iov; - p = strchr(tbuf, '>') + 1; + p = strchr(tbuf, '>') + 3; v->iov_base = p; v->iov_len = cnt - (p - tbuf); ++v; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Apr 6 12:57:01 2018 (r332099) +++ head/sys/sys/param.h Fri Apr 6 13:00:45 2018 (r332100) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200060 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200061 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Apr 6 14:14:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD34CF892CD; Fri, 6 Apr 2018 14:14:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 758EA7DD0E; Fri, 6 Apr 2018 14:14:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f177.google.com with SMTP id q84so1881914iod.10; Fri, 06 Apr 2018 07:14:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=irA4GjPiFiZC7KoHIIrWxrGK6s9LmizbzmR/8/6+GHs=; b=j1ySjlSGyUljKf/Pmgf7TGNhps9hq1KmSggkH8np0n+UebxcyUeL6/3BWo4Nv5Pn15 w7ZgdPsKc5QO6kd6V11KfcyI1PNJNJftw+8p5xdavaA4FphirVunTaLWUrpeQy7n2Nuk TVI/Sx3aFyR6Ung98ZHuuQc5UF5LICXrfMvoF7pbSQA68lByxKstN7AGPqhJGoIeK6yS smZY+6gYB7bTBlYLj/sB8iPaCCcgJfhCPLX5Nb5zGk6LONyV7GgY4L2yEQ6ndD6UsVxE DU4DVnn0N6hsicVTxcCpC6ocVTRlD6lqC3B0j0DrARVUqFmfvMNemT2bEHA93AejUu+t EVZw== X-Gm-Message-State: AElRT7FjDPYKEjvo4art1+qR0RNxvPBP8xAmDYt2m655qTwUJ4/CyGWt P/aIzAjYgsCrxmw2PabCom7vMwwr X-Google-Smtp-Source: AIpwx49OOZK0cXRjfIDoisalc4Wj0kfG2luanaN/jGzDKmntgHgKpEqgan/UKrBbIbQIpvHgpu0pBQ== X-Received: by 10.107.179.134 with SMTP id c128mr24675656iof.278.1523024083289; Fri, 06 Apr 2018 07:14:43 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id v128-v6sm4747364itg.14.2018.04.06.07.14.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 07:14:42 -0700 (PDT) Received: by mail-io0-f181.google.com with SMTP id q80so1873184ioi.13; Fri, 06 Apr 2018 07:14:42 -0700 (PDT) X-Received: by 10.107.181.72 with SMTP id e69mr25449815iof.267.1523024082688; Fri, 06 Apr 2018 07:14:42 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.62.19 with HTTP; Fri, 6 Apr 2018 07:14:42 -0700 (PDT) In-Reply-To: <201804061120.w36BK6s6074635@repo.freebsd.org> References: <201804061120.w36BK6s6074635@repo.freebsd.org> From: Conrad Meyer Date: Fri, 6 Apr 2018 07:14:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 14:14:45 -0000 I like something like this for clarity. But I don't see any reason for these function-like macros instead of the more general definition of an SI prefix constant multiple. A multiple works with numeric literals and variables alike. Something like: #define GiB ((size_t)1 << 30) my_foo =3D 15 * GiB; (There's nothing byte-specific about SI prefixes, but "Gi" alone is a worse name. Arguably, size_t is wrong for quantities of bytes on 32-bit platforms with 64-bit off_t.) The compiler will still reduce constant expressions. Perhaps even better, conversion away is straightforward units math, and the compiler can still do the clever thing with right shifts: my_gb =3D howmany(my_foo, GiB); //or my_gb =3D my_foo / GiB; Unfortunately, I expect a lot of code to already have defines or variables with conflicting names, so I'm not sure adding these names to primary headers is viable as-is. Best, Conrad On Fri, Apr 6, 2018 at 4:20 AM, Roger Pau Monn=C3=A9 w= rote: > Author: royger > Date: Fri Apr 6 11:20:06 2018 > New Revision: 332092 > URL: https://svnweb.freebsd.org/changeset/base/332092 > > Log: > remove GiB/MiB macros from param.h > > And instead define them in the files where they are used. > > Requested by: bde > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/sys/param.h > head/sys/x86/x86/mp_x86.c > > Modified: head/sys/amd64/amd64/mp_machdep.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/amd64/amd64/mp_machdep.c Fri Apr 6 09:25:08 2018 (= r332091) > +++ head/sys/amd64/amd64/mp_machdep.c Fri Apr 6 11:20:06 2018 (= r332092) > @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); > #define BIOS_RESET (0x0f) > #define BIOS_WARM (0x0a) > > +#define GiB(v) (v ## ULL << 30) > + > extern struct pcpu __pcpu[]; > > /* Temporary variables for init_secondary() */ > > Modified: head/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/param.h Fri Apr 6 09:25:08 2018 (r332091) > +++ head/sys/sys/param.h Fri Apr 6 11:20:06 2018 (r332092) > @@ -362,8 +362,4 @@ __END_DECLS > */ > #define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[off= set]) > > -/* Unit conversion macros. */ > -#define GiB(v) (v ## ULL << 30) > -#define MiB(v) (v ## ULL << 20) > - > #endif /* _SYS_PARAM_H_ */ > > Modified: head/sys/x86/x86/mp_x86.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/x86/x86/mp_x86.c Fri Apr 6 09:25:08 2018 (r332091) > +++ head/sys/x86/x86/mp_x86.c Fri Apr 6 11:20:06 2018 (r332092) > @@ -160,6 +160,8 @@ struct cache_info { > > unsigned int boot_address; > > +#define MiB(v) (v ## ULL << 20) > + > void > mem_range_AP_init(void) > { > From owner-svn-src-all@freebsd.org Fri Apr 6 15:01:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 836D9F8C29B; Fri, 6 Apr 2018 15:01:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 320217F97A; Fri, 6 Apr 2018 15:01:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CE4D1357A; Fri, 6 Apr 2018 15:01:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36F1kjs086081; Fri, 6 Apr 2018 15:01:46 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36F1kaq086080; Fri, 6 Apr 2018 15:01:46 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061501.w36F1kaq086080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 15:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332101 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 332101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:01:46 -0000 Author: kp Date: Fri Apr 6 15:01:45 2018 New Revision: 332101 URL: https://svnweb.freebsd.org/changeset/base/332101 Log: pf: Improve ioctl validation for DIOCRADDTABLES and DIOCRDELTABLES The DIOCRADDTABLES and DIOCRDELTABLES ioctls can process a number of tables at a time, and as such try to allocate * sizeof(struct pfr_table). This multiplication can overflow. Thanks to mallocarray() this is not exploitable, but an overflow does panic the system. Arbitrarily limit this to 65535 tables. pfctl only ever processes one table at a time, so it presents no issues there. MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 13:00:45 2018 (r332100) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 15:01:45 2018 (r332101) @@ -89,6 +89,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define PF_TABLES_MAX_REQUEST 65535 /* Maximum tables per request. */ + static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -2530,13 +2532,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2559,13 +2563,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); From owner-svn-src-all@freebsd.org Fri Apr 6 15:03:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A9AF8C5EE; Fri, 6 Apr 2018 15:03:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D99ED7FD57; Fri, 6 Apr 2018 15:03:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D48E8135B8; Fri, 6 Apr 2018 15:03:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36F3mi2089265; Fri, 6 Apr 2018 15:03:48 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36F3mfD089261; Fri, 6 Apr 2018 15:03:48 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061503.w36F3mfD089261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 15:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332102 - in head: etc/mtree tests/sys/netpfil/pf tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: etc/mtree tests/sys/netpfil/pf tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 332102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:03:49 -0000 Author: kp Date: Fri Apr 6 15:03:48 2018 New Revision: 332102 URL: https://svnweb.freebsd.org/changeset/base/332102 Log: pf tests: Basic ioctl validation tests Validate the DIOCRADDTABLES and DIOCRDELTABLES ioctls with invalid size values. All of these requests should fail. MFC after: 1 week Added: head/tests/sys/netpfil/pf/ioctl/ head/tests/sys/netpfil/pf/ioctl/Makefile (contents, props changed) head/tests/sys/netpfil/pf/ioctl/validation.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/netpfil/pf/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Apr 6 15:01:45 2018 (r332101) +++ head/etc/mtree/BSD.tests.dist Fri Apr 6 15:03:48 2018 (r332102) @@ -742,6 +742,8 @@ .. netpfil pf + ioctl + .. .. .. opencrypto Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Fri Apr 6 15:01:45 2018 (r332101) +++ head/tests/sys/netpfil/pf/Makefile Fri Apr 6 15:03:48 2018 (r332102) @@ -3,6 +3,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/pf +TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= pass_block \ forward \ Added: head/tests/sys/netpfil/pf/ioctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/ioctl/Makefile Fri Apr 6 15:03:48 2018 (r332102) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/netpfil/pf/ioctl + +ATF_TESTS_C += \ + validation + +.include Added: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 15:03:48 2018 (r332102) @@ -0,0 +1,130 @@ +/*- + * Copyright (c) 2018 Kristof Provost + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +static int dev; + +#define COMMON_HEAD() \ + if (modfind("pf") == -1) \ + atf_tc_skip("pf not loaded"); \ + dev = open("/dev/pf", O_RDWR); \ + if (dev == -1) \ + atf_tc_skip("Failed to open /dev/pf"); + +#define COMMON_CLEANUP() \ + close(dev); + +ATF_TC_WITHOUT_HEAD(addtables); +ATF_TC_BODY(addtables, tc) +{ + struct pfioc_table io; + struct pfr_table tbl; + int flags; + + COMMON_HEAD(); + + flags = 0; + + bzero(&io, sizeof(io)); + io.pfrio_flags = flags; + io.pfrio_buffer = &tbl; + io.pfrio_esize = sizeof(tbl); + + /* Negative size */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRADDTABLES, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRADDTABLES, &io) == 0) + atf_tc_fail("Request with size 1 << 24 succeeded"); + + /* NULL buffer */ + io.pfrio_size = 1; + io.pfrio_buffer = NULL; + if (ioctl(dev, DIOCRADDTABLES, &io) == 0) + atf_tc_fail("Request with NULL buffer succeeded"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(deltables); +ATF_TC_BODY(deltables, tc) +{ + struct pfioc_table io; + struct pfr_table tbl; + int flags; + + COMMON_HEAD(); + + flags = 0; + + bzero(&io, sizeof(io)); + io.pfrio_flags = flags; + io.pfrio_buffer = &tbl; + io.pfrio_esize = sizeof(tbl); + + /* Negative size */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRDELTABLES, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRDELTABLES, &io) == 0) + atf_tc_fail("Request with size 1 << 24 succeeded"); + + /* NULL buffer */ + io.pfrio_size = 1; + io.pfrio_buffer = NULL; + if (ioctl(dev, DIOCRDELTABLES, &io) == 0) + atf_tc_fail("Request with NULL buffer succeeded"); + + COMMON_CLEANUP(); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, addtables); + ATF_TP_ADD_TC(tp, deltables); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Fri Apr 6 15:09:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A617CF8CC21; Fri, 6 Apr 2018 15:09:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53CD580304; Fri, 6 Apr 2018 15:09:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EAD013605; Fri, 6 Apr 2018 15:09:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36F9VBR089515; Fri, 6 Apr 2018 15:09:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36F9VHn089514; Fri, 6 Apr 2018 15:09:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804061509.w36F9VHn089514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 6 Apr 2018 15:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332103 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 332103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:09:31 -0000 Author: markj Date: Fri Apr 6 15:09:30 2018 New Revision: 332103 URL: https://svnweb.freebsd.org/changeset/base/332103 Log: MFC r331934: Wrap long lines. Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Fri Apr 6 15:03:48 2018 (r332102) +++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Fri Apr 6 15:09:30 2018 (r332103) @@ -267,7 +267,8 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q PHOLD(task->task_thread->td_proc); sleepq_lock(task); if (atomic_read(&task->state) != TASK_WAKING) { - ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, state); + ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, + state); } else { sleepq_release(task); ret = 0; @@ -300,7 +301,8 @@ linux_schedule_timeout(int timeout) sleepq_lock(task); state = atomic_read(&task->state); if (state != TASK_WAKING) { - ret = linux_add_to_sleepqueue(task, task, "sched", timeout, state); + ret = linux_add_to_sleepqueue(task, task, "sched", timeout, + state); } else { sleepq_release(task); ret = 0; @@ -368,7 +370,8 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit break; } set_task_state(task, state); - ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, state); + ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, + state); if (ret != 0) break; } From owner-svn-src-all@freebsd.org Fri Apr 6 15:15:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2699F8D4C1; Fri, 6 Apr 2018 15:15:21 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70B9F80B2B; Fri, 6 Apr 2018 15:15:21 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B7ED137B6; Fri, 6 Apr 2018 15:15:21 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36FFL8O094387; Fri, 6 Apr 2018 15:15:21 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36FFLR8094386; Fri, 6 Apr 2018 15:15:21 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804061515.w36FFLR8094386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 6 Apr 2018 15:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332104 - head/sys/dev/ipmi X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/dev/ipmi X-SVN-Commit-Revision: 332104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:15:21 -0000 Author: jtl Date: Fri Apr 6 15:15:21 2018 New Revision: 332104 URL: https://svnweb.freebsd.org/changeset/base/332104 Log: In cases where an application issues certain IPMI commands at a high enough rate, the IPMI code can print large numbers of messages to the console, such as: ipmi0: KCS: Failed to read completion code ipmi0: KCS error: ff ipmi0: KCS: Failed to read completion code ipmi0: KCS error: ff These seem to be innocuous from a system standpoint, and the user- space code can deal with the failures. Therefore, suppress printing these messages to the console unless bootverbose is enabled. Obtained from: Netflix, Inc. Modified: head/sys/dev/ipmi/ipmi_kcs.c Modified: head/sys/dev/ipmi/ipmi_kcs.c ============================================================================== --- head/sys/dev/ipmi/ipmi_kcs.c Fri Apr 6 15:09:30 2018 (r332103) +++ head/sys/dev/ipmi/ipmi_kcs.c Fri Apr 6 15:15:21 2018 (r332104) @@ -150,7 +150,7 @@ kcs_error(struct ipmi_softc *sc) /* Read error status */ data = INB(sc, KCS_DATA); - if (data != 0) + if (data != 0 && (data != 0xff || bootverbose)) device_printf(sc->ipmi_dev, "KCS error: %02x\n", data); @@ -416,8 +416,10 @@ kcs_polled_request(struct ipmi_softc *sc, struct ipmi_ /* Next we read the completion code. */ if (kcs_read_byte(sc, &req->ir_compcode) != 1) { - device_printf(sc->ipmi_dev, - "KCS: Failed to read completion code\n"); + if (bootverbose) { + device_printf(sc->ipmi_dev, + "KCS: Failed to read completion code\n"); + } goto fail; } #ifdef KCS_DEBUG From owner-svn-src-all@freebsd.org Fri Apr 6 15:17:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A363F8D750; Fri, 6 Apr 2018 15:17:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE0F380D71; Fri, 6 Apr 2018 15:17:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D89D7137BF; Fri, 6 Apr 2018 15:17:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36FH9pI094492; Fri, 6 Apr 2018 15:17:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36FH9Xv094491; Fri, 6 Apr 2018 15:17:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061517.w36FH9Xv094491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 15:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332105 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 332105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:17:10 -0000 Author: kevans Date: Fri Apr 6 15:17:09 2018 New Revision: 332105 URL: https://svnweb.freebsd.org/changeset/base/332105 Log: aw_sid(4): Use prctl read for all reads when it's required It was later found that some operation on the OrangePi one will cause direct accesses to the eeprom to return wrong data again, so reading it all once via prctl at attach time is no longer sufficient. Modified: head/sys/arm/allwinner/aw_sid.c Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Fri Apr 6 15:15:21 2018 (r332104) +++ head/sys/arm/allwinner/aw_sid.c Fri Apr 6 15:17:09 2018 (r332105) @@ -61,8 +61,11 @@ __FBSDID("$FreeBSD$"); #define SID_RDKEY 0x60 #define SID_SRAM 0x200 -#define SID_THERMAL_CALIB0 (SID_SRAM + 0x34) -#define SID_THERMAL_CALIB1 (SID_SRAM + 0x38) +/* Offsets into efuse space, for convenience */ +#define SID_THERMAL_CALIB0_OFF (0x34) +#define SID_THERMAL_CALIB1_OFF (0x38) +#define SID_THERMAL_CALIB0 (SID_SRAM + SID_THERMAL_CALIB0_OFF) +#define SID_THERMAL_CALIB1 (SID_SRAM + SID_THERMAL_CALIB1_OFF) #define ROOT_KEY_SIZE 4 @@ -116,6 +119,7 @@ static struct ofw_compat_data compat_data[] = { }; struct aw_sid_softc { + device_t sid_dev; struct resource *res; struct aw_sid_conf *sid_conf; struct mtx prctl_mtx; @@ -135,6 +139,8 @@ enum sid_keys { #define RD4(sc, reg) bus_read_4((sc)->res, (reg)) #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) +#define PRCTL_RD4(sc, reg, val) aw_sid_prctl_read((sc)->sid_dev, (reg), (val)) + static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS); static int aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val); @@ -183,10 +189,9 @@ static int aw_sid_attach(device_t dev) { struct aw_sid_softc *sc; - bus_size_t i; - uint32_t val; sc = device_get_softc(dev); + sc->sid_dev = dev; if (bus_alloc_resources(dev, aw_sid_spec, &sc->res) != 0) { device_printf(dev, "cannot allocate resources for device\n"); @@ -197,19 +202,6 @@ aw_sid_attach(device_t dev) sc->sid_conf = (struct aw_sid_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; aw_sid_sc = sc; - /* - * This set of reads is solely for working around a silicon bug on some - * SoC that require a prctl read in order for direct register access to - * return a non-garbled value. Hence, the values we read are simply - * ignored. - */ - if (sc->sid_conf->requires_prctl_read) - for (i = 0; i < sc->sid_conf->efuse_size; i += 4) - if (aw_sid_prctl_read(dev, i, &val) != 0) { - device_printf(dev, "failed prctl read\n"); - goto fail; - } - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rootkey", @@ -217,11 +209,6 @@ aw_sid_attach(device_t dev) dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key"); return (0); - -fail: - bus_release_resources(dev, aw_sid_spec, &sc->res); - mtx_destroy(&sc->prctl_mtx); - return (ENXIO); } int @@ -235,8 +222,13 @@ aw_sid_read_tscalib(uint32_t *calib0, uint32_t *calib1 if (!sc->sid_conf->has_thermal) return (ENXIO); - *calib0 = RD4(sc, SID_THERMAL_CALIB0); - *calib1 = RD4(sc, SID_THERMAL_CALIB1); + if (sc->sid_conf->requires_prctl_read) { + PRCTL_RD4(sc, SID_THERMAL_CALIB0_OFF, calib0); + PRCTL_RD4(sc, SID_THERMAL_CALIB1_OFF, calib1); + } else { + *calib0 = RD4(sc, SID_THERMAL_CALIB0); + *calib1 = RD4(sc, SID_THERMAL_CALIB1); + } return (0); } @@ -254,7 +246,10 @@ aw_sid_get_rootkey(u_char *out) return (ENXIO); root_key_off = aw_sid_sc->sid_conf->rootkey_offset; for (i = 0; i < ROOT_KEY_SIZE ; i++) { - tmp = RD4(aw_sid_sc, root_key_off + (i * 4)); + if (sc->sid_conf->requires_prctl_read) + PRCTL_RD4(sc, (i * 4), &tmp); + else + tmp = RD4(aw_sid_sc, root_key_off + (i * 4)); be32enc(&out[i * 4], tmp); } From owner-svn-src-all@freebsd.org Fri Apr 6 15:19:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C911F8DB5E; Fri, 6 Apr 2018 15:19:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D59C2810D4; Fri, 6 Apr 2018 15:19:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0996137D5; Fri, 6 Apr 2018 15:19:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36FJmp8094623; Fri, 6 Apr 2018 15:19:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36FJmmg094622; Fri, 6 Apr 2018 15:19:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061519.w36FJmmg094622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 15:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332106 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 332106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:19:49 -0000 Author: kevans Date: Fri Apr 6 15:19:48 2018 New Revision: 332106 URL: https://svnweb.freebsd.org/changeset/base/332106 Log: lualoader: Fix menu skipping with loader.conf(5) vars Earlier efforts to stop loading the menu broke the ability to skip the menu with, e.g., beastie_disable in loader.conf(5) as it was decided before configuration was read. Defer bringing in the menu module until we've loaded configuration so that we can make a more informed decision on whether the menu should be skipped or not. Modified: head/stand/lua/loader.lua Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Fri Apr 6 15:17:09 2018 (r332105) +++ head/stand/lua/loader.lua Fri Apr 6 15:19:48 2018 (r332106) @@ -37,15 +37,17 @@ require("cli") local color = require("color") local core = require("core") local config = require("config") -local menu -if not core.isMenuSkipped() then - menu = require("menu") -end local password = require("password") +-- The menu module will be brought in after config has loaded if we actually +-- need it. +local menu try_include("local") config.load() +if not core.isMenuSkipped() then + menu = require("menu") +end if core.isUEFIBoot() then loader.perform("efi-autoresizecons") end From owner-svn-src-all@freebsd.org Fri Apr 6 15:54:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8984F907D4; Fri, 6 Apr 2018 15:54:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A4683004; Fri, 6 Apr 2018 15:54:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60C6313E71; Fri, 6 Apr 2018 15:54:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36FsVUf017385; Fri, 6 Apr 2018 15:54:31 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36FsVOI017382; Fri, 6 Apr 2018 15:54:31 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061554.w36FsVOI017382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 15:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332107 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 332107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:54:32 -0000 Author: kp Date: Fri Apr 6 15:54:30 2018 New Revision: 332107 URL: https://svnweb.freebsd.org/changeset/base/332107 Log: pf: Improve ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. Limit the allocation to required size (or the user allocation, if that's smaller). That does mean we need to do the allocation with the rules lock held (so the number doesn't change while we're doing this), so it can't M_WAITOK. MFC after: 1 week Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_ioctl.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Apr 6 15:19:48 2018 (r332106) +++ head/sys/net/pfvar.h Fri Apr 6 15:54:30 2018 (r332107) @@ -1638,6 +1638,7 @@ void pfr_detach_table(struct pfr_ktable *); int pfr_clr_tables(struct pfr_table *, int *, int); int pfr_add_tables(struct pfr_table *, int, int *, int); int pfr_del_tables(struct pfr_table *, int, int *, int); +int pfr_table_count(struct pfr_table *, int); int pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int); int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 15:19:48 2018 (r332106) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 15:54:30 2018 (r332107) @@ -2588,20 +2588,25 @@ DIOCCHANGEADDR_error: case DIOCRGETTABLES: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + PF_RULES_RLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_RUNLOCK(); break; } - PF_RULES_RLOCK(); error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_RUNLOCK(); @@ -2614,20 +2619,24 @@ DIOCCHANGEADDR_error: case DIOCRGETTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_tstats *pfrtstats; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_tstats)) { error = ENODEV; break; } + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_tstats); pfrtstats = mallocarray(io->pfrio_size, - sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); - if (! pfrtstats) { + sizeof(struct pfr_tstats), M_TEMP, M_NOWAIT); + if (pfrtstats == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2640,25 +2649,31 @@ DIOCCHANGEADDR_error: case DIOCRCLRTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_clr_tstats(pfrts, io->pfrio_size, &io->pfrio_nzero, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2669,25 +2684,31 @@ DIOCCHANGEADDR_error: case DIOCRSETTFLAGS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Fri Apr 6 15:19:48 2018 (r332106) +++ head/sys/netpfil/pf/pf_table.c Fri Apr 6 15:54:30 2018 (r332107) @@ -177,7 +177,6 @@ static struct pfr_ktable *pfr_lookup_table(struct pfr_table *); static void pfr_clean_node_mask(struct pfr_ktable *, struct pfr_kentryworkq *); -static int pfr_table_count(struct pfr_table *, int); static int pfr_skip_table(struct pfr_table *, struct pfr_ktable *, int); static struct pfr_kentry @@ -1688,7 +1687,7 @@ pfr_fix_anchor(char *anchor) return (0); } -static int +int pfr_table_count(struct pfr_table *filter, int flags) { struct pf_ruleset *rs; From owner-svn-src-all@freebsd.org Fri Apr 6 15:57:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC95F90B49; Fri, 6 Apr 2018 15:57:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A186832E9; Fri, 6 Apr 2018 15:57:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60D7513E72; Fri, 6 Apr 2018 15:57:21 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36FvLOJ017551; Fri, 6 Apr 2018 15:57:21 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36FvLRZ017550; Fri, 6 Apr 2018 15:57:21 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061557.w36FvLRZ017550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 15:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332108 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 332108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 15:57:22 -0000 Author: kp Date: Fri Apr 6 15:57:20 2018 New Revision: 332108 URL: https://svnweb.freebsd.org/changeset/base/332108 Log: pf tests: Basic ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS Validate the DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS ioctls with invalid values. These may succeed (because the kernel uses the minimally required size, not the specified size), but should not trigger kernel panics. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 15:54:30 2018 (r332107) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 15:57:20 2018 (r332108) @@ -51,6 +51,16 @@ static int dev; #define COMMON_CLEANUP() \ close(dev); +void +common_init_tbl(struct pfr_table *tbl) +{ + bzero(tbl, sizeof(struct pfr_table)); + strcpy(tbl->pfrt_anchor, "anchor"); + strcpy(tbl->pfrt_name, "name"); + tbl->pfrt_flags = 0; + tbl->pfrt_fback = 0; +} + ATF_TC_WITHOUT_HEAD(addtables); ATF_TC_BODY(addtables, tc) { @@ -121,10 +131,138 @@ ATF_TC_BODY(deltables, tc) COMMON_CLEANUP(); } +ATF_TC_WITHOUT_HEAD(gettables); +ATF_TC_BODY(gettables, tc) +{ + struct pfioc_table io; + struct pfr_table tbl; + int flags; + + COMMON_HEAD(); + + flags = 0; + + bzero(&io, sizeof(io)); + io.pfrio_flags = flags; + io.pfrio_buffer = &tbl; + io.pfrio_esize = sizeof(tbl); + + /* Negative size. This will succeed, because the kernel will not copy + * tables than it has. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRGETTABLES, &io) != 0) + atf_tc_fail("Request with size -1 failed"); + + /* Overly large size. See above. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRGETTABLES, &io) != 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(gettstats); +ATF_TC_BODY(gettstats, tc) +{ + struct pfioc_table io; + struct pfr_tstats stats; + int flags; + + COMMON_HEAD(); + + flags = 0; + + bzero(&io, sizeof(io)); + io.pfrio_flags = flags; + io.pfrio_buffer = &stats; + io.pfrio_esize = sizeof(stats); + + /* Negative size. This will succeed, because the kernel will not copy + * tables than it has. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRGETTSTATS, &io) != 0) + atf_tc_fail("Request with size -1 failed"); + + /* Overly large size. See above. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRGETTSTATS, &io) != 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(clrtstats); +ATF_TC_BODY(clrtstats, tc) +{ + struct pfioc_table io; + struct pfr_table tbl; + int flags; + + COMMON_HEAD(); + + flags = 0; + + common_init_tbl(&tbl); + + bzero(&io, sizeof(io)); + io.pfrio_flags = flags; + io.pfrio_buffer = &tbl; + io.pfrio_esize = sizeof(tbl); + + /* Negative size. This will succeed, because the kernel will not copy + * tables than it has. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRCLRTSTATS, &io) != 0) + atf_tc_fail("Request with size -1 failed "); + + /* Overly large size. See above. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRCLRTSTATS, &io) != 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(settflags); +ATF_TC_BODY(settflags, tc) +{ + struct pfioc_table io; + struct pfr_table tbl; + int flags; + + COMMON_HEAD(); + + flags = 0; + + common_init_tbl(&tbl); + + bzero(&io, sizeof(io)); + io.pfrio_flags = flags; + io.pfrio_buffer = &tbl; + io.pfrio_esize = sizeof(tbl); + + /* Negative size. This will succeed, because the kernel will not copy + * tables than it has. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRSETTFLAGS, &io) != 0) + atf_tc_fail("Request with size -1 failed"); + + /* Overly large size. See above. */ + io.pfrio_size = 1 << 28; + if (ioctl(dev, DIOCRSETTFLAGS, &io) != 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, addtables); ATF_TP_ADD_TC(tp, deltables); + ATF_TP_ADD_TC(tp, gettables); + ATF_TP_ADD_TC(tp, gettstats); + ATF_TP_ADD_TC(tp, clrtstats); + ATF_TP_ADD_TC(tp, settflags); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Fri Apr 6 16:17:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B96A6F9230B; Fri, 6 Apr 2018 16:17:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5A384253; Fri, 6 Apr 2018 16:17:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w36GHAxX003444; Fri, 6 Apr 2018 09:17:10 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w36GH9sw003442; Fri, 6 Apr 2018 09:17:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804061617.w36GH9sw003442@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 In-Reply-To: <201804061120.w36BK6s6074635@repo.freebsd.org> To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Fri, 6 Apr 2018 09:17:09 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 16:17:14 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: royger > Date: Fri Apr 6 11:20:06 2018 > New Revision: 332092 > URL: https://svnweb.freebsd.org/changeset/base/332092 > > Log: > remove GiB/MiB macros from param.h > > And instead define them in the files where they are used. It would of been better to "revert" your prior change and make a seperate new commit. It is rarely desireable to combine a revert of a change with anything. > Requested by: bde > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/sys/param.h > head/sys/x86/x86/mp_x86.c > > Modified: head/sys/amd64/amd64/mp_machdep.c ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Apr 6 16:22:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AB5EF92A75; Fri, 6 Apr 2018 16:22:15 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3F81848D9; Fri, 6 Apr 2018 16:22:14 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEEC514341; Fri, 6 Apr 2018 16:22:14 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36GMEFT032304; Fri, 6 Apr 2018 16:22:14 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36GMEi2032302; Fri, 6 Apr 2018 16:22:14 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201804061622.w36GMEi2032302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 6 Apr 2018 16:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332109 - in head/sys: amd64/amd64 x86/x86 X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/x86 X-SVN-Commit-Revision: 332109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:22:15 -0000 Author: royger Date: Fri Apr 6 16:22:14 2018 New Revision: 332109 URL: https://svnweb.freebsd.org/changeset/base/332109 Log: x86: fix trampoline memory allocation after r332073 Add the missing breaks in the for loops, in order to exit the loop when a suitable entry is found. Also switch amd64 native_start_all_aps to use PHYS_TO_DMAP in order to find the virtual address of the boot_trampoline and the initial page tables. Reported and tested by: pho Sponsored by: Citrix Systems R&D Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Apr 6 15:57:20 2018 (r332108) +++ head/sys/amd64/amd64/mp_machdep.c Fri Apr 6 16:22:14 2018 (r332109) @@ -128,6 +128,7 @@ mp_bootaddress(vm_paddr_t *physmap, unsigned int *phys sizeof(*physmap) * (*physmap_idx - i + 2)); *physmap_idx -= 2; } + break; } if (!allocated) { @@ -336,7 +337,6 @@ init_secondary(void) int native_start_all_aps(void) { - vm_offset_t va = boot_address + KERNBASE; u_int64_t *pt4, *pt3, *pt2; u_int32_t mpbioswarmvec; int apic_id, cpu, i; @@ -344,13 +344,11 @@ native_start_all_aps(void) mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); - /* install the AP 1st level boot code */ - pmap_kenter(va, boot_address); - pmap_invalidate_page(kernel_pmap, va); - bcopy(mptramp_start, (void *)va, bootMP_size); + /* copy the AP 1st level boot code */ + bcopy(mptramp_start, (void *)PHYS_TO_DMAP(boot_address), bootMP_size); /* Locate the page tables, they'll be below the trampoline */ - pt4 = (u_int64_t *)(uintptr_t)(mptramp_pagetables + KERNBASE); + pt4 = (uint64_t *)PHYS_TO_DMAP(mptramp_pagetables); pt3 = pt4 + (PAGE_SIZE) / sizeof(u_int64_t); pt2 = pt3 + (PAGE_SIZE) / sizeof(u_int64_t); Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Apr 6 15:57:20 2018 (r332108) +++ head/sys/x86/x86/mp_x86.c Fri Apr 6 16:22:14 2018 (r332109) @@ -947,6 +947,7 @@ alloc_ap_trampoline(vm_paddr_t *physmap, unsigned int sizeof(*physmap) * (*physmap_idx - i + 2)); *physmap_idx -= 2; } + break; } if (!allocated) { From owner-svn-src-all@freebsd.org Fri Apr 6 16:24:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46D28F92C77; Fri, 6 Apr 2018 16:24:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F141084B06; Fri, 6 Apr 2018 16:24:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBD8514357; Fri, 6 Apr 2018 16:24:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36GO3iW032430; Fri, 6 Apr 2018 16:24:03 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36GO3hF032429; Fri, 6 Apr 2018 16:24:03 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804061624.w36GO3hF032429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 6 Apr 2018 16:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332110 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:24:04 -0000 Author: ed Date: Fri Apr 6 16:24:03 2018 New Revision: 332110 URL: https://svnweb.freebsd.org/changeset/base/332110 Log: Properly respect the passed in hostname for RFC 5424 messages. Only override the hostname in case none is provided or when remote hostnames should be ignored. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Apr 6 16:22:14 2018 (r332109) +++ head/usr.sbin/syslogd/syslogd.c Fri Apr 6 16:24:03 2018 (r332110) @@ -1028,6 +1028,8 @@ parsemsg_rfc5424(const char *from, int pri, char *msg) msg[-1] = '\0'; \ } PARSE_STRING("HOSTNAME", hostname); + if (hostname == NULL || !RemoteHostname) + hostname = from; PARSE_STRING("APP-NAME", app_name); PARSE_STRING("PROCID", procid); PARSE_STRING("MSGID", msgid); @@ -1079,7 +1081,7 @@ parsemsg_rfc5424(const char *from, int pri, char *msg) #undef IF_NOT_NILVALUE parsemsg_remove_unsafe_characters(msg, line, sizeof(line)); - logmsg(pri, timestamp, from, app_name, procid, msgid, + logmsg(pri, timestamp, hostname, app_name, procid, msgid, structured_data, line, 0); } From owner-svn-src-all@freebsd.org Fri Apr 6 16:26:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481CAF93085; Fri, 6 Apr 2018 16:26:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A41A58520C; Fri, 6 Apr 2018 16:26:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9964214362; Fri, 6 Apr 2018 16:26:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36GQkZR033626; Fri, 6 Apr 2018 16:26:46 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36GQkh2033625; Fri, 6 Apr 2018 16:26:46 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804061626.w36GQkh2033625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 6 Apr 2018 16:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332111 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:26:47 -0000 Author: ed Date: Fri Apr 6 16:26:46 2018 New Revision: 332111 URL: https://svnweb.freebsd.org/changeset/base/332111 Log: Remove some places where error messages are prefixed with "syslogd". Due to using RFC 5424, the application name is stored in a dedicated field. It can simply be passed as an argument to logmsg() now. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Apr 6 16:24:03 2018 (r332110) +++ head/usr.sbin/syslogd/syslogd.c Fri Apr 6 16:26:46 2018 (r332111) @@ -1991,7 +1991,7 @@ domark(int signo __unused) * Print syslogd errors some place. */ static void -logerror(const char *type) +logerror(const char *msg) { char buf[512]; static int recursed = 0; @@ -2000,15 +2000,15 @@ logerror(const char *type) if (recursed) return; recursed++; - if (errno) - (void)snprintf(buf, - sizeof buf, "syslogd: %s: %s", type, strerror(errno)); - else - (void)snprintf(buf, sizeof buf, "syslogd: %s", type); + if (errno != 0) { + (void)snprintf(buf, sizeof(buf), "%s: %s", msg, + strerror(errno)); + msg = buf; + } errno = 0; dprintf("%s\n", buf); - logmsg(LOG_SYSLOG|LOG_ERR, NULL, LocalHostName, NULL, NULL, NULL, - NULL, buf, 0); + logmsg(LOG_SYSLOG|LOG_ERR, NULL, LocalHostName, "syslogd", NULL, NULL, + NULL, msg, 0); recursed--; } @@ -2355,18 +2355,18 @@ init(int signo) } } - logmsg(LOG_SYSLOG|LOG_INFO, NULL, LocalHostName, NULL, NULL, NULL, - NULL, "syslogd: restart", 0); + logmsg(LOG_SYSLOG | LOG_INFO, NULL, LocalHostName, "syslogd", NULL, + NULL, NULL, "restart", 0); dprintf("syslogd: restarted\n"); /* * Log a change in hostname, but only on a restart. */ if (signo != 0 && strcmp(oldLocalHostName, LocalHostName) != 0) { (void)snprintf(hostMsg, sizeof(hostMsg), - "syslogd: hostname changed, \"%s\" to \"%s\"", + "hostname changed, \"%s\" to \"%s\"", oldLocalHostName, LocalHostName); - logmsg(LOG_SYSLOG|LOG_INFO, NULL, LocalHostName, NULL, NULL, - NULL, NULL, hostMsg, 0); + logmsg(LOG_SYSLOG | LOG_INFO, NULL, LocalHostName, "syslogd", + NULL, NULL, NULL, hostMsg, 0); dprintf("%s\n", hostMsg); } /* @@ -2375,9 +2375,9 @@ init(int signo) */ if (signo == 0 && !use_bootfile) { (void)snprintf(bootfileMsg, sizeof(bootfileMsg), - "syslogd: kernel boot file is %s", bootfile); - logmsg(LOG_KERN|LOG_INFO, NULL, LocalHostName, NULL, NULL, - NULL, NULL, bootfileMsg, 0); + "kernel boot file is %s", bootfile); + logmsg(LOG_KERN | LOG_INFO, NULL, LocalHostName, "syslogd", + NULL, NULL, NULL, bootfileMsg, 0); dprintf("%s\n", bootfileMsg); } } From owner-svn-src-all@freebsd.org Fri Apr 6 16:45:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED1DF94A0A; Fri, 6 Apr 2018 16:45:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 543C9875FB; Fri, 6 Apr 2018 16:45:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ACCC146E1; Fri, 6 Apr 2018 16:45:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Gj1si046352; Fri, 6 Apr 2018 16:45:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Gj1CI046351; Fri, 6 Apr 2018 16:45:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061645.w36Gj1CI046351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 16:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332112 - stable/11/usr.bin/dtc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/dtc X-SVN-Commit-Revision: 332112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:45:01 -0000 Author: kevans Date: Fri Apr 6 16:45:00 2018 New Revision: 332112 URL: https://svnweb.freebsd.org/changeset/base/332112 Log: MFC r320160: dtc: Update to upstream 917526 - Add missing "typename" in divmod's "using" of binary_operator_base::result. Modified: stable/11/usr.bin/dtc/input_buffer.cc Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/dtc/input_buffer.cc ============================================================================== --- stable/11/usr.bin/dtc/input_buffer.cc Fri Apr 6 16:26:46 2018 (r332111) +++ stable/11/usr.bin/dtc/input_buffer.cc Fri Apr 6 16:45:00 2018 (r332112) @@ -698,7 +698,7 @@ template struct divmod : public binary_operator<5, T> { using binary_operator<5, T>::binary_operator; - using binary_operator_base::result; + using typename binary_operator_base::result; result operator()() override { result r = (*binary_operator_base::rhs)(); From owner-svn-src-all@freebsd.org Fri Apr 6 16:48:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D03F94DEF; Fri, 6 Apr 2018 16:48:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9229878AB; Fri, 6 Apr 2018 16:48:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A98A2146E4; Fri, 6 Apr 2018 16:48:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Gm8LB046522; Fri, 6 Apr 2018 16:48:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Gm8dr046517; Fri, 6 Apr 2018 16:48:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804061648.w36Gm8dr046517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 6 Apr 2018 16:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332113 - in stable/11/sys/modules: i2c/iicbus i2c/isl spi/at45d spi/mx25l spi/spibus X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/11/sys/modules: i2c/iicbus i2c/isl spi/at45d spi/mx25l spi/spibus X-SVN-Commit-Revision: 332113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:48:09 -0000 Author: ian Date: Fri Apr 6 16:48:07 2018 New Revision: 332113 URL: https://svnweb.freebsd.org/changeset/base/332113 Log: MFC r331868: Add opt_platform.h for several modules that have #ifdef FDT in the source. Submitted by: Andre Albsmeier PR: 227322 227323 Modified: stable/11/sys/modules/i2c/iicbus/Makefile stable/11/sys/modules/i2c/isl/Makefile stable/11/sys/modules/spi/at45d/Makefile stable/11/sys/modules/spi/mx25l/Makefile stable/11/sys/modules/spi/spibus/Makefile Modified: stable/11/sys/modules/i2c/iicbus/Makefile ============================================================================== --- stable/11/sys/modules/i2c/iicbus/Makefile Fri Apr 6 16:45:00 2018 (r332112) +++ stable/11/sys/modules/i2c/iicbus/Makefile Fri Apr 6 16:48:07 2018 (r332113) @@ -13,6 +13,7 @@ SRCS= \ iicbus_if.h \ iiconf.c \ iiconf.h \ + opt_platform.h \ .if !empty(OPT_FDT) SRCS+= ofw_iicbus.c ofw_bus_if.h Modified: stable/11/sys/modules/i2c/isl/Makefile ============================================================================== --- stable/11/sys/modules/i2c/isl/Makefile Fri Apr 6 16:45:00 2018 (r332112) +++ stable/11/sys/modules/i2c/isl/Makefile Fri Apr 6 16:48:07 2018 (r332113) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/isl KMOD = isl -SRCS = isl.c device_if.h bus_if.h iicbus_if.h +SRCS = isl.c device_if.h bus_if.h iicbus_if.h opt_platform.h .include Modified: stable/11/sys/modules/spi/at45d/Makefile ============================================================================== --- stable/11/sys/modules/spi/at45d/Makefile Fri Apr 6 16:45:00 2018 (r332112) +++ stable/11/sys/modules/spi/at45d/Makefile Fri Apr 6 16:48:07 2018 (r332113) @@ -9,6 +9,7 @@ SRCS= at45d.c SRCS+= \ bus_if.h \ device_if.h \ + opt_platform.h \ spibus_if.h \ .if !empty(OPT_FDT) Modified: stable/11/sys/modules/spi/mx25l/Makefile ============================================================================== --- stable/11/sys/modules/spi/mx25l/Makefile Fri Apr 6 16:45:00 2018 (r332112) +++ stable/11/sys/modules/spi/mx25l/Makefile Fri Apr 6 16:48:07 2018 (r332113) @@ -9,6 +9,7 @@ SRCS= mx25l.c SRCS+= \ bus_if.h \ device_if.h \ + opt_platform.h \ spibus_if.h \ .if !empty(OPT_FDT) Modified: stable/11/sys/modules/spi/spibus/Makefile ============================================================================== --- stable/11/sys/modules/spi/spibus/Makefile Fri Apr 6 16:45:00 2018 (r332112) +++ stable/11/sys/modules/spi/spibus/Makefile Fri Apr 6 16:48:07 2018 (r332113) @@ -13,6 +13,7 @@ SRCS+= ofw_spibus.c ofw_bus_if.h SRCS+= \ bus_if.h \ device_if.h \ + opt_platform.h \ spibus_if.c \ spibus_if.h \ From owner-svn-src-all@freebsd.org Fri Apr 6 16:48:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70888F94E0A; Fri, 6 Apr 2018 16:48:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 257C5878B1; Fri, 6 Apr 2018 16:48:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EBB8146E7; Fri, 6 Apr 2018 16:48:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36GmC5S046594; Fri, 6 Apr 2018 16:48:12 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36GmBkd046593; Fri, 6 Apr 2018 16:48:11 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804061648.w36GmBkd046593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 6 Apr 2018 16:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332114 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:48:12 -0000 Author: jtl Date: Fri Apr 6 16:48:11 2018 New Revision: 332114 URL: https://svnweb.freebsd.org/changeset/base/332114 Log: Check that in_pcbfree() is only called once for each PCB. If that assumption is violated, "bad things" could follow. I believe such an assert would have detected some of the problems jch@ was chasing in PR 203175 (see r307551). We also use it in our internal TCP development efforts. And, in case a bug does slip through to released code, this change silently ignores subsequent calls to in_pcbfree(). Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D14990 Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Apr 6 16:48:07 2018 (r332113) +++ head/sys/netinet/in_pcb.c Fri Apr 6 16:48:11 2018 (r332114) @@ -1288,6 +1288,13 @@ in_pcbfree(struct inpcb *inp) KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + KASSERT((inp->inp_flags2 & INP_FREED) == 0, + ("%s: called twice for pcb %p", __func__, inp)); + if (inp->inp_flags2 & INP_FREED) { + INP_WUNLOCK(inp); + return; + } + #ifdef INVARIANTS if (pcbinfo == &V_tcbinfo) { INP_INFO_LOCK_ASSERT(pcbinfo); From owner-svn-src-all@freebsd.org Fri Apr 6 16:59:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B5BEF95ED2; Fri, 6 Apr 2018 16:59:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A92668831; Fri, 6 Apr 2018 16:59:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 454ED148BF; Fri, 6 Apr 2018 16:59:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Gxx1g051651; Fri, 6 Apr 2018 16:59:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36GxwEr051645; Fri, 6 Apr 2018 16:59:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061659.w36GxwEr051645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 16:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332115 - in stable/11/stand: . arm/loader defaults forth mips/uboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . arm/loader defaults forth mips/uboot X-SVN-Commit-Revision: 332115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 16:59:59 -0000 Author: kevans Date: Fri Apr 6 16:59:58 2018 New Revision: 332115 URL: https://svnweb.freebsd.org/changeset/base/332115 Log: MFC r330005-r330007, r330021, r330029, r330622, r331207: Solo loader.conf(5) r330005: Go back to one loader.conf We really only need one loader.conf. The other loader.conf was created because the current one took forever to parse in FORTH. That will be fixed in the next commit. r330006: Take a meat cleaver to defaults/loader.conf Remove almost all of the _load=XXX options (kept only those relevant to splash screens, since there were other settings). Remove the excessively cutesy comment blocks. Remove excessive comments and replace with similar content Remove gratuitous blank lines (while leaving some) We have too many modules to list them all here. There's no purpose in doing so and it's a giant hassle to maintain. In addition the extra ~500 lines slow this down on small platforms. It slowed it down so much small platforms forked, which caused other issues... This is a compromise between those two extremes. r330007: loader.conf is loader agnostic, so remove 4th references. r330021: These two directories build man pages, so it's incorrect to tag them NO_OBJ. Also, make sure the loader.conf.5 man gets built and installed. r330029: Fix a typo: "now" -> "no". r330622: loader.conf(5): Document some other settings These tend to have less coverage in other places and they don't have defaults as of yet, so mention them here: - fdt_overlays - kernels_autodetect (lualoader only) r331207: loader.conf: remove obsolete non-x86 beastie menu statement As of r330005 the same loader.conf defaults are used on all platforms. Added: stable/11/stand/defaults/ - copied from r330007, head/stand/defaults/ Deleted: stable/11/stand/arm/loader/loader.conf stable/11/stand/forth/loader.conf stable/11/stand/forth/loader.conf.5 stable/11/stand/mips/uboot/loader.conf Modified: stable/11/stand/Makefile stable/11/stand/defaults/Makefile stable/11/stand/defaults/loader.conf stable/11/stand/defaults/loader.conf.5 stable/11/stand/forth/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/Makefile ============================================================================== --- stable/11/stand/Makefile Fri Apr 6 16:48:11 2018 (r332114) +++ stable/11/stand/Makefile Fri Apr 6 16:59:58 2018 (r332115) @@ -9,6 +9,7 @@ SUBDIR+= ficl SUBDIR+= forth .endif +SUBDIR+= defaults SUBDIR+= man .include Modified: stable/11/stand/defaults/Makefile ============================================================================== --- head/stand/defaults/Makefile Mon Feb 26 03:16:57 2018 (r330007) +++ stable/11/stand/defaults/Makefile Fri Apr 6 16:59:58 2018 (r332115) @@ -1,11 +1,9 @@ # $FreeBSD$ -NO_OBJ=t - .include FILES+= loader.conf -FILES+= loader.conf.5 +MAN+= loader.conf.5 FILESDIR_loader.conf= /boot/defaults Modified: stable/11/stand/defaults/loader.conf ============================================================================== --- head/stand/defaults/loader.conf Mon Feb 26 03:16:57 2018 (r330007) +++ stable/11/stand/defaults/loader.conf Fri Apr 6 16:59:58 2018 (r332115) @@ -69,7 +69,7 @@ acpi_video_load="NO" # Load the ACPI video extension #loader_delay="3" # Delay in seconds before loading anything. # Default is unset and disabled (no delay). #autoboot_delay="10" # Delay in seconds before autobooting, - # -1 for now user interrupts, NO to disable + # -1 for no user interrupts, NO to disable #password="" # Prevent changes to boot options #bootlock_password="" # Prevent booting (see check-password.4th(8)) #geom_eli_passphrase_prompt="NO" # Prompt for geli(8) passphrase to mount root Modified: stable/11/stand/defaults/loader.conf.5 ============================================================================== --- head/stand/defaults/loader.conf.5 Mon Feb 26 03:16:57 2018 (r330007) +++ stable/11/stand/defaults/loader.conf.5 Fri Apr 6 16:59:58 2018 (r332115) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 6, 2016 +.Dd March 19, 2018 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -249,7 +249,6 @@ be displayed. If set to .Dq YES , the beastie boot menu will be skipped. -The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_logo Pq Dq Li orbbw Selects a desired logo in the beastie boot menu. Possible values are: @@ -277,6 +276,23 @@ See the entropy entries in .Pq Dq /boot/entropy The name of the very early boot-time entropy cache file. +.El +.Sh OTHER SETTINGS +Other settings that may be used in +.Nm +that have no default value: +.Bl -tag -width bootfile -offset indent +.It Va fdt_overlays +Specifies a comma-delimited list of FDT overlays to apply. +.Pa /boot/overlays +is created by default for overlays to be placed in. +.It Va kernels_autodetect +If set to +.Dq YES , +attempt to auto-detect kernels installed in +.Pa /boot . +This is an option specific to the Lua-based loader. +It is not available in the default Forth-based loader. .El .Sh FILES .Bl -tag -width /boot/defaults/loader.conf -compact Modified: stable/11/stand/forth/Makefile ============================================================================== --- stable/11/stand/forth/Makefile Fri Apr 6 16:48:11 2018 (r332114) +++ stable/11/stand/forth/Makefile Fri Apr 6 16:59:58 2018 (r332115) @@ -7,7 +7,6 @@ MAN+= beastie.4th.8 \ check-password.4th.8 \ color.4th.8 \ delay.4th.8 \ - loader.conf.5 \ loader.4th.8 \ menu.4th.8 \ menusets.4th.8 \ @@ -33,10 +32,9 @@ FILES+= screen.4th FILES+= shortcuts.4th FILES+= support.4th FILES+= version.4th -FILESDIR_loader.conf= /boot/defaults # Allow machine specific loader.rc to be installed. -.for f in loader.rc menu.rc loader.conf +.for f in loader.rc menu.rc .if exists(${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f}) FILES+= ${BOOTSRC}/${MACHINE:C/amd64/i386/}/loader/${f} .else From owner-svn-src-all@freebsd.org Fri Apr 6 17:04:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55F63F965F6; Fri, 6 Apr 2018 17:04:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA6468E90; Fri, 6 Apr 2018 17:04:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 059F814A66; Fri, 6 Apr 2018 17:04:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36H4LxX056474; Fri, 6 Apr 2018 17:04:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36H4Ler056471; Fri, 6 Apr 2018 17:04:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061704.w36H4Ler056471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 17:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332116 - in stable/11: etc/mtree stand/defaults X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: etc/mtree stand/defaults X-SVN-Commit-Revision: 332116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:04:22 -0000 Author: kevans Date: Fri Apr 6 17:04:21 2018 New Revision: 332116 URL: https://svnweb.freebsd.org/changeset/base/332116 Log: MFC r331212,r331213: Move /boot/overlays to /boot/dtb/overlays r331212: Move /boot/overlays to /boot/dtb/overlays The former is fairly vague; these are FDT overlays to be applied to the running system, so /boot/dtb is a sensible location to put it without cluttering up /boot/dtb even further if desired. r331213: Amend missed reference to /boot/overlays Modified: stable/11/etc/mtree/BSD.root.dist stable/11/stand/defaults/loader.conf stable/11/stand/defaults/loader.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.root.dist ============================================================================== --- stable/11/etc/mtree/BSD.root.dist Fri Apr 6 16:59:58 2018 (r332115) +++ stable/11/etc/mtree/BSD.root.dist Fri Apr 6 17:04:21 2018 (r332116) @@ -11,14 +11,14 @@ defaults .. dtb + overlays tags=package=runtime + .. .. firmware .. kernel .. modules - .. - overlays tags=package=runtime .. zfs .. Modified: stable/11/stand/defaults/loader.conf ============================================================================== --- stable/11/stand/defaults/loader.conf Fri Apr 6 16:59:58 2018 (r332115) +++ stable/11/stand/defaults/loader.conf Fri Apr 6 17:04:21 2018 (r332116) @@ -80,7 +80,7 @@ bootenv_autolist="YES" # Auto populate the list of ZF #comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device -module_path="/boot/modules;/boot/dtb;/boot/overlays" # Set the module search path +module_path="/boot/modules;/boot/dtb;/boot/dtb/overlays" # Set the module search path #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem Modified: stable/11/stand/defaults/loader.conf.5 ============================================================================== --- stable/11/stand/defaults/loader.conf.5 Fri Apr 6 16:59:58 2018 (r332115) +++ stable/11/stand/defaults/loader.conf.5 Fri Apr 6 17:04:21 2018 (r332116) @@ -284,7 +284,7 @@ that have no default value: .Bl -tag -width bootfile -offset indent .It Va fdt_overlays Specifies a comma-delimited list of FDT overlays to apply. -.Pa /boot/overlays +.Pa /boot/dtb/overlays is created by default for overlays to be placed in. .It Va kernels_autodetect If set to From owner-svn-src-all@freebsd.org Fri Apr 6 17:06:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03289F968CD; Fri, 6 Apr 2018 17:06:23 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E5C69132; Fri, 6 Apr 2018 17:06:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3BDA14A79; Fri, 6 Apr 2018 17:06:22 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36H6MF6056596; Fri, 6 Apr 2018 17:06:22 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36H6MEg056595; Fri, 6 Apr 2018 17:06:22 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804061706.w36H6MEg056595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 6 Apr 2018 17:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332117 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 332117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:06:23 -0000 Author: jtl Date: Fri Apr 6 17:06:22 2018 New Revision: 332117 URL: https://svnweb.freebsd.org/changeset/base/332117 Log: Pat the watchdog less while producing a coredump. Prior to this change, we patted the watchdog approximately once per 4KB page of memory. After this change, we pat the watchdog approximately once per 128MB of memory. On a sample machine, this translated to patting the watchdog approximately every 5.4 seconds, which "seems reasonable". We can choose a different value in the future, if warranted. This has extensive field experience. It is a performance improvement, and has not caused any known problems. Reviewed by: imp, kib Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D14988 Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Fri Apr 6 17:04:21 2018 (r332116) +++ head/sys/amd64/amd64/minidump_machdep.c Fri Apr 6 17:06:22 2018 (r332117) @@ -62,7 +62,7 @@ static struct kerneldumpheader kdh; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress, dumpsize; +static size_t counter, progress, dumpsize, wdog_next; CTASSERT(sizeof(*vm_page_dump) == 8); static int dump_retry_count = 5; @@ -134,6 +134,9 @@ report_progress(size_t progress, size_t dumpsize) } } +/* Pat the watchdog approximately every 128MB of the dump. */ +#define WDOG_DUMP_INTERVAL (128 * 1024 * 1024) + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -173,9 +176,14 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t report_progress(progress, dumpsize); counter &= (1<<24) - 1; } + if (progress <= wdog_next) { + wdog_kern_pat(WD_LASTVAL); + if (wdog_next > WDOG_DUMP_INTERVAL) + wdog_next -= WDOG_DUMP_INTERVAL; + else + wdog_next = 0; + } - wdog_kern_pat(WD_LASTVAL); - if (ptr) { error = dump_append(di, ptr, 0, len); if (error) @@ -313,7 +321,7 @@ minidumpsys(struct dumperinfo *di) } dumpsize += PAGE_SIZE; - progress = dumpsize; + wdog_next = progress = dumpsize; /* Initialize mdhdr */ bzero(&mdhdr, sizeof(mdhdr)); From owner-svn-src-all@freebsd.org Fri Apr 6 17:16:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCE51F97465; Fri, 6 Apr 2018 17:16:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F8CE69AAB; Fri, 6 Apr 2018 17:16:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A69D14C37; Fri, 6 Apr 2018 17:16:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36HGot3061971; Fri, 6 Apr 2018 17:16:50 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36HGo46061970; Fri, 6 Apr 2018 17:16:50 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804061716.w36HGo46061970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 6 Apr 2018 17:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332118 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:16:51 -0000 Author: ed Date: Fri Apr 6 17:16:50 2018 New Revision: 332118 URL: https://svnweb.freebsd.org/changeset/base/332118 Log: Push RFC 5424 message format from logmsg() into fprintlog(). Now that all of parsemsg() parses both RFC 3164 and 5424 messages and hands them to logmsg(), alter the latter to properly forward all RFC 5424 message attributes to fprintlog(). While there, make some minor cleanups to this code: - Instead of extending the existing code that compares hostnames and message bodies for deduplication, print all of the relevant message fields into a single string that we can compare ('saved'). - No longer let the behaviour of fprintflog() depend on whether 'msg == NULL' to print repetition messages, Simply decompose this function into fprintlog_first() and fprintlog_successive(). This makes the interpretation of function arguments less magical and also allows us to get consistent behaviour across RFC 3164 and 5424 when adding support for the RFC 5424 output format. - As RFC 5424 syslog messages have a dedicated application name field, alter the repetition messages to be printed on behalf of syslogd on the current system. Change these messages to use the local hostname, so that it's obvious which syslogd instance detected the repetition. Remove f_prevhost, as it has now become unnecessary. - Remove a useless strdup(). Deconsting the message string is safe in this specific case. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Apr 6 17:06:22 2018 (r332117) +++ head/usr.sbin/syslogd/syslogd.c Fri Apr 6 17:16:50 2018 (r332118) @@ -252,7 +252,6 @@ struct filed { #define fu_pipe_pid f_un.f_pipe.f_pid char f_prevline[MAXSVLINE]; /* last message logged */ struct logtime f_lasttime; /* time of last occurrence */ - char f_prevhost[MAXHOSTNAMELEN]; /* host from which recd. */ int f_prevpri; /* pri of f_prevline */ size_t f_prevlen; /* length of f_prevline */ int f_prevcount; /* repetition cnt of prevline */ @@ -385,7 +384,9 @@ static void die(int) __dead2; static void dodie(int); static void dofsync(void); static void domark(int); -static void fprintlog(struct filed *, int, const char *); +static void fprintlog_first(struct filed *, const char *, const char *, + const char *, const char *, const char *, const char *, int); +static void fprintlog_successive(struct filed *, int); static void init(int); static void logerror(const char *); static void logmsg(int, const struct logtime *, const char *, const char *, @@ -1411,19 +1412,19 @@ skip_message(const char *name, const char *spec, int c * STRUCTURED-DATA fields are thus discarded for the time being. */ static void -logmsg(int pri, const struct logtime *timestamp, const char *from, - const char *app_name, const char *procid, const char *msgid __unused, - const char *structured_data __unused, const char *msg, int flags) +logmsg(int pri, const struct logtime *timestamp, const char *hostname, + const char *app_name, const char *procid, const char *msgid, + const char *structured_data, const char *msg, int flags) { struct timeval tv; struct logtime timestamp_now; struct filed *f; - size_t msglen; + size_t savedlen; int fac, prilev; - char buf[MAXLINE+1]; + char saved[MAXSVLINE]; dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", - pri, flags, from, msg); + pri, flags, hostname, msg); (void)gettimeofday(&tv, NULL); now = tv.tv_sec; @@ -1445,18 +1446,6 @@ logmsg(int pri, const struct logtime *timestamp, const prilev = LOG_PRI(pri); - /* Prepend the application name to the message if provided. */ - if (app_name != NULL) { - if (procid != NULL) - msglen = snprintf(buf, sizeof(buf), "%s[%s]: %s", - app_name, procid, msg); - else - msglen = snprintf(buf, sizeof(buf), "%s: %s", - app_name, msg); - msg = buf; - } else - msglen = strlen(msg); - /* log the message to the particular outputs */ if (!Initialized) { f = &consfile; @@ -1468,12 +1457,27 @@ logmsg(int pri, const struct logtime *timestamp, const if (f->f_file >= 0) { f->f_lasttime = *timestamp; - fprintlog(f, flags, msg); + fprintlog_first(f, hostname, app_name, procid, msgid, + structured_data, msg, flags); close(f->f_file); f->f_file = -1; } return; } + + /* + * Store all of the fields of the message, except the timestamp, + * in a single string. This string is used to detect duplicate + * messages. + */ + assert(hostname != NULL); + assert(msg != NULL); + savedlen = snprintf(saved, sizeof(saved), + "%d %s %s %s %s %s %s", pri, hostname, + app_name == NULL ? "-" : app_name, procid == NULL ? "-" : procid, + msgid == NULL ? "-" : msgid, + structured_data == NULL ? "-" : structured_data, msg); + STAILQ_FOREACH(f, &fhead, next) { /* skip messages that are incorrect priority */ if (!(((f->f_pcmp[fac] & PRI_EQ) && (f->f_pmask[fac] == prilev)) @@ -1484,7 +1488,7 @@ logmsg(int pri, const struct logtime *timestamp, const continue; /* skip messages with the incorrect hostname */ - if (skip_message(from, f->f_host, 0)) + if (skip_message(hostname, f->f_host, 0)) continue; /* skip messages with the incorrect program name */ @@ -1504,9 +1508,8 @@ logmsg(int pri, const struct logtime *timestamp, const * suppress duplicate lines to this file */ if (no_compress - (f->f_type != F_PIPE) < 1 && - (flags & MARK) == 0 && msglen == f->f_prevlen && - !strcmp(msg, f->f_prevline) && - !strcasecmp(from, f->f_prevhost)) { + (flags & MARK) == 0 && savedlen == f->f_prevlen && + strcmp(saved, f->f_prevline) == 0) { f->f_lasttime = *timestamp; f->f_prevcount++; dprintf("msg repeated %d times, %ld sec of %d\n", @@ -1519,27 +1522,22 @@ logmsg(int pri, const struct logtime *timestamp, const * in the future. */ if (now > REPEATTIME(f)) { - fprintlog(f, flags, (char *)NULL); + fprintlog_successive(f, flags); BACKOFF(f); } } else { /* new line, save it */ if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + fprintlog_successive(f, 0); f->f_repeatcount = 0; f->f_prevpri = pri; f->f_lasttime = *timestamp; - (void)strlcpy(f->f_prevhost, from, - sizeof(f->f_prevhost)); - if (msglen < MAXSVLINE) { - f->f_prevlen = msglen; - (void)strlcpy(f->f_prevline, msg, sizeof(f->f_prevline)); - fprintlog(f, flags, (char *)NULL); - } else { - f->f_prevline[0] = 0; - f->f_prevlen = 0; - fprintlog(f, flags, msg); - } + static_assert(sizeof(f->f_prevline) == sizeof(saved), + "Space to store saved line incorrect"); + (void)strcpy(f->f_prevline, saved); + f->f_prevlen = savedlen; + fprintlog_first(f, hostname, app_name, procid, msgid, + structured_data, msg, flags); } } } @@ -1560,12 +1558,14 @@ dofsync(void) #define IOV_SIZE 7 static void -fprintlog(struct filed *f, int flags, const char *msg) +fprintlog_first(struct filed *f, const char *hostname, const char *app_name, + const char *procid, const char *msgid __unused, + const char *structured_data __unused, const char *msg, int flags) { struct iovec iov[IOV_SIZE]; struct addrinfo *r; int l, lsent = 0; - char line[MAXLINE + 1], repbuf[80], greetings[200], *wmsg = NULL; + char tagged_msg[MAXLINE + 1], line[MAXLINE + 1], greetings[200]; char nul[] = "", space[] = " ", lf[] = "\n", crlf[] = "\r\n"; char timebuf[RFC3164_DATELEN + 1]; const char *msgret; @@ -1583,8 +1583,7 @@ fprintlog(struct filed *f, int flags, const char *msg) .iov_base = greetings, .iov_len = snprintf(greetings, sizeof(greetings), "\r\n\7Message from syslogd@%s " - "at %.24s ...\r\n", - f->f_prevhost, timebuf) + "at %.24s ...\r\n", hostname, timebuf) }; if (iov[0].iov_len >= sizeof(greetings)) iov[0].iov_len = sizeof(greetings) - 1; @@ -1647,36 +1646,28 @@ fprintlog(struct filed *f, int flags, const char *msg) .iov_len = 0 }; } + /* Prepend the application name to the message if provided. */ + if (app_name != NULL) { + if (procid != NULL) + snprintf(tagged_msg, sizeof(tagged_msg), + "%s[%s]: %s", app_name, procid, msg); + else + snprintf(tagged_msg, sizeof(tagged_msg), + "%s: %s", app_name, msg); + msg = tagged_msg; + } iov[3] = (struct iovec){ - .iov_base = f->f_prevhost, - .iov_len = strlen(f->f_prevhost) + .iov_base = __DECONST(char *, hostname), + .iov_len = strlen(hostname) }; iov[4] = (struct iovec){ .iov_base = space, .iov_len = 1 }; - if (msg) { - wmsg = strdup(msg); /* XXX iov_base needs a `const' sibling. */ - if (wmsg == NULL) { - logerror("strdup"); - exit(1); - } - iov[5] = (struct iovec){ - .iov_base = wmsg, - .iov_len = strlen(msg) - }; - } else if (f->f_prevcount > 1) { - iov[5] = (struct iovec){ - .iov_base = repbuf, - .iov_len = snprintf(repbuf, sizeof(repbuf), - "last message repeated %d times", f->f_prevcount) - }; - } else { - iov[5] = (struct iovec){ - .iov_base = f->f_prevline, - .iov_len = f->f_prevlen - }; - } + iov[5] = (struct iovec){ + .iov_base = __DECONST(char *, msg), + .iov_len = strlen(msg) + }; dprintf("Logging to %s", TypeNames[f->f_type]); f->f_time = now; @@ -1704,11 +1695,11 @@ fprintlog(struct filed *f, int flags, const char *msg) dprintf("\n"); } /* check for local vs remote messages */ - if (strcasecmp(f->f_prevhost, LocalHostName)) + if (strcasecmp(hostname, LocalHostName)) l = snprintf(line, sizeof line - 1, "<%d>%.15s Forwarded from %s: %s", f->f_prevpri, (char *)iov[0].iov_base, - f->f_prevhost, (char *)iov[5].iov_base); + hostname, (char *)iov[5].iov_base); else l = snprintf(line, sizeof line - 1, "<%d>%.15s %s", f->f_prevpri, (char *)iov[0].iov_base, @@ -1841,10 +1832,25 @@ fprintlog(struct filed *f, int flags, const char *msg) break; } f->f_prevcount = 0; - free(wmsg); } /* + * Prints a message to a log file that the previously logged message was + * received multiple times. + */ +static void +fprintlog_successive(struct filed *f, int flags) +{ + char msg[100]; + + assert(f->f_prevcount > 0); + snprintf(msg, sizeof(msg), "last message repeated %d times", + f->f_prevcount); + fprintlog_first(f, LocalHostName, "syslogd", NULL, NULL, NULL, msg, + flags); +} + +/* * WALLMSG -- Write a message to the world at large * * Write the specified message to either the entire @@ -2022,7 +2028,7 @@ die(int signo) STAILQ_FOREACH(f, &fhead, next) { /* flush any pending output */ if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + fprintlog_successive(f, 0); if (f->f_type == F_PIPE && f->fu_pipe_pid > 0) close_filed(f); } @@ -2252,7 +2258,7 @@ init(int signo) STAILQ_FOREACH(f, &fhead, next) { /* flush any pending output */ if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + fprintlog_successive(f, 0); switch (f->f_type) { case F_FILE: @@ -2696,7 +2702,7 @@ markit(void) dprintf("flush %s: repeated %d times, %d sec.\n", TypeNames[f->f_type], f->f_prevcount, repeatinterval[f->f_repeatcount]); - fprintlog(f, 0, (char *)NULL); + fprintlog_successive(f, 0); BACKOFF(f); } } From owner-svn-src-all@freebsd.org Fri Apr 6 17:17:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B716EF97532; Fri, 6 Apr 2018 17:17:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6957669C1A; Fri, 6 Apr 2018 17:17:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63D8214C38; Fri, 6 Apr 2018 17:17:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36HHZ8C062046; Fri, 6 Apr 2018 17:17:35 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36HHYO3062040; Fri, 6 Apr 2018 17:17:34 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804061717.w36HHYO3062040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 17:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332119 - in head/lib/libc: amd64/sys gen i386/sys powerpc/sys powerpc64/sys sparc64/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/lib/libc: amd64/sys gen i386/sys powerpc/sys powerpc64/sys sparc64/sys X-SVN-Commit-Revision: 332119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:17:36 -0000 Author: brooks Date: Fri Apr 6 17:17:34 2018 New Revision: 332119 URL: https://svnweb.freebsd.org/changeset/base/332119 Log: Remove caching from getlogin(2). This caching has existed since the CSRG import, but serves no obvious purpose. Sure, setlogin() is called rarely, but calls to getlogin() should also be infrequent. The required invalidation was not implemented on aarch64, arm, mips, amd riscv so updates would never occur if getlogin() was called before setlogin(). Reported by: Ali Mashtizadeh Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14965 Deleted: head/lib/libc/amd64/sys/setlogin.S head/lib/libc/i386/sys/setlogin.S head/lib/libc/powerpc/sys/setlogin.S head/lib/libc/powerpc64/sys/setlogin.S head/lib/libc/sparc64/sys/setlogin.S Modified: head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/gen/getlogin.c head/lib/libc/i386/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Fri Apr 6 17:16:50 2018 (r332118) +++ head/lib/libc/amd64/sys/Makefile.inc Fri Apr 6 17:17:34 2018 (r332119) @@ -9,7 +9,7 @@ SRCS+= \ amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S + sbrk.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: head/lib/libc/gen/getlogin.c ============================================================================== --- head/lib/libc/gen/getlogin.c Fri Apr 6 17:16:50 2018 (r332118) +++ head/lib/libc/gen/getlogin.c Fri Apr 6 17:17:34 2018 (r332119) @@ -47,62 +47,33 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" -#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex) -#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex) - extern int _getlogin(char *, int); -int _logname_valid __hidden; /* known to setlogin() */ -static pthread_mutex_t logname_mutex = PTHREAD_MUTEX_INITIALIZER; - -static char * -getlogin_basic(int *status) -{ - static char logname[MAXLOGNAME]; - - if (_logname_valid == 0) { - if (_getlogin(logname, sizeof(logname)) < 0) { - *status = errno; - return (NULL); - } - _logname_valid = 1; - } - *status = 0; - return (*logname ? logname : NULL); -} - char * getlogin(void) { - char *result; - int status; + static char logname[MAXLOGNAME]; - THREAD_LOCK(); - result = getlogin_basic(&status); - THREAD_UNLOCK(); - return (result); + if (_getlogin(logname, sizeof(logname)) < 0) + return (NULL); + return (logname[0] != '\0' ? logname : NULL); } int getlogin_r(char *logname, int namelen) { - char *result; + char tmpname[MAXLOGNAME]; int len; - int status; if (namelen < 1) return (ERANGE); logname[0] = '\0'; - THREAD_LOCK(); - result = getlogin_basic(&status); - if (status == 0 && result != NULL) { - len = strlen(result) + 1; - if (len > namelen) - status = ERANGE; - else - strncpy(logname, result, len); - } - THREAD_UNLOCK(); - return (status); + if (_getlogin(tmpname, sizeof(tmpname)) < 0) + return (errno); + len = strlen(tmpname) + 1; + if (len > namelen) + return (ERANGE); + strlcpy(logname, tmpname, len); + return (0); } Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Fri Apr 6 17:16:50 2018 (r332118) +++ head/lib/libc/i386/sys/Makefile.inc Fri Apr 6 17:17:34 2018 (r332119) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_io i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S syscall.S + sbrk.S syscall.S NOASM+= vfork.o Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Fri Apr 6 17:16:50 2018 (r332118) +++ head/lib/libc/powerpc/sys/Makefile.inc Fri Apr 6 17:17:34 2018 (r332119) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Fri Apr 6 17:16:50 2018 (r332118) +++ head/lib/libc/powerpc64/sys/Makefile.inc Fri Apr 6 17:17:34 2018 (r332119) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Fri Apr 6 17:16:50 2018 (r332118) +++ head/lib/libc/sparc64/sys/Makefile.inc Fri Apr 6 17:17:34 2018 (r332119) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S sbrk.S sigaction1.S From owner-svn-src-all@freebsd.org Fri Apr 6 17:20:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E330EF97986; Fri, 6 Apr 2018 17:20:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97C0F69F20; Fri, 6 Apr 2018 17:20:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9296A14C48; Fri, 6 Apr 2018 17:20:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36HKb85062209; Fri, 6 Apr 2018 17:20:37 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36HKb8A062208; Fri, 6 Apr 2018 17:20:37 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804061720.w36HKb8A062208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 6 Apr 2018 17:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332120 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:20:38 -0000 Author: jtl Date: Fri Apr 6 17:20:37 2018 New Revision: 332120 URL: https://svnweb.freebsd.org/changeset/base/332120 Log: If a user closes the socket before we call tcp_usr_abort(), then tcp_drop() may unlock the INP. Currently, tcp_usr_abort() does not check for this case, which results in a panic while trying to unlock the already-unlocked INP (not to mention, a use-after-free violation). Make tcp_usr_abort() check the return value of tcp_drop(). In the case where tcp_drop() returns NULL, tcp_usr_abort() can skip further steps to abort the connection and simply unlock the INP_INFO lock prior to returning. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Fri Apr 6 17:17:34 2018 (r332119) +++ head/sys/netinet/tcp_usrreq.c Fri Apr 6 17:20:37 2018 (r332120) @@ -1095,7 +1095,9 @@ tcp_usr_abort(struct socket *so) !(inp->inp_flags & INP_DROPPED)) { tp = intotcpcb(inp); TCPDEBUG1(); - tcp_drop(tp, ECONNABORTED); + tp = tcp_drop(tp, ECONNABORTED); + if (tp == NULL) + goto dropped; TCPDEBUG2(PRU_ABORT); TCP_PROBE2(debug__user, tp, PRU_ABORT); } @@ -1106,6 +1108,7 @@ tcp_usr_abort(struct socket *so) inp->inp_flags |= INP_SOCKREF; } INP_WUNLOCK(inp); +dropped: INP_INFO_RUNLOCK(&V_tcbinfo); } From owner-svn-src-all@freebsd.org Fri Apr 6 17:23:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D05BEF97E9C; Fri, 6 Apr 2018 17:23:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 841666A3F0; Fri, 6 Apr 2018 17:23:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EDB314DD1; Fri, 6 Apr 2018 17:23:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36HNlCq066924; Fri, 6 Apr 2018 17:23:47 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36HNlHF066923; Fri, 6 Apr 2018 17:23:47 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804061723.w36HNlHF066923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 17:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332121 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:23:48 -0000 Author: brooks Date: Fri Apr 6 17:23:47 2018 New Revision: 332121 URL: https://svnweb.freebsd.org/changeset/base/332121 Log: Support -DNO_CLEAN builds across r332119. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 6 17:20:37 2018 (r332120) +++ head/Makefile.inc1 Fri Apr 6 17:23:47 2018 (r332121) @@ -807,7 +807,8 @@ _cleanobj_fast_depend_hack: .PHONY # 20170624 r320278 fstat fstatat fstatfs getdirentries getfsstat statfs # 20180404 r332048 sigreturn # 20180405 r332080 shmat -.for f in fstat fstatat fstatfs getdirentries getfsstat shmat sigreturn statfs +# 20180406 r332119 setlogin +.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-all@freebsd.org Fri Apr 6 17:35:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9C23F98C51; Fri, 6 Apr 2018 17:35:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C24C6AE17; Fri, 6 Apr 2018 17:35:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7658414F6C; Fri, 6 Apr 2018 17:35:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36HZkhO071987; Fri, 6 Apr 2018 17:35:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36HZaOD071891; Fri, 6 Apr 2018 17:35:36 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804061735.w36HZaOD071891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 17:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332122 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 arm/arm arm64/arm64 cam/scsi compat/freebsd32 compat/ia32 compat/linux conf dev/aac dev/aacraid dev/acpica dev/at... X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 arm/arm arm64/arm64 cam/scsi compat/freebsd32 compat/ia32 compat/linux conf dev/aac dev/aacraid dev/acpica dev/atkbdc dev/cy dev/drm2 dev/... X-SVN-Commit-Revision: 332122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 17:35:47 -0000 Author: brooks Date: Fri Apr 6 17:35:35 2018 New Revision: 332122 URL: https://svnweb.freebsd.org/changeset/base/332122 Log: Move most of the contents of opt_compat.h to opt_global.h. opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Modified: head/sys/amd64/amd64/db_trace.c head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/ptrace_machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_misc.c head/sys/amd64/ia32/ia32_reg.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/ia32/ia32_sigtramp.S head/sys/amd64/ia32/ia32_syscall.c head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/amd64/linux32/syscalls.master head/sys/arm/arm/machdep.c head/sys/arm/arm/vm_machdep.c head/sys/arm64/arm64/machdep.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_pass.c head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/ia32/ia32_genassym.c head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/linux/linux_util.c head/sys/conf/options head/sys/conf/options.amd64 head/sys/conf/options.arm64 head/sys/conf/options.mips head/sys/conf/options.powerpc head/sys/dev/aac/aac.c head/sys/dev/aacraid/aacraid.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/cy/cy.c head/sys/dev/drm2/drmP.h head/sys/dev/drm2/drm_ioc32.c head/sys/dev/drm2/i915/i915_ioc32.c head/sys/dev/drm2/radeon/radeon_ioc32.c head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c head/sys/dev/kbdmux/kbdmux.c head/sys/dev/md/md.c head/sys/dev/mfi/mfi.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mps/mps_user.c head/sys/dev/mrsas/mrsas_linux.c head/sys/dev/null/null.c head/sys/dev/pci/pci_user.c head/sys/dev/rp/rp.c head/sys/dev/sio/sio.c head/sys/dev/syscons/scvidctl.c head/sys/dev/syscons/syscons.c head/sys/dev/uart/uart_kbd_sun.c head/sys/dev/usb/input/ukbd.c head/sys/dev/vkbd/vkbd.c head/sys/dev/vt/vt_core.c head/sys/fs/cuse/cuse.c head/sys/fs/devfs/devfs_devs.c head/sys/fs/procfs/procfs_dbregs.c head/sys/fs/procfs/procfs_fpregs.c head/sys/fs/procfs/procfs_ioctl.c head/sys/fs/procfs/procfs_map.c head/sys/fs/procfs/procfs_regs.c head/sys/geom/geom_dev.c head/sys/i386/i386/genassym.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/sigtramp.s head/sys/i386/linux/linux_dummy.c head/sys/kern/imgact_elf.c head/sys/kern/init_sysent.c head/sys/kern/kern_descrip.c head/sys/kern/kern_event.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_jail.c head/sys/kern/kern_mib.c head/sys/kern/kern_module.c head/sys/kern/kern_proc.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/kern_sendfile.c head/sys/kern/kern_sharedpage.c head/sys/kern/kern_sig.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_tc.c head/sys/kern/kern_thr.c head/sys/kern/kern_umtx.c head/sys/kern/kern_xxx.c head/sys/kern/makesyscalls.sh head/sys/kern/subr_dummy_vdso_tc.c head/sys/kern/sys_generic.c head/sys/kern/sys_getrandom.c head/sys/kern/sys_pipe.c head/sys/kern/sys_process.c head/sys/kern/sysv_ipc.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/kern/tty.c head/sys/kern/tty_compat.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/mips/include/reg.h head/sys/mips/include/sigframe.h head/sys/mips/include/tls.h head/sys/mips/include/ucontext.h head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/swtch.S head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c head/sys/modules/aac/Makefile head/sys/modules/aacraid/Makefile head/sys/modules/cam/Makefile head/sys/modules/cryptodev/Makefile head/sys/modules/cuse/Makefile head/sys/modules/drm2/drm2/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/drm2/radeonkms/Makefile head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/dtrace/dtraceall/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c head/sys/modules/dtrace/fasttrap/Makefile head/sys/modules/filemon/Makefile head/sys/modules/hyperv/vmbus/Makefile head/sys/modules/if_tap/Makefile head/sys/modules/isp/Makefile head/sys/modules/kbdmux/Makefile head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile head/sys/modules/linux_common/Makefile head/sys/modules/mfi/Makefile head/sys/modules/mpr/Makefile head/sys/modules/mps/Makefile head/sys/modules/mqueue/Makefile head/sys/modules/procfs/Makefile head/sys/modules/rp/Makefile head/sys/modules/sem/Makefile head/sys/modules/sgx/Makefile head/sys/modules/sio/Makefile head/sys/modules/sysvipc/sysvmsg/Makefile head/sys/modules/sysvipc/sysvsem/Makefile head/sys/modules/sysvipc/sysvshm/Makefile head/sys/modules/usb/ukbd/Makefile head/sys/modules/vkbd/Makefile head/sys/net/bpf.c head/sys/net/if.c head/sys/net/if_tap.c head/sys/net/rtsock.c head/sys/netinet/in_jail.c head/sys/netinet/in_prot.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_syscalls.c head/sys/netinet/tcp_subr.c head/sys/netinet6/in6.c head/sys/netinet6/in6_jail.c head/sys/opencrypto/cryptodev.c head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/include/reg.h head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/machdep.c head/sys/powerpc/powerpc/ptrace_machdep.c head/sys/powerpc/powerpc/sys_machdep.c head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/machdep.c head/sys/vm/swap_pager.c head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_unix.c head/sys/x86/x86/cpu_machdep.c head/sys/x86/x86/tsc.c Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/amd64/db_trace.c Fri Apr 6 17:35:35 2018 (r332122) @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/amd64/exception.S Fri Apr 6 17:35:35 2018 (r332122) @@ -39,7 +39,6 @@ */ #include "opt_atpic.h" -#include "opt_compat.h" #include "opt_hwpmc_hooks.h" #include "assym.inc" Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/amd64/genassym.c Fri Apr 6 17:35:35 2018 (r332122) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_hwpmc_hooks.h" #include "opt_kstack_pages.h" Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/amd64/machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include "opt_atpic.h" -#include "opt_compat.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_inet.h" Modified: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- head/sys/amd64/amd64/ptrace_machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/amd64/ptrace_machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/amd64/vm_machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_isa.h" #include "opt_cpu.h" -#include "opt_compat.h" #include #include Modified: head/sys/amd64/ia32/ia32_misc.c ============================================================================== --- head/sys/amd64/ia32/ia32_misc.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/ia32/ia32_misc.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/ia32/ia32_reg.c ============================================================================== --- head/sys/amd64/ia32/ia32_reg.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/ia32/ia32_reg.c Fri Apr 6 17:35:35 2018 (r332122) @@ -31,8 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/ia32/ia32_signal.c Fri Apr 6 17:35:35 2018 (r332122) @@ -36,8 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/ia32/ia32_sigtramp.S ============================================================================== --- head/sys/amd64/ia32/ia32_sigtramp.S Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/ia32/ia32_sigtramp.S Fri Apr 6 17:35:35 2018 (r332122) @@ -26,8 +26,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/ia32/ia32_syscall.c Fri Apr 6 17:35:35 2018 (r332122) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_clock.h" -#include "opt_compat.h" #include "opt_cpu.h" #include "opt_isa.h" Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux/linux_dummy.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux/linux_sysvec.c Fri Apr 6 17:35:35 2018 (r332122) @@ -34,8 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #define __ELF_WORD_SIZE 64 #include Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux32/linux32_dummy.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux32/linux32_machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -33,8 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux32/linux32_sysent.c Fri Apr 6 17:35:35 2018 (r332122) @@ -5,7 +5,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" #include #include #include Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Apr 6 17:35:35 2018 (r332122) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #ifndef COMPAT_FREEBSD32 #error "Unable to compile Linux-emulator due to missing COMPAT_FREEBSD32 option!" Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/amd64/linux32/syscalls.master Fri Apr 6 17:35:35 2018 (r332122) @@ -26,7 +26,6 @@ ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. -#include "opt_compat.h" #include #include #include Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/arm/arm/machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -44,7 +44,6 @@ * Updated : 18/04/01 updated for new wscons */ -#include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_platform.h" Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/arm/arm/vm_machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -42,8 +42,6 @@ * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ */ -#include "opt_compat.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/arm64/arm64/machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -26,7 +26,6 @@ */ #include "opt_acpi.h" -#include "opt_compat.h" #include "opt_platform.h" #include "opt_ddb.h" Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/cam/scsi/scsi_enc.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/cam/scsi/scsi_pass.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Fri Apr 6 17:35:35 2018 (r332122) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/compat/freebsd32/freebsd32_misc.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,7 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ktrace.h" Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Fri Apr 6 17:35:35 2018 (r332122) @@ -5,8 +5,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/compat/ia32/ia32_genassym.c ============================================================================== --- head/sys/compat/ia32/ia32_genassym.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/compat/ia32/ia32_genassym.c Fri Apr 6 17:35:35 2018 (r332122) @@ -1,8 +1,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/compat/ia32/ia32_sysvec.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #define __ELF_WORD_SIZE 32 #include Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/compat/linux/linux_util.c Fri Apr 6 17:35:35 2018 (r332122) @@ -34,8 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/conf/options Fri Apr 6 17:35:35 2018 (r332122) @@ -80,18 +80,18 @@ BOOTVERBOSE opt_global.h CALLOUT_PROFILING CAPABILITIES opt_capsicum.h CAPABILITY_MODE opt_capsicum.h -COMPAT_43 opt_compat.h -COMPAT_43TTY opt_compat.h -COMPAT_FREEBSD4 opt_compat.h -COMPAT_FREEBSD5 opt_compat.h -COMPAT_FREEBSD6 opt_compat.h -COMPAT_FREEBSD7 opt_compat.h -COMPAT_FREEBSD9 opt_compat.h -COMPAT_FREEBSD10 opt_compat.h -COMPAT_FREEBSD11 opt_compat.h +COMPAT_43 opt_global.h +COMPAT_43TTY opt_global.h +COMPAT_FREEBSD4 opt_global.h +COMPAT_FREEBSD5 opt_global.h +COMPAT_FREEBSD6 opt_global.h +COMPAT_FREEBSD7 opt_global.h +COMPAT_FREEBSD9 opt_global.h +COMPAT_FREEBSD10 opt_global.h +COMPAT_FREEBSD11 opt_global.h COMPAT_CLOUDABI32 opt_dontuse.h COMPAT_CLOUDABI64 opt_dontuse.h -COMPAT_LINUXKPI opt_compat.h +COMPAT_LINUXKPI opt_dontuse.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/conf/options.amd64 Fri Apr 6 17:35:35 2018 (r332122) @@ -14,7 +14,7 @@ PV_STATS opt_pmap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. -COMPAT_FREEBSD32 opt_compat.h +COMPAT_FREEBSD32 opt_global.h #IBCS2 opt_dontuse.h #COMPAT_LINUX opt_dontuse.h COMPAT_LINUX32 opt_compat.h Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/conf/options.arm64 Fri Apr 6 17:35:35 2018 (r332122) @@ -8,7 +8,7 @@ THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h # Binary compatibility -COMPAT_FREEBSD32 opt_compat.h +COMPAT_FREEBSD32 opt_global.h # EFI Runtime services support EFIRT opt_efirt.h Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/conf/options.mips Fri Apr 6 17:35:35 2018 (r332122) @@ -58,7 +58,7 @@ MIPS64EL MIPS64ELHF MIPSN32 -COMPAT_FREEBSD32 opt_compat.h +COMPAT_FREEBSD32 opt_global.h YAMON opt_global.h CFE opt_global.h Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/conf/options.powerpc Fri Apr 6 17:35:35 2018 (r332122) @@ -13,7 +13,7 @@ POWERPCSPE FPU_EMU -COMPAT_FREEBSD32 opt_compat.h +COMPAT_FREEBSD32 opt_global.h GFB_DEBUG opt_gfb.h GFB_NO_FONT_LOADING opt_gfb.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/aac/aac.c Fri Apr 6 17:35:35 2018 (r332122) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #define AAC_DRIVERNAME "aac" #include "opt_aac.h" -#include "opt_compat.h" /* #include */ #include Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/aacraid/aacraid.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #define AAC_DRIVERNAME "aacraid" #include "opt_aacraid.h" -#include "opt_compat.h" /* #include */ #include Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/acpica/acpi_hpet.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" -#include "opt_compat.h" #if defined(__amd64__) #define DEV_APIC Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/atkbdc/atkbd.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_kbd.h" #include "opt_atkbd.h" #include "opt_evdev.h" Modified: head/sys/dev/cy/cy.c ============================================================================== --- head/sys/dev/cy/cy.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/cy/cy.c Fri Apr 6 17:35:35 2018 (r332122) @@ -33,8 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - /* * TODO: * Atomic COR change. Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/drm2/drmP.h Fri Apr 6 17:35:35 2018 (r332122) @@ -121,7 +121,6 @@ struct drm_device; #include #include -#include "opt_compat.h" #include "opt_drm.h" #include "opt_syscons.h" #ifdef DRM_DEBUG Modified: head/sys/dev/drm2/drm_ioc32.c ============================================================================== --- head/sys/dev/drm2/drm_ioc32.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/drm2/drm_ioc32.c Fri Apr 6 17:35:35 2018 (r332122) @@ -25,8 +25,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #ifdef COMPAT_FREEBSD32 #include Modified: head/sys/dev/drm2/i915/i915_ioc32.c ============================================================================== --- head/sys/dev/drm2/i915/i915_ioc32.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/drm2/i915/i915_ioc32.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #ifdef COMPAT_FREEBSD32 /** @file i915_ioc32.c Modified: head/sys/dev/drm2/radeon/radeon_ioc32.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_ioc32.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/drm2/radeon/radeon_ioc32.c Fri Apr 6 17:35:35 2018 (r332122) @@ -31,8 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #ifdef COMPAT_FREEBSD32 #include Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/filemon/filemon.c Fri Apr 6 17:35:35 2018 (r332122) @@ -31,8 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/filemon/filemon_wrapper.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_compat.h" - static eventhandler_tag filemon_exec_tag; static eventhandler_tag filemon_exit_tag; static eventhandler_tag filemon_fork_tag; Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/kbdmux/kbdmux.c Fri Apr 6 17:35:35 2018 (r332122) @@ -33,7 +33,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" #include "opt_evdev.h" #include "opt_kbd.h" #include "opt_kbdmux.h" Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/md/md.c Fri Apr 6 17:35:35 2018 (r332122) @@ -60,7 +60,6 @@ * From: src/sys/dev/vn/vn.c,v 1.122 2000/12/16 16:06:03 */ -#include "opt_compat.h" #include "opt_rootdevname.h" #include "opt_geom.h" #include "opt_md.h" Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/mfi/mfi.c Fri Apr 6 17:35:35 2018 (r332122) @@ -55,7 +55,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_mfi.h" #include Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/mpr/mpr_user.c Fri Apr 6 17:35:35 2018 (r332122) @@ -63,8 +63,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - /* TODO Move headers to mprvar */ #include #include Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/mps/mps_user.c Fri Apr 6 17:35:35 2018 (r332122) @@ -65,8 +65,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - /* TODO Move headers to mpsvar */ #include #include Modified: head/sys/dev/mrsas/mrsas_linux.c ============================================================================== --- head/sys/dev/mrsas/mrsas_linux.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/mrsas/mrsas_linux.c Fri Apr 6 17:35:35 2018 (r332122) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include +#undef COMPAT_FREEBSD32 #include /* There are multiple ioctl number ranges that need to be handled */ Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/null/null.c Fri Apr 6 17:35:35 2018 (r332122) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/pci/pci_user.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_bus.h" /* XXX trim includes */ -#include "opt_compat.h" #include #include Modified: head/sys/dev/rp/rp.c ============================================================================== --- head/sys/dev/rp/rp.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/rp/rp.c Fri Apr 6 17:35:35 2018 (r332122) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); * rp.c - for RocketPort FreeBSD */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/dev/sio/sio.c ============================================================================== --- head/sys/dev/sio/sio.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/sio/sio.c Fri Apr 6 17:35:35 2018 (r332122) @@ -35,7 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_gdb.h" #include "opt_kdb.h" #include "opt_sio.h" Modified: head/sys/dev/syscons/scvidctl.c ============================================================================== --- head/sys/dev/syscons/scvidctl.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/syscons/scvidctl.c Fri Apr 6 17:35:35 2018 (r332122) @@ -32,7 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_syscons.h" #include Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/syscons/syscons.c Fri Apr 6 17:35:35 2018 (r332122) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_syscons.h" #include "opt_splash.h" #include "opt_ddb.h" Modified: head/sys/dev/uart/uart_kbd_sun.c ============================================================================== --- head/sys/dev/uart/uart_kbd_sun.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/uart/uart_kbd_sun.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,7 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_kbd.h" #include "opt_sunkbd.h" Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/usb/input/ukbd.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ -#include "opt_compat.h" #include "opt_kbd.h" #include "opt_ukbd.h" #include "opt_evdev.h" Modified: head/sys/dev/vkbd/vkbd.c ============================================================================== --- head/sys/dev/vkbd/vkbd.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/vkbd/vkbd.c Fri Apr 6 17:35:35 2018 (r332122) @@ -33,7 +33,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" #include "opt_kbd.h" #include Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/dev/vt/vt_core.c Fri Apr 6 17:35:35 2018 (r332122) @@ -35,8 +35,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/cuse/cuse.c Fri Apr 6 17:35:35 2018 (r332122) @@ -24,8 +24,6 @@ * SUCH DAMAGE. */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/devfs/devfs_devs.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/procfs/procfs_dbregs.c ============================================================================== --- head/sys/fs/procfs/procfs_dbregs.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/procfs/procfs_dbregs.c Fri Apr 6 17:35:35 2018 (r332122) @@ -45,8 +45,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- head/sys/fs/procfs/procfs_fpregs.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/procfs/procfs_fpregs.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,8 +39,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ioctl.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/procfs/procfs_ioctl.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/procfs/procfs_map.c Fri Apr 6 17:35:35 2018 (r332122) @@ -37,8 +37,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/fs/procfs/procfs_regs.c ============================================================================== --- head/sys/fs/procfs/procfs_regs.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/fs/procfs/procfs_regs.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,8 +39,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/geom/geom_dev.c Fri Apr 6 17:35:35 2018 (r332122) @@ -38,8 +38,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/i386/i386/genassym.c Fri Apr 6 17:35:35 2018 (r332122) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" -#include "opt_compat.h" #include "opt_hwpmc_hooks.h" #include "opt_kstack_pages.h" Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/i386/i386/locore.s Fri Apr 6 17:35:35 2018 (r332122) @@ -40,7 +40,6 @@ */ #include "opt_bootp.h" -#include "opt_compat.h" #include "opt_nfsroot.h" #include "opt_pmap.h" Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/i386/i386/machdep.c Fri Apr 6 17:35:35 2018 (r332122) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #include "opt_atpic.h" -#include "opt_compat.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_inet.h" Modified: head/sys/i386/i386/sigtramp.s ============================================================================== --- head/sys/i386/i386/sigtramp.s Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/i386/i386/sigtramp.s Fri Apr 6 17:35:35 2018 (r332122) @@ -39,8 +39,6 @@ * and many others. */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/i386/linux/linux_dummy.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/imgact_elf.c Fri Apr 6 17:35:35 2018 (r332122) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" -#include "opt_compat.h" #include #include Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/init_sysent.c Fri Apr 6 17:35:35 2018 (r332122) @@ -5,8 +5,6 @@ * $FreeBSD$ */ -#include "opt_compat.h" - #include #include #include Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_descrip.c Fri Apr 6 17:35:35 2018 (r332122) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" -#include "opt_compat.h" #include "opt_ddb.h" #include "opt_ktrace.h" Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_event.c Fri Apr 6 17:35:35 2018 (r332122) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_ktrace.h" #include "opt_kqueue.h" Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_exec.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" -#include "opt_compat.h" #include "opt_hwpmc_hooks.h" #include "opt_ktrace.h" #include "opt_vm.h" Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_exit.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_ktrace.h" #include Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_jail.c Fri Apr 6 17:35:35 2018 (r332122) @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_mib.c Fri Apr 6 17:35:35 2018 (r332122) @@ -40,7 +40,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_posix.h" #include "opt_config.h" Modified: head/sys/kern/kern_module.c ============================================================================== --- head/sys/kern/kern_module.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_module.c Fri Apr 6 17:35:35 2018 (r332122) @@ -26,8 +26,6 @@ * SUCH DAMAGE. */ -#include "opt_compat.h" - #include __FBSDID("$FreeBSD$"); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_proc.c Fri Apr 6 17:35:35 2018 (r332122) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_ddb.h" #include "opt_ktrace.h" #include "opt_kstack_pages.h" Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_prot.c Fri Apr 6 17:35:35 2018 (r332122) @@ -46,7 +46,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_resource.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,8 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_sendfile.c Fri Apr 6 17:35:35 2018 (r332122) @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include Modified: head/sys/kern/kern_sharedpage.c ============================================================================== --- head/sys/kern/kern_sharedpage.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_sharedpage.c Fri Apr 6 17:35:35 2018 (r332122) @@ -33,7 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_vm.h" #include Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_sig.c Fri Apr 6 17:35:35 2018 (r332122) @@ -39,7 +39,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_ktrace.h" #include Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_sysctl.c Fri Apr 6 17:35:35 2018 (r332122) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" -#include "opt_compat.h" #include "opt_ktrace.h" #include Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_tc.c Fri Apr 6 17:35:35 2018 (r332122) @@ -21,7 +21,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_ntp.h" #include "opt_ffclock.h" Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_thr.c Fri Apr 6 17:35:35 2018 (r332122) @@ -29,7 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_posix.h" #include #include Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_umtx.c Fri Apr 6 17:35:35 2018 (r332122) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" #include "opt_umtx_profiling.h" #include Modified: head/sys/kern/kern_xxx.c ============================================================================== --- head/sys/kern/kern_xxx.c Fri Apr 6 17:23:47 2018 (r332121) +++ head/sys/kern/kern_xxx.c Fri Apr 6 17:35:35 2018 (r332122) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 6 17:45:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 786F6F99A1D for ; Fri, 6 Apr 2018 17:45:01 +0000 (UTC) (envelope-from neha@credible.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 195856BAD1 for ; Fri, 6 Apr 2018 17:45:01 +0000 (UTC) (envelope-from neha@credible.com) Received: by mail-qk0-x242.google.com with SMTP id p67so2013726qke.13 for ; Fri, 06 Apr 2018 10:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=credible-com.20150623.gappssmtp.com; s=20150623; h=date:to:from:reply-to:subject:message-id:mime-version :content-transfer-encoding; bh=ZcrDmODXX6aesIIf3eL/yFB8LZMcjlhkqqCmzL8NLBY=; b=OX/NvKJS+w8PR6fyw4G8xC5L/jI/ZQ84TzKke7xGaap755B20NtWv3lJzkIaMP6tUd 7fbhC591YE1P1qdnWDtGDdWBTQjomvnY48iR0OVxmo5oHSDBuz2mXIlSMkIX5hboCV53 BR0gG+9EEcV3a1RHAfMEGyb08fp5oSfk+kCmNB2t9q7wiFyuSaXQgWlbPk1KfY/Iyyp0 dSStS7EUcrrq7Dey5sHy3OBYonfaxA6TewSLAyXVdhySXcoDeFvlcRM2NvrCjkQaELfE Pmk1hOz+HQWZ+8KWKQF2riHcQPri3b8CJQY85j35XpYoBMjbY6tXLT6PYthQ8y4lY27e Q0kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:to:from:reply-to:subject:message-id :mime-version:content-transfer-encoding; bh=ZcrDmODXX6aesIIf3eL/yFB8LZMcjlhkqqCmzL8NLBY=; b=ewtXksOSeIr2aJoM/28ZLezzQqZDD1xzGZYblJqTlv9ZOu0yE8xBzxDrdES2cHD7Yo CVytd7NbDfLzqlVrmuDeyY9Nk3SHyQ0Tml7hD+QuxORCf1K7r7vTfH4nB8UfE9GarjrI ptKu6E7EAwlp8FBCqpa48uzyYKB5Pzigw6KKDBlpRaVPloNiU5Jq3ouFbJaY1PjQxJGO r83z+6YHZSpuMw27agdu021Pt0+KPPYlfdQM1moA2uvBYeeHktwF3CNF8gCq4um2+VZz 56Bz7t7dyBmnCuOCxctOouCnOkKPSef7En0bQ1Sfn9VUcY7AOLZB1AcSpy/iF1vbM7gF VcyQ== X-Gm-Message-State: ALQs6tDIwnFtQALD8u+s2P7uLgE2DB8ublIvdwXcFrUcz6VSV4S1CptO Sw6ORMHAuk4UN+7ujNdaAvmeYQN4q5q2AqZGCQLbjM6qSAN0JMI03tMgFgzFyvrgBYOut3MytsW nt4XGmk8xqPNeW1ydBBILEQ4N10vOQWCyyL7xRgamezElMWef34t0/SK3RZ+MJvFPJQ== X-Google-Smtp-Source: AIpwx4/MCnuxFWkxETT60WN0K5x6p9TqQaAY1TfdXu7IGCYS0SX5eY7Kbqr0vrsaTyi00814126pCg== X-Received: by 10.55.123.199 with SMTP id w190mr36549688qkc.195.1523036700371; Fri, 06 Apr 2018 10:45:00 -0700 (PDT) Received: from credible.com (ec2-54-81-0-34.compute-1.amazonaws.com. [54.81.0.34]) by smtp.gmail.com with ESMTPSA id c4sm7737243qtj.86.2018.04.06.10.44.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 10:44:59 -0700 (PDT) Date: Fri, 6 Apr 2018 17:44:59 +0000 To: svn-src-all@freebsd.org From: Neha Chhabdiya Reply-To: Neha Chhabdiya Subject: New study: the best & worst states at managing debt Message-ID: <16645904.or_mail@credible.com> X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 17:45:01 -0000 Hi there, Debt is a major issue many Americans face today and we wanted to find out where people are faring the worst. I wanted to share this new analysis from Credible because you’ve touched on debt in the past. Here are a few highlights of the best and worst states at managing debt: On average, people in Michigan have the least debt relative to the income they make Hawaii has the highest average debt-to-income ratio of all states On average, borrowers are paying nearly $1,500 on monthly credit card bills, student loan debt, and housing costs I think it would be really interesting to see how your audience would respond to that. Will you let me know what you think of this piece? :) I can even send you a quick line of code to embed a map on your site if you’re interested. Thanks, Neha -------- Neha Chhabdiya Community Manager p: 866-540-6005 e: neha@credible.com w: credible.comDon't want emails from us anymore? Reply to this email with the word "UNSUBSCRIBE" in the subject line. Credible Labs Inc., 101 Green Street Level 2, San Francisco California, 94111, United States From owner-svn-src-all@freebsd.org Fri Apr 6 18:10:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69D0FF9B5E3; Fri, 6 Apr 2018 18:10:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19DE66C7C0; Fri, 6 Apr 2018 18:10:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 146E81545E; Fri, 6 Apr 2018 18:10:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36IAd99087149; Fri, 6 Apr 2018 18:10:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36IAcs1087134; Fri, 6 Apr 2018 18:10:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061810.w36IAcs1087134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 18:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332123 - in stable/11: lib/libefivar usr.sbin/efidp usr.sbin/efivar X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: lib/libefivar usr.sbin/efidp usr.sbin/efivar X-SVN-Commit-Revision: 332123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:10:40 -0000 Author: kevans Date: Fri Apr 6 18:10:38 2018 New Revision: 332123 URL: https://svnweb.freebsd.org/changeset/base/332123 Log: MFC efivar changes: r321429, r323056-r323057, r323066, r323259-r323260, r323519, r325684, r326050-r326051, r326231, r326287, r326457-r326459, r326472, r326658, r326805, r327574-r327575, r330279 r321429: fix typo r323056: Fix printing File() nodes in device paths. Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not ASCII/UTF8. Convert to utf8 and print that when printing File paths. Also, since File may be at the end of a long device path, output File() around the path so it doesn't just show up as random nodes that might accidentally match real node paths names and cause errors. r323057: Fix parsing File() nodes in device paths. o Add File to the mUefiDevicePathLibDevPathFromTextTable table so we don't include 'File()' in the supposed path name. This happens because of a possible misfeature in the EDK2 code where any path that's not recognized is treated as a File() node. o Convert utf8 input into ucs2 output rather than just copying the utf8 and hoping for the best (no good comes from that). o Remove bogus comment about needing to add 1. The dummy array already is length 1, so that's included in sizeof the struct, so there's no need to add it. Sponsored by: Netflix r323066: Add UCS2->UTF8 option. Many UEFI variables are UCS2 strings (some NUL terminated, others not). Add --utf8 (-u) to convert UCS2 strings to UTF8 before printing. Sponsored by: Netflix r323259: Implement efidp_size efidp_size will return the size, in bytes, of a EFI device path structure. This is a convenience wrapper in the same style as the other linux routines. It's implemented by GetDevicePathSize from EDK2 we already needed for other things. Sponsored by: Netflix r323260: Create efi utility printing routines Split out asciidump, utf8dump, bindump, and hexdump into a separate file efiutil.c. Implement new efi_print_load_option for printing out the EFI_LOADER_OPTION data structure used to specify different options to the UEFI boot manager. Sponsored by: Netflix r323519: Minor fixes to edge cases in efi_get_next_variable_name Fix allocating more memory for the names (unlikely to be needed, but still best to get right) to ask for the length the kernel told use we needed, not the old length of the variable. Mind the proper NUL that we add in the space we allocate. Free the old name string before we allcoate a new one to limit what we leak to the last one (free passed in name for the last one in the list), and detect the last one by rv != 0 and errno == ENOENT, rather then just the former to avoid false positives if errno happens to be ENOENT on entry. Sponsored by: Netflix r325684: Simplify the efivar interface a little. We started out having Linux compatible libefivar interfaces. This was in anticipation of porting the GPL'd efibootmgr to FreeBSD via a port. However, since we need that functionality in the base, that port isn't going to happened. It also appears that efivar is a private library that's not used much outside a command line util and efibootmgr. Reduce compatibility with the Linux version a little by removing the mode parameter to efi_set_variable (which was unused on FreeBSD, and not set to something useful in the code we'd written). Also remove some efi error routines that were never implemented and existed only to placate early GPL efibootmgr porting experiments. Suggested by: Matt Williams Sponsored by: Netflix r326050: Document what the command line arguments actually do. List some of the size limitations. Sponsored by: Netflix r326051: This program is more useful if it skips leading whitespace when parsing a textual UEFI Device Path, since otherwise it things the passed in path is a filename. While here, reduce the repetition of 8192. Sponsored by: Netflix r326231: Add efidp_format_device_path_node to format a single node in a device path, much like efidp_format_device_path will format the entire path. Sponsored by: Netflix r326287: efivar: add missing getopt 'u' option r326457: Read multiple lines when parsing the data. Allow multiple device paths to be read when formatting device paths. Set the upper limit to 64k (most of these paths are < 64 bytes). Sponsored by: Netflix r326458: Create a function to translate UEFI paths to unix paths efivar_device_path_to_unix_path translates from UEFI to Unix efivar_unix_path_to_device_path translates from Unix to UEFI At present, only HD() device types are supported (both GPT and MBR). CdRom and floppy devices aren't supported. ZFS isn't supported because there's no way in the UEFI standard to specify a ZFS datastore. Network devices aren't supported either. Three forms of Unix path are accepted: /path/to/file (for a mounted filesystem), //path/to/file (uses the EFI partition on the same disk as /), and dev:/path/to/file (for unmounted filesystem). Two forms are produced (the first and last). Sponsored by: Netflix r326459: Add -u (--to-unix) and -e (--to-efi) to convert unix or efi paths to the other. Sponsored by: Netflix r326472: Add forgotten libgeom. Sponsored by: Netflix r326658: Ensure that "out" is initialized in all error paths. Reported by: gcc Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D13402 r326805: Iniailize str so ucs2_to_utf8 won't free stack garbage. CID: 1381037 Sponsored by: Netflix r327574: Set dp to NULL when we free it, and tree a NULL dp as an error condition. This should prevent a double free. In addition, prevent a leak by freeing dp each loop and when we're done. CID: 1383577 Sponsored by: Netflix r327575: Need to convert '/' back to '\' when creating a path. Ideally, this would be filesystem type dependent, but that's difficult to accomplish and it's unclear how the UEFI firmware will cope. Be conservative and make boot loaders cope instead. Sponsored by: Netflix r330279: libefivar: use standard 2-Clause FreeBSD license Approved by: imp Sponsored by: The FreeBSD Foundation Added: stable/11/lib/libefivar/efivar-dp-xlate.c - copied, changed from r326459, head/lib/libefivar/efivar-dp-xlate.c stable/11/usr.sbin/efivar/efiutil.c - copied, changed from r323260, head/usr.sbin/efivar/efiutil.c stable/11/usr.sbin/efivar/efiutil.h - copied unchanged from r323260, head/usr.sbin/efivar/efiutil.h Modified: stable/11/lib/libefivar/Makefile stable/11/lib/libefivar/efi-osdep.h stable/11/lib/libefivar/efivar-dp-format.c stable/11/lib/libefivar/efivar-dp-parse.c stable/11/lib/libefivar/efivar-dp.h stable/11/lib/libefivar/efivar.c stable/11/lib/libefivar/efivar.h stable/11/lib/libefivar/uefi-dplib.h stable/11/lib/libefivar/uefi-dputil.c stable/11/usr.sbin/efidp/Makefile stable/11/usr.sbin/efidp/efidp.8 stable/11/usr.sbin/efidp/efidp.c stable/11/usr.sbin/efivar/Makefile stable/11/usr.sbin/efivar/efivar.8 stable/11/usr.sbin/efivar/efivar.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libefivar/Makefile ============================================================================== --- stable/11/lib/libefivar/Makefile Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/Makefile Fri Apr 6 18:10:38 2018 (r332123) @@ -35,6 +35,7 @@ PACKAGE=lib${LIB} LIB= efivar SRCS= efivar.c efichar.c efivar-dp-format.c \ efivar-dp-parse.c \ + efivar-dp-xlate.c \ uefi-guid.c uefi-dputil.c INCS= efivar.h efivar-dp.h SHLIB_MAJOR= 1 Modified: stable/11/lib/libefivar/efi-osdep.h ============================================================================== --- stable/11/lib/libefivar/efi-osdep.h Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/efi-osdep.h Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: stable/11/lib/libefivar/efivar-dp-format.c ============================================================================== --- stable/11/lib/libefivar/efivar-dp-format.c Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/efivar-dp-format.c Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "efichar.h" + #include "efi-osdep.h" #include "efivar-dp.h" @@ -1872,9 +1874,12 @@ DevPathToTextFilePath ( ) { FILEPATH_DEVICE_PATH *Fp; + char *name = NULL; Fp = DevPath; - UefiDevicePathLibCatPrint (Str, "%s", Fp->PathName); + ucs2_to_utf8(Fp->PathName, &name); + UefiDevicePathLibCatPrint (Str, "File(%s)", name); + free(name); } /** @@ -2267,7 +2272,6 @@ static const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePath {0, 0, NULL} }; -#ifndef __FreeBSD__ /** Converts a device node to its string representation. @@ -2283,7 +2287,7 @@ static const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePath is NULL or there was insufficient memory. **/ -CHAR16 * +static char * EFIAPI UefiDevicePathLibConvertDeviceNodeToText ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode, @@ -2294,6 +2298,7 @@ UefiDevicePathLibConvertDeviceNodeToText ( POOL_PRINT Str; UINTN Index; DEVICE_PATH_TO_TEXT ToText; + EFI_DEVICE_PATH_PROTOCOL *Node; if (DeviceNode == NULL) { return NULL; @@ -2305,6 +2310,7 @@ UefiDevicePathLibConvertDeviceNodeToText ( // Process the device path node // If not found, use a generic function // + Node = __DECONST(EFI_DEVICE_PATH_PROTOCOL *, DeviceNode); ToText = DevPathToTextNodeGeneric; for (Index = 0; mUefiDevicePathLibToTextTable[Index].Function != NULL; Index++) { if (DevicePathType (DeviceNode) == mUefiDevicePathLibToTextTable[Index].Type && @@ -2318,12 +2324,11 @@ UefiDevicePathLibConvertDeviceNodeToText ( // // Print this node // - ToText (&Str, (VOID *) DeviceNode, DisplayOnly, AllowShortcuts); + ToText (&Str, (VOID *) Node, DisplayOnly, AllowShortcuts); ASSERT (Str.Str != NULL); return Str.Str; } -#endif /** Converts a device path to its text representation. @@ -2424,4 +2429,39 @@ efidp_format_device_path(char *buf, size_t len, const_ free(str); return retval; +} + +ssize_t +efidp_format_device_path_node(char *buf, size_t len, const_efidp dp) +{ + char *str; + ssize_t retval; + + str = UefiDevicePathLibConvertDeviceNodeToText ( + __DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp), FALSE, TRUE); + if (str == NULL) + return -1; + strlcpy(buf, str, len); + retval = strlen(str); + free(str); + + return retval; +} + +size_t +efidp_size(const_efidp dp) +{ + + return GetDevicePathSize(__DECONST(EFI_DEVICE_PATH_PROTOCOL *, dp)); +} + +char * +efidp_extract_file_path(const_efidp dp) +{ + const FILEPATH_DEVICE_PATH *fp; + char *name = NULL; + + fp = (const void *)dp; + ucs2_to_utf8(fp->PathName, &name); + return name; } Modified: stable/11/lib/libefivar/efivar-dp-parse.c ============================================================================== --- stable/11/lib/libefivar/efivar-dp-parse.c Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/efivar-dp-parse.c Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "efichar.h" + #include "efi-osdep.h" #include "efivar-dp.h" @@ -3031,21 +3033,15 @@ DevPathFromTextFilePath ( StrCpyS (File->PathName, StrLen (TextDeviceNode) + 1, TextDeviceNode); #else + size_t len = (sizeof (FILEPATH_DEVICE_PATH) + StrLen (TextDeviceNode) * 2); + efi_char * v; File = (FILEPATH_DEVICE_PATH *) CreateDeviceNode ( MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, - (UINT16) (sizeof (FILEPATH_DEVICE_PATH) + StrLen (TextDeviceNode) + 1) + (UINT16)len ); - - /* - * Note: We'd have to change the Tianocore header files to fix this - * to not need a cast. Instead we just cast it here. The Interface - * to the user may have issues since this won't be a UCS-2 - * string. Also note that in the original code, a NUL wasn't - * allocated for the end of the string, but we copy that below. This - * has been corrected. - */ - StrCpyS ((char *)File->PathName, StrLen (TextDeviceNode) + 1, TextDeviceNode); + v = File->PathName; + utf8_to_ucs2(TextDeviceNode, &v, &len); #endif return (EFI_DEVICE_PATH_PROTOCOL *) File; @@ -3560,6 +3556,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TA {"Media", DevPathFromTextMedia }, {"Fv", DevPathFromTextFv }, {"FvFile", DevPathFromTextFvFile }, + {"File", DevPathFromTextFilePath }, {"Offset", DevPathFromTextRelativeOffsetRange }, {"RamDisk", DevPathFromTextRamDisk }, {"VirtualDisk", DevPathFromTextVirtualDisk }, Copied and modified: stable/11/lib/libefivar/efivar-dp-xlate.c (from r326459, head/lib/libefivar/efivar-dp-xlate.c) ============================================================================== --- head/lib/libefivar/efivar-dp-xlate.c Sat Dec 2 07:29:24 2017 (r326459, copy source) +++ stable/11/lib/libefivar/efivar-dp-xlate.c Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include @@ -527,12 +527,17 @@ find_geom_efimedia(struct gmesh *mesh, const char *dev static int build_dp(const char *efimedia, const char *relpath, efidp *dp) { - char *fp, *dptxt = NULL; + char *fp, *dptxt = NULL, *cp, *rp; int rv = 0; - efidp out; + efidp out = NULL; size_t len; - fp = path_to_file_dp(relpath); + rp = strdup(relpath); + for (cp = rp; *cp; cp++) + if (*cp == '/') + *cp = '\\'; + fp = path_to_file_dp(rp); + free(rp); if (fp == NULL) { rv = ENOMEM; goto errout; @@ -663,6 +668,7 @@ errout: free(rp); if (rv != 0) { free(*dp); + *dp = NULL; } return (rv); } Modified: stable/11/lib/libefivar/efivar-dp.h ============================================================================== --- stable/11/lib/libefivar/efivar-dp.h Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/efivar-dp.h Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ @@ -60,6 +60,13 @@ typedef const efidp_data *const_efidp; */ ssize_t efidp_format_device_path(char *buf, size_t len, const_efidp dp, ssize_t max); +ssize_t efidp_format_device_path_node(char *buf, size_t len, const_efidp dp); ssize_t efidp_parse_device_path(char *path, efidp out, size_t max); +char * efidp_extract_file_path(const_efidp dp); + +size_t efidp_size(const_efidp); + +int efivar_device_path_to_unix_path(const_efidp dp, char **dev, char **relpath, char **abspath); +int efivar_unix_path_to_device_path(const char *path, efidp *dp); #endif /* _EFIVAR_DP_H_ */ Modified: stable/11/lib/libefivar/efivar.c ============================================================================== --- stable/11/lib/libefivar/efivar.c Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/efivar.c Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include @@ -150,7 +150,7 @@ efi_append_variable(efi_guid_t guid, const char *name, { return efi_set_variable(guid, name, data, data_size, - attributes | EFI_VARIABLE_APPEND_WRITE, 0); + attributes | EFI_VARIABLE_APPEND_WRITE); } int @@ -158,7 +158,7 @@ efi_del_variable(efi_guid_t guid, const char *name) { /* data_size of 0 deletes the variable */ - return efi_set_variable(guid, name, NULL, 0, 0, 0); + return efi_set_variable(guid, name, NULL, 0, 0); } int @@ -225,8 +225,13 @@ efi_get_next_variable_name(efi_guid_t **guid, char **n if (efi_open_dev() == -1) return -1; + /* + * Always allocate enough for an extra NUL on the end, but don't tell + * the IOCTL about it so we can NUL terminate the name before converting + * it to UTF8. + */ if (buf == NULL) - buf = malloc(buflen); + buf = malloc(buflen + sizeof(efi_char)); again: efi_var_reset(&var); @@ -244,21 +249,23 @@ again: rv = ioctl(efi_fd, EFIIOC_VAR_NEXT, &var); if (rv == 0 && var.name == NULL) { /* - * oops, too little space. Try again. + * Variable name not long enough, so allocate more space for the + * name and try again. As above, mind the NUL we add. */ - void *new = realloc(buf, buflen); - buflen = var.namesize; + void *new = realloc(buf, var.namesize + sizeof(efi_char)); if (new == NULL) { rv = -1; errno = ENOMEM; goto done; } + buflen = var.namesize; buf = new; goto again; } if (rv == 0) { - *name = NULL; /* XXX */ + free(*name); /* Free last name, to avoid leaking */ + *name = NULL; /* Force ucs2_to_utf8 to malloc new space */ var.name[var.namesize / sizeof(efi_char)] = 0; /* EFI doesn't NUL terminate */ rv = ucs2_to_utf8(var.name, name); if (rv != 0) @@ -269,9 +276,11 @@ again: errout: /* XXX The linux interface expects name to be a static buffer -- fix or leak memory? */ + /* XXX for the moment, we free just before we'd leak, but still leak last one */ done: - if (errno == ENOENT) { + if (rv != 0 && errno == ENOENT) { errno = 0; + free(*name); /* Free last name, to avoid leaking */ return 0; } @@ -349,7 +358,7 @@ efi_name_to_guid(const char *name, efi_guid_t *guid) int efi_set_variable(efi_guid_t guid, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode __unused) + uint8_t *data, size_t data_size, uint32_t attributes) { struct efi_var_ioc var; int rv; Modified: stable/11/lib/libefivar/efivar.h ============================================================================== --- stable/11/lib/libefivar/efivar.h Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/efivar.h Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ @@ -83,7 +83,7 @@ int efi_guid_to_symbol(efi_guid_t *guid, char **symbol int efi_guid_to_str(const efi_guid_t *guid, char **sp); int efi_name_to_guid(const char *name, efi_guid_t *guid); int efi_set_variable(efi_guid_t guid, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode); + uint8_t *data, size_t data_size, uint32_t attributes); int efi_str_to_guid(const char *s, efi_guid_t *guid); int efi_variables_supported(void); @@ -98,38 +98,5 @@ struct uuid_table int efi_known_guid(struct uuid_table **); extern const efi_guid_t efi_guid_empty; - -/* Stubs that are expected, but aren't really used */ -static inline int -efi_error_get(unsigned int n __unused, char ** const fn __unused, - char ** const func __unused, int *line __unused, - char ** const msg __unused, int *err __unused) -{ - return 0; -} - -static inline int -efi_error_set(const char *fn __unused, const char *func __unused, - int line __unused, int err __unused, const char *fmt __unused, ...) -{ - return 0; -} - -static inline void -efi_error_clear(void) -{ -} - -static inline int -efi_error(const char *fmt __unused, ...) -{ - return 0; -} - -static inline int -efi_error_val(int val __unused, const char *fmt __unused, ...) -{ - return 0; -} #endif /* _EFIVAR_H_ */ Modified: stable/11/lib/libefivar/uefi-dplib.h ============================================================================== --- stable/11/lib/libefivar/uefi-dplib.h Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/uefi-dplib.h Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ Modified: stable/11/lib/libefivar/uefi-dputil.c ============================================================================== --- stable/11/lib/libefivar/uefi-dputil.c Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/lib/libefivar/uefi-dputil.c Fri Apr 6 18:10:38 2018 (r332123) @@ -6,22 +6,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ /* @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "uefi-dplib.h" -/* XXX maybe I sould include the entire DevicePathUtiltiies.c and ifdef out what we don't use */ +/* XXX maybe I should include the entire DevicePathUtiltiies.c and ifdef out what we don't use */ /* * Taken from MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c Modified: stable/11/usr.sbin/efidp/Makefile ============================================================================== --- stable/11/usr.sbin/efidp/Makefile Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/usr.sbin/efidp/Makefile Fri Apr 6 18:10:38 2018 (r332123) @@ -3,6 +3,6 @@ PROG= efidp MAN= efidp.8 -LIBADD= efivar +LIBADD= efivar geom .include Modified: stable/11/usr.sbin/efidp/efidp.8 ============================================================================== --- stable/11/usr.sbin/efidp/efidp.8 Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/usr.sbin/efidp/efidp.8 Fri Apr 6 18:10:38 2018 (r332123) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd December 1, 2017 .Dt EFIDP 8 .Os .Sh NAME @@ -36,16 +36,44 @@ .Op Fl -parse .Op Fl -format .Sh DESCRIPTION -This program manages +This program converts .Dq Unified Extensible Firmware Interface .Pq UEFI -Device Paths, as defined in the UEFI standard. +Device Paths, as defined in the UEFI standard, to and from binary form. +Binary and textual forms are defined in Chapter 9 of the UEFI +Specification. +.Pp +.Bl -tag -width 20m +.It Fl f Fl -format +Formats a binary UEFI Device Path into its canonical UTF-8 textual form. +A binary Device Path can be no longer than 65536 bytes. +The textual form must fit into 65536 bytes. +Multiple binary device paths may be specified. +.It Fl p Fl -parse +Parses a UEFI Device Path UTF-8 specification and outputs the binary +Device Path form. +Only one device path is parsed, even if there are multiple present in +the input. +Leading white space is ignored. +The resulting binary Device Path can be no longer than 65536 bytes. +Multiple lines may be specified. +Each one will be translated. +.It Fl e Fl --to-efi +Translate a Unix file path to an EFI Device Path. +The output is the textual representation of the EFI Device Path. +.It Fl u Fl --to-unix +Translate an EFI device path to a Unix file path. +The input is the textual representation of the EFI Device Path. +.El .Sh SEE ALSO Appendix A of the UEFI specification has the format for GUIDs. All GUIDs .Dq Globally Unique Identifiers have the format described in RFC 4122. -.El +.Pp +The Unified Extensible Firmware Interface Specification is available +from +.Pa www.uefi.org . .Sh HISTORY The .Nm Modified: stable/11/usr.sbin/efidp/efidp.c ============================================================================== --- stable/11/usr.sbin/efidp/efidp.c Fri Apr 6 17:35:35 2018 (r332122) +++ stable/11/usr.sbin/efidp/efidp.c Fri Apr 6 18:10:38 2018 (r332123) @@ -27,9 +27,11 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include +#include #include #include #include @@ -37,21 +39,25 @@ __FBSDID("$FreeBSD$"); #include #include +#define MAXSIZE 65536 /* Everyting will be smaller than this, most 1000x smaller */ + /* options descriptor */ static struct option longopts[] = { + { "to-unix", no_argument, NULL, 'u' }, + { "to-efi", no_argument, NULL, 'e' }, { "format", no_argument, NULL, 'f' }, { "parse", no_argument, NULL, 'p' }, { NULL, 0, NULL, 0 } }; -static int flag_format, flag_parse; +static int flag_format, flag_parse, flag_unix, flag_efi; static void usage(void) { - errx(1, "efidp [-fp]"); + errx(1, "efidp [-efpu]"); } static ssize_t @@ -62,18 +68,16 @@ read_file(int fd, void **rv) off_t off; ssize_t red; - len = 4096; + len = MAXSIZE; off = 0; retval = malloc(len); do { red = read(fd, retval + off, len - off); + if (red == 0) + break; off += red; - if (red < (ssize_t)(len - off)) + if (off == (off_t)len) break; - len *= 2; - retval = reallocf(retval, len); - if (retval == NULL) - return -1; } while (1); *rv = retval; @@ -85,15 +89,21 @@ parse_args(int argc, char **argv) { int ch; - while ((ch = getopt_long(argc, argv, "fp", + while ((ch = getopt_long(argc, argv, "efpu", longopts, NULL)) != -1) { switch (ch) { + case 'e': + flag_efi++; + break; case 'f': flag_format++; break; case 'p': flag_parse++; break; + case 'u': + flag_unix++; + break; default: usage(); } @@ -104,45 +114,139 @@ parse_args(int argc, char **argv) if (argc >= 1) usage(); - if (flag_parse + flag_format != 1) { + if (flag_parse + flag_format + flag_efi + flag_unix != 1) { warnx("Can only use one of -p (--parse), " "and -f (--format)"); usage(); } } -int -main(int argc, char **argv) +static char * +trim(char *s) { - void *data; + char *t; + + while (isspace(*s)) + s++; + t = s + strlen(s) - 1; + while (t > s && isspace(*t)) + *t-- = '\0'; + return s; +} + +static void +unix_to_efi(void) +{ + char buffer[MAXSIZE]; + char efi[MAXSIZE]; + efidp dp; + char *walker; + int rv; + + dp = NULL; + while (fgets(buffer, sizeof(buffer), stdin)) { + walker= trim(buffer); + free(dp); + dp = NULL; + rv = efivar_unix_path_to_device_path(walker, &dp); + if (rv != 0 || dp == NULL) { + errno = rv; + warn("Can't convert '%s' to efi", walker); + continue; + } + if (efidp_format_device_path(efi, sizeof(efi), + dp, efidp_size(dp)) < 0) { + warnx("Can't format dp for '%s'", walker); + continue; + } + printf("%s\n", efi); + } + free(dp); +} + +static void +efi_to_unix(void) +{ + char buffer[MAXSIZE]; + char dpbuf[MAXSIZE]; + efidp dp; + size_t dplen; + char *walker, *dev, *relpath, *abspath; + int rv; + + dp = (efidp)dpbuf; + while (fgets(buffer, sizeof(buffer), stdin)) { + walker= trim(buffer); + dplen = efidp_parse_device_path(walker, dp, sizeof(dpbuf)); + rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); + if (rv == 0) + printf("%s:%s %s\n", dev, relpath, abspath); + else { + errno = rv; + warn("Can't convert '%s' to unix", walker); + } + } +} + +static void +format(void) +{ + char buffer[MAXSIZE]; + ssize_t fmtlen; ssize_t len; + void *data; + size_t dplen; + const_efidp dp; - parse_args(argc, argv); len = read_file(STDIN_FILENO, &data); if (len == -1) err(1, "read"); - if (flag_format) { - char buffer[4096]; - ssize_t fmtlen; - + dp = (const_efidp)data; + while (len > 0) { + dplen = efidp_size(dp); fmtlen = efidp_format_device_path(buffer, sizeof(buffer), - (const_efidp)data, len); + dp, dplen); if (fmtlen > 0) printf("%s\n", buffer); - free(data); - } else if (flag_parse) { - efidp dp; - ssize_t dplen; - char *str; + len -= dplen; + dp = (const_efidp)((const char *)dp + dplen); + } + free(data); +} - dp = malloc(8192); - str = realloc(data, len + 1); - if (str == NULL || dp == NULL) - errx(1, "Can't allocate memory."); - str[len] = '\0'; - dplen = efidp_parse_device_path(str, dp, 8192); +static void +parse(void) +{ + char buffer[MAXSIZE]; + efidp dp; + ssize_t dplen; + char *walker; + + dplen = MAXSIZE; + dp = malloc(dplen); + if (dp == NULL) + errx(1, "Can't allocate memory."); + while (fgets(buffer, sizeof(buffer), stdin)) { + walker= trim(buffer); + dplen = efidp_parse_device_path(walker, dp, dplen); if (dplen == -1) - errx(1, "Can't parse %s", str); + errx(1, "Can't parse %s", walker); write(STDOUT_FILENO, dp, dplen); } + free(dp); +} + +int +main(int argc, char **argv) +{ + + parse_args(argc, argv); + if (flag_unix) + efi_to_unix(); + else if (flag_efi) + unix_to_efi(); + else if (flag_format) + format(); + else if (flag_parse) + parse(); } Modified: stable/11/usr.sbin/efivar/Makefile ============================================================================== --- stable/11/usr.sbin/efivar/Makefile Fri Apr 6 17:35:35 2018 (r332122) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 6 18:23:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DB14F9C258; Fri, 6 Apr 2018 18:23:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3DB36D249; Fri, 6 Apr 2018 18:23:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEAC31578C; Fri, 6 Apr 2018 18:23:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36INghU097020; Fri, 6 Apr 2018 18:23:42 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36INguo097017; Fri, 6 Apr 2018 18:23:42 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201804061823.w36INguo097017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 6 Apr 2018 18:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332125 - in stable/11/share: examples/etc mk X-SVN-Group: stable-11 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/11/share: examples/etc mk X-SVN-Commit-Revision: 332125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:23:43 -0000 Author: jkim Date: Fri Apr 6 18:23:42 2018 New Revision: 332125 URL: https://svnweb.freebsd.org/changeset/base/332125 Log: MFC: r314875, r331963 Catch up with Clang 6.0. Modified: stable/11/share/examples/etc/make.conf stable/11/share/mk/bsd.cpu.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/examples/etc/make.conf ============================================================================== --- stable/11/share/examples/etc/make.conf Fri Apr 6 18:16:14 2018 (r332124) +++ stable/11/share/examples/etc/make.conf Fri Apr 6 18:23:42 2018 (r332125) @@ -44,8 +44,9 @@ # if omitted), ultrasparc3 # Additionally the following CPU types are recognized by clang: # Intel x86 architecture (for both amd64 and i386): -# (AMD CPUs) bdver4, bdver3, bdver2, bdver1, btver2, btver1 -# (Intel CPUs) skylake, knl, broadwell, haswell, ivybridge, +# (AMD CPUs) znver1, bdver4, bdver3, bdver2, bdver1, btver2, btver1 +# (Intel CPUs) cannonlake, knm, skylake-avx512, knl, goldmont, +# skylake, broadwell, haswell, ivybridge, # sandybridge, westmere, nehalem, silvermont, bonnell # # (?= allows to buildworld for a different CPUTYPE.) Modified: stable/11/share/mk/bsd.cpu.mk ============================================================================== --- stable/11/share/mk/bsd.cpu.mk Fri Apr 6 18:16:14 2018 (r332124) +++ stable/11/share/mk/bsd.cpu.mk Fri Apr 6 18:23:42 2018 (r332125) @@ -173,7 +173,9 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} ########## i386 . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "bdver4" +. if ${CPUTYPE} == "znver1" +MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 +. elif ${CPUTYPE} == "bdver4" MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \ ${CPUTYPE} == "bdver1" @@ -200,14 +202,16 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586 MACHINE_CPU = mmx k6 k5 i586 . elif ${CPUTYPE} == "k5" MACHINE_CPU = k5 i586 -. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "knl" +. elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" +. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \ + ${CPUTYPE} == "haswell" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" || \ - ${CPUTYPE} == "silvermont" +. elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \ + ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 @@ -242,7 +246,9 @@ MACHINE_CPU = mmx MACHINE_CPU += i486 ########## amd64 . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "bdver4" +. if ${CPUTYPE} == "znver1" +MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 +. elif ${CPUTYPE} == "bdver4" MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 . elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \ ${CPUTYPE} == "bdver1" @@ -259,14 +265,16 @@ MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "knl" +. elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" +. elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \ + ${CPUTYPE} == "haswell" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" || \ - ${CPUTYPE} == "silvermont" +. elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \ + ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 From owner-svn-src-all@freebsd.org Fri Apr 6 18:25:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D831F9C3D6; Fri, 6 Apr 2018 18:25:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51F0A6D450; Fri, 6 Apr 2018 18:25:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CCD21578D; Fri, 6 Apr 2018 18:25:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36IP4kX097126; Fri, 6 Apr 2018 18:25:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36IP4TO097124; Fri, 6 Apr 2018 18:25:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061825.w36IP4TO097124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 18:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332126 - in stable/11/usr.sbin: . efibootmgr X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/usr.sbin: . efibootmgr X-SVN-Commit-Revision: 332126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:25:04 -0000 Author: kevans Date: Fri Apr 6 18:25:03 2018 New Revision: 332126 URL: https://svnweb.freebsd.org/changeset/base/332126 Log: MFC efibootmgr: r326725-r326728, r326771, r326800-r326804, r326806, r327163 r327572-r327573, r327610-r327611, r327877, r331069 r326725: Import Netflix's efibootmgr to help manage UEFI boot variables efibootmgr manages the UEFI BootXXXX variables that implement the UEFI Boot Manager protocol defined in the UEFI standards. It is modeled after the Linux program of the same name with a mostly compatible set of command line options. Since there's a fair amount of OS specifioc code due to differeing names and methods of doing things, the compatibility isn't 100%. Basic functionality is implemented, though the more advanced next boot functionality that's been defined elsewhere is unimplemented. Submitted by: Matt Williams (with unix / efi path xlate by me) Sponsored by: Netflix r326726: Forgotten in 326725 Release Notes: Yes r326727: Remove vestiges of -d and -p commands. Fix two core dumps when optional data isn't specified. Sponsored by: Netflix r326728: Indent multiple device path entries correctly. Sponsored by: Netflix r326771: Unbreak gcc build by using (void) for functions that take no args. Sponsored by: Netflix r326800: Check return value for set_bootvar and give a good error message. CID: 1383601 Sponsored by: Netflix r326801: Don't leak new_data. CID: 1383605 Sponsored by: Netflix r326802: Fix resource leak. Free converted description after printing it. Also minor style sort of local vars. CID: 1383606 Sponsored by: Netflix r326803: Free load_opt_buf after we're done with it. CID: 1383607 Sponsored by: Netflix r326804: Add sanity testing against maximum sane lengths for device paths for loader and kernel. CID: 1383608 Sponsored by: Netflix r326806: Actually insert the free(d) call missed in r326802. Noticed by: rpokala@ r327163: Remove write-only opt and useless optlen variables. This squashes the warning gebnerated by GCC 6.x. Since variables that are now removed had come documentation value, put relevant bits in comment, so they can be resurrected from there when actually needed. r327572: Ensure that we have a description string. When unspecified, default to "". Sponsored by: Netflix r327573: Free options before setting them. This will prevent us from leaking memory when we have multiple copies of the same option from being specified. Sponsored by: Netflix r327610: Fix usage strings. -d and -p were removed before this was committed to FreeBSD, but the strings weren't updated. Sponsored by: Netflix r327611: There's no need / benefit from deleting the variable before we set it. Sponsored by: Netflix r327877: Fix error in determining the next available boot slot. Sponsored by: Netflix r331069: Make not getting BootOrder a warning, not a fatal error when printing. Sponsored by: Netflix Relnotes: yes Added: stable/11/usr.sbin/efibootmgr/ - copied from r326728, head/usr.sbin/efibootmgr/ Modified: stable/11/usr.sbin/Makefile stable/11/usr.sbin/efibootmgr/efibootmgr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/Makefile ============================================================================== --- stable/11/usr.sbin/Makefile Fri Apr 6 18:23:42 2018 (r332125) +++ stable/11/usr.sbin/Makefile Fri Apr 6 18:25:03 2018 (r332126) @@ -126,7 +126,7 @@ SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_CXGBETOOL}+= cxgbetool SUBDIR.${MK_MLX5TOOL}+= mlx5tool SUBDIR.${MK_DIALOG}+= bsdconfig -SUBDIR.${MK_EFI}+= efivar efidp +SUBDIR.${MK_EFI}+= efivar efidp efibootmgr SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread Modified: stable/11/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sat Dec 9 07:44:00 2017 (r326728) +++ stable/11/usr.sbin/efibootmgr/efibootmgr.c Fri Apr 6 18:25:03 2018 (r332126) @@ -164,18 +164,17 @@ static int set_bootvar(const char *name, uint8_t *data, size_t size) { - efi_del_variable(EFI_GLOBAL_GUID, name); return efi_set_variable(EFI_GLOBAL_GUID, name, data, size, COMMON_ATTRS); } #define USAGE \ - " [-aAnNB Bootvar] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help] \n \ - [-c -d device -p partition -l loader [-L label] [--dry-run]]" + " [-aAnNB Bootvar] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help] \n\ + [-c -l loader [-k kernel ] [-L label] [--dry-run]]" #define CREATE_USAGE \ - " efibootmgr -c -d device -p partition -loader loader [-L label ] [--dry-run]" + " efibootmgr -c -l loader [-k kernel] [-L label] [--dry-run]" #define ORDER_USAGE \ " efibootmgr -o bootvarnum1,bootvarnum2,..." #define TIMEOUT_USAGE \ @@ -217,6 +216,7 @@ parse_args(int argc, char *argv[]) opts.dry_run = true; break; case 'e': + free(opts.env); opts.env = strdup(optarg); break; case 'h': @@ -224,12 +224,15 @@ parse_args(int argc, char *argv[]) errx(1, "%s", USAGE); break; case 'k': + free(opts.kernel); opts.kernel = strdup(optarg); break; case 'L': + free(opts.label); opts.label = strdup(optarg); break; case 'l': + free(opts.loader); opts.loader = strdup(optarg); opts.loader = mangle_loader(opts.loader); break; @@ -244,6 +247,7 @@ parse_args(int argc, char *argv[]) opts.once = true; break; case 'o': + free(opts.order); opts.order = strdup(optarg); break; case 'T': @@ -275,14 +279,16 @@ parse_args(int argc, char *argv[]) static void -print_order() +print_order(void) { uint32_t attrs; uint8_t *data; size_t size, i; - if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", &data, &size, &attrs) < 0) - errx(1, "Couldn't get value for BootOrder\n"); + if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", &data, &size, &attrs) < 0) { + printf("BootOrder : Couldn't get value for BootOrder\n"); + return; + } if (size % 2 == 1) errx(1, "Bad BootOrder variable: odd length"); @@ -361,6 +367,7 @@ set_boot_order(char *order) free(cp); if (set_bootvar("BootOrder", (uint8_t*)new_data, size) < 0) err(1, "Unabke to set BootOrder to %s", order); + free(new_data); } static void @@ -531,7 +538,7 @@ compare(const void *a, const void *b) } static char * -make_next_boot_var_name() +make_next_boot_var_name(void) { struct entry *v; uint16_t *vals, next_free = 0; @@ -558,7 +565,7 @@ make_next_boot_var_name() } else { /* now just run the list looking for the first hole */ for (i = 0; i < cnt - 1 && next_free == 0; i++) - if (vals[i] != vals[i + 1] + 1) + if (vals[i] + 1 != vals[i + 1]) next_free = vals[i] + 1; if (next_free == 0) next_free = vals[cnt - 1] + 1; @@ -590,12 +597,7 @@ create_loadopt(uint8_t *buf, size_t bufmax, uint32_t a /* * Compute the length to make sure the passed in buffer is long enough. */ - if (description) - utf8_to_ucs2(description, &bbuf, &desc_len); - else { - desc_len = 0; - bbuf = NULL; - } + utf8_to_ucs2(description, &bbuf, &desc_len); len = sizeof(uint32_t) + sizeof(uint16_t) + desc_len + dp_size + optional_data_size; if (len > bufmax) { free(bbuf); @@ -635,6 +637,8 @@ make_boot_var(const char *label, const char *loader, c char *bootvar = NULL; int ret; + assert(label != NULL); + bootvar = make_next_boot_var_name(); if (bootvar == NULL) err(1, "bootvar creation"); @@ -649,8 +653,14 @@ make_boot_var(const char *label, const char *loader, c kerneldp = NULL; } llen = efidp_size(loaderdp); + if (llen > MAX_DP_LEN) + errx(1, "Loader path too long."); klen = efidp_size(kerneldp); + if (klen > MAX_DP_LEN) + errx(1, "Kernel path too long."); dp = malloc(llen + klen); + if (dp == NULL) + errx(1, "Can't allocate memory for new device paths"); memcpy(dp, loaderdp, llen); if (kerneldp != NULL) memcpy((char *)dp + llen, kerneldp, klen); @@ -683,8 +693,9 @@ make_boot_var(const char *label, const char *loader, c new_ent->name = bootvar; new_ent->guid = EFI_GLOBAL_GUID; LIST_INSERT_HEAD(&efivars, new_ent, entries); - + free(load_opt_buf); free(dp); + return 0; } @@ -699,10 +710,8 @@ print_loadopt_str(uint8_t *data, size_t datalen) uint8_t *ep = data + datalen; uint8_t *walker = data; efidp dp, edp; - void *opt; char buf[1024]; int len; - int optlen; int rv; int indent; @@ -726,10 +735,11 @@ print_loadopt_str(uint8_t *data, size_t datalen) if (walker > ep) return; edp = (efidp)walker; - // Everything left is the binary option args - opt = walker; - optlen = ep - walker; - + /* + * Everything left is the binary option args + * opt = walker; + * optlen = ep - walker; + */ indent = 1; while (dp < edp) { efidp_format_device_path(buf, sizeof(buf), dp, @@ -745,12 +755,10 @@ print_loadopt_str(uint8_t *data, size_t datalen) } dp = (efidp)((char *)dp + efidp_size(dp)); } - if (optlen == 0) - return; } static char * -get_descr(uint8_t* data) +get_descr(uint8_t *data) { uint8_t *pos = data; efi_char *desc; @@ -782,9 +790,10 @@ print_boot_vars(bool verbose) * as a command epilogue */ struct entry *v; - uint32_t attrs, load_attrs; uint8_t *data; + char *d; size_t size; + uint32_t attrs, load_attrs; int ret; ret = efi_get_variable(EFI_GLOBAL_GUID, "BootNext", &data, &size, &attrs); @@ -811,9 +820,10 @@ print_boot_vars(bool verbose) if (ret < 0) continue; /* we must have deleted it */ load_attrs = le32dec(data); + d = get_descr(data); printf("%s%c %s", v->name, - ((load_attrs & LOAD_OPTION_ACTIVE) ? '*': ' '), - get_descr(data)); + ((load_attrs & LOAD_OPTION_ACTIVE) ? '*': ' '), d); + free(d); if (verbose) print_loadopt_str(data, size); else @@ -823,7 +833,7 @@ print_boot_vars(bool verbose) } static void -delete_timeout() +delete_timeout(void) { efi_del_variable(EFI_GLOBAL_GUID,"Timeout"); @@ -835,7 +845,8 @@ handle_timeout(int to) uint16_t timeout; le16enc(&timeout, to); - set_bootvar("Timeout", (uint8_t *)&timeout, sizeof(timeout)); + if (set_bootvar("Timeout", (uint8_t *)&timeout, sizeof(timeout)) < 0) + errx(1, "Can't set Timeout for booting."); } int @@ -853,8 +864,8 @@ main(int argc, char *argv[]) /* * side effect, adds to boot order, but not yet active. */ - make_boot_var(opts.label, opts.loader, opts.kernel, opts.env, - opts.dry_run); + make_boot_var(opts.label ? opts.label : "", + opts.loader, opts.kernel, opts.env, opts.dry_run); else if (opts.set_active || opts.set_inactive ) handle_activity(opts.bootnum, opts.set_active); else if (opts.order != NULL) From owner-svn-src-all@freebsd.org Fri Apr 6 18:30:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766B6F9CA76; Fri, 6 Apr 2018 18:30:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DB686D84A; Fri, 6 Apr 2018 18:30:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5EFEF10AFAE; Fri, 6 Apr 2018 14:30:16 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327954 - in head/sys: amd64/conf conf dev/acpica vm x86/acpica Date: Fri, 06 Apr 2018 11:18:10 -0700 Message-ID: <21787612.Ya3XE9VMiB@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <1522611345.49673.175.camel@freebsd.org> References: <201801140336.w0E3a3xv010728@repo.freebsd.org> <1522611345.49673.175.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Apr 2018 14:30:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 18:30:17 -0000 On Sunday, April 01, 2018 01:35:45 PM Ian Lepore wrote: > On Sun, 2018-01-14 at 03:36 +0000, Jeff Roberson wrote: > > Author: jeff > > Date: Sun Jan 14 03:36:03 2018 > > New Revision: 327954 > > URL: https://svnweb.freebsd.org/changeset/base/327954 > > > > Log: > > Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config > > option NUMA. > > > > Sponsored by: Netflix, Dell/EMC Isilon > > Discussed with: jhb > > It turns out this breaks building powerpc lint kernels. It shakes out > like this... makeLINT.mk copies sys/conf/NOTES into the generated LINT > config (I guess on the theory that things documented in NOTES are > supported by all arches). So option NUMA is present on powerpc, but the > powerpc vmparam.h doesn't define VM_LEVEL_0_ORDER so the build fails. > (Mips also doesn't define that, but it has no lint kernel build at all > right now.) > > It could be fixed in vm_domainset.c with: > > -#ifdef NUMA > +#if defined(NUMA) && defined(VM_LEVEL_0_ORDER) > > but there may be some better way to fix it, I don't know that much > about this stuff. Maybe add 'nooption NUMA' to sys/powerpc/conf/NOTES? (It has several nooption and nodevice lines already) If it affects more than powerpc then I wouldn't do that, but if it's only powerpc then I think patching powerpc/conf/NOTES is most consistent with how this has been handled to date. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 6 18:30:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F8EF9CA5C; Fri, 6 Apr 2018 18:30:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8C596D844; Fri, 6 Apr 2018 18:30:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id D77D110AFAD; Fri, 6 Apr 2018 14:30:14 -0400 (EDT) From: John Baldwin To: Ed Maste Cc: Mark Linimon , Dimitry Andric , Antoine Brodin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , re , svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... Date: Fri, 06 Apr 2018 11:24:53 -0700 Message-ID: <2526702.9M648BMneK@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201803311138.w2VBcKHP014025@repo.freebsd.org> <20180331184109.GA23589@lonesome.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Apr 2018 14:30:14 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 18:30:17 -0000 On Monday, April 02, 2018 12:27:47 PM Ed Maste wrote: > On 31 March 2018 at 14:41, Mark Linimon wrote: > This is the most important point of this discussion: we do need to > ensure there's good communication and coordination between teams where > dependencies like this exist. I'll take the blame here: Dimitry asked > me about merging the Clang update to stable/11 and I agreed that it > was reasonable to merge sooner rather than later to have as much lead > time as possible before the 11.2 process starts. I also assumed that > outstanding Clang 6 issues in ports were farther along in being > addressed. > > The key lesson from this discussion is that for significant commits > and merges like this one we should make sure to always have sufficient > advance notice. Is this driven by -mretpoline? That is, would we not be as aggressive with pushing for clang 6 in 11.2 if it weren't for that? I kind of feel like we probably wouldn't and would have left it at 5 and let clang 6 be a FreeBSD 12 thing. Was -mretpoline backported to clang 5 (I thought there was some talk of providing patches for clang 5)? -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 6 18:30:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 020A7F9CADA; Fri, 6 Apr 2018 18:30:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEA56D929; Fri, 6 Apr 2018 18:30:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 60E5F10AFCD; Fri, 6 Apr 2018 14:30:18 -0400 (EDT) From: John Baldwin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332090 - head/stand/i386 Date: Fri, 06 Apr 2018 10:54:11 -0700 Message-ID: <8352524.sDEuJtqkT0@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804060257.w362vwi3023158@repo.freebsd.org> References: <201804060257.w362vwi3023158@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Apr 2018 14:30:18 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 18:30:22 -0000 On Friday, April 06, 2018 02:57:58 AM Ed Maste wrote: > Author: emaste > Date: Fri Apr 6 02:57:58 2018 > New Revision: 332090 > URL: https://svnweb.freebsd.org/changeset/base/332090 > > Log: > stand: pass --no-rosegment for i386 bits when linking with lld > > btxld does not correctly handle input with other than 2 PT_LOAD > segments. Passing --no-rosegment lets lld produce output eqivalent to > ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO. > > PR: 225775 > MFC after: 3 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D14956 > > Modified: > head/stand/i386/Makefile.inc > > Modified: head/stand/i386/Makefile.inc > ============================================================================== > --- head/stand/i386/Makefile.inc Fri Apr 6 02:47:43 2018 (r332089) > +++ head/stand/i386/Makefile.inc Fri Apr 6 02:57:58 2018 (r332090) > @@ -2,8 +2,13 @@ > # > # $FreeBSD$ > > +.sinclude > + > LOADER_ADDRESS?=0x200000 > LDFLAGS+= -nostdlib > +.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld" > +LDFLAGS+= -Wl,--no-rosegment > +.endif Maybe we should support LDFLAGS.${LINKER_TYPE} as we do for CFLAGS, etc.? -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 6 18:37:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57073F9D608 for ; Fri, 6 Apr 2018 18:37:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAA276E436 for ; Fri, 6 Apr 2018 18:37:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id y128so2781055iod.4 for ; Fri, 06 Apr 2018 11:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9fu0V16jHz0Pt9l8dZpue/kBf6mtYa/J5hPWO0RMTrw=; b=rHFlEz89CMewHNX3qoi8fNOmy+Im4t+dllpxbBWaMkASskS0Uq6+UtvTLyJtfCExpO ao1qIRL4+zcwUZBk+NZP5eA8MX98Z2g+FcI37mhmXbD6AvqXOx6X97mGuePpQLq/dgm2 ar/eyIcz/jfaONahN8WSJulOTE2dDc95/SKy40oMQzOKxg4kbrnQ5vpPwCrH+4Geqaow qECzM/eyDDaJXLSvS3kPvGCFJs9d2uuE/RyjpolsV2lvFZoRvHqhENBOrdVpJS6fvG8z 0TZfdevv7nyw4zt4wyi6jBqvVBa6+7J2QChOpDbI/wsh07uKhcyGTckV8VGesBfNdgEl xtMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9fu0V16jHz0Pt9l8dZpue/kBf6mtYa/J5hPWO0RMTrw=; b=iqVY+5OUyA5YZ6Fd8bRxapMKb3Kro1VLtLHoNBKH8+IHtN/4SP38LidTDaAXaAe4P/ JXIHWQpwmVDtH1KzbXqgp06uXjKkf+9ZREp7y7X1gH+8nlEdBtpdULm36hbgDJ5gmnaW /MKisvXEUDaVJF9u4Jmaa2s/TYJe7Xnls55pv9jEqVZgzV/GOHqpvHJoXOEh3/EsOixs 41E+Geus27NGYrdLrQiwKQTPDd5KeF1TQ1udmUjcezzTuxvS8ENdZJGckX4LR0w2D1Pg JN64gPVRsRycrh39E846yHBQIADHRnZMl3NnOQpHeFrqw+l4dr191jTk/QDnY/qQOVLD NQRw== X-Gm-Message-State: ALQs6tB91L8ydujSUrpdn9skenyb29o4pNQlTz2UplkAX6vP1mi8b5XG eTwe73UyTNf2AtjFrWKJt5JkegV3YS5AGQUDab9RyQ== X-Google-Smtp-Source: AIpwx49hk2AY5b2II+yo+WLIeqeD1sk8q9HSdAee2oE/1X6giikYbKj4q0BEsNaNAiB+pemunRPA+I5QFzI1kDg83hM= X-Received: by 10.107.18.162 with SMTP id 34mr25119907ios.168.1523039820969; Fri, 06 Apr 2018 11:37:00 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Fri, 6 Apr 2018 11:37:00 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <8352524.sDEuJtqkT0@ralph.baldwin.cx> References: <201804060257.w362vwi3023158@repo.freebsd.org> <8352524.sDEuJtqkT0@ralph.baldwin.cx> From: Warner Losh Date: Fri, 6 Apr 2018 12:37:00 -0600 X-Google-Sender-Auth: 3LDF9k79Q64N-teCydZZh-e9E7s Message-ID: Subject: Re: svn commit: r332090 - head/stand/i386 To: John Baldwin Cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 18:37:02 -0000 On Fri, Apr 6, 2018 at 11:54 AM, John Baldwin wrote: > On Friday, April 06, 2018 02:57:58 AM Ed Maste wrote: > > Author: emaste > > Date: Fri Apr 6 02:57:58 2018 > > New Revision: 332090 > > URL: https://svnweb.freebsd.org/changeset/base/332090 > > > > Log: > > stand: pass --no-rosegment for i386 bits when linking with lld > > > > btxld does not correctly handle input with other than 2 PT_LOAD > > segments. Passing --no-rosegment lets lld produce output eqivalent to > > ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO. > > > > PR: 225775 > > MFC after: 3 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D14956 > > > > Modified: > > head/stand/i386/Makefile.inc > > > > Modified: head/stand/i386/Makefile.inc > > ============================================================ > ================== > > --- head/stand/i386/Makefile.inc Fri Apr 6 02:47:43 2018 > (r332089) > > +++ head/stand/i386/Makefile.inc Fri Apr 6 02:57:58 2018 > (r332090) > > @@ -2,8 +2,13 @@ > > # > > # $FreeBSD$ > > > > +.sinclude > > + > > LOADER_ADDRESS?=0x200000 > > LDFLAGS+= -nostdlib > > +.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld" > > +LDFLAGS+= -Wl,--no-rosegment > > +.endif > > Maybe we should support LDFLAGS.${LINKER_TYPE} as we do for CFLAGS, etc.? > I concur. It doesn't take too many of these for that to pay off big time, especially if we have to do anything globally... Warner From owner-svn-src-all@freebsd.org Fri Apr 6 18:38:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B8EF9D828; Fri, 6 Apr 2018 18:38:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC71B6E631; Fri, 6 Apr 2018 18:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D34CE15937; Fri, 6 Apr 2018 18:38:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36IcPUK002269; Fri, 6 Apr 2018 18:38:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36IcPql002265; Fri, 6 Apr 2018 18:38:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061838.w36IcPql002265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 18:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332127 - in stable/11/stand/efi: include libefi loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/efi: include libefi loader X-SVN-Commit-Revision: 332127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:38:26 -0000 Author: kevans Date: Fri Apr 6 18:38:25 2018 New Revision: 332127 URL: https://svnweb.freebsd.org/changeset/base/332127 Log: MFC r329268, r329517 r329268: efi: Only scan the BLKIO MEDIA once Scan only the BLOCK IO MEDIA once instead of each time for each type of device (fd, cd and hdd). Leave the mechanism to free and reprobe all devices if one day we want to implement a "dev rescan" thing. r329517: efi: Do not pad the efi devpath structure This solve problem when booting with efi on armv7 Modified: stable/11/stand/efi/include/efidevp.h stable/11/stand/efi/include/efilib.h stable/11/stand/efi/libefi/efipart.c stable/11/stand/efi/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/include/efidevp.h ============================================================================== --- stable/11/stand/efi/include/efidevp.h Fri Apr 6 18:25:03 2018 (r332126) +++ stable/11/stand/efi/include/efidevp.h Fri Apr 6 18:38:25 2018 (r332127) @@ -31,6 +31,8 @@ Revision History // Device Path structures - Section C // +#pragma pack(1) + typedef struct _EFI_DEVICE_PATH { UINT8 Type; UINT8 SubType; @@ -450,5 +452,7 @@ typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL { EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText; EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText; } EFI_DEVICE_PATH_TO_TEXT_PROTOCOL; + +#pragma pack() #endif Modified: stable/11/stand/efi/include/efilib.h ============================================================================== --- stable/11/stand/efi/include/efilib.h Fri Apr 6 18:25:03 2018 (r332126) +++ stable/11/stand/efi/include/efilib.h Fri Apr 6 18:38:25 2018 (r332127) @@ -106,4 +106,7 @@ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); void cpy16to8(const CHAR16 *, char *, size_t); +/* efipart.c */ +int efipart_inithandles(void); + #endif /* _LOADER_EFILIB_H */ Modified: stable/11/stand/efi/libefi/efipart.c ============================================================================== --- stable/11/stand/efi/libefi/efipart.c Fri Apr 6 18:25:03 2018 (r332126) +++ stable/11/stand/efi/libefi/efipart.c Fri Apr 6 18:38:25 2018 (r332127) @@ -148,7 +148,7 @@ efiblk_pdinfo_count(pdinfo_list_t *pdi) return (i); } -static int +int efipart_inithandles(void) { UINTN sz; @@ -176,6 +176,10 @@ efipart_inithandles(void) efipart_handles = hin; efipart_nhandles = sz; +#ifdef EFIPART_DEBUG + printf("%s: Got %d BLOCK IO MEDIA handle(s)\n", __func__, + efipart_nhandles); +#endif return (0); } @@ -319,11 +323,7 @@ efipart_updatefd(void) static int efipart_initfd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&fdinfo); efipart_updatefd(); @@ -439,11 +439,7 @@ efipart_updatecd(void) static int efipart_initcd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&cdinfo); efipart_updatecd(); @@ -685,11 +681,7 @@ efipart_updatehd(void) static int efipart_inithd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&hdinfo); efipart_updatehd(); Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Fri Apr 6 18:25:03 2018 (r332126) +++ stable/11/stand/efi/loader/main.c Fri Apr 6 18:38:25 2018 (r332127) @@ -456,11 +456,15 @@ main(int argc, CHAR16 *argv[]) } /* - * March through the device switch probing for things. + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); + if ((i = efipart_inithandles()) == 0) { + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + } else + printf("efipart_inithandles failed %d, expect failures", i); printf("Command line arguments:"); for (i = 0; i < argc; i++) From owner-svn-src-all@freebsd.org Fri Apr 6 18:40:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CADD6F9DAE0; Fri, 6 Apr 2018 18:40:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB416E86B; Fri, 6 Apr 2018 18:40:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 738BD1593C; Fri, 6 Apr 2018 18:40:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36IePBr002425; Fri, 6 Apr 2018 18:40:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36IeOwc002415; Fri, 6 Apr 2018 18:40:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061840.w36IeOwc002415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 18:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332128 - in stable/11/stand: . common efi/libefi efi/loader i386/loader sparc64/loader userboot/userboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . common efi/libefi efi/loader i386/loader sparc64/loader userboot/userboot X-SVN-Commit-Revision: 332128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:40:26 -0000 Author: kevans Date: Fri Apr 6 18:40:24 2018 New Revision: 332128 URL: https://svnweb.freebsd.org/changeset/base/332128 Log: MFC r329725, r329831 r329725: Consolidate three copies of ZFS commands into a central location. There's no reason to have multiple copies of lszfs and reloadbe. Consolidate them into one location. Also ldi_get_size is the same everywhere (except sparc64). Make it the same everywhere as the common definition is more general and will work on spar64. r329831: Fix userboot w/ ZFS after r329725 r329725 cleaned up ZFS commands duplicated in multiple places, but userboot was not setting HAVE_ZFS when MK_ZFS != "no". This resulted in a failure to boot (as seen in PR 226118) in bhyve, with the following message: /boot/userboot.so: Undefined symbol "ldi_get_size" Added: stable/11/stand/common/zfs_cmd.c - copied unchanged from r329725, head/stand/common/zfs_cmd.c Modified: stable/11/stand/efi/libefi/efizfs.c stable/11/stand/efi/loader/Makefile stable/11/stand/efi/loader/main.c stable/11/stand/i386/loader/main.c stable/11/stand/loader.mk stable/11/stand/sparc64/loader/Makefile stable/11/stand/sparc64/loader/main.c stable/11/stand/userboot/userboot/Makefile stable/11/stand/userboot/userboot/main.c Directory Properties: stable/11/ (props changed) Copied: stable/11/stand/common/zfs_cmd.c (from r329725, head/stand/common/zfs_cmd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/common/zfs_cmd.c Fri Apr 6 18:40:24 2018 (r332128, copy of r329725, head/stand/common/zfs_cmd.c) @@ -0,0 +1,108 @@ +/*- + * Copyright (c) 2018 Warner Losh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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$"); + +/* + * MD bootstrap main() and assorted miscellaneous + * commands. + */ + +#include +#include +#include +#include + +#include "bootstrap.h" + +#ifdef LOADER_ZFS_SUPPORT +#include "../zfs/libzfs.h" +#endif + +COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", + command_lszfs); + +static int +command_lszfs(int argc, char *argv[]) +{ + int err; + + if (argc != 2) { + command_errmsg = "a single dataset must be supplied"; + return (CMD_ERROR); + } + + err = zfs_list(argv[1]); + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + return (CMD_OK); +} + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + char *root; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + /* There does not appear to be a ZFS pool here, exit without error */ + return (CMD_OK); + } + err = zfs_bootenv(root); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + + return (CMD_OK); +} + +uint64_t +ldi_get_size(void *priv) +{ + int fd = (uintptr_t) priv; + uint64_t size; + + ioctl(fd, DIOCGMEDIASIZE, &size); + return (size); +} Modified: stable/11/stand/efi/libefi/efizfs.c ============================================================================== --- stable/11/stand/efi/libefi/efizfs.c Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/efi/libefi/efizfs.c Fri Apr 6 18:40:24 2018 (r332128) @@ -109,14 +109,4 @@ efi_zfs_probe(void) } } } - -uint64_t -ldi_get_size(void *priv) -{ - int fd = (uintptr_t) priv; - uint64_t size; - - ioctl(fd, DIOCGMEDIASIZE, &size); - return (size); -} #endif Modified: stable/11/stand/efi/loader/Makefile ============================================================================== --- stable/11/stand/efi/loader/Makefile Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/efi/loader/Makefile Fri Apr 6 18:40:24 2018 (r332128) @@ -28,6 +28,7 @@ SRCS= autoload.c \ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT +HAVE_ZFS= yes .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/efi/loader/main.c Fri Apr 6 18:40:24 2018 (r332128) @@ -747,61 +747,6 @@ command_mode(int argc, char *argv[]) return (CMD_OK); } -#ifdef EFI_ZFS_BOOT -COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", - command_lszfs); - -static int -command_lszfs(int argc, char *argv[]) -{ - int err; - - if (argc != 2) { - command_errmsg = "wrong number of arguments"; - return (CMD_ERROR); - } - - err = zfs_list(argv[1]); - if (err != 0) { - command_errmsg = strerror(err); - return (CMD_ERROR); - } - return (CMD_OK); -} - -COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", - command_reloadbe); - -static int -command_reloadbe(int argc, char *argv[]) -{ - int err; - char *root; - - if (argc > 2) { - command_errmsg = "wrong number of arguments"; - return (CMD_ERROR); - } - - if (argc == 2) { - err = zfs_bootenv(argv[1]); - } else { - root = getenv("zfs_be_root"); - if (root == NULL) { - return (CMD_OK); - } - err = zfs_bootenv(root); - } - - if (err != 0) { - command_errmsg = strerror(err); - return (CMD_ERROR); - } - - return (CMD_OK); -} -#endif - #ifdef LOADER_FDT_SUPPORT extern int command_fdt_internal(int argc, char *argv[]); Modified: stable/11/stand/i386/loader/main.c ============================================================================== --- stable/11/stand/i386/loader/main.c Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/i386/loader/main.c Fri Apr 6 18:40:24 2018 (r332128) @@ -374,63 +374,6 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -#ifdef LOADER_ZFS_SUPPORT -COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", - command_lszfs); - -static int -command_lszfs(int argc, char *argv[]) -{ - int err; - - if (argc != 2) { - command_errmsg = "wrong number of arguments"; - return (CMD_ERROR); - } - - err = zfs_list(argv[1]); - if (err != 0) { - command_errmsg = strerror(err); - return (CMD_ERROR); - } - - return (CMD_OK); -} - -COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", - command_reloadbe); - -static int -command_reloadbe(int argc, char *argv[]) -{ - int err; - char *root; - - if (argc > 2) { - command_errmsg = "wrong number of arguments"; - return (CMD_ERROR); - } - - if (argc == 2) { - err = zfs_bootenv(argv[1]); - } else { - root = getenv("zfs_be_root"); - if (root == NULL) { - /* There does not appear to be a ZFS pool here, exit without error */ - return (CMD_OK); - } - err = zfs_bootenv(root); - } - - if (err != 0) { - command_errmsg = strerror(err); - return (CMD_ERROR); - } - - return (CMD_OK); -} -#endif - /* ISA bus access functions for PnP. */ static int isa_inb(int port) @@ -463,15 +406,5 @@ i386_zfs_probe(void) sprintf(devname, "disk%d:", unit); zfs_probe_dev(devname, NULL); } -} - -uint64_t -ldi_get_size(void *priv) -{ - int fd = (uintptr_t) priv; - uint64_t size; - - ioctl(fd, DIOCGMEDIASIZE, &size); - return (size); } #endif Modified: stable/11/stand/loader.mk ============================================================================== --- stable/11/stand/loader.mk Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/loader.mk Fri Apr 6 18:40:24 2018 (r332128) @@ -121,7 +121,8 @@ CFLAGS+= -DLOADER_MBR_SUPPORT CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs -.if ${MACHINE} == "amd64" +SRCS+= zfs_cmd.c +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 # Have to override to use 32-bit version of zfs library... # kinda lame to select that there XXX LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a Modified: stable/11/stand/sparc64/loader/Makefile ============================================================================== --- stable/11/stand/sparc64/loader/Makefile Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/sparc64/loader/Makefile Fri Apr 6 18:40:24 2018 (r332128) @@ -19,6 +19,10 @@ NEWVERSWHAT?= "bootstrap loader" sparc64 VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b +.if ${MK_ZFS} != "no" +HAVE_ZFS= yes +.endif + # Architecture-specific loader code .PATH: ${BOOTSRC}/sparc64/loader SRCS= locore.S main.c metadata.c vers.c Modified: stable/11/stand/sparc64/loader/main.c ============================================================================== --- stable/11/stand/sparc64/loader/main.c Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/sparc64/loader/main.c Fri Apr 6 18:40:24 2018 (r332128) @@ -735,15 +735,6 @@ tlb_init_sun4u(void) #ifdef LOADER_ZFS_SUPPORT -/* Set by sparc64_zfs_probe to provide partition size. */ -static size_t part_size; - -uint64_t -ldi_get_size(void *priv __unused) -{ - return ((uint64_t)part_size); -} - static void sparc64_zfs_probe(void) { @@ -799,7 +790,6 @@ sparc64_zfs_probe(void) if (part == 2 || vtoc.part[part].tag != VTOC_TAG_FREEBSD_ZFS) continue; - part_size = vtoc.map[part].nblks; (void)sprintf(devname, "%s:%c", alias, part + 'a'); /* Get the GUID of the ZFS pool on the boot device. */ if (strcmp(devname, bootpath) == 0) @@ -948,7 +938,7 @@ static const char *const page_sizes[] = { static void pmap_print_tte_sun4u(tte_t tag, tte_t tte) -{ + printf("%s %s ", page_sizes[(tte >> TD_SIZE_SHIFT) & TD_SIZE_MASK], Modified: stable/11/stand/userboot/userboot/Makefile ============================================================================== --- stable/11/stand/userboot/userboot/Makefile Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/userboot/userboot/Makefile Fri Apr 6 18:40:24 2018 (r332128) @@ -42,6 +42,7 @@ NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a +HAVE_ZFS=yes .endif # Always add MI sources Modified: stable/11/stand/userboot/userboot/main.c ============================================================================== --- stable/11/stand/userboot/userboot/main.c Fri Apr 6 18:38:25 2018 (r332127) +++ stable/11/stand/userboot/userboot/main.c Fri Apr 6 18:40:24 2018 (r332128) @@ -218,70 +218,7 @@ userboot_zfs_probe(void) userboot_zfs_found = 1; } } - -COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", - command_lszfs); - -static int -command_lszfs(int argc, char *argv[]) -{ - int err; - - if (argc != 2) { - command_errmsg = "a single dataset must be supplied"; - return (CMD_ERROR); - } - - err = zfs_list(argv[1]); - if (err != 0) { - command_errmsg = strerror(err); - return (CMD_ERROR); - } - return (CMD_OK); -} - -COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", - command_reloadbe); - -static int -command_reloadbe(int argc, char *argv[]) -{ - int err; - char *root; - - if (argc > 2) { - command_errmsg = "wrong number of arguments"; - return (CMD_ERROR); - } - - if (argc == 2) { - err = zfs_bootenv(argv[1]); - } else { - root = getenv("zfs_be_root"); - if (root == NULL) { - return (CMD_OK); - } - err = zfs_bootenv(root); - } - - if (err != 0) { - command_errmsg = strerror(err); - return (CMD_ERROR); - } - - return (CMD_OK); -} - -uint64_t -ldi_get_size(void *priv) -{ - int fd = (uintptr_t) priv; - uint64_t size; - - ioctl(fd, DIOCGMEDIASIZE, &size); - return (size); -} -#endif /* USERBOOT_ZFS_SUPPORT */ +#endif COMMAND_SET(quit, "quit", "exit the loader", command_quit); From owner-svn-src-all@freebsd.org Fri Apr 6 18:48:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A9EEF9E401; Fri, 6 Apr 2018 18:48:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 300E26EF79; Fri, 6 Apr 2018 18:48:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10FFA15ADF; Fri, 6 Apr 2018 18:48:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36ImAnn007419; Fri, 6 Apr 2018 18:48:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36ImAu5007418; Fri, 6 Apr 2018 18:48:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061848.w36ImAu5007418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 18:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332129 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 332129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:48:11 -0000 Author: kevans Date: Fri Apr 6 18:48:10 2018 New Revision: 332129 URL: https://svnweb.freebsd.org/changeset/base/332129 Log: Record-only MFC of r329269 and r329418 r329269 was a style(9) cleanup that had a functional side-effect. r329418 reverted it while benno regrouped to fight the forces of evil. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Fri Apr 6 18:55:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE41F9EC5A; Fri, 6 Apr 2018 18:55:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C46B26F637; Fri, 6 Apr 2018 18:55:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF12B15C7F; Fri, 6 Apr 2018 18:55:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36It2l8012327; Fri, 6 Apr 2018 18:55:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36It2j5012324; Fri, 6 Apr 2018 18:55:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061855.w36It2j5012324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 18:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332130 - in stable/11/stand/i386: boot2 loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/i386: boot2 loader X-SVN-Commit-Revision: 332130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 18:55:03 -0000 Author: kevans Date: Fri Apr 6 18:55:02 2018 New Revision: 332130 URL: https://svnweb.freebsd.org/changeset/base/332130 Log: MFC r329726, r329737, r329740 r329726: Honor settings for including / excluding cd9660, ufs, ext2fs and msdos. The Makefile gives the impression that ext2fs and msdos were excluded (they weren't) and that you could exclude cd9660 and ufs support (you couldn't). Allow those to be excluded. We need to look, in the future, at trimming the number of supported filesystems, and this will make that easier. r329737: Purely whitespace changes bringing this file closer to style(9). Curiously, changing whitespace seems to cause the md5 of the .o files to differ these days hence the following testing strategy: Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6) r329740: Further style(9) changes. Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6) Modified: stable/11/stand/i386/boot2/boot2.c stable/11/stand/i386/loader/Makefile stable/11/stand/i386/loader/conf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/boot2/boot2.c ============================================================================== --- stable/11/stand/i386/boot2/boot2.c Fri Apr 6 18:48:10 2018 (r332129) +++ stable/11/stand/i386/boot2/boot2.c Fri Apr 6 18:55:02 2018 (r332130) @@ -72,33 +72,33 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static struct dsk { - unsigned drive; - unsigned type; - unsigned unit; - uint8_t slice; - uint8_t part; - unsigned start; - int init; + unsigned drive; + unsigned type; + unsigned unit; + uint8_t slice; + uint8_t part; + unsigned start; + int init; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -126,18 +126,22 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { - const char *s = src; - char *d = dst; + const char *s; + char *d; - while (len--) - *d++ = *s++; + s = src; + d = dst; + + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; + + for (; *s1 == *s2 && *s1; s1++, s2++); + return ((unsigned char)*s1 - (unsigned char)*s2); } #define UFS_SMALL_CGBASE @@ -146,501 +150,513 @@ strcmp(const char *s1, const char *s2) static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return -1; - } - return 0; + + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return (-1); + } + return (0); } static inline void getstr(void) { - char *s; - int c; + char *s; + int c; - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } } - } } static inline void putc(int c) { - v86.addr = 0x10; - v86.eax = 0xe00 | (c & 0xff); - v86.ebx = 0x7; - v86int(); + + v86.addr = 0x10; + v86.eax = 0xe00 | (c & 0xff); + v86.ebx = 0x7; + v86int(); } int main(void) { - uint8_t autoboot; - ufs_ino_t ino; - size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.drive = *(uint8_t *)PTOV(ARGS); - dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; - dsk.unit = dsk.drive & DRV_MASK; - dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.drive = *(uint8_t *)PTOV(ARGS); + dsk.type = dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; + dsk.unit = dsk.drive & DRV_MASK; + dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - nbyte = fsread(ino, cmd, sizeof(cmd) - 1); - cmd[nbyte] = '\0'; - } + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ - if (!kname) { - kname = PATH_LOADER; - if (autoboot && !keyhit(3*SECOND)) { - load(); - kname = PATH_KERNEL; + if (!kname) { + kname = PATH_LOADER; + if (autoboot && !keyhit(3*SECOND)) { + load(); + kname = PATH_KERNEL; + } } - } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/x86 boot\n" - "Default: %u:%s(%u,%c)%s\n" - "boot: ", - dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - 'a' + dsk.part, kname); - if (DO_SIO) - sio_flush(); - if (!autoboot || keyhit(3*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/x86 boot\n" + "Default: %u:%s(%u,%c)%s\n" + "boot: ", + dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, + 'a' + dsk.part, kname); + if (DO_SIO) + sio_flush(); + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ void exit(int x) { + } static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int k; - uint8_t i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr; + int k; + uint8_t i, j; - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); - return; - } - if (xfsread(ino, &hdr, sizeof(hdr))) - return; - - if (N_GETMAGIC(hdr.ex) == ZMAGIC) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - } else if (IS_ELF(hdr.eh)) { - fs_off = hdr.eh.e_phoff; - for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); return; - if (ep[j].p_type == PT_LOAD) - j++; } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) + if (xfsread(ino, &hdr, sizeof(hdr))) return; - } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + } else if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } + addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); return; - for (i = 0; i < 2; i++) { - *(Elf32_Word *)p = es[i].sh_size; - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } } - addr = hdr.eh.e_entry & 0xffffff; - bootinfo.bi_esymtab = VTOP(p); - } else { - printf("Invalid %s\n", "format"); - return; - } - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), - 0, 0, 0, VTOP(&bootinfo)); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), + 0, 0, 0, VTOP(&bootinfo)); } static int parse() { - char *arg = cmd; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; - size_t k; + char *arg, *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; + size_t k; - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; + arg = cmd; + + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | + OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; #if SERIAL - } else if (c == 'S') { - j = 0; - while ((unsigned int)(i = *arg++ - '0') <= 9) - j = j * 10 + i; - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* Fall through to error below ('S' not in optstr[]). */ + } else if (c == 'S') { + j = 0; + while ((u_int)(i = *arg++ - '0') <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* + * Fall through to error below + * ('S' not in optstr[]). + */ #endif - } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return (-1); + opts ^= OPT_SET(flags[i]); + } #if SERIAL - ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (DO_SIO) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (DO_SIO) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } #endif - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; + } + if (q - arg != 2) + return (-1); + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return (-1); + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != ',' || dsk.unit > 9) + return (-1); + arg += 2; + dsk.slice = WHOLE_DISK_SLICE; + if (arg[1] == ',') { + dsk.slice = *arg - '0' + 1; + if (dsk.slice > NDOSPART + 1) + return (-1); + arg += 2; + } + if (arg[1] != ')') + return (-1); + dsk.part = *arg - 'a'; + if (dsk.part > 7) + return (-1); + arg += 2; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + dsk_meta = 0; + } + k = ep - arg; + if (k > 0) { + if (k >= sizeof(knamebuf)) + return (-1); + memcpy(knamebuf, arg, k + 1); + kname = knamebuf; + } } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return -1; - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) - return -1; - arg += 2; - dsk.slice = WHOLE_DISK_SLICE; - if (arg[1] == ',') { - dsk.slice = *arg - '0' + 1; - if (dsk.slice > NDOSPART + 1) - return -1; - arg += 2; - } - if (arg[1] != ')') - return -1; - dsk.part = *arg - 'a'; - if (dsk.part > 7) - return (-1); - arg += 2; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - dsk_meta = 0; - } - k = ep - arg; - if (k > 0) { - if (k >= sizeof(knamebuf)) - return -1; - memcpy(knamebuf, arg, k + 1); - kname = knamebuf; - } + arg = p; } - arg = p; - } - return 0; + return (0); } static int dskread(void *buf, unsigned lba, unsigned nblk) { - struct dos_partition *dp; - struct disklabel *d; - char *sec; - unsigned i; - uint8_t sl; - const char *reason; + struct dos_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + const char *reason; - if (!dsk_meta) { - sec = dmadat->secbuf; - dsk.start = 0; - if (drvread(sec, DOSBBSECTOR, 1)) - return -1; - dp = (void *)(sec + DOSPARTOFF); - sl = dsk.slice; - if (sl < BASE_SLICE) { - for (i = 0; i < NDOSPART; i++) - if (dp[i].dp_typ == DOSPTYP_386BSD && - (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { - sl = BASE_SLICE + i; - if (dp[i].dp_flag & 0x80 || - dsk.slice == COMPATIBILITY_SLICE) - break; + if (!dsk_meta) { + sec = dmadat->secbuf; + dsk.start = 0; + if (drvread(sec, DOSBBSECTOR, 1)) + return (-1); + dp = (void *)(sec + DOSPARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < NDOSPART; i++) + if (dp[i].dp_typ == DOSPTYP_386BSD && + (dp[i].dp_flag & 0x80 || sl < BASE_SLICE)) { + sl = BASE_SLICE + i; + if (dp[i].dp_flag & 0x80 || + dsk.slice == COMPATIBILITY_SLICE) + break; + } + if (dsk.slice == WHOLE_DISK_SLICE) + dsk.slice = sl; } - if (dsk.slice == WHOLE_DISK_SLICE) - dsk.slice = sl; + if (sl != WHOLE_DISK_SLICE) { + if (sl != COMPATIBILITY_SLICE) + dp += sl - BASE_SLICE; + if (dp->dp_typ != DOSPTYP_386BSD) { + reason = "slice"; + goto error; + } + dsk.start = dp->dp_start; + } + if (drvread(sec, dsk.start + LABELSECTOR, 1)) + return (-1); + d = (void *)(sec + LABELOFFSET); + if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { + if (dsk.part != RAW_PART) { + reason = "label"; + goto error; + } + } else { + if (!dsk.init) { + if (d->d_type == DTYPE_SCSI) + dsk.type = TYPE_DA; + dsk.init++; + } + if (dsk.part >= d->d_npartitions || + !d->d_partitions[dsk.part].p_size) { + reason = "partition"; + goto error; + } + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; + } } - if (sl != WHOLE_DISK_SLICE) { - if (sl != COMPATIBILITY_SLICE) - dp += sl - BASE_SLICE; - if (dp->dp_typ != DOSPTYP_386BSD) { - reason = "slice"; - goto error; - } - dsk.start = dp->dp_start; - } - if (drvread(sec, dsk.start + LABELSECTOR, 1)) - return -1; - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - if (dsk.part != RAW_PART) { - reason = "label"; - goto error; - } - } else { - if (!dsk.init) { - if (d->d_type == DTYPE_SCSI) - dsk.type = TYPE_DA; - dsk.init++; - } - if (dsk.part >= d->d_npartitions || - !d->d_partitions[dsk.part].p_size) { - reason = "partition"; - goto error; - } - dsk.start += d->d_partitions[dsk.part].p_offset; - dsk.start -= d->d_partitions[RAW_PART].p_offset; - } - } - return drvread(buf, dsk.start + lba, nblk); + return (drvread(buf, dsk.start + lba, nblk)); error: - printf("Invalid %s\n", reason); - return -1; + printf("Invalid %s\n", reason); + return (-1); } static void printf(const char *fmt,...) { - va_list ap; - static char buf[10]; - char *s; - unsigned u; - int c; + va_list ap; + static char buf[10]; + char *s; + unsigned u; + int c; - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } + va_start(ap, fmt); + while ((c = *fmt++)) { + if (c == '%') { + c = *fmt++; + switch (c) { + case 'c': + putchar(va_arg(ap, int)); + continue; + case 's': + for (s = va_arg(ap, char *); *s; s++) + putchar(*s); + continue; + case 'u': + u = va_arg(ap, unsigned); + s = buf; + do + *s++ = '0' + u % 10U; + while (u /= 10U); + while (--s >= buf) + putchar(*s); + continue; + } + } + putchar(c); } - putchar(c); - } - va_end(ap); - return; + va_end(ap); + return; } static void putchar(int c) { - if (c == '\n') - xputc('\r'); - xputc(c); + + if (c == '\n') + xputc('\r'); + xputc(c); } static int drvread(void *buf, unsigned lba, unsigned nblk) { - static unsigned c = 0x2d5c7c2f; + static unsigned c = 0x2d5c7c2f; - if (!OPT_CHECK(RBX_QUIET)) { - xputc(c = c << 8 | c >> 24); - xputc('\b'); - } - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = XREADORG; /* call to xread in boot1 */ - v86.es = VTOPSEG(buf); - v86.eax = lba; - v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; - v86.edx = nblk << 8 | dsk.drive; - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); - return -1; - } - return 0; + if (!OPT_CHECK(RBX_QUIET)) { + xputc(c = c << 8 | c >> 24); + xputc('\b'); + } + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = XREADORG; /* call to xread in boot1 */ + v86.es = VTOPSEG(buf); + v86.eax = lba; + v86.ebx = VTOPOFF(buf); + v86.ecx = lba >> 16; + v86.edx = nblk << 8 | dsk.drive; + v86int(); + v86.ctl = V86_FLAGS; + if (V86_CY(v86.efl)) { + printf("error %u lba %u\n", v86.eax >> 8 & 0xff, lba); + return (-1); + } + return (0); } static int keyhit(unsigned ticks) { - uint32_t t0, t1; + uint32_t t0, t1; - if (OPT_CHECK(RBX_NOINTR)) - return 0; - t0 = 0; - for (;;) { - if (xgetc(1)) - return 1; - t1 = *(uint32_t *)PTOV(0x46c); - if (!t0) - t0 = t1; - if ((uint32_t)(t1 - t0) >= ticks) - return 0; - } + if (OPT_CHECK(RBX_NOINTR)) + return (0); + t0 = 0; + for (;;) { + if (xgetc(1)) + return (1); + t1 = *(uint32_t *)PTOV(0x46c); + if (!t0) + t0 = t1; + if ((uint32_t)(t1 - t0) >= ticks) + return (0); + } } static int xputc(int c) { - if (DO_KBD) - putc(c); - if (DO_SIO) - sio_putc(c); - return c; + + if (DO_KBD) + putc(c); + if (DO_SIO) + sio_putc(c); + return (c); } static int getc(int fn) { - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); + + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return (fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl)); } static int xgetc(int fn) { - if (OPT_CHECK(RBX_NOINTR)) - return 0; - for (;;) { - if (DO_KBD && getc(1)) - return fn ? 1 : getc(0); - if (DO_SIO && sio_ischar()) - return fn ? 1 : sio_getc(); - if (fn) - return 0; - } + + if (OPT_CHECK(RBX_NOINTR)) + return (0); + for (;;) { + if (DO_KBD && getc(1)) + return (fn ? 1 : getc(0)); + if (DO_SIO && sio_ischar()) + return (fn ? 1 : sio_getc()); + if (fn) + return (0); + } } Modified: stable/11/stand/i386/loader/Makefile ============================================================================== --- stable/11/stand/i386/loader/Makefile Fri Apr 6 18:48:10 2018 (r332129) +++ stable/11/stand/i386/loader/Makefile Fri Apr 6 18:55:02 2018 (r332130) @@ -5,9 +5,9 @@ HAVE_GELI= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 6 19:01:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D20F9F405; Fri, 6 Apr 2018 19:01:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E953E6FD17; Fri, 6 Apr 2018 19:01:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E41C015DD2; Fri, 6 Apr 2018 19:01:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36J19LV015747; Fri, 6 Apr 2018 19:01:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36J18td015737; Fri, 6 Apr 2018 19:01:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061901.w36J18td015737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332131 - in stable/11: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: share/mk stand stand/fdt stand/ficl stand/geli stand/libsa stand/mips/uboot stand/uboot/fdt stand/uboot/lib stand/zfs X-SVN-Commit-Revision: 332131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:01:10 -0000 Author: kevans Date: Fri Apr 6 19:01:08 2018 New Revision: 332131 URL: https://svnweb.freebsd.org/changeset/base/332131 Log: MFC r329345: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC for the toolchain to be added (bogusly) when building on amd64. Pull all relevant defs back into defs.mk and delete bsd.stand.mk. This saves about 15-20k on i386 loader and zfsloader which when combined with Lua give us a lot more stack space in those constrained environments. Deleted: stable/11/share/mk/bsd.stand.mk Modified: stable/11/stand/defs.mk stable/11/stand/fdt/Makefile stable/11/stand/ficl/Makefile stable/11/stand/geli/Makefile stable/11/stand/libsa/Makefile stable/11/stand/mips/uboot/Makefile stable/11/stand/uboot/fdt/Makefile stable/11/stand/uboot/lib/Makefile stable/11/stand/zfs/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/defs.mk Fri Apr 6 19:01:08 2018 (r332131) @@ -99,8 +99,10 @@ SSP_CFLAGS= # currently has no /boot/loader, but may soon. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.elif ${MACHINE_CPUARCH} != "riscv" +CFLAGS+= -mgeneral-regs-only -fPIC +.elif ${MACHINE_CPUARCH} == "riscv" +CFLAGS+= -march=rv64imac -mabi=lp64 +.else CFLAGS+= -msoft-float .endif @@ -108,8 +110,10 @@ CFLAGS+= -msoft-float CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 +CFLAGS+= -fPIC -mno-red-zone +.endif - .if ${MACHINE_CPUARCH} == "arm" # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). @@ -120,6 +124,7 @@ CFLAGS.clang+= -mllvm -arm-use-movt=0 CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none +CFLAGS+= -fPIC .endif # The boot loader build uses dd status=none, where possible, for reproducible @@ -128,6 +133,10 @@ CFLAGS.clang+= -mfpu=none # when this test succeeds rather than require dd to be a bootstrap tool. DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true DD=dd ${DD_NOSTATUS} + +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif .if ${MK_LOADER_FORCE_LE} != "no" .if ${MACHINE_ARCH} == "powerpc64" Modified: stable/11/stand/fdt/Makefile ============================================================================== --- stable/11/stand/fdt/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/fdt/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall -.include .include Modified: stable/11/stand/ficl/Makefile ============================================================================== --- stable/11/stand/ficl/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/ficl/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -12,7 +12,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o -.include .ifmake testmain CFLAGS= -DTESTMAIN -D_TESTMAIN CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} Modified: stable/11/stand/geli/Makefile ============================================================================== --- stable/11/stand/geli/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/geli/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -34,5 +34,4 @@ SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_e .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c -.include .include Modified: stable/11/stand/libsa/Makefile ============================================================================== --- stable/11/stand/libsa/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/libsa/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -147,5 +147,4 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c -.include .include Modified: stable/11/stand/mips/uboot/Makefile ============================================================================== --- stable/11/stand/mips/uboot/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/mips/uboot/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -53,5 +53,4 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACH CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.include .include Modified: stable/11/stand/uboot/fdt/Makefile ============================================================================== --- stable/11/stand/uboot/fdt/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/uboot/fdt/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -18,5 +18,4 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -.include .include Modified: stable/11/stand/uboot/lib/Makefile ============================================================================== --- stable/11/stand/uboot/lib/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/uboot/lib/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -24,5 +24,4 @@ CFLAGS+= -I${LDRSRC} CFLAGS+= -DDISK_DEBUG .endif -.include .include Modified: stable/11/stand/zfs/Makefile ============================================================================== --- stable/11/stand/zfs/Makefile Fri Apr 6 18:55:02 2018 (r332130) +++ stable/11/stand/zfs/Makefile Fri Apr 6 19:01:08 2018 (r332131) @@ -17,5 +17,4 @@ CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall -.include .include From owner-svn-src-all@freebsd.org Fri Apr 6 19:10:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9015FF9FCAF; Fri, 6 Apr 2018 19:10:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3911A702B8; Fri, 6 Apr 2018 19:10:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F61815E5C; Fri, 6 Apr 2018 19:10:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JACOd017673; Fri, 6 Apr 2018 19:10:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JAC5l017672; Fri, 6 Apr 2018 19:10:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061910.w36JAC5l017672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332132 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 332132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:10:13 -0000 Author: kevans Date: Fri Apr 6 19:10:11 2018 New Revision: 332132 URL: https://svnweb.freebsd.org/changeset/base/332132 Log: MFC r329745: load_elf.c: Use consistent indentation As noted in D14267 load_elf.c has a variety of indentation styles. Move to standard 8 column hard tab indents, 4 space second level indents. Also includes some whitespace cleanups found by clang-format. Modified: stable/11/stand/common/load_elf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/load_elf.c ============================================================================== --- stable/11/stand/common/load_elf.c Fri Apr 6 19:01:08 2018 (r332131) +++ stable/11/stand/common/load_elf.c Fri Apr 6 19:10:11 2018 (r332132) @@ -52,29 +52,31 @@ __FBSDID("$FreeBSD$"); #endif typedef struct elf_file { - Elf_Phdr *ph; - Elf_Ehdr *ehdr; - Elf_Sym *symtab; - Elf_Hashelt *hashtab; - Elf_Hashelt nbuckets; - Elf_Hashelt nchains; - Elf_Hashelt *buckets; - Elf_Hashelt *chains; - Elf_Rel *rel; - size_t relsz; - Elf_Rela *rela; - size_t relasz; - char *strtab; - size_t strsz; - int fd; - caddr_t firstpage; - size_t firstlen; - int kernel; - u_int64_t off; + Elf_Phdr *ph; + Elf_Ehdr *ehdr; + Elf_Sym *symtab; + Elf_Hashelt *hashtab; + Elf_Hashelt nbuckets; + Elf_Hashelt nchains; + Elf_Hashelt *buckets; + Elf_Hashelt *chains; + Elf_Rel *rel; + size_t relsz; + Elf_Rela *rela; + size_t relasz; + char *strtab; + size_t strsz; + int fd; + caddr_t firstpage; + size_t firstlen; + int kernel; + u_int64_t off; } *elf_file_t; -static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, u_int64_t loadaddr); -static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const char* name, Elf_Sym* sym); +static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, + u_int64_t loadaddr); +static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, + const char* name, Elf_Sym* sym); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p, void *val, size_t len); static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, @@ -198,11 +200,11 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) { ssize_t bytes_read; Elf_Ehdr *ehdr; - int err; + int err; /* - * Open the image, read and validate the ELF header - */ + * Open the image, read and validate the ELF header + */ if (filename == NULL) /* can't handle nameless */ return (EFTYPE); if ((ef->fd = open(filename, O_RDONLY)) == -1) @@ -237,7 +239,8 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) if (err) goto error; - if (ehdr->e_version != EV_CURRENT || ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ + if (ehdr->e_version != EV_CURRENT || ehdr->e_machine != ELF_TARG_MACH) { + /* Machine ? */ err = EFTYPE; goto error; } @@ -271,136 +274,144 @@ int __elfN(loadfile_raw)(char *filename, u_int64_t dest, struct preloaded_file **result, int multiboot) { - struct preloaded_file *fp, *kfp; - struct elf_file ef; - Elf_Ehdr *ehdr; - int err; + struct preloaded_file *fp, *kfp; + struct elf_file ef; + Elf_Ehdr *ehdr; + int err; - fp = NULL; - bzero(&ef, sizeof(struct elf_file)); - ef.fd = -1; + fp = NULL; + bzero(&ef, sizeof(struct elf_file)); + ef.fd = -1; - err = __elfN(load_elf_header)(filename, &ef); - if (err != 0) - return (err); + err = __elfN(load_elf_header)(filename, &ef); + if (err != 0) + return (err); - ehdr = ef.ehdr; + ehdr = ef.ehdr; - /* - * Check to see what sort of module we are. - */ - kfp = file_findfile(NULL, __elfN(kerneltype)); + /* + * Check to see what sort of module we are. + */ + kfp = file_findfile(NULL, __elfN(kerneltype)); #ifdef __powerpc__ - /* - * Kernels can be ET_DYN, so just assume the first loaded object is the - * kernel. This assumption will be checked later. - */ - if (kfp == NULL) - ef.kernel = 1; -#endif - if (ef.kernel || ehdr->e_type == ET_EXEC) { - /* Looks like a kernel */ - if (kfp != NULL) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: kernel already loaded\n"); - err = EPERM; - goto oerr; - } - /* - * Calculate destination address based on kernel entrypoint. - * - * For ARM, the destination address is independent of any values in the - * elf header (an ARM kernel can be loaded at any 2MB boundary), so we - * leave dest set to the value calculated by archsw.arch_loadaddr() and - * passed in to this function. + /* + * Kernels can be ET_DYN, so just assume the first loaded object is the + * kernel. This assumption will be checked later. */ + if (kfp == NULL) + ef.kernel = 1; +#endif + if (ef.kernel || ehdr->e_type == ET_EXEC) { + /* Looks like a kernel */ + if (kfp != NULL) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadfile: kernel already loaded\n"); + err = EPERM; + goto oerr; + } + /* + * Calculate destination address based on kernel entrypoint. + * + * For ARM, the destination address is independent of any values + * in the elf header (an ARM kernel can be loaded at any 2MB + * boundary), so we leave dest set to the value calculated by + * archsw.arch_loadaddr() and passed in to this function. + */ #ifndef __arm__ - if (ehdr->e_type == ET_EXEC) - dest = (ehdr->e_entry & ~PAGE_MASK); + if (ehdr->e_type == ET_EXEC) + dest = (ehdr->e_entry & ~PAGE_MASK); #endif - if ((ehdr->e_entry & ~PAGE_MASK) == 0) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: not a kernel (maybe static binary?)\n"); - err = EPERM; - goto oerr; - } - ef.kernel = 1; + if ((ehdr->e_entry & ~PAGE_MASK) == 0) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadfile: not a kernel (maybe static binary?)\n"); + err = EPERM; + goto oerr; + } + ef.kernel = 1; - } else if (ehdr->e_type == ET_DYN) { - /* Looks like a kld module */ - if (multiboot != 0) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module as multiboot\n"); - err = EPERM; + } else if (ehdr->e_type == ET_DYN) { + /* Looks like a kld module */ + if (multiboot != 0) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadfile: can't load module as multiboot\n"); + err = EPERM; + goto oerr; + } + if (kfp == NULL) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadfile: can't load module before kernel\n"); + err = EPERM; + goto oerr; + } + if (strcmp(__elfN(kerneltype), kfp->f_type)) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadfile: can't load module with kernel type '%s'\n", + kfp->f_type); + err = EPERM; + goto oerr; + } + /* Looks OK, got ahead */ + ef.kernel = 0; + + } else { + err = EFTYPE; goto oerr; } - if (kfp == NULL) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module before kernel\n"); - err = EPERM; - goto oerr; - } - if (strcmp(__elfN(kerneltype), kfp->f_type)) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module with kernel type '%s'\n", kfp->f_type); - err = EPERM; - goto oerr; - } - /* Looks OK, got ahead */ - ef.kernel = 0; - } else { - err = EFTYPE; - goto oerr; - } + if (archsw.arch_loadaddr != NULL) + dest = archsw.arch_loadaddr(LOAD_ELF, ehdr, dest); + else + dest = roundup(dest, PAGE_SIZE); - if (archsw.arch_loadaddr != NULL) - dest = archsw.arch_loadaddr(LOAD_ELF, ehdr, dest); - else - dest = roundup(dest, PAGE_SIZE); + /* + * Ok, we think we should handle this. + */ + fp = file_alloc(); + if (fp == NULL) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadfile: cannot allocate module info\n"); + err = EPERM; + goto out; + } + if (ef.kernel == 1 && multiboot == 0) + setenv("kernelname", filename, 1); + fp->f_name = strdup(filename); + if (multiboot == 0) + fp->f_type = strdup(ef.kernel ? + __elfN(kerneltype) : __elfN(moduletype)); + else + fp->f_type = strdup("elf multiboot kernel"); - /* - * Ok, we think we should handle this. - */ - fp = file_alloc(); - if (fp == NULL) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: cannot allocate module info\n"); - err = EPERM; - goto out; - } - if (ef.kernel == 1 && multiboot == 0) - setenv("kernelname", filename, 1); - fp->f_name = strdup(filename); - if (multiboot == 0) - fp->f_type = strdup(ef.kernel ? - __elfN(kerneltype) : __elfN(moduletype)); - else - fp->f_type = strdup("elf multiboot kernel"); - #ifdef ELF_VERBOSE - if (ef.kernel) - printf("%s entry at 0x%jx\n", filename, (uintmax_t)ehdr->e_entry); + if (ef.kernel) + printf("%s entry at 0x%jx\n", filename, + (uintmax_t)ehdr->e_entry); #else - printf("%s ", filename); + printf("%s ", filename); #endif - fp->f_size = __elfN(loadimage)(fp, &ef, dest); - if (fp->f_size == 0 || fp->f_addr == 0) - goto ioerr; + fp->f_size = __elfN(loadimage)(fp, &ef, dest); + if (fp->f_size == 0 || fp->f_addr == 0) + goto ioerr; - /* save exec header as metadata */ - file_addmetadata(fp, MODINFOMD_ELFHDR, sizeof(*ehdr), ehdr); + /* save exec header as metadata */ + file_addmetadata(fp, MODINFOMD_ELFHDR, sizeof(*ehdr), ehdr); - /* Load OK, return module pointer */ - *result = (struct preloaded_file *)fp; - err = 0; - goto out; - - ioerr: - err = EIO; - oerr: - file_discard(fp); - out: - if (ef.firstpage) - free(ef.firstpage); - if (ef.fd != -1) - close(ef.fd); - return(err); + /* Load OK, return module pointer */ + *result = (struct preloaded_file *)fp; + err = 0; + goto out; + +ioerr: + err = EIO; +oerr: + file_discard(fp); +out: + if (ef.firstpage) + free(ef.firstpage); + if (ef.fd != -1) + close(ef.fd); + return (err); } /* @@ -410,408 +421,431 @@ __elfN(loadfile_raw)(char *filename, u_int64_t dest, static int __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) { - int i; - u_int j; - Elf_Ehdr *ehdr; - Elf_Phdr *phdr, *php; - Elf_Shdr *shdr; - char *shstr; - int ret; - vm_offset_t firstaddr; - vm_offset_t lastaddr; - size_t chunk; - ssize_t result; - Elf_Addr ssym, esym; - Elf_Dyn *dp; - Elf_Addr adp; - Elf_Addr ctors; - int ndp; - int symstrindex; - int symtabindex; - Elf_Size size; - u_int fpcopy; - Elf_Sym sym; - Elf_Addr p_start, p_end; + int i; + u_int j; + Elf_Ehdr *ehdr; + Elf_Phdr *phdr, *php; + Elf_Shdr *shdr; + char *shstr; + int ret; + vm_offset_t firstaddr; + vm_offset_t lastaddr; + size_t chunk; + ssize_t result; + Elf_Addr ssym, esym; + Elf_Dyn *dp; + Elf_Addr adp; + Elf_Addr ctors; + int ndp; + int symstrindex; + int symtabindex; + Elf_Size size; + u_int fpcopy; + Elf_Sym sym; + Elf_Addr p_start, p_end; - dp = NULL; - shdr = NULL; - ret = 0; - firstaddr = lastaddr = 0; - ehdr = ef->ehdr; - if (ehdr->e_type == ET_EXEC) { + dp = NULL; + shdr = NULL; + ret = 0; + firstaddr = lastaddr = 0; + ehdr = ef->ehdr; + if (ehdr->e_type == ET_EXEC) { #if defined(__i386__) || defined(__amd64__) #if __ELF_WORD_SIZE == 64 - off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */ + /* x86_64 relocates after locore */ + off = - (off & 0xffffffffff000000ull); #else - off = - (off & 0xff000000u); /* i386 relocates after locore */ + /* i386 relocates after locore */ + off = - (off & 0xff000000u); #endif #elif defined(__powerpc__) - /* - * On the purely virtual memory machines like e500, the kernel is - * linked against its final VA range, which is most often not - * available at the loader stage, but only after kernel initializes - * and completes its VM settings. In such cases we cannot use p_vaddr - * field directly to load ELF segments, but put them at some - * 'load-time' locations. - */ - if (off & 0xf0000000u) { - off = -(off & 0xf0000000u); - /* - * XXX the physical load address should not be hardcoded. Note - * that the Book-E kernel assumes that it's loaded at a 16MB - * boundary for now... - */ - off += 0x01000000; - ehdr->e_entry += off; + /* + * On the purely virtual memory machines like e500, the kernel + * is linked against its final VA range, which is most often + * not available at the loader stage, but only after kernel + * initializes and completes its VM settings. In such cases we + * cannot use p_vaddr field directly to load ELF segments, but + * put them at some 'load-time' locations. + */ + if (off & 0xf0000000u) { + off = -(off & 0xf0000000u); + /* + * XXX the physical load address should not be + * hardcoded. Note that the Book-E kernel assumes that + * it's loaded at a 16MB boundary for now... + */ + off += 0x01000000; + ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("Converted entry 0x%08x\n", ehdr->e_entry); + printf("Converted entry 0x%08x\n", ehdr->e_entry); #endif - } else - off = 0; + } else + off = 0; #elif defined(__arm__) && !defined(EFI) - /* - * The elf headers in arm kernels specify virtual addresses in all - * header fields, even the ones that should be physical addresses. - * We assume the entry point is in the first page, and masking the page - * offset will leave us with the virtual address the kernel was linked - * at. We subtract that from the load offset, making 'off' into the - * value which, when added to a virtual address in an elf header, - * translates it to a physical address. We do the va->pa conversion on - * the entry point address in the header now, so that later we can - * launch the kernel by just jumping to that address. - * - * When booting from UEFI the copyin and copyout functions handle - * adjusting the location relative to the first virtual address. - * Because of this there is no need to adjust the offset or entry - * point address as these will both be handled by the efi code. - */ - off -= ehdr->e_entry & ~PAGE_MASK; - ehdr->e_entry += off; + /* + * The elf headers in arm kernels specify virtual addresses in + * all header fields, even the ones that should be physical + * addresses. We assume the entry point is in the first page, + * and masking the page offset will leave us with the virtual + * address the kernel was linked at. We subtract that from the + * load offset, making 'off' into the value which, when added + * to a virtual address in an elf header, translates it to a + * physical address. We do the va->pa conversion on the entry + * point address in the header now, so that later we can launch + * the kernel by just jumping to that address. + * + * When booting from UEFI the copyin and copyout functions + * handle adjusting the location relative to the first virtual + * address. Because of this there is no need to adjust the + * offset or entry point address as these will both be handled + * by the efi code. + */ + off -= ehdr->e_entry & ~PAGE_MASK; + ehdr->e_entry += off; #ifdef ELF_VERBOSE - printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off); + printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", + ehdr->e_entry, off); #endif #else - off = 0; /* other archs use direct mapped kernels */ + off = 0; /* other archs use direct mapped kernels */ #endif - } - ef->off = off; + } + ef->off = off; - if (ef->kernel) - __elfN(relocation_offset) = off; + if (ef->kernel) + __elfN(relocation_offset) = off; - if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > ef->firstlen) { - printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadimage: program header not within first page\n"); - goto out; - } - phdr = (Elf_Phdr *)(ef->firstpage + ehdr->e_phoff); + if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > ef->firstlen) { + printf("elf" __XSTRING(__ELF_WORD_SIZE) + "_loadimage: program header not within first page\n"); + goto out; + } + phdr = (Elf_Phdr *)(ef->firstpage + ehdr->e_phoff); - for (i = 0; i < ehdr->e_phnum; i++) { - if (elf_program_header_convert(ehdr, phdr)) - continue; + for (i = 0; i < ehdr->e_phnum; i++) { + if (elf_program_header_convert(ehdr, phdr)) + continue; - /* We want to load PT_LOAD segments only.. */ - if (phdr[i].p_type != PT_LOAD) - continue; + /* We want to load PT_LOAD segments only.. */ + if (phdr[i].p_type != PT_LOAD) + continue; #ifdef ELF_VERBOSE - printf("Segment: 0x%lx@0x%lx -> 0x%lx-0x%lx", - (long)phdr[i].p_filesz, (long)phdr[i].p_offset, - (long)(phdr[i].p_vaddr + off), - (long)(phdr[i].p_vaddr + off + phdr[i].p_memsz - 1)); + printf("Segment: 0x%lx@0x%lx -> 0x%lx-0x%lx", + (long)phdr[i].p_filesz, (long)phdr[i].p_offset, + (long)(phdr[i].p_vaddr + off), + (long)(phdr[i].p_vaddr + off + phdr[i].p_memsz - 1)); #else - if ((phdr[i].p_flags & PF_W) == 0) { - printf("text=0x%lx ", (long)phdr[i].p_filesz); - } else { - printf("data=0x%lx", (long)phdr[i].p_filesz); - if (phdr[i].p_filesz < phdr[i].p_memsz) - printf("+0x%lx", (long)(phdr[i].p_memsz -phdr[i].p_filesz)); - printf(" "); - } + if ((phdr[i].p_flags & PF_W) == 0) { + printf("text=0x%lx ", (long)phdr[i].p_filesz); + } else { + printf("data=0x%lx", (long)phdr[i].p_filesz); + if (phdr[i].p_filesz < phdr[i].p_memsz) + printf("+0x%lx", (long)(phdr[i].p_memsz - + phdr[i].p_filesz)); + printf(" "); + } #endif - fpcopy = 0; - if (ef->firstlen > phdr[i].p_offset) { - fpcopy = ef->firstlen - phdr[i].p_offset; - archsw.arch_copyin(ef->firstpage + phdr[i].p_offset, - phdr[i].p_vaddr + off, fpcopy); - } - if (phdr[i].p_filesz > fpcopy) { - if (kern_pread(ef->fd, phdr[i].p_vaddr + off + fpcopy, - phdr[i].p_filesz - fpcopy, phdr[i].p_offset + fpcopy) != 0) { - printf("\nelf" __XSTRING(__ELF_WORD_SIZE) - "_loadimage: read failed\n"); - goto out; - } - } - /* clear space from oversized segments; eg: bss */ - if (phdr[i].p_filesz < phdr[i].p_memsz) { + fpcopy = 0; + if (ef->firstlen > phdr[i].p_offset) { + fpcopy = ef->firstlen - phdr[i].p_offset; + archsw.arch_copyin(ef->firstpage + phdr[i].p_offset, + phdr[i].p_vaddr + off, fpcopy); + } + if (phdr[i].p_filesz > fpcopy) { + if (kern_pread(ef->fd, phdr[i].p_vaddr + off + fpcopy, + phdr[i].p_filesz - fpcopy, + phdr[i].p_offset + fpcopy) != 0) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "_loadimage: read failed\n"); + goto out; + } + } + /* clear space from oversized segments; eg: bss */ + if (phdr[i].p_filesz < phdr[i].p_memsz) { #ifdef ELF_VERBOSE - printf(" (bss: 0x%lx-0x%lx)", - (long)(phdr[i].p_vaddr + off + phdr[i].p_filesz), - (long)(phdr[i].p_vaddr + off + phdr[i].p_memsz - 1)); + printf(" (bss: 0x%lx-0x%lx)", + (long)(phdr[i].p_vaddr + off + phdr[i].p_filesz), + (long)(phdr[i].p_vaddr + off + phdr[i].p_memsz -1)); #endif - kern_bzero(phdr[i].p_vaddr + off + phdr[i].p_filesz, - phdr[i].p_memsz - phdr[i].p_filesz); - } + kern_bzero(phdr[i].p_vaddr + off + phdr[i].p_filesz, + phdr[i].p_memsz - phdr[i].p_filesz); + } #ifdef ELF_VERBOSE - printf("\n"); + printf("\n"); #endif - if (archsw.arch_loadseg != NULL) - archsw.arch_loadseg(ehdr, phdr + i, off); + if (archsw.arch_loadseg != NULL) + archsw.arch_loadseg(ehdr, phdr + i, off); - if (firstaddr == 0 || firstaddr > (phdr[i].p_vaddr + off)) - firstaddr = phdr[i].p_vaddr + off; - if (lastaddr == 0 || lastaddr < (phdr[i].p_vaddr + off + phdr[i].p_memsz)) - lastaddr = phdr[i].p_vaddr + off + phdr[i].p_memsz; - } - lastaddr = roundup(lastaddr, sizeof(long)); + if (firstaddr == 0 || firstaddr > (phdr[i].p_vaddr + off)) + firstaddr = phdr[i].p_vaddr + off; + if (lastaddr == 0 || lastaddr < + (phdr[i].p_vaddr + off + phdr[i].p_memsz)) + lastaddr = phdr[i].p_vaddr + off + phdr[i].p_memsz; + } + lastaddr = roundup(lastaddr, sizeof(long)); - /* - * Get the section headers. We need this for finding the .ctors - * section as well as for loading any symbols. Both may be hard - * to do if reading from a .gz file as it involves seeking. I - * think the rule is going to have to be that you must strip a - * file to remove symbols before gzipping it. - */ - chunk = (size_t)ehdr->e_shnum * (size_t)ehdr->e_shentsize; - if (chunk == 0 || ehdr->e_shoff == 0) - goto nosyms; - shdr = alloc_pread(ef->fd, ehdr->e_shoff, chunk); - if (shdr == NULL) { - printf("\nelf" __XSTRING(__ELF_WORD_SIZE) - "_loadimage: failed to read section headers"); - goto nosyms; - } + /* + * Get the section headers. We need this for finding the .ctors + * section as well as for loading any symbols. Both may be hard + * to do if reading from a .gz file as it involves seeking. I + * think the rule is going to have to be that you must strip a + * file to remove symbols before gzipping it. + */ + chunk = (size_t)ehdr->e_shnum * (size_t)ehdr->e_shentsize; + if (chunk == 0 || ehdr->e_shoff == 0) + goto nosyms; + shdr = alloc_pread(ef->fd, ehdr->e_shoff, chunk); + if (shdr == NULL) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "_loadimage: failed to read section headers"); + goto nosyms; + } - for (i = 0; i < ehdr->e_shnum; i++) - elf_section_header_convert(ehdr, &shdr[i]); + for (i = 0; i < ehdr->e_shnum; i++) + elf_section_header_convert(ehdr, &shdr[i]); - file_addmetadata(fp, MODINFOMD_SHDR, chunk, shdr); + file_addmetadata(fp, MODINFOMD_SHDR, chunk, shdr); - /* - * Read the section string table and look for the .ctors section. - * We need to tell the kernel where it is so that it can call the - * ctors. - */ - chunk = shdr[ehdr->e_shstrndx].sh_size; - if (chunk) { - shstr = alloc_pread(ef->fd, shdr[ehdr->e_shstrndx].sh_offset, chunk); - if (shstr) { - for (i = 0; i < ehdr->e_shnum; i++) { - if (strcmp(shstr + shdr[i].sh_name, ".ctors") != 0) - continue; - ctors = shdr[i].sh_addr; - file_addmetadata(fp, MODINFOMD_CTORS_ADDR, sizeof(ctors), - &ctors); - size = shdr[i].sh_size; - file_addmetadata(fp, MODINFOMD_CTORS_SIZE, sizeof(size), - &size); - break; - } - free(shstr); + /* + * Read the section string table and look for the .ctors section. + * We need to tell the kernel where it is so that it can call the + * ctors. + */ + chunk = shdr[ehdr->e_shstrndx].sh_size; + if (chunk) { + shstr = alloc_pread(ef->fd, shdr[ehdr->e_shstrndx].sh_offset, + chunk); + if (shstr) { + for (i = 0; i < ehdr->e_shnum; i++) { + if (strcmp(shstr + shdr[i].sh_name, + ".ctors") != 0) + continue; + ctors = shdr[i].sh_addr; + file_addmetadata(fp, MODINFOMD_CTORS_ADDR, + sizeof(ctors), &ctors); + size = shdr[i].sh_size; + file_addmetadata(fp, MODINFOMD_CTORS_SIZE, + sizeof(size), &size); + break; + } + free(shstr); + } } - } - /* - * Now load any symbols. - */ - symtabindex = -1; - symstrindex = -1; - for (i = 0; i < ehdr->e_shnum; i++) { - if (shdr[i].sh_type != SHT_SYMTAB) - continue; - for (j = 0; j < ehdr->e_phnum; j++) { - if (phdr[j].p_type != PT_LOAD) - continue; - if (shdr[i].sh_offset >= phdr[j].p_offset && - (shdr[i].sh_offset + shdr[i].sh_size <= - phdr[j].p_offset + phdr[j].p_filesz)) { - shdr[i].sh_offset = 0; - shdr[i].sh_size = 0; - break; - } + /* + * Now load any symbols. + */ + symtabindex = -1; + symstrindex = -1; + for (i = 0; i < ehdr->e_shnum; i++) { + if (shdr[i].sh_type != SHT_SYMTAB) + continue; + for (j = 0; j < ehdr->e_phnum; j++) { + if (phdr[j].p_type != PT_LOAD) + continue; + if (shdr[i].sh_offset >= phdr[j].p_offset && + (shdr[i].sh_offset + shdr[i].sh_size <= + phdr[j].p_offset + phdr[j].p_filesz)) { + shdr[i].sh_offset = 0; + shdr[i].sh_size = 0; + break; + } + } + if (shdr[i].sh_offset == 0 || shdr[i].sh_size == 0) + continue; /* alread loaded in a PT_LOAD above */ + /* Save it for loading below */ + symtabindex = i; + symstrindex = shdr[i].sh_link; } - if (shdr[i].sh_offset == 0 || shdr[i].sh_size == 0) - continue; /* alread loaded in a PT_LOAD above */ - /* Save it for loading below */ - symtabindex = i; - symstrindex = shdr[i].sh_link; - } - if (symtabindex < 0 || symstrindex < 0) - goto nosyms; + if (symtabindex < 0 || symstrindex < 0) + goto nosyms; - /* Ok, committed to a load. */ + /* Ok, committed to a load. */ #ifndef ELF_VERBOSE - printf("syms=["); + printf("syms=["); #endif - ssym = lastaddr; - for (i = symtabindex; i >= 0; i = symstrindex) { + ssym = lastaddr; + for (i = symtabindex; i >= 0; i = symstrindex) { #ifdef ELF_VERBOSE - char *secname; + char *secname; - switch(shdr[i].sh_type) { - case SHT_SYMTAB: /* Symbol table */ - secname = "symtab"; - break; - case SHT_STRTAB: /* String table */ - secname = "strtab"; - break; - default: - secname = "WHOA!!"; - break; - } + switch(shdr[i].sh_type) { + case SHT_SYMTAB: /* Symbol table */ + secname = "symtab"; + break; + case SHT_STRTAB: /* String table */ + secname = "strtab"; + break; + default: + secname = "WHOA!!"; + break; + } #endif - size = shdr[i].sh_size; + size = shdr[i].sh_size; #if defined(__powerpc__) #if __ELF_WORD_SIZE == 64 - size = htobe64(size); + size = htobe64(size); #else - size = htobe32(size); + size = htobe32(size); #endif #endif - archsw.arch_copyin(&size, lastaddr, sizeof(size)); - lastaddr += sizeof(size); + archsw.arch_copyin(&size, lastaddr, sizeof(size)); + lastaddr += sizeof(size); #ifdef ELF_VERBOSE - printf("\n%s: 0x%jx@0x%jx -> 0x%jx-0x%jx", secname, - (uintmax_t)shdr[i].sh_size, (uintmax_t)shdr[i].sh_offset, - (uintmax_t)lastaddr, (uintmax_t)(lastaddr + shdr[i].sh_size)); + printf("\n%s: 0x%jx@0x%jx -> 0x%jx-0x%jx", secname, + (uintmax_t)shdr[i].sh_size, (uintmax_t)shdr[i].sh_offset, + (uintmax_t)lastaddr, + (uintmax_t)(lastaddr + shdr[i].sh_size)); #else - if (i == symstrindex) - printf("+"); - printf("0x%lx+0x%lx", (long)sizeof(size), (long)size); + if (i == symstrindex) + printf("+"); + printf("0x%lx+0x%lx", (long)sizeof(size), (long)size); #endif - if (lseek(ef->fd, (off_t)shdr[i].sh_offset, SEEK_SET) == -1) { - printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_loadimage: could not seek for symbols - skipped!"); - lastaddr = ssym; - ssym = 0; - goto nosyms; + if (lseek(ef->fd, (off_t)shdr[i].sh_offset, SEEK_SET) == -1) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "_loadimage: could not seek for symbols - skipped!"); + lastaddr = ssym; + ssym = 0; + goto nosyms; + } + result = archsw.arch_readin(ef->fd, lastaddr, shdr[i].sh_size); + if (result < 0 || (size_t)result != shdr[i].sh_size) { + printf("\nelf" __XSTRING(__ELF_WORD_SIZE) + "_loadimage: could not read symbols - skipped! " + "(%ju != %ju)", (uintmax_t)result, + (uintmax_t)shdr[i].sh_size); + lastaddr = ssym; + ssym = 0; + goto nosyms; + } + /* Reset offsets relative to ssym */ + lastaddr += shdr[i].sh_size; + lastaddr = roundup(lastaddr, sizeof(size)); + if (i == symtabindex) + symtabindex = -1; + else if (i == symstrindex) + symstrindex = -1; } - result = archsw.arch_readin(ef->fd, lastaddr, shdr[i].sh_size); - if (result < 0 || (size_t)result != shdr[i].sh_size) { - printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_loadimage: could not read symbols - skipped! (%ju != %ju)", (uintmax_t)result, - (uintmax_t)shdr[i].sh_size); - lastaddr = ssym; - ssym = 0; - goto nosyms; - } - /* Reset offsets relative to ssym */ - lastaddr += shdr[i].sh_size; - lastaddr = roundup(lastaddr, sizeof(size)); - if (i == symtabindex) - symtabindex = -1; - else if (i == symstrindex) - symstrindex = -1; - } - esym = lastaddr; + esym = lastaddr; #ifndef ELF_VERBOSE - printf("]"); + printf("]"); #endif #if defined(__powerpc__) /* On PowerPC we always need to provide BE data to the kernel */ #if __ELF_WORD_SIZE == 64 - ssym = htobe64((uint64_t)ssym); - esym = htobe64((uint64_t)esym); + ssym = htobe64((uint64_t)ssym); + esym = htobe64((uint64_t)esym); #else - ssym = htobe32((uint32_t)ssym); - esym = htobe32((uint32_t)esym); + ssym = htobe32((uint32_t)ssym); + esym = htobe32((uint32_t)esym); #endif #endif - file_addmetadata(fp, MODINFOMD_SSYM, sizeof(ssym), &ssym); - file_addmetadata(fp, MODINFOMD_ESYM, sizeof(esym), &esym); + file_addmetadata(fp, MODINFOMD_SSYM, sizeof(ssym), &ssym); + file_addmetadata(fp, MODINFOMD_ESYM, sizeof(esym), &esym); nosyms: - printf("\n"); + printf("\n"); - ret = lastaddr - firstaddr; - fp->f_addr = firstaddr; + ret = lastaddr - firstaddr; + fp->f_addr = firstaddr; - php = NULL; - for (i = 0; i < ehdr->e_phnum; i++) { - if (phdr[i].p_type == PT_DYNAMIC) { - php = phdr + i; - adp = php->p_vaddr; - file_addmetadata(fp, MODINFOMD_DYNAMIC, sizeof(adp), &adp); - break; + php = NULL; + for (i = 0; i < ehdr->e_phnum; i++) { + if (phdr[i].p_type == PT_DYNAMIC) { + php = phdr + i; + adp = php->p_vaddr; + file_addmetadata(fp, MODINFOMD_DYNAMIC, sizeof(adp), + &adp); + break; + } } - } - if (php == NULL) /* this is bad, we cannot get to symbols or _DYNAMIC */ - goto out; + if (php == NULL) /* this is bad, we cannot get to symbols or _DYNAMIC */ + goto out; - ndp = php->p_filesz / sizeof(Elf_Dyn); - if (ndp == 0) - goto out; - dp = malloc(php->p_filesz); - if (dp == NULL) - goto out; - archsw.arch_copyout(php->p_vaddr + off, dp, php->p_filesz); + ndp = php->p_filesz / sizeof(Elf_Dyn); + if (ndp == 0) + goto out; + dp = malloc(php->p_filesz); + if (dp == NULL) + goto out; + archsw.arch_copyout(php->p_vaddr + off, dp, php->p_filesz); - ef->strsz = 0; - for (i = 0; i < ndp; i++) { - if (dp[i].d_tag == 0) - break; - switch (dp[i].d_tag) { - case DT_HASH: - ef->hashtab = (Elf_Hashelt*)(uintptr_t)(dp[i].d_un.d_ptr + off); - break; - case DT_STRTAB: - ef->strtab = (char *)(uintptr_t)(dp[i].d_un.d_ptr + off); - break; - case DT_STRSZ: - ef->strsz = dp[i].d_un.d_val; - break; - case DT_SYMTAB: - ef->symtab = (Elf_Sym*)(uintptr_t)(dp[i].d_un.d_ptr + off); - break; - case DT_REL: - ef->rel = (Elf_Rel *)(uintptr_t)(dp[i].d_un.d_ptr + off); - break; - case DT_RELSZ: - ef->relsz = dp[i].d_un.d_val; - break; - case DT_RELA: - ef->rela = (Elf_Rela *)(uintptr_t)(dp[i].d_un.d_ptr + off); - break; - case DT_RELASZ: - ef->relasz = dp[i].d_un.d_val; - break; - default: - break; + ef->strsz = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 6 19:11:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A3C1F9FF64; Fri, 6 Apr 2018 19:11:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B415F704CC; Fri, 6 Apr 2018 19:11:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF24215E9E; Fri, 6 Apr 2018 19:11:22 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JBMBk017794; Fri, 6 Apr 2018 19:11:22 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JBMvB017793; Fri, 6 Apr 2018 19:11:22 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804061911.w36JBMvB017793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 19:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332133 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 332133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:11:23 -0000 Author: brooks Date: Fri Apr 6 19:11:22 2018 New Revision: 332133 URL: https://svnweb.freebsd.org/changeset/base/332133 Log: Add an unused _COMPAT_LINUX32 option to ensure opt_compat.h exists on platforms without COMPAT_LINUX32. Reported by: kib Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Apr 6 19:10:11 2018 (r332132) +++ head/sys/conf/options Fri Apr 6 19:11:22 2018 (r332133) @@ -92,6 +92,7 @@ COMPAT_FREEBSD11 opt_global.h COMPAT_CLOUDABI32 opt_dontuse.h COMPAT_CLOUDABI64 opt_dontuse.h COMPAT_LINUXKPI opt_dontuse.h +_COMPAT_LINUX32 opt_compat.h # XXX: make sure opt_compat.h exists COMPILING_LINT opt_global.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h From owner-svn-src-all@freebsd.org Fri Apr 6 19:11:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C04BBFA0043; Fri, 6 Apr 2018 19:11:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF3F70681; Fri, 6 Apr 2018 19:11:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67C2A15FC1; Fri, 6 Apr 2018 19:11:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JBwIb022403; Fri, 6 Apr 2018 19:11:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JBwrf022402; Fri, 6 Apr 2018 19:11:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061911.w36JBwrf022402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332134 - stable/11/stand/sparc64/loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/sparc64/loader X-SVN-Commit-Revision: 332134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:11:58 -0000 Author: kevans Date: Fri Apr 6 19:11:58 2018 New Revision: 332134 URL: https://svnweb.freebsd.org/changeset/base/332134 Log: MFC r329758: Fix compilation with LOADER_DEBUG defined after r329725. Modified: stable/11/stand/sparc64/loader/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/sparc64/loader/main.c ============================================================================== --- stable/11/stand/sparc64/loader/main.c Fri Apr 6 19:11:22 2018 (r332133) +++ stable/11/stand/sparc64/loader/main.c Fri Apr 6 19:11:58 2018 (r332134) @@ -938,7 +938,7 @@ static const char *const page_sizes[] = { static void pmap_print_tte_sun4u(tte_t tag, tte_t tte) - +{ printf("%s %s ", page_sizes[(tte >> TD_SIZE_SHIFT) & TD_SIZE_MASK], From owner-svn-src-all@freebsd.org Fri Apr 6 19:18:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8030FA0668; Fri, 6 Apr 2018 19:18:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A93970B95; Fri, 6 Apr 2018 19:18:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 959C11600A; Fri, 6 Apr 2018 19:18:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JI0SR022805; Fri, 6 Apr 2018 19:18:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JHxCi022789; Fri, 6 Apr 2018 19:17:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061917.w36JHxCi022789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332135 - in stable/11: contrib/compiler-rt/lib/builtins include stand sys/arm/include sys/arm64/include sys/mips/include sys/powerpc/include sys/riscv/include sys/sparc64/include sys/s... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: contrib/compiler-rt/lib/builtins include stand sys/arm/include sys/arm64/include sys/mips/include sys/powerpc/include sys/riscv/include sys/sparc64/include sys/sys sys/x86/include X-SVN-Commit-Revision: 332135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:18:01 -0000 Author: kevans Date: Fri Apr 6 19:17:59 2018 New Revision: 332135 URL: https://svnweb.freebsd.org/changeset/base/332135 Log: MFC r329859,r329860: Float protection in stand r329859: Do not include float interfaces when using libsa. We don't support float in the boot loaders, so don't include interfaces for float or double in systems headers. In addition, take the unusual step of spiking double and float to prevent any more accidental seepage. r329860: Floaty McFloatface is funnier... Modified: stable/11/contrib/compiler-rt/lib/builtins/int_types.h stable/11/include/time.h stable/11/stand/defs.mk stable/11/sys/arm/include/_types.h stable/11/sys/arm64/include/_types.h stable/11/sys/mips/include/_types.h stable/11/sys/powerpc/include/_types.h stable/11/sys/powerpc/include/pcb.h stable/11/sys/riscv/include/_types.h stable/11/sys/sparc64/include/_types.h stable/11/sys/sys/_types.h stable/11/sys/x86/include/_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/compiler-rt/lib/builtins/int_types.h ============================================================================== --- stable/11/contrib/compiler-rt/lib/builtins/int_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/contrib/compiler-rt/lib/builtins/int_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -114,6 +114,7 @@ static __inline tu_int make_tu(du_int h, du_int l) { #endif /* CRT_HAS_128BIT */ +#ifndef _STANDALONE typedef union { su_int u; @@ -125,6 +126,7 @@ typedef union udwords u; double f; } double_bits; +#endif typedef struct { @@ -137,6 +139,7 @@ typedef struct #endif /* _YUGA_LITTLE_ENDIAN */ } uqwords; +#ifndef _STANDALONE typedef union { uqwords u; @@ -159,6 +162,7 @@ typedef struct { long double real, imaginary; } Lcompl #define COMPLEX_REAL(x) (x).real #define COMPLEX_IMAGINARY(x) (x).imaginary +#endif #endif #endif /* INT_TYPES_H */ Modified: stable/11/include/time.h ============================================================================== --- stable/11/include/time.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/include/time.h Fri Apr 6 19:17:59 2018 (r332135) @@ -144,7 +144,9 @@ __BEGIN_DECLS char *asctime(const struct tm *); clock_t clock(void); char *ctime(const time_t *); +#ifndef _STANDALONE double difftime(time_t, time_t); +#endif /* XXX missing: getdate() */ struct tm *gmtime(const time_t *); struct tm *localtime(const time_t *); Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/stand/defs.mk Fri Apr 6 19:17:59 2018 (r332135) @@ -49,6 +49,9 @@ CFLAGS+= -I${BOOTOBJ}/libsa .endif CFLAGS+= -I${SASRC} -D_STANDALONE CFLAGS+= -I${SYSDIR} +# Spike the floating point interfaces +CFLAGS+= -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface + # GELI Support, with backward compat hooks (mostly) .if defined(HAVE_GELI) Modified: stable/11/sys/arm/include/_types.h ============================================================================== --- stable/11/sys/arm/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/arm/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -68,8 +68,10 @@ typedef unsigned long long __uint64_t; */ typedef __uint32_t __clock_t; /* clock()... */ typedef __int32_t __critical_t; +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif typedef __int32_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int32_t __intptr_t; Modified: stable/11/sys/arm64/include/_types.h ============================================================================== --- stable/11/sys/arm64/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/arm64/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -56,8 +56,10 @@ typedef unsigned long __uint64_t; */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; Modified: stable/11/sys/mips/include/_types.h ============================================================================== --- stable/11/sys/mips/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/mips/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -73,8 +73,10 @@ typedef unsigned long long __uint64_t; * Standard type definitions. */ typedef __int32_t __clock_t; /* clock()... */ +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif #ifdef __mips_n64 typedef __int64_t __critical_t; typedef __int64_t __intfptr_t; Modified: stable/11/sys/powerpc/include/_types.h ============================================================================== --- stable/11/sys/powerpc/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/powerpc/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -72,8 +72,10 @@ typedef unsigned long long __uint64_t; * Standard type definitions. */ typedef __uint32_t __clock_t; /* clock()... */ +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif #ifdef __LP64__ typedef __int64_t __critical_t; typedef __int64_t __intfptr_t; Modified: stable/11/sys/powerpc/include/pcb.h ============================================================================== --- stable/11/sys/powerpc/include/pcb.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/powerpc/include/pcb.h Fri Apr 6 19:17:59 2018 (r332135) @@ -37,6 +37,7 @@ #include +#ifndef _STANDALONE struct pcb { register_t pcb_context[20]; /* non-volatile r14-r31 */ register_t pcb_cr; /* Condition register */ @@ -79,6 +80,7 @@ struct pcb { } booke; } pcb_cpu; }; +#endif #ifdef _KERNEL Modified: stable/11/sys/riscv/include/_types.h ============================================================================== --- stable/11/sys/riscv/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/riscv/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -56,8 +56,10 @@ typedef unsigned long __uint64_t; */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; Modified: stable/11/sys/sparc64/include/_types.h ============================================================================== --- stable/11/sys/sparc64/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/sparc64/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -56,8 +56,10 @@ typedef unsigned long __uint64_t; */ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif typedef __int64_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; Modified: stable/11/sys/sys/_types.h ============================================================================== --- stable/11/sys/sys/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/sys/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -102,7 +102,9 @@ typedef __uint_least32_t __char32_t; typedef struct { long long __max_align1 __aligned(_Alignof(long long)); +#ifndef _STANDALONE long double __max_align2 __aligned(_Alignof(long double)); +#endif } __max_align_t; typedef __uint32_t __dev_t; /* device number */ Modified: stable/11/sys/x86/include/_types.h ============================================================================== --- stable/11/sys/x86/include/_types.h Fri Apr 6 19:11:58 2018 (r332134) +++ stable/11/sys/x86/include/_types.h Fri Apr 6 19:17:59 2018 (r332135) @@ -78,15 +78,19 @@ typedef unsigned long long __uint64_t; #ifdef __LP64__ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; +#ifndef _STANDALONE typedef double __double_t; typedef float __float_t; +#endif typedef __int64_t __intfptr_t; typedef __int64_t __intptr_t; #else typedef unsigned long __clock_t; typedef __int32_t __critical_t; +#ifndef _STANDALONE typedef long double __double_t; typedef long double __float_t; +#endif typedef __int32_t __intfptr_t; typedef __int32_t __intptr_t; #endif From owner-svn-src-all@freebsd.org Fri Apr 6 19:20:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3B5FA09A8; Fri, 6 Apr 2018 19:20:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 972F270EDF; Fri, 6 Apr 2018 19:20:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9202C1602B; Fri, 6 Apr 2018 19:20:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JKjxg022969; Fri, 6 Apr 2018 19:20:45 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JKj4b022968; Fri, 6 Apr 2018 19:20:45 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061920.w36JKj4b022968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 19:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332136 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 332136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:20:46 -0000 Author: kp Date: Fri Apr 6 19:20:45 2018 New Revision: 332136 URL: https://svnweb.freebsd.org/changeset/base/332136 Log: pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. There's no obvious limit to the request size for these, so we limit the requests to something which won't overflow. Change the memory allocation to M_NOWAIT so excessive requests will fail rather than stall forever. MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 19:17:59 2018 (r332135) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 19:20:45 2018 (r332136) @@ -3143,10 +3143,17 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } + totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); - if (! ioes) { + M_TEMP, M_NOWAIT); + if (ioes == NULL) { error = ENOMEM; break; } @@ -3349,13 +3356,20 @@ DIOCCHANGEADDR_error: break; } + if (io->pfiio_size < 0 || + WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { + error = EINVAL; + break; + } + bufsiz = io->pfiio_size * sizeof(struct pfi_kif); ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), - M_TEMP, M_WAITOK); - if (! ifstore) { + M_TEMP, M_NOWAIT); + if (ifstore == NULL) { error = ENOMEM; break; } + PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); From owner-svn-src-all@freebsd.org Fri Apr 6 19:21:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94173FA0A60; Fri, 6 Apr 2018 19:21:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43E47710A8; Fri, 6 Apr 2018 19:21:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3ED2F16156; Fri, 6 Apr 2018 19:21:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JLUvQ024516; Fri, 6 Apr 2018 19:21:30 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JLUV2024515; Fri, 6 Apr 2018 19:21:30 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061921.w36JLUV2024515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 19:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332137 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 332137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:21:30 -0000 Author: kp Date: Fri Apr 6 19:21:29 2018 New Revision: 332137 URL: https://svnweb.freebsd.org/changeset/base/332137 Log: pf tests: Basic ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT Validate the DIOCIGETIFACES and DIOCXCOMMIT ioctls with invalid values. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 19:20:45 2018 (r332136) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 19:21:29 2018 (r332137) @@ -255,6 +255,63 @@ ATF_TC_BODY(settflags, tc) COMMON_CLEANUP(); } +ATF_TC_WITHOUT_HEAD(igetifaces); +ATF_TC_BODY(igetifaces, tc) +{ + struct pfioc_iface io; + struct pfi_kif kif; + + COMMON_HEAD(); + + bzero(&io, sizeof(io)); + io.pfiio_flags = 0; + io.pfiio_buffer = &kif; + io.pfiio_esize = sizeof(kif); + + /* Negative size */ + io.pfiio_size = -1; + if (ioctl(dev, DIOCIGETIFACES, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + /* Overflow size */ + io.pfiio_size = 1 << 31; + if (ioctl(dev, DIOCIGETIFACES, &io) == 0) + atf_tc_fail("request with size 1 << 31 succeeded"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(commit); +ATF_TC_BODY(commit, tc) +{ + struct pfioc_trans io; + struct pfioc_trans_e ioe; + + COMMON_HEAD(); + + bzero(&io, sizeof(io)); + io.esize = sizeof(ioe); + io.array = &ioe; + + /* Negative size */ + io.size = -1; + if (ioctl(dev, DIOCXCOMMIT, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + /* Overflow size */ + io.size = 1 << 30; + if (ioctl(dev, DIOCXCOMMIT, &io) == 0) + atf_tc_fail("request with size 1 << 30 succeeded"); + + /* NULL buffer */ + io.size = 1; + io.array = NULL; + if (ioctl(dev, DIOCXCOMMIT, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + COMMON_CLEANUP(); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, addtables); @@ -263,6 +320,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, gettstats); ATF_TP_ADD_TC(tp, clrtstats); ATF_TP_ADD_TC(tp, settflags); + ATF_TP_ADD_TC(tp, igetifaces); + ATF_TP_ADD_TC(tp, commit); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Fri Apr 6 19:21:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C984FA0AAF; Fri, 6 Apr 2018 19:21:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 299C3711AC; Fri, 6 Apr 2018 19:21:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 246C916167; Fri, 6 Apr 2018 19:21:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JLbIT025268; Fri, 6 Apr 2018 19:21:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JLbtk025259; Fri, 6 Apr 2018 19:21:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061921.w36JLbtk025259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332138 - in stable/11/stand: libsa userboot/userboot zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: libsa userboot/userboot zfs X-SVN-Commit-Revision: 332138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:21:38 -0000 Author: kevans Date: Fri Apr 6 19:21:36 2018 New Revision: 332138 URL: https://svnweb.freebsd.org/changeset/base/332138 Log: MFC r329879, r329892 r329879: libsa: Const-ify buffer argument of write(2) analog r329892: libsa: Change write(2)-alike prototype to match definition Broken in r329879. Apparently old GCC detects this, but modern GCC didn't. Mea culpa. Modified: stable/11/stand/libsa/cd9660.c stable/11/stand/libsa/nfs.c stable/11/stand/libsa/nullfs.c stable/11/stand/libsa/stand.h stable/11/stand/libsa/tftp.c stable/11/stand/libsa/ufs.c stable/11/stand/libsa/write.c stable/11/stand/userboot/userboot/host.c stable/11/stand/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/cd9660.c ============================================================================== --- stable/11/stand/libsa/cd9660.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/cd9660.c Fri Apr 6 19:21:36 2018 (r332138) @@ -66,7 +66,7 @@ static int cd9660_open(const char *path, struct open_f static int cd9660_close(struct open_file *f); static int cd9660_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int cd9660_write(struct open_file *f, void *buf, size_t size, +static int cd9660_write(struct open_file *f, const void *buf, size_t size, size_t *resid); static off_t cd9660_seek(struct open_file *f, off_t offset, int where); static int cd9660_stat(struct open_file *f, struct stat *sb); @@ -557,7 +557,8 @@ again: } static int -cd9660_write(struct open_file *f __unused, void *start __unused, size_t size __unused, size_t *resid __unused) +cd9660_write(struct open_file *f __unused, const void *buf __unused, + size_t size __unused, size_t *resid __unused) { return EROFS; } Modified: stable/11/stand/libsa/nfs.c ============================================================================== --- stable/11/stand/libsa/nfs.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/nfs.c Fri Apr 6 19:21:36 2018 (r332138) @@ -126,7 +126,6 @@ struct nfs_iodesc { int nfs_open(const char *path, struct open_file *f); static int nfs_close(struct open_file *f); static int nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t nfs_seek(struct open_file *f, off_t offset, int where); static int nfs_stat(struct open_file *f, struct stat *sb); static int nfs_readdir(struct open_file *f, struct dirent *d); @@ -138,7 +137,7 @@ struct fs_ops nfs_fsops = { nfs_open, nfs_close, nfs_read, - nfs_write, + null_write, nfs_seek, nfs_stat, nfs_readdir @@ -713,15 +712,6 @@ ret: *resid = size; return (0); -} - -/* - * Not implemented. - */ -int -nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid) -{ - return (EROFS); } off_t Modified: stable/11/stand/libsa/nullfs.c ============================================================================== --- stable/11/stand/libsa/nullfs.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/nullfs.c Fri Apr 6 19:21:36 2018 (r332138) @@ -83,7 +83,7 @@ int null_read (struct open_file *f, void *buf, size_t return EIO; } -int null_write (struct open_file *f, void *buf, size_t size, size_t *resid) +int null_write (struct open_file *f, const void *buf, size_t size, size_t *resid) { return EIO; } Modified: stable/11/stand/libsa/stand.h ============================================================================== --- stable/11/stand/libsa/stand.h Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/stand.h Fri Apr 6 19:21:36 2018 (r332138) @@ -105,7 +105,7 @@ struct fs_ops { int (*fo_close)(struct open_file *f); int (*fo_read)(struct open_file *f, void *buf, size_t size, size_t *resid); - int (*fo_write)(struct open_file *f, void *buf, + int (*fo_write)(struct open_file *f, const void *buf, size_t size, size_t *resid); off_t (*fo_seek)(struct open_file *f, off_t offset, int where); int (*fo_stat)(struct open_file *f, struct stat *sb); @@ -289,7 +289,7 @@ extern int open(const char *, int); extern int close(int); extern void closeall(void); extern ssize_t read(int, void *, size_t); -extern ssize_t write(int, void *, size_t); +extern ssize_t write(int, const void *, size_t); extern struct dirent *readdirfd(int); extern void srandom(u_long seed); @@ -383,7 +383,7 @@ extern void nullsys(void); extern int null_open(const char *path, struct open_file *f); extern int null_close(struct open_file *f); extern int null_read(struct open_file *f, void *buf, size_t size, size_t *resid); -extern int null_write(struct open_file *f, void *buf, size_t size, size_t *resid); +extern int null_write(struct open_file *f, const void *buf, size_t size, size_t *resid); extern off_t null_seek(struct open_file *f, off_t offset, int where); extern int null_stat(struct open_file *f, struct stat *sb); extern int null_readdir(struct open_file *f, struct dirent *d); Modified: stable/11/stand/libsa/tftp.c ============================================================================== --- stable/11/stand/libsa/tftp.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/tftp.c Fri Apr 6 19:21:36 2018 (r332138) @@ -69,7 +69,8 @@ static int tftp_open(const char *path, struct open_fil static int tftp_close(struct open_file *f); static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); +static int tftp_write(struct open_file *f, const void *buf, size_t size, + size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); @@ -574,8 +575,8 @@ tftp_close(struct open_file *f) } static int -tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused, - size_t *resid __unused /* out */) +tftp_write(struct open_file *f __unused, const void *start __unused, + size_t size __unused, size_t *resid __unused /* out */) { return (EROFS); } Modified: stable/11/stand/libsa/ufs.c ============================================================================== --- stable/11/stand/libsa/ufs.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/ufs.c Fri Apr 6 19:21:36 2018 (r332138) @@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$"); #include "string.h" static int ufs_open(const char *path, struct open_file *f); -static int ufs_write(struct open_file *f, void *buf, size_t size, size_t *resid); +static int ufs_write(struct open_file *f, const void *buf, size_t size, + size_t *resid); static int ufs_close(struct open_file *f); static int ufs_read(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t ufs_seek(struct open_file *f, off_t offset, int where); @@ -131,7 +132,7 @@ struct file { static int read_inode(ino_t, struct open_file *); static int block_map(struct open_file *, ufs2_daddr_t, ufs2_daddr_t *); static int buf_read_file(struct open_file *, char **, size_t *); -static int buf_write_file(struct open_file *, char *, size_t *); +static int buf_write_file(struct open_file *, const char *, size_t *); static int search_directory(char *, struct open_file *, ino_t *); /* @@ -301,7 +302,7 @@ block_map(f, file_block, disk_block_p) static int buf_write_file(f, buf_p, size_p) struct open_file *f; - char *buf_p; + const char *buf_p; size_t *size_p; /* out */ { struct file *fp = (struct file *)f->f_fsdata; @@ -764,14 +765,14 @@ ufs_read(f, start, size, resid) static int ufs_write(f, start, size, resid) struct open_file *f; - void *start; + const void *start; size_t size; size_t *resid; /* out */ { struct file *fp = (struct file *)f->f_fsdata; size_t csize; int rc = 0; - char *addr = start; + const char *addr = start; csize = size; while ((size != 0) && (csize != 0)) { Modified: stable/11/stand/libsa/write.c ============================================================================== --- stable/11/stand/libsa/write.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/libsa/write.c Fri Apr 6 19:21:36 2018 (r332138) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); ssize_t write(fd, dest, bcount) int fd; - void *dest; + const void *dest; size_t bcount; { struct open_file *f = &files[fd]; @@ -82,7 +82,8 @@ write(fd, dest, bcount) if (f->f_flags & F_RAW) { twiddle(4); errno = (f->f_dev->dv_strategy)(f->f_devdata, F_WRITE, - btodb(f->f_offset), bcount, dest, &resid); + btodb(f->f_offset), bcount, __DECONST(void *, dest), + &resid); if (errno) return (-1); f->f_offset += resid; Modified: stable/11/stand/userboot/userboot/host.c ============================================================================== --- stable/11/stand/userboot/userboot/host.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/userboot/userboot/host.c Fri Apr 6 19:21:36 2018 (r332138) @@ -74,16 +74,6 @@ host_read(struct open_file *f, void *start, size_t siz return (CALLBACK(read, f->f_fsdata, start, size, resid)); } -/* - * Don't be silly - the bootstrap has no business writing anything. - */ -static int -host_write(struct open_file *f, void *start, size_t size, size_t *resid) -{ - - return (EROFS); -} - static off_t host_seek(struct open_file *f, off_t offset, int where) { @@ -183,7 +173,7 @@ struct fs_ops host_fsops = { host_open, host_close, host_read, - host_write, + null_write, host_seek, host_stat, host_readdir Modified: stable/11/stand/zfs/zfs.c ============================================================================== --- stable/11/stand/zfs/zfs.c Fri Apr 6 19:21:29 2018 (r332137) +++ stable/11/stand/zfs/zfs.c Fri Apr 6 19:21:36 2018 (r332138) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #define ZFS_BE_LAST 8 static int zfs_open(const char *path, struct open_file *f); -static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); static int zfs_read(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t zfs_seek(struct open_file *f, off_t offset, int where); @@ -67,7 +66,7 @@ struct fs_ops zfs_fsops = { zfs_open, zfs_close, zfs_read, - zfs_write, + null_write, zfs_seek, zfs_stat, zfs_readdir @@ -169,16 +168,6 @@ zfs_read(struct open_file *f, void *start, size_t size *resid = size - n; return (0); -} - -/* - * Don't be silly - the bootstrap has no business writing anything. - */ -static int -zfs_write(struct open_file *f, void *start, size_t size, size_t *resid /* out */) -{ - - return (EROFS); } static off_t From owner-svn-src-all@freebsd.org Fri Apr 6 19:22:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88B6FA0C0B; Fri, 6 Apr 2018 19:22:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9026D713E4; Fri, 6 Apr 2018 19:22:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2941619D; Fri, 6 Apr 2018 19:22:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JMM0R027550; Fri, 6 Apr 2018 19:22:22 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JMMWA027549; Fri, 6 Apr 2018 19:22:22 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061922.w36JMMWA027549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 19:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332139 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 332139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:22:22 -0000 Author: kp Date: Fri Apr 6 19:22:22 2018 New Revision: 332139 URL: https://svnweb.freebsd.org/changeset/base/332139 Log: pf tests: Try to provoke a memory leak There was a memory leak in the DIOCRADDTABLES ioctl() code which could be triggered by trying to add tables with the same name. Try to provoke this memory leak. It was fixed in r331225. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 19:21:36 2018 (r332138) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 19:22:22 2018 (r332139) @@ -66,6 +66,7 @@ ATF_TC_BODY(addtables, tc) { struct pfioc_table io; struct pfr_table tbl; + struct pfr_table tbls[4]; int flags; COMMON_HEAD(); @@ -92,6 +93,14 @@ ATF_TC_BODY(addtables, tc) io.pfrio_buffer = NULL; if (ioctl(dev, DIOCRADDTABLES, &io) == 0) atf_tc_fail("Request with NULL buffer succeeded"); + + /* This can provoke a memory leak, see r331225. */ + io.pfrio_size = 4; + for (int i = 0; i < io.pfrio_size; i++) + common_init_tbl(&tbls[i]); + + io.pfrio_buffer = &tbls; + ioctl(dev, DIOCRADDTABLES, &io); COMMON_CLEANUP(); } From owner-svn-src-all@freebsd.org Fri Apr 6 19:24:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C85FFA0F57; Fri, 6 Apr 2018 19:24:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A45F371619; Fri, 6 Apr 2018 19:24:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85E64161B4; Fri, 6 Apr 2018 19:24:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JO4KB027657; Fri, 6 Apr 2018 19:24:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JO4ar027655; Fri, 6 Apr 2018 19:24:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061924.w36JO4ar027655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332140 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 332140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:24:05 -0000 Author: kevans Date: Fri Apr 6 19:24:04 2018 New Revision: 332140 URL: https://svnweb.freebsd.org/changeset/base/332140 Log: MFC r330026: libsa: Move MAXWAIT from net.h to net.c It's not a setting that has any effect or use outside of the net.c context. Modified: stable/11/stand/libsa/net.c stable/11/stand/libsa/net.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/net.c ============================================================================== --- stable/11/stand/libsa/net.c Fri Apr 6 19:22:22 2018 (r332139) +++ stable/11/stand/libsa/net.c Fri Apr 6 19:24:04 2018 (r332140) @@ -58,6 +58,20 @@ __FBSDID("$FreeBSD$"); #include "net.h" /* + * Maximum wait time for sending and receiving before we give up and timeout. + * If set to 0, operations will eventually timeout completely, but send/recv + * timeouts must progress exponentially from MINTMO to MAXTMO before final + * timeout is hit. + */ +#ifndef MAXWAIT +#define MAXWAIT 0 /* seconds */ +#endif + +#if MAXWAIT < 0 +#error MAXWAIT must not be a negative number +#endif + +/* * Send a packet and wait for a reply, with exponential backoff. * * The send routine must return the actual number of bytes written, Modified: stable/11/stand/libsa/net.h ============================================================================== --- stable/11/stand/libsa/net.h Fri Apr 6 19:22:22 2018 (r332139) +++ stable/11/stand/libsa/net.h Fri Apr 6 19:24:04 2018 (r332140) @@ -61,20 +61,6 @@ enum net_proto { #define MAXTMO 120 /* seconds */ #define MINTMO 2 /* seconds */ -/* - * Maximum wait time for sending and receiving before we give up and timeout. - * If set to 0, operations will eventually timeout completely, but send/recv - * timeouts must progress exponentially from MINTMO to MAXTMO before final - * timeout is hit. - */ -#ifndef MAXWAIT -#define MAXWAIT 0 /* seconds */ -#endif - -#if MAXWAIT < 0 -#error MAXWAIT must not be a negative number -#endif - #define FNAME_SIZE 128 #define IFNAME_SIZE 16 #define RECV_SIZE 1536 /* XXX delete this */ From owner-svn-src-all@freebsd.org Fri Apr 6 19:00:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7AD6F9F2CA for ; Fri, 6 Apr 2018 19:00:32 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x232.google.com (mail-yb0-x232.google.com [IPv6:2607:f8b0:4002:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F3C46FB9B for ; Fri, 6 Apr 2018 19:00:32 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x232.google.com with SMTP id k1-v6so744555yba.5 for ; Fri, 06 Apr 2018 12:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cU6bZ0faTKiqdazf9o5QyYz+eW+0DlIva94eFBjHGE8=; b=Ktm1zHHSmcC5nshiiA1xt8wWOSg6Y8jozQ3DhwcNOZ0aSQ0ks9jIFblokxpz0KteON QZYiAjCZj9mDre6ESe5Yz0xzprNcVQ+jI/nPKKHBZAZaOGpRWzSTzKmhgHfdh4MrxTmS nj6bhFQXnwz+fafEZ9tpR1SLQSFuQO5rKiK+zSfi0SNEMG1KoV94qZliZ3Mk3J6e675U xvotddG1qFXAsoR36xroOFVzbKc8KRM7UFiVO6VNlUwW6dh8/S7FybiNZ6y+RY8RTRfk wyQQnSbjuC7vCF/orrwinBQASV8fDJ0rJnAmcXkRYW0ARV6B0JuQjG2I1bUfBkWj0kwV uQgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cU6bZ0faTKiqdazf9o5QyYz+eW+0DlIva94eFBjHGE8=; b=poKWfH/HZmashCRttoVr+GrSi8IQxBl3fs/wNhB17fXVu+gBN7McnUwZOyGTso43Mm Ypc3GXO7vYIBPSkZ61LMv7aLy5XsRl1MRKR4mOLKJru82XKOFhyvrAIWblv3rGPpTqWi G0L9iMgpLrVBClrfapuREwy+sin0TdxHyyULgtmDpXDSvNeOQ4XQLIFx5mzRfyoWB2DY p6jFfXS7met19CpgBkU2E3ueLSa5SUjNaYpBauzXQPyH+iDKcaTFDQae+sdOrlDxEW7J bjRLxLtJEgxGnL2J88WzCu/tsjqLIaz+gHFqftEnfCzD74XEZfbjLW54Uuc1ojeWwAg1 mrTQ== X-Gm-Message-State: ALQs6tDO1LrkgSUVaBYW61YdNbZP/i4qJ16Fv4kO0Vr/3v8TkiVUmMwd u44+Qpb4m2OY1fOd6p5wAgyz2QhK/N1EYbJvFolcXA== X-Google-Smtp-Source: AIpwx49Uyw9coK/YDsiIp8nqI3lnF9acdlG7VjlTS4PZBTjZHrCKxD8pyXQayFv3fOhwOuozRXwjh7UENj2NLN1sCm0= X-Received: by 2002:a25:5047:: with SMTP id e68-v6mr15655086ybb.165.1523041231480; Fri, 06 Apr 2018 12:00:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5b:64b:0:0:0:0:0 with HTTP; Fri, 6 Apr 2018 12:00:30 -0700 (PDT) In-Reply-To: <2526702.9M648BMneK@ralph.baldwin.cx> References: <201803311138.w2VBcKHP014025@repo.freebsd.org> <20180331184109.GA23589@lonesome.com> <2526702.9M648BMneK@ralph.baldwin.cx> From: Oliver Pinter Date: Fri, 6 Apr 2018 21:00:30 +0200 Message-ID: Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... To: John Baldwin Cc: Ed Maste , Antoine Brodin , src-committers , re , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric , svn-src-stable-11@freebsd.org, Mark Linimon Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Fri, 06 Apr 2018 19:30:06 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 19:00:33 -0000 On 4/6/18, John Baldwin wrote: > On Monday, April 02, 2018 12:27:47 PM Ed Maste wrote: >> On 31 March 2018 at 14:41, Mark Linimon wrote: >> This is the most important point of this discussion: we do need to >> ensure there's good communication and coordination between teams where >> dependencies like this exist. I'll take the blame here: Dimitry asked >> me about merging the Clang update to stable/11 and I agreed that it >> was reasonable to merge sooner rather than later to have as much lead >> time as possible before the 11.2 process starts. I also assumed that >> outstanding Clang 6 issues in ports were farther along in being >> addressed. >> >> The key lesson from this discussion is that for significant commits >> and merges like this one we should make sure to always have sufficient >> advance notice. > > Is this driven by -mretpoline? Don't think so since it requires LLD as linker. The LLVM 5 which was already part of the 11-stable has the retpoline option. See r331219. >From other side, I like to see a newer compiler sets in the recent releases, because there are lot of performance improvements and other fixes. > That is, would we not be as aggressive > with pushing for clang 6 in 11.2 if it weren't for that? I kind of feel > like we probably wouldn't and would have left it at 5 and let clang 6 be > a FreeBSD 12 thing. Was -mretpoline backported to clang 5 (I thought > there was some talk of providing patches for clang 5)? > > -- > John Baldwin > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to > "svn-src-stable-11-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Fri Apr 6 19:34:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BFE1FA1A4E; Fri, 6 Apr 2018 19:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E73571DA4; Fri, 6 Apr 2018 19:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 192E716372; Fri, 6 Apr 2018 19:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JYL9a032974; Fri, 6 Apr 2018 19:34:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JYLJD032971; Fri, 6 Apr 2018 19:34:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061934.w36JYLJD032971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332141 - stable/11/stand/libsa X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/libsa X-SVN-Commit-Revision: 332141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:34:22 -0000 Author: kevans Date: Fri Apr 6 19:34:21 2018 New Revision: 332141 URL: https://svnweb.freebsd.org/changeset/base/332141 Log: MFC r330056: libsa: replace remaining _write callbacks by null_write There are some _write callbacks left only returning EROFS, replace them by null_write. return EROFS from null_write(). Modified: stable/11/stand/libsa/cd9660.c stable/11/stand/libsa/nullfs.c stable/11/stand/libsa/tftp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/cd9660.c ============================================================================== --- stable/11/stand/libsa/cd9660.c Fri Apr 6 19:24:04 2018 (r332140) +++ stable/11/stand/libsa/cd9660.c Fri Apr 6 19:34:21 2018 (r332141) @@ -66,8 +66,6 @@ static int cd9660_open(const char *path, struct open_f static int cd9660_close(struct open_file *f); static int cd9660_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int cd9660_write(struct open_file *f, const void *buf, size_t size, - size_t *resid); static off_t cd9660_seek(struct open_file *f, off_t offset, int where); static int cd9660_stat(struct open_file *f, struct stat *sb); static int cd9660_readdir(struct open_file *f, struct dirent *d); @@ -86,7 +84,7 @@ struct fs_ops cd9660_fsops = { cd9660_open, cd9660_close, cd9660_read, - cd9660_write, + null_write, cd9660_seek, cd9660_stat, cd9660_readdir @@ -554,13 +552,6 @@ again: fp->f_off += isonum_711(ep->length); return (0); -} - -static int -cd9660_write(struct open_file *f __unused, const void *buf __unused, - size_t size __unused, size_t *resid __unused) -{ - return EROFS; } static off_t Modified: stable/11/stand/libsa/nullfs.c ============================================================================== --- stable/11/stand/libsa/nullfs.c Fri Apr 6 19:24:04 2018 (r332140) +++ stable/11/stand/libsa/nullfs.c Fri Apr 6 19:34:21 2018 (r332141) @@ -85,7 +85,7 @@ int null_read (struct open_file *f, void *buf, size_t int null_write (struct open_file *f, const void *buf, size_t size, size_t *resid) { - return EIO; + return EROFS; } off_t null_seek (struct open_file *f, off_t offset, int where) Modified: stable/11/stand/libsa/tftp.c ============================================================================== --- stable/11/stand/libsa/tftp.c Fri Apr 6 19:24:04 2018 (r332140) +++ stable/11/stand/libsa/tftp.c Fri Apr 6 19:34:21 2018 (r332141) @@ -69,8 +69,6 @@ static int tftp_open(const char *path, struct open_fil static int tftp_close(struct open_file *f); static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); -static int tftp_write(struct open_file *f, const void *buf, size_t size, - size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); @@ -80,7 +78,7 @@ struct fs_ops tftp_fsops = { tftp_open, tftp_close, tftp_read, - tftp_write, + null_write, tftp_seek, tftp_stat, null_readdir @@ -572,13 +570,6 @@ tftp_close(struct open_file *f) } is_open = 0; return (0); -} - -static int -tftp_write(struct open_file *f __unused, const void *start __unused, - size_t size __unused, size_t *resid __unused /* out */) -{ - return (EROFS); } static int From owner-svn-src-all@freebsd.org Fri Apr 6 19:36:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A9BFA1CF8; Fri, 6 Apr 2018 19:36:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF54471F6D; Fri, 6 Apr 2018 19:36:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5FBA16373; Fri, 6 Apr 2018 19:36:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JaZ8v033105; Fri, 6 Apr 2018 19:36:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JaZVq033104; Fri, 6 Apr 2018 19:36:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061936.w36JaZVq033104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 19:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332142 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 332142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:36:36 -0000 Author: kp Date: Fri Apr 6 19:36:35 2018 New Revision: 332142 URL: https://svnweb.freebsd.org/changeset/base/332142 Log: pf: Improve ioctl validation Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations. MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 19:34:21 2018 (r332141) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Apr 6 19:36:35 2018 (r332142) @@ -2740,9 +2740,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2772,9 +2777,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2804,10 +2814,18 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || io->pfrio_size2 < 0) { + error = EINVAL; + break; + } count = max(io->pfrio_size, io->pfrio_size2); + if (WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, - M_WAITOK); + M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2838,9 +2856,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2864,9 +2887,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, - sizeof(struct pfr_astats), M_TEMP, M_WAITOK); + sizeof(struct pfr_astats), M_TEMP, M_NOWAIT); if (! pfrastats) { error = ENOMEM; break; @@ -2890,9 +2918,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2922,9 +2955,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2954,9 +2992,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -3001,9 +3044,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; @@ -3072,9 +3120,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; From owner-svn-src-all@freebsd.org Fri Apr 6 19:37:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0AFFFA1D79; Fri, 6 Apr 2018 19:37:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6330F72093; Fri, 6 Apr 2018 19:37:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E0DF16379; Fri, 6 Apr 2018 19:37:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JbFw3033185; Fri, 6 Apr 2018 19:37:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JbFfx033184; Fri, 6 Apr 2018 19:37:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804061937.w36JbFfx033184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 6 Apr 2018 19:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332143 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 332143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:37:15 -0000 Author: kp Date: Fri Apr 6 19:37:15 2018 New Revision: 332143 URL: https://svnweb.freebsd.org/changeset/base/332143 Log: pf tests: Basic ioctl validation Basic validation tests for DIOCRADDADDRS, DIOCRDELADDRS, DIOCRSETADDRS, DIOCRGETADDRS, DIOCRGETASTATS, DIOCRCLRASTATS, DIOCRTSTADDRS, DIOCRINADEFINE, DIOCXBEGIN and DIOCXROLLBACK. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 19:36:35 2018 (r332142) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Fri Apr 6 19:37:15 2018 (r332143) @@ -264,6 +264,232 @@ ATF_TC_BODY(settflags, tc) COMMON_CLEANUP(); } +ATF_TC_WITHOUT_HEAD(addaddrs); +ATF_TC_BODY(addaddrs, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRADDADDRS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 28; + if (ioctl(dev, DIOCRADDADDRS, &io) == 0) + atf_tc_fail("Reuqest with size 1 << 28 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(deladdrs); +ATF_TC_BODY(deladdrs, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRDELADDRS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 28; + if (ioctl(dev, DIOCRDELADDRS, &io) == 0) + atf_tc_fail("Reuqest with size 1 << 28 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(setaddrs); +ATF_TC_BODY(setaddrs, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRSETADDRS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 28; + if (ioctl(dev, DIOCRSETADDRS, &io) == 0) + atf_tc_fail("Reuqest with size 1 << 28 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(getaddrs); +ATF_TC_BODY(getaddrs, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + common_init_tbl(&io.pfrio_table); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRGETADDRS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRGETADDRS, &io) == 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(getastats); +ATF_TC_BODY(getastats, tc) +{ + struct pfioc_table io; + struct pfr_astats astats; + + COMMON_HEAD(); + + bzero(&astats, sizeof(astats)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &astats; + io.pfrio_esize = sizeof(astats); + + common_init_tbl(&io.pfrio_table); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRGETASTATS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRGETASTATS, &io) == 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(clrastats); +ATF_TC_BODY(clrastats, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + common_init_tbl(&io.pfrio_table); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRCLRASTATS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRCLRASTATS, &io) == 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(tstaddrs); +ATF_TC_BODY(tstaddrs, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + common_init_tbl(&io.pfrio_table); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRTSTADDRS, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRTSTADDRS, &io) == 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(inadefine); +ATF_TC_BODY(inadefine, tc) +{ + struct pfioc_table io; + struct pfr_addr addr; + + COMMON_HEAD(); + + bzero(&addr, sizeof(addr)); + bzero(&io, sizeof(io)); + io.pfrio_flags = 0; + io.pfrio_buffer = &addr; + io.pfrio_esize = sizeof(addr); + + common_init_tbl(&io.pfrio_table); + + /* Negative size. */ + io.pfrio_size = -1; + if (ioctl(dev, DIOCRINADEFINE, &io) == 0) + atf_tc_fail("Request with size -1 succeeded"); + + /* Overly large size. */ + io.pfrio_size = 1 << 24; + if (ioctl(dev, DIOCRINADEFINE, &io) == 0) + atf_tc_fail("Request with size 1 << 24 failed"); + + COMMON_CLEANUP(); +} + ATF_TC_WITHOUT_HEAD(igetifaces); ATF_TC_BODY(igetifaces, tc) { @@ -290,6 +516,68 @@ ATF_TC_BODY(igetifaces, tc) COMMON_CLEANUP(); } +ATF_TC_WITHOUT_HEAD(cxbegin); +ATF_TC_BODY(cxbegin, tc) +{ + struct pfioc_trans io; + struct pfioc_trans_e ioe; + + COMMON_HEAD(); + + bzero(&io, sizeof(io)); + io.esize = sizeof(ioe); + io.array = &ioe; + + /* Negative size */ + io.size = -1; + if (ioctl(dev, DIOCXBEGIN, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + /* Overflow size */ + io.size = 1 << 30; + if (ioctl(dev, DIOCXBEGIN, &io) == 0) + atf_tc_fail("request with size 1 << 30 succeeded"); + + /* NULL buffer */ + io.size = 1; + io.array = NULL; + if (ioctl(dev, DIOCXBEGIN, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + COMMON_CLEANUP(); +} + +ATF_TC_WITHOUT_HEAD(cxrollback); +ATF_TC_BODY(cxrollback, tc) +{ + struct pfioc_trans io; + struct pfioc_trans_e ioe; + + COMMON_HEAD(); + + bzero(&io, sizeof(io)); + io.esize = sizeof(ioe); + io.array = &ioe; + + /* Negative size */ + io.size = -1; + if (ioctl(dev, DIOCXROLLBACK, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + /* Overflow size */ + io.size = 1 << 30; + if (ioctl(dev, DIOCXROLLBACK, &io) == 0) + atf_tc_fail("request with size 1 << 30 succeeded"); + + /* NULL buffer */ + io.size = 1; + io.array = NULL; + if (ioctl(dev, DIOCXROLLBACK, &io) == 0) + atf_tc_fail("request with size -1 succeeded"); + + COMMON_CLEANUP(); +} + ATF_TC_WITHOUT_HEAD(commit); ATF_TC_BODY(commit, tc) { @@ -329,7 +617,16 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, gettstats); ATF_TP_ADD_TC(tp, clrtstats); ATF_TP_ADD_TC(tp, settflags); + ATF_TP_ADD_TC(tp, addaddrs); + ATF_TP_ADD_TC(tp, deladdrs); + ATF_TP_ADD_TC(tp, setaddrs); + ATF_TP_ADD_TC(tp, getaddrs); + ATF_TP_ADD_TC(tp, clrastats); + ATF_TP_ADD_TC(tp, tstaddrs); + ATF_TP_ADD_TC(tp, inadefine); ATF_TP_ADD_TC(tp, igetifaces); + ATF_TP_ADD_TC(tp, cxbegin); + ATF_TP_ADD_TC(tp, cxrollback); ATF_TP_ADD_TC(tp, commit); return (atf_no_error()); From owner-svn-src-all@freebsd.org Fri Apr 6 19:47:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 578F5F808BA; Fri, 6 Apr 2018 19:47:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 043DF7287B; Fri, 6 Apr 2018 19:47:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F317C16514; Fri, 6 Apr 2018 19:47:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Jl7qR038167; Fri, 6 Apr 2018 19:47:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Jl7tg038163; Fri, 6 Apr 2018 19:47:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061947.w36Jl7tg038163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332144 - in stable/11: share/mk stand stand/efi X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: share/mk stand stand/efi X-SVN-Commit-Revision: 332144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:47:08 -0000 Author: kevans Date: Fri Apr 6 19:47:07 2018 New Revision: 332144 URL: https://svnweb.freebsd.org/changeset/base/332144 Log: MFC r330077, r330248 r330077: Move EFI up to common makefile. There's no need for all these .if's based on architecture. Sponsored by: Netflix r330248: Create LOADER_UBOOT, and LOADER_OFW. Move these options out of Makefile.${MACHINE_ARCH} and remove the now-empty files. Generate the *32 directories on the necessary architectures (well, currently only amd64) on the fly. Remove LOADER_EFI variable and co-locate it with EFI. Deleted: stable/11/stand/Makefile.arm stable/11/stand/Makefile.arm64 stable/11/stand/Makefile.i386 stable/11/stand/Makefile.mips stable/11/stand/Makefile.powerpc stable/11/stand/Makefile.sparc64 Modified: stable/11/share/mk/src.opts.mk stable/11/stand/Makefile stable/11/stand/Makefile.amd64 stable/11/stand/efi/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Fri Apr 6 19:37:15 2018 (r332143) +++ stable/11/share/mk/src.opts.mk Fri Apr 6 19:47:07 2018 (r332144) @@ -131,6 +131,8 @@ __DEFAULT_YES_OPTIONS = \ LPR \ LS_COLORS \ LZMA_SUPPORT \ + LOADER_OFW \ + LOADER_UBOOT \ MAIL \ MAILWRAPPER \ MAKE \ @@ -276,9 +278,23 @@ BROKEN_OPTIONS+=LLDB .if ${__T} != "armv6" BROKEN_OPTIONS+=LIBSOFT .endif +# EFI doesn't exist on mips, powerpc, sparc or riscv. .if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} BROKEN_OPTIONS+=EFI .endif +# GELI isn't supported on !x86 +.if ${__T} != "i386" && ${__T} != "amd64" +BROKEN_OPTIONS+=LOADER_GELI +.endif +# OFW is only for powerpc and sparc64, exclude others +.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" +BROKEN_OPTIONS+=LOADER_OFW +.endif +# UBOOT is only for arm, mips and powerpc, exclude others +.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "" +BROKEN_OPTIONS+=LOADER_UBOOT +.endif + .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE Modified: stable/11/stand/Makefile ============================================================================== --- stable/11/stand/Makefile Fri Apr 6 19:37:15 2018 (r332143) +++ stable/11/stand/Makefile Fri Apr 6 19:47:07 2018 (r332144) @@ -2,20 +2,43 @@ .include -SUBDIR+= libsa -.if ${MK_FORTH} != "no" -# Build the add-in FORTH interpreter. -SUBDIR+= ficl -SUBDIR+= forth +# For amd64 we have to build 32 and 64 bit versions of things. For +# others we don't. LIB32LIST is a list of libraries, which if +# included, need to be built 32-bit as well. +.if ${MACHINE_ARCH} == "amd64" +LIB32LIST=libsa ficl liblua zfs .endif -SUBDIR+= defaults -SUBDIR+= man +S.yes+= libsa +S.${MK_FORTH}+= ficl +S.${MK_FORTH}+= forth +S.${MK_LOADER_LUA}+= liblua +S.${MK_LOADER_LUA}+= lua +S.${MK_FDT}+= fdt +S.${MK_LOADER_OFW}+= ofw +S.${MK_ZFS}+= zfs +S.yes+= defaults +S.yes+= man + +S.${MK_LOADER_GELI}+= geli + .include +S.${MK_EFI}+= efi +S.${MK_LOADER_UBOOT}+= uboot + .if exists(${.CURDIR}/${MACHINE}/.) -SUBDIR+= ${MACHINE} +S.yes+= ${MACHINE} .endif + +# Build the actual subdir list from S.yes, adding in the 32-bit +# variant if necessary. +.for _x in ${S.yes} +SUBDIR+=${_x} +.if defined(LIB32LIST) && ${LIB32LIST:M${_x}} +SUBDIR+=${_x}32 +.endif +.endfor .include Modified: stable/11/stand/Makefile.amd64 ============================================================================== --- stable/11/stand/Makefile.amd64 Fri Apr 6 19:37:15 2018 (r332143) +++ stable/11/stand/Makefile.amd64 Fri Apr 6 19:47:07 2018 (r332144) @@ -1,18 +1,4 @@ # $FreeBSD$ -SUBDIR+= libsa32 -.if ${MK_ZFS} != "no" -SUBDIR+= zfs zfs32 -.endif -.if ${MK_FORTH} != "no" -SUBDIR+= ficl32 -.endif - -SUBDIR+= efi -SUBDIR+= userboot - -.if ${MK_LOADER_GELI} == "yes" -SUBDIR+= geli -.endif - -SUBDIR+= i386 +S.yes+= userboot +S.yes+= i386 Modified: stable/11/stand/efi/Makefile ============================================================================== --- stable/11/stand/efi/Makefile Fri Apr 6 19:37:15 2018 (r332143) +++ stable/11/stand/efi/Makefile Fri Apr 6 19:47:07 2018 (r332144) @@ -8,17 +8,11 @@ NO_OBJ=t # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" SUBDIR+= fdt .endif -.endif -.if ${MACHINE_CPUARCH} == "aarch64" || \ - ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" SUBDIR+= libefi loader boot1 -.endif .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 From owner-svn-src-all@freebsd.org Fri Apr 6 19:47:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCAF1F80998; Fri, 6 Apr 2018 19:47:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF9B729BA; Fri, 6 Apr 2018 19:47:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C8E16515; Fri, 6 Apr 2018 19:47:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Jljib038234; Fri, 6 Apr 2018 19:47:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Jljbb038232; Fri, 6 Apr 2018 19:47:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804061947.w36Jljbb038232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 6 Apr 2018 19:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332145 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 332145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:47:46 -0000 Author: mav Date: Fri Apr 6 19:47:44 2018 New Revision: 332145 URL: https://svnweb.freebsd.org/changeset/base/332145 Log: Do not fail devices just for errors in descriptor format. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Fri Apr 6 19:47:07 2018 (r332144) +++ head/sys/cam/scsi/scsi_cd.c Fri Apr 6 19:47:44 2018 (r332145) @@ -1119,7 +1119,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) * supported" (0x25) error. */ if ((have_sense) && (asc != 0x25) - && (error_code == SSD_CURRENT_ERROR)) { + && (error_code == SSD_CURRENT_ERROR + || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; const char *asc_desc; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 6 19:47:07 2018 (r332144) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 6 19:47:44 2018 (r332145) @@ -4649,7 +4649,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || ((have_sense) && - (error_code == SSD_CURRENT_ERROR) && + (error_code == SSD_CURRENT_ERROR || + error_code == SSD_DESC_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { cam_periph_lock(periph); softc->flags &= ~DA_FLAG_CAN_RC16; @@ -4674,7 +4675,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) */ if ((have_sense) && (asc != 0x25) && (asc != 0x44) - && (error_code == SSD_CURRENT_ERROR)) { + && (error_code == SSD_CURRENT_ERROR + || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; const char *asc_desc; From owner-svn-src-all@freebsd.org Fri Apr 6 19:49:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E59DF80C60; Fri, 6 Apr 2018 19:49:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D069B72BF2; Fri, 6 Apr 2018 19:49:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB2AC1652A; Fri, 6 Apr 2018 19:49:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JnvjE038348; Fri, 6 Apr 2018 19:49:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JnvEd038347; Fri, 6 Apr 2018 19:49:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061949.w36JnvEd038347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332146 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 332146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:49:58 -0000 Author: kevans Date: Fri Apr 6 19:49:57 2018 New Revision: 332146 URL: https://svnweb.freebsd.org/changeset/base/332146 Log: Re-sort LOADER options These have become unsorted from everything else. This is desync'd from stable/11 due to some hand-merging that was done there, so the MFC of this will look slightly different. MFC after: 3 days Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Apr 6 19:47:44 2018 (r332145) +++ head/share/mk/src.opts.mk Fri Apr 6 19:49:57 2018 (r332146) @@ -129,14 +129,14 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ + LOADER_GELI \ + LOADER_OFW \ + LOADER_UBOOT \ LOCALES \ LOCATE \ LPR \ LS_COLORS \ LZMA_SUPPORT \ - LOADER_GELI \ - LOADER_OFW \ - LOADER_UBOOT \ MAIL \ MAILWRAPPER \ MAKE \ From owner-svn-src-all@freebsd.org Fri Apr 6 19:52:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 461B0F81028; Fri, 6 Apr 2018 19:52:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E788D72ED9; Fri, 6 Apr 2018 19:52:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E26D01669B; Fri, 6 Apr 2018 19:52:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Jq0MV042067; Fri, 6 Apr 2018 19:52:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Jq0u4042066; Fri, 6 Apr 2018 19:52:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061952.w36Jq0u4042066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332147 - stable/11/stand X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand X-SVN-Commit-Revision: 332147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:52:01 -0000 Author: kevans Date: Fri Apr 6 19:52:00 2018 New Revision: 332147 URL: https://svnweb.freebsd.org/changeset/base/332147 Log: Revert lua bits that snuck in with r332144 These will get re-MFC'd differently when we import lualoader from head. This is a direct commit to stable/11 Modified: stable/11/stand/Makefile Modified: stable/11/stand/Makefile ============================================================================== --- stable/11/stand/Makefile Fri Apr 6 19:49:57 2018 (r332146) +++ stable/11/stand/Makefile Fri Apr 6 19:52:00 2018 (r332147) @@ -6,15 +6,13 @@ # others we don't. LIB32LIST is a list of libraries, which if # included, need to be built 32-bit as well. .if ${MACHINE_ARCH} == "amd64" -LIB32LIST=libsa ficl liblua zfs +LIB32LIST=libsa ficl zfs .endif S.yes+= libsa S.${MK_FORTH}+= ficl S.${MK_FORTH}+= forth -S.${MK_LOADER_LUA}+= liblua -S.${MK_LOADER_LUA}+= lua S.${MK_FDT}+= fdt S.${MK_LOADER_OFW}+= ofw S.${MK_ZFS}+= zfs From owner-svn-src-all@freebsd.org Fri Apr 6 19:54:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D046F8127A; Fri, 6 Apr 2018 19:54:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 215A77321E; Fri, 6 Apr 2018 19:54:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C29A166D4; Fri, 6 Apr 2018 19:54:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JsAFY042979; Fri, 6 Apr 2018 19:54:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JsAXt042974; Fri, 6 Apr 2018 19:54:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061954.w36JsAXt042974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332148 - in stable/11/stand: efi i386 powerpc sparc64 uboot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: efi i386 powerpc sparc64 uboot X-SVN-Commit-Revision: 332148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:54:11 -0000 Author: kevans Date: Fri Apr 6 19:54:10 2018 New Revision: 332148 URL: https://svnweb.freebsd.org/changeset/base/332148 Log: MFC r330249-r330250 r330249: stand: Makefile SUBDIR cleanup Use SUBDIR.${MK_*} where appropriate. r330248 eliminated most of the offenders, sweep the rest under the rug. Differential Revision: https://reviews.freebsd.org/D14545 r330250: stand: Fix build after r330249 One does not simply convert to SUBDIR.yes in stand without making everything else in the affected files SUBDIR.yes -- there are better ways to do this. Modified: stable/11/stand/efi/Makefile stable/11/stand/i386/Makefile stable/11/stand/powerpc/Makefile stable/11/stand/sparc64/Makefile stable/11/stand/uboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/Makefile ============================================================================== --- stable/11/stand/efi/Makefile Fri Apr 6 19:52:00 2018 (r332147) +++ stable/11/stand/efi/Makefile Fri Apr 6 19:54:10 2018 (r332148) @@ -8,11 +8,8 @@ NO_OBJ=t # than 4.5 supports it. .if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 -.if ${MK_FDT} != "no" -SUBDIR+= fdt -.endif - -SUBDIR+= libefi loader boot1 +SUBDIR.${MK_FDT}+= fdt +SUBDIR.yes+= libefi loader boot1 .endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 Modified: stable/11/stand/i386/Makefile ============================================================================== --- stable/11/stand/i386/Makefile Fri Apr 6 19:52:00 2018 (r332147) +++ stable/11/stand/i386/Makefile Fri Apr 6 19:54:10 2018 (r332148) @@ -4,24 +4,20 @@ NO_OBJ=t .include -SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ +SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ libi386 -.if ${MK_LOADER_FIREWIRE} == "yes" -SUBDIR+= libfirewire -.endif +SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire -SUBDIR+= loader +SUBDIR.yes+= loader # special boot programs, 'self-extracting boot2+loader' -SUBDIR+= pxeldr +SUBDIR.yes+= pxeldr .if ${MACHINE_CPUARCH} == "i386" -SUBDIR+= kgzldr +SUBDIR.yes+= kgzldr .endif -.if ${MK_ZFS} != "no" -SUBDIR+= zfsboot gptzfsboot zfsloader -.endif +SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot zfsloader .include Modified: stable/11/stand/powerpc/Makefile ============================================================================== --- stable/11/stand/powerpc/Makefile Fri Apr 6 19:52:00 2018 (r332147) +++ stable/11/stand/powerpc/Makefile Fri Apr 6 19:54:10 2018 (r332148) @@ -4,9 +4,7 @@ NO_OBJ=t .include -SUBDIR= boot1.chrp ofw uboot -.if ${MK_FDT} == "yes" -SUBDIR+= kboot -.endif +SUBDIR.yes= boot1.chrp ofw uboot +SUBDIR.${MK_FDT}+= kboot .include Modified: stable/11/stand/sparc64/Makefile ============================================================================== --- stable/11/stand/sparc64/Makefile Fri Apr 6 19:52:00 2018 (r332147) +++ stable/11/stand/sparc64/Makefile Fri Apr 6 19:54:10 2018 (r332148) @@ -4,9 +4,7 @@ NO_OBJ=t .include -SUBDIR= boot1 loader -.if ${MK_ZFS} != "no" -SUBDIR+=zfsboot zfsloader -.endif +SUBDIR.yes= boot1 loader +SUBDIR.${MK_ZFS}+=zfsboot zfsloader .include Modified: stable/11/stand/uboot/Makefile ============================================================================== --- stable/11/stand/uboot/Makefile Fri Apr 6 19:52:00 2018 (r332147) +++ stable/11/stand/uboot/Makefile Fri Apr 6 19:54:10 2018 (r332148) @@ -2,10 +2,8 @@ .include -SUBDIR= lib +SUBDIR.yes= lib -.if ${MK_FDT} != "no" -SUBDIR+=fdt -.endif +SUBDIR.${MK_FDT}+=fdt .include From owner-svn-src-all@freebsd.org Fri Apr 6 19:59:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A966F817E1; Fri, 6 Apr 2018 19:59:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A47367350A; Fri, 6 Apr 2018 19:59:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A97B166DD; Fri, 6 Apr 2018 19:59:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36JxSxa043242; Fri, 6 Apr 2018 19:59:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36JxSsn043238; Fri, 6 Apr 2018 19:59:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804061959.w36JxSsn043238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 19:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332149 - in stable/11/stand/mips/beri: boot2 common loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/mips/beri: boot2 common loader X-SVN-Commit-Revision: 332149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 19:59:29 -0000 Author: kevans Date: Fri Apr 6 19:59:27 2018 New Revision: 332149 URL: https://svnweb.freebsd.org/changeset/base/332149 Log: MFC r330788: beri loader: Replace getc/putc with beri_ prefixed versions This matches a convention that we use, at least in ubldr, to prefix getc/putc with a loader-specific prefix to avoid collisions. This was encountered while trying to build the beri loader with MK_LOADER_LUA=yes. Modified: stable/11/stand/mips/beri/boot2/boot2.c stable/11/stand/mips/beri/common/altera_jtag_uart.c stable/11/stand/mips/beri/common/cons.h stable/11/stand/mips/beri/loader/beri_console.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/mips/beri/boot2/boot2.c ============================================================================== --- stable/11/stand/mips/beri/boot2/boot2.c Fri Apr 6 19:54:10 2018 (r332148) +++ stable/11/stand/mips/beri/boot2/boot2.c Fri Apr 6 19:59:27 2018 (r332149) @@ -627,7 +627,7 @@ static int xputc(int c) { if (ioctrl & IO_KEYBOARD) - putc(c); + beri_putc(c); #if 0 if (ioctrl & IO_SERIAL) sio_putc(c); @@ -642,7 +642,7 @@ xgetc(int fn) return 0; for (;;) { if (ioctrl & IO_KEYBOARD && keyhit(0)) - return fn ? 1 : getc(); + return fn ? 1 : beri_getc(); #if 0 if (ioctrl & IO_SERIAL && sio_ischar()) return fn ? 1 : sio_getc(); Modified: stable/11/stand/mips/beri/common/altera_jtag_uart.c ============================================================================== --- stable/11/stand/mips/beri/common/altera_jtag_uart.c Fri Apr 6 19:54:10 2018 (r332148) +++ stable/11/stand/mips/beri/common/altera_jtag_uart.c Fri Apr 6 19:59:27 2018 (r332149) @@ -159,7 +159,7 @@ keyhit(int seconds) } int -getc(void) +beri_getc(void) { while (!(uart_readable())); @@ -168,7 +168,7 @@ getc(void) } void -putc(int ch) +beri_putc(int ch) { uart_data_write(ch); Modified: stable/11/stand/mips/beri/common/cons.h ============================================================================== --- stable/11/stand/mips/beri/common/cons.h Fri Apr 6 19:54:10 2018 (r332148) +++ stable/11/stand/mips/beri/common/cons.h Fri Apr 6 19:59:27 2018 (r332149) @@ -33,8 +33,8 @@ #ifndef _CONS_H_ #define _CONS_H_ -int getc(void); +int beri_getc(void); int keyhit(int); -void putc(int); +void beri_putc(int); #endif Modified: stable/11/stand/mips/beri/loader/beri_console.c ============================================================================== --- stable/11/stand/mips/beri/loader/beri_console.c Fri Apr 6 19:54:10 2018 (r332148) +++ stable/11/stand/mips/beri/loader/beri_console.c Fri Apr 6 19:59:27 2018 (r332149) @@ -72,14 +72,14 @@ static void c_out(int c) { - putc(c); + beri_putc(c); } static int c_in(void) { - return (getc()); + return (beri_getc()); } static int From owner-svn-src-all@freebsd.org Fri Apr 6 20:24:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E656F836F4; Fri, 6 Apr 2018 20:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E80374845; Fri, 6 Apr 2018 20:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 393A016BBE; Fri, 6 Apr 2018 20:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36KOqqt058540; Fri, 6 Apr 2018 20:24:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36KOpTi058529; Fri, 6 Apr 2018 20:24:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804062024.w36KOpTi058529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 20:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332150 - in stable/11/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . common mips/beri/loader powerpc/kboot powerpc/ofw sparc64/loader uboot/common uboot/lib X-SVN-Commit-Revision: 332150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 20:24:52 -0000 Author: kevans Date: Fri Apr 6 20:24:50 2018 New Revision: 332150 URL: https://svnweb.freebsd.org/changeset/base/332150 Log: MFC r329190, r329315, r330131: metadata load file unification r329190: Unify metadata load files for arm, mips, powerpc, sparc64 Summary: All metadata.c files are very similar, with only trivial changes. Unify them into a single common file, with minor special-casing where needed. r329315: stand: Fix ubldr after r329190 metadata load files were consolidated in r329190, and these relocation fixup bits were inadvertently dropped in the process. Re-add them to fix boot with ubldr. r330131: Fix module loading on arm after the metadata.c unification in r329190. Arm modules need an additional address fixup not needed by other platforms. Added: stable/11/stand/common/metadata.c - copied, changed from r329190, head/stand/common/metadata.c Deleted: stable/11/stand/mips/beri/loader/metadata.c stable/11/stand/powerpc/kboot/metadata.c stable/11/stand/powerpc/ofw/metadata.c stable/11/stand/sparc64/loader/metadata.c stable/11/stand/uboot/common/metadata.c Modified: stable/11/stand/loader.mk stable/11/stand/mips/beri/loader/Makefile stable/11/stand/mips/beri/loader/exec.c stable/11/stand/mips/beri/loader/loader.h stable/11/stand/powerpc/kboot/Makefile stable/11/stand/powerpc/kboot/main.c stable/11/stand/powerpc/ofw/Makefile stable/11/stand/sparc64/loader/Makefile stable/11/stand/uboot.mk stable/11/stand/uboot/lib/elf_freebsd.c Directory Properties: stable/11/ (props changed) Copied and modified: stable/11/stand/common/metadata.c (from r329190, head/stand/common/metadata.c) ============================================================================== --- head/stand/common/metadata.c Tue Feb 13 03:44:50 2018 (r329190, copy source) +++ stable/11/stand/common/metadata.c Fri Apr 6 20:24:50 2018 (r332150) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __arm__ +#include +#endif #include #include "bootstrap.h" @@ -262,6 +265,7 @@ md_copymodules(vm_offset_t addr, int kern64) struct preloaded_file *fp; struct file_metadata *md; uint64_t scratch64; + uint32_t scratch32; int c; c = addr != 0; @@ -278,7 +282,11 @@ md_copymodules(vm_offset_t addr, int kern64) scratch64 = fp->f_size; MOD_SIZE(addr, scratch64, c); } else { - MOD_ADDR(addr, fp->f_addr, c); + scratch32 = fp->f_addr; +#ifdef __arm__ + scratch32 -= __elfN(relocation_offset); +#endif + MOD_ADDR(addr, scratch32, c); MOD_SIZE(addr, fp->f_size, c); } for (md = fp->f_metadata; md != NULL; md = md->md_next) { @@ -315,7 +323,23 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs uint64_t scratch64; char *rootdevname; int howto; +#ifdef __arm__ + vm_offset_t vaddr; + int i; + /* + * These metadata addreses must be converted for kernel after + * relocation. + */ + uint32_t mdt[] = { + MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, + MODINFOMD_ENVP, +#if defined(LOADER_FDT_SUPPORT) + MODINFOMD_DTBP +#endif + }; +#endif + align = kern64 ? 8 : 4; howto = md_getboothowto(args); @@ -409,6 +433,23 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs } else { bcopy(&kernend, md->md_data, sizeof kernend); } + +#ifdef __arm__ + /* Convert addresses to the final VA */ + *modulep -= __elfN(relocation_offset); + + /* Do relocation fixup on metadata of each module. */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + for (i = 0; i < nitems(mdt); i++) { + md = file_findmetadata(xp, mdt[i]); + if (md) { + bcopy(md->md_data, &vaddr, sizeof vaddr); + vaddr -= __elfN(relocation_offset); + bcopy(&vaddr, md->md_data, sizeof vaddr); + } + } + } +#endif (void)md_copymodules(addr, kern64); #if defined(LOADER_FDT_SUPPORT) Modified: stable/11/stand/loader.mk ============================================================================== --- stable/11/stand/loader.mk Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/loader.mk Fri Apr 6 20:24:50 2018 (r332150) @@ -22,12 +22,16 @@ SRCS+= load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == "powerpc" SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE_ARCH:Mmips64*} != "" SRCS+= load_elf64.c reloc_elf64.c +SRCS+= metadata.c .elif ${MACHINE} == "mips" SRCS+= load_elf32.c reloc_elf32.c +SRCS+= metadata.c .endif .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" Modified: stable/11/stand/mips/beri/loader/Makefile ============================================================================== --- stable/11/stand/mips/beri/loader/Makefile Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/mips/beri/loader/Makefile Fri Apr 6 20:24:50 2018 (r332150) @@ -47,7 +47,6 @@ SRCS= start.S \ main.c \ devicename.c \ exec.c \ - metadata.c \ vers.c \ arch.c Modified: stable/11/stand/mips/beri/loader/exec.c ============================================================================== --- stable/11/stand/mips/beri/loader/exec.c Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/mips/beri/loader/exec.c Fri Apr 6 20:24:50 2018 (r332150) @@ -85,7 +85,7 @@ beri_elf64_exec(struct preloaded_file *fp) } ehdr = (Elf_Ehdr *)md->md_data; - error = md_load64(fp->f_args, &mdp); + error = md_load64(fp->f_args, &mdp, NULL); if (error) { printf("%s: md_load64 failed\n", fp->f_name); return (error); Modified: stable/11/stand/mips/beri/loader/loader.h ============================================================================== --- stable/11/stand/mips/beri/loader/loader.h Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/mips/beri/loader/loader.h Fri Apr 6 20:24:50 2018 (r332150) @@ -56,7 +56,7 @@ extern char **boot2_envv; extern struct bootinfo boot2_bootinfo; /* metadata.c */ -int md_load64(char *args, vm_offset_t *modulep); +int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtbp); /* vers.c */ extern char bootprog_info[]; Modified: stable/11/stand/powerpc/kboot/Makefile ============================================================================== --- stable/11/stand/powerpc/kboot/Makefile Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/powerpc/kboot/Makefile Fri Apr 6 20:24:50 2018 (r332150) @@ -17,7 +17,7 @@ NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c +SRCS= conf.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c Modified: stable/11/stand/powerpc/kboot/main.c ============================================================================== --- stable/11/stand/powerpc/kboot/main.c Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/powerpc/kboot/main.c Fri Apr 6 20:24:50 2018 (r332150) @@ -291,6 +291,7 @@ main(int argc, const char **argv) setenv("currdev", bootdev, 1); setenv("loaddev", bootdev, 1); setenv("LINES", "24", 1); + setenv("usefdt", "1", 1); interact(); /* doesn't return */ Modified: stable/11/stand/powerpc/ofw/Makefile ============================================================================== --- stable/11/stand/powerpc/ofw/Makefile Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/powerpc/ofw/Makefile Fri Apr 6 20:24:50 2018 (r332150) @@ -17,7 +17,7 @@ NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c metadata.c vers.c start.c +SRCS= conf.c vers.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" Modified: stable/11/stand/sparc64/loader/Makefile ============================================================================== --- stable/11/stand/sparc64/loader/Makefile Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/sparc64/loader/Makefile Fri Apr 6 20:24:50 2018 (r332150) @@ -25,7 +25,7 @@ HAVE_ZFS= yes # Architecture-specific loader code .PATH: ${BOOTSRC}/sparc64/loader -SRCS= locore.S main.c metadata.c vers.c +SRCS= locore.S main.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG Modified: stable/11/stand/uboot.mk ============================================================================== --- stable/11/stand/uboot.mk Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/uboot.mk Fri Apr 6 20:24:50 2018 (r332150) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= main.c metadata.c +SRCS+= main.c .PATH: ${UBOOTSRC}/common @@ -10,6 +10,9 @@ CFLAGS+= -I${UBOOTSRC}/common LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${BOOTOBJ}/uboot/lib +.if ${MACHINE_CPUARCH} == "arm" +SRCS+= metadata.c +.endif .include "${BOOTSRC}/fdt.mk" Modified: stable/11/stand/uboot/lib/elf_freebsd.c ============================================================================== --- stable/11/stand/uboot/lib/elf_freebsd.c Fri Apr 6 19:59:27 2018 (r332149) +++ stable/11/stand/uboot/lib/elf_freebsd.c Fri Apr 6 20:24:50 2018 (r332150) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libuboot.h" -extern vm_offset_t md_load(char *, vm_offset_t *); +extern vm_offset_t md_load(char *, vm_offset_t *, vm_offset_t *); int __elfN(uboot_load)(char *filename, u_int64_t dest, @@ -81,7 +81,7 @@ __elfN(uboot_exec)(struct preloaded_file *fp) e = (Elf_Ehdr *)&fmp->md_data; - if ((error = md_load(fp->f_args, &mdp)) != 0) + if ((error = md_load(fp->f_args, &mdp, NULL)) != 0) return (error); entry = (void *)e->e_entry; From owner-svn-src-all@freebsd.org Fri Apr 6 20:26:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8577F839B3; Fri, 6 Apr 2018 20:26:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6416274A09; Fri, 6 Apr 2018 20:26:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC0516BBF; Fri, 6 Apr 2018 20:26:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36KQvjG058666; Fri, 6 Apr 2018 20:26:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36KQvYv058665; Fri, 6 Apr 2018 20:26:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804062026.w36KQvYv058665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 20:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332151 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 20:26:57 -0000 Author: brooks Date: Fri Apr 6 20:26:56 2018 New Revision: 332151 URL: https://svnweb.freebsd.org/changeset/base/332151 Log: ifconf(): correct handling of sockaddrs smaller than struct sockaddr. Portable programs that use SIOCGIFCONF (e.g. traceroute) assume that each pseudo ifreq is of length MAX(sizeof(struct ifreq), sizeof(ifr_name) + ifr_addr.sa_len). For short sockaddrs we copied too much from the source sockaddr resulting in a heap leak. I believe only one such sockaddr exists (struct sockaddr_sco which is 8 bytes) and it is unclear if such sockaddrs end up on interfaces in practice. If it did, the result would be an 8 byte heap leak on current architectures. admbugs: 869 Reviewed by: kib Obtained from: CheriBSD MFC after: 3 days Security: kernel heap leak Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14981 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Apr 6 20:24:50 2018 (r332150) +++ head/sys/net/if.c Fri Apr 6 20:26:56 2018 (r332151) @@ -3191,7 +3191,13 @@ again: continue; addrs++; if (sa->sa_len <= sizeof(*sa)) { - ifr.ifr_addr = *sa; + if (sa->sa_len < sizeof(*sa)) { + memset(&ifr.ifr_ifru.ifru_addr, 0, + sizeof(ifr.ifr_ifru.ifru_addr)); + memcpy(&ifr.ifr_ifru.ifru_addr, sa, + sa->sa_len); + } else + ifr.ifr_ifru.ifru_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); } else { From owner-svn-src-all@freebsd.org Fri Apr 6 20:27:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D8D8F83B4D; Fri, 6 Apr 2018 20:27:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA7D74B8E; Fri, 6 Apr 2018 20:27:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A88F16BC8; Fri, 6 Apr 2018 20:27:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36KRunc058750; Fri, 6 Apr 2018 20:27:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36KRtZk058743; Fri, 6 Apr 2018 20:27:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804062027.w36KRtZk058743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 20:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332152 - in stable/11/stand: ofw/common ofw/libofw powerpc/ofw X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: ofw/common ofw/libofw powerpc/ofw X-SVN-Commit-Revision: 332152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 20:27:56 -0000 Author: kevans Date: Fri Apr 6 20:27:55 2018 New Revision: 332152 URL: https://svnweb.freebsd.org/changeset/base/332152 Log: MFC r330365, r330371: OFW changes r330365: Move "common" Open Firmware parts of the loader used only on PowerPC to the powerpc/ subdirectory. These have never used by SPARC and we have no other (and almost certainly will have no other) Open Firmware platforms. This makes the directory structure simpler and lets us avoid some cargo-cult MI patterns on code that is, and always was, architecture-specific. r330371: Where we can, pass the kernel an FDT facsimile of the OF device tree rather than a pointer to Open Firmware by default. This eliminates a number of potentially unsafe calls to firmware from the kernel and provides better performance. This feature is meant to be expanded until it is on by default unconditionally and, ideally, we can then garbage-collect the nightmare pile of hacks required to call into Open Firmware from a live kernel. Added: stable/11/stand/powerpc/ofw/elf_freebsd.c - copied unchanged from r330365, head/stand/powerpc/ofw/elf_freebsd.c stable/11/stand/powerpc/ofw/main.c - copied, changed from r330365, head/stand/powerpc/ofw/main.c stable/11/stand/powerpc/ofw/ppc64_elf_freebsd.c - copied unchanged from r330365, head/stand/powerpc/ofw/ppc64_elf_freebsd.c Deleted: stable/11/stand/ofw/common/ stable/11/stand/ofw/libofw/elf_freebsd.c stable/11/stand/ofw/libofw/ppc64_elf_freebsd.c Modified: stable/11/stand/ofw/libofw/Makefile stable/11/stand/ofw/libofw/libofw.h stable/11/stand/powerpc/ofw/Makefile stable/11/stand/powerpc/ofw/conf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/ofw/libofw/Makefile ============================================================================== --- stable/11/stand/ofw/libofw/Makefile Fri Apr 6 20:26:56 2018 (r332151) +++ stable/11/stand/ofw/libofw/Makefile Fri Apr 6 20:27:55 2018 (r332152) @@ -4,7 +4,7 @@ LIB= ofw -SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ +SRCS= devicename.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c .PATH: ${ZFSSRC} @@ -12,10 +12,6 @@ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} - -.if ${MACHINE_CPUARCH} == "powerpc" -SRCS+= ppc64_elf_freebsd.c -.endif .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative Modified: stable/11/stand/ofw/libofw/libofw.h ============================================================================== --- stable/11/stand/ofw/libofw/libofw.h Fri Apr 6 20:26:56 2018 (r332151) +++ stable/11/stand/ofw/libofw/libofw.h Fri Apr 6 20:27:55 2018 (r332152) @@ -62,17 +62,9 @@ void ofw_memmap(int); struct preloaded_file; struct file_format; -int ofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **); -int ofw_elf_exec(struct preloaded_file *); - /* MD code implementing MI interfaces */ vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); - -extern struct file_format ofw_elf; -#ifdef __powerpc__ -extern struct file_format ofw_elf64; -#endif extern void reboot(void); Modified: stable/11/stand/powerpc/ofw/Makefile ============================================================================== --- stable/11/stand/powerpc/ofw/Makefile Fri Apr 6 20:26:56 2018 (r332151) +++ stable/11/stand/powerpc/ofw/Makefile Fri Apr 6 20:27:55 2018 (r332152) @@ -17,7 +17,7 @@ NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c vers.c start.c +SRCS= conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c SRCS+= ucmpdi2.c .include "${BOOTSRC}/fdt.mk" @@ -37,10 +37,6 @@ RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc - -# Pull in common loader code -.PATH: ${BOOTSRC}/ofw/common -.include "${BOOTSRC}/ofw/common/Makefile.inc" # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a Modified: stable/11/stand/powerpc/ofw/conf.c ============================================================================== --- stable/11/stand/powerpc/ofw/conf.c Fri Apr 6 20:26:56 2018 (r332151) +++ stable/11/stand/powerpc/ofw/conf.c Fri Apr 6 20:27:55 2018 (r332152) @@ -97,6 +97,9 @@ struct netif_driver *netif_drivers[] = { * rather than reading the file go first. */ +struct file_format ofw_elf; +struct file_format ofw_elf64; + struct file_format *file_formats[] = { &ofw_elf, &ofw_elf64, Copied: stable/11/stand/powerpc/ofw/elf_freebsd.c (from r330365, head/stand/powerpc/ofw/elf_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/powerpc/ofw/elf_freebsd.c Fri Apr 6 20:27:55 2018 (r332152, copy of r330365, head/stand/powerpc/ofw/elf_freebsd.c) @@ -0,0 +1,106 @@ +/*- + * Copyright (c) 2001 Benno Rice + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#if defined(__powerpc__) +#include +#endif + +#include + +#include "bootstrap.h" +#include "libofw.h" +#include "openfirm.h" + +extern char end[]; +extern vm_offset_t reloc; /* From /conf.c */ + +int +__elfN(ofw_loadfile)(char *filename, u_int64_t dest, + struct preloaded_file **result) +{ + int r; + + r = __elfN(loadfile)(filename, dest, result); + if (r != 0) + return (r); + +#if defined(__powerpc__) + /* + * No need to sync the icache for modules: this will + * be done by the kernel after relocation. + */ + if (!strcmp((*result)->f_type, "elf kernel")) + __syncicache((void *) (*result)->f_addr, (*result)->f_size); +#endif + return (0); +} + +int +__elfN(ofw_exec)(struct preloaded_file *fp) +{ + struct file_metadata *fmp; + vm_offset_t mdp, dtbp; + Elf_Ehdr *e; + int error; + intptr_t entry; + + if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { + return(EFTYPE); + } + e = (Elf_Ehdr *)&fmp->md_data; + entry = e->e_entry; + + if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0) + return (error); + + printf("Kernel entry at 0x%lx ...\n", e->e_entry); + + dev_cleanup(); + if (dtbp != 0) { + OF_quiesce(); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, + 0, 0, (void *)mdp, 0xfb5d104d); + } else { + OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, + (void *)mdp, 0xfb5d104d); + } + + panic("exec returned"); +} + +struct file_format ofw_elf = +{ + __elfN(ofw_loadfile), + __elfN(ofw_exec) +}; Copied and modified: stable/11/stand/powerpc/ofw/main.c (from r330365, head/stand/powerpc/ofw/main.c) ============================================================================== --- head/stand/powerpc/ofw/main.c Sat Mar 3 23:39:07 2018 (r330365, copy source) +++ stable/11/stand/powerpc/ofw/main.c Fri Apr 6 20:27:55 2018 (r332152) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "bootstrap.h" +#include + struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; @@ -47,6 +49,16 @@ static char heap[HEAP_SIZE]; // In BSS, so uses no spa #define OF_puts(fd, text) OF_write(fd, text, strlen(text)) +static __inline register_t +mfmsr(void) +{ + register_t value; + + __asm __volatile ("mfmsr %0" : "=r"(value)); + + return (value); +} + void init_heap(void) { @@ -144,6 +156,15 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); setenv("LINES", "24", 1); /* optional */ + + /* + * On non-Apple hardware, where it works reliably, pass flattened + * device trees to the kernel by default instead of OF CI pointers. + * Apple hardware is the only virtual-mode OF implementation in + * existence, so far as I am aware, so use that as a flag. + */ + if (!(mfmsr() & PSL_DR)) + setenv("usefdt", "1", 1); archsw.arch_getdev = ofw_getdev; archsw.arch_copyin = ofw_copyin; Copied: stable/11/stand/powerpc/ofw/ppc64_elf_freebsd.c (from r330365, head/stand/powerpc/ofw/ppc64_elf_freebsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/powerpc/ofw/ppc64_elf_freebsd.c Fri Apr 6 20:27:55 2018 (r332152, copy of r330365, head/stand/powerpc/ofw/ppc64_elf_freebsd.c) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2001 Benno Rice + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define __ELF_WORD_SIZE 64 + +#include +#include + +#include +#include +#include + +#include + +#include "bootstrap.h" +#include "libofw.h" +#include "openfirm.h" + +extern char end[]; +extern vm_offset_t reloc; /* From /conf.c */ + +int +ppc64_ofw_elf_loadfile(char *filename, u_int64_t dest, + struct preloaded_file **result) +{ + int r; + + r = __elfN(loadfile)(filename, dest, result); + if (r != 0) + return (r); + + /* + * No need to sync the icache for modules: this will + * be done by the kernel after relocation. + */ + if (!strcmp((*result)->f_type, "elf kernel")) + __syncicache((void *) (*result)->f_addr, (*result)->f_size); + return (0); +} + +int +ppc64_ofw_elf_exec(struct preloaded_file *fp) +{ + struct file_metadata *fmp; + vm_offset_t mdp, dtbp; + Elf_Ehdr *e; + int error; + intptr_t entry; + + if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) { + return(EFTYPE); + } + e = (Elf_Ehdr *)&fmp->md_data; + + /* Handle function descriptor for ELFv1 kernels */ + if ((e->e_flags & 3) == 2) + entry = e->e_entry; + else + entry = *(uint64_t *)(intptr_t)e->e_entry; + + if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) + return (error); + + printf("Kernel entry at 0x%lx ...\n", entry); + + dev_cleanup(); + + if (dtbp != 0) { + OF_quiesce(); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, + 0, 0, (void *)mdp, 0xfb5d104d); + } else { + OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, + (void *)mdp, 0xfb5d104d); + } + + panic("exec returned"); +} + +struct file_format ofw_elf64 = +{ + ppc64_ofw_elf_loadfile, + ppc64_ofw_elf_exec +}; From owner-svn-src-all@freebsd.org Fri Apr 6 20:56:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83E7CF85C6F; Fri, 6 Apr 2018 20:56:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3004C760A2; Fri, 6 Apr 2018 20:56:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AC2E170E5; Fri, 6 Apr 2018 20:56:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36Ku7fJ074507; Fri, 6 Apr 2018 20:56:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36Ku7e9074506; Fri, 6 Apr 2018 20:56:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804062056.w36Ku7e9074506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 20:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332153 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 332153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 20:56:07 -0000 Author: kevans Date: Fri Apr 6 20:56:06 2018 New Revision: 332153 URL: https://svnweb.freebsd.org/changeset/base/332153 Log: stable/11: Mark EFI as a broken option on pc98 This is a direct commit to stable/11, due to pc98 removal in head. Modified: stable/11/share/mk/src.opts.mk Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Fri Apr 6 20:27:55 2018 (r332152) +++ stable/11/share/mk/src.opts.mk Fri Apr 6 20:56:06 2018 (r332153) @@ -278,8 +278,9 @@ BROKEN_OPTIONS+=LLDB .if ${__T} != "armv6" BROKEN_OPTIONS+=LIBSOFT .endif -# EFI doesn't exist on mips, powerpc, sparc or riscv. -.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} +# EFI doesn't exist on mips, pc98, powerpc, sparc or riscv. +.if ${__T:Mmips*} || ${__TT:Mpc98*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || \ + ${__T:Mriscv*} BROKEN_OPTIONS+=EFI .endif # GELI isn't supported on !x86 From owner-svn-src-all@freebsd.org Fri Apr 6 21:06:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66712F86741; Fri, 6 Apr 2018 21:06:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E28267675D; Fri, 6 Apr 2018 21:06:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 01C5944E05; Fri, 6 Apr 2018 23:06:51 +0200 (CEST) From: Dimitry Andric Message-Id: <9DB407A8-8A6E-4F79-A5B3-5ED26AF37EEF@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_59E2B4E0-1F75-4305-9172-726B1C2294A3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r331838 - in stable/11: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/BlocksRuntime contrib/compiler-rt/lib/asan contrib/compiler-rt/l... Date: Fri, 6 Apr 2018 23:06:50 +0200 In-Reply-To: Cc: John Baldwin , Ed Maste , Antoine Brodin , src-committers , re , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-11@freebsd.org, Mark Linimon To: Oliver Pinter References: <201803311138.w2VBcKHP014025@repo.freebsd.org> <20180331184109.GA23589@lonesome.com> <2526702.9M648BMneK@ralph.baldwin.cx> X-Mailer: Apple Mail (2.3273) X-Mailman-Approved-At: Fri, 06 Apr 2018 21:25:26 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 21:06:53 -0000 --Apple-Mail=_59E2B4E0-1F75-4305-9172-726B1C2294A3 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 6 Apr 2018, at 21:00, Oliver Pinter wrote: > > On 4/6/18, John Baldwin wrote: >> On Monday, April 02, 2018 12:27:47 PM Ed Maste wrote: >>> On 31 March 2018 at 14:41, Mark Linimon wrote: >>> This is the most important point of this discussion: we do need to >>> ensure there's good communication and coordination between teams where >>> dependencies like this exist. I'll take the blame here: Dimitry asked >>> me about merging the Clang update to stable/11 and I agreed that it >>> was reasonable to merge sooner rather than later to have as much lead >>> time as possible before the 11.2 process starts. I also assumed that >>> outstanding Clang 6 issues in ports were farther along in being >>> addressed. >>> >>> The key lesson from this discussion is that for significant commits >>> and merges like this one we should make sure to always have sufficient >>> advance notice. >> >> Is this driven by -mretpoline? > > Don't think so since it requires LLD as linker. You can use lld on 11, but it isn't the default. > The LLVM 5 which was already > part of the 11-stable has the retpoline option. See r331219. Indeed, r331219 contains backports (from upstream) for llvm, clang *and* lld. If you want to make use of -mretpoline, you should also pass -fuse-ld=lld on the command line. > From other side, I like to see a newer compiler sets in the recent > releases, because > there are lot of performance improvements and other fixes. That is certainly the case, the flip side is that there are always some new bugs, regressions and newly added warnings. Having the default C++ dialect bumped is really an anomaly, this won't happen every upstream release. :) -Dimitry --Apple-Mail=_59E2B4E0-1F75-4305-9172-726B1C2294A3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWsfhagAKCRCwXqMKLiCW o1KkAKDuBRPEESSzWrVU1iq3IRWYFja7nwCfXTrNI0vMPx2R15vCoJcdJqBQAq8= =gktQ -----END PGP SIGNATURE----- --Apple-Mail=_59E2B4E0-1F75-4305-9172-726B1C2294A3-- From owner-svn-src-all@freebsd.org Fri Apr 6 21:37:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2762F889DD; Fri, 6 Apr 2018 21:37:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9961E778EF; Fri, 6 Apr 2018 21:37:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93DE9177B1; Fri, 6 Apr 2018 21:37:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36LbSiv094314; Fri, 6 Apr 2018 21:37:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36LbQXV094285; Fri, 6 Apr 2018 21:37:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804062137.w36LbQXV094285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 21:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332154 - in stable/11/stand: common efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/arm ficl/aarch64 ficl/amd64 ficl/arm ficl/i386 ficl/mips ficl/mips64 ficl/powerpc ficl/r... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: common efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/arm ficl/aarch64 ficl/amd64 ficl/arm ficl/i386 ficl/mips ficl/mips64 ficl/powerpc ficl/riscv ficl/sparc64 i386/bt... X-SVN-Commit-Revision: 332154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 21:37:29 -0000 Author: kevans Date: Fri Apr 6 21:37:25 2018 New Revision: 332154 URL: https://svnweb.freebsd.org/changeset/base/332154 Log: MFC r330806-r330815, r330837, r330864, r330883 pc98 changes associated with the named commits are also included in this commit, despite not having been made with the original commits due to its removal in head. r330806: Minor cosmetic changes. Make sure { on the same line as struct for all struct *devdesc. Move some type definitions to next to the dv_type define, since that's what sets the d_type. r330807: We can't use d_opendata for blkio storage. open_disk uses d_opendata for it's own purpse. We can't store blkio there. Fortunately, blkio is stored elsewhere and we never actually retrieve blkio from d_opendata. Eliminate it as a source of confusion. Eliminate all stores of d_opendata in efi since this layer doesn't own that field. r330808: Make struct libi386_devdesc match the struct devdesc better Move data to top and call it d_opendata. r330809: Use the actual struct devdesc at the start of all *_devdesc structs The current system is fragile and requires very careful layout of all *_devdesc structures. It also makes it hard to change the base devdesc. Take a page from CAM and put the 'header' in all the derived classes and adjust the code to match. For OFW, move the iHandle h_handle out of a slot conflicting with d_opendata. Due to quirks in the alignment rules, this worked. However changing the code to use d_opendata storage now that it's a pointer is hard, so just have a separate field for it. All other cleanups were to make the *_devdesc structures match where they'd taken some liberties that were none-the-less compatible enough to work. r330810: Remove d_type from devdesc. It's not needed as we can fetch it from d_dev->dv_type when we need it. r330811: GC unused routines. Sponsored by: Netflix r330812: Use the one-line-per-file pattern here, and sort the file names. Sponsored by: Netflix r330813: Move the env convenience routines out of boot1.c. These routines are more generally useful. Even though boot1 is on its way out, it's better to make these common during the transition than copy them. r330814: Star BootCurrent entry when booting. Sponsored by: Netflix r330815: Print the load and device path as well as BootCurrent and BootOrder Sponsored by: Netflix r330837: biosdisk.c should not set d_opendata. Same as 330807, d_opendata is owned by open_disk and we should not set it. M stand/i386/libi386/biosdisk.c r330864: Prefer uintXX_t to u_intXX_t A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. -- Ralph Waldo Emerson r330883: Fix typo that misteriously passes compilation. Added: stable/11/stand/efi/libefi/efienv.c - copied unchanged from r330815, head/stand/efi/libefi/efienv.c Modified: stable/11/stand/common/bootstrap.h stable/11/stand/common/disk.c stable/11/stand/common/disk.h stable/11/stand/common/isapnp.c stable/11/stand/common/load_elf.c stable/11/stand/common/load_elf_obj.c stable/11/stand/common/metadata.c stable/11/stand/common/misc.c stable/11/stand/common/pnp.c stable/11/stand/efi/boot1/boot1.c stable/11/stand/efi/boot1/ufs_module.c stable/11/stand/efi/include/efilib.h stable/11/stand/efi/libefi/Makefile stable/11/stand/efi/libefi/devicename.c stable/11/stand/efi/libefi/efipart.c stable/11/stand/efi/libefi/efizfs.c stable/11/stand/efi/libefi/env.c stable/11/stand/efi/loader/arch/arm/exec.c stable/11/stand/efi/loader/main.c stable/11/stand/ficl/aarch64/sysdep.c stable/11/stand/ficl/amd64/sysdep.c stable/11/stand/ficl/arm/sysdep.c stable/11/stand/ficl/i386/sysdep.c stable/11/stand/ficl/mips/sysdep.c stable/11/stand/ficl/mips64/sysdep.c stable/11/stand/ficl/powerpc/sysdep.c stable/11/stand/ficl/riscv/sysdep.c stable/11/stand/ficl/sparc64/sysdep.c stable/11/stand/i386/btx/lib/btxv86.h stable/11/stand/i386/libi386/biosacpi.c stable/11/stand/i386/libi386/bioscd.c stable/11/stand/i386/libi386/biosdisk.c stable/11/stand/i386/libi386/biospnp.c stable/11/stand/i386/libi386/bootinfo32.c stable/11/stand/i386/libi386/bootinfo64.c stable/11/stand/i386/libi386/devicename.c stable/11/stand/i386/libi386/elf64_freebsd.c stable/11/stand/i386/libi386/libi386.h stable/11/stand/i386/libi386/multiboot.c stable/11/stand/i386/libi386/pxe.c stable/11/stand/i386/loader/chain.c stable/11/stand/i386/loader/main.c stable/11/stand/libsa/arp.c stable/11/stand/libsa/bootp.c stable/11/stand/libsa/bootparam.c stable/11/stand/libsa/dosfs.h stable/11/stand/libsa/ext2fs.c stable/11/stand/libsa/net.h stable/11/stand/libsa/rpc.c stable/11/stand/libsa/stand.h stable/11/stand/mips/beri/loader/beri_disk_cfi.c stable/11/stand/mips/beri/loader/beri_disk_sdcard.c stable/11/stand/mips/beri/loader/devicename.c stable/11/stand/ofw/libofw/devicename.c stable/11/stand/ofw/libofw/libofw.h stable/11/stand/ofw/libofw/openfirm.c stable/11/stand/pc98/libpc98/bioscd.c stable/11/stand/pc98/libpc98/biosdisk.c stable/11/stand/pc98/loader/main.c stable/11/stand/powerpc/boot1.chrp/boot1.c stable/11/stand/powerpc/kboot/ppc64_elf_freebsd.c stable/11/stand/powerpc/ofw/elf_freebsd.c stable/11/stand/powerpc/ofw/main.c stable/11/stand/powerpc/ofw/ppc64_elf_freebsd.c stable/11/stand/sparc64/boot1/boot1.c stable/11/stand/sparc64/loader/main.c stable/11/stand/uboot/common/main.c stable/11/stand/uboot/lib/devicename.c stable/11/stand/uboot/lib/disk.c stable/11/stand/uboot/lib/elf_freebsd.c stable/11/stand/uboot/lib/libuboot.h stable/11/stand/userboot/userboot/bootinfo32.c stable/11/stand/userboot/userboot/bootinfo64.c stable/11/stand/userboot/userboot/devicename.c stable/11/stand/userboot/userboot/elf64_freebsd.c stable/11/stand/userboot/userboot/main.c stable/11/stand/userboot/userboot/userboot_disk.c stable/11/stand/zfs/libzfs.h stable/11/stand/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/bootstrap.h Fri Apr 6 21:37:25 2018 (r332154) @@ -150,7 +150,7 @@ void pnp_addident(struct pnpinfo *pi, char *ident); struct pnpinfo *pnp_allocinfo(void); void pnp_freeinfo(struct pnpinfo *pi); void pnp_addinfo(struct pnpinfo *pi); -char *pnp_eisaformat(u_int8_t *data); +char *pnp_eisaformat(uint8_t *data); /* * < 0 - No ISA in system @@ -168,7 +168,7 @@ extern int isapnp_readport; struct file_metadata { size_t md_size; - u_int16_t md_type; + uint16_t md_type; struct file_metadata *md_next; char md_data[1]; /* data are immediately appended */ }; @@ -210,7 +210,7 @@ struct preloaded_file struct file_format { /* Load function must return EFTYPE if it can't handle the module supplied */ - int (* l_load)(char *filename, u_int64_t dest, struct preloaded_file **result); + int (* l_load)(char *filename, uint64_t dest, struct preloaded_file **result); /* Only a loader that will load a kernel (first module) should have an exec handler */ int (* l_exec)(struct preloaded_file *mp); }; @@ -239,20 +239,20 @@ void file_removemetadata(struct preloaded_file *fp); #define ELF_RELOC_RELA 2 /* Relocation offset for some architectures */ -extern u_int64_t __elfN(relocation_offset); +extern uint64_t __elfN(relocation_offset); struct elf_file; typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx); -int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result); -int __elfN(obj_loadfile)(char *filename, u_int64_t dest, +int __elfN(loadfile)(char *filename, uint64_t dest, struct preloaded_file **result); +int __elfN(obj_loadfile)(char *filename, uint64_t dest, struct preloaded_file **result); int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata, int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len); -int __elfN(loadfile_raw)(char *filename, u_int64_t dest, +int __elfN(loadfile_raw)(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot); -int __elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest); +int __elfN(load_modmetadata)(struct preloaded_file *fp, uint64_t dest); #endif /* Modified: stable/11/stand/common/disk.c ============================================================================== --- stable/11/stand/common/disk.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/disk.c Fri Apr 6 21:37:25 2018 (r332154) @@ -86,7 +86,7 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o struct open_disk *od; dev = (struct disk_devdesc *)d; - od = (struct open_disk *)dev->d_opendata; + od = (struct open_disk *)dev->dd.d_opendata; /* * The strategy function assumes the offset is in units of 512 byte @@ -98,7 +98,7 @@ ptblread(void *d, void *buf, size_t blocks, uint64_t o * As the GPT backup partition is located at the end of the disk, * to avoid reading past disk end, flag bcache not to use RA. */ - return (dev->d_dev->dv_strategy(dev, F_READ | F_NORA, offset, + return (dev->dd.d_dev->dv_strategy(dev, F_READ | F_NORA, offset, blocks * od->sectorsize, (char *)buf, NULL)); } @@ -114,7 +114,7 @@ ptable_print(void *arg, const char *pname, const struc int res; pa = (struct print_args *)arg; - od = (struct open_disk *)pa->dev->d_opendata; + od = (struct open_disk *)pa->dev->dd.d_opendata; sprintf(line, " %s%s: %s", pa->prefix, pname, parttype2str(part->type)); if (pa->verbose) @@ -127,8 +127,8 @@ ptable_print(void *arg, const char *pname, const struc res = 0; if (part->type == PART_FREEBSD) { /* Open slice with BSD label */ - dev.d_dev = pa->dev->d_dev; - dev.d_unit = pa->dev->d_unit; + dev.dd.d_dev = pa->dev->dd.d_dev; + dev.dd.d_unit = pa->dev->dd.d_unit; dev.d_slice = part->index; dev.d_partition = -1; if (disk_open(&dev, part->end - part->start + 1, @@ -158,7 +158,7 @@ disk_print(struct disk_devdesc *dev, char *prefix, int struct print_args pa; /* Disk should be opened */ - od = (struct open_disk *)dev->d_opendata; + od = (struct open_disk *)dev->dd.d_opendata; pa.dev = dev; pa.prefix = prefix; pa.verbose = verbose; @@ -171,8 +171,8 @@ disk_read(struct disk_devdesc *dev, void *buf, uint64_ struct open_disk *od; int ret; - od = (struct open_disk *)dev->d_opendata; - ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, + od = (struct open_disk *)dev->dd.d_opendata; + ret = dev->dd.d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset, blocks * od->sectorsize, buf, NULL); return (ret); @@ -184,8 +184,8 @@ disk_write(struct disk_devdesc *dev, void *buf, uint64 struct open_disk *od; int ret; - od = (struct open_disk *)dev->d_opendata; - ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, + od = (struct open_disk *)dev->dd.d_opendata; + ret = dev->dd.d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset, blocks * od->sectorsize, buf, NULL); return (ret); @@ -194,7 +194,7 @@ disk_write(struct disk_devdesc *dev, void *buf, uint64 int disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *data) { - struct open_disk *od = dev->d_opendata; + struct open_disk *od = dev->dd.d_opendata; if (od == NULL) return (ENOTTY); @@ -238,7 +238,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize DEBUG("no memory"); return (ENOMEM); } - dev->d_opendata = od; + dev->dd.d_opendata = od; od->entrysize = 0; od->mediasize = mediasize; od->sectorsize = sectorsize; @@ -348,7 +348,7 @@ disk_close(struct disk_devdesc *dev) { struct open_disk *od; - od = (struct open_disk *)dev->d_opendata; + od = (struct open_disk *)dev->dd.d_opendata; DEBUG("%s closed => %p", disk_fmtdev(dev), od); ptable_close(od->table); free(od); @@ -361,7 +361,7 @@ disk_fmtdev(struct disk_devdesc *dev) static char buf[128]; char *cp; - cp = buf + sprintf(buf, "%s%d", dev->d_dev->dv_name, dev->d_unit); + cp = buf + sprintf(buf, "%s%d", dev->dd.d_dev->dv_name, dev->dd.d_unit); if (dev->d_slice >= 0) { #ifdef LOADER_GPT_SUPPORT if (dev->d_partition == 255) { @@ -423,7 +423,7 @@ disk_parsedev(struct disk_devdesc *dev, const char *de if (*cp != '\0' && *cp != ':') return (EINVAL); - dev->d_unit = unit; + dev->dd.d_unit = unit; dev->d_slice = slice; dev->d_partition = partition; if (path != NULL) Modified: stable/11/stand/common/disk.h ============================================================================== --- stable/11/stand/common/disk.h Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/disk.h Fri Apr 6 21:37:25 2018 (r332154) @@ -81,12 +81,9 @@ #ifndef _DISK_H #define _DISK_H -struct disk_devdesc -{ - struct devsw *d_dev; - int d_type; - int d_unit; - void *d_opendata; +/* Note: Must match the 'struct devdesc' in stand.h */ +struct disk_devdesc { + struct devdesc dd; int d_slice; int d_partition; uint64_t d_offset; Modified: stable/11/stand/common/isapnp.c ============================================================================== --- stable/11/stand/common/isapnp.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/isapnp.c Fri Apr 6 21:37:25 2018 (r332154) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); static void isapnp_write(int d, int r); static void isapnp_send_Initiation_LFSR(void); -static int isapnp_get_serial(u_int8_t *p); +static int isapnp_get_serial(uint8_t *p); static int isapnp_isolation_protocol(void); static void isapnp_enumerate(void); @@ -90,7 +90,7 @@ isapnp_send_Initiation_LFSR(void) * Get the device's serial number. Returns 1 if the serial is valid. */ static int -isapnp_get_serial(u_int8_t *data) +isapnp_get_serial(uint8_t *data) { int i, bit, valid = 0, sum = 0x6a; @@ -123,7 +123,7 @@ isapnp_get_serial(u_int8_t *data) * Returns nonzero if the device fails to report */ static int -isapnp_get_resource_info(u_int8_t *buffer, int len) +isapnp_get_resource_info(uint8_t *buffer, int len) { int i, j; u_char temp; @@ -229,7 +229,7 @@ isapnp_isolation_protocol(void) { int csn; struct pnpinfo *pi; - u_int8_t cardid[_PNP_ID_LEN]; + uint8_t cardid[_PNP_ID_LEN]; int ndevs; isapnp_send_Initiation_LFSR(); Modified: stable/11/stand/common/load_elf.c ============================================================================== --- stable/11/stand/common/load_elf.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/load_elf.c Fri Apr 6 21:37:25 2018 (r332154) @@ -70,11 +70,11 @@ typedef struct elf_file { caddr_t firstpage; size_t firstlen; int kernel; - u_int64_t off; + uint64_t off; } *elf_file_t; static int __elfN(loadimage)(struct preloaded_file *mp, elf_file_t ef, - u_int64_t loadaddr); + uint64_t loadaddr); static int __elfN(lookup_symbol)(struct preloaded_file *mp, elf_file_t ef, const char* name, Elf_Sym* sym); static int __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, @@ -87,7 +87,7 @@ static char *fake_modname(const char *name); const char *__elfN(kerneltype) = "elf kernel"; const char *__elfN(moduletype) = "elf module"; -u_int64_t __elfN(relocation_offset) = 0; +uint64_t __elfN(relocation_offset) = 0; extern void elf_wrong_field_size(void); #define CONVERT_FIELD(b, f, e) \ @@ -265,13 +265,13 @@ error: * will be saved in (result). */ int -__elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result) +__elfN(loadfile)(char *filename, uint64_t dest, struct preloaded_file **result) { return (__elfN(loadfile_raw)(filename, dest, result, 0)); } int -__elfN(loadfile_raw)(char *filename, u_int64_t dest, +__elfN(loadfile_raw)(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot) { struct preloaded_file *fp, *kfp; @@ -419,7 +419,7 @@ out: * the Elf header, load the image at (off) */ static int -__elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) +__elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) { int i; u_int j; @@ -883,21 +883,21 @@ fake_modname(const char *name) struct mod_metadata64 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - u_int64_t md_data; /* specific data */ - u_int64_t md_cval; /* common string label */ + uint64_t md_data; /* specific data */ + uint64_t md_cval; /* common string label */ }; #endif #if defined(__amd64__) && __ELF_WORD_SIZE == 32 struct mod_metadata32 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - u_int32_t md_data; /* specific data */ - u_int32_t md_cval; /* common string label */ + uint32_t md_data; /* specific data */ + uint32_t md_cval; /* common string label */ }; #endif int -__elfN(load_modmetadata)(struct preloaded_file *fp, u_int64_t dest) +__elfN(load_modmetadata)(struct preloaded_file *fp, uint64_t dest) { struct elf_file ef; int err, i, j; Modified: stable/11/stand/common/load_elf_obj.c ============================================================================== --- stable/11/stand/common/load_elf_obj.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/load_elf_obj.c Fri Apr 6 21:37:25 2018 (r332154) @@ -63,7 +63,7 @@ typedef struct elf_file { } *elf_file_t; static int __elfN(obj_loadimage)(struct preloaded_file *mp, elf_file_t ef, - u_int64_t loadaddr); + uint64_t loadaddr); static int __elfN(obj_lookup_set)(struct preloaded_file *mp, elf_file_t ef, const char *name, Elf_Addr *startp, Elf_Addr *stopp, int *countp); static int __elfN(obj_reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, @@ -81,7 +81,7 @@ const char *__elfN(obj_moduletype) = "elf obj module"; * will be saved in (result). */ int -__elfN(obj_loadfile)(char *filename, u_int64_t dest, +__elfN(obj_loadfile)(char *filename, uint64_t dest, struct preloaded_file **result) { struct preloaded_file *fp, *kfp; @@ -186,7 +186,7 @@ out: * the Elf header, load the image at (off) */ static int -__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) +__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) { Elf_Ehdr *hdr; Elf_Shdr *shdr, *cshdr, *lshdr; @@ -345,8 +345,8 @@ out: struct mod_metadata64 { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - u_int64_t md_data; /* specific data */ - u_int64_t md_cval; /* common string label */ + uint64_t md_data; /* specific data */ + uint64_t md_cval; /* common string label */ }; #endif Modified: stable/11/stand/common/metadata.c ============================================================================== --- stable/11/stand/common/metadata.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/metadata.c Fri Apr 6 21:37:25 2018 (r332154) @@ -217,7 +217,7 @@ md_copyenv(vm_offset_t addr) static int align; #define COPY32(v, a, c) { \ - u_int32_t x = (v); \ + uint32_t x = (v); \ if (c) \ archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ Modified: stable/11/stand/common/misc.c ============================================================================== --- stable/11/stand/common/misc.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/misc.c Fri Apr 6 21:37:25 2018 (r332154) @@ -185,7 +185,7 @@ hexdump(caddr_t region, size_t len) for (x = 0; x < 16; x++) { if ((line + x) < (region + len)) { - emit("%02x ", *(u_int8_t *)(line + x)); + emit("%02x ", *(uint8_t *)(line + x)); } else { emit("-- "); } @@ -195,7 +195,7 @@ hexdump(caddr_t region, size_t len) emit(" |"); for (x = 0; x < 16; x++) { if ((line + x) < (region + len)) { - c = *(u_int8_t *)(line + x); + c = *(uint8_t *)(line + x); if ((c < ' ') || (c > '~')) /* !isprint(c) */ c = '.'; emit("%c", c); Modified: stable/11/stand/common/pnp.c ============================================================================== --- stable/11/stand/common/pnp.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/common/pnp.c Fri Apr 6 21:37:25 2018 (r332154) @@ -169,7 +169,7 @@ pnp_addinfo(struct pnpinfo *pi) * where 'AAA' is the EISA vendor ID, II is the product ID and RR the revision ID. */ char * -pnp_eisaformat(u_int8_t *data) +pnp_eisaformat(uint8_t *data) { static char idbuf[8]; const char hextoascii[] = "0123456789abcdef"; Modified: stable/11/stand/efi/boot1/boot1.c ============================================================================== --- stable/11/stand/efi/boot1/boot1.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/boot1/boot1.c Fri Apr 6 21:37:25 2018 (r332154) @@ -54,8 +54,6 @@ static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCO static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; -static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; /* * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures @@ -80,42 +78,6 @@ Free(void *buf, const char *file __unused, int line __ (void)BS->FreePool(buf); } -static EFI_STATUS -efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) -{ - size_t ul; - CHAR16 *uv; - UINT32 attr; - UINTN dl; - EFI_STATUS rv; - - uv = NULL; - if (utf8_to_ucs2(v, &uv, &ul) != 0) - return (EFI_OUT_OF_RESOURCES); - dl = *len; - rv = RS->GetVariable(uv, g, &attr, &dl, data); - if (rv == EFI_SUCCESS) - *len = dl; - free(uv); - return (rv); -} - -static EFI_STATUS -efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) -{ - CHAR16 *var = NULL; - size_t len; - EFI_STATUS rv; - - if (utf8_to_ucs2(varname, &var, &len) != 0) - return (EFI_OUT_OF_RESOURCES); - rv = RS->SetVariable(var, &FreeBSDBootVarGUID, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, - (ucs2len(valstr) + 1) * sizeof(efi_char), valstr); - free(var); - return (rv); -} - /* * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, * FALSE otherwise. @@ -505,14 +467,15 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) boot_current = 0; sz = sizeof(boot_current); - efi_getenv(&GlobalBootVarGUID, "BootCurrent", &boot_current, &sz); + efi_global_getenv("BootCurrent", &boot_current, &sz); printf(" BootCurrent: %04x\n", boot_current); sz = sizeof(boot_order); - efi_getenv(&GlobalBootVarGUID, "BootOrder", &boot_order, &sz); + efi_global_getenv("BootOrder", &boot_order, &sz); printf(" BootOrder:"); for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x", boot_order[i]); + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); printf("\n"); #ifdef TEST_FAILURE Modified: stable/11/stand/efi/boot1/ufs_module.c ============================================================================== --- stable/11/stand/efi/boot1/ufs_module.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/boot1/ufs_module.c Fri Apr 6 21:37:25 2018 (r332154) @@ -44,7 +44,7 @@ static dev_info_t *devinfo; static dev_info_t *devices; static int -dskread(void *buf, u_int64_t lba, int nblk) +dskread(void *buf, uint64_t lba, int nblk) { int size; EFI_STATUS status; Modified: stable/11/stand/efi/include/efilib.h ============================================================================== --- stable/11/stand/efi/include/efilib.h Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/include/efilib.h Fri Apr 6 21:37:25 2018 (r332154) @@ -106,6 +106,17 @@ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); void cpy16to8(const CHAR16 *, char *, size_t); +/* + * Routines for interacting with EFI's env vars in a more unix-like + * way than the standard APIs. In addition, convenience routines for + * the loader setting / getting FreeBSD specific variables. + */ + +EFI_STATUS efi_freebsd_getenv(const char *v, void *data, __size_t *len); +EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, __size_t *len); +EFI_STATUS efi_global_getenv(const char *v, void *data, __size_t *len); +EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr); + /* efipart.c */ int efipart_inithandles(void); Modified: stable/11/stand/efi/libefi/Makefile ============================================================================== --- stable/11/stand/efi/libefi/Makefile Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/libefi/Makefile Fri Apr 6 21:37:25 2018 (r332154) @@ -5,8 +5,21 @@ LIB= efi WARNS?= 2 -SRCS= delay.c devpath.c efi_console.c efichar.c efinet.c efipart.c env.c errno.c \ - handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c devicename.c +SRCS= delay.c \ + devicename.c \ + devpath.c \ + efi_console.c \ + efi_driver_utils.c \ + efichar.c \ + efienv.c \ + efinet.c \ + efipart.c \ + efizfs.c \ + env.c \ + errno.c \ + handles.c \ + libefi.c \ + wchar.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c Modified: stable/11/stand/efi/libefi/devicename.c ============================================================================== --- stable/11/stand/efi/libefi/devicename.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/libefi/devicename.c Fri Apr 6 21:37:25 2018 (r332154) @@ -161,7 +161,6 @@ efi_parsedev(struct devdesc **dev, const char *devspec } idev->d_dev = dv; - idev->d_type = dv->dv_type; if (dev != NULL) *dev = idev; @@ -180,7 +179,7 @@ efi_fmtdev(void *vdev) struct devdesc *dev = (struct devdesc *)vdev; static char buf[SPECNAMELEN + 1]; - switch(dev->d_type) { + switch(dev->d_dev->dv_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; Copied: stable/11/stand/efi/libefi/efienv.c (from r330815, head/stand/efi/libefi/efienv.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/efi/libefi/efienv.c Fri Apr 6 21:37:25 2018 (r332154, copy of r330815, head/stand/efi/libefi/efienv.c) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2018 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; +static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; + +EFI_STATUS +efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) +{ + size_t ul; + CHAR16 *uv; + UINT32 attr; + UINTN dl; + EFI_STATUS rv; + + uv = NULL; + if (utf8_to_ucs2(v, &uv, &ul) != 0) + return (EFI_OUT_OF_RESOURCES); + dl = *len; + rv = RS->GetVariable(uv, g, &attr, &dl, data); + if (rv == EFI_SUCCESS) + *len = dl; + free(uv); + return (rv); +} + +EFI_STATUS +efi_global_getenv(const char *v, void *data, size_t *len) +{ + + return (efi_getenv(&GlobalBootVarGUID, v, data, len)); +} + +EFI_STATUS +efi_freebsd_getenv(const char *v, void *data, size_t *len) +{ + + return (efi_getenv(&FreeBSDBootVarGUID, v, data, len)); +} + +EFI_STATUS +efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr) +{ + CHAR16 *var = NULL; + size_t len; + EFI_STATUS rv; + + if (utf8_to_ucs2(varname, &var, &len) != 0) + return (EFI_OUT_OF_RESOURCES); + rv = RS->SetVariable(var, &FreeBSDBootVarGUID, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + (ucs2len(valstr) + 1) * sizeof(efi_char), valstr); + free(var); + return (rv); +} + Modified: stable/11/stand/efi/libefi/efipart.c ============================================================================== --- stable/11/stand/efi/libefi/efipart.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/libefi/efipart.c Fri Apr 6 21:37:25 2018 (r332154) @@ -744,11 +744,10 @@ efipart_print_common(struct devsw *dev, pdinfo_list_t continue; pd->pd_blkio = blkio; - pd_dev.d_dev = dev; - pd_dev.d_unit = pd->pd_unit; + pd_dev.dd.d_dev = dev; + pd_dev.dd.d_unit = pd->pd_unit; pd_dev.d_slice = -1; pd_dev.d_partition = -1; - pd_dev.d_opendata = blkio; ret = disk_open(&pd_dev, blkio->Media->BlockSize * (blkio->Media->LastBlock + 1), blkio->Media->BlockSize); @@ -821,7 +820,7 @@ efipart_open(struct open_file *f, ...) if (pd->pd_bcache == NULL) pd->pd_bcache = bcache_allocate(); - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { int rc; rc = disk_open(dev, @@ -860,7 +859,7 @@ efipart_close(struct open_file *f) bcache_free(pd->pd_bcache); pd->pd_bcache = NULL; } - if (dev->d_dev->dv_type == DEVT_DISK) + if (dev->dd.d_dev->dv_type == DEVT_DISK) return (disk_close(dev)); return (0); } @@ -880,7 +879,7 @@ efipart_ioctl(struct open_file *f, u_long cmd, void *d if (pd == NULL) return (EINVAL); - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { rc = disk_ioctl(dev, cmd, data); if (rc != ENOTTY) return (rc); @@ -967,7 +966,7 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, s bcd.dv_devdata = devdata; bcd.dv_cache = pd->pd_bcache; - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { daddr_t offset; offset = dev->d_offset * pd->pd_blkio->Media->BlockSize; @@ -1011,7 +1010,7 @@ efipart_realstrategy(void *devdata, int rw, daddr_t bl * partition. */ disk_blocks = 0; - if (dev->d_dev->dv_type == DEVT_DISK) { + if (dev->dd.d_dev->dv_type == DEVT_DISK) { if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { /* DIOCGMEDIASIZE does return bytes. */ disk_blocks /= blkio->Media->BlockSize; Modified: stable/11/stand/efi/libefi/efizfs.c ============================================================================== --- stable/11/stand/efi/libefi/efizfs.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/libefi/efizfs.c Fri Apr 6 21:37:25 2018 (r332154) @@ -29,8 +29,7 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include #ifdef EFI_ZFS_BOOT #include Modified: stable/11/stand/efi/libefi/env.c ============================================================================== --- stable/11/stand/efi/libefi/env.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/libefi/env.c Fri Apr 6 21:37:25 2018 (r332154) @@ -35,35 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -/* - * Simple wrappers to the underlying UEFI functions. - * See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES - * for details. - */ -EFI_STATUS -efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, - EFI_GUID *vendor_guid) -{ - return (RS->GetNextVariableName(variable_name_size, variable_name, - vendor_guid)); -} - -EFI_STATUS -efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, - UINT32 *attributes, UINTN *data_size, void *data) -{ - return (RS->GetVariable(variable_name, vendor_guid, attributes, - data_size, data)); -} - -EFI_STATUS -efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, - UINT32 attributes, UINTN data_size, void *data) -{ - return (RS->SetVariable(variable_name, vendor_guid, attributes, - data_size, data)); -} - void efi_init_environment(void) { Modified: stable/11/stand/efi/loader/arch/arm/exec.c ============================================================================== --- stable/11/stand/efi/loader/arch/arm/exec.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/loader/arch/arm/exec.c Fri Apr 6 21:37:25 2018 (r332154) @@ -47,7 +47,7 @@ extern vm_offset_t md_load(char *, vm_offset_t *); extern int bi_load(char *, vm_offset_t *, vm_offset_t *); static int -__elfN(arm_load)(char *filename, u_int64_t dest, +__elfN(arm_load)(char *filename, uint64_t dest, struct preloaded_file **result) { int r; Modified: stable/11/stand/efi/loader/main.c ============================================================================== --- stable/11/stand/efi/loader/main.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/efi/loader/main.c Fri Apr 6 21:37:25 2018 (r332154) @@ -175,9 +175,7 @@ set_devdesc_currdev(struct devsw *dev, int unit) char *devname; currdev.d_dev = dev; - currdev.d_type = currdev.d_dev->dv_type; currdev.d_unit = unit; - currdev.d_opendata = NULL; devname = efi_fmtdev(&currdev); env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, @@ -202,10 +200,8 @@ find_currdev(EFI_LOADED_IMAGE *img) if (pool_guid != 0) { struct zfs_devdesc currdev; - currdev.d_dev = &zfs_dev; - currdev.d_unit = 0; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_opendata = NULL; + currdev.dd.d_dev = &zfs_dev; + currdev.dd.d_unit = 0; currdev.pool_guid = pool_guid; currdev.root_guid = 0; devname = efi_fmtdev(&currdev); @@ -224,10 +220,8 @@ find_currdev(EFI_LOADED_IMAGE *img) STAILQ_FOREACH(dp, pdi_list, pd_link) { struct disk_devdesc currdev; - currdev.d_dev = &efipart_hddev; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = dp->pd_unit; - currdev.d_opendata = NULL; + currdev.dd.d_dev = &efipart_hddev; + currdev.dd.d_unit = dp->pd_unit; currdev.d_slice = -1; currdev.d_partition = -1; @@ -318,6 +312,12 @@ main(int argc, CHAR16 *argv[]) int i, j, vargood, howto; UINTN k; int has_kbd; + CHAR16 *text; + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; + EFI_DEVICE_PATH *imgpath; + EFI_STATUS status; #if !defined(__arm__) char buf[40]; #endif @@ -479,6 +479,36 @@ main(int argc, CHAR16 *argv[]) printf("\n%s", bootprog_info); + text = efi_devpath_name(img->FilePath); + if (text != NULL) { + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("LoaderPath", text); + efi_free_devpath_name(text); + } + + status = BS->HandleProtocol(img->DeviceHandle, &devid, (void **)&imgpath); + if (status == EFI_SUCCESS) { + text = efi_devpath_name(imgpath); + if (text != NULL) { + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("LoaderDev", text); + efi_free_devpath_name(text); + } + } + + boot_current = 0; + sz = sizeof(boot_current); + efi_global_getenv("BootCurrent", &boot_current, &sz); + printf(" BootCurrent: %04x\n", boot_current); + + sz = sizeof(boot_order); + efi_global_getenv("BootOrder", &boot_order, &sz); + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); + /* * Disable the watchdog timer. By default the boot manager sets * the timer to 5 minutes before invoking a boot option. If we @@ -848,7 +878,7 @@ command_chain(int argc, char *argv[]) struct disk_devdesc *d_dev; pdinfo_t *hd, *pd; - switch (dev->d_type) { + switch (dev->d_dev->dv_type) { #ifdef EFI_ZFS_BOOT case DEVT_ZFS: z_dev = (struct zfs_devdesc *)dev; Modified: stable/11/stand/ficl/aarch64/sysdep.c ============================================================================== --- stable/11/stand/ficl/aarch64/sysdep.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/ficl/aarch64/sysdep.c Fri Apr 6 21:37:25 2018 (r332154) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: stable/11/stand/ficl/amd64/sysdep.c ============================================================================== --- stable/11/stand/ficl/amd64/sysdep.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/ficl/amd64/sysdep.c Fri Apr 6 21:37:25 2018 (r332154) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: stable/11/stand/ficl/arm/sysdep.c ============================================================================== --- stable/11/stand/ficl/arm/sysdep.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/ficl/arm/sysdep.c Fri Apr 6 21:37:25 2018 (r332154) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; Modified: stable/11/stand/ficl/i386/sysdep.c ============================================================================== --- stable/11/stand/ficl/i386/sysdep.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/ficl/i386/sysdep.c Fri Apr 6 21:37:25 2018 (r332154) @@ -28,12 +28,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -41,7 +41,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; qh = q.hi; qx = (qh << 32) | q.lo; @@ -89,7 +89,7 @@ void ficlOutb(FICL_VM *pVM) { u_char c; - u_int32_t port; + uint32_t port; port=stackPopUNS(pVM->pStack); c=(u_char)stackPopINT(pVM->pStack); @@ -104,7 +104,7 @@ void ficlInb(FICL_VM *pVM) { u_char c; - u_int32_t port; + uint32_t port; port=stackPopUNS(pVM->pStack); c=inb(port); Modified: stable/11/stand/ficl/mips/sysdep.c ============================================================================== --- stable/11/stand/ficl/mips/sysdep.c Fri Apr 6 20:56:06 2018 (r332153) +++ stable/11/stand/ficl/mips/sysdep.c Fri Apr 6 21:37:25 2018 (r332154) @@ -25,12 +25,12 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) { DPUNS q; - u_int64_t qx; + uint64_t qx; - qx = (u_int64_t)x * (u_int64_t) y; + qx = (uint64_t)x * (uint64_t) y; - q.hi = (u_int32_t)( qx >> 32 ); - q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + q.hi = (uint32_t)( qx >> 32 ); + q.lo = (uint32_t)( qx & 0xFFFFFFFFL); return q; } @@ -38,7 +38,7 @@ DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) { UNSQR result; - u_int64_t qx, qh; + uint64_t qx, qh; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 6 21:40:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B4DBF88C9B; Fri, 6 Apr 2018 21:40:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF9477AD6; Fri, 6 Apr 2018 21:40:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43248177B5; Fri, 6 Apr 2018 21:40:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36LeOuK094497; Fri, 6 Apr 2018 21:40:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36LeOpa094496; Fri, 6 Apr 2018 21:40:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804062140.w36LeOpa094496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 21:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332155 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 332155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 21:40:24 -0000 Author: kevans Date: Fri Apr 6 21:40:23 2018 New Revision: 332155 URL: https://svnweb.freebsd.org/changeset/base/332155 Log: MFC r331331: Apply r228478 (CTASSERT => _Static_assert()) to bootstrap.h Modified: stable/11/stand/common/bootstrap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/bootstrap.h ============================================================================== --- stable/11/stand/common/bootstrap.h Fri Apr 6 21:37:25 2018 (r332154) +++ stable/11/stand/common/bootstrap.h Fri Apr 6 21:40:23 2018 (r332155) @@ -330,10 +330,8 @@ void dev_cleanup(void); time_t time(time_t *tloc); -#ifndef CTASSERT /* Allow lint to override */ -#define CTASSERT(x) _CTASSERT(x, __LINE__) -#define _CTASSERT(x, y) __CTASSERT(x, y) -#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#ifndef CTASSERT +#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") #endif #endif /* !_BOOTSTRAP_H_ */ From owner-svn-src-all@freebsd.org Fri Apr 6 21:50:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86A49F89699; Fri, 6 Apr 2018 21:50:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35460780BE; Fri, 6 Apr 2018 21:50:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C3521794B; Fri, 6 Apr 2018 21:50:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36LoBQ6099584; Fri, 6 Apr 2018 21:50:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36LoAB8099575; Fri, 6 Apr 2018 21:50:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804062150.w36LoAB8099575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 6 Apr 2018 21:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332156 - in stable/11: stand/efi/boot1 stand/efi/include stand/efi/libefi stand/i386/libfirewire sys/dev/firewire X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/efi/boot1 stand/efi/include stand/efi/libefi stand/i386/libfirewire sys/dev/firewire X-SVN-Commit-Revision: 332156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 21:50:11 -0000 Author: kevans Date: Fri Apr 6 21:50:09 2018 New Revision: 332156 URL: https://svnweb.freebsd.org/changeset/base/332156 Log: MFC r330970, r331067, r331767, r331852, r331858 r330970: libefi: UEFI_BOOT_VAR_GUID duplicates EFI_GLOBAL_VARIABLE Drop UEFI_BOOT_VAR_GUID and use EFI_GLOBAL_VARIABLE. r331067: Only print boot order / boot current if we can get the variables from the loader. Some UEFI implementations don't return all of them. Sponsored by: Netflix r331767: efinet: Do not return only if ReceiveFilter fails If the network interface or the uefi implementation do not support the ReceiveFilter interface do not return only and just print a message. U-Boot doesn't support is and likely never will. Also even if this fails it doesn't mean that network in EFI isn't supported. r331852: fwohcireg.h is 99% the same between the boot loader and the kernel. Delete it and fix up the 1% difference because there's no need for them to be different. r331858: The Uninorth ID was really for Uninorth 2. Deleted: stable/11/stand/i386/libfirewire/fwohcireg.h Modified: stable/11/stand/efi/boot1/boot1.c stable/11/stand/efi/include/efi.h stable/11/stand/efi/libefi/efienv.c stable/11/stand/efi/libefi/efinet.c stable/11/stand/i386/libfirewire/firewire.c stable/11/stand/i386/libfirewire/fwohci.c stable/11/stand/i386/libfirewire/fwohci.h stable/11/sys/dev/firewire/fwohci_pci.c stable/11/sys/dev/firewire/fwohcireg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/efi/boot1/boot1.c ============================================================================== --- stable/11/stand/efi/boot1/boot1.c Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/efi/boot1/boot1.c Fri Apr 6 21:50:09 2018 (r332156) @@ -467,16 +467,18 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) boot_current = 0; sz = sizeof(boot_current); - efi_global_getenv("BootCurrent", &boot_current, &sz); - printf(" BootCurrent: %04x\n", boot_current); + if (efi_global_getenv("BootCurrent", &boot_current, &sz) == EFI_SUCCESS) { + printf(" BootCurrent: %04x\n", boot_current); - sz = sizeof(boot_order); - efi_global_getenv("BootOrder", &boot_order, &sz); - printf(" BootOrder:"); - for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x%s", boot_order[i], - boot_order[i] == boot_current ? "[*]" : ""); - printf("\n"); + sz = sizeof(boot_order); + if (efi_global_getenv("BootOrder", &boot_order, &sz) == EFI_SUCCESS) { + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); + } + } #ifdef TEST_FAILURE /* Modified: stable/11/stand/efi/include/efi.h ============================================================================== --- stable/11/stand/efi/include/efi.h Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/efi/include/efi.h Fri Apr 6 21:50:09 2018 (r332156) @@ -59,7 +59,5 @@ Revision History */ #define FREEBSD_BOOT_VAR_GUID \ { 0xCFEE69AD, 0xA0DE, 0x47A9, {0x93, 0xA8, 0xF6, 0x31, 0x06, 0xF8, 0xAE, 0x99} } -#define UEFI_BOOT_VAR_GUID \ - { 0x8be4df61, 0x93ca, 0x11d2, {0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c} } #endif Modified: stable/11/stand/efi/libefi/efienv.c ============================================================================== --- stable/11/stand/efi/libefi/efienv.c Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/efi/libefi/efienv.c Fri Apr 6 21:50:09 2018 (r332156) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID; +static EFI_GUID GlobalBootVarGUID = EFI_GLOBAL_VARIABLE; EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len) Modified: stable/11/stand/efi/libefi/efinet.c ============================================================================== --- stable/11/stand/efi/libefi/efinet.c Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/efi/libefi/efinet.c Fri Apr 6 21:50:09 2018 (r332156) @@ -225,11 +225,9 @@ efinet_init(struct iodesc *desc, void *machdep_hint) EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST; status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL); - if (status != EFI_SUCCESS) { + if (status != EFI_SUCCESS) printf("net%d: cannot set rx. filters (status=%lu)\n", nif->nif_unit, EFI_ERROR_CODE(status)); - return; - } #ifdef EFINET_DEBUG dump_mode(net->Mode); Modified: stable/11/stand/i386/libfirewire/firewire.c ============================================================================== --- stable/11/stand/i386/libfirewire/firewire.c Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/i386/libfirewire/firewire.c Fri Apr 6 21:50:09 2018 (r332156) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "fwohci.h" #include Modified: stable/11/stand/i386/libfirewire/fwohci.c ============================================================================== --- stable/11/stand/i386/libfirewire/fwohci.c Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/i386/libfirewire/fwohci.c Fri Apr 6 21:50:09 2018 (r332156) @@ -39,8 +39,9 @@ #include #include +#include #include "fwohci.h" -#include "fwohcireg.h" +#include #include static uint32_t fwphy_wrdata ( struct fwohci_softc *, uint32_t, uint32_t); @@ -62,12 +63,6 @@ char *linkspeed[] = { "S100", "S200", "S400", "S800", "S1600", "S3200", "undef", "undef" }; - -#define FW_EUI64_BYTE(eui, x) \ - ((((x)<4)? \ - ((eui)->hi >> (8*(3-(x)))): \ - ((eui)->lo >> (8*(7-(x)))) \ - ) & 0xff) /* * Communication with PHY device Modified: stable/11/stand/i386/libfirewire/fwohci.h ============================================================================== --- stable/11/stand/i386/libfirewire/fwohci.h Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/stand/i386/libfirewire/fwohci.h Fri Apr 6 21:50:09 2018 (r332156) @@ -37,10 +37,6 @@ #define MAX_OHCI 5 #define CROMSIZE 0x400 -struct fw_eui64 { - uint32_t hi, lo; -}; - struct fwohci_softc { uint32_t locator; uint32_t devid; Modified: stable/11/sys/dev/firewire/fwohci_pci.c ============================================================================== --- stable/11/sys/dev/firewire/fwohci_pci.c Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/sys/dev/firewire/fwohci_pci.c Fri Apr 6 21:50:09 2018 (r332156) @@ -169,8 +169,8 @@ fwohci_pci_probe(device_t dev) device_set_desc(dev, "Apple Pangea"); return BUS_PROBE_DEFAULT; } - if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH)) { - device_set_desc(dev, "Apple UniNorth"); + if (id == (FW_VENDORID_APPLE | FW_DEVICE_UNINORTH2)) { + device_set_desc(dev, "Apple UniNorth 2"); return BUS_PROBE_DEFAULT; } if (id == (FW_VENDORID_LUCENT | FW_DEVICE_FW322)) { Modified: stable/11/sys/dev/firewire/fwohcireg.h ============================================================================== --- stable/11/sys/dev/firewire/fwohcireg.h Fri Apr 6 21:40:23 2018 (r332155) +++ stable/11/sys/dev/firewire/fwohcireg.h Fri Apr 6 21:50:09 2018 (r332156) @@ -72,7 +72,7 @@ #define FW_DEVICE_R5C551 (0x0551 << 16) #define FW_DEVICE_R5C552 (0x0552 << 16) #define FW_DEVICE_PANGEA (0x0030 << 16) -#define FW_DEVICE_UNINORTH (0x0031 << 16) +#define FW_DEVICE_UNINORTH2 (0x0031 << 16) #define FW_DEVICE_AIC5800 (0x5800 << 16) #define FW_DEVICE_FW322 (0x5811 << 16) #define FW_DEVICE_7007 (0x7007 << 16) @@ -328,6 +328,7 @@ struct ohci_registers { struct ohci_dma dma_irch[0x20]; }; +#ifndef _STANDALONE struct fwohcidb_tr { STAILQ_ENTRY(fwohcidb_tr) link; struct fw_xfer *xfer; @@ -337,6 +338,7 @@ struct fwohcidb_tr { bus_addr_t bus_addr; int dbcnt; }; +#endif /* * OHCI info structure. From owner-svn-src-all@freebsd.org Fri Apr 6 22:03:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFC73F8A591; Fri, 6 Apr 2018 22:03:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CB2778A1C; Fri, 6 Apr 2018 22:03:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6791B17C84; Fri, 6 Apr 2018 22:03:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36M3iBL009221; Fri, 6 Apr 2018 22:03:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36M3h1B009213; Fri, 6 Apr 2018 22:03:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804062203.w36M3h1B009213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Apr 2018 22:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332157 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel X-SVN-Commit-Revision: 332157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 22:03:45 -0000 Author: jhb Date: Fri Apr 6 22:03:43 2018 New Revision: 332157 URL: https://svnweb.freebsd.org/changeset/base/332157 Log: Add a way to temporarily suspend and resume virtual CPUs. This is used as part of implementing run control in bhyve's debug server. The hypervisor now maintains a set of "debugged" CPUs. Attempting to run a debugged CPU will fail to execute any guest instructions and will instead report a VM_EXITCODE_DEBUG exit to the userland hypervisor. Virtual CPUs are placed into the debugged state via vm_suspend_cpu() (implemented via a new VM_SUSPEND_CPU ioctl). Virtual CPUs can be resumed via vm_resume_cpu() (VM_RESUME_CPU ioctl). The debug server suspends virtual CPUs when it wishes them to stop executing in the guest (for example, when a debugger attaches to the server). The debug server can choose to resume only a subset of CPUs (for example, when single stepping) or it can choose to resume all CPUs. The debug server must explicitly mark a CPU as resumed via vm_resume_cpu() before the virtual CPU will successfully execute any guest instructions. Reviewed by: avg, grehan Tested on: Intel (jhb), AMD (avg) Differential Revision: https://reviews.freebsd.org/D14466 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Fri Apr 6 21:50:09 2018 (r332156) +++ head/lib/libvmmapi/vmmapi.c Fri Apr 6 22:03:43 2018 (r332157) @@ -1374,6 +1374,13 @@ vm_suspended_cpus(struct vmctx *ctx, cpuset_t *cpus) } int +vm_debug_cpus(struct vmctx *ctx, cpuset_t *cpus) +{ + + return (vm_get_cpus(ctx, VM_DEBUG_CPUS, cpus)); +} + +int vm_activate_cpu(struct vmctx *ctx, int vcpu) { struct vm_activate_cpu ac; @@ -1386,6 +1393,30 @@ vm_activate_cpu(struct vmctx *ctx, int vcpu) } int +vm_suspend_cpu(struct vmctx *ctx, int vcpu) +{ + struct vm_activate_cpu ac; + int error; + + bzero(&ac, sizeof(struct vm_activate_cpu)); + ac.vcpuid = vcpu; + error = ioctl(ctx->fd, VM_SUSPEND_CPU, &ac); + return (error); +} + +int +vm_resume_cpu(struct vmctx *ctx, int vcpu) +{ + struct vm_activate_cpu ac; + int error; + + bzero(&ac, sizeof(struct vm_activate_cpu)); + ac.vcpuid = vcpu; + error = ioctl(ctx->fd, VM_RESUME_CPU, &ac); + return (error); +} + +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) { struct vm_intinfo vmii; @@ -1501,7 +1532,8 @@ vm_get_ioctls(size_t *len) VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, VM_GLA2GPA_NOFAULT, - VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, + VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SUSPEND_CPU, VM_RESUME_CPU, + VM_SET_INTINFO, VM_GET_INTINFO, VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, VM_RESTART_INSTRUCTION }; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Fri Apr 6 21:50:09 2018 (r332156) +++ head/lib/libvmmapi/vmmapi.h Fri Apr 6 22:03:43 2018 (r332157) @@ -216,7 +216,10 @@ int vcpu_reset(struct vmctx *ctx, int vcpu); int vm_active_cpus(struct vmctx *ctx, cpuset_t *cpus); int vm_suspended_cpus(struct vmctx *ctx, cpuset_t *cpus); +int vm_debug_cpus(struct vmctx *ctx, cpuset_t *cpus); int vm_activate_cpu(struct vmctx *ctx, int vcpu); +int vm_suspend_cpu(struct vmctx *ctx, int vcpu); +int vm_resume_cpu(struct vmctx *ctx, int vcpu); /* * FreeBSD specific APIs Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Fri Apr 6 21:50:09 2018 (r332156) +++ head/sys/amd64/include/vmm.h Fri Apr 6 22:03:43 2018 (r332157) @@ -231,8 +231,11 @@ int vm_get_x2apic_state(struct vm *vm, int vcpu, enum int vm_set_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state state); int vm_apicid2vcpuid(struct vm *vm, int apicid); int vm_activate_cpu(struct vm *vm, int vcpu); +int vm_suspend_cpu(struct vm *vm, int vcpu); +int vm_resume_cpu(struct vm *vm, int vcpu); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip); +void vm_exit_debug(struct vm *vm, int vcpuid, uint64_t rip); void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip); void vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip); void vm_exit_reqidle(struct vm *vm, int vcpuid, uint64_t rip); @@ -256,6 +259,7 @@ typedef void (*vm_rendezvous_func_t)(struct vm *vm, in void vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t dest, vm_rendezvous_func_t func, void *arg); cpuset_t vm_active_cpus(struct vm *vm); +cpuset_t vm_debug_cpus(struct vm *vm); cpuset_t vm_suspended_cpus(struct vm *vm); #endif /* _SYS__CPUSET_H_ */ @@ -280,6 +284,8 @@ vcpu_reqidle(struct vm_eventinfo *info) return (*info->iptr); } +int vcpu_debugged(struct vm *vm, int vcpuid); + /* * Return 1 if device indicated by bus/slot/func is supposed to be a * pci passthrough device. @@ -540,6 +546,7 @@ enum vm_exitcode { VM_EXITCODE_MWAIT, VM_EXITCODE_SVM, VM_EXITCODE_REQIDLE, + VM_EXITCODE_DEBUG, VM_EXITCODE_MAX }; Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Fri Apr 6 21:50:09 2018 (r332156) +++ head/sys/amd64/include/vmm_dev.h Fri Apr 6 22:03:43 2018 (r332157) @@ -209,6 +209,7 @@ struct vm_cpuset { }; #define VM_ACTIVE_CPUS 0 #define VM_SUSPENDED_CPUS 1 +#define VM_DEBUG_CPUS 2 struct vm_intinfo { int vcpuid; @@ -292,6 +293,8 @@ enum { /* vm_cpuset */ IOCNUM_ACTIVATE_CPU = 90, IOCNUM_GET_CPUSET = 91, + IOCNUM_SUSPEND_CPU = 92, + IOCNUM_RESUME_CPU = 93, /* RTC */ IOCNUM_RTC_READ = 100, @@ -386,6 +389,10 @@ enum { _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) #define VM_GET_CPUS \ _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) +#define VM_SUSPEND_CPU \ + _IOW('v', IOCNUM_SUSPEND_CPU, struct vm_activate_cpu) +#define VM_RESUME_CPU \ + _IOW('v', IOCNUM_RESUME_CPU, struct vm_activate_cpu) #define VM_SET_INTINFO \ _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) #define VM_GET_INTINFO \ Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Fri Apr 6 21:50:09 2018 (r332156) +++ head/sys/amd64/vmm/amd/svm.c Fri Apr 6 22:03:43 2018 (r332157) @@ -2015,6 +2015,12 @@ svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t break; } + if (vcpu_debugged(vm, vcpu)) { + enable_gintr(); + vm_exit_debug(vm, vcpu, state->rip); + break; + } + svm_inj_interrupts(svm_sc, vcpu, vlapic); /* Activate the nested pmap on 'curcpu' */ Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Apr 6 21:50:09 2018 (r332156) +++ head/sys/amd64/vmm/intel/vmx.c Fri Apr 6 22:03:43 2018 (r332157) @@ -2746,6 +2746,12 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm break; } + if (vcpu_debugged(vm, vcpu)) { + enable_intr(); + vm_exit_debug(vmx->vm, vcpu, rip); + break; + } + vmx_run_trace(vmx, vcpu); vmx_dr_enter_guest(vmxctx); rc = vmx_enter_guest(vmxctx, vmx, launched); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Apr 6 21:50:09 2018 (r332156) +++ head/sys/amd64/vmm/vmm.c Fri Apr 6 22:03:43 2018 (r332157) @@ -152,6 +152,7 @@ struct vm { struct vpmtmr *vpmtmr; /* (i) virtual ACPI PM timer */ struct vrtc *vrtc; /* (o) virtual RTC */ volatile cpuset_t active_cpus; /* (i) active vcpus */ + volatile cpuset_t debug_cpus; /* (i) vcpus stopped for debug */ int suspend; /* (i) stop VM execution */ volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */ volatile cpuset_t halted_cpus; /* (x) cpus in a hard halt */ @@ -415,6 +416,7 @@ vm_init(struct vm *vm, bool create) vm->vrtc = vrtc_init(vm); CPU_ZERO(&vm->active_cpus); + CPU_ZERO(&vm->debug_cpus); vm->suspend = 0; CPU_ZERO(&vm->suspended_cpus); @@ -1283,6 +1285,9 @@ vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_dis if (vcpu_should_yield(vm, vcpuid)) break; + if (vcpu_debugged(vm, vcpuid)) + break; + /* * Some Linux guests implement "halt" by having all vcpus * execute HLT with interrupts disabled. 'halted_cpus' keeps @@ -1554,6 +1559,17 @@ vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t } void +vm_exit_debug(struct vm *vm, int vcpuid, uint64_t rip) +{ + struct vm_exit *vmexit; + + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->rip = rip; + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_DEBUG; +} + +void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip) { struct vm_exit *vmexit; @@ -2267,11 +2283,67 @@ vm_activate_cpu(struct vm *vm, int vcpuid) return (0); } +int +vm_suspend_cpu(struct vm *vm, int vcpuid) +{ + int i; + + if (vcpuid < -1 || vcpuid >= VM_MAXCPU) + return (EINVAL); + + if (vcpuid == -1) { + vm->debug_cpus = vm->active_cpus; + for (i = 0; i < VM_MAXCPU; i++) { + if (CPU_ISSET(i, &vm->active_cpus)) + vcpu_notify_event(vm, i, false); + } + } else { + if (!CPU_ISSET(vcpuid, &vm->active_cpus)) + return (EINVAL); + + CPU_SET_ATOMIC(vcpuid, &vm->debug_cpus); + vcpu_notify_event(vm, vcpuid, false); + } + return (0); +} + +int +vm_resume_cpu(struct vm *vm, int vcpuid) +{ + + if (vcpuid < -1 || vcpuid >= VM_MAXCPU) + return (EINVAL); + + if (vcpuid == -1) { + CPU_ZERO(&vm->debug_cpus); + } else { + if (!CPU_ISSET(vcpuid, &vm->debug_cpus)) + return (EINVAL); + + CPU_CLR_ATOMIC(vcpuid, &vm->debug_cpus); + } + return (0); +} + +int +vcpu_debugged(struct vm *vm, int vcpuid) +{ + + return (CPU_ISSET(vcpuid, &vm->debug_cpus)); +} + cpuset_t vm_active_cpus(struct vm *vm) { return (vm->active_cpus); +} + +cpuset_t +vm_debug_cpus(struct vm *vm) +{ + + return (vm->debug_cpus); } cpuset_t Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Fri Apr 6 21:50:09 2018 (r332156) +++ head/sys/amd64/vmm/vmm_dev.c Fri Apr 6 22:03:43 2018 (r332157) @@ -690,11 +690,21 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da *cpuset = vm_active_cpus(sc->vm); else if (vm_cpuset->which == VM_SUSPENDED_CPUS) *cpuset = vm_suspended_cpus(sc->vm); + else if (vm_cpuset->which == VM_DEBUG_CPUS) + *cpuset = vm_debug_cpus(sc->vm); else error = EINVAL; if (error == 0) error = copyout(cpuset, vm_cpuset->cpus, size); free(cpuset, M_TEMP); + break; + case VM_SUSPEND_CPU: + vac = (struct vm_activate_cpu *)data; + error = vm_suspend_cpu(sc->vm, vac->vcpuid); + break; + case VM_RESUME_CPU: + vac = (struct vm_activate_cpu *)data; + error = vm_resume_cpu(sc->vm, vac->vcpuid); break; case VM_SET_INTINFO: vmii = (struct vm_intinfo *)data; From owner-svn-src-all@freebsd.org Fri Apr 6 23:17:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CB62F8F2D0; Fri, 6 Apr 2018 23:17:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 484737B2D0; Fri, 6 Apr 2018 23:17:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3944E10AFAE; Fri, 6 Apr 2018 19:17:28 -0400 (EDT) From: John Baldwin To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332133 - head/sys/conf Date: Fri, 06 Apr 2018 14:22:43 -0700 Message-ID: <3249895.eL6Z6pOVrh@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804061911.w36JBMvB017793@repo.freebsd.org> References: <201804061911.w36JBMvB017793@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 06 Apr 2018 19:17:28 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 23:17:29 -0000 On Friday, April 06, 2018 07:11:22 PM Brooks Davis wrote: > Author: brooks > Date: Fri Apr 6 19:11:22 2018 > New Revision: 332133 > URL: https://svnweb.freebsd.org/changeset/base/332133 > > Log: > Add an unused _COMPAT_LINUX32 option to ensure opt_compat.h exists on > platforms without COMPAT_LINUX32. I wonder if it wouldn't be cleaner to just move COMPAT_LINUX32 itself to sys/conf/options? -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 6 23:25:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 992D3F8FD03; Fri, 6 Apr 2018 23:25:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F37C7B8DE; Fri, 6 Apr 2018 23:25:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 459D31896D; Fri, 6 Apr 2018 23:25:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36NPt5R049036; Fri, 6 Apr 2018 23:25:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36NPtvx049035; Fri, 6 Apr 2018 23:25:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804062325.w36NPtvx049035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 23:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332158 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 23:25:55 -0000 Author: brooks Date: Fri Apr 6 23:25:54 2018 New Revision: 332158 URL: https://svnweb.freebsd.org/changeset/base/332158 Log: Remove the thread argument from ifr_buffer_*() accessors. They are always used in a context where curthread is the correct thread. This makes them more similar to the ifr_data_get_ptr() accessor. Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Apr 6 22:03:43 2018 (r332157) +++ head/sys/net/if.c Fri Apr 6 23:25:54 2018 (r332158) @@ -2403,13 +2403,13 @@ ifunit(const char *name) } static void * -ifr_buffer_get_buffer(struct thread *td, void *data) +ifr_buffer_get_buffer(void *data) { union ifreq_union *ifrup; ifrup = data; #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) return ((void *)(uintptr_t) ifrup->ifr32.ifr_ifru.ifru_buffer.buffer); #endif @@ -2417,13 +2417,13 @@ ifr_buffer_get_buffer(struct thread *td, void *data) } static void -ifr_buffer_set_buffer_null(struct thread *td, void *data) +ifr_buffer_set_buffer_null(void *data) { union ifreq_union *ifrup; ifrup = data; #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) ifrup->ifr32.ifr_ifru.ifru_buffer.buffer = 0; else #endif @@ -2431,26 +2431,26 @@ ifr_buffer_set_buffer_null(struct thread *td, void *da } static size_t -ifr_buffer_get_length(struct thread *td, void *data) +ifr_buffer_get_length(void *data) { union ifreq_union *ifrup; ifrup = data; #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) return (ifrup->ifr32.ifr_ifru.ifru_buffer.length); #endif return (ifrup->ifr.ifr_ifru.ifru_buffer.length); } static void -ifr_buffer_set_length(struct thread *td, void *data, size_t len) +ifr_buffer_set_length(void *data, size_t len) { union ifreq_union *ifrup; ifrup = data; #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) ifrup->ifr32.ifr_ifru.ifru_buffer.length = len; else #endif @@ -2531,12 +2531,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, else { /* space for terminating nul */ descrlen = strlen(ifp->if_description) + 1; - if (ifr_buffer_get_length(td, ifr) < descrlen) - ifr_buffer_set_buffer_null(td, ifr); + if (ifr_buffer_get_length(ifr) < descrlen) + ifr_buffer_set_buffer_null(ifr); else error = copyout(ifp->if_description, - ifr_buffer_get_buffer(td, ifr), descrlen); - ifr_buffer_set_length(td, ifr, descrlen); + ifr_buffer_get_buffer(ifr), descrlen); + ifr_buffer_set_length(ifr, descrlen); } sx_sunlock(&ifdescr_sx); break; @@ -2552,15 +2552,15 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, * length parameter is supposed to count the * terminating nul in. */ - if (ifr_buffer_get_length(td, ifr) > ifdescr_maxlen) + if (ifr_buffer_get_length(ifr) > ifdescr_maxlen) return (ENAMETOOLONG); - else if (ifr_buffer_get_length(td, ifr) == 0) + else if (ifr_buffer_get_length(ifr) == 0) descrbuf = NULL; else { - descrbuf = malloc(ifr_buffer_get_length(td, ifr), + descrbuf = malloc(ifr_buffer_get_length(ifr), M_IFDESCR, M_WAITOK | M_ZERO); - error = copyin(ifr_buffer_get_buffer(td, ifr), descrbuf, - ifr_buffer_get_length(td, ifr) - 1); + error = copyin(ifr_buffer_get_buffer(ifr), descrbuf, + ifr_buffer_get_length(ifr) - 1); if (error) { free(descrbuf, M_IFDESCR); break; From owner-svn-src-all@freebsd.org Fri Apr 6 23:31:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AF43F903F8; Fri, 6 Apr 2018 23:31:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE4697BC94; Fri, 6 Apr 2018 23:31:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A938518AD2; Fri, 6 Apr 2018 23:31:48 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w36NVmOl052390; Fri, 6 Apr 2018 23:31:48 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w36NVlVh052383; Fri, 6 Apr 2018 23:31:47 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804062331.w36NVlVh052383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 6 Apr 2018 23:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332159 - in stable/11/sys: net ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys: net ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 332159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Apr 2018 23:31:49 -0000 Author: brooks Date: Fri Apr 6 23:31:47 2018 New Revision: 332159 URL: https://svnweb.freebsd.org/changeset/base/332159 Log: MFC r331648: Improve copy-and-pasted versions of SIOCGIFADDR. The original implementation used a reference to ifr_data and a cast to do the equivalent of accessing ifr_addr. This was copied multiple times since 1996. Approved by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14873 Modified: stable/11/sys/net/if_arcsubr.c stable/11/sys/net/if_ethersubr.c stable/11/sys/net/if_fddisubr.c stable/11/sys/net/if_fwsubr.c stable/11/sys/net/if_iso88025subr.c stable/11/sys/net/if_vlan.c stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_arcsubr.c ============================================================================== --- stable/11/sys/net/if_arcsubr.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/net/if_arcsubr.c Fri Apr 6 23:31:47 2018 (r332159) @@ -679,12 +679,7 @@ arc_ioctl(struct ifnet *ifp, u_long command, caddr_t d break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) &ifr->ifr_data; - *(u_int8_t *)sa->sa_data = ARC_LLADDR(ifp); - } + ifr->ifr_addr.sa_data[0] = ARC_LLADDR(ifp); break; case SIOCADDMULTI: Modified: stable/11/sys/net/if_ethersubr.c ============================================================================== --- stable/11/sys/net/if_ethersubr.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/net/if_ethersubr.c Fri Apr 6 23:31:47 2018 (r332159) @@ -1084,13 +1084,8 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, ETHER_ADDR_LEN); - } + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + ETHER_ADDR_LEN); break; case SIOCSIFMTU: Modified: stable/11/sys/net/if_fddisubr.c ============================================================================== --- stable/11/sys/net/if_fddisubr.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/net/if_fddisubr.c Fri Apr 6 23:31:47 2018 (r332159) @@ -556,14 +556,9 @@ fddi_ioctl (ifp, command, data) break; } break; - case SIOCGIFADDR: { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, FDDI_ADDR_LEN); - - } + case SIOCGIFADDR: + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + FDDI_ADDR_LEN); break; case SIOCSIFMTU: /* Modified: stable/11/sys/net/if_fwsubr.c ============================================================================== --- stable/11/sys/net/if_fwsubr.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/net/if_fwsubr.c Fri Apr 6 23:31:47 2018 (r332159) @@ -660,13 +660,8 @@ firewire_ioctl(struct ifnet *ifp, u_long command, cadd break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(&IFP2FWC(ifp)->fc_hwaddr, - (caddr_t) sa->sa_data, sizeof(struct fw_hwaddr)); - } + bcopy(&IFP2FWC(ifp)->fc_hwaddr, &ifr->ifr_addr.sa_data[0], + sizeof(struct fw_hwaddr)); break; case SIOCSIFMTU: Modified: stable/11/sys/net/if_iso88025subr.c ============================================================================== --- stable/11/sys/net/if_iso88025subr.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/net/if_iso88025subr.c Fri Apr 6 23:31:47 2018 (r332159) @@ -171,13 +171,9 @@ iso88025_ioctl(struct ifnet *ifp, u_long command, cadd } break; - case SIOCGIFADDR: { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, ISO88025_ADDR_LEN); - } + case SIOCGIFADDR: + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + ISO88025_ADDR_LEN); break; case SIOCSIFMTU: Modified: stable/11/sys/net/if_vlan.c ============================================================================== --- stable/11/sys/net/if_vlan.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/net/if_vlan.c Fri Apr 6 23:31:47 2018 (r332159) @@ -1842,12 +1842,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data #endif break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *)&ifr->ifr_data; - bcopy(IF_LLADDR(ifp), sa->sa_data, ifp->if_addrlen); - } + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + ifp->if_addrlen); break; case SIOCGIFMEDIA: VLAN_SLOCK(); Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Fri Apr 6 23:25:54 2018 (r332158) +++ stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Fri Apr 6 23:31:47 2018 (r332159) @@ -318,13 +318,8 @@ ipoib_ioctl(struct ifnet *ifp, u_long command, caddr_t break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, INFINIBAND_ALEN); - } + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + INFINIBAND_ALEN); break; case SIOCSIFMTU: From owner-svn-src-all@freebsd.org Sat Apr 7 00:04:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11274F927F2; Sat, 7 Apr 2018 00:04:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A19607D07B; Sat, 7 Apr 2018 00:04:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 959C518FF7; Sat, 7 Apr 2018 00:04:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3704TpH069094; Sat, 7 Apr 2018 00:04:29 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3704S5S069086; Sat, 7 Apr 2018 00:04:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804070004.w3704S5S069086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 7 Apr 2018 00:04:28 +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: r332160 - in stable/10/sys: net ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/10/sys: net ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 332160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 00:04:30 -0000 Author: brooks Date: Sat Apr 7 00:04:28 2018 New Revision: 332160 URL: https://svnweb.freebsd.org/changeset/base/332160 Log: MFC r331648: Improve copy-and-pasted versions of SIOCGIFADDR. The original implementation used a reference to ifr_data and a cast to do the equivalent of accessing ifr_addr. This was copied multiple times since 1996. Approved by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14873 Modified: stable/10/sys/net/if_arcsubr.c stable/10/sys/net/if_ethersubr.c stable/10/sys/net/if_fddisubr.c stable/10/sys/net/if_fwsubr.c stable/10/sys/net/if_iso88025subr.c stable/10/sys/net/if_vlan.c stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_arcsubr.c ============================================================================== --- stable/10/sys/net/if_arcsubr.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/net/if_arcsubr.c Sat Apr 7 00:04:28 2018 (r332160) @@ -715,12 +715,7 @@ arc_ioctl(struct ifnet *ifp, u_long command, caddr_t d break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) &ifr->ifr_data; - *(u_int8_t *)sa->sa_data = ARC_LLADDR(ifp); - } + ifr->ifr_addr.sa_data[0] = ARC_LLADDR(ifp); break; case SIOCADDMULTI: Modified: stable/10/sys/net/if_ethersubr.c ============================================================================== --- stable/10/sys/net/if_ethersubr.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/net/if_ethersubr.c Sat Apr 7 00:04:28 2018 (r332160) @@ -1109,13 +1109,8 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, ETHER_ADDR_LEN); - } + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + ETHER_ADDR_LEN); break; case SIOCSIFMTU: Modified: stable/10/sys/net/if_fddisubr.c ============================================================================== --- stable/10/sys/net/if_fddisubr.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/net/if_fddisubr.c Sat Apr 7 00:04:28 2018 (r332160) @@ -669,14 +669,9 @@ fddi_ioctl (ifp, command, data) break; } break; - case SIOCGIFADDR: { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, FDDI_ADDR_LEN); - - } + case SIOCGIFADDR: + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + FDDI_ADDR_LEN); break; case SIOCSIFMTU: /* Modified: stable/10/sys/net/if_fwsubr.c ============================================================================== --- stable/10/sys/net/if_fwsubr.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/net/if_fwsubr.c Sat Apr 7 00:04:28 2018 (r332160) @@ -656,13 +656,8 @@ firewire_ioctl(struct ifnet *ifp, u_long command, cadd break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(&IFP2FWC(ifp)->fc_hwaddr, - (caddr_t) sa->sa_data, sizeof(struct fw_hwaddr)); - } + bcopy(&IFP2FWC(ifp)->fc_hwaddr, &ifr->ifr_addr.sa_data[0], + sizeof(struct fw_hwaddr)); break; case SIOCSIFMTU: Modified: stable/10/sys/net/if_iso88025subr.c ============================================================================== --- stable/10/sys/net/if_iso88025subr.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/net/if_iso88025subr.c Sat Apr 7 00:04:28 2018 (r332160) @@ -200,13 +200,9 @@ iso88025_ioctl(struct ifnet *ifp, u_long command, cadd } break; - case SIOCGIFADDR: { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, ISO88025_ADDR_LEN); - } + case SIOCGIFADDR: + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + ISO88025_ADDR_LEN); break; case SIOCSIFMTU: Modified: stable/10/sys/net/if_vlan.c ============================================================================== --- stable/10/sys/net/if_vlan.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/net/if_vlan.c Sat Apr 7 00:04:28 2018 (r332160) @@ -1588,12 +1588,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data #endif break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *)&ifr->ifr_data; - bcopy(IF_LLADDR(ifp), sa->sa_data, ifp->if_addrlen); - } + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + ifp->if_addrlen); break; case SIOCGIFMEDIA: VLAN_LOCK(); Modified: stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Fri Apr 6 23:31:47 2018 (r332159) +++ stable/10/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Apr 7 00:04:28 2018 (r332160) @@ -293,13 +293,8 @@ ipoib_ioctl(struct ifnet *ifp, u_long command, caddr_t break; case SIOCGIFADDR: - { - struct sockaddr *sa; - - sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), - (caddr_t) sa->sa_data, INFINIBAND_ALEN); - } + bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0], + INFINIBAND_ALEN); break; case SIOCSIFMTU: From owner-svn-src-all@freebsd.org Sat Apr 7 00:23:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A75F93CE4; Sat, 7 Apr 2018 00:23:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D860E7DDFF; Sat, 7 Apr 2018 00:23:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D319F19334; Sat, 7 Apr 2018 00:23:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w370NnhJ079398; Sat, 7 Apr 2018 00:23:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w370Nn4J079397; Sat, 7 Apr 2018 00:23:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804070023.w370Nn4J079397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 7 Apr 2018 00:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332161 - stable/11/sys/dev/sbni X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/sbni X-SVN-Commit-Revision: 332161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 00:23:50 -0000 Author: brooks Date: Sat Apr 7 00:23:49 2018 New Revision: 332161 URL: https://svnweb.freebsd.org/changeset/base/332161 Log: MFC r331651-r331653 r331651: Copy flags over ifr_union directly rather than via casts through ifr_data. No functional change in practice. If the sbni driver supported 64-bit big-endian system, this would be an ABI changes, but it is i386-only. The old version leaked a word of stack on 64-bit systems. This eliminates the only assignment to ifr_data. r331652: Revert r331651 to recommit with proper commit metadata. r331653: Copy flags over ifr_union directly rather than via casts through ifr_data. No functional change in practice. If the sbni driver supported 64-bit big-endian system, this would be an ABI changes, but it is i386-only. The old version leaked a word of stack on 64-bit systems. This eliminates the only assignment to ifr_data. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14874 Modified: stable/11/sys/dev/sbni/if_sbni.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/11/sys/dev/sbni/if_sbni.c Sat Apr 7 00:04:28 2018 (r332160) +++ stable/11/sys/dev/sbni/if_sbni.c Sat Apr 7 00:23:49 2018 (r332161) @@ -1144,7 +1144,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t flags.fixed_rxl = (sc->delta_rxl == 0); flags.fixed_rate = 1; SBNI_UNLOCK(sc); - ifr->ifr_data = *(caddr_t*) &flags; + bcopy(&flags, &ifr->ifr_ifru, sizeof(flags)); break; case SIOCGINSTATS: @@ -1163,7 +1163,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t error = priv_check(td, PRIV_DRIVER); if (error) break; - flags = *(struct sbni_flags*)&ifr->ifr_data; + bcopy(&ifr->ifr_ifru, &flags, sizeof(flags)); SBNI_LOCK(sc); if (flags.fixed_rxl) { sc->delta_rxl = 0; From owner-svn-src-all@freebsd.org Sat Apr 7 03:02:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8179F9EBD4; Sat, 7 Apr 2018 03:02:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCC08494C; Sat, 7 Apr 2018 03:02:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58C301B083; Sat, 7 Apr 2018 03:02:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w373272h061474; Sat, 7 Apr 2018 03:02:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w373278C061473; Sat, 7 Apr 2018 03:02:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804070302.w373278C061473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 7 Apr 2018 03:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332163 - stable/11/share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/share/man/man5 X-SVN-Commit-Revision: 332163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 03:02:08 -0000 Author: kevans Date: Sat Apr 7 03:02:07 2018 New Revision: 332163 URL: https://svnweb.freebsd.org/changeset/base/332163 Log: Regenerate src.conf(5) after r332162 This is a direct commit to stable/11 Modified: stable/11/share/man/man5/src.conf.5 Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sat Apr 7 02:56:59 2018 (r332162) +++ stable/11/share/man/man5/src.conf.5 Sat Apr 7 03:02:07 2018 (r332163) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd March 23, 2018 +.Dd April 6, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -431,18 +431,12 @@ Set to not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL Set to not build .Xr cxgbetool 8 -.It Va WITHOUT_MLX5TOOL -Set to not build -.Xr mlx5tool 8 .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and powerpc/powerpc. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 -.It Va WITH_MLX5TOOL -Set to build -.Xr mlx5tool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc64 and sparc64/sparc64. @@ -608,7 +602,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -616,7 +610,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. .It Va WITH_EISA Set to build EISA kernel modules. .It Va WITHOUT_ELFCOPY_AS_OBJCOPY @@ -1003,6 +997,29 @@ Enable firewire support in /boot/loader and /boot/zfsl This option is a nop on all other platforms. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. +.Pp +This is a default setting on +arm/arm, arm/armeb, arm/armv6, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITHOUT_LOADER_OFW +Disable building of openfirmware bootloader components. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and pc98/i386. +.It Va WITH_LOADER_OFW +Set to build openfirmware bootloader components. +.Pp +This is a default setting on +powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITHOUT_LOADER_UBOOT +Disable building of ubldr. +.Pp +This is a default setting on +amd64/amd64, arm64/aarch64, i386/i386, pc98/i386 and sparc64/sparc64. +.It Va WITH_LOADER_UBOOT +Set to build ubldr. +.Pp +This is a default setting on +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_LOCALES Set to not build localization files; see .Xr locale 1 . @@ -1138,6 +1155,18 @@ This must be set in the environment, make command line .Pa /etc/src-env.conf , not .Pa /etc/src.conf . +.It Va WITHOUT_MLX5TOOL +Set to not build +.Xr mlx5tool 8 +.Pp +This is a default setting on +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and powerpc/powerpc. +.It Va WITH_MLX5TOOL +Set to build +.Xr mlx5tool 8 +.Pp +This is a default setting on +amd64/amd64, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_NAND Set to build the NAND Flash components. .It Va WITHOUT_NDIS From owner-svn-src-all@freebsd.org Sat Apr 7 02:57:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83FDDF9E5FE; Sat, 7 Apr 2018 02:57:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28F7083DC4; Sat, 7 Apr 2018 02:57:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE071AE65; Sat, 7 Apr 2018 02:57:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w372uxTB055151; Sat, 7 Apr 2018 02:56:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w372uxSg055147; Sat, 7 Apr 2018 02:56:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804070256.w372uxSg055147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 7 Apr 2018 02:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332162 - stable/11/tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/tools/build/options X-SVN-Commit-Revision: 332162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 02:57:00 -0000 Author: kevans Date: Sat Apr 7 02:56:59 2018 New Revision: 332162 URL: https://svnweb.freebsd.org/changeset/base/332162 Log: MFC r330116, r330118, r330251, r330254 r330116: Some missing LOADER_EFI build option descriptions r330118: Add missing punctuation to *_LOADER_EFI descriptions... r330251: Remove LOADER_EFI description files LOADER_EFI functionality got folded into EFI as of r330248. r330254: Add descriptions for recently added loader options Added: stable/11/tools/build/options/WITHOUT_LOADER_OFW - copied unchanged from r330254, head/tools/build/options/WITHOUT_LOADER_OFW stable/11/tools/build/options/WITHOUT_LOADER_UBOOT - copied unchanged from r330254, head/tools/build/options/WITHOUT_LOADER_UBOOT stable/11/tools/build/options/WITH_LOADER_OFW - copied unchanged from r330254, head/tools/build/options/WITH_LOADER_OFW stable/11/tools/build/options/WITH_LOADER_UBOOT - copied unchanged from r330254, head/tools/build/options/WITH_LOADER_UBOOT Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/tools/build/options/WITHOUT_LOADER_OFW (from r330254, head/tools/build/options/WITHOUT_LOADER_OFW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_LOADER_OFW Sat Apr 7 02:56:59 2018 (r332162, copy of r330254, head/tools/build/options/WITHOUT_LOADER_OFW) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable building of openfirmware bootloader components. Copied: stable/11/tools/build/options/WITHOUT_LOADER_UBOOT (from r330254, head/tools/build/options/WITHOUT_LOADER_UBOOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_LOADER_UBOOT Sat Apr 7 02:56:59 2018 (r332162, copy of r330254, head/tools/build/options/WITHOUT_LOADER_UBOOT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable building of ubldr. Copied: stable/11/tools/build/options/WITH_LOADER_OFW (from r330254, head/tools/build/options/WITH_LOADER_OFW) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_LOADER_OFW Sat Apr 7 02:56:59 2018 (r332162, copy of r330254, head/tools/build/options/WITH_LOADER_OFW) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build openfirmware bootloader components. Copied: stable/11/tools/build/options/WITH_LOADER_UBOOT (from r330254, head/tools/build/options/WITH_LOADER_UBOOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_LOADER_UBOOT Sat Apr 7 02:56:59 2018 (r332162, copy of r330254, head/tools/build/options/WITH_LOADER_UBOOT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build ubldr. From owner-svn-src-all@freebsd.org Sat Apr 7 03:51:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10E21F80655; Sat, 7 Apr 2018 03:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B553870C53; Sat, 7 Apr 2018 03:51:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD09A1B8A8; Sat, 7 Apr 2018 03:51:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w373pJ4r083640; Sat, 7 Apr 2018 03:51:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w373pJAv083639; Sat, 7 Apr 2018 03:51:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804070351.w373pJAv083639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 7 Apr 2018 03:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332164 - stable/11/lib/libcapsicum X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libcapsicum X-SVN-Commit-Revision: 332164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 03:51:20 -0000 Author: kevans Date: Sat Apr 7 03:51:19 2018 New Revision: 332164 URL: https://svnweb.freebsd.org/changeset/base/332164 Log: MFC r322324: capsicum_helpers: Add FIODTYPE to default ioctls allowed FIODTYPE will be needed by hexdump(1) to speed up the -s flag on devices that should be able to support fseek(3); specifically, in an attempt to correct for the fact that most tape drives don't support seeking yet don't indicate as such when fseeko(3) is invoked. Modified: stable/11/lib/libcapsicum/capsicum_helpers.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- stable/11/lib/libcapsicum/capsicum_helpers.h Sat Apr 7 03:02:07 2018 (r332163) +++ stable/11/lib/libcapsicum/capsicum_helpers.h Sat Apr 7 03:51:19 2018 (r332164) @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -47,7 +48,7 @@ static __inline int caph_limit_stream(int fd, int flags) { cap_rights_t rights; - unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ }; + unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ, FIODTYPE }; cap_rights_init(&rights, CAP_EVENT, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_SEEK); From owner-svn-src-all@freebsd.org Sat Apr 7 09:03:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDCBF99A3E; Sat, 7 Apr 2018 09:03:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BACA56E3A3; Sat, 7 Apr 2018 09:03:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5C6C1EC09; Sat, 7 Apr 2018 09:03:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3793pio040311; Sat, 7 Apr 2018 09:03:51 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3793pGN040309; Sat, 7 Apr 2018 09:03:51 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201804070903.w3793pGN040309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 7 Apr 2018 09:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332165 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 09:03:52 -0000 Author: ed Date: Sat Apr 7 09:03:51 2018 New Revision: 332165 URL: https://svnweb.freebsd.org/changeset/base/332165 Log: Fix enough warnings that we can build syslogd on all targets at WARNS=6. This also fixes the build on MIPS. Reported by: cy (MIPS build failure) Modified: head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/Makefile ============================================================================== --- head/usr.sbin/syslogd/Makefile Sat Apr 7 03:51:19 2018 (r332164) +++ head/usr.sbin/syslogd/Makefile Sat Apr 7 09:03:51 2018 (r332165) @@ -11,8 +11,6 @@ SRCS= syslogd.c ttymsg.c LIBADD= util -WARNS?= 3 - .if ${MK_INET_SUPPORT} != "no" CFLAGS+= -DINET .endif Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sat Apr 7 03:51:19 2018 (r332164) +++ head/usr.sbin/syslogd/syslogd.c Sat Apr 7 09:03:51 2018 (r332165) @@ -581,7 +581,7 @@ main(int argc, char *argv[]) else if (ch == 'p') { mode = DEFFILEMODE; pflag = 1; - } else if (ch == 'S') { + } else { mode = S_IRUSR | S_IWUSR; Sflag = 1; } @@ -931,7 +931,7 @@ static void parsemsg_rfc5424(const char *from, int pri, char *msg) { const struct logtime *timestamp; - struct logtime timestamp_remote = { 0 }; + struct logtime timestamp_remote; const char *omsg, *hostname, *app_name, *procid, *msgid, *structured_data; char line[MAXLINE + 1]; @@ -971,6 +971,7 @@ parsemsg_rfc5424(const char *from, int pri, char *msg) dest = v; \ } while (0) /* Date and time. */ + memset(×tamp_remote, 0, sizeof(timestamp_remote)); PARSE_NUMBER(timestamp_remote.tm.tm_year, 4, 0, 9999); timestamp_remote.tm.tm_year -= 1900; PARSE_CHAR("TIMESTAMP", '-'); @@ -1151,7 +1152,7 @@ parsemsg_rfc3164(const char *from, int pri, char *msg) { struct tm tm_parsed; const struct logtime *timestamp; - struct logtime timestamp_remote = { 0 }; + struct logtime timestamp_remote; const char *app_name, *procid; size_t i, msglen; char line[MAXLINE + 1]; @@ -1187,6 +1188,7 @@ parsemsg_rfc3164(const char *from, int pri, char *msg) timestamp_remote.tm = tm_parsed; timestamp_remote.tm.tm_year = year; timestamp_remote.tm.tm_isdst = -1; + timestamp_remote.usec = 0; if (mktime(×tamp_remote.tm) < t_now + 7 * 24 * 60 * 60) break; From owner-svn-src-all@freebsd.org Sat Apr 7 14:17:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AF4FF8BBF7; Sat, 7 Apr 2018 14:17:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BEEF79603; Sat, 7 Apr 2018 14:17:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EC8621DF1; Sat, 7 Apr 2018 14:17:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EHIVo095738; Sat, 7 Apr 2018 14:17:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EHIae095737; Sat, 7 Apr 2018 14:17:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804071417.w37EHIae095737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 7 Apr 2018 14:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332166 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 332166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:17:18 -0000 Author: manu Date: Sat Apr 7 14:17:17 2018 New Revision: 332166 URL: https://svnweb.freebsd.org/changeset/base/332166 Log: axp81x: Do not fail if regulators aren't properly defined If a regulator is missing a mandatory property (like 'regulator-name'), do not fail, regulator_parse_ofw_stdparam is returning a non-zero value so just skip this regulator. Also if any regulator fails to attach continue with the rest of the regulators instead of returning ENXIO in axp8xx_attach Tested On: BananaPi M3 Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Sat Apr 7 09:03:51 2018 (r332165) +++ head/sys/arm/allwinner/axp81x.c Sat Apr 7 14:17:17 2018 (r332166) @@ -900,7 +900,8 @@ axp8xx_reg_attach(device_t dev, phandle_t node, struct regnode *regnode; memset(&initdef, 0, sizeof(initdef)); - regulator_parse_ofw_stdparam(dev, node, &initdef); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) + return (NULL); if (initdef.std_param.min_uvolt == 0) initdef.std_param.min_uvolt = def->voltage_min * 1000; if (initdef.std_param.max_uvolt == 0) @@ -1039,7 +1040,7 @@ axp8xx_attach(device_t dev) device_printf(dev, "cannot attach regulator %s\n", regname); - return (ENXIO); + continue; } sc->regs[i] = reg; } From owner-svn-src-all@freebsd.org Sat Apr 7 14:35:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95858F8CFCF; Sat, 7 Apr 2018 14:35:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B33383B42; Sat, 7 Apr 2018 14:35:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 461F922143; Sat, 7 Apr 2018 14:35:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EZlWs005937; Sat, 7 Apr 2018 14:35:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EZlfp005936; Sat, 7 Apr 2018 14:35:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071435.w37EZlfp005936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332167 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:35:47 -0000 Author: tuexen Date: Sat Apr 7 14:35:46 2018 New Revision: 332167 URL: https://svnweb.freebsd.org/changeset/base/332167 Log: MFC r320650: Don't hold a refcount on an stcb when it is not needed. This improves the consistency with other parts of the code. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 14:17:17 2018 (r332166) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 14:35:46 2018 (r332167) @@ -2152,23 +2152,23 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in * cookie was in flight. Only recourse is to abort the * association. */ - atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, src, dst, sh, op_err, mflowtype, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif - atomic_subtract_int(&stcb->asoc.refcnt, 1); return (NULL); } /* process the INIT-ACK info (my info) */ @@ -2189,36 +2189,36 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in else retval = 0; if (retval < 0) { - atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif - atomic_subtract_int(&stcb->asoc.refcnt, 1); return (NULL); } /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, src, dst, init_src, port)) { - atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif - atomic_subtract_int(&stcb->asoc.refcnt, 1); return (NULL); } /* @@ -2237,18 +2237,18 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in /* auth HMAC failed, dump the assoc and packet */ SCTPDBG(SCTP_DEBUG_AUTH1, "COOKIE-ECHO: AUTH failed\n"); - atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_21); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif - atomic_subtract_int(&stcb->asoc.refcnt, 1); return (NULL); } else { /* remaining chunks checked... good to go */ @@ -2298,18 +2298,18 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in break; #endif default: - atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif - atomic_subtract_int(&stcb->asoc.refcnt, 1); return (NULL); } From owner-svn-src-all@freebsd.org Sat Apr 7 14:37:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C18F8D1EA; Sat, 7 Apr 2018 14:37:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20ACD84946; Sat, 7 Apr 2018 14:37:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B7B622145; Sat, 7 Apr 2018 14:37:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EbGL2006040; Sat, 7 Apr 2018 14:37:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EbGlu006039; Sat, 7 Apr 2018 14:37:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071437.w37EbGlu006039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332168 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:37:17 -0000 Author: tuexen Date: Sat Apr 7 14:37:16 2018 New Revision: 332168 URL: https://svnweb.freebsd.org/changeset/base/332168 Log: MFC r320653: Move to open state after plausibility checks. When doing this too early, the MIB counters go wrong. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 14:35:46 2018 (r332167) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 14:37:16 2018 (r332168) @@ -2255,17 +2255,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in stcb->asoc.authenticated = 1; } } - /* update current state */ - SCTPDBG(SCTP_DEBUG_INPUT2, "moving to OPEN state\n"); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); - if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, asoc->primary_destination); - } - sctp_stop_all_cookie_timers(stcb); - SCTP_STAT_INCR_COUNTER32(sctps_passiveestab); - SCTP_STAT_INCR_GAUGE32(sctps_currestab); - /* * if we're doing ASCONFs, check to see if we have any new local * addresses that need to get added to the peer (eg. addresses @@ -2312,6 +2301,17 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in #endif return (NULL); } + + /* update current state */ + SCTPDBG(SCTP_DEBUG_INPUT2, "moving to OPEN state\n"); + SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, + stcb->sctp_ep, stcb, asoc->primary_destination); + } + sctp_stop_all_cookie_timers(stcb); + SCTP_STAT_INCR_COUNTER32(sctps_passiveestab); + SCTP_STAT_INCR_GAUGE32(sctps_currestab); /* set up to notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_UP; From owner-svn-src-all@freebsd.org Sat Apr 7 14:38:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87EA8F8D42C; Sat, 7 Apr 2018 14:38:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 387CD85A4D; Sat, 7 Apr 2018 14:38:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D3CB22146; Sat, 7 Apr 2018 14:38:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Ecx1Q006147; Sat, 7 Apr 2018 14:38:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EcwIE006145; Sat, 7 Apr 2018 14:38:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071438.w37EcwIE006145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332169 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:38:59 -0000 Author: tuexen Date: Sat Apr 7 14:38:58 2018 New Revision: 332169 URL: https://svnweb.freebsd.org/changeset/base/332169 Log: MFC r321034: Fix the handling of Explicit EOR mode. While there, appropriately handle the overhead depending on the usage of DATA or I-DATA chunks. Take the overhead only into account, when required. Joint work with rrs@ Modified: stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_output.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 14:37:16 2018 (r332168) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 14:38:58 2018 (r332169) @@ -6250,11 +6250,7 @@ sctp_get_frag_point(struct sctp_tcb *stcb, } else { ovh = SCTP_MIN_V4_OVERHEAD; } - if (stcb->asoc.idata_supported) { - ovh += sizeof(struct sctp_idata_chunk); - } else { - ovh += sizeof(struct sctp_data_chunk); - } + ovh += SCTP_DATA_CHUNK_OVERHEAD(stcb); if (stcb->asoc.sctp_frag_point > asoc->smallest_mtu) siz = asoc->smallest_mtu - ovh; else @@ -6759,7 +6755,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s } } un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + (stcb->asoc.stream_queue_cnt * SCTP_DATA_CHUNK_OVERHEAD(stcb))); if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) && (stcb->asoc.total_flight > 0) && @@ -7459,11 +7455,7 @@ dont_do_it: } else { atomic_subtract_int(&sp->length, to_move); } - if (stcb->asoc.idata_supported == 0) { - leading = sizeof(struct sctp_data_chunk); - } else { - leading = sizeof(struct sctp_idata_chunk); - } + leading = SCTP_DATA_CHUNK_OVERHEAD(stcb); if (M_LEADINGSPACE(chk->data) < leading) { /* Not enough room for a chunk header, get some */ struct mbuf *m; @@ -7505,11 +7497,7 @@ dont_do_it: M_ALIGN(chk->data, 4); } } - if (stcb->asoc.idata_supported == 0) { - SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_data_chunk), M_NOWAIT); - } else { - SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_idata_chunk), M_NOWAIT); - } + SCTP_BUF_PREPEND(chk->data, SCTP_DATA_CHUNK_OVERHEAD(stcb), M_NOWAIT); if (chk->data == NULL) { /* HELP, TSNH since we assured it would not above? */ #ifdef INVARIANTS @@ -7522,13 +7510,8 @@ dont_do_it: to_move = 0; goto out_of; } - if (stcb->asoc.idata_supported == 0) { - sctp_snd_sb_alloc(stcb, sizeof(struct sctp_data_chunk)); - chk->book_size = chk->send_size = (uint16_t)(to_move + sizeof(struct sctp_data_chunk)); - } else { - sctp_snd_sb_alloc(stcb, sizeof(struct sctp_idata_chunk)); - chk->book_size = chk->send_size = (uint16_t)(to_move + sizeof(struct sctp_idata_chunk)); - } + sctp_snd_sb_alloc(stcb, SCTP_DATA_CHUNK_OVERHEAD(stcb)); + chk->book_size = chk->send_size = (uint16_t)(to_move + SCTP_DATA_CHUNK_OVERHEAD(stcb)); chk->book_size_scale = 0; chk->sent = SCTP_DATAGRAM_UNSENT; @@ -7728,11 +7711,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, break; } /* Need an allowance for the data chunk header too */ - if (stcb->asoc.idata_supported == 0) { - space_left -= sizeof(struct sctp_data_chunk); - } else { - space_left -= sizeof(struct sctp_idata_chunk); - } + space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); /* must make even word boundary */ space_left &= 0xfffffffc; @@ -7749,18 +7728,10 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); total_moved += moved; space_left -= moved; - if (stcb->asoc.idata_supported == 0) { - if (space_left >= sizeof(struct sctp_data_chunk)) { - space_left -= sizeof(struct sctp_data_chunk); - } else { - space_left = 0; - } + if (space_left >= SCTP_DATA_CHUNK_OVERHEAD(stcb)) { + space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); } else { - if (space_left >= sizeof(struct sctp_idata_chunk)) { - space_left -= sizeof(struct sctp_idata_chunk); - } else { - space_left = 0; - } + space_left = 0; } space_left &= 0xfffffffc; } @@ -10209,8 +10180,7 @@ do_it_again: * and we have data in flight we stop, except if we * are handling a fragmented user message. */ - un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; if ((un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD)) && (stcb->asoc.total_flight > 0)) { /* && sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) {*/ @@ -12448,7 +12418,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->sender_all_done = 0; sp->some_taken = 0; sp->put_last_out = 0; - resv_in_first = sizeof(struct sctp_data_chunk); + resv_in_first = SCTP_DATA_CHUNK_OVERHEAD(stcb); sp->data = sp->tail_mbuf = NULL; if (sp->length == 0) { *error = 0; @@ -12865,12 +12835,19 @@ sctp_lower_sosend(struct socket *so, } /* would we block? */ if (non_blocking) { + uint32_t amount; + if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); - if ((SCTP_SB_LIMIT_SND(so) < (sndlen + inqueue_bytes + stcb->asoc.sb_send_resv)) || + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (user_marks_eor == 0) { + amount = sndlen; + } else { + amount = 1; + } + if ((SCTP_SB_LIMIT_SND(so) < (amount + inqueue_bytes + stcb->asoc.sb_send_resv)) || (stcb->asoc.chunks_on_out_queue >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EWOULDBLOCK); if (sndlen > SCTP_SB_LIMIT_SND(so)) @@ -13036,7 +13013,7 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } /* Calculate the maximum we can send */ - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { if (non_blocking) { /* we already checked for non-blocking above. */ @@ -13093,7 +13070,7 @@ sctp_lower_sosend(struct socket *so, ((stcb->asoc.chunks_on_out_queue + stcb->asoc.stream_queue_cnt) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { /* No room right now ! */ SOCKBUF_LOCK(&so->so_snd); - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); while ((SCTP_SB_LIMIT_SND(so) < (inqueue_bytes + local_add_more)) || ((stcb->asoc.stream_queue_cnt + stcb->asoc.chunks_on_out_queue) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { SCTPDBG(SCTP_DEBUG_OUTPUT1, "pre_block limit:%u <(inq:%d + %d) || (%d+%d > %d)\n", @@ -13129,7 +13106,7 @@ sctp_lower_sosend(struct socket *so, SOCKBUF_UNLOCK(&so->so_snd); goto out_unlocked; } - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); } if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; @@ -13222,8 +13199,9 @@ skip_preblock: /* How much room do we have? */ struct mbuf *new_tail, *mm; - if (SCTP_SB_LIMIT_SND(so) > stcb->asoc.total_output_queue_size) - max_len = SCTP_SB_LIMIT_SND(so) - stcb->asoc.total_output_queue_size; + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) + max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; else max_len = 0; @@ -13299,8 +13277,8 @@ skip_preblock: hold_tcblock = 1; } sctp_prune_prsctp(stcb, asoc, srcv, sndlen); - inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); - if (SCTP_SB_LIMIT_SND(so) > stcb->asoc.total_output_queue_size) + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; else max_len = 0; @@ -13341,8 +13319,7 @@ skip_preblock: } asoc->ifp_had_enobuf = 0; } - un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) && (stcb->asoc.total_flight > 0) && (stcb->asoc.stream_queue_cnt < SCTP_MAX_DATA_BUNDLING) && @@ -13416,7 +13393,8 @@ skip_preblock: * size we KNOW we will get to sleep safely with the * wakeup flag in place. */ - if (SCTP_SB_LIMIT_SND(so) <= (stcb->asoc.total_output_queue_size + + inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); + if (SCTP_SB_LIMIT_SND(so) <= (inqueue_bytes + min(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTP_SB_LIMIT_SND(so)))) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_INTO_BLK, @@ -13613,8 +13591,7 @@ skip_out_eof: } asoc->ifp_had_enobuf = 0; } - un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + - (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); + un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) && (stcb->asoc.total_flight > 0) && (stcb->asoc.stream_queue_cnt < SCTP_MAX_DATA_BUNDLING) && Modified: stable/11/sys/netinet/sctp_output.h ============================================================================== --- stable/11/sys/netinet/sctp_output.h Sat Apr 7 14:37:16 2018 (r332168) +++ stable/11/sys/netinet/sctp_output.h Sat Apr 7 14:38:58 2018 (r332169) @@ -135,6 +135,11 @@ void sctp_fix_ecn_echo(struct sctp_association *); void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net); + +#define SCTP_DATA_CHUNK_OVERHEAD(stcb) ((stcb)->asoc.idata_supported ? \ + sizeof(struct sctp_idata_chunk) : \ + sizeof(struct sctp_data_chunk)) + int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); From owner-svn-src-all@freebsd.org Sat Apr 7 14:40:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2BFAF8D599; Sat, 7 Apr 2018 14:40:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9768A86508; Sat, 7 Apr 2018 14:40:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91A022214A; Sat, 7 Apr 2018 14:40:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Ee9DA006274; Sat, 7 Apr 2018 14:40:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Ee9Vr006272; Sat, 7 Apr 2018 14:40:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804071440.w37Ee9Vr006272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 7 Apr 2018 14:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332170 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 332170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:40:10 -0000 Author: tsoome Date: Sat Apr 7 14:40:09 2018 New Revision: 332170 URL: https://svnweb.freebsd.org/changeset/base/332170 Log: libsa: cd9660: warning: 'lenskip' may be used uninitialized in this function We better provide value for lenskip in both instances. Modified: head/stand/libsa/cd9660.c head/stand/libsa/cd9660read.c Modified: head/stand/libsa/cd9660.c ============================================================================== --- head/stand/libsa/cd9660.c Sat Apr 7 14:38:58 2018 (r332169) +++ head/stand/libsa/cd9660.c Sat Apr 7 14:40:09 2018 (r332170) @@ -309,6 +309,7 @@ cd9660_open(const char *path, struct open_file *f) first = 1; use_rrip = 0; + lenskip = 0; while (*path) { bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); dsize = isonum_733(rec.size); @@ -343,7 +344,7 @@ cd9660_open(const char *path, struct open_file *f) use_rrip = rrip_check(f, dp, &lenskip); if (dirmatch(f, path, dp, use_rrip, - first ? 0 : lenskip)) { + first ? 0 : lenskip)) { first = 0; break; } else Modified: head/stand/libsa/cd9660read.c ============================================================================== --- head/stand/libsa/cd9660read.c Sat Apr 7 14:38:58 2018 (r332169) +++ head/stand/libsa/cd9660read.c Sat Apr 7 14:40:09 2018 (r332170) @@ -247,6 +247,7 @@ cd9660_lookup(const char *path) first = 1; use_rrip = 0; + lenskip = 0; while (*path) { bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); dsize = isonum_733(rec.size); From owner-svn-src-all@freebsd.org Sat Apr 7 14:40:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2487F8D624; Sat, 7 Apr 2018 14:40:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEEB86763; Sat, 7 Apr 2018 14:40:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 436AA2214B; Sat, 7 Apr 2018 14:40:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EeMvj006332; Sat, 7 Apr 2018 14:40:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EeLiU006328; Sat, 7 Apr 2018 14:40:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071440.w37EeLiU006328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332171 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:40:23 -0000 Author: tuexen Date: Sat Apr 7 14:40:21 2018 New Revision: 332171 URL: https://svnweb.freebsd.org/changeset/base/332171 Log: MFC r321197: Fix the accounting and add code to detect errors in accounting. Joint work with rrs@ Modified: stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Sat Apr 7 14:40:09 2018 (r332170) +++ stable/11/sys/netinet/sctp_auth.c Sat Apr 7 14:40:21 2018 (r332171) @@ -1797,8 +1797,8 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:40:09 2018 (r332170) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:40:21 2018 (r332171) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); * This will cause sctp_service_queues() to get called on the top entry in * the list. */ -static void +static uint32_t sctp_add_chk_to_control(struct sctp_queued_to_read *control, struct sctp_stream_in *strm, struct sctp_tcb *stcb, @@ -92,6 +92,8 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso asoc->size_on_reasm_queue == 0 && asoc->size_on_all_streams == 0) { /* Full rwnd granted */ + KASSERT(asoc->cnt_on_reasm_queue == 0, ("cnt_on_reasm_queue is %u", asoc->cnt_on_reasm_queue)); + KASSERT(asoc->cnt_on_all_streams == 0, ("cnt_on_all_streams is %u", asoc->cnt_on_all_streams)); calc = max(SCTP_SB_LIMIT_RCV(stcb->sctp_socket), SCTP_MINIMAL_RWND); return (calc); } @@ -558,7 +560,15 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, } /* EY it wont be queued if it could be delivered directly */ queue_needed = 0; - asoc->size_on_all_streams -= control->length; + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); strm->last_mid_delivered++; sctp_mark_non_revokable(asoc, control->sinfo_tsn); @@ -571,11 +581,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, nxt_todel = strm->last_mid_delivered + 1; if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid) && (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG)) { - asoc->size_on_all_streams -= control->length; - sctp_ucount_decr(asoc->cnt_on_all_streams); if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { #ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); +#ifdef INVARIANTS } else { panic("Huh control: %p is on_strm_q: %d", control, control->on_strm_q); @@ -671,7 +689,7 @@ sctp_setup_tail_pointer(struct sctp_queued_to_read *co } static void -sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m) +sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m, uint32_t *added) { struct mbuf *prev = NULL; struct sctp_tcb *stcb; @@ -715,6 +733,7 @@ sctp_add_to_tail_pointer(struct sctp_queued_to_read *c */ sctp_sballoc(stcb, &stcb->sctp_socket->so_rcv, m); } + *added += SCTP_BUF_LEN(m); atomic_add_int(&control->length, SCTP_BUF_LEN(m)); m = SCTP_BUF_NEXT(m); } @@ -815,7 +834,15 @@ restart: tchk = TAILQ_FIRST(&control->reasm); if (tchk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) { TAILQ_REMOVE(&control->reasm, tchk, sctp_next); - asoc->size_on_reasm_queue -= tchk->send_size; + if (asoc->size_on_reasm_queue >= tchk->send_size) { + asoc->size_on_reasm_queue -= tchk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, tchk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); nc->first_frag_seen = 1; nc->fsn_included = tchk->rec.data.fsn; @@ -1127,6 +1154,16 @@ done_un: #endif SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; } if (strm->pd_api_started && control->pdapi_started) { @@ -1173,6 +1210,16 @@ deliver_more: #endif SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; } ret++; @@ -1219,7 +1266,7 @@ out: } -void +uint32_t sctp_add_chk_to_control(struct sctp_queued_to_read *control, struct sctp_stream_in *strm, struct sctp_tcb *stcb, struct sctp_association *asoc, @@ -1229,6 +1276,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co * Given a control and a chunk, merge the data from the chk onto the * control and free up the chunk resources. */ + uint32_t added = 0; int i_locked = 0; if (control->on_read_q && (hold_rlock == 0)) { @@ -1242,7 +1290,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co control->data = chk->data; sctp_setup_tail_pointer(control); } else { - sctp_add_to_tail_pointer(control, chk->data); + sctp_add_to_tail_pointer(control, chk->data, &added); } control->fsn_included = chk->rec.data.fsn; asoc->size_on_reasm_queue -= chk->send_size; @@ -1268,6 +1316,16 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co } else if (control->on_strm_q == SCTP_ON_ORDERED) { /* Ordered */ TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; #ifdef INVARIANTS } else if (control->on_strm_q) { @@ -1283,6 +1341,7 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co SCTP_INP_READ_UNLOCK(stcb->sctp_ep); } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); + return (added); } /* @@ -1302,6 +1361,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc struct sctp_tmit_chunk *at, *nat; struct sctp_stream_in *strm; int do_wakeup, unordered; + uint32_t lenadded; strm = &asoc->strmin[control->sinfo_stream]; /* @@ -1314,6 +1374,9 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc } /* Must be added to the stream-in queue */ if (created_control) { + if (unordered == 0) { + sctp_ucount_incr(asoc->cnt_on_all_streams); + } if (sctp_place_control_in_stream(strm, asoc, control)) { /* Duplicate SSN? */ sctp_clean_up_control(stcb, control); @@ -1373,6 +1436,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); sctp_setup_tail_pointer(control); + asoc->size_on_all_streams += control->length; } else { /* Place the chunk in our list */ int inserted = 0; @@ -1529,7 +1593,8 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc at->rec.data.fsn, next_fsn, control->fsn_included); TAILQ_REMOVE(&control->reasm, at, sctp_next); - sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); + lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); + asoc->size_on_all_streams += lenadded; if (control->on_read_q) { do_wakeup = 1; } @@ -1600,7 +1665,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc uint16_t sid; struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - struct sctp_queued_to_read *control = NULL; + struct sctp_queued_to_read *control, *ncontrol; uint32_t ppid; uint8_t chk_flags; struct sctp_stream_reset_list *liste; @@ -2006,7 +2071,13 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc return (0); } if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { + struct mbuf *m; + control->data = dmbuf; + m = control->data; + for (m = control->data; m; m = m->m_next) { + control->length += SCTP_BUF_LEN(m); + } control->tail_mbuf = NULL; control->end_added = 1; control->last_frag_seen = 1; @@ -2116,16 +2187,16 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc /* first one on */ TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); } else { - struct sctp_queued_to_read *ctlOn, *nctlOn; + struct sctp_queued_to_read *lcontrol, *nlcontrol; unsigned char inserted = 0; - TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { - if (SCTP_TSN_GT(control->sinfo_tsn, ctlOn->sinfo_tsn)) { + TAILQ_FOREACH_SAFE(lcontrol, &asoc->pending_reply_queue, next, nlcontrol) { + if (SCTP_TSN_GT(control->sinfo_tsn, lcontrol->sinfo_tsn)) { continue; } else { /* found it */ - TAILQ_INSERT_BEFORE(ctlOn, control, next); + TAILQ_INSERT_BEFORE(lcontrol, control, next); inserted = 1; break; } @@ -2216,8 +2287,6 @@ finish_express_del: * pending_reply space 3: distribute any chunks in * pending_reply_queue. */ - struct sctp_queued_to_read *ctl, *nctl; - sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); sctp_send_deferred_reset_response(stcb, liste, SCTP_STREAM_RESET_RESULT_PERFORMED); @@ -2226,34 +2295,34 @@ finish_express_del: liste = TAILQ_FIRST(&asoc->resetHead); if (TAILQ_EMPTY(&asoc->resetHead)) { /* All can be removed */ - TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); - sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag, &need_reasm_check); + TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) { + TAILQ_REMOVE(&asoc->pending_reply_queue, control, next); + sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); if (*abort_flag) { return (0); } if (need_reasm_check) { - (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[ctl->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); + (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[control->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); need_reasm_check = 0; } } } else { - TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - if (SCTP_TSN_GT(ctl->sinfo_tsn, liste->tsn)) { + TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) { + if (SCTP_TSN_GT(control->sinfo_tsn, liste->tsn)) { break; } /* - * if ctl->sinfo_tsn is <= liste->tsn we can - * process it which is the NOT of - * ctl->sinfo_tsn > liste->tsn + * if control->sinfo_tsn is <= liste->tsn we + * can process it which is the NOT of + * control->sinfo_tsn > liste->tsn */ - TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); - sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag, &need_reasm_check); + TAILQ_REMOVE(&asoc->pending_reply_queue, control, next); + sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check); if (*abort_flag) { return (0); } if (need_reasm_check) { - (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[ctl->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); + (void)sctp_deliver_reasm_check(stcb, asoc, &asoc->strmin[control->sinfo_stream], SCTP_READ_LOCK_NOT_HELD); need_reasm_check = 0; } } @@ -5181,7 +5250,7 @@ static void sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, struct sctp_stream_in *strmin) { - struct sctp_queued_to_read *ctl, *nctl; + struct sctp_queued_to_read *control, *ncontrol; struct sctp_association *asoc; uint32_t mid; int need_reasm_check = 0; @@ -5192,43 +5261,51 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, * First deliver anything prior to and including the stream no that * came in. */ - TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next_instrm, nctl) { - if (SCTP_MID_GE(asoc->idata_supported, mid, ctl->mid)) { + TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) { + if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) { /* this is deliverable now */ - if (((ctl->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { - if (ctl->on_strm_q) { - if (ctl->on_strm_q == SCTP_ON_ORDERED) { - TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm); - } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { - TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); + if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { + if (control->on_strm_q) { + if (control->on_strm_q == SCTP_ON_ORDERED) { + TAILQ_REMOVE(&strmin->inqueue, control, next_instrm); + } else if (control->on_strm_q == SCTP_ON_UNORDERED) { + TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm); #ifdef INVARIANTS } else { panic("strmin: %p ctl: %p unknown %d", - strmin, ctl, ctl->on_strm_q); + strmin, control, control->on_strm_q); #endif } - ctl->on_strm_q = 0; + control->on_strm_q = 0; } /* subtract pending on streams */ - asoc->size_on_all_streams -= ctl->length; + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); /* deliver it to at least the delivery-q */ if (stcb->sctp_socket) { - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, + control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); } } else { /* Its a fragmented message */ - if (ctl->first_frag_seen) { + if (control->first_frag_seen) { /* * Make it so this is next to * deliver, we restore later */ - strmin->last_mid_delivered = ctl->mid - 1; + strmin->last_mid_delivered = control->mid - 1; need_reasm_check = 1; break; } @@ -5257,32 +5334,40 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, * now ready. */ mid = strmin->last_mid_delivered + 1; - TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next_instrm, nctl) { - if (SCTP_MID_EQ(asoc->idata_supported, mid, ctl->mid)) { - if (((ctl->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { + TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) { + if (SCTP_MID_EQ(asoc->idata_supported, mid, control->mid)) { + if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { /* this is deliverable now */ - if (ctl->on_strm_q) { - if (ctl->on_strm_q == SCTP_ON_ORDERED) { - TAILQ_REMOVE(&strmin->inqueue, ctl, next_instrm); - } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { - TAILQ_REMOVE(&strmin->uno_inqueue, ctl, next_instrm); + if (control->on_strm_q) { + if (control->on_strm_q == SCTP_ON_ORDERED) { + TAILQ_REMOVE(&strmin->inqueue, control, next_instrm); + } else if (control->on_strm_q == SCTP_ON_UNORDERED) { + TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm); #ifdef INVARIANTS } else { panic("strmin: %p ctl: %p unknown %d", - strmin, ctl, ctl->on_strm_q); + strmin, control, control->on_strm_q); #endif } - ctl->on_strm_q = 0; + control->on_strm_q = 0; } /* subtract pending on streams */ - asoc->size_on_all_streams -= ctl->length; + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); /* deliver it to at least the delivery-q */ - strmin->last_mid_delivered = ctl->mid; + strmin->last_mid_delivered = control->mid; if (stcb->sctp_socket) { - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_mark_non_revokable(asoc, control->sinfo_tsn); sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, + control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); @@ -5290,12 +5375,12 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, mid = strmin->last_mid_delivered + 1; } else { /* Its a fragmented message */ - if (ctl->first_frag_seen) { + if (control->first_frag_seen) { /* * Make it so this is next to * deliver */ - strmin->last_mid_delivered = ctl->mid - 1; + strmin->last_mid_delivered = control->mid - 1; need_reasm_check = 1; break; } @@ -5347,7 +5432,15 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, } cnt_removed++; TAILQ_REMOVE(&control->reasm, chk, sctp_next); - asoc->size_on_reasm_queue -= chk->send_size; + if (asoc->size_on_reasm_queue >= chk->send_size) { + asoc->size_on_reasm_queue -= chk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); if (chk->data) { sctp_m_freem(chk->data); @@ -5373,6 +5466,16 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, } if (control->on_strm_q == SCTP_ON_ORDERED) { TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; } else if (control->on_strm_q == SCTP_ON_UNORDERED) { TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); @@ -5416,7 +5519,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, unsigned int i, fwd_sz, m_size; uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_queued_to_read *ctl, *sv; + struct sctp_queued_to_read *control, *sv; asoc = &stcb->asoc; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { @@ -5575,25 +5678,35 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, for (cur_mid = strm->last_mid_delivered; SCTP_MID_GE(asoc->idata_supported, mid, cur_mid); cur_mid++) { sctp_flush_reassm_for_str_seq(stcb, asoc, sid, cur_mid, ordered, new_cum_tsn); } - TAILQ_FOREACH(ctl, &stcb->sctp_ep->read_queue, next) { - if ((ctl->sinfo_stream == sid) && - (SCTP_MID_EQ(asoc->idata_supported, ctl->mid, mid))) { + TAILQ_FOREACH(control, &stcb->sctp_ep->read_queue, next) { + if ((control->sinfo_stream == sid) && + (SCTP_MID_EQ(asoc->idata_supported, control->mid, mid))) { str_seq = (sid << 16) | (0x0000ffff & mid); - ctl->pdapi_aborted = 1; + control->pdapi_aborted = 1; sv = stcb->asoc.control_pdapi; - ctl->end_added = 1; - if (ctl->on_strm_q == SCTP_ON_ORDERED) { - TAILQ_REMOVE(&strm->inqueue, ctl, next_instrm); - } else if (ctl->on_strm_q == SCTP_ON_UNORDERED) { - TAILQ_REMOVE(&strm->uno_inqueue, ctl, next_instrm); + control->end_added = 1; + if (control->on_strm_q == SCTP_ON_ORDERED) { + TAILQ_REMOVE(&strm->inqueue, control, next_instrm); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { #ifdef INVARIANTS - } else if (ctl->on_strm_q) { + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + sctp_ucount_decr(asoc->cnt_on_all_streams); + } else if (control->on_strm_q == SCTP_ON_UNORDERED) { + TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); +#ifdef INVARIANTS + } else if (control->on_strm_q) { panic("strm: %p ctl: %p unknown %d", - strm, ctl, ctl->on_strm_q); + strm, control, control->on_strm_q); #endif } - ctl->on_strm_q = 0; - stcb->asoc.control_pdapi = ctl; + control->on_strm_q = 0; + stcb->asoc.control_pdapi = control; sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, stcb, SCTP_PARTIAL_DELIVERY_ABORTED, @@ -5601,8 +5714,8 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, SCTP_SO_NOT_LOCKED); stcb->asoc.control_pdapi = sv; break; - } else if ((ctl->sinfo_stream == sid) && - SCTP_MID_GT(asoc->idata_supported, ctl->mid, mid)) { + } else if ((control->sinfo_stream == sid) && + SCTP_MID_GT(asoc->idata_supported, control->mid, mid)) { /* We are past our victim SSN */ break; } Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 14:40:09 2018 (r332170) +++ stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 14:40:21 2018 (r332171) @@ -4599,21 +4599,21 @@ void sctp_clean_up_stream(struct sctp_tcb *stcb, struct sctp_readhead *rh) { struct sctp_tmit_chunk *chk, *nchk; - struct sctp_queued_to_read *ctl, *nctl; + struct sctp_queued_to_read *control, *ncontrol; - TAILQ_FOREACH_SAFE(ctl, rh, next_instrm, nctl) { - TAILQ_REMOVE(rh, ctl, next_instrm); - ctl->on_strm_q = 0; - if (ctl->on_read_q == 0) { - sctp_free_remote_addr(ctl->whoFrom); - if (ctl->data) { - sctp_m_freem(ctl->data); - ctl->data = NULL; + TAILQ_FOREACH_SAFE(control, rh, next_instrm, ncontrol) { + TAILQ_REMOVE(rh, control, next_instrm); + control->on_strm_q = 0; + if (control->on_read_q == 0) { + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; } } /* Reassembly free? */ - TAILQ_FOREACH_SAFE(chk, &ctl->reasm, sctp_next, nchk) { - TAILQ_REMOVE(&ctl->reasm, chk, sctp_next); + TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { + TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -4629,8 +4629,8 @@ sctp_clean_up_stream(struct sctp_tcb *stcb, struct sct * We don't free the address here since all the net's were * freed above. */ - if (ctl->on_read_q == 0) { - sctp_free_a_readq(stcb, ctl); + if (control->on_read_q == 0) { + sctp_free_a_readq(stcb, control); } } } @@ -6801,7 +6801,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) struct sctp_association *asoc; struct sctp_tmit_chunk *chk, *nchk; uint32_t cumulative_tsn_p1; - struct sctp_queued_to_read *ctl, *nctl; + struct sctp_queued_to_read *control, *ncontrol; int cnt, strmat; uint32_t gap, i; int fnd = 0; @@ -6818,88 +6818,124 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) cnt = 0; /* Ok that was fun, now we will drain all the inbound streams? */ for (strmat = 0; strmat < asoc->streamincnt; strmat++) { - TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[strmat].inqueue, next_instrm, nctl) { + TAILQ_FOREACH_SAFE(control, &asoc->strmin[strmat].inqueue, next_instrm, ncontrol) { #ifdef INVARIANTS - if (ctl->on_strm_q != SCTP_ON_ORDERED) { + if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", - ctl, ctl->on_strm_q); + control, control->on_strm_q); } #endif - if (SCTP_TSN_GT(ctl->sinfo_tsn, cumulative_tsn_p1)) { + if (SCTP_TSN_GT(control->sinfo_tsn, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; - SCTP_CALC_TSN_TO_GAP(gap, ctl->sinfo_tsn, asoc->mapping_array_base_tsn); - asoc->size_on_all_streams = sctp_sbspace_sub(asoc->size_on_all_streams, ctl->length); + SCTP_CALC_TSN_TO_GAP(gap, control->sinfo_tsn, asoc->mapping_array_base_tsn); + KASSERT(control->length > 0, ("control has zero length")); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (ctl->on_read_q) { - TAILQ_REMOVE(&stcb->sctp_ep->read_queue, ctl, next); - ctl->on_read_q = 0; + if (control->on_read_q) { + TAILQ_REMOVE(&stcb->sctp_ep->read_queue, control, next); + control->on_read_q = 0; } - TAILQ_REMOVE(&asoc->strmin[strmat].inqueue, ctl, next_instrm); - ctl->on_strm_q = 0; - if (ctl->data) { - sctp_m_freem(ctl->data); - ctl->data = NULL; + TAILQ_REMOVE(&asoc->strmin[strmat].inqueue, control, next_instrm); + control->on_strm_q = 0; + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; } - sctp_free_remote_addr(ctl->whoFrom); + sctp_free_remote_addr(control->whoFrom); /* Now its reasm? */ - TAILQ_FOREACH_SAFE(chk, &ctl->reasm, sctp_next, nchk) { + TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.tsn, asoc->mapping_array_base_tsn); - asoc->size_on_reasm_queue = sctp_sbspace_sub(asoc->size_on_reasm_queue, chk->send_size); + KASSERT(chk->send_size > 0, ("chunk has zero length")); + if (asoc->size_on_reasm_queue >= chk->send_size) { + asoc->size_on_reasm_queue -= chk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - TAILQ_REMOVE(&ctl->reasm, chk, sctp_next); + TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } - sctp_free_a_readq(stcb, ctl); + sctp_free_a_readq(stcb, control); } } - TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[strmat].uno_inqueue, next_instrm, nctl) { + TAILQ_FOREACH_SAFE(control, &asoc->strmin[strmat].uno_inqueue, next_instrm, ncontrol) { #ifdef INVARIANTS - if (ctl->on_strm_q != SCTP_ON_UNORDERED) { + if (control->on_strm_q != SCTP_ON_UNORDERED) { panic("Huh control: %p on_q: %d -- not unordered?", - ctl, ctl->on_strm_q); + control, control->on_strm_q); } #endif - if (SCTP_TSN_GT(ctl->sinfo_tsn, cumulative_tsn_p1)) { + if (SCTP_TSN_GT(control->sinfo_tsn, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; - SCTP_CALC_TSN_TO_GAP(gap, ctl->sinfo_tsn, asoc->mapping_array_base_tsn); - asoc->size_on_all_streams = sctp_sbspace_sub(asoc->size_on_all_streams, ctl->length); + SCTP_CALC_TSN_TO_GAP(gap, control->sinfo_tsn, asoc->mapping_array_base_tsn); + KASSERT(control->length > 0, ("control has zero length")); + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_all_streams); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (ctl->on_read_q) { - TAILQ_REMOVE(&stcb->sctp_ep->read_queue, ctl, next); - ctl->on_read_q = 0; + if (control->on_read_q) { + TAILQ_REMOVE(&stcb->sctp_ep->read_queue, control, next); + control->on_read_q = 0; } - TAILQ_REMOVE(&asoc->strmin[strmat].uno_inqueue, ctl, next_instrm); - ctl->on_strm_q = 0; - if (ctl->data) { - sctp_m_freem(ctl->data); - ctl->data = NULL; + TAILQ_REMOVE(&asoc->strmin[strmat].uno_inqueue, control, next_instrm); + control->on_strm_q = 0; + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; } - sctp_free_remote_addr(ctl->whoFrom); + sctp_free_remote_addr(control->whoFrom); /* Now its reasm? */ - TAILQ_FOREACH_SAFE(chk, &ctl->reasm, sctp_next, nchk) { + TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) { cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.tsn, asoc->mapping_array_base_tsn); - asoc->size_on_reasm_queue = sctp_sbspace_sub(asoc->size_on_reasm_queue, chk->send_size); + KASSERT(chk->send_size > 0, ("chunk has zero length")); + if (asoc->size_on_reasm_queue >= chk->send_size) { + asoc->size_on_reasm_queue -= chk->send_size; + } else { +#ifdef INVARIANTS + panic("size_on_reasm_queue = %u smaller than chunk length %u", asoc->size_on_reasm_queue, chk->send_size); +#else + asoc->size_on_reasm_queue = 0; +#endif + } sctp_ucount_decr(asoc->cnt_on_reasm_queue); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - TAILQ_REMOVE(&ctl->reasm, chk, sctp_next); + TAILQ_REMOVE(&control->reasm, chk, sctp_next); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } - sctp_free_a_readq(stcb, ctl); + sctp_free_a_readq(stcb, control); } } } Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 14:40:09 2018 (r332170) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 14:40:21 2018 (r332171) @@ -2754,9 +2754,9 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_t m_notify); if (control != NULL) { control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, @@ -3038,7 +3038,10 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sctp_m_freem(m_notify); return; } + control->length = SCTP_BUF_LEN(m_notify); control->spec_flags = M_NOTIFICATION; + /* not that we need this */ + control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, @@ -3138,7 +3141,10 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32 sctp_m_freem(m_notify); return; } + control->length = SCTP_BUF_LEN(m_notify); control->spec_flags = M_NOTIFICATION; + /* not that we need this */ + control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked); @@ -3239,12 +3245,10 @@ sctp_notify_partial_delivery_indication(struct sctp_tc sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - control->held_length = 0; - control->length = 0; sb = &stcb->sctp_socket->so_rcv; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(m_notify)); @@ -3253,7 +3257,6 @@ sctp_notify_partial_delivery_indication(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } - atomic_add_int(&control->length, SCTP_BUF_LEN(m_notify)); control->end_added = 1; if (stcb->asoc.control_pdapi) TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, stcb->asoc.control_pdapi, control, next); @@ -3348,8 +3351,8 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb) sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3455,8 +3458,8 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, ui sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3505,8 +3508,8 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, ui sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3570,8 +3573,8 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, sctp_m_freem(m_notify); return; } - control->spec_flags = M_NOTIFICATION; control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -3626,9 +3629,9 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16 m_notify); if (control != NULL) { control->length = SCTP_BUF_LEN(m_notify); + control->spec_flags = M_NOTIFICATION; /* not that we need this */ control->tail_mbuf = m_notify; - control->spec_flags = M_NOTIFICATION; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, From owner-svn-src-all@freebsd.org Sat Apr 7 14:41:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07B0BF8D96C; Sat, 7 Apr 2018 14:41:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5D72874E6; Sat, 7 Apr 2018 14:41:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FAAA221A3; Sat, 7 Apr 2018 14:41:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EfjNL009608; Sat, 7 Apr 2018 14:41:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EfiO8009601; Sat, 7 Apr 2018 14:41:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071441.w37EfiO8009601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332172 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 332172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:41:46 -0000 Author: tuexen Date: Sat Apr 7 14:41:44 2018 New Revision: 332172 URL: https://svnweb.freebsd.org/changeset/base/332172 Log: MFC r321204: Use memset/memcpy instead of bzero/bcopy. Just use one variant instead of both. Use the memset/memcpy ones since they cause less problems in crossplatform deployment. Modified: stable/11/sys/netinet/sctp_asconf.c stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctputil.c stable/11/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_asconf.c ============================================================================== --- stable/11/sys/netinet/sctp_asconf.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet/sctp_asconf.c Sat Apr 7 14:41:44 2018 (r332172) @@ -182,7 +182,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc } v4addr = (struct sctp_ipv4addr_param *)ph; sin = &store.sin; - bzero(sin, sizeof(*sin)); + memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); sin->sin_port = stcb->rport; @@ -205,7 +205,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = &store.sin6; - bzero(sin6, sizeof(*sin6)); + memset(sin6, 0, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_port = stcb->rport; @@ -332,7 +332,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, } v4addr = (struct sctp_ipv4addr_param *)ph; sin = &store.sin; - bzero(sin, sizeof(*sin)); + memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); sin->sin_port = stcb->rport; @@ -352,7 +352,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = &store.sin6; - bzero(sin6, sizeof(*sin6)); + memset(sin6, 0, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); sin6->sin6_port = stcb->rport; @@ -461,7 +461,7 @@ sctp_process_asconf_set_primary(struct sockaddr *src, } v4addr = (struct sctp_ipv4addr_param *)ph; sin = &store.sin; - bzero(sin, sizeof(*sin)); + memset(sin, 0, sizeof(*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(struct sockaddr_in); sin->sin_addr.s_addr = v4addr->addr; @@ -479,7 +479,7 @@ sctp_process_asconf_set_primary(struct sockaddr *src, } v6addr = (struct sctp_ipv6addr_param *)ph; sin6 = &store.sin6; - bzero(sin6, sizeof(*sin6)); + memset(sin6, 0, sizeof(*sin6)); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(struct sockaddr_in6); memcpy((caddr_t)&sin6->sin6_addr, v6addr->addr, @@ -2604,7 +2604,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen SCTP_BUF_LEN(m_asconf_chk) = sizeof(struct sctp_asconf_chunk); SCTP_BUF_LEN(m_asconf) = 0; acp = mtod(m_asconf_chk, struct sctp_asconf_chunk *); - bzero(acp, sizeof(struct sctp_asconf_chunk)); + memset(acp, 0, sizeof(struct sctp_asconf_chunk)); /* save pointers to lookup address and asconf params */ lookup_ptr = (caddr_t)(acp + 1); /* after the header */ ptr = mtod(m_asconf, caddr_t); /* beginning of cluster */ @@ -2737,7 +2737,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen /* XXX for now, we send a IPv4 address of 0.0.0.0 */ lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS); lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param))); - bzero(lookup->addr, sizeof(struct in_addr)); + memset(lookup->addr, 0, sizeof(struct in_addr)); SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param)); } } Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet/sctp_auth.c Sat Apr 7 14:41:44 2018 (r332172) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); void sctp_clear_chunklist(sctp_auth_chklist_t *chklist) { - bzero(chklist, sizeof(*chklist)); + memset(chklist, 0, sizeof(*chklist)); /* chklist->num_chunks = 0; */ } @@ -92,7 +92,7 @@ sctp_copy_chunklist(sctp_auth_chklist_t *list) if (new_list == NULL) return (NULL); /* copy it */ - bcopy(list, new_list, sizeof(*new_list)); + memcpy(new_list, list, sizeof(*new_list)); return (new_list); } @@ -338,7 +338,7 @@ sctp_set_key(uint8_t *key, uint32_t keylen) /* out of memory */ return (NULL); } - bcopy(key, new_key->key, keylen); + memcpy(new_key->key, key, keylen); return (new_key); } @@ -427,28 +427,28 @@ sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key if (sctp_compare_key(key1, key2) <= 0) { /* key is shared + key1 + key2 */ if (sctp_get_keylen(shared)) { - bcopy(shared->key, key_ptr, shared->keylen); + memcpy(key_ptr, shared->key, shared->keylen); key_ptr += shared->keylen; } if (sctp_get_keylen(key1)) { - bcopy(key1->key, key_ptr, key1->keylen); + memcpy(key_ptr, key1->key, key1->keylen); key_ptr += key1->keylen; } if (sctp_get_keylen(key2)) { - bcopy(key2->key, key_ptr, key2->keylen); + memcpy(key_ptr, key2->key, key2->keylen); } } else { /* key is shared + key2 + key1 */ if (sctp_get_keylen(shared)) { - bcopy(shared->key, key_ptr, shared->keylen); + memcpy(key_ptr, shared->key, shared->keylen); key_ptr += shared->keylen; } if (sctp_get_keylen(key2)) { - bcopy(key2->key, key_ptr, key2->keylen); + memcpy(key_ptr, key2->key, key2->keylen); key_ptr += key2->keylen; } if (sctp_get_keylen(key1)) { - bcopy(key1->key, key_ptr, key1->keylen); + memcpy(key_ptr, key1->key, key1->keylen); } } return (new_key); @@ -764,7 +764,7 @@ sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t for (i = 0; i < list->num_algo; i++) { hmac_id = htons(list->hmac[i]); - bcopy(&hmac_id, ptr, sizeof(hmac_id)); + memcpy(ptr, &hmac_id, sizeof(hmac_id)); ptr += sizeof(hmac_id); } return (list->num_algo * sizeof(hmac_id)); @@ -795,7 +795,7 @@ sctp_alloc_authinfo(void) /* out of memory */ return (NULL); } - bzero(new_authinfo, sizeof(*new_authinfo)); + memset(new_authinfo, 0, sizeof(*new_authinfo)); return (new_authinfo); } @@ -953,10 +953,10 @@ sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t k key = temp; } /* initialize the inner/outer pads with the key and "append" zeroes */ - bzero(ipad, blocklen); - bzero(opad, blocklen); - bcopy(key, ipad, keylen); - bcopy(key, opad, keylen); + memset(ipad, 0, blocklen); + memset(opad, 0, blocklen); + memcpy(ipad, key, keylen); + memcpy(opad, key, keylen); /* XOR the key with ipad and opad values */ for (i = 0; i < blocklen; i++) { @@ -1013,10 +1013,10 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t key = temp; } /* initialize the inner/outer pads with the key and "append" zeroes */ - bzero(ipad, blocklen); - bzero(opad, blocklen); - bcopy(key, ipad, keylen); - bcopy(key, opad, keylen); + memset(ipad, 0, blocklen); + memset(opad, 0, blocklen); + memcpy(ipad, key, keylen); + memcpy(opad, key, keylen); /* XOR the key with ipad and opad values */ for (i = 0; i < blocklen; i++) { @@ -1124,7 +1124,7 @@ sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, sctp_hmac_final(hmac_algo, &ctx, temp); /* save the hashed key as the new key */ key->keylen = digestlen; - bcopy(temp, key->key, key->keylen); + memcpy(key->key, temp, key->keylen); } return (sctp_hmac(hmac_algo, key->key, key->keylen, text, textlen, digest)); @@ -1158,7 +1158,7 @@ sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *ke sctp_hmac_final(hmac_algo, &ctx, temp); /* save the hashed key as the new key */ key->keylen = digestlen; - bcopy(temp, key->key, key->keylen); + memcpy(key->key, temp, key->keylen); } return (sctp_hmac_m(hmac_algo, key->key, key->keylen, m, m_offset, digest, 0)); } @@ -1501,17 +1501,17 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str /* copy in the RANDOM */ if (p_random != NULL) { keylen = sizeof(*p_random) + random_len; - bcopy(p_random, new_key->key, keylen); + memcpy(new_key->key, p_random, keylen); } /* append in the AUTH chunks */ if (chunks != NULL) { - bcopy(chunks, new_key->key + keylen, + memcpy(new_key->key + keylen, chunks, sizeof(*chunks) + num_chunks); keylen += sizeof(*chunks) + num_chunks; } /* append in the HMACs */ if (hmacs != NULL) { - bcopy(hmacs, new_key->key + keylen, + memcpy(new_key->key + keylen, hmacs, sizeof(*hmacs) + hmacs_len); } } @@ -1550,7 +1550,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_ /* zero the digest + chunk padding */ digestlen = sctp_get_hmac_digest_len(stcb->asoc.peer_hmac_id); - bzero(auth->hmac, SCTP_SIZE32(digestlen)); + memset(auth->hmac, 0, SCTP_SIZE32(digestlen)); /* is the desired key cached? */ if ((keyid != stcb->asoc.authinfo.assoc_keyid) || @@ -1588,7 +1588,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_ static void -sctp_bzero_m(struct mbuf *m, uint32_t m_offset, uint32_t size) +sctp_zero_m(struct mbuf *m, uint32_t m_offset, uint32_t size) { struct mbuf *m_tmp; uint8_t *data; @@ -1607,10 +1607,10 @@ sctp_bzero_m(struct mbuf *m, uint32_t m_offset, uint32 while ((m_tmp != NULL) && (size > 0)) { data = mtod(m_tmp, uint8_t *)+m_offset; if (size > (uint32_t)SCTP_BUF_LEN(m_tmp)) { - bzero(data, SCTP_BUF_LEN(m_tmp)); + memset(data, 0, SCTP_BUF_LEN(m_tmp)); size -= SCTP_BUF_LEN(m_tmp); } else { - bzero(data, size); + memset(data, 0, size); size = 0; } /* clear the offset since it's only for the first mbuf */ @@ -1727,8 +1727,8 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_au return (-1); } /* save a copy of the digest, zero the pseudo header, and validate */ - bcopy(auth->hmac, digest, digestlen); - sctp_bzero_m(m, offset + sizeof(*auth), SCTP_SIZE32(digestlen)); + memcpy(digest, auth->hmac, digestlen); + sctp_zero_m(m, offset + sizeof(*auth), SCTP_SIZE32(digestlen)); (void)sctp_compute_hmac_m(hmac_id, stcb->asoc.authinfo.recv_key, m, offset, computed_digest); Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 14:41:44 2018 (r332172) @@ -4404,7 +4404,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, * we can try their selection but it may not be * bound. */ - bzero(&lsa6_tmp, sizeof(lsa6_tmp)); + memset(&lsa6_tmp, 0, sizeof(lsa6_tmp)); lsa6_tmp.sin6_family = AF_INET6; lsa6_tmp.sin6_len = sizeof(lsa6_tmp); lsa6 = &lsa6_tmp; @@ -4489,7 +4489,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, * XXX: sa6 may not have a valid sin6_scope_id in * the non-SCOPEDROUTING case. */ - bzero(&lsa6_storage, sizeof(lsa6_storage)); + memset(&lsa6_storage, 0, sizeof(lsa6_storage)); lsa6_storage.sin6_family = AF_INET6; lsa6_storage.sin6_len = sizeof(lsa6_storage); lsa6_storage.sin6_addr = lsa6->sin6_addr; @@ -13730,7 +13730,7 @@ sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_en SCTP_BUF_RESV_UF(m_auth, SCTP_MIN_OVERHEAD); /* fill in the AUTH chunk details */ auth = mtod(m_auth, struct sctp_auth_chunk *); - bzero(auth, sizeof(*auth)); + memset(auth, 0, sizeof(*auth)); auth->ch.chunk_type = SCTP_AUTHENTICATION; auth->ch.chunk_flags = 0; chunk_len = sizeof(*auth) + Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 14:41:44 2018 (r332172) @@ -702,7 +702,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 return (NULL); } SCTP_INCR_LADDR_COUNT(); - bzero(wi, sizeof(*wi)); + memset(wi, 0, sizeof(*wi)); (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_ADD_IP_ADDRESS; @@ -811,7 +811,7 @@ out_now: return; } SCTP_INCR_LADDR_COUNT(); - bzero(wi, sizeof(*wi)); + memset(wi, 0, sizeof(*wi)); (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = sctp_ifap; wi->action = SCTP_DEL_IP_ADDRESS; @@ -2429,7 +2429,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) return (ENOBUFS); } /* zap it */ - bzero(inp, sizeof(*inp)); + memset(inp, 0, sizeof(*inp)); /* bump generations */ /* setup socket pointers */ @@ -2715,7 +2715,7 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, st continue; } SCTP_INCR_LADDR_COUNT(); - bzero(laddr, sizeof(*laddr)); + memset(laddr, 0, sizeof(*laddr)); (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time); laddr->ifa = oladdr->ifa; atomic_add_int(&laddr->ifa->refcount, 1); @@ -2765,7 +2765,7 @@ sctp_insert_laddr(struct sctpladdr *list, struct sctp_ return (EINVAL); } SCTP_INCR_LADDR_COUNT(); - bzero(laddr, sizeof(*laddr)); + memset(laddr, 0, sizeof(*laddr)); (void)SCTP_GETTIME_TIMEVAL(&laddr->start_time); laddr->ifa = ifa; laddr->action = act; @@ -3766,7 +3766,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct soc /* Invalid address */ return (-1); } - /* zero out the bzero area */ + /* zero out the zero area */ memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); /* assure len is set */ @@ -3849,7 +3849,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct soc return (-1); } SCTP_INCR_RADDR_COUNT(); - bzero(net, sizeof(struct sctp_nets)); + memset(net, 0, sizeof(struct sctp_nets)); (void)SCTP_GETTIME_TIMEVAL(&net->start_time); memcpy(&net->ro._l_addr, newaddr, newaddr->sa_len); switch (newaddr->sa_family) { @@ -4285,7 +4285,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd } SCTP_INCR_ASOC_COUNT(); - bzero(stcb, sizeof(*stcb)); + memset(stcb, 0, sizeof(*stcb)); asoc = &stcb->asoc; asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); @@ -5731,7 +5731,7 @@ sctp_pcb_init() SCTP_BASE_VAR(sctp_pcb_initialized) = 1; #if defined(SCTP_LOCAL_TRACE_BUF) - bzero(&SCTP_BASE_SYSCTL(sctp_log), sizeof(struct sctp_log)); + memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) SCTP_MALLOC(SCTP_BASE_STATS, struct sctpstat *, @@ -5740,11 +5740,11 @@ sctp_pcb_init() #endif (void)SCTP_GETTIME_TIMEVAL(&tv); #if defined(__FreeBSD__) && defined(SMP) && defined(SCTP_USE_PERCPU_STAT) - bzero(SCTP_BASE_STATS, (sizeof(struct sctpstat) * (mp_maxid + 1))); + memset(SCTP_BASE_STATS, 0, sizeof(struct sctpstat) * (mp_maxid + 1)); SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_sec = (uint32_t)tv.tv_sec; SCTP_BASE_STATS[PCPU_GET(cpuid)].sctps_discontinuitytime.tv_usec = (uint32_t)tv.tv_usec; #else - bzero(&SCTP_BASE_STATS, sizeof(struct sctpstat)); + memset(&SCTP_BASE_STATS, 0, sizeof(struct sctpstat)); SCTP_BASE_STAT(sctps_discontinuitytime).tv_sec = (uint32_t)tv.tv_sec; SCTP_BASE_STAT(sctps_discontinuitytime).tv_usec = (uint32_t)tv.tv_usec; #endif @@ -6656,17 +6656,17 @@ next_param: /* copy in the RANDOM */ if (p_random != NULL) { keylen = sizeof(*p_random) + random_len; - bcopy(p_random, new_key->key, keylen); + memcpy(new_key->key, p_random, keylen); } /* append in the AUTH chunks */ if (chunks != NULL) { - bcopy(chunks, new_key->key + keylen, + memcpy(new_key->key + keylen, chunks, sizeof(*chunks) + num_chunks); keylen += sizeof(*chunks) + num_chunks; } /* append in the HMACs */ if (hmacs != NULL) { - bcopy(hmacs, new_key->key + keylen, + memcpy(new_key->key + keylen, hmacs, sizeof(*hmacs) + hmacs_len); } } else { Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 14:41:44 2018 (r332172) @@ -85,7 +85,7 @@ sctp_init(void) #if defined(SCTP_PACKET_LOGGING) SCTP_BASE_VAR(packet_log_writers) = 0; SCTP_BASE_VAR(packet_log_end) = 0; - bzero(&SCTP_BASE_VAR(packet_log_buffer), SCTP_PACKET_LOG_SIZE); + memset(&SCTP_BASE_VAR(packet_log_buffer), 0, SCTP_PACKET_LOG_SIZE); #endif } Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 14:41:44 2018 (r332172) @@ -2593,7 +2593,7 @@ sctp_m_getptr(struct mbuf *m, int off, int len, uint8_ /* else, it spans more than one mbuf, so save a temp copy... */ while ((m != NULL) && (len > 0)) { count = min(SCTP_BUF_LEN(m) - off, len); - bcopy(mtod(m, caddr_t)+off, ptr, count); + memcpy(ptr, mtod(m, caddr_t)+off, count); len -= count; ptr += count; off = 0; @@ -6166,7 +6166,7 @@ sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t } /* Now incr the count and int wi structure */ SCTP_INCR_LADDR_COUNT(); - bzero(wi, sizeof(*wi)); + memset(wi, 0, sizeof(*wi)); (void)SCTP_GETTIME_TIMEVAL(&wi->start_time); wi->ifa = ifa; wi->action = SCTP_SET_PRIM_ADDR; Modified: stable/11/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 14:40:21 2018 (r332171) +++ stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 14:41:44 2018 (r332172) @@ -305,7 +305,7 @@ sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void return; } /* Copy out the port numbers and the verification tag. */ - bzero(&sh, sizeof(sh)); + memset(&sh, 0, sizeof(sh)); m_copydata(ip6cp->ip6c_m, ip6cp->ip6c_off, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t), From owner-svn-src-all@freebsd.org Sat Apr 7 14:42:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E77CBF8DAAE; Sat, 7 Apr 2018 14:42:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9376C87FE1; Sat, 7 Apr 2018 14:42:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CE12222DA; Sat, 7 Apr 2018 14:42:47 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EglvQ011086; Sat, 7 Apr 2018 14:42:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EglG7011085; Sat, 7 Apr 2018 14:42:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804071442.w37EglG7011085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 7 Apr 2018 14:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332173 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 332173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:42:48 -0000 Author: tsoome Date: Sat Apr 7 14:42:47 2018 New Revision: 332173 URL: https://svnweb.freebsd.org/changeset/base/332173 Log: libsa: name is not used in dirmatch() Seems like variable 'name' is leftover. Modified: head/stand/libsa/cd9660read.c Modified: head/stand/libsa/cd9660read.c ============================================================================== --- head/stand/libsa/cd9660read.c Sat Apr 7 14:41:44 2018 (r332172) +++ head/stand/libsa/cd9660read.c Sat Apr 7 14:42:47 2018 (r332173) @@ -174,7 +174,7 @@ dirmatch(const char *path, struct iso_directory_record int lenskip) { size_t len; - const char *cp = NULL, *name = NULL; + const char *cp = NULL; int i, icase; if (use_rrip) @@ -187,7 +187,6 @@ dirmatch(const char *path, struct iso_directory_record icase = 1; } else icase = 0; - name = cp; for (i = len; --i >= 0; path++, cp++) { if (!*path || *path == '/') break; From owner-svn-src-all@freebsd.org Sat Apr 7 14:43:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED095F8DAED; Sat, 7 Apr 2018 14:43:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 967316825A; Sat, 7 Apr 2018 14:43:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 914FE222DB; Sat, 7 Apr 2018 14:43:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Eh19W011141; Sat, 7 Apr 2018 14:43:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Eh1hd011140; Sat, 7 Apr 2018 14:43:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071443.w37Eh1hd011140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332174 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:43:02 -0000 Author: tuexen Date: Sat Apr 7 14:43:01 2018 New Revision: 332174 URL: https://svnweb.freebsd.org/changeset/base/332174 Log: MFC r321205: Avoid shadowed variables. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:42:47 2018 (r332173) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:43:01 2018 (r332174) @@ -2071,12 +2071,12 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc return (0); } if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) { - struct mbuf *m; + struct mbuf *mm; control->data = dmbuf; - m = control->data; - for (m = control->data; m; m = m->m_next) { - control->length += SCTP_BUF_LEN(m); + mm = control->data; + for (mm = control->data; mm; mm = mm->m_next) { + control->length += SCTP_BUF_LEN(mm); } control->tail_mbuf = NULL; control->end_added = 1; From owner-svn-src-all@freebsd.org Sat Apr 7 14:44:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C55CF8DC87; Sat, 7 Apr 2018 14:44:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5E5168EF6; Sat, 7 Apr 2018 14:44:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFF38222DC; Sat, 7 Apr 2018 14:44:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37EiLXa011263; Sat, 7 Apr 2018 14:44:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EiLvl011261; Sat, 7 Apr 2018 14:44:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071444.w37EiLvl011261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332175 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:44:22 -0000 Author: tuexen Date: Sat Apr 7 14:44:21 2018 New Revision: 332175 URL: https://svnweb.freebsd.org/changeset/base/332175 Log: MFC r321289: Fix the explicit EOR mode. If the final messages is not complete, send an ABORT. Joint work with rrs@ Modified: stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_ss_functions.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:43:01 2018 (r332174) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:44:21 2018 (r332175) @@ -4293,47 +4293,44 @@ again: ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; } + if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (asoc->stream_queue_cnt == 1) && + (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { + struct mbuf *op_err; + + *abort_now = 1; + /* XXX */ + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; + } if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && (asoc->stream_queue_cnt == 0)) { - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - /* Need to abort here */ - struct mbuf *op_err; + struct sctp_nets *netp; - abort_out_now: - *abort_now = 1; - /* XXX */ - op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); + } + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; } else { - struct sctp_nets *netp; - - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_stop_timers_for_shutdown(stcb); - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } - sctp_send_shutdown(stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, netp); + netp = asoc->primary_destination; } + sctp_send_shutdown(stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, + stcb->sctp_ep, stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, + stcb->sctp_ep, stcb, netp); } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - goto abort_out_now; - } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); @@ -4989,48 +4986,45 @@ hopeless_peer: ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; } + if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (asoc->stream_queue_cnt == 1) && + (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { + struct mbuf *op_err; + + *abort_now = 1; + /* XXX */ + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; + } if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && (asoc->stream_queue_cnt == 0)) { - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - /* Need to abort here */ - struct mbuf *op_err; + struct sctp_nets *netp; - abort_out_now: - *abort_now = 1; - /* XXX */ - op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); + } + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; } else { - struct sctp_nets *netp; - - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { - SCTP_STAT_DECR_GAUGE32(sctps_currestab); - } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_stop_timers_for_shutdown(stcb); - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } - sctp_send_shutdown(stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, netp); - sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, netp); + netp = asoc->primary_destination; } + sctp_send_shutdown(stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, + stcb->sctp_ep, stcb, netp); + sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, + stcb->sctp_ep, stcb, netp); return; } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { - goto abort_out_now; - } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); Modified: stable/11/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/11/sys/netinet/sctp_ss_functions.c Sat Apr 7 14:43:01 2018 (r332174) +++ stable/11/sys/netinet/sctp_ss_functions.c Sat Apr 7 14:44:21 2018 (r332175) @@ -268,9 +268,23 @@ sctp_ss_default_set_value(struct sctp_tcb *stcb SCTP_U } static int -sctp_ss_default_is_user_msgs_incomplete(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_association *asoc SCTP_UNUSED) +sctp_ss_default_is_user_msgs_incomplete(struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_association *asoc) { - return (0); + struct sctp_stream_out *strq; + struct sctp_stream_queue_pending *sp; + + if (asoc->stream_queue_cnt != 1) { + return (0); + } + strq = asoc->ss_data.locked_on_sending; + if (strq == NULL) { + return (0); + } + sp = TAILQ_FIRST(&strq->outqueue); + if (sp == NULL) { + return (0); + } + return (!sp->msg_is_complete); } /* From owner-svn-src-all@freebsd.org Sat Apr 7 14:45:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAACDF8DDC6; Sat, 7 Apr 2018 14:45:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90D8469D38; Sat, 7 Apr 2018 14:45:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AC1F222DE; Sat, 7 Apr 2018 14:45:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Ejteg011374; Sat, 7 Apr 2018 14:45:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37EjttO011373; Sat, 7 Apr 2018 14:45:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071445.w37EjttO011373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 14:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332176 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 14:45:56 -0000 Author: tuexen Date: Sat Apr 7 14:45:55 2018 New Revision: 332176 URL: https://svnweb.freebsd.org/changeset/base/332176 Log: MFC r321463: Remove duplicate statement. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:44:21 2018 (r332175) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 14:45:55 2018 (r332176) @@ -2074,7 +2074,6 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc struct mbuf *mm; control->data = dmbuf; - mm = control->data; for (mm = control->data; mm; mm = mm->m_next) { control->length += SCTP_BUF_LEN(mm); } From owner-svn-src-all@freebsd.org Sat Apr 7 15:10:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 187F6F8FBB9; Sat, 7 Apr 2018 15:10:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA696771BE; Sat, 7 Apr 2018 15:10:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B105622618; Sat, 7 Apr 2018 15:10:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37FA83x021164; Sat, 7 Apr 2018 15:10:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37FA8FQ021163; Sat, 7 Apr 2018 15:10:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071510.w37FA8FQ021163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 15:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332177 - stable/11/sys/netinet/tcp_stacks X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 332177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 15:10:09 -0000 Author: tuexen Date: Sat Apr 7 15:10:08 2018 New Revision: 332177 URL: https://svnweb.freebsd.org/changeset/base/332177 Log: MFC r322812: Avoid TCP log messages which are false positives. The check for timestamps are too early to handle SYN-ACK correctly. So move it down after the corresponing processing has been done. MFC r322813: Avoid TCP log messages which are false positives. This is https://svnweb.freebsd.org/changeset/base/322812, just for alternate TCP stacks. PR: 216832 Obtained from: antonfb@hesiod.org Modified: stable/11/sys/netinet/tcp_stacks/fastpath.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- stable/11/sys/netinet/tcp_stacks/fastpath.c Sat Apr 7 14:45:55 2018 (r332176) +++ stable/11/sys/netinet/tcp_stacks/fastpath.c Sat Apr 7 15:10:08 2018 (r332177) @@ -1812,24 +1812,6 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; } - /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session and vice versa. - */ - if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } - if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } /* * Process options only when we get SYN/ACK back. The SYN case @@ -1860,6 +1842,26 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; } + + /* + * If timestamps were negotiated during SYN/ACK they should + * appear on every segment during this session and vice versa. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp not expected, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + can_enter = 0; if (__predict_true((tlen == 0))) { /* @@ -2284,24 +2286,6 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr * if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; } - /* - * If timestamps were negotiated during SYN/ACK they should - * appear on every segment during this session and vice versa. - */ - if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp missing, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } - if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "no action\n", s, __func__); - free(s, M_TCPLOG); - } - } /* * Process options only when we get SYN/ACK back. The SYN case @@ -2332,6 +2316,26 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr * (to.to_flags & TOF_SACKPERM) == 0) tp->t_flags &= ~TF_SACK_PERMIT; } + + /* + * If timestamps were negotiated during SYN/ACK they should + * appear on every segment during this session and vice versa. + */ + if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: Timestamp not expected, " + "no action\n", s, __func__); + free(s, M_TCPLOG); + } + } + /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has From owner-svn-src-all@freebsd.org Sat Apr 7 15:16:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 349D8F90333; Sat, 7 Apr 2018 15:16:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA3027B102; Sat, 7 Apr 2018 15:16:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D02F1227A7; Sat, 7 Apr 2018 15:16:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37FGvnx026400; Sat, 7 Apr 2018 15:16:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37FGvGC026399; Sat, 7 Apr 2018 15:16:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071516.w37FGvGC026399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 15:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332178 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 15:16:58 -0000 Author: tuexen Date: Sat Apr 7 15:16:57 2018 New Revision: 332178 URL: https://svnweb.freebsd.org/changeset/base/332178 Log: MFC r322967: Fix blackhole detection. There were two bugs related to the blackhole detection: * The smalles size was tried more than two times. * The restored MSS was not the original one, but the second candidate. Sponsored by: Netflix, Inc. Modified: stable/11/sys/netinet/tcp_timer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_timer.c ============================================================================== --- stable/11/sys/netinet/tcp_timer.c Sat Apr 7 15:10:08 2018 (r332177) +++ stable/11/sys/netinet/tcp_timer.c Sat Apr 7 15:16:57 2018 (r332178) @@ -687,19 +687,21 @@ tcp_timer_rexmt(void * xtp) */ if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) == (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) && - (tp->t_rxtshift >= 2 && tp->t_rxtshift % 2 == 0)) { + (tp->t_rxtshift >= 2 && tp->t_rxtshift < 6 && + tp->t_rxtshift % 2 == 0)) { /* * Enter Path MTU Black-hole Detection mechanism: * - Disable Path MTU Discovery (IP "DF" bit). * - Reduce MTU to lower value than what we * negotiated with peer. */ - /* Record that we may have found a black hole. */ - tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; + if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) == 0) { + /* Record that we may have found a black hole. */ + tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; + /* Keep track of previous MSS. */ + tp->t_pmtud_saved_maxseg = tp->t_maxseg; + } - /* Keep track of previous MSS. */ - tp->t_pmtud_saved_maxseg = tp->t_maxseg; - /* * Reduce the MSS to blackhole value or to the default * in an attempt to retransmit. @@ -757,7 +759,7 @@ tcp_timer_rexmt(void * xtp) * stage (1448, 1188, 524) 2 chances to recover. */ if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) && - (tp->t_rxtshift > 6)) { + (tp->t_rxtshift >= 6)) { tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; tp->t_maxseg = tp->t_pmtud_saved_maxseg; From owner-svn-src-all@freebsd.org Sat Apr 7 15:19:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DE3FF9058C; Sat, 7 Apr 2018 15:19:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F8A7C510; Sat, 7 Apr 2018 15:19:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 948E2227A8; Sat, 7 Apr 2018 15:19:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37FJAgY026529; Sat, 7 Apr 2018 15:19:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37FJAIA026528; Sat, 7 Apr 2018 15:19:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071519.w37FJAIA026528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 15:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332179 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/netstat X-SVN-Commit-Revision: 332179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 15:19:11 -0000 Author: tuexen Date: Sat Apr 7 15:19:10 2018 New Revision: 332179 URL: https://svnweb.freebsd.org/changeset/base/332179 Log: MFC r323352: The combination of IPv6 and SCTP is also supported. Modified: stable/11/usr.bin/netstat/netstat.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/netstat.1 ============================================================================== --- stable/11/usr.bin/netstat/netstat.1 Sat Apr 7 15:16:57 2018 (r332178) +++ stable/11/usr.bin/netstat/netstat.1 Sat Apr 7 15:19:10 2018 (r332179) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd September 9, 2017 .Dt NETSTAT 1 .Os .Sh NAME @@ -770,7 +770,7 @@ The following address families and protocols are recog .It Cm inet Pq Dv AF_INET .Cm divert , icmp , igmp , ip , ipsec , pim, sctp , tcp , udp .It Cm inet6 Pq Dv AF_INET6 -.Cm icmp6 , ip6 , ipsec6 , rip6 , tcp , udp +.Cm icmp6 , ip6 , ipsec6 , rip6 , sctp , tcp , udp .It Cm pfkey Pq Dv PF_KEY .Cm pfkey .It Cm netgraph , ng Pq Dv AF_NETGRAPH From owner-svn-src-all@freebsd.org Sat Apr 7 15:38:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59908F91A72; Sat, 7 Apr 2018 15:38:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05497872DD; Sat, 7 Apr 2018 15:38:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE22C22AD2; Sat, 7 Apr 2018 15:38:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Fcgqs036297; Sat, 7 Apr 2018 15:38:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37FcgSm036294; Sat, 7 Apr 2018 15:38:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804071538.w37FcgSm036294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 7 Apr 2018 15:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332180 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 332180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 15:38:43 -0000 Author: manu Date: Sat Apr 7 15:38:42 2018 New Revision: 332180 URL: https://svnweb.freebsd.org/changeset/base/332180 Log: allwinner: aw_clk_nm: Add prediv value Some NM clocks needs a fixed prediv value applied to the parent frequency on some conditions. Add support for it. Modified: head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/aw_clk_nm.c head/sys/arm/allwinner/clkng/aw_clk_nm.h Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Sat Apr 7 15:19:10 2018 (r332179) +++ head/sys/arm/allwinner/clkng/aw_clk.h Sat Apr 7 15:38:42 2018 (r332180) @@ -66,6 +66,7 @@ struct aw_clk_init { #define AW_CLK_SCALE_CHANGE 0x0010 #define AW_CLK_HAS_FRAC 0x0020 #define AW_CLK_HAS_UPDATE 0x0040 +#define AW_CLK_HAS_PREDIV 0x0080 #define AW_CLK_FACTOR_POWER_OF_TWO 0x0001 #define AW_CLK_FACTOR_ZERO_BASED 0x0002 Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Sat Apr 7 15:19:10 2018 (r332179) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Sat Apr 7 15:38:42 2018 (r332180) @@ -52,6 +52,7 @@ struct aw_clk_nm_sc { struct aw_clk_factor m; struct aw_clk_factor n; + struct aw_clk_factor prediv; struct aw_clk_frac frac; uint32_t mux_shift; @@ -278,7 +279,7 @@ static int aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq) { struct aw_clk_nm_sc *sc; - uint32_t val, m, n; + uint32_t val, m, n, prediv; sc = clknode_get_softc(clk); @@ -294,8 +295,12 @@ aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq) } else { m = aw_clk_get_factor(val, &sc->m); n = aw_clk_get_factor(val, &sc->n); + if (sc->flags & AW_CLK_HAS_PREDIV) + prediv = aw_clk_get_factor(val, &sc->prediv); + else + prediv = 1; - *freq = *freq / n / m; + *freq = *freq / prediv / n / m; } return (0); @@ -339,6 +344,18 @@ aw_clk_nm_register(struct clkdom *clkdom, struct aw_cl sc->n.mask = ((1 << sc->n.width) - 1) << sc->n.shift; sc->n.value = clkdef->n.value; sc->n.flags = clkdef->n.flags; + + sc->prediv.shift = clkdef->prediv.shift; + sc->prediv.width = clkdef->prediv.width; + sc->prediv.mask = ((1 << sc->prediv.width) - 1) << sc->prediv.shift; + sc->prediv.value = clkdef->prediv.value; + sc->prediv.flags = clkdef->prediv.flags; + sc->prediv.cond_shift = clkdef->prediv.cond_shift; + if (clkdef->prediv.cond_width != 0) + sc->prediv.cond_mask = ((1 << clkdef->prediv.cond_width) - 1) << sc->prediv.shift; + else + sc->prediv.cond_mask = clkdef->prediv.cond_mask; + sc->prediv.cond_value = clkdef->prediv.cond_value; sc->frac.freq0 = clkdef->frac.freq0; sc->frac.freq1 = clkdef->frac.freq1; Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.h Sat Apr 7 15:19:10 2018 (r332179) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.h Sat Apr 7 15:38:42 2018 (r332180) @@ -37,6 +37,7 @@ struct aw_clk_nm_def { struct aw_clk_factor m; struct aw_clk_factor n; + struct aw_clk_factor prediv; struct aw_clk_frac frac; uint32_t mux_shift; From owner-svn-src-all@freebsd.org Sat Apr 7 15:40:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB8AF91BD5; Sat, 7 Apr 2018 15:40:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 051E687E7E; Sat, 7 Apr 2018 15:40:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2E2422AD6; Sat, 7 Apr 2018 15:40:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Fe0aC036414; Sat, 7 Apr 2018 15:40:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Fe089036413; Sat, 7 Apr 2018 15:40:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804071540.w37Fe089036413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 7 Apr 2018 15:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332181 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 332181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 15:40:01 -0000 Author: manu Date: Sat Apr 7 15:40:00 2018 New Revision: 332181 URL: https://svnweb.freebsd.org/changeset/base/332181 Log: allwinner: a83t_r_ccu: Add proper IR clock support Now that NM clocks support prediv, add proper support for the IR clock found on the A83T SoC. Tested On: BananaPi M3 Reported by: kevans Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Apr 7 15:38:42 2018 (r332180) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Apr 7 15:40:00 2018 (r332181) @@ -108,10 +108,10 @@ DIV_CLK(apb0_clk, 0, 2, /* shift, width */ 0, NULL); /* flags, div table */ -static const char *ir_parents[] = {"osc32k", "osc24M"}; -NM_CLK(ir_clk, +static const char *r_ccu_ir_parents[] = {"osc32k", "osc24M"}; +NM_CLK(r_ccu_ir_clk, CLK_IR, /* id */ - "ir", ir_parents, /* names, parents */ + "ir", r_ccu_ir_parents, /* names, parents */ 0x54, /* offset */ 0, 4, 0, 0, /* N factor */ 16, 2, 0, 0, /* M flags */ @@ -119,6 +119,28 @@ NM_CLK(ir_clk, 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ +static const char *a83t_ir_parents[] = {"osc16M", "osc24M"}; +static struct aw_clk_nm_def a83t_ir_clk = { + .clkdef = { + .id = CLK_IR, + .name = "ir", + .parent_names = a83t_ir_parents, + .parent_cnt = nitems(a83t_ir_parents), + }, + .offset = 0x54, + .n = {.shift = 0, .width = 4, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 16, .width = 2}, + .prediv = { + .cond_shift = 24, + .cond_width = 2, + .cond_value = 0, + .value = 16 + }, + .mux_shift = 24, + .mux_width = 2, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_PREDIV, +}; + static struct aw_clk_prediv_mux_def *r_ccu_prediv_mux_clks[] = { &ar100_clk, }; @@ -135,15 +157,20 @@ static struct clk_fixed_def *fixed_factor_clks[] = { &ahb0_clk, }; -static struct aw_clk_nm_def *nm_clks[] = { - &ir_clk, +static struct aw_clk_nm_def *r_ccu_nm_clks[] = { + &r_ccu_ir_clk, }; +static struct aw_clk_nm_def *a83t_nm_clks[] = { + &a83t_ir_clk, +}; + void ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc) { int i; struct aw_clk_prediv_mux_def **prediv_mux_clks; + struct aw_clk_nm_def **nm_clks; sc->resets = ccu_sun8i_r_resets; sc->nresets = nitems(ccu_sun8i_r_resets); @@ -151,10 +178,13 @@ ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc) sc->ngates = nitems(ccu_sun8i_r_gates); /* a83t names the parents differently than the others */ - if (sc->type == A83T_R_CCU) + if (sc->type == A83T_R_CCU) { prediv_mux_clks = a83t_r_ccu_prediv_mux_clks; - else + nm_clks = a83t_nm_clks; + } else { prediv_mux_clks = r_ccu_prediv_mux_clks; + nm_clks = r_ccu_nm_clks; + } for (i = 0; i < nitems(prediv_mux_clks); i++) aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); From owner-svn-src-all@freebsd.org Sat Apr 7 17:06:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B404F97C68; Sat, 7 Apr 2018 17:06:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E1E977DEF; Sat, 7 Apr 2018 17:06:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 389982397F; Sat, 7 Apr 2018 17:06:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37H6Err084184; Sat, 7 Apr 2018 17:06:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37H6Da7084181; Sat, 7 Apr 2018 17:06:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804071706.w37H6Da7084181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 7 Apr 2018 17:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332182 - in head/sys: amd64/amd64 vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 vm X-SVN-Commit-Revision: 332182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:06:14 -0000 Author: kib Date: Sat Apr 7 17:06:13 2018 New Revision: 332182 URL: https://svnweb.freebsd.org/changeset/base/332182 Log: Handle Skylake-X errata SKZ63. SKZ63 Processor May Hang When Executing Code In an HLE Transaction Region Problem: Under certain conditions, if the processor acquires an HLE (Hardware Lock Elision) lock via the XACQUIRE instruction in the Host Physical Address range between 40000000H and 403FFFFFH, it may hang with an internal timeout error (MCACOD 0400H) logged into IA32_MCi_STATUS. Move the pages from the range into the blacklist. Add a tunable to not waste 4M if local DoS is not the issue. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15001 Modified: head/sys/amd64/amd64/pmap.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Apr 7 15:40:00 2018 (r332181) +++ head/sys/amd64/amd64/pmap.c Sat Apr 7 17:06:13 2018 (r332182) @@ -1290,7 +1290,35 @@ pmap_init(void) struct pmap_preinit_mapping *ppim; vm_page_t mpte; vm_size_t s; - int error, i, pv_npg; + int error, i, pv_npg, ret, skz63; + + /* Detect bare-metal Skylake Server and Skylake-X. */ + if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL && + CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) == 0x55) { + /* + * Skylake-X errata SKZ63. Processor May Hang When + * Executing Code In an HLE Transaction Region between + * 40000000H and 403FFFFFH. + * + * Mark the pages in the range as preallocated. It + * seems to be impossible to distinguish between + * Skylake Server and Skylake X. + */ + skz63 = 1; + TUNABLE_INT_FETCH("hw.skz63_enable", &skz63); + if (skz63 != 0) { + if (bootverbose) + printf("SKZ63: skipping 4M RAM starting " + "at physical 1G\n"); + for (i = 0; i < atop(0x400000); i++) { + ret = vm_page_blacklist_add(0x40000000 + + ptoa(i), FALSE); + if (!ret && bootverbose) + printf("page at %#lx already used\n", + 0x40000000 + ptoa(i)); + } + } + } /* * Initialize the vm page array entries for the kernel pmap's Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Apr 7 15:40:00 2018 (r332181) +++ head/sys/vm/vm_page.c Sat Apr 7 17:06:13 2018 (r332182) @@ -341,6 +341,29 @@ vm_page_blacklist_next(char **list, char *end) return (0); } +bool +vm_page_blacklist_add(vm_paddr_t pa, bool verbose) +{ + struct vm_domain *vmd; + vm_page_t m; + int ret; + + m = vm_phys_paddr_to_vm_page(pa); + if (m == NULL) + return (true); /* page does not exist, no failure */ + + vmd = vm_pagequeue_domain(m); + vm_domain_free_lock(vmd); + ret = vm_phys_unfree_page(m); + vm_domain_free_unlock(vmd); + if (ret) { + TAILQ_INSERT_TAIL(&blacklist_head, m, listq); + if (verbose) + printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); + } + return (ret); +} + /* * vm_page_blacklist_check: * @@ -351,29 +374,14 @@ vm_page_blacklist_next(char **list, char *end) static void vm_page_blacklist_check(char *list, char *end) { - struct vm_domain *vmd; vm_paddr_t pa; - vm_page_t m; char *next; - int ret; next = list; while (next != NULL) { if ((pa = vm_page_blacklist_next(&next, end)) == 0) continue; - m = vm_phys_paddr_to_vm_page(pa); - if (m == NULL) - continue; - vmd = vm_pagequeue_domain(m); - vm_domain_free_lock(vmd); - ret = vm_phys_unfree_page(m); - vm_domain_free_unlock(vmd); - if (ret == TRUE) { - TAILQ_INSERT_TAIL(&blacklist_head, m, listq); - if (bootverbose) - printf("Skipping page with pa 0x%jx\n", - (uintmax_t)pa); - } + vm_page_blacklist_add(pa, bootverbose); } } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Apr 7 15:40:00 2018 (r332181) +++ head/sys/vm/vm_page.h Sat Apr 7 17:06:13 2018 (r332182) @@ -476,6 +476,7 @@ vm_page_t vm_page_alloc_contig_domain(vm_object_t obje vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); vm_page_t vm_page_alloc_freelist_domain(int, int, int); +bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); void vm_page_change_lock(vm_page_t m, struct mtx **mtx); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, From owner-svn-src-all@freebsd.org Sat Apr 7 17:35:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62242F99C37; Sat, 7 Apr 2018 17:35:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16E1787C1C; Sat, 7 Apr 2018 17:35:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ABB523E7C; Sat, 7 Apr 2018 17:35:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37HZ40J099026; Sat, 7 Apr 2018 17:35:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37HZ42n099025; Sat, 7 Apr 2018 17:35:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071735.w37HZ42n099025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332183 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:35:05 -0000 Author: tuexen Date: Sat Apr 7 17:35:04 2018 New Revision: 332183 URL: https://svnweb.freebsd.org/changeset/base/332183 Log: MFC r323372: Savely remove a chunk from the control queue. This bug was found by Coverity scanning the usrsctp library. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 17:06:13 2018 (r332182) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 17:35:04 2018 (r332183) @@ -3136,14 +3136,14 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct * make sure that we have a covered ECNE in the control chunk part. * If so remove it. */ - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk, *nchk; struct sctp_ecne_chunk *ecne; int override; uint32_t cwr_tsn; cwr_tsn = ntohl(cp->tsn); override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; - TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { + TAILQ_FOREACH_SAFE(chk, &stcb->asoc.control_send_queue, sctp_next, nchk) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { continue; } From owner-svn-src-all@freebsd.org Sat Apr 7 17:36:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 981CAF99D4F; Sat, 7 Apr 2018 17:36:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3DB88C5C; Sat, 7 Apr 2018 17:36:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 418E423E7D; Sat, 7 Apr 2018 17:36:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Harxw099137; Sat, 7 Apr 2018 17:36:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Harjb099136; Sat, 7 Apr 2018 17:36:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071736.w37Harjb099136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332184 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:36:54 -0000 Author: tuexen Date: Sat Apr 7 17:36:53 2018 New Revision: 332184 URL: https://svnweb.freebsd.org/changeset/base/332184 Log: MFC r323374: Silence a Coverity warning from scanning the usrsctp library. Modified: stable/11/sys/netinet/sctp_pcb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 17:35:04 2018 (r332183) +++ stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 17:36:53 2018 (r332184) @@ -2919,9 +2919,9 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *ad */ /* got to be root to get at low ports */ if (ntohs(lport) < IPPORT_RESERVED) { - if (p && (error = + if ((p != NULL) && ((error = priv_check(p, PRIV_NETINET_RESERVEDPORT) - )) { + ) != 0)) { SCTP_INP_DECR_REF(inp); SCTP_INP_WUNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); From owner-svn-src-all@freebsd.org Sat Apr 7 17:38:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB7D5F99EF0; Sat, 7 Apr 2018 17:38:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C1C889CBD; Sat, 7 Apr 2018 17:38:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C48D23E7F; Sat, 7 Apr 2018 17:38:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Hcc0o099355; Sat, 7 Apr 2018 17:38:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Hcc5W099354; Sat, 7 Apr 2018 17:38:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071738.w37Hcc5W099354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332185 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:38:39 -0000 Author: tuexen Date: Sat Apr 7 17:38:38 2018 New Revision: 332185 URL: https://svnweb.freebsd.org/changeset/base/332185 Log: MFC r323376: Fix locking issues found by Coverity scanning the usrsctp library. Modified: stable/11/sys/netinet/sctp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 17:36:53 2018 (r332184) +++ stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 17:38:38 2018 (r332185) @@ -1959,6 +1959,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); } else { id->assoc_value = stcb->asoc.vrf_id; + SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_assoc_value); } break; @@ -3063,7 +3064,6 @@ flags_out: if (event_type > 0) { if (stcb) { event->se_on = sctp_stcb_is_feature_on(inp, stcb, event_type); - SCTP_TCB_UNLOCK(stcb); } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || @@ -3077,6 +3077,9 @@ flags_out: } } } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } if (error == 0) { *optsize = sizeof(struct sctp_event); } @@ -3647,12 +3650,16 @@ flags_out: sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0]; sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0]; #endif - SCTP_TCB_UNLOCK(stcb); - *optsize = sizeof(struct sctp_prstatus); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (error == 0) { + *optsize = sizeof(struct sctp_prstatus); + } break; } case SCTP_PR_ASSOC_STATUS: @@ -3675,11 +3682,15 @@ flags_out: sprstat->sprstat_abandoned_unsent = stcb->asoc.abandoned_unsent[policy]; sprstat->sprstat_abandoned_sent = stcb->asoc.abandoned_sent[policy]; } - SCTP_TCB_UNLOCK(stcb); - *optsize = sizeof(struct sctp_prstatus); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; + } + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (error == 0) { + *optsize = sizeof(struct sctp_prstatus); } break; } From owner-svn-src-all@freebsd.org Sat Apr 7 17:40:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 578DEF9A035; Sat, 7 Apr 2018 17:40:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A2658AADB; Sat, 7 Apr 2018 17:40:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0513023E83; Sat, 7 Apr 2018 17:40:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37HeBMF099491; Sat, 7 Apr 2018 17:40:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37HeBA9099490; Sat, 7 Apr 2018 17:40:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071740.w37HeBA9099490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332186 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 332186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:40:12 -0000 Author: tuexen Date: Sat Apr 7 17:40:11 2018 New Revision: 332186 URL: https://svnweb.freebsd.org/changeset/base/332186 Log: MFC r323377: Fix a locking issue found by Coverity scanning the usrsctp library. Modified: stable/11/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 17:38:38 2018 (r332185) +++ stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 17:40:11 2018 (r332186) @@ -879,7 +879,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) { stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb) { - SCTP_TCB_UNLOCK(stcb); + SCTP_TCB_LOCK(stcb); } SCTP_INP_RUNLOCK(inp); } else { From owner-svn-src-all@freebsd.org Sat Apr 7 17:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3854AF9A277; Sat, 7 Apr 2018 17:41:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DED3A8B79C; Sat, 7 Apr 2018 17:41:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D799923EC7; Sat, 7 Apr 2018 17:41:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37HfWYu003013; Sat, 7 Apr 2018 17:41:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37HfWEn003012; Sat, 7 Apr 2018 17:41:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071741.w37HfWEn003012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332187 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:41:33 -0000 Author: tuexen Date: Sat Apr 7 17:41:32 2018 New Revision: 332187 URL: https://svnweb.freebsd.org/changeset/base/332187 Log: MFC r323378: Fix MTU computation. Coverity scanning usrsctp pointed to this code... Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 17:40:11 2018 (r332186) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 17:41:32 2018 (r332187) @@ -4277,11 +4277,13 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, uint32_t mtu; mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); - if (net->port) { - mtu -= sizeof(struct udphdr); - } - if (mtu && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + if (mtu > 0) { + if (net->port) { + mtu -= sizeof(struct udphdr); + } + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } net->mtu = mtu; } } else if (ro->ro_rt == NULL) { @@ -4633,13 +4635,14 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, uint32_t mtu; mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); - if (mtu && - (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); - net->mtu = mtu; + if (mtu > 0) { if (net->port) { - net->mtu -= sizeof(struct udphdr); + mtu -= sizeof(struct udphdr); } + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } + net->mtu = mtu; } } else if (ifp) { if (ND_IFINFO(ifp)->linkmtu && @@ -12421,7 +12424,6 @@ sctp_copy_it_in(struct sctp_tcb *stcb, resv_in_first = SCTP_DATA_CHUNK_OVERHEAD(stcb); sp->data = sp->tail_mbuf = NULL; if (sp->length == 0) { - *error = 0; goto skip_copy; } if (srcv->sinfo_keynumber_valid) { @@ -13152,7 +13154,7 @@ skip_preblock: if (strm->last_msg_incomplete == 0) { do_a_copy_in: sp = sctp_copy_it_in(stcb, asoc, srcv, uio, net, max_len, user_marks_eor, &error); - if ((sp == NULL) || (error)) { + if (error) { goto out; } SCTP_TCB_SEND_LOCK(stcb); From owner-svn-src-all@freebsd.org Sat Apr 7 17:54:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91DB9F9AD9C; Sat, 7 Apr 2018 17:54:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 403BB6ACE8; Sat, 7 Apr 2018 17:54:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35627241A2; Sat, 7 Apr 2018 17:54:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37HsdOn009662; Sat, 7 Apr 2018 17:54:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37HscSo009660; Sat, 7 Apr 2018 17:54:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071754.w37HscSo009660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332188 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:54:39 -0000 Author: tuexen Date: Sat Apr 7 17:54:38 2018 New Revision: 332188 URL: https://svnweb.freebsd.org/changeset/base/332188 Log: MFC r323505: Export the UDP encapsualation port and the path state. Modified: stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/sctp_uio.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/11/sys/netinet/sctp_sysctl.c Sat Apr 7 17:41:32 2018 (r332187) +++ stable/11/sys/netinet/sctp_sysctl.c Sat Apr 7 17:54:38 2018 (r332188) @@ -505,6 +505,14 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) xraddr.rtt = net->rtt / 1000; xraddr.heartbeat_interval = net->heart_beat_delay; xraddr.ssthresh = net->ssthresh; + xraddr.encaps_port = net->port; + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + xraddr.state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + xraddr.state = SCTP_ACTIVE; + } else { + xraddr.state = SCTP_INACTIVE; + } xraddr.start_time.tv_sec = (uint32_t)net->start_time.tv_sec; xraddr.start_time.tv_usec = (uint32_t)net->start_time.tv_usec; SCTP_INP_RUNLOCK(inp); Modified: stable/11/sys/netinet/sctp_uio.h ============================================================================== --- stable/11/sys/netinet/sctp_uio.h Sat Apr 7 17:41:32 2018 (r332187) +++ stable/11/sys/netinet/sctp_uio.h Sat Apr 7 17:54:38 2018 (r332188) @@ -1239,7 +1239,9 @@ struct xsctp_raddr { uint32_t rtt; uint32_t heartbeat_interval; uint32_t ssthresh; - uint32_t extra_padding[30]; /* future */ + uint16_t encaps_port; + uint16_t state; + uint32_t extra_padding[29]; /* future */ }; #define SCTP_MAX_LOGGING_SIZE 30000 From owner-svn-src-all@freebsd.org Sat Apr 7 17:59:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A73A4F9B1D8; Sat, 7 Apr 2018 17:59:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5FF6D457; Sat, 7 Apr 2018 17:59:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54F7A241A5; Sat, 7 Apr 2018 17:59:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Hx9F8009882; Sat, 7 Apr 2018 17:59:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Hx8Xn009876; Sat, 7 Apr 2018 17:59:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071759.w37Hx8Xn009876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 17:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332189 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 17:59:09 -0000 Author: tuexen Date: Sat Apr 7 17:59:08 2018 New Revision: 332189 URL: https://svnweb.freebsd.org/changeset/base/332189 Log: MFC r323657: Remove code not used on any platform currently supported. Modified: stable/11/sys/netinet/sctp.h stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_os_bsd.h stable/11/sys/netinet/sctp_pcb.h stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp.h ============================================================================== --- stable/11/sys/netinet/sctp.h Sat Apr 7 17:54:38 2018 (r332188) +++ stable/11/sys/netinet/sctp.h Sat Apr 7 17:59:08 2018 (r332189) @@ -545,7 +545,6 @@ struct sctp_error_auth_invalid_hmac { #define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x0000000000000010 #define SCTP_PCB_FLAGS_DO_ASCONF 0x0000000000000020 #define SCTP_PCB_FLAGS_AUTO_ASCONF 0x0000000000000040 -#define SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE 0x0000000000000080 /* socket options */ #define SCTP_PCB_FLAGS_NODELAY 0x0000000000000100 #define SCTP_PCB_FLAGS_AUTOCLOSE 0x0000000000000200 Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sat Apr 7 17:54:38 2018 (r332188) +++ stable/11/sys/netinet/sctp_constants.h Sat Apr 7 17:59:08 2018 (r332189) @@ -555,11 +555,9 @@ __FBSDID("$FreeBSD$"); #define SCTP_TIMER_TYPE_INPKILL 15 #define SCTP_TIMER_TYPE_ASOCKILL 16 #define SCTP_TIMER_TYPE_ADDR_WQ 17 -#define SCTP_TIMER_TYPE_ZERO_COPY 18 -#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 19 -#define SCTP_TIMER_TYPE_PRIM_DELETED 20 +#define SCTP_TIMER_TYPE_PRIM_DELETED 18 /* add new timers here - and increment LAST */ -#define SCTP_TIMER_TYPE_LAST 21 +#define SCTP_TIMER_TYPE_LAST 19 #define SCTP_IS_TIMER_TYPE_VALID(t) (((t) > SCTP_TIMER_TYPE_NONE) && \ ((t) < SCTP_TIMER_TYPE_LAST)) Modified: stable/11/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/11/sys/netinet/sctp_os_bsd.h Sat Apr 7 17:54:38 2018 (r332188) +++ stable/11/sys/netinet/sctp_os_bsd.h Sat Apr 7 17:59:08 2018 (r332189) @@ -404,11 +404,6 @@ typedef struct rtentry sctp_rtentry_t; #define SCTP_RTALLOC(ro, vrf_id, fibnum) \ rtalloc_ign_fib((struct route *)ro, 0UL, fibnum) -/* Future zero copy wakeup/send function */ -#define SCTP_ZERO_COPY_EVENT(inp, so) -/* This is re-pulse ourselves for sendbuf */ -#define SCTP_ZERO_COPY_SENDQ_EVENT(inp, so) - /* * SCTP protocol specific mbuf flags. */ Modified: stable/11/sys/netinet/sctp_pcb.h ============================================================================== --- stable/11/sys/netinet/sctp_pcb.h Sat Apr 7 17:54:38 2018 (r332188) +++ stable/11/sys/netinet/sctp_pcb.h Sat Apr 7 17:59:08 2018 (r332189) @@ -314,10 +314,6 @@ struct sctp_pcb { */ struct sctp_timer signature_change; - /* Zero copy full buffer timer */ - struct sctp_timer zero_copy_timer; - /* Zero copy app to transport (sendq) read repulse timer */ - struct sctp_timer zero_copy_sendq_timer; uint32_t def_cookie_life; /* defaults to 0 */ int auto_close_time; Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 17:54:38 2018 (r332188) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 17:59:08 2018 (r332189) @@ -1633,22 +1633,6 @@ sctp_timeout_handler(void *t) /* call the handler for the appropriate timer type */ switch (type) { - case SCTP_TIMER_TYPE_ZERO_COPY: - if (inp == NULL) { - break; - } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { - SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); - } - break; - case SCTP_TIMER_TYPE_ZCOPY_SENDQ: - if (inp == NULL) { - break; - } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { - SCTP_ZERO_COPY_SENDQ_EVENT(inp, inp->sctp_socket); - } - break; case SCTP_TIMER_TYPE_ADDR_WQ: sctp_handle_addr_wq(); break; @@ -1962,14 +1946,6 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, s SCTP_TCB_LOCK_ASSERT(stcb); } switch (t_type) { - case SCTP_TIMER_TYPE_ZERO_COPY: - tmr = &inp->sctp_ep.zero_copy_timer; - to_ticks = SCTP_ZERO_COPY_TICK_DELAY; - break; - case SCTP_TIMER_TYPE_ZCOPY_SENDQ: - tmr = &inp->sctp_ep.zero_copy_sendq_timer; - to_ticks = SCTP_ZERO_COPY_SENDQ_TICK_DELAY; - break; case SCTP_TIMER_TYPE_ADDR_WQ: /* Only 1 tick away :-) */ tmr = &SCTP_BASE_INFO(addr_wq_timer); @@ -2251,12 +2227,6 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, st SCTP_TCB_LOCK_ASSERT(stcb); } switch (t_type) { - case SCTP_TIMER_TYPE_ZERO_COPY: - tmr = &inp->sctp_ep.zero_copy_timer; - break; - case SCTP_TIMER_TYPE_ZCOPY_SENDQ: - tmr = &inp->sctp_ep.zero_copy_sendq_timer; - break; case SCTP_TIMER_TYPE_ADDR_WQ: tmr = &SCTP_BASE_INFO(addr_wq_timer); break; @@ -4469,36 +4439,32 @@ sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, ) { if ((inp != NULL) && (inp->sctp_socket != NULL)) { - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { - SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); - } else { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - struct socket *so; + struct socket *so; - so = SCTP_INP_SO(inp); - if (!so_locked) { - if (stcb) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - } - SCTP_SOCKET_LOCK(so, 1); - if (stcb) { - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - } - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } + so = SCTP_INP_SO(inp); + if (!so_locked) { + if (stcb) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); } -#endif - sctp_sorwakeup(inp, inp->sctp_socket); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if (!so_locked) { + SCTP_SOCKET_LOCK(so, 1); + if (stcb) { + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + } + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { SCTP_SOCKET_UNLOCK(so, 1); + return; } + } #endif + sctp_sorwakeup(inp, inp->sctp_socket); +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + if (!so_locked) { + SCTP_SOCKET_UNLOCK(so, 1); } +#endif } } From owner-svn-src-all@freebsd.org Sat Apr 7 18:02:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C19F9F9B601; Sat, 7 Apr 2018 18:02:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 743476F1CA; Sat, 7 Apr 2018 18:02:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F34724337; Sat, 7 Apr 2018 18:02:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37I2HkZ013894; Sat, 7 Apr 2018 18:02:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37I2Ha5013893; Sat, 7 Apr 2018 18:02:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071802.w37I2Ha5013893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 18:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332190 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:02:17 -0000 Author: tuexen Date: Sat Apr 7 18:02:17 2018 New Revision: 332190 URL: https://svnweb.freebsd.org/changeset/base/332190 Log: MFC r323670: Fix an accounting bug and use sctp_timer_start to start a timer. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 17:59:08 2018 (r332189) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 18:02:17 2018 (r332190) @@ -1594,9 +1594,17 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc next_fsn, control->fsn_included); TAILQ_REMOVE(&control->reasm, at, sctp_next); lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD); - asoc->size_on_all_streams += lenadded; if (control->on_read_q) { do_wakeup = 1; + } else { + /* + * We only add to the + * size-on-all-streams if its not on + * the read q. The read q flag will + * cause a sballoc so its accounted + * for there. + */ + asoc->size_on_all_streams += lenadded; } next_fsn++; if (control->end_added && control->pdapi_started) { @@ -4229,8 +4237,7 @@ again: } if (net->flight_size) { j++; - (void)SCTP_OS_TIMER_START(&net->rxt_timer.timer, to_ticks, - sctp_timeout_handler, &net->rxt_timer); + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net); if (net->window_probe) { net->window_probe = 0; } @@ -4242,8 +4249,7 @@ again: */ net->window_probe = 0; if (!SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { - SCTP_OS_TIMER_START(&net->rxt_timer.timer, to_ticks, - sctp_timeout_handler, &net->rxt_timer); + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net); } } else if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, From owner-svn-src-all@freebsd.org Sat Apr 7 18:05:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 201ABF9B8E9; Sat, 7 Apr 2018 18:05:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B708970B2E; Sat, 7 Apr 2018 18:05:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADE832434F; Sat, 7 Apr 2018 18:05:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37I51lU014742; Sat, 7 Apr 2018 18:05:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37I51gd014741; Sat, 7 Apr 2018 18:05:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071805.w37I51gd014741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 18:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332191 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:05:02 -0000 Author: tuexen Date: Sat Apr 7 18:05:01 2018 New Revision: 332191 URL: https://svnweb.freebsd.org/changeset/base/332191 Log: MFC r323763: Remove a no longer used variable. Reported by: Felix Weinrank Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 18:02:17 2018 (r332190) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 18:05:01 2018 (r332191) @@ -4213,8 +4213,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 again: j = 0; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - int to_ticks; - if (win_probe_recovery && (net->window_probe)) { win_probe_recovered = 1; /* @@ -4229,11 +4227,6 @@ again: break; } } - } - if (net->RTO == 0) { - to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto); - } else { - to_ticks = MSEC_TO_TICKS(net->RTO); } if (net->flight_size) { j++; From owner-svn-src-all@freebsd.org Sat Apr 7 18:06:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50EF7F9BA49; Sat, 7 Apr 2018 18:06:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2F8E71A14; Sat, 7 Apr 2018 18:06:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED57124351; Sat, 7 Apr 2018 18:06:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37I6e8V014844; Sat, 7 Apr 2018 18:06:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37I6eag014843; Sat, 7 Apr 2018 18:06:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071806.w37I6eag014843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 18:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332192 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:06:41 -0000 Author: tuexen Date: Sat Apr 7 18:06:40 2018 New Revision: 332192 URL: https://svnweb.freebsd.org/changeset/base/332192 Log: MFC r323774: Avoid an overflow when computing the staleness. This issue was found by running libfuzz on the userland stack. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 18:05:01 2018 (r332191) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 18:06:40 2018 (r332192) @@ -2556,15 +2556,12 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in /* Expire time is in Ticks, so we convert to seconds */ time_expires.tv_sec = cookie->time_entered.tv_sec + TICKS_TO_SEC(cookie->cookie_life); time_expires.tv_usec = cookie->time_entered.tv_usec; - /* - * TODO sctp_constants.h needs alternative time macros when _KERNEL - * is undefined. - */ if (timevalcmp(&now, &time_expires, >)) { /* cookie is stale! */ struct mbuf *op_err; struct sctp_error_stale_cookie *cause; - uint32_t tim; + struct timeval diff; + uint32_t staleness; op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_error_stale_cookie), 0, M_NOWAIT, 1, MT_DATA); @@ -2578,12 +2575,19 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in cause->cause.code = htons(SCTP_CAUSE_STALE_COOKIE); cause->cause.length = htons((sizeof(struct sctp_paramhdr) + (sizeof(uint32_t)))); - /* seconds to usec */ - tim = (now.tv_sec - time_expires.tv_sec) * 1000000; - /* add in usec */ - if (tim == 0) - tim = now.tv_usec - cookie->time_entered.tv_usec; - cause->stale_time = htonl(tim); + diff = now; + timevalsub(&diff, &time_expires); + if (diff.tv_sec > UINT32_MAX / 1000000) { + staleness = UINT32_MAX; + } else { + staleness = diff.tv_sec * 1000000; + } + if (UINT32_MAX - staleness >= diff.tv_usec) { + staleness += diff.tv_usec; + } else { + staleness = UINT32_MAX; + } + cause->stale_time = htonl(staleness); sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, mflowtype, mflowid, l_inp->fibnum, vrf_id, port); From owner-svn-src-all@freebsd.org Sat Apr 7 18:08:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1376F9BC5F; Sat, 7 Apr 2018 18:08:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FC8D72C2E; Sat, 7 Apr 2018 18:08:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 845E224352; Sat, 7 Apr 2018 18:08:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37I8giC014965; Sat, 7 Apr 2018 18:08:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37I8g7c014964; Sat, 7 Apr 2018 18:08:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071808.w37I8g7c014964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 18:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332193 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:08:43 -0000 Author: tuexen Date: Sat Apr 7 18:08:42 2018 New Revision: 332193 URL: https://svnweb.freebsd.org/changeset/base/332193 Log: MFC r323776: Fix a warning. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 18:06:40 2018 (r332192) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 18:08:42 2018 (r332193) @@ -2582,7 +2582,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in } else { staleness = diff.tv_sec * 1000000; } - if (UINT32_MAX - staleness >= diff.tv_usec) { + if (UINT32_MAX - staleness >= (uint32_t)diff.tv_usec) { staleness += diff.tv_usec; } else { staleness = UINT32_MAX; From owner-svn-src-all@freebsd.org Sat Apr 7 18:09:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B48F9BD1E; Sat, 7 Apr 2018 18:09:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9038D733E0; Sat, 7 Apr 2018 18:09:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8873224353; Sat, 7 Apr 2018 18:09:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37I9VmJ015052; Sat, 7 Apr 2018 18:09:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37I9Vip015051; Sat, 7 Apr 2018 18:09:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804071809.w37I9Vip015051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 18:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332194 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:09:32 -0000 Author: ian Date: Sat Apr 7 18:09:31 2018 New Revision: 332194 URL: https://svnweb.freebsd.org/changeset/base/332194 Log: Add support for writing/changing spi device ivars. The SPI mode (polarity and phase) and the maximum bus speed can be changed. The chip select number cannot be changed, because the device instances which are children of spibus are inherently associated with the chip select number they were instantiated for. Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Sat Apr 7 18:08:42 2018 (r332193) +++ head/sys/dev/spibus/spibus.c Sat Apr 7 18:09:31 2018 (r332194) @@ -160,6 +160,37 @@ spibus_read_ivar(device_t bus, device_t child, int whi return (0); } +static int +spibus_write_ivar(device_t bus, device_t child, int which, uintptr_t value) +{ + struct spibus_ivar *devi = SPIBUS_IVAR(child); + + if (devi == NULL || device_get_parent(child) != bus) + return (EDOOFUS); + + switch (which) { + case SPIBUS_IVAR_CLOCK: + /* Any non-zero value is allowed for max clock frequency. */ + if (value == 0) + return (EINVAL); + devi->clock = (uint32_t)value; + break; + case SPIBUS_IVAR_CS: + /* Chip select cannot be changed. */ + return (EINVAL); + case SPIBUS_IVAR_MODE: + /* Valid SPI modes are 0-3. */ + if (value > 3) + return (EINVAL); + devi->mode = (uint32_t)value; + break; + default: + return (EINVAL); + } + + return (0); +} + static device_t spibus_add_child(device_t dev, u_int order, const char *name, int unit) { @@ -211,6 +242,7 @@ static device_method_t spibus_methods[] = { DEVMETHOD(bus_print_child, spibus_print_child), DEVMETHOD(bus_probe_nomatch, spibus_probe_nomatch), DEVMETHOD(bus_read_ivar, spibus_read_ivar), + DEVMETHOD(bus_write_ivar, spibus_write_ivar), DEVMETHOD(bus_child_pnpinfo_str, spibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, spibus_child_location_str), DEVMETHOD(bus_hinted_child, spibus_hinted_child), From owner-svn-src-all@freebsd.org Sat Apr 7 18:25:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE5C6F9CD10; Sat, 7 Apr 2018 18:25:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AED67BD18; Sat, 7 Apr 2018 18:25:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95D0F24675; Sat, 7 Apr 2018 18:25:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37IP7g2025028; Sat, 7 Apr 2018 18:25:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37IP7ri025027; Sat, 7 Apr 2018 18:25:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804071825.w37IP7ri025027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 18:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332195 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:25:08 -0000 Author: ian Date: Sat Apr 7 18:25:07 2018 New Revision: 332195 URL: https://svnweb.freebsd.org/changeset/base/332195 Log: A couple minor improvements to spibus.c... - Change the description string to "SPI bus" (was "spibus bus"). - This is the default driver for a SPI bus, not a generic implementation, so return the probe value that indicates such. - Use device_delete_children() at detach time, instead of a local loop to enumerate the children and detach each one individually. Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Sat Apr 7 18:09:31 2018 (r332194) +++ head/sys/dev/spibus/spibus.c Sat Apr 7 18:25:07 2018 (r332195) @@ -49,8 +49,9 @@ __FBSDID("$FreeBSD$"); static int spibus_probe(device_t dev) { - device_set_desc(dev, "spibus bus"); - return (BUS_PROBE_GENERIC); + + device_set_desc(dev, "SPI bus"); + return (BUS_PROBE_DEFAULT); } static int @@ -70,16 +71,11 @@ spibus_attach(device_t dev) static int spibus_detach(device_t dev) { - int err, ndevs, i; - device_t *devlist; + int err; if ((err = bus_generic_detach(dev)) != 0) return (err); - if ((err = device_get_children(dev, &devlist, &ndevs)) != 0) - return (err); - for (i = 0; i < ndevs; i++) - device_delete_child(dev, devlist[i]); - free(devlist, M_TEMP); + device_delete_children(dev); return (0); } From owner-svn-src-all@freebsd.org Sat Apr 7 18:58:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 251ABF9EDF6; Sat, 7 Apr 2018 18:58:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA27A6E8EE; Sat, 7 Apr 2018 18:58:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4FEA24B4B; Sat, 7 Apr 2018 18:58:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Iww3B040242; Sat, 7 Apr 2018 18:58:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Iwwdo040241; Sat, 7 Apr 2018 18:58:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804071858.w37Iwwdo040241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 18:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332196 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 18:58:59 -0000 Author: ian Date: Sat Apr 7 18:58:58 2018 New Revision: 332196 URL: https://svnweb.freebsd.org/changeset/base/332196 Log: Return BUS_PROBE_DEFAULT, not zero, because this is not the one driver implementation that must be used, it's just the base system default driver. Also add a comment noting that we're being more liberal about the bus frequency property than the dts binding documents require. Modified: head/sys/dev/spibus/ofw_spibus.c Modified: head/sys/dev/spibus/ofw_spibus.c ============================================================================== --- head/sys/dev/spibus/ofw_spibus.c Sat Apr 7 18:25:07 2018 (r332195) +++ head/sys/dev/spibus/ofw_spibus.c Sat Apr 7 18:58:58 2018 (r332196) @@ -71,7 +71,7 @@ ofw_spibus_probe(device_t dev) return (ENXIO); device_set_desc(dev, "OFW SPI bus"); - return (0); + return (BUS_PROBE_DEFAULT); } static int @@ -126,6 +126,10 @@ ofw_spibus_attach(device_t dev) /* * Get the maximum clock frequency for device, zero means * use the default bus speed. + * + * XXX Note that the current (2018-04-07) dts bindings say that + * spi-max-frequency is a required property (but says nothing of + * how to interpret a value of zero). */ if (OF_getencprop(child, "spi-max-frequency", &clock, sizeof(clock)) == -1) From owner-svn-src-all@freebsd.org Sat Apr 7 19:09:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DB11F9F989; Sat, 7 Apr 2018 19:09:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8687C74A3A; Sat, 7 Apr 2018 19:09:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 815EA24CE1; Sat, 7 Apr 2018 19:09:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37J9plx046652; Sat, 7 Apr 2018 19:09:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37J9p5h046650; Sat, 7 Apr 2018 19:09:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071909.w37J9p5h046650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332197 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:09:52 -0000 Author: tuexen Date: Sat Apr 7 19:09:51 2018 New Revision: 332197 URL: https://svnweb.freebsd.org/changeset/base/332197 Log: MFC r323833: Protect the address workqueue timer by a mutex. Modified: stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 18:58:58 2018 (r332196) +++ stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 19:09:51 2018 (r332197) @@ -709,12 +709,11 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 SCTP_WQ_ADDR_LOCK(); LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_WQ_ADDR_UNLOCK(); - sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); + SCTP_WQ_ADDR_UNLOCK(); } else { /* it's ready for use */ sctp_ifap->localifa_flags &= ~SCTP_ADDR_DEFER_USE; @@ -821,12 +820,11 @@ out_now: * the newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_WQ_ADDR_UNLOCK(); - sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); + SCTP_WQ_ADDR_UNLOCK(); } return; } Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 18:58:58 2018 (r332196) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 19:09:51 2018 (r332197) @@ -1462,13 +1462,11 @@ sctp_handle_addr_wq(void) LIST_INIT(&asc->list_of_work); asc->cnt = 0; - SCTP_WQ_ADDR_LOCK(); LIST_FOREACH_SAFE(wi, &SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) { LIST_REMOVE(wi, sctp_nxt_addr); LIST_INSERT_HEAD(&asc->list_of_work, wi, sctp_nxt_addr); asc->cnt++; } - SCTP_WQ_ADDR_UNLOCK(); if (asc->cnt == 0) { SCTP_FREE(asc, SCTP_M_ASC_IT); @@ -1492,11 +1490,9 @@ sctp_handle_addr_wq(void) if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { sctp_asconf_iterator_end(asc, 0); } else { - SCTP_WQ_ADDR_LOCK(); LIST_FOREACH(wi, &asc->list_of_work, sctp_nxt_addr) { LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); } - SCTP_WQ_ADDR_UNLOCK(); SCTP_FREE(asc, SCTP_M_ASC_IT); } } @@ -1565,8 +1561,7 @@ sctp_timeout_handler(void *t) (tmr->type != SCTP_TIMER_TYPE_SHUTDOWN) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWNACK) && (tmr->type != SCTP_TIMER_TYPE_SHUTDOWNGUARD) && - (tmr->type != SCTP_TIMER_TYPE_ASOCKILL)) - ) { + (tmr->type != SCTP_TIMER_TYPE_ASOCKILL))) { SCTP_INP_DECR_REF(inp); CURVNET_RESTORE(); return; @@ -1612,6 +1607,12 @@ sctp_timeout_handler(void *t) CURVNET_RESTORE(); return; } + } else if (inp != NULL) { + if (type != SCTP_TIMER_TYPE_INPKILL) { + SCTP_INP_WLOCK(inp); + } + } else { + SCTP_WQ_ADDR_LOCK(); } /* record in stopped what t-o occurred */ tmr->stopped_from = type; @@ -1759,7 +1760,6 @@ sctp_timeout_handler(void *t) } SCTP_STAT_INCR(sctps_timosecret); (void)SCTP_GETTIME_TIMEVAL(&tv); - SCTP_INP_WLOCK(inp); inp->sctp_ep.time_of_secret_change = tv.tv_sec; inp->sctp_ep.last_secret_number = inp->sctp_ep.current_secret_number; @@ -1773,7 +1773,6 @@ sctp_timeout_handler(void *t) inp->sctp_ep.secret_key[secret][i] = sctp_select_initial_TSN(&inp->sctp_ep); } - SCTP_INP_WUNLOCK(inp); sctp_timer_start(SCTP_TIMER_TYPE_NEWCOOKIE, inp, stcb, net); } did_output = 0; @@ -1921,7 +1920,12 @@ sctp_timeout_handler(void *t) get_out: if (stcb) { SCTP_TCB_UNLOCK(stcb); + } else if (inp != NULL) { + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_WQ_ADDR_UNLOCK(); } + out_decr: if (inp) { SCTP_INP_DECR_REF(inp); @@ -6145,11 +6149,11 @@ sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t * newest first :-0 */ LIST_INSERT_HEAD(&SCTP_BASE_INFO(addr_wq), wi, sctp_nxt_addr); - SCTP_WQ_ADDR_UNLOCK(); sctp_timer_start(SCTP_TIMER_TYPE_ADDR_WQ, (struct sctp_inpcb *)NULL, (struct sctp_tcb *)NULL, (struct sctp_nets *)NULL); + SCTP_WQ_ADDR_UNLOCK(); return (0); } From owner-svn-src-all@freebsd.org Sat Apr 7 19:10:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70AD1F9F9DD; Sat, 7 Apr 2018 19:10:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B494B74BC9; Sat, 7 Apr 2018 19:09:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AD0E24CE2; Sat, 7 Apr 2018 19:09:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37J9vPt046699; Sat, 7 Apr 2018 19:09:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37J9v1r046698; Sat, 7 Apr 2018 19:09:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804071909.w37J9v1r046698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 19:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332198 - head/sys/modules/spigen X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/spigen X-SVN-Commit-Revision: 332198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:10:00 -0000 Author: ian Date: Sat Apr 7 19:09:57 2018 New Revision: 332198 URL: https://svnweb.freebsd.org/changeset/base/332198 Log: Arrange the list of generated sources as 1-per-line alphbetical, and add the files required when building for FDT-based systems. Modified: head/sys/modules/spigen/Makefile Modified: head/sys/modules/spigen/Makefile ============================================================================== --- head/sys/modules/spigen/Makefile Sat Apr 7 19:09:51 2018 (r332197) +++ head/sys/modules/spigen/Makefile Sat Apr 7 19:09:57 2018 (r332198) @@ -3,6 +3,16 @@ .PATH: ${SRCTOP}/sys/dev/spibus KMOD= spigen SRCS= spigen.c -SRCS+= device_if.h bus_if.h opt_platform.h spibus_if.h + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + opt_platform.h \ + spibus_if.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif .include From owner-svn-src-all@freebsd.org Sat Apr 7 19:11:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4C4BF9FB1F; Sat, 7 Apr 2018 19:11:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 878A375A7E; Sat, 7 Apr 2018 19:11:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A0F24E34; Sat, 7 Apr 2018 19:11:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JBLYZ049046; Sat, 7 Apr 2018 19:11:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JBL9b049045; Sat, 7 Apr 2018 19:11:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071911.w37JBL9b049045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332199 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:11:22 -0000 Author: tuexen Date: Sat Apr 7 19:11:21 2018 New Revision: 332199 URL: https://svnweb.freebsd.org/changeset/base/332199 Log: MFC r323847: No need to wakeup, since sctp_add_to_readq() does it. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:09:57 2018 (r332198) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:11:21 2018 (r332199) @@ -1617,7 +1617,6 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc control, &stcb->sctp_socket->so_rcv, control->end_added, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - do_wakeup = 1; } break; } From owner-svn-src-all@freebsd.org Sat Apr 7 19:13:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BC2BF9FDC6; Sat, 7 Apr 2018 19:13:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F65276B3B; Sat, 7 Apr 2018 19:13:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2994F24E88; Sat, 7 Apr 2018 19:13:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JD6QE051432; Sat, 7 Apr 2018 19:13:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JD6dn051431; Sat, 7 Apr 2018 19:13:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071913.w37JD6dn051431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332200 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:13:06 -0000 Author: tuexen Date: Sat Apr 7 19:13:05 2018 New Revision: 332200 URL: https://svnweb.freebsd.org/changeset/base/332200 Log: MFC r323850: Free the control structure after using is, not before. Found by Coverity while scanning the usrsctp library. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:11:21 2018 (r332199) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:13:05 2018 (r332200) @@ -1379,10 +1379,10 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc } if (sctp_place_control_in_stream(strm, asoc, control)) { /* Duplicate SSN? */ - sctp_clean_up_control(stcb, control); sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_6); + sctp_clean_up_control(stcb, control); return; } if ((tsn == (asoc->cumulative_tsn + 1) && (asoc->idata_supported == 0))) { From owner-svn-src-all@freebsd.org Sat Apr 7 19:14:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3710AF9FF60; Sat, 7 Apr 2018 19:14:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9D51778B7; Sat, 7 Apr 2018 19:14:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4E3824E89; Sat, 7 Apr 2018 19:14:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JEVI2051533; Sat, 7 Apr 2018 19:14:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JEVch051529; Sat, 7 Apr 2018 19:14:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071914.w37JEVch051529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332201 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:14:32 -0000 Author: tuexen Date: Sat Apr 7 19:14:31 2018 New Revision: 332201 URL: https://svnweb.freebsd.org/changeset/base/332201 Log: MFC r323861: Code cleanup, no functional change. Modified: stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_output.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sat Apr 7 19:13:05 2018 (r332200) +++ stable/11/sys/netinet/sctp_constants.h Sat Apr 7 19:14:31 2018 (r332201) @@ -969,9 +969,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_SO_NOT_LOCKED 0 -#define SCTP_HOLDS_LOCK 1 -#define SCTP_NOT_LOCKED 0 - /*- * For address locks, do we hold the lock? */ Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:13:05 2018 (r332200) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:14:31 2018 (r332201) @@ -199,8 +199,7 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offse sctp_send_initiate_ack(inp, stcb, net, m, iphlen, offset, src, dst, sh, cp, mflowtype, mflowid, - vrf_id, port, - ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); + vrf_id, port); } outnow: if (stcb == NULL) { Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 19:13:05 2018 (r332200) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 19:14:31 2018 (r332201) @@ -5491,7 +5491,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *init_chk, uint8_t mflowtype, uint32_t mflowid, - uint32_t vrf_id, uint16_t port, int hold_inp_lock) + uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; struct mbuf *m, *m_tmp, *m_last, *m_cookie, *op_err; @@ -5839,10 +5839,6 @@ do_a_abort: } else { uint32_t vtag, itsn; - if (hold_inp_lock) { - SCTP_INP_INCR_REF(inp); - SCTP_INP_RUNLOCK(inp); - } if (asoc) { atomic_add_int(&asoc->refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5862,12 +5858,12 @@ do_a_abort: SCTP_TCB_LOCK(stcb); atomic_add_int(&asoc->refcnt, -1); } else { + SCTP_INP_INCR_REF(inp); + SCTP_INP_RUNLOCK(inp); vtag = sctp_select_a_tag(inp, inp->sctp_lport, sh->src_port, 1); initack->init.initiate_tag = htonl(vtag); /* get a TSN to use too */ initack->init.initial_tsn = htonl(sctp_select_initial_TSN(&inp->sctp_ep)); - } - if (hold_inp_lock) { SCTP_INP_RLOCK(inp); SCTP_INP_DECR_REF(inp); } Modified: stable/11/sys/netinet/sctp_output.h ============================================================================== --- stable/11/sys/netinet/sctp_output.h Sat Apr 7 19:13:05 2018 (r332200) +++ stable/11/sys/netinet/sctp_output.h Sat Apr 7 19:14:31 2018 (r332201) @@ -86,7 +86,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *, struct sct struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_init_chunk *, uint8_t, uint32_t, - uint32_t, uint16_t, int); + uint32_t, uint16_t); struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, From owner-svn-src-all@freebsd.org Sat Apr 7 19:16:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 648FBFA00ED; Sat, 7 Apr 2018 19:16:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16ECB786FF; Sat, 7 Apr 2018 19:16:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EADE24E8A; Sat, 7 Apr 2018 19:16:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JG6eN051648; Sat, 7 Apr 2018 19:16:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JG6FF051647; Sat, 7 Apr 2018 19:16:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071916.w37JG6FF051647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332202 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:16:07 -0000 Author: tuexen Date: Sat Apr 7 19:16:06 2018 New Revision: 332202 URL: https://svnweb.freebsd.org/changeset/base/332202 Log: MFC r323902: Add missing socket lock. Modified: stable/11/sys/netinet/sctp_pcb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 19:14:31 2018 (r332201) +++ stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 19:16:06 2018 (r332202) @@ -2484,7 +2484,9 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) inp->sctp_flags = (SCTP_PCB_FLAGS_TCPTYPE | SCTP_PCB_FLAGS_UNBOUND); /* Be sure we have blocking IO by default */ + SOCK_LOCK(so); SCTP_CLEAR_SO_NBIO(so); + SOCK_UNLOCK(so); } else { /* * unsupported socket type (RAW, etc)- in case we missed it From owner-svn-src-all@freebsd.org Sat Apr 7 19:17:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B914FFA0224; Sat, 7 Apr 2018 19:17:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69572793BC; Sat, 7 Apr 2018 19:17:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 634DE24E8B; Sat, 7 Apr 2018 19:17:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JHVR4051750; Sat, 7 Apr 2018 19:17:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JHVKv051749; Sat, 7 Apr 2018 19:17:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071917.w37JHVKv051749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332203 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:17:32 -0000 Author: tuexen Date: Sat Apr 7 19:17:31 2018 New Revision: 332203 URL: https://svnweb.freebsd.org/changeset/base/332203 Log: MFC r323904: Add missing locking. Found by Coverity while scanning the usrsctp library. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:16:06 2018 (r332202) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:17:31 2018 (r332203) @@ -701,6 +701,14 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ struct sctpasochead *head; + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_INFO_WLOCK(); + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); @@ -712,6 +720,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + SCTP_INP_INFO_WUNLOCK(); return (1); } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { @@ -733,6 +742,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); + SCTP_INP_INFO_WUNLOCK(); return (1); } return (0); From owner-svn-src-all@freebsd.org Sat Apr 7 19:19:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDFC4FA04E2; Sat, 7 Apr 2018 19:19:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0887A4FD; Sat, 7 Apr 2018 19:19:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F31D24E8D; Sat, 7 Apr 2018 19:19:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JJQQA051873; Sat, 7 Apr 2018 19:19:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JJQTR051871; Sat, 7 Apr 2018 19:19:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071919.w37JJQTR051871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332204 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:19:27 -0000 Author: tuexen Date: Sat Apr 7 19:19:25 2018 New Revision: 332204 URL: https://svnweb.freebsd.org/changeset/base/332204 Log: MFC r324056: Remove unused function. Modified: stable/11/sys/netinet/sctp_asconf.c stable/11/sys/netinet/sctp_asconf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_asconf.c ============================================================================== --- stable/11/sys/netinet/sctp_asconf.c Sat Apr 7 19:17:31 2018 (r332203) +++ stable/11/sys/netinet/sctp_asconf.c Sat Apr 7 19:19:25 2018 (r332204) @@ -2305,39 +2305,6 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, return (0); } -void -sctp_set_primary_ip_address(struct sctp_ifa *ifa) -{ - struct sctp_inpcb *inp; - - /* go through all our PCB's */ - LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { - struct sctp_tcb *stcb; - - /* process for all associations for this endpoint */ - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - /* queue an ASCONF:SET_PRIM_ADDR to be sent */ - if (!sctp_asconf_queue_add(stcb, ifa, - SCTP_SET_PRIM_ADDR)) { - /* set primary queuing succeeded */ - SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address: queued on stcb=%p, ", - (void *)stcb); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &ifa->address.sa); - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { -#ifdef SCTP_TIMER_BASED_ASCONF - sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, - stcb->sctp_ep, stcb, - stcb->asoc.primary_destination); -#else - sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); -#endif - } - } - } /* for each stcb */ - } /* for each inp */ -} - int sctp_is_addr_pending(struct sctp_tcb *stcb, struct sctp_ifa *sctp_ifa) { Modified: stable/11/sys/netinet/sctp_asconf.h ============================================================================== --- stable/11/sys/netinet/sctp_asconf.h Sat Apr 7 19:17:31 2018 (r332203) +++ stable/11/sys/netinet/sctp_asconf.h Sat Apr 7 19:19:25 2018 (r332204) @@ -73,9 +73,6 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *, struct sockaddr *); extern void - sctp_set_primary_ip_address(struct sctp_ifa *ifa); - -extern void sctp_check_address_list(struct sctp_tcb *, struct mbuf *, int, int, struct sockaddr *, uint16_t, uint16_t, uint16_t, uint16_t); From owner-svn-src-all@freebsd.org Sat Apr 7 19:21:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A9AFA0819; Sat, 7 Apr 2018 19:21:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06667B741; Sat, 7 Apr 2018 19:21:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB41A24FC0; Sat, 7 Apr 2018 19:21:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JLFN9052922; Sat, 7 Apr 2018 19:21:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JLFkg052920; Sat, 7 Apr 2018 19:21:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071921.w37JLFkg052920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332205 - stable/11/usr.sbin/traceroute6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.sbin/traceroute6 X-SVN-Commit-Revision: 332205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:21:16 -0000 Author: tuexen Date: Sat Apr 7 19:21:15 2018 New Revision: 332205 URL: https://svnweb.freebsd.org/changeset/base/332205 Log: MFC r324119: * Update function definitions. * Ensure that the datalen always describes the length after the IPv6 header consistently, not matter which protocol us used for probes.. * Document that the default length is 20, not 12. * Don't send inormation in probe packets which is not needed or even checked when the responses are processed. * Address CID 978587. This is mainly a cleanup preparing the addition of SCTP and TCP as possible probe packet protocols. Modified: stable/11/usr.sbin/traceroute6/traceroute6.8 stable/11/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.8 Sat Apr 7 19:19:25 2018 (r332204) +++ stable/11/usr.sbin/traceroute6/traceroute6.8 Sat Apr 7 19:21:15 2018 (r332205) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2009 +.Dd September 30, 2017 .Dt TRACEROUTE6 8 .Os .\" @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl adIlnNrvU +.Op Fl adIlnNrUv .Ek .Bk -words .Op Fl f Ar firsthop @@ -79,7 +79,7 @@ uses the IPv6 protocol hop limit field to elicit an IC response from each gateway along the path to some host. .Pp The only mandatory parameter is the destination host name or IPv6 address. -The default probe datagram carries 12 bytes of payload, +The default probe datagram carries 20 bytes of payload, in addition to the IPv6 header. The size of the payload can be specified by giving a length (in bytes) @@ -96,9 +96,9 @@ Debug mode. .It Fl f Ar firsthop Specify how many hops to skip in trace. .It Fl g Ar gateway -Specify intermediate gateway -.Nm ( -uses routing header). +Specify intermediate gateway. Please note that +.Nm +tries to use routing headers. .It Fl I Use ICMP6 ECHO instead of UDP datagrams. .It Fl l Modified: stable/11/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 19:19:25 2018 (r332204) +++ stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 19:21:15 2018 (r332205) @@ -289,23 +289,8 @@ static const char rcsid[] = #define freehostent(x) #endif -/* - * format of a (udp) probe packet. - */ -struct tv32 { - u_int32_t tv32_sec; - u_int32_t tv32_usec; -}; - -struct opacket { - u_char seq; /* sequence number of this packet */ - u_char hops; /* hop limit of the packet */ - u_char pad[2]; - struct tv32 tv; /* time packet left */ -} __attribute__((__packed__)); - u_char packet[512]; /* last inbound (icmp) packet */ -struct opacket *outpacket; /* last output (udp) packet */ +char *outpacket; /* last output packet */ int main(int, char *[]); int wait_for_reply(int, struct msghdr *); @@ -333,7 +318,7 @@ int rcvhlim; struct in6_pktinfo *rcvpktinfo; struct sockaddr_in6 Src, Dst, Rcv; -u_long datalen; /* How much data */ +u_long datalen = 20; /* How much data */ #define ICMP6ECHOLEN 8 /* XXX: 2064 = 127(max hops in type 0 rthdr) * sizeof(ip6_hdr) + 16(margin) */ char rtbuf[2064]; @@ -362,9 +347,7 @@ char *as_server = NULL; void *asn; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int mib[4] = { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_DEFHLIM }; char hbuf[NI_MAXHOST], src0[NI_MAXHOST], *ep; @@ -533,12 +516,12 @@ main(argc, argv) */ source = optarg; break; - case 'v': - verbose++; - break; case 'U': useproto = IPPROTO_UDP; break; + case 'v': + verbose++; + break; case 'w': ep = NULL; errno = 0; @@ -574,13 +557,13 @@ main(argc, argv) } break; case IPPROTO_NONE: - if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_NONE)) < 0) { + if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_NONE)) < 0) { perror("socket(SOCK_RAW)"); exit(5); } break; default: - fprintf(stderr, "traceroute6: unknown probe protocol %d", + fprintf(stderr, "traceroute6: unknown probe protocol %d\n", useproto); exit(5); } @@ -641,7 +624,7 @@ main(argc, argv) ep = NULL; errno = 0; datalen = strtoul(*argv, &ep, 0); - if (errno || !*argv || *ep) { + if (errno || *ep) { fprintf(stderr, "traceroute6: invalid packet length.\n"); exit(1); @@ -649,10 +632,10 @@ main(argc, argv) } switch (useproto) { case IPPROTO_ICMPV6: - minlen = ICMP6ECHOLEN + sizeof(struct tv32); + minlen = ICMP6ECHOLEN; break; case IPPROTO_UDP: - minlen = sizeof(struct opacket); + minlen = sizeof(struct udphdr); break; case IPPROTO_NONE: minlen = 0; @@ -671,6 +654,8 @@ main(argc, argv) minlen, MAXPACKET); exit(1); } + if (useproto == IPPROTO_UDP) + datalen -= sizeof(struct udphdr); outpacket = malloc(datalen); if (!outpacket) { perror("malloc"); @@ -735,8 +720,10 @@ main(argc, argv) #ifdef SO_SNDBUF i = datalen; + if (i == 0) + i = 1; if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&i, - sizeof(i)) < 0 && useproto != IPPROTO_NONE) { + sizeof(i)) < 0) { perror("setsockopt(SO_SNDBUF)"); exit(6); } @@ -977,9 +964,7 @@ main(argc, argv) } int -wait_for_reply(sock, mhdr) - int sock; - struct msghdr *mhdr; +wait_for_reply(int sock, struct msghdr *mhdr) { #ifdef HAVE_POLL struct pollfd pfd[1]; @@ -1038,14 +1023,9 @@ setpolicy(so, policy) #endif void -send_probe(seq, hops) - int seq; - u_long hops; +send_probe(int seq, u_long hops) { struct icmp6_hdr *icp; - struct opacket *op; - struct timeval tv; - struct tv32 tv32; int i; i = hops; @@ -1055,9 +1035,6 @@ send_probe(seq, hops) } Dst.sin6_port = htons(port + seq); - (void) gettimeofday(&tv, NULL); - tv32.tv32_sec = htonl(tv.tv_sec); - tv32.tv32_usec = htonl(tv.tv_usec); switch (useproto) { case IPPROTO_ICMPV6: @@ -1068,15 +1045,8 @@ send_probe(seq, hops) icp->icmp6_cksum = 0; icp->icmp6_id = ident; icp->icmp6_seq = htons(seq); - bcopy(&tv32, ((u_int8_t *)outpacket + ICMP6ECHOLEN), - sizeof(tv32)); break; case IPPROTO_UDP: - op = outpacket; - - op->seq = seq; - op->hops = hops; - bcopy(&tv32, &op->tv, sizeof tv32); break; case IPPROTO_NONE: /* No space for anything. No harm as seq/tv32 are decorative. */ @@ -1098,8 +1068,7 @@ send_probe(seq, hops) } int -get_hoplim(mhdr) - struct msghdr *mhdr; +get_hoplim(struct msghdr *mhdr) { struct cmsghdr *cm; @@ -1115,8 +1084,7 @@ get_hoplim(mhdr) } double -deltaT(t1p, t2p) - struct timeval *t1p, *t2p; +deltaT(struct timeval *t1p, struct timeval *t2p) { double dt; @@ -1185,10 +1153,7 @@ pr_type(int t0) } int -packet_ok(mhdr, cc, seq) - struct msghdr *mhdr; - int cc; - int seq; +packet_ok(struct msghdr *mhdr, int cc, int seq) { struct icmp6_hdr *icp; struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; @@ -1262,6 +1227,8 @@ packet_ok(mhdr, cc, seq) if ((type == ICMP6_TIME_EXCEEDED && code == ICMP6_TIME_EXCEED_TRANSIT) || type == ICMP6_DST_UNREACH) { struct ip6_hdr *hip; + struct icmp6_hdr *icmp; + struct udphdr *udp; void *up; hip = (struct ip6_hdr *)(icp + 1); @@ -1272,14 +1239,16 @@ packet_ok(mhdr, cc, seq) } switch (useproto) { case IPPROTO_ICMPV6: - if (((struct icmp6_hdr *)up)->icmp6_id == ident && - ((struct icmp6_hdr *)up)->icmp6_seq == htons(seq)) + icmp = (struct icmp6_hdr *)up; + if (icmp->icmp6_id == ident && + icmp->icmp6_seq == htons(seq)) return (type == ICMP6_TIME_EXCEEDED ? -1 : code + 1); break; case IPPROTO_UDP: - if (((struct udphdr *)up)->uh_sport == htons(srcport) && - ((struct udphdr *)up)->uh_dport == htons(port + seq)) + udp = (struct udphdr *)up; + if (udp->uh_sport == htons(srcport) && + udp->uh_dport == htons(port + seq)) return (type == ICMP6_TIME_EXCEEDED ? -1 : code + 1); break; @@ -1328,9 +1297,7 @@ packet_ok(mhdr, cc, seq) * Increment pointer until find the UDP or ICMP header. */ void * -get_uphdr(ip6, lim) - struct ip6_hdr *ip6; - u_char *lim; +get_uphdr(struct ip6_hdr *ip6, u_char *lim) { u_char *cp = (u_char *)ip6, nh; int hlen; @@ -1374,9 +1341,7 @@ get_uphdr(ip6, lim) } void -print(mhdr, cc) - struct msghdr *mhdr; - int cc; +print(struct msghdr *mhdr, int cc) { struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; char hbuf[NI_MAXHOST]; @@ -1412,8 +1377,7 @@ print(mhdr, cc) * numeric value, otherwise try for symbolic name. */ const char * -inetname(sa) - struct sockaddr *sa; +inetname(struct sockaddr *sa) { static char line[NI_MAXHOST], domain[MAXHOSTNAMELEN + 1]; static int first = 1; @@ -1447,7 +1411,7 @@ inetname(sa) } void -usage() +usage(void) { fprintf(stderr, From owner-svn-src-all@freebsd.org Sat Apr 7 19:22:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B47A8FA09F6; Sat, 7 Apr 2018 19:22:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 606FF7C3CC; Sat, 7 Apr 2018 19:22:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5827825025; Sat, 7 Apr 2018 19:22:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JMX31057243; Sat, 7 Apr 2018 19:22:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JMXA2057241; Sat, 7 Apr 2018 19:22:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071922.w37JMXA2057241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332206 - stable/11/usr.sbin/traceroute6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.sbin/traceroute6 X-SVN-Commit-Revision: 332206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:22:34 -0000 Author: tuexen Date: Sat Apr 7 19:22:32 2018 New Revision: 332206 URL: https://svnweb.freebsd.org/changeset/base/332206 Log: MFC r324120: Add SCTP and TCP as protocols for sending probe packets. Modified: stable/11/usr.sbin/traceroute6/traceroute6.8 stable/11/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.8 Sat Apr 7 19:21:15 2018 (r332205) +++ stable/11/usr.sbin/traceroute6/traceroute6.8 Sat Apr 7 19:22:32 2018 (r332206) @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl adIlnNrUv +.Op Fl adIlnNrSTUv .Ek .Bk -words .Op Fl f Ar firsthop @@ -119,7 +119,7 @@ Do not resolve numeric address to hostname. Use a packet with no upper layer header for the probes, instead of UDP datagrams. .It Fl p Ar port -Set UDP port number to +Set SCTP/TCP/UDP port number to .Ar port . .It Fl q Ar probes Set the number of probe per hop count to @@ -138,6 +138,10 @@ that has no route through it .It Fl s Ar src .Ar Src specifies the source IPv6 address to be used. +.It Fl S +Use SCTP packets for the probes. +.It Fl T +Use TCP segments for the probes. .It Fl U Use UDP datagrams for the probes. This is the default. Modified: stable/11/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 19:21:15 2018 (r332205) +++ stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 19:22:32 2018 (r332206) @@ -271,6 +271,8 @@ static const char rcsid[] = #include #include +#include +#include #include #ifdef IPSEC @@ -307,10 +309,14 @@ const char *pr_type(int); int packet_ok(struct msghdr *, int, int); void print(struct msghdr *, int); const char *inetname(struct sockaddr *); +u_int32_t sctp_crc32c(void *, u_int32_t); +u_int16_t in_cksum(u_int16_t *addr, int); +u_int16_t tcp_chksum(struct sockaddr_in6 *, struct sockaddr_in6 *, + void *, u_int32_t); void usage(void); int rcvsock; /* receive (icmp) socket file descriptor */ -int sndsock; /* send (udp) socket file descriptor */ +int sndsock; /* send (raw/udp) socket file descriptor */ struct msghdr rcvmhdr; struct iovec rcviov[2]; @@ -394,8 +400,9 @@ main(int argc, char *argv[]) #endif seq = 0; + ident = htons(getpid() & 0xffff); /* same as ping6 */ - while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:Uvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:STUvw:")) != -1) switch (ch) { case 'a': as_path = 1; @@ -455,7 +462,6 @@ main(int argc, char *argv[]) break; case 'I': useproto = IPPROTO_ICMPV6; - ident = htons(getpid() & 0xffff); /* same as ping6 */ break; case 'l': lflag++; @@ -516,6 +522,12 @@ main(int argc, char *argv[]) */ source = optarg; break; + case 'S': + useproto = IPPROTO_SCTP; + break; + case 'T': + useproto = IPPROTO_TCP; + break; case 'U': useproto = IPPROTO_UDP; break; @@ -557,7 +569,9 @@ main(int argc, char *argv[]) } break; case IPPROTO_NONE: - if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_NONE)) < 0) { + case IPPROTO_SCTP: + case IPPROTO_TCP: + if ((sndsock = socket(AF_INET6, SOCK_RAW, useproto)) < 0) { perror("socket(SOCK_RAW)"); exit(5); } @@ -641,6 +655,12 @@ main(int argc, char *argv[]) minlen = 0; datalen = 0; break; + case IPPROTO_SCTP: + minlen = sizeof(struct sctphdr); + break; + case IPPROTO_TCP: + minlen = sizeof(struct tcphdr); + break; default: fprintf(stderr, "traceroute6: unknown probe protocol %d.\n", useproto); @@ -1026,6 +1046,9 @@ void send_probe(int seq, u_long hops) { struct icmp6_hdr *icp; + struct sctphdr *sctp; + struct sctp_chunkhdr *chk; + struct tcphdr *tcp; int i; i = hops; @@ -1051,6 +1074,43 @@ send_probe(int seq, u_long hops) case IPPROTO_NONE: /* No space for anything. No harm as seq/tv32 are decorative. */ break; + case IPPROTO_SCTP: + sctp = (struct sctphdr *)outpacket; + + sctp->src_port = htons(ident); + sctp->dest_port = htons(port + seq); + sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port; + sctp->checksum = htonl(0); + if (datalen >= (u_long)(sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr))) { + chk = (struct sctp_chunkhdr *)(sctp + 1); + chk->chunk_type = SCTP_SHUTDOWN_ACK; + chk->chunk_flags = 0; + chk->chunk_length = htons(4); + } + if (datalen >= (u_long)(sizeof(struct sctphdr) + + 2 * sizeof(struct sctp_chunkhdr))) { + chk = chk + 1; + chk->chunk_type = SCTP_PAD_CHUNK; + chk->chunk_flags = 0; + chk->chunk_length = htons((u_int16_t)(datalen - + sizeof(struct sctphdr) - + sizeof(struct sctp_chunkhdr))); + } + sctp->checksum = sctp_crc32c(outpacket, datalen); + break; + case IPPROTO_TCP: + tcp = (struct tcphdr *)outpacket; + + tcp->th_sport = htons(ident); + tcp->th_dport = htons(port + seq); + tcp->th_seq = (tcp->th_sport << 16) | tcp->th_dport; + tcp->th_ack = 0; + tcp->th_off = 5; + tcp->th_flags = TH_SYN; + tcp->th_sum = 0; + tcp->th_sum = tcp_chksum(&Src, &Dst, outpacket, datalen); + break; default: fprintf(stderr, "Unknown probe protocol %d.\n", useproto); exit(1); @@ -1228,6 +1288,8 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) || type == ICMP6_DST_UNREACH) { struct ip6_hdr *hip; struct icmp6_hdr *icmp; + struct sctphdr *sctp; + struct tcphdr *tcp; struct udphdr *udp; void *up; @@ -1252,6 +1314,24 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) return (type == ICMP6_TIME_EXCEEDED ? -1 : code + 1); break; + case IPPROTO_SCTP: + sctp = (struct sctphdr *)up; + if (sctp->src_port == htons(ident) && + sctp->dest_port == htons(port + seq) && + sctp->v_tag == + (u_int32_t)((sctp->src_port << 16) | sctp->dest_port)) + return (type == ICMP6_TIME_EXCEEDED ? + -1 : code + 1); + break; + case IPPROTO_TCP: + tcp = (struct tcphdr *)up; + if (tcp->th_sport == htons(ident) && + tcp->th_dport == htons(port + seq) && + tcp->th_seq == + (tcp_seq)((tcp->th_sport << 16) | tcp->th_dport)) + return (type == ICMP6_TIME_EXCEEDED ? + -1 : code + 1); + break; case IPPROTO_NONE: return (type == ICMP6_TIME_EXCEEDED ? -1 : code + 1); default: @@ -1312,10 +1392,11 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) while (lim - cp >= (nh == IPPROTO_NONE ? 0 : 8)) { switch (nh) { case IPPROTO_ESP: - case IPPROTO_TCP: return(NULL); case IPPROTO_ICMPV6: return(useproto == nh ? cp : NULL); + case IPPROTO_SCTP: + case IPPROTO_TCP: case IPPROTO_UDP: return(useproto == nh ? cp : NULL); case IPPROTO_NONE: @@ -1410,12 +1491,163 @@ inetname(struct sockaddr *sa) return line; } +/* + * CRC32C routine for the Stream Control Transmission Protocol + */ + +#define CRC32C(c, d) (c = (c>>8) ^ crc_c[(c^(d))&0xFF]) + +static u_int32_t crc_c[256] = { + 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, + 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, + 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, + 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, + 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, + 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, + 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, + 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B, + 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, + 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, + 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, + 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, + 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, + 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A, + 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, + 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, + 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, + 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, + 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, + 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198, + 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, + 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, + 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, + 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, + 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, + 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789, + 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, + 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, + 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, + 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, + 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, + 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829, + 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, + 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, + 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, + 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, + 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, + 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC, + 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, + 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, + 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, + 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, + 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, + 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982, + 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, + 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, + 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, + 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, + 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, + 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F, + 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, + 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, + 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, + 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, + 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, + 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F, + 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, + 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, + 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, + 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, + 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, + 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E, + 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, + 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351 +}; + +u_int32_t +sctp_crc32c(void *packet, u_int32_t len) +{ + u_int32_t i, crc32c; + u_int8_t byte0, byte1, byte2, byte3; + u_int8_t *buf = (u_int8_t *)packet; + + crc32c = ~0; + for (i = 0; i < len; i++) + CRC32C(crc32c, buf[i]); + crc32c = ~crc32c; + byte0 = crc32c & 0xff; + byte1 = (crc32c>>8) & 0xff; + byte2 = (crc32c>>16) & 0xff; + byte3 = (crc32c>>24) & 0xff; + crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); + return htonl(crc32c); +} + +u_int16_t +in_cksum(u_int16_t *addr, int len) +{ + int nleft = len; + u_int16_t *w = addr; + u_int16_t answer; + int sum = 0; + + /* + * Our algorithm is simple, using a 32 bit accumulator (sum), + * we add sequential 16 bit words to it, and at the end, fold + * back all the carry bits from the top 16 bits into the lower + * 16 bits. + */ + while (nleft > 1) { + sum += *w++; + nleft -= 2; + } + + /* mop up an odd byte, if necessary */ + if (nleft == 1) + sum += *(u_char *)w; + + /* + * add back carry outs from top 16 bits to low 16 bits + */ + sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ + sum += (sum >> 16); /* add carry */ + answer = ~sum; /* truncate to 16 bits */ + return (answer); +} + +u_int16_t +tcp_chksum(struct sockaddr_in6 *src, struct sockaddr_in6 *dst, + void *payload, u_int32_t len) +{ + struct { + struct in6_addr src; + struct in6_addr dst; + u_int32_t len; + u_int8_t zero[3]; + u_int8_t next; + } pseudo_hdr; + u_int16_t sum[2]; + + pseudo_hdr.src = src->sin6_addr; + pseudo_hdr.dst = dst->sin6_addr; + pseudo_hdr.len = htonl(len); + pseudo_hdr.zero[0] = 0; + pseudo_hdr.zero[1] = 0; + pseudo_hdr.zero[2] = 0; + pseudo_hdr.next = IPPROTO_TCP; + + sum[1] = in_cksum((u_int16_t *)&pseudo_hdr, sizeof(pseudo_hdr)); + sum[0] = in_cksum(payload, len); + + return (~in_cksum(sum, sizeof(sum))); +} + void usage(void) { fprintf(stderr, -"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n" +"usage: traceroute6 [-adIlnNrSTUv] [-A as_server] [-f firsthop] [-g gateway]\n" " [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n" " [datalen]\n"); exit(1); From owner-svn-src-all@freebsd.org Sat Apr 7 19:23:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90CAFFA0B37; Sat, 7 Apr 2018 19:23:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4373B7CFC7; Sat, 7 Apr 2018 19:23:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E78A25027; Sat, 7 Apr 2018 19:23:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JNqwo057337; Sat, 7 Apr 2018 19:23:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JNqpM057336; Sat, 7 Apr 2018 19:23:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071923.w37JNqpM057336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332207 - stable/11/usr.sbin/traceroute6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.sbin/traceroute6 X-SVN-Commit-Revision: 332207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:23:52 -0000 Author: tuexen Date: Sat Apr 7 19:23:51 2018 New Revision: 332207 URL: https://svnweb.freebsd.org/changeset/base/332207 Log: MFC r324122: Fix reporting of probing size. This bug was introduced in r324119. Modified: stable/11/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 19:22:32 2018 (r332206) +++ stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 19:23:51 2018 (r332207) @@ -904,7 +904,8 @@ main(int argc, char *argv[]) if (source) fprintf(stderr, " from %s", source); fprintf(stderr, ", %lu hops max, %lu byte packets\n", - max_hops, datalen); + max_hops, + datalen + ((useproto == IPPROTO_UDP) ? sizeof(struct udphdr) : 0)); (void) fflush(stderr); if (first_hop > 1) From owner-svn-src-all@freebsd.org Sat Apr 7 19:29:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F1E5FA1072; Sat, 7 Apr 2018 19:29:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 036877FEEF; Sat, 7 Apr 2018 19:29:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F101325029; Sat, 7 Apr 2018 19:29:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JTJw2057572; Sat, 7 Apr 2018 19:29:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JTJ3R057571; Sat, 7 Apr 2018 19:29:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804071929.w37JTJ3R057571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 7 Apr 2018 19:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332208 - head/sys/modules/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/modules/cam X-SVN-Commit-Revision: 332208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:29:20 -0000 Author: imp Date: Sat Apr 7 19:29:19 2018 New Revision: 332208 URL: https://svnweb.freebsd.org/changeset/base/332208 Log: Add nvme_util.c to cam.ko. cam.ko can't load onto the kernel w/o nvme in the kernel. Add nvme_util.c to cam.ko. Noticed by: kib@ Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Sat Apr 7 19:23:51 2018 (r332207) +++ head/sys/modules/cam/Makefile Sat Apr 7 19:29:19 2018 (r332208) @@ -2,7 +2,7 @@ S= ${SRCTOP}/sys -.PATH: $S/cam $S/cam/scsi $S/cam/ata $S/cam/nvme $S/${MACHINE}/${MACHINE} +.PATH: $S/cam $S/cam/scsi $S/cam/ata $S/cam/nvme $S/dev/nvme $S/${MACHINE}/${MACHINE} KMOD= cam @@ -46,6 +46,7 @@ SRCS+= ata_pmp.c SRCS+= nvme_all.c SRCS+= nvme_xpt.c SRCS+= nvme_da.c +SRCS+= nvme_util.c EXPORT_SYMS= YES # XXX evaluate From owner-svn-src-all@freebsd.org Sat Apr 7 19:38:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5ED4FA1B0D; Sat, 7 Apr 2018 19:38:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50EF4854D6; Sat, 7 Apr 2018 19:38:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49998251C7; Sat, 7 Apr 2018 19:38:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JcuS6062485; Sat, 7 Apr 2018 19:38:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Jcu6e062483; Sat, 7 Apr 2018 19:38:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071938.w37Jcu6e062483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332209 - in stable/11: sbin/ipfw sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/netpfil/ipfw X-SVN-Commit-Revision: 332209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:38:56 -0000 Author: tuexen Date: Sat Apr 7 19:38:55 2018 New Revision: 332209 URL: https://svnweb.freebsd.org/changeset/base/332209 Log: MFC r324216: Fix a bug which avoided that rules for matching port numbers for SCTP packets where actually matched. While there, make clean in the man-page that SCTP port numbers are supported in rules. Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Sat Apr 7 19:29:19 2018 (r332208) +++ stable/11/sbin/ipfw/ipfw.8 Sat Apr 7 19:38:55 2018 (r332209) @@ -537,7 +537,7 @@ for filtering packets, among the following: .It Layer-2 header fields When available .It IPv4 and IPv6 Protocol -TCP, UDP, ICMP, etc. +SCTP, TCP, UDP, ICMP, etc. .It Source and dest. addresses and ports .It Direction See Section @@ -1396,7 +1396,7 @@ error-prone. No support for sets of IPv6 addresses is provided because IPv6 addresses are typically random past the initial prefix. .It Ar ports : Bro Ar port | port Ns \&- Ns Ar port Ns Brc Ns Op , Ns Ar ports -For protocols which support port numbers (such as TCP and UDP), optional +For protocols which support port numbers (such as SCTP, TCP and UDP), optional .Cm ports may be specified as one or more ports or port ranges, separated by commas but no spaces, and an optional Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Sat Apr 7 19:29:19 2018 (r332208) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Sat Apr 7 19:38:55 2018 (r332209) @@ -1847,7 +1847,8 @@ do { \ */ if ((proto == IPPROTO_UDP || proto == IPPROTO_UDPLITE || - proto == IPPROTO_TCP) && offset == 0) { + proto == IPPROTO_TCP || + proto==IPPROTO_SCTP) && offset == 0) { u_int16_t x = (cmd->opcode == O_IP_SRCPORT) ? src_port : dst_port ; From owner-svn-src-all@freebsd.org Sat Apr 7 19:40:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7192EFA1F2B; Sat, 7 Apr 2018 19:40:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2537386738; Sat, 7 Apr 2018 19:40:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DA0F252D5; Sat, 7 Apr 2018 19:40:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Jemco062630; Sat, 7 Apr 2018 19:40:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JembX062629; Sat, 7 Apr 2018 19:40:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071940.w37JembX062629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332210 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 332210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:40:49 -0000 Author: tuexen Date: Sat Apr 7 19:40:48 2018 New Revision: 332210 URL: https://svnweb.freebsd.org/changeset/base/332210 Log: MFC r324218: Whitespace changes: Remove leading spaces followed by a tab. Modified: stable/11/sbin/ipfw/ipfw2.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.h ============================================================================== --- stable/11/sbin/ipfw/ipfw2.h Sat Apr 7 19:38:55 2018 (r332209) +++ stable/11/sbin/ipfw/ipfw2.h Sat Apr 7 19:40:48 2018 (r332210) @@ -205,14 +205,14 @@ enum tokens { TOK_IP, TOK_IF, - TOK_ALOG, - TOK_DENY_INC, - TOK_SAME_PORTS, - TOK_UNREG_ONLY, + TOK_ALOG, + TOK_DENY_INC, + TOK_SAME_PORTS, + TOK_UNREG_ONLY, TOK_SKIP_GLOBAL, - TOK_RESET_ADDR, - TOK_ALIAS_REV, - TOK_PROXY_ONLY, + TOK_RESET_ADDR, + TOK_ALIAS_REV, + TOK_PROXY_ONLY, TOK_REDIR_ADDR, TOK_REDIR_PORT, TOK_REDIR_PROTO, From owner-svn-src-all@freebsd.org Sat Apr 7 19:42:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844A7FA215A; Sat, 7 Apr 2018 19:42:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3349987B9B; Sat, 7 Apr 2018 19:42:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E3EA25359; Sat, 7 Apr 2018 19:42:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Jgsli067110; Sat, 7 Apr 2018 19:42:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Jgs4m067109; Sat, 7 Apr 2018 19:42:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071942.w37Jgs4m067109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332211 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:42:54 -0000 Author: tuexen Date: Sat Apr 7 19:42:53 2018 New Revision: 332211 URL: https://svnweb.freebsd.org/changeset/base/332211 Log: MFC r324317: Ensure that the accept ABORT chunks with the T-bit set only the a non-zero matching peer tag is provided. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:40:48 2018 (r332210) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:42:53 2018 (r332211) @@ -4676,6 +4676,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) && (vtag_in == asoc->my_vtag)) || (((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) && + (asoc->peer_vtag != htonl(0)) && (vtag_in == asoc->peer_vtag))) { /* this is valid */ } else { From owner-svn-src-all@freebsd.org Sat Apr 7 19:44:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A55C8FA2329; Sat, 7 Apr 2018 19:44:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37CC968BA8; Sat, 7 Apr 2018 19:44:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 314912535B; Sat, 7 Apr 2018 19:44:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Jig6i067251; Sat, 7 Apr 2018 19:44:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JifIa067245; Sat, 7 Apr 2018 19:44:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071944.w37JifIa067245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332212 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:44:42 -0000 Author: tuexen Date: Sat Apr 7 19:44:41 2018 New Revision: 332212 URL: https://svnweb.freebsd.org/changeset/base/332212 Log: MFC r324615: Code cleanup, not functional change. This avoids taking a pointer of a packed structure which allows simpler compilation of the userland stack. Modified: stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctputil.c stable/11/sys/netinet/sctputil.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sat Apr 7 19:42:53 2018 (r332211) +++ stable/11/sys/netinet/sctp_constants.h Sat Apr 7 19:44:41 2018 (r332212) @@ -97,10 +97,6 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_DEFAULT_VRF_SIZE 4 -/* constants for rto calc */ -#define sctp_align_safe_nocopy 0 -#define sctp_align_unsafe_makecopy 1 - /* JRS - Values defined for the HTCP algorithm */ #define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ #define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:42:53 2018 (r332211) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:44:41 2018 (r332212) @@ -3058,7 +3058,6 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru &stcb->asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); *rto_ok = 0; } @@ -4030,7 +4029,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); rto_ok = 0; } @@ -4636,7 +4634,6 @@ hopeless_peer: sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); rto_ok = 0; } Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:42:53 2018 (r332211) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:44:41 2018 (r332212) @@ -519,7 +519,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, + net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -641,7 +641,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk tv.tv_sec = cp->heartbeat.hb_info.time_value_1; tv.tv_usec = cp->heartbeat.hb_info.time_value_2; /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, + r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, SCTP_RTT_FROM_NON_DATA); if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; @@ -1489,6 +1489,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle struct sctp_init_ack_chunk *initack_cp, initack_buf; struct sctp_nets *net; struct mbuf *op_err; + struct timeval old; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1650,10 +1651,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle * since we did not send a HB make sure we don't * double things */ + old.tv_sec = cookie->time_entered.tv_sec; + old.tv_usec = cookie->time_entered.tv_usec; net->hb_responded = 1; net->RTO = sctp_calculate_rto(stcb, asoc, net, - &cookie->time_entered, - sctp_align_unsafe_makecopy, + &old, SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && @@ -2370,10 +2372,13 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); if ((netp != NULL) && (*netp != NULL)) { + struct timeval old; + /* calculate the RTT and set the encaps port */ + old.tv_sec = cookie->time_entered.tv_sec; + old.tv_usec = cookie->time_entered.tv_usec; (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_RTT_FROM_NON_DATA); + &old, SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2939,7 +2944,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, sctp_align_safe_nocopy, + &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 19:42:53 2018 (r332211) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 19:44:41 2018 (r332212) @@ -5501,6 +5501,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct struct sctp_paramhdr *ph; union sctp_sockstore *over_addr; struct sctp_scoping scp; + struct timeval now; #ifdef INET struct sockaddr_in *dst4 = (struct sockaddr_in *)dst; struct sockaddr_in *src4 = (struct sockaddr_in *)src; @@ -5601,7 +5602,9 @@ do_a_abort: memset(&stc, 0, sizeof(struct sctp_state_cookie)); /* the time I built cookie */ - (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&now); + stc.time_entered.tv_sec = now.tv_sec; + stc.time_entered.tv_usec = now.tv_usec; /* populate any tie tags */ if (asoc != NULL) { Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 19:42:53 2018 (r332211) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 19:44:41 2018 (r332212) @@ -2422,8 +2422,8 @@ uint32_t sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, - struct timeval *told, - int safe, int rtt_from_sack) + struct timeval *old, + int rtt_from_sack) { /*- * given an association and the starting time of the current RTT @@ -2432,19 +2432,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb, int32_t rtt; /* RTT in ms */ uint32_t new_rto; int first_measure = 0; - struct timeval now, then, *old; + struct timeval now; - /* Copy it out for sparc64 */ - if (safe == sctp_align_unsafe_makecopy) { - old = &then; - memcpy(&then, told, sizeof(struct timeval)); - } else if (safe == sctp_align_safe_nocopy) { - old = told; - } else { - /* error */ - SCTP_PRINTF("Huh, bad rto calc call\n"); - return (0); - } /************************/ /* 1. calculate new RTT */ /************************/ Modified: stable/11/sys/netinet/sctputil.h ============================================================================== --- stable/11/sys/netinet/sctputil.h Sat Apr 7 19:42:53 2018 (r332211) +++ stable/11/sys/netinet/sctputil.h Sat Apr 7 19:44:41 2018 (r332212) @@ -135,7 +135,7 @@ void uint32_t sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, - struct sctp_nets *, struct timeval *, int, int); + struct sctp_nets *, struct timeval *, int); uint32_t sctp_calculate_len(struct mbuf *); From owner-svn-src-all@freebsd.org Sat Apr 7 19:56:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B01FA2FA4; Sat, 7 Apr 2018 19:56:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D92D66F614; Sat, 7 Apr 2018 19:56:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3E6C2550B; Sat, 7 Apr 2018 19:56:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JuYHD072212; Sat, 7 Apr 2018 19:56:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JuYo2072211; Sat, 7 Apr 2018 19:56:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071956.w37JuYo2072211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332213 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:56:35 -0000 Author: tuexen Date: Sat Apr 7 19:56:34 2018 New Revision: 332213 URL: https://svnweb.freebsd.org/changeset/base/332213 Log: MFC r324638: Fix the handling of parital and too short chunks. Ensure that the current behaviour is consistent: stop processing of the chunk, but finish the processing of the previous chunks. This behaviour might be changed in a later commit to ABORT the assoication due to a protocol violation, but changing this is a separate issue. MFC r324725 Fix a bug introduced in r324638. Thanks to Felix Weinrank for making me aware of this. MFC r324726: Revert change which got in accidently. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:44:41 2018 (r332212) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:56:34 2018 (r332213) @@ -4521,7 +4521,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * * until we get into jumbo grams and such.. */ uint8_t chunk_buf[SCTP_CHUNK_BUFFER_SIZE]; - struct sctp_tcb *locked_tcb = stcb; int got_auth = 0; uint32_t auth_offset = 0, auth_len = 0; int auth_skipped = 0; @@ -4533,31 +4532,29 @@ sctp_process_control(struct mbuf *m, int iphlen, int * SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_control: iphlen=%u, offset=%u, length=%u stcb:%p\n", iphlen, *offset, length, (void *)stcb); + if (stcb) { + SCTP_TCB_LOCK_ASSERT(stcb); + } /* validate chunk header length... */ if (ntohs(ch->chunk_length) < sizeof(*ch)) { SCTPDBG(SCTP_DEBUG_INPUT1, "Invalid header length %d\n", ntohs(ch->chunk_length)); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + *offset = length; + return (stcb); } /* * validate the verification tag */ vtag_in = ntohl(sh->v_tag); - if (locked_tcb) { - SCTP_TCB_LOCK_ASSERT(locked_tcb); - } if (ch->chunk_type == SCTP_INITIATION) { SCTPDBG(SCTP_DEBUG_INPUT1, "Its an INIT of len:%d vtag:%x\n", ntohs(ch->chunk_length), vtag_in); if (vtag_in != 0) { /* protocol error- silently discard... */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4580,9 +4577,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (*offset >= length) { /* no more data left in the mbuf chain */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, @@ -4591,10 +4585,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (ch == NULL) { /* Help */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if (ch->chunk_type == SCTP_COOKIE_ECHO) { goto process_control_chunks; @@ -4631,10 +4622,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * * sctp_findassociation_ep_asconf(). */ SCTP_INP_DECR_REF(inp); - } else { - locked_tcb = stcb; } - /* now go back and verify any auth chunk to be sure */ if (auth_skipped && (stcb != NULL)) { struct sctp_auth_chunk *auth; @@ -4648,10 +4636,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * auth_offset)) { /* auth HMAC failed so dump it */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } else { /* remaining chunks are HMAC checked */ stcb->asoc.authenticated = 1; @@ -4667,9 +4652,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * mflowtype, mflowid, inp->fibnum, vrf_id, port); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } asoc = &stcb->asoc; @@ -4687,8 +4669,8 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } else { /* drop this packet... */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4701,8 +4683,8 @@ sctp_process_control(struct mbuf *m, int iphlen, int * * but it won't complete until the shutdown * is completed */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), @@ -4721,8 +4703,8 @@ sctp_process_control(struct mbuf *m, int iphlen, int * "invalid vtag: %xh, expect %xh\n", vtag_in, asoc->my_vtag); SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } *offset = length; return (NULL); @@ -4758,10 +4740,7 @@ process_control_chunks: if (chk_length < sizeof(*ch) || (*offset + (int)chk_length) > length) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } SCTP_STAT_INCR_COUNTER64(sctps_incontrolchunks); /* @@ -4776,8 +4755,8 @@ process_control_chunks: sizeof(struct sctp_init_ack_chunk), chunk_buf); if (ch == NULL) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4799,8 +4778,8 @@ process_control_chunks: chunk_buf); if (ch == NULL) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4811,8 +4790,8 @@ process_control_chunks: if (ch == NULL) { SCTP_PRINTF("sctp_process_control: Can't get the all data....\n"); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4852,8 +4831,8 @@ process_control_chunks: (length - *offset > (int)SCTP_SIZE32(chk_length))) { /* RFC 4960 requires that no ABORT is sent */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4873,8 +4852,8 @@ process_control_chunks: mflowtype, mflowid, vrf_id, port); *offset = length; - if ((!abort_no_unlock) && (locked_tcb)) { - SCTP_TCB_UNLOCK(locked_tcb); + if ((!abort_no_unlock) && (stcb != NULL)) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); break; @@ -4884,15 +4863,14 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ - if ((stcb) && (stcb->asoc.total_output_queue_size)) { + if ((stcb != NULL) && (stcb->asoc.total_output_queue_size)) { ; } else { - if ((locked_tcb != NULL) && (locked_tcb != stcb)) { - /* Very unlikely */ - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } *offset = length; - if (stcb) { + if (stcb != NULL) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -4914,10 +4892,7 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if ((netp) && (*netp)) { ret = sctp_handle_init_ack(m, iphlen, *offset, @@ -4941,10 +4916,7 @@ process_control_chunks: if ((stcb != NULL) && (ret == 0)) { sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); break; case SCTP_SELECTIVE_ACK: { @@ -5136,10 +5108,7 @@ process_control_chunks: if ((stcb == NULL) || (chk_length != sizeof(struct sctp_heartbeat_chunk))) { /* Its not ours */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } /* He's alive so give him credit */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { @@ -5169,10 +5138,7 @@ process_control_chunks: (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if (netp && *netp) { int abort_flag = 0; @@ -5209,7 +5175,7 @@ process_control_chunks: if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ abend: - if (stcb) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } *offset = length; @@ -5254,6 +5220,9 @@ process_control_chunks: } } if (netp) { + struct sctp_tcb *locked_stcb; + + locked_stcb = stcb; ret_buf = sctp_handle_cookie_echo(m, iphlen, *offset, @@ -5264,11 +5233,17 @@ process_control_chunks: auth_skipped, auth_offset, auth_len, - &locked_tcb, + &locked_stcb, mflowtype, mflowid, vrf_id, port); + if ((locked_stcb != NULL) && (locked_stcb != stcb)) { + SCTP_TCB_UNLOCK(locked_stcb); + } + if (stcb != NULL) { + SCTP_TCB_LOCK_ASSERT(stcb); + } } else { ret_buf = NULL; } @@ -5276,8 +5251,8 @@ process_control_chunks: SCTP_ASOC_CREATE_UNLOCK(linp); } if (ret_buf == NULL) { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } SCTPDBG(SCTP_DEBUG_INPUT3, "GAK, null buffer\n"); @@ -5304,10 +5279,7 @@ process_control_chunks: case SCTP_COOKIE_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -5349,11 +5321,8 @@ process_control_chunks: /* He's alive so give him credit */ if ((stcb == NULL) || (chk_length != sizeof(struct sctp_ecne_chunk))) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (stcb) { if (stcb->asoc.ecn_supported == 0) { @@ -5376,12 +5345,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN-CWR\n"); /* He's alive so give him credit */ if ((stcb == NULL) || (chk_length != sizeof(struct sctp_cwr_chunk))) { - /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (stcb) { if (stcb->asoc.ecn_supported == 0) { @@ -5404,10 +5369,7 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if ((stcb) && netp && *netp) { sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, @@ -5440,11 +5402,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF-ACK\n"); if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if ((stcb) && netp && *netp) { if (stcb->asoc.asconf_supported == 0) { @@ -5470,11 +5429,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_FWD-TSN\n"); if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } /* He's alive so give him credit */ if (stcb) { @@ -5537,11 +5493,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_STREAM_RESET\n"); if (((stcb == NULL) || (ch == NULL) || (chk_length < sizeof(struct sctp_stream_reset_tsn_req)))) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (stcb->asoc.reconfig_supported == 0) { goto unknown_chunk; @@ -5557,11 +5510,8 @@ process_control_chunks: /* re-get it all please */ if (chk_length < sizeof(struct sctp_pktdrop_chunk)) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (ch && (stcb) && netp && (*netp)) { if (stcb->asoc.pktdrop_supported == 0) { @@ -5570,7 +5520,6 @@ process_control_chunks: sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, min(chk_length, (sizeof(chunk_buf) - 4))); - } break; case SCTP_AUTHENTICATION: @@ -5592,11 +5541,8 @@ process_control_chunks: (chk_length > (sizeof(struct sctp_auth_chunk) + SCTP_AUTH_DIGEST_LEN_MAX))) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (got_auth == 1) { /* skip this chunk... it's already auth'd */ @@ -5661,11 +5607,8 @@ next_chunk: ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, sizeof(struct sctp_chunkhdr), chunk_buf); if (ch == NULL) { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } } /* while */ From owner-svn-src-all@freebsd.org Sat Apr 7 19:58:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0399BF801B6; Sat, 7 Apr 2018 19:58:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A391370576; Sat, 7 Apr 2018 19:58:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 809442550C; Sat, 7 Apr 2018 19:58:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37JwERW072330; Sat, 7 Apr 2018 19:58:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37JwERH072329; Sat, 7 Apr 2018 19:58:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071958.w37JwERH072329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332214 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:58:15 -0000 Author: tuexen Date: Sat Apr 7 19:58:14 2018 New Revision: 332214 URL: https://svnweb.freebsd.org/changeset/base/332214 Log: MFC r324729: Abort an SCTP association, when a DATA chunk is followed by an unknown chunk with a length smaller than the minimum length. Thanks to Felix Weinrank for making me aware of the problem. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:56:34 2018 (r332213) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:58:14 2018 (r332214) @@ -2696,7 +2696,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o } /* get pointer to the first chunk header */ ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_chunkhdr), (uint8_t *)&chunk_buf); + sizeof(struct sctp_chunkhdr), + (uint8_t *)&chunk_buf); if (ch == NULL) { return (1); } @@ -2753,7 +2754,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk of length %d", + snprintf(msg, sizeof(msg), "%s chunk of length %d", + ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; @@ -2830,7 +2832,25 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o return (2); } default: - /* unknown chunk type, use bit rules */ + /* + * Unknown chunk type: use bit rules after + * checking length + */ + if (chk_length < sizeof(struct sctp_chunkhdr)) { + /* + * Need to send an abort since we + * had a invalid chunk. + */ + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; + + snprintf(msg, sizeof(msg), "Chunk of length %d", + chk_length); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); + return (2); + } if (ch->chunk_type & 0x40) { /* Add a error report to the queue */ struct mbuf *op_err; @@ -2866,7 +2886,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o continue; } ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_chunkhdr), (uint8_t *)&chunk_buf); + sizeof(struct sctp_chunkhdr), + (uint8_t *)&chunk_buf); if (ch == NULL) { *offset = length; stop_proc = 1; From owner-svn-src-all@freebsd.org Sat Apr 7 19:59:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84473F80401; Sat, 7 Apr 2018 19:59:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3394C712BB; Sat, 7 Apr 2018 19:59:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A40B2550E; Sat, 7 Apr 2018 19:59:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Jxe9d072436; Sat, 7 Apr 2018 19:59:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Jxe5C072435; Sat, 7 Apr 2018 19:59:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804071959.w37Jxe5C072435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 19:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332215 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 19:59:41 -0000 Author: tuexen Date: Sat Apr 7 19:59:40 2018 New Revision: 332215 URL: https://svnweb.freebsd.org/changeset/base/332215 Log: MFC r324730: Fix a signed/unsigned warning. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:58:14 2018 (r332214) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 19:59:40 2018 (r332215) @@ -2641,10 +2641,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct sctp_association *asoc; int num_chunks = 0; /* number of control chunks processed */ int stop_proc = 0; - int chk_length, break_flag, last_chunk; + int break_flag, last_chunk; int abort_flag = 0, was_a_gap; struct mbuf *m; uint32_t highest_tsn; + uint16_t chk_length; /* set the rwnd */ sctp_set_rwnd(stcb, &stcb->asoc); @@ -2739,7 +2740,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o } if ((ch->chunk_type == SCTP_DATA) || (ch->chunk_type == SCTP_IDATA)) { - int clen; + uint16_t clen; if (ch->chunk_type == SCTP_DATA) { clen = sizeof(struct sctp_data_chunk); @@ -2754,7 +2755,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s chunk of length %d", + snprintf(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); @@ -2844,7 +2845,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "Chunk of length %d", + snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; From owner-svn-src-all@freebsd.org Sat Apr 7 20:00:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBCAEF806CE; Sat, 7 Apr 2018 20:00:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD1971EE6; Sat, 7 Apr 2018 20:00:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76A5125531; Sat, 7 Apr 2018 20:00:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K0wHH074962; Sat, 7 Apr 2018 20:00:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K0whH074961; Sat, 7 Apr 2018 20:00:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072000.w37K0whH074961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332216 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:00:59 -0000 Author: tuexen Date: Sat Apr 7 20:00:58 2018 New Revision: 332216 URL: https://svnweb.freebsd.org/changeset/base/332216 Log: MFC r324954: Fix a locking issue found by running AFL on the userland stack. Thanks to Felix Weinrank for reporting the issue. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 19:59:40 2018 (r332215) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:00:58 2018 (r332216) @@ -4866,9 +4866,6 @@ process_control_chunks: if ((stcb != NULL) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } *offset = length; if (stcb != NULL) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) From owner-svn-src-all@freebsd.org Sat Apr 7 20:02:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC70AF80824; Sat, 7 Apr 2018 20:02:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9486972AFB; Sat, 7 Apr 2018 20:02:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7399F2558B; Sat, 7 Apr 2018 20:02:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K28wF077656; Sat, 7 Apr 2018 20:02:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K28FM077655; Sat, 7 Apr 2018 20:02:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072002.w37K28FM077655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332217 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:02:09 -0000 Author: tuexen Date: Sat Apr 7 20:02:08 2018 New Revision: 332217 URL: https://svnweb.freebsd.org/changeset/base/332217 Log: MFC r324958: Fix a bug in handling special ABORT chunks. Thanks to Felix Weinrank for finding this issue using libfuzzer with the userland stack. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:00:58 2018 (r332216) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:02:08 2018 (r332217) @@ -765,7 +765,8 @@ sctp_handle_nat_missing_state(struct sctp_tcb *stcb, } -static void +/* Returns 1 if the stcb was aborted, 0 otherwise */ +static int sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -777,29 +778,29 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: handling ABORT\n"); if (stcb == NULL) - return; + return (0); len = ntohs(abort->ch.chunk_length); - if (len > sizeof(struct sctp_chunkhdr)) { + if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_error_cause)) { /* * Need to check the cause codes for our two magic nat * aborts which don't kill the assoc necessarily. */ - struct sctp_gen_error_cause *cause; + struct sctp_error_cause *cause; - cause = (struct sctp_gen_error_cause *)(abort + 1); + cause = (struct sctp_error_cause *)(abort + 1); error = ntohs(cause->code); if (error == SCTP_CAUSE_NAT_COLLIDING_STATE) { SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags:%x\n", abort->ch.chunk_flags); if (sctp_handle_nat_colliding_state(stcb)) { - return; + return (0); } } else if (error == SCTP_CAUSE_NAT_MISSING_STATE) { SCTPDBG(SCTP_DEBUG_INPUT2, "Received missing state abort flags:%x\n", abort->ch.chunk_flags); if (sctp_handle_nat_missing_state(stcb, net)) { - return; + return (0); } } } else { @@ -834,6 +835,7 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, SCTP_SOCKET_UNLOCK(so, 1); #endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); + return (1); } static void @@ -5124,11 +5126,16 @@ process_control_chunks: case SCTP_ABORT_ASSOCIATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ABORT, stcb %p\n", (void *)stcb); - if ((stcb) && netp && *netp) - sctp_handle_abort((struct sctp_abort_chunk *)ch, - stcb, *netp); *offset = length; - return (NULL); + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { + if (sctp_handle_abort((struct sctp_abort_chunk *)ch, stcb, *netp)) { + return (NULL); + } else { + return (stcb); + } + } else { + return (NULL); + } break; case SCTP_SHUTDOWN: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN, stcb %p\n", From owner-svn-src-all@freebsd.org Sat Apr 7 20:03:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3838F809C6; Sat, 7 Apr 2018 20:03:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86DFF737E3; Sat, 7 Apr 2018 20:03:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81AF4256A2; Sat, 7 Apr 2018 20:03:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K3ZnC077755; Sat, 7 Apr 2018 20:03:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K3ZWx077754; Sat, 7 Apr 2018 20:03:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072003.w37K3ZWx077754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332218 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:03:36 -0000 Author: tuexen Date: Sat Apr 7 20:03:35 2018 New Revision: 332218 URL: https://svnweb.freebsd.org/changeset/base/332218 Log: MFC r324971: Fix a bug reported by Felix Weinrank using the libfuzzer on the userland stack. Modified: stable/11/sys/netinet/sctp_auth.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Sat Apr 7 20:02:08 2018 (r332217) +++ stable/11/sys/netinet/sctp_auth.c Sat Apr 7 20:03:35 2018 (r332218) @@ -1606,9 +1606,9 @@ sctp_zero_m(struct mbuf *m, uint32_t m_offset, uint32_ /* now use the rest of the mbuf chain */ while ((m_tmp != NULL) && (size > 0)) { data = mtod(m_tmp, uint8_t *)+m_offset; - if (size > (uint32_t)SCTP_BUF_LEN(m_tmp)) { - memset(data, 0, SCTP_BUF_LEN(m_tmp)); - size -= SCTP_BUF_LEN(m_tmp); + if (size > (uint32_t)(SCTP_BUF_LEN(m_tmp) - m_offset)) { + memset(data, 0, SCTP_BUF_LEN(m_tmp) - m_offset); + size -= SCTP_BUF_LEN(m_tmp) - m_offset; } else { memset(data, 0, size); size = 0; From owner-svn-src-all@freebsd.org Sat Apr 7 20:04:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76DB2F80A52; Sat, 7 Apr 2018 20:04:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A601873C83; Sat, 7 Apr 2018 20:04:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F4CE256A3; Sat, 7 Apr 2018 20:04:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K435G077812; Sat, 7 Apr 2018 20:04:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K43Nr077811; Sat, 7 Apr 2018 20:04:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072004.w37K43Nr077811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 20:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332219 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:04:06 -0000 Author: ian Date: Sat Apr 7 20:04:03 2018 New Revision: 332219 URL: https://svnweb.freebsd.org/changeset/base/332219 Log: Remove the existing identify() hack to force-add a spigen device on FDT-based systems, and instead add proper FDT probe code. Because this driver is freebsd-specific and just provides generic userland access to run spibus transactions, there is no bindings document to mandate a compatible string, so just arbitrarily use "freebsd,spigen". Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Sat Apr 7 20:03:35 2018 (r332218) +++ head/sys/dev/spibus/spigen.c Sat Apr 7 20:04:03 2018 (r332219) @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FDT +#include +#endif + #include "spibus_if.h" #define SPIGEN_OPEN (1 << 0) @@ -70,24 +74,24 @@ struct spigen_softc { int sc_flags; }; -#ifdef FDT -static void -spigen_identify(driver_t *driver, device_t parent) -{ - if (device_find_child(parent, "spigen", -1) != NULL) - return; - if (BUS_ADD_CHILD(parent, 0, "spigen", -1) == NULL) - device_printf(parent, "add child failed\n"); -} -#endif - static int spigen_probe(device_t dev) { + int rv; +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "freebsd,spigen")) + return (ENXIO); + rv = BUS_PROBE_DEFAULT; +#else + rv = BUS_PROBE_NOWILDCARD; +#endif device_set_desc(dev, "SPI Generic IO"); - return (BUS_PROBE_NOWILDCARD); + return (rv); } static int spigen_open(struct cdev *, int, int, struct thread *); @@ -439,9 +443,6 @@ static devclass_t spigen_devclass; static device_method_t spigen_methods[] = { /* Device interface */ -#ifdef FDT - DEVMETHOD(device_identify, spigen_identify), -#endif DEVMETHOD(device_probe, spigen_probe), DEVMETHOD(device_attach, spigen_attach), DEVMETHOD(device_detach, spigen_detach), From owner-svn-src-all@freebsd.org Sat Apr 7 20:05:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE50F80C50; Sat, 7 Apr 2018 20:05:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB33F749BD; Sat, 7 Apr 2018 20:05:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADFE9256A5; Sat, 7 Apr 2018 20:05:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K5POA077916; Sat, 7 Apr 2018 20:05:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K5PLI077915; Sat, 7 Apr 2018 20:05:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072005.w37K5PLI077915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332220 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:05:26 -0000 Author: tuexen Date: Sat Apr 7 20:05:25 2018 New Revision: 332220 URL: https://svnweb.freebsd.org/changeset/base/332220 Log: MFC r325046: Fix parsing error when processing cmsg in SCTP send calls. The bug is related to a signed/unsigned mismatch. This should most likely fix the issue in sctp_sosend reported by Dmitry Vyukov on the freebsd-hackers mailing list and found by running syzkaller. Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:04:03 2018 (r332219) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:05:25 2018 (r332220) @@ -3465,32 +3465,35 @@ static int sctp_find_cmsg(int c_type, void *data, struct mbuf *control, size_t cpsize) { struct cmsghdr cmh; - int tlen, at, found; struct sctp_sndinfo sndinfo; struct sctp_prinfo prinfo; struct sctp_authinfo authinfo; + int tot_len, rem_len, cmsg_data_len, cmsg_data_off, off; + int found; - tlen = SCTP_BUF_LEN(control); - at = 0; - found = 0; /* * Independent of how many mbufs, find the c_type inside the control * structure and copy out the data. */ - while (at < tlen) { - if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + found = 0; + tot_len = SCTP_BUF_LEN(control); + for (off = 0; off < tot_len; off += CMSG_ALIGN(cmh.cmsg_len)) { + rem_len = tot_len - off; + if (rem_len < (int)CMSG_ALIGN(sizeof(cmh))) { /* There is not enough room for one more. */ return (found); } - m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + m_copydata(control, off, sizeof(cmh), (caddr_t)&cmh); if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ return (found); } - if (((int)cmh.cmsg_len + at) > tlen) { + if ((cmh.cmsg_len > INT_MAX) || ((int)cmh.cmsg_len > rem_len)) { /* We don't have the complete CMSG. */ return (found); } + cmsg_data_len = (int)cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh)); + cmsg_data_off = off + CMSG_ALIGN(sizeof(cmh)); if ((cmh.cmsg_level == IPPROTO_SCTP) && ((c_type == cmh.cmsg_type) || ((c_type == SCTP_SNDRCV) && @@ -3498,11 +3501,14 @@ sctp_find_cmsg(int c_type, void *data, struct mbuf *co (cmh.cmsg_type == SCTP_PRINFO) || (cmh.cmsg_type == SCTP_AUTHINFO))))) { if (c_type == cmh.cmsg_type) { - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < cpsize) { + if (cpsize > INT_MAX) { return (found); } + if (cmsg_data_len < (int)cpsize) { + return (found); + } /* It is exactly what we want. Copy it out. */ - m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), (int)cpsize, (caddr_t)data); + m_copydata(control, cmsg_data_off, (int)cpsize, (caddr_t)data); return (1); } else { struct sctp_sndrcvinfo *sndrcvinfo; @@ -3516,10 +3522,10 @@ sctp_find_cmsg(int c_type, void *data, struct mbuf *co } switch (cmh.cmsg_type) { case SCTP_SNDINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_sndinfo)) { + if (cmsg_data_len < (int)sizeof(struct sctp_sndinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + m_copydata(control, cmsg_data_off, sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); sndrcvinfo->sinfo_stream = sndinfo.snd_sid; sndrcvinfo->sinfo_flags = sndinfo.snd_flags; sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; @@ -3527,10 +3533,10 @@ sctp_find_cmsg(int c_type, void *data, struct mbuf *co sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; break; case SCTP_PRINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_prinfo)) { + if (cmsg_data_len < (int)sizeof(struct sctp_prinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + m_copydata(control, cmsg_data_off, sizeof(struct sctp_prinfo), (caddr_t)&prinfo); if (prinfo.pr_policy != SCTP_PR_SCTP_NONE) { sndrcvinfo->sinfo_timetolive = prinfo.pr_value; } else { @@ -3539,10 +3545,10 @@ sctp_find_cmsg(int c_type, void *data, struct mbuf *co sndrcvinfo->sinfo_flags |= prinfo.pr_policy; break; case SCTP_AUTHINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_authinfo)) { + if (cmsg_data_len < (int)sizeof(struct sctp_authinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + m_copydata(control, cmsg_data_off, sizeof(struct sctp_authinfo), (caddr_t)&authinfo); sndrcvinfo->sinfo_keynumber_valid = 1; sndrcvinfo->sinfo_keynumber = authinfo.auth_keynumber; break; @@ -3552,7 +3558,6 @@ sctp_find_cmsg(int c_type, void *data, struct mbuf *co found = 1; } } - at += CMSG_ALIGN(cmh.cmsg_len); } return (found); } From owner-svn-src-all@freebsd.org Sat Apr 7 20:06:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77ED2F80E54; Sat, 7 Apr 2018 20:06:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA9975712; Sat, 7 Apr 2018 20:06:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21613256A8; Sat, 7 Apr 2018 20:06:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K6pPi078288; Sat, 7 Apr 2018 20:06:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K6pV2078287; Sat, 7 Apr 2018 20:06:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072006.w37K6pV2078287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332221 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:06:51 -0000 Author: tuexen Date: Sat Apr 7 20:06:50 2018 New Revision: 332221 URL: https://svnweb.freebsd.org/changeset/base/332221 Log: MFC r325284: Fix the reporting of the MTU for SCTP sockets when using IPv6. Modified: stable/11/sys/netinet/sctp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 20:05:25 2018 (r332220) +++ stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 20:06:50 2018 (r332221) @@ -2412,7 +2412,7 @@ flags_out: #endif #ifdef INET6 case AF_INET6: - paddrp->spp_pathmtu -= SCTP_MIN_V4_OVERHEAD; + paddrp->spp_pathmtu -= SCTP_MIN_OVERHEAD; break; #endif default: From owner-svn-src-all@freebsd.org Sat Apr 7 20:08:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9013AF80FC6; Sat, 7 Apr 2018 20:08:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ADBB76401; Sat, 7 Apr 2018 20:08:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A52E256A9; Sat, 7 Apr 2018 20:08:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37K8IaH078396; Sat, 7 Apr 2018 20:08:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37K8Hx8078389; Sat, 7 Apr 2018 20:08:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072008.w37K8Hx8078389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332222 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 332222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:08:18 -0000 Author: tuexen Date: Sat Apr 7 20:08:17 2018 New Revision: 332222 URL: https://svnweb.freebsd.org/changeset/base/332222 Log: MFC r325370: Allow the setting of the MTU for future paths using an SCTP socket option. This functionality was missing. Modified: stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_pcb.h stable/11/sys/netinet/sctp_structs.h stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctputil.c stable/11/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:08:17 2018 (r332222) @@ -4273,12 +4273,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, /* free tempy routes */ RO_RTFREE(ro); } else { - /* - * PMTU check versus smallest asoc MTU goes - * here - */ - if ((ro->ro_rt != NULL) && - (net->ro._s_addr)) { + if ((ro->ro_rt != NULL) && (net->ro._s_addr) && + ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0)) { uint32_t mtu; mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); @@ -4635,8 +4631,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } net->src_addr_selected = 0; } - if ((ro->ro_rt != NULL) && - (net->ro._s_addr)) { + if ((ro->ro_rt != NULL) && (net->ro._s_addr) && + ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0)) { uint32_t mtu; mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt); Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet/sctp_pcb.c Sat Apr 7 20:08:17 2018 (r332222) @@ -2577,6 +2577,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); + m->default_mtu = 0; /* Add adaptation cookie */ m->adaptation_layer_indicator = 0; m->adaptation_layer_indicator_provided = 0; @@ -3942,7 +3943,28 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct soc net, 0, stcb->asoc.vrf_id); - if (net->ro._s_addr != NULL) { + if (stcb->asoc.default_mtu > 0) { + net->mtu = stcb->asoc.default_mtu; + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: + net->mtu += SCTP_MIN_V4_OVERHEAD; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu += SCTP_MIN_OVERHEAD; + break; +#endif + default: + break; + } +#if defined(INET) || defined(INET6) + if (net->port) { + net->mtu += (uint32_t)sizeof(struct udphdr); + } +#endif + } else if (net->ro._s_addr != NULL) { uint32_t imtu, rmtu, hcmtu; net->src_addr_selected = 1; @@ -3966,19 +3988,42 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct soc } } if (net->mtu == 0) { - switch (newaddr->sa_family) { + if (stcb->asoc.default_mtu > 0) { + net->mtu = stcb->asoc.default_mtu; + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: - net->mtu = SCTP_DEFAULT_MTU; - break; + case AF_INET: + net->mtu += SCTP_MIN_V4_OVERHEAD; + break; #endif #ifdef INET6 - case AF_INET6: - net->mtu = 1280; - break; + case AF_INET6: + net->mtu += SCTP_MIN_OVERHEAD; + break; #endif - default: - break; + default: + break; + } +#if defined(INET) || defined(INET6) + if (net->port) { + net->mtu += (uint32_t)sizeof(struct udphdr); + } +#endif + } else { + switch (newaddr->sa_family) { +#ifdef INET + case AF_INET: + net->mtu = SCTP_DEFAULT_MTU; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu = 1280; + break; +#endif + default: + break; + } } } #if defined(INET) || defined(INET6) Modified: stable/11/sys/netinet/sctp_pcb.h ============================================================================== --- stable/11/sys/netinet/sctp_pcb.h Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet/sctp_pcb.h Sat Apr 7 20:08:17 2018 (r332222) @@ -287,6 +287,7 @@ struct sctp_pcb { sctp_auth_chklist_t *local_auth_chunks; sctp_hmaclist_t *local_hmacs; uint16_t default_keyid; + uint32_t default_mtu; /* various thresholds */ /* Max times I will init at a guy */ Modified: stable/11/sys/netinet/sctp_structs.h ============================================================================== --- stable/11/sys/netinet/sctp_structs.h Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet/sctp_structs.h Sat Apr 7 20:08:17 2018 (r332222) @@ -1098,6 +1098,7 @@ struct sctp_association { uint32_t chunks_on_out_queue; /* total chunks floating around, * locked by send socket buffer */ uint32_t peers_adaptation; + uint32_t default_mtu; uint16_t peer_hmac_id; /* peer HMAC id to send */ /* Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet/sctp_usrreq.c Sat Apr 7 20:08:17 2018 (r332222) @@ -202,6 +202,10 @@ sctp_notify(struct sctp_inpcb *inp, #endif /* no need to unlock here, since the TCB is gone */ } else if (icmp_code == ICMP_UNREACH_NEEDFRAG) { + if ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0) { + SCTP_TCB_UNLOCK(stcb); + return; + } /* Find the next (smaller) MTU */ if (next_mtu == 0) { /* @@ -2447,7 +2451,7 @@ flags_out: * value */ paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure; - paddrp->spp_pathmtu = 0; + paddrp->spp_pathmtu = stcb->asoc.default_mtu; if (stcb->asoc.default_dscp & 0x01) { paddrp->spp_dscp = stcb->asoc.default_dscp & 0xfc; paddrp->spp_flags |= SPP_DSCP; @@ -2494,8 +2498,7 @@ flags_out: paddrp->spp_flags |= SPP_IPV6_FLOWLABEL; } #endif - /* can't return this */ - paddrp->spp_pathmtu = 0; + paddrp->spp_pathmtu = inp->sctp_ep.default_mtu; if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) { paddrp->spp_flags |= SPP_HB_ENABLE; @@ -5479,6 +5482,7 @@ sctp_setopt(struct socket *so, int optname, void *optv sctp_pathmtu_adjustment(stcb, net->mtu); } } + stcb->asoc.default_mtu = paddrp->spp_pathmtu; sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { @@ -5488,6 +5492,7 @@ sctp_setopt(struct socket *so, int optname, void *optv } net->dest_state &= ~SCTP_ADDR_NO_PMTUD; } + stcb->asoc.default_mtu = 0; sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { @@ -5544,8 +5549,12 @@ sctp_setopt(struct socket *so, int optname, void *optv sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } if (paddrp->spp_flags & SPP_PMTUD_ENABLE) { + inp->sctp_ep.default_mtu = 0; sctp_feature_off(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } else if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { + if (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU) { + inp->sctp_ep.default_mtu = paddrp->spp_pathmtu; + } sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD); } if (paddrp->spp_flags & SPP_DSCP) { Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 20:08:17 2018 (r332222) @@ -1042,6 +1042,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb asoc->initial_init_rto_max = inp->sctp_ep.initial_init_rto_max; asoc->initial_rto = inp->sctp_ep.initial_rto; + asoc->default_mtu = inp->sctp_ep.default_mtu; asoc->max_init_times = inp->sctp_ep.max_init_times; asoc->max_send_times = inp->sctp_ep.max_send_times; asoc->def_net_failure = inp->sctp_ep.def_net_failure; Modified: stable/11/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 20:06:50 2018 (r332221) +++ stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 20:08:17 2018 (r332222) @@ -229,6 +229,10 @@ sctp6_notify(struct sctp_inpcb *inp, } break; case ICMP6_PACKET_TOO_BIG: + if ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0) { + SCTP_TCB_UNLOCK(stcb); + break; + } if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { timer_stopped = 1; sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, From owner-svn-src-all@freebsd.org Sat Apr 7 20:10:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF307F81304; Sat, 7 Apr 2018 20:10:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1FA77691; Sat, 7 Apr 2018 20:10:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93F36256AF; Sat, 7 Apr 2018 20:10:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KAQBB078548; Sat, 7 Apr 2018 20:10:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KAQBH078547; Sat, 7 Apr 2018 20:10:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072010.w37KAQBH078547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332223 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:10:27 -0000 Author: tuexen Date: Sat Apr 7 20:10:26 2018 New Revision: 332223 URL: https://svnweb.freebsd.org/changeset/base/332223 Log: MFC r325434: Fix an accounting bug where data was counted twice if on the read queue and on the ordered or unordered queue. While there, improve the checking in INVARIANTs when computing the a_rwnd. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 20:08:17 2018 (r332222) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 20:10:26 2018 (r332223) @@ -88,12 +88,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso if (stcb->sctp_socket == NULL) { return (calc); } + KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0, + ("size_on_reasm_queue is %u", asoc->size_on_reasm_queue)); + KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0, + ("size_on_all_streams is %u", asoc->size_on_all_streams)); if (stcb->asoc.sb_cc == 0 && - asoc->size_on_reasm_queue == 0 && - asoc->size_on_all_streams == 0) { + asoc->cnt_on_reasm_queue == 0 && + asoc->cnt_on_all_streams == 0) { /* Full rwnd granted */ - KASSERT(asoc->cnt_on_reasm_queue == 0, ("cnt_on_reasm_queue is %u", asoc->cnt_on_reasm_queue)); - KASSERT(asoc->cnt_on_all_streams == 0, ("cnt_on_all_streams is %u", asoc->cnt_on_all_streams)); calc = max(SCTP_SB_LIMIT_RCV(stcb->sctp_socket), SCTP_MINIMAL_RWND); return (calc); } @@ -1245,6 +1247,19 @@ deliver_more: } done = (control->end_added) && (control->last_frag_seen); if (control->on_read_q == 0) { + if (!done) { + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + strm->pd_api_started = 1; + control->pdapi_started = 1; + } sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, control->end_added, @@ -1254,10 +1269,6 @@ deliver_more: if (done) { control = nctl; goto deliver_more; - } else { - /* We are now doing PD API */ - strm->pd_api_started = 1; - control->pdapi_started = 1; } } } @@ -1316,15 +1327,11 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co } else if (control->on_strm_q == SCTP_ON_ORDERED) { /* Ordered */ TAILQ_REMOVE(&strm->inqueue, control, next_instrm); - if (asoc->size_on_all_streams >= control->length) { - asoc->size_on_all_streams -= control->length; - } else { -#ifdef INVARIANTS - panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); -#else - asoc->size_on_all_streams = 0; -#endif - } + /* + * Don't need to decrement + * size_on_all_streams, since control is on + * the read queue. + */ sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; #ifdef INVARIANTS From owner-svn-src-all@freebsd.org Sat Apr 7 20:11:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 052D7F81634; Sat, 7 Apr 2018 20:11:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA35A7857F; Sat, 7 Apr 2018 20:11:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3FD625716; Sat, 7 Apr 2018 20:11:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KBu3L081556; Sat, 7 Apr 2018 20:11:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KBuip081555; Sat, 7 Apr 2018 20:11:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072011.w37KBuip081555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332224 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:11:57 -0000 Author: tuexen Date: Sat Apr 7 20:11:56 2018 New Revision: 332224 URL: https://svnweb.freebsd.org/changeset/base/332224 Log: MFC r325746: Cleanup the handling of control chunks. While there fix some minor bug related to clearing the assoc retransmit counter and the dup TSN handling of NR-SACK chunks. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:10:26 2018 (r332223) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:11:56 2018 (r332224) @@ -635,6 +635,14 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk r_net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_4); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, r_net); } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { + sctp_misc_ints(SCTP_THRESHOLD_CLEAR, + stcb->asoc.overall_error_count, + 0, + SCTP_FROM_SCTP_INPUT, + __LINE__); + } + stcb->asoc.overall_error_count = 0; old_error_counter = r_net->error_count; r_net->error_count = 0; r_net->hb_responded = 1; @@ -2928,7 +2936,14 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c return; } asoc = &stcb->asoc; - + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { + sctp_misc_ints(SCTP_THRESHOLD_CLEAR, + asoc->overall_error_count, + 0, + SCTP_FROM_SCTP_INPUT, + __LINE__); + } + asoc->overall_error_count = 0; sctp_stop_all_cookie_timers(stcb); /* process according to association state */ if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) { @@ -4721,14 +4736,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { /* implied cookie-ack.. we must have lost the ack */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); } @@ -4862,7 +4869,7 @@ process_control_chunks: case SCTP_PAD_CHUNK: break; case SCTP_INITIATION_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT_ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ if ((stcb != NULL) && (stcb->asoc.total_output_queue_size)) { @@ -4893,7 +4900,7 @@ process_control_chunks: *offset = length; return (stcb); } - if ((netp) && (*netp)) { + if ((netp != NULL) && (*netp != NULL)) { ret = sctp_handle_init_ack(m, iphlen, *offset, src, dst, sh, (struct sctp_init_ack_chunk *)ch, @@ -4918,23 +4925,35 @@ process_control_chunks: return (stcb); break; case SCTP_SELECTIVE_ACK: + case SCTP_NR_SELECTIVE_ACK: { - struct sctp_sack_chunk *sack; int abort_now = 0; uint32_t a_rwnd, cum_ack; - uint16_t num_seg, num_dup; + uint16_t num_seg, num_nr_seg, num_dup; uint8_t flags; int offset_seg, offset_dup; - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "%s\n", + ch->chunk_type == SCTP_SELECTIVE_ACK ? "SCTP_SACK" : "SCTP_NR_SACK"); SCTP_STAT_INCR(sctps_recvsacks); if (stcb == NULL) { - SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing SACK chunk\n"); + SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing %s chunk\n", + (ch->chunk_type == SCTP_SELECTIVE_ACK) ? "SCTP_SACK" : "SCTP_NR_SACK"); break; } - if (chk_length < sizeof(struct sctp_sack_chunk)) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on SACK chunk, too small\n"); - break; + if (ch->chunk_type == SCTP_SELECTIVE_ACK) { + if (chk_length < sizeof(struct sctp_sack_chunk)) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on SACK chunk, too small\n"); + break; + } + } else { + if (stcb->asoc.nrsack_supported == 0) { + goto unknown_chunk; + } + if (chk_length < sizeof(struct sctp_nr_sack_chunk)) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on NR_SACK chunk, too small\n"); + break; + } } if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { /*- @@ -4944,108 +4963,44 @@ process_control_chunks: */ break; } - sack = (struct sctp_sack_chunk *)ch; flags = ch->chunk_flags; - cum_ack = ntohl(sack->sack.cum_tsn_ack); - num_seg = ntohs(sack->sack.num_gap_ack_blks); - num_dup = ntohs(sack->sack.num_dup_tsns); - a_rwnd = (uint32_t)ntohl(sack->sack.a_rwnd); - if (sizeof(struct sctp_sack_chunk) + - num_seg * sizeof(struct sctp_gap_ack_block) + - num_dup * sizeof(uint32_t) != chk_length) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of SACK chunk\n"); - break; - } - offset_seg = *offset + sizeof(struct sctp_sack_chunk); - offset_dup = offset_seg + num_seg * sizeof(struct sctp_gap_ack_block); - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK process cum_ack:%x num_seg:%d a_rwnd:%d\n", - cum_ack, num_seg, a_rwnd); - stcb->asoc.seen_a_sack_this_pkt = 1; - if ((stcb->asoc.pr_sctp_cnt == 0) && - (num_seg == 0) && - SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && - (stcb->asoc.saw_sack_with_frags == 0) && - (stcb->asoc.saw_sack_with_nr_frags == 0) && - (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) - ) { - /* - * We have a SIMPLE sack having no - * prior segments and data on sent - * queue to be acked.. Use the - * faster path sack processing. We - * also allow window update sacks - * with no missing segments to go - * this way too. - */ - sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now, ecne_seen); + if (ch->chunk_type == SCTP_SELECTIVE_ACK) { + struct sctp_sack_chunk *sack; + + sack = (struct sctp_sack_chunk *)ch; + cum_ack = ntohl(sack->sack.cum_tsn_ack); + num_seg = ntohs(sack->sack.num_gap_ack_blks); + num_nr_seg = 0; + num_dup = ntohs(sack->sack.num_dup_tsns); + a_rwnd = ntohl(sack->sack.a_rwnd); + if (sizeof(struct sctp_sack_chunk) + + num_seg * sizeof(struct sctp_gap_ack_block) + + num_dup * sizeof(uint32_t) != chk_length) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of SACK chunk\n"); + break; + } + offset_seg = *offset + sizeof(struct sctp_sack_chunk); + offset_dup = offset_seg + num_seg * sizeof(struct sctp_gap_ack_block); } else { - if (netp && *netp) - sctp_handle_sack(m, offset_seg, offset_dup, stcb, - num_seg, 0, num_dup, &abort_now, flags, - cum_ack, a_rwnd, ecne_seen); - } - if (abort_now) { - /* ABORT signal from sack processing */ - *offset = length; - return (NULL); - } - if (TAILQ_EMPTY(&stcb->asoc.send_queue) && - TAILQ_EMPTY(&stcb->asoc.sent_queue) && - (stcb->asoc.stream_queue_cnt == 0)) { - sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - } - } - break; - /* - * EY - nr_sack: If the received chunk is an - * nr_sack chunk - */ - case SCTP_NR_SELECTIVE_ACK: - { - struct sctp_nr_sack_chunk *nr_sack; - int abort_now = 0; - uint32_t a_rwnd, cum_ack; - uint16_t num_seg, num_nr_seg, num_dup; - uint8_t flags; - int offset_seg, offset_dup; + struct sctp_nr_sack_chunk *nr_sack; - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n"); - SCTP_STAT_INCR(sctps_recvsacks); - if (stcb == NULL) { - SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing NR-SACK chunk\n"); - break; + nr_sack = (struct sctp_nr_sack_chunk *)ch; + cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); + num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); + num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); + num_dup = ntohs(nr_sack->nr_sack.num_dup_tsns); + a_rwnd = ntohl(nr_sack->nr_sack.a_rwnd); + if (sizeof(struct sctp_nr_sack_chunk) + + (num_seg + num_nr_seg) * sizeof(struct sctp_gap_ack_block) + + num_dup * sizeof(uint32_t) != chk_length) { + SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of NR_SACK chunk\n"); + break; + } + offset_seg = *offset + sizeof(struct sctp_nr_sack_chunk); + offset_dup = offset_seg + (num_seg + num_nr_seg) * sizeof(struct sctp_gap_ack_block); } - if (stcb->asoc.nrsack_supported == 0) { - goto unknown_chunk; - } - if (chk_length < sizeof(struct sctp_nr_sack_chunk)) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on NR-SACK chunk, too small\n"); - break; - } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { - /*- - * If we have sent a shutdown-ack, we will pay no - * attention to a sack sent in to us since - * we don't care anymore. - */ - break; - } - nr_sack = (struct sctp_nr_sack_chunk *)ch; - flags = ch->chunk_flags; - cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); - num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); - num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); - num_dup = ntohs(nr_sack->nr_sack.num_dup_tsns); - a_rwnd = (uint32_t)ntohl(nr_sack->nr_sack.a_rwnd); - if (sizeof(struct sctp_nr_sack_chunk) + - (num_seg + num_nr_seg) * sizeof(struct sctp_gap_ack_block) + - num_dup * sizeof(uint32_t) != chk_length) { - SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size of NR_SACK chunk\n"); - break; - } - offset_seg = *offset + sizeof(struct sctp_nr_sack_chunk); - offset_dup = offset_seg + num_seg * sizeof(struct sctp_gap_ack_block); - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK process cum_ack:%x num_seg:%d a_rwnd:%d\n", + SCTPDBG(SCTP_DEBUG_INPUT3, "%s process cum_ack:%x num_seg:%d a_rwnd:%d\n", + (ch->chunk_type == SCTP_SELECTIVE_ACK) ? "SCTP_SACK" : "SCTP_NR_SACK", cum_ack, num_seg, a_rwnd); stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && @@ -5066,10 +5021,11 @@ process_control_chunks: sctp_express_handle_sack(stcb, cum_ack, a_rwnd, &abort_now, ecne_seen); } else { - if (netp && *netp) + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_sack(m, offset_seg, offset_dup, stcb, num_seg, num_nr_seg, num_dup, &abort_now, flags, cum_ack, a_rwnd, ecne_seen); + } } if (abort_now) { /* ABORT signal from sack processing */ @@ -5081,47 +5037,28 @@ process_control_chunks: (stcb->asoc.stream_queue_cnt == 0)) { sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } + break; } - break; - case SCTP_HEARTBEAT_REQUEST: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT\n"); - if ((stcb) && netp && *netp) { + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { SCTP_STAT_INCR(sctps_recvheartbeat); sctp_send_heartbeat_ack(stcb, m, *offset, chk_length, *netp); - - /* He's alive so give him credit */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; } break; case SCTP_HEARTBEAT_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT-ACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_HEARTBEAT_ACK\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_heartbeat_chunk))) { /* Its not ours */ *offset = length; return (stcb); } - /* He's alive so give him credit */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; SCTP_STAT_INCR(sctps_recvheartbeatack); - if (netp && *netp) + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_heartbeat_ack((struct sctp_heartbeat_chunk *)ch, stcb, *netp); + } break; case SCTP_ABORT_ASSOCIATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ABORT, stcb %p\n", @@ -5144,7 +5081,7 @@ process_control_chunks: *offset = length; return (stcb); } - if (netp && *netp) { + if ((netp != NULL) && (*netp != NULL)) { int abort_flag = 0; sctp_handle_shutdown((struct sctp_shutdown_chunk *)ch, @@ -5156,24 +5093,25 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", (void *)stcb); - if ((stcb) && (netp) && (*netp)) + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN_ACK, stcb %p\n", (void *)stcb); + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp); + } *offset = length; return (NULL); break; - case SCTP_OPERATION_ERROR: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP-ERR\n"); - if ((stcb) && netp && *netp && sctp_handle_error(ch, stcb, *netp) < 0) { + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP_ERR\n"); + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL) && + sctp_handle_error(ch, stcb, *netp) < 0) { *offset = length; return (NULL); } break; case SCTP_COOKIE_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, - "SCTP_COOKIE-ECHO, stcb %p\n", (void *)stcb); - if ((stcb) && (stcb->asoc.total_output_queue_size)) { + "SCTP_COOKIE_ECHO, stcb %p\n", (void *)stcb); + if ((stcb != NULL) && (stcb->asoc.total_output_queue_size > 0)) { ; } else { if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { @@ -5215,7 +5153,7 @@ process_control_chunks: linp = inp; } - if (linp) { + if (linp != NULL) { SCTP_ASOC_CREATE_LOCK(linp); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { @@ -5223,7 +5161,7 @@ process_control_chunks: goto abend; } } - if (netp) { + if (netp != NULL) { struct sctp_tcb *locked_stcb; locked_stcb = stcb; @@ -5251,7 +5189,7 @@ process_control_chunks: } else { ret_buf = NULL; } - if (linp) { + if (linp != NULL) { SCTP_ASOC_CREATE_UNLOCK(linp); } if (ret_buf == NULL) { @@ -5281,7 +5219,7 @@ process_control_chunks: } break; case SCTP_COOKIE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE_ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { return (stcb); } @@ -5307,75 +5245,43 @@ process_control_chunks: return (NULL); } } - /* He's alive so give him credit */ - if ((stcb) && netp && *netp) { - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; + if ((netp != NULL) && (*netp != NULL)) { sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); } break; case SCTP_ECN_ECHO: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN-ECHO\n"); - /* He's alive so give him credit */ + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_ECHO\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_ecne_chunk))) { /* Its not ours */ *offset = length; return (stcb); } - if (stcb) { - if (stcb->asoc.ecn_supported == 0) { - goto unknown_chunk; - } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, - stcb); - ecne_seen = 1; + if (stcb->asoc.ecn_supported == 0) { + goto unknown_chunk; } + sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, stcb); + ecne_seen = 1; break; case SCTP_ECN_CWR: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN-CWR\n"); - /* He's alive so give him credit */ + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN_CWR\n"); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_cwr_chunk))) { *offset = length; return (stcb); } - if (stcb) { - if (stcb->asoc.ecn_supported == 0) { - goto unknown_chunk; - } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); + if (stcb->asoc.ecn_supported == 0) { + goto unknown_chunk; } + sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); break; case SCTP_SHUTDOWN_COMPLETE: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", (void *)stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN_COMPLETE, stcb %p\n", (void *)stcb); /* must be first and only chunk */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; return (stcb); } - if ((stcb) && netp && *netp) { + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, stcb, *netp); } @@ -5384,32 +5290,23 @@ process_control_chunks: break; case SCTP_ASCONF: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF\n"); - /* He's alive so give him credit */ - if (stcb) { + if (stcb != NULL) { if (stcb->asoc.asconf_supported == 0) { goto unknown_chunk; } - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; sctp_handle_asconf(m, *offset, src, (struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0); asconf_cnt++; } break; case SCTP_ASCONF_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF-ACK\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF_ACK\n"); if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { /* Its not ours */ *offset = length; return (stcb); } - if ((stcb) && netp && *netp) { + if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) { if (stcb->asoc.asconf_supported == 0) { goto unknown_chunk; } @@ -5430,27 +5327,18 @@ process_control_chunks: break; case SCTP_FORWARD_CUM_TSN: case SCTP_IFORWARD_CUM_TSN: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_FWD-TSN\n"); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_FWD_TSN\n"); if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { /* Its not ours */ *offset = length; return (stcb); } - /* He's alive so give him credit */ - if (stcb) { + if (stcb != NULL) { int abort_flag = 0; if (stcb->asoc.prsctp_supported == 0) { goto unknown_chunk; } - stcb->asoc.overall_error_count = 0; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -5480,17 +5368,7 @@ process_control_chunks: if (abort_flag) { *offset = length; return (NULL); - } else { - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; } - } break; case SCTP_STREAM_RESET: @@ -5517,7 +5395,7 @@ process_control_chunks: *offset = length; return (stcb); } - if (ch && (stcb) && netp && (*netp)) { + if ((ch != NULL) && (stcb != NULL) && (netp != NULL) && (*netp != NULL)) { if (stcb->asoc.pktdrop_supported == 0) { goto unknown_chunk; } @@ -5616,7 +5494,7 @@ next_chunk: } } /* while */ - if (asconf_cnt > 0 && stcb != NULL) { + if ((asconf_cnt > 0) && (stcb != NULL)) { sctp_send_asconf_ack(stcb); } return (stcb); @@ -5894,14 +5772,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph * shows us the cookie-ack was lost. Imply it was * there. */ - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { - sctp_misc_ints(SCTP_THRESHOLD_CLEAR, - stcb->asoc.overall_error_count, - 0, - SCTP_FROM_SCTP_INPUT, - __LINE__); - } - stcb->asoc.overall_error_count = 0; sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, net); break; case SCTP_STATE_COOKIE_WAIT: From owner-svn-src-all@freebsd.org Sat Apr 7 20:13:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64229F817AB; Sat, 7 Apr 2018 20:13:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14593793E1; Sat, 7 Apr 2018 20:13:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DF6C25857; Sat, 7 Apr 2018 20:13:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KDTND083138; Sat, 7 Apr 2018 20:13:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KDTOM083137; Sat, 7 Apr 2018 20:13:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072013.w37KDTOM083137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332225 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:13:30 -0000 Author: tuexen Date: Sat Apr 7 20:13:29 2018 New Revision: 332225 URL: https://svnweb.freebsd.org/changeset/base/332225 Log: MFC r325788: Simply the code and use the full buffer for contigous chunk representation. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:11:56 2018 (r332224) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:13:29 2018 (r332225) @@ -4527,7 +4527,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * char msg[SCTP_DIAG_INFO_LEN]; uint32_t vtag_in; int num_chunks = 0; /* number of control chunks processed */ - uint32_t chk_length; + uint32_t chk_length, contiguous; int ret; int abort_no_unlock = 0; int ecne_seen = 0; @@ -4753,58 +4753,30 @@ process_control_chunks: } SCTP_STAT_INCR_COUNTER64(sctps_incontrolchunks); /* - * INIT-ACK only gets the init ack "header" portion only - * because we don't have to process the peer's COOKIE. All - * others get a complete chunk. + * INIT and INIT-ACK only gets the init ack "header" portion + * only because we don't have to process the peer's COOKIE. + * All others get a complete chunk. */ - if ((ch->chunk_type == SCTP_INITIATION_ACK) || - (ch->chunk_type == SCTP_INITIATION)) { - /* get an init-ack chunk */ - ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_init_ack_chunk), chunk_buf); - if (ch == NULL) { - *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); + switch (ch->chunk_type) { + case SCTP_INITIATION: + contiguous = sizeof(struct sctp_init_chunk); + break; + case SCTP_INITIATION_ACK: + contiguous = sizeof(struct sctp_init_ack_chunk); + break; + default: + contiguous = min(chk_length, sizeof(chunk_buf)); + break; + } + ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, + contiguous, + chunk_buf); + if (ch == NULL) { + *offset = length; + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } - } else { - /* For cookies and all other chunks. */ - if (chk_length > sizeof(chunk_buf)) { - /* - * use just the size of the chunk buffer so - * the front part of our chunks fit in - * contiguous space up to the chunk buffer - * size (508 bytes). For chunks that need to - * get more than that they must use the - * sctp_m_getptr() function or other means - * (e.g. know how to parse mbuf chains). - * Cookies do this already. - */ - ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - (sizeof(chunk_buf) - 4), - chunk_buf); - if (ch == NULL) { - *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); - } - } else { - /* We can fit it all */ - ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - chk_length, chunk_buf); - if (ch == NULL) { - SCTP_PRINTF("sctp_process_control: Can't get the all data....\n"); - *offset = length; - if (stcb != NULL) { - SCTP_TCB_UNLOCK(stcb); - } - return (NULL); - } - } + return (NULL); } num_chunks++; /* Save off the last place we got a control from */ @@ -5401,7 +5373,7 @@ process_control_chunks: } sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, - min(chk_length, (sizeof(chunk_buf) - 4))); + min(chk_length, contiguous)); } break; case SCTP_AUTHENTICATION: From owner-svn-src-all@freebsd.org Sat Apr 7 20:15:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A58C1F8199A; Sat, 7 Apr 2018 20:15:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5274F7A2D9; Sat, 7 Apr 2018 20:15:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4728325858; Sat, 7 Apr 2018 20:15:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KFDqj083256; Sat, 7 Apr 2018 20:15:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KFD3t083255; Sat, 7 Apr 2018 20:15:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072015.w37KFD3t083255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332226 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:15:14 -0000 Author: tuexen Date: Sat Apr 7 20:15:12 2018 New Revision: 332226 URL: https://svnweb.freebsd.org/changeset/base/332226 Log: MFC r325864: Fix the handling of ERROR chunks which a lot of error causes. While there, clean up the code. Thanks to Felix Weinrank who found the bug by using fuzz-testing the SCTP userland stack. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:13:29 2018 (r332225) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:15:12 2018 (r332226) @@ -1100,19 +1100,11 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun #endif } -/* - * Skip past the param header and then we will find the chunk that caused the - * problem. There are two possibilities ASCONF or FWD-TSN other than that and - * our peer must be broken. - */ static void -sctp_process_unrecog_chunk(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr, +sctp_process_unrecog_chunk(struct sctp_tcb *stcb, uint8_t chunk_type, struct sctp_nets *net) { - struct sctp_chunkhdr *chk; - - chk = (struct sctp_chunkhdr *)((caddr_t)phdr + sizeof(*phdr)); - switch (chk->chunk_type) { + switch (chunk_type) { case SCTP_ASCONF_ACK: case SCTP_ASCONF: sctp_asconf_cleanup(stcb, net); @@ -1123,8 +1115,8 @@ sctp_process_unrecog_chunk(struct sctp_tcb *stcb, stru break; default: SCTPDBG(SCTP_DEBUG_INPUT2, - "Peer does not support chunk type %d(%x)??\n", - chk->chunk_type, (uint32_t)chk->chunk_type); + "Peer does not support chunk type %d (0x%x).\n", + chunk_type, chunk_type); break; } } @@ -1136,12 +1128,9 @@ sctp_process_unrecog_chunk(struct sctp_tcb *stcb, stru * XXX: Is this the right thing to do? */ static void -sctp_process_unrecog_param(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr) +sctp_process_unrecog_param(struct sctp_tcb *stcb, uint16_t parameter_type) { - struct sctp_paramhdr *pbad; - - pbad = phdr + 1; - switch (ntohs(pbad->param_type)) { + switch (parameter_type) { /* pr-sctp draft */ case SCTP_PRSCTP_SUPPORTED: stcb->asoc.prsctp_supported = 0; @@ -1166,63 +1155,69 @@ sctp_process_unrecog_param(struct sctp_tcb *stcb, stru break; default: SCTPDBG(SCTP_DEBUG_INPUT2, - "Peer does not support param type %d(%x)??\n", - pbad->param_type, (uint32_t)pbad->param_type); + "Peer does not support param type %d (0x%x)??\n", + parameter_type, parameter_type); break; } } static int sctp_handle_error(struct sctp_chunkhdr *ch, - struct sctp_tcb *stcb, struct sctp_nets *net) + struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t limit) { - int chklen; - struct sctp_paramhdr *phdr; - uint16_t error, error_type; - uint16_t error_len; + struct sctp_error_cause *cause; struct sctp_association *asoc; - int adjust; + uint32_t remaining_length, adjust; + uint16_t code, cause_code, cause_length; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif /* parse through all of the errors and process */ asoc = &stcb->asoc; - phdr = (struct sctp_paramhdr *)((caddr_t)ch + + cause = (struct sctp_error_cause *)((caddr_t)ch + sizeof(struct sctp_chunkhdr)); - chklen = ntohs(ch->chunk_length) - sizeof(struct sctp_chunkhdr); - error = 0; - while ((size_t)chklen >= sizeof(struct sctp_paramhdr)) { + remaining_length = ntohs(ch->chunk_length); + if (remaining_length > limit) { + remaining_length = limit; + } + if (remaining_length >= sizeof(struct sctp_chunkhdr)) { + remaining_length -= sizeof(struct sctp_chunkhdr); + } else { + remaining_length = 0; + } + code = 0; + while (remaining_length >= sizeof(struct sctp_error_cause)) { /* Process an Error Cause */ - error_type = ntohs(phdr->param_type); - error_len = ntohs(phdr->param_length); - if ((error_len > chklen) || (error_len == 0)) { - /* invalid param length for this param */ - SCTPDBG(SCTP_DEBUG_INPUT1, "Bogus length in error param- chunk left:%d errorlen:%d\n", - chklen, error_len); + cause_code = ntohs(cause->code); + cause_length = ntohs(cause->length); + if ((cause_length > remaining_length) || (cause_length == 0)) { + /* Invalid cause length, possibly due to truncation. */ + SCTPDBG(SCTP_DEBUG_INPUT1, "Bogus length in cause - bytes left: %u cause length: %u\n", + remaining_length, cause_length); return (0); } - if (error == 0) { + if (code == 0) { /* report the first error cause */ - error = error_type; + code = cause_code; } - switch (error_type) { + switch (cause_code) { case SCTP_CAUSE_INVALID_STREAM: case SCTP_CAUSE_MISSING_PARAM: case SCTP_CAUSE_INVALID_PARAM: case SCTP_CAUSE_NO_USER_DATA: - SCTPDBG(SCTP_DEBUG_INPUT1, "Software error we got a %d back? We have a bug :/ (or do they?)\n", - error_type); + SCTPDBG(SCTP_DEBUG_INPUT1, "Software error we got a %u back? We have a bug :/ (or do they?)\n", + cause_code); break; case SCTP_CAUSE_NAT_COLLIDING_STATE: - SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags:%x\n", + SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags: %x\n", ch->chunk_flags); if (sctp_handle_nat_colliding_state(stcb)) { return (0); } break; case SCTP_CAUSE_NAT_MISSING_STATE: - SCTPDBG(SCTP_DEBUG_INPUT2, "Received missing state abort flags:%x\n", + SCTPDBG(SCTP_DEBUG_INPUT2, "Received missing state abort flags: %x\n", ch->chunk_flags); if (sctp_handle_nat_missing_state(stcb, net)) { return (0); @@ -1233,12 +1228,18 @@ sctp_handle_error(struct sctp_chunkhdr *ch, * We only act if we have echoed a cookie and are * waiting. */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) { - int *p; + if ((cause_length >= sizeof(struct sctp_error_stale_cookie)) && + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + struct sctp_error_stale_cookie *stale_cookie; - p = (int *)((caddr_t)phdr + sizeof(*phdr)); - /* Save the time doubled */ - asoc->cookie_preserve_req = ntohl(*p) << 1; + stale_cookie = (struct sctp_error_stale_cookie *)cause; + asoc->cookie_preserve_req = ntohl(stale_cookie->stale_time); + /* Double it to be more robust on RTX */ + if (asoc->cookie_preserve_req <= UINT32_MAX / 2) { + asoc->cookie_preserve_req *= 2; + } else { + asoc->cookie_preserve_req = UINT32_MAX; + } asoc->stale_cookie_count++; if (asoc->stale_cookie_count > asoc->max_init_times) { @@ -1281,10 +1282,21 @@ sctp_handle_error(struct sctp_chunkhdr *ch, */ break; case SCTP_CAUSE_UNRECOG_CHUNK: - sctp_process_unrecog_chunk(stcb, phdr, net); + if (cause_length >= sizeof(struct sctp_error_unrecognized_chunk)) { + struct sctp_error_unrecognized_chunk *unrec_chunk; + + unrec_chunk = (struct sctp_error_unrecognized_chunk *)cause; + sctp_process_unrecog_chunk(stcb, unrec_chunk->ch.chunk_type, net); + } break; case SCTP_CAUSE_UNRECOG_PARAM: - sctp_process_unrecog_param(stcb, phdr); + /* XXX: We only consider the first parameter */ + if (cause_length >= sizeof(struct sctp_error_cause) + sizeof(struct sctp_paramhdr)) { + struct sctp_paramhdr *unrec_parameter; + + unrec_parameter = (struct sctp_paramhdr *)(cause + 1); + sctp_process_unrecog_param(stcb, ntohs(unrec_parameter->param_type)); + } break; case SCTP_CAUSE_COOKIE_IN_SHUTDOWN: /* @@ -1301,8 +1313,8 @@ sctp_handle_error(struct sctp_chunkhdr *ch, * We should NOT get these here, but in a * ASCONF-ACK. */ - SCTPDBG(SCTP_DEBUG_INPUT2, "Peer sends ASCONF errors in a Operational Error?<%d>?\n", - error_type); + SCTPDBG(SCTP_DEBUG_INPUT2, "Peer sends ASCONF errors in a error cause with code %u.\n", + cause_code); break; case SCTP_CAUSE_OUT_OF_RESC: /* @@ -1314,15 +1326,19 @@ sctp_handle_error(struct sctp_chunkhdr *ch, */ break; default: - SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_handle_error: unknown error type = 0x%xh\n", - error_type); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_handle_error: unknown code 0x%x\n", + cause_code); break; } - adjust = SCTP_SIZE32(error_len); - chklen -= adjust; - phdr = (struct sctp_paramhdr *)((caddr_t)phdr + adjust); + adjust = SCTP_SIZE32(cause_length); + if (remaining_length >= adjust) { + remaining_length -= adjust; + } else { + remaining_length = 0; + } + cause = (struct sctp_error_cause *)((caddr_t)cause + adjust); } - sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, error, ch, SCTP_SO_NOT_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, code, ch, SCTP_SO_NOT_LOCKED); return (0); } @@ -5075,7 +5091,7 @@ process_control_chunks: case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP_ERR\n"); if ((stcb != NULL) && (netp != NULL) && (*netp != NULL) && - sctp_handle_error(ch, stcb, *netp) < 0) { + sctp_handle_error(ch, stcb, *netp, contiguous) < 0) { *offset = length; return (NULL); } From owner-svn-src-all@freebsd.org Sat Apr 7 20:22:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE28F82297; Sat, 7 Apr 2018 20:22:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A0D57DCFE; Sat, 7 Apr 2018 20:22:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A432259C8; Sat, 7 Apr 2018 20:22:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KM5kM087959; Sat, 7 Apr 2018 20:22:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KM4Ah087948; Sat, 7 Apr 2018 20:22:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072022.w37KM4Ah087948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332227 - in stable/11: sys/conf sys/netinet sys/netinet6 usr.bin/systat X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11: sys/conf sys/netinet sys/netinet6 usr.bin/systat X-SVN-Commit-Revision: 332227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:22:07 -0000 Author: tuexen Date: Sat Apr 7 20:22:04 2018 New Revision: 332227 URL: https://svnweb.freebsd.org/changeset/base/332227 Log: MFC r326672: Retire SCTP_WITH_NO_CSUM option. This option was used in the early days to allow performance measurements extrapolating the use of SCTP checksum offloading. Since this feature is now available, get rid of this option. This also un-breaks the LINT kernel. Thanks to markj@ for making me aware of the problem. Modified: stable/11/sys/conf/NOTES stable/11/sys/conf/options stable/11/sys/netinet/sctp_crc32.c stable/11/sys/netinet/sctp_crc32.h stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_input.h stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/sctp_uio.h stable/11/sys/netinet6/sctp6_usrreq.c stable/11/usr.bin/systat/sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/conf/NOTES Sat Apr 7 20:22:04 2018 (r332227) @@ -664,21 +664,6 @@ options SCTP # faster.. if you are not debugging don't use. options SCTP_DEBUG # -# This option turns off the CRC32c checksum. Basically, -# you will not be able to talk to anyone else who -# has not done this. Its more for experimentation to -# see how much CPU the CRC32c really takes. Most new -# cards for TCP support checksum offload.. so this -# option gives you a "view" into what SCTP would be -# like with such an offload (which only exists in -# high in iSCSI boards so far). With the new -# splitting 8's algorithm its not as bad as it used -# to be.. but it does speed things up try only -# for in a captured lab environment :-) -options SCTP_WITH_NO_CSUM -# - -# # All that options after that turn on specific types of # logging. You can monitor CWND growth, flight size # and all sorts of things. Go look at the code and Modified: stable/11/sys/conf/options ============================================================================== --- stable/11/sys/conf/options Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/conf/options Sat Apr 7 20:22:04 2018 (r332227) @@ -462,7 +462,6 @@ FLOWTABLE_HASH_ALL opt_route.h # SCTP opt_sctp.h SCTP_DEBUG opt_sctp.h # Enable debug printfs -SCTP_WITH_NO_CSUM opt_sctp.h # Use this at your peril SCTP_LOCK_LOGGING opt_sctp.h # Log to KTR lock activity SCTP_MBUF_LOGGING opt_sctp.h # Log to KTR general mbuf aloc/free SCTP_MBCNT_LOGGING opt_sctp.h # Log to KTR mbcnt activity Modified: stable/11/sys/netinet/sctp_crc32.c ============================================================================== --- stable/11/sys/netinet/sctp_crc32.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_crc32.c Sat Apr 7 20:22:04 2018 (r332227) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include -#if !defined(SCTP_WITH_NO_CSUM) static uint32_t sctp_finalize_crc32c(uint32_t crc32c) @@ -113,17 +112,11 @@ sctp_calculate_cksum(struct mbuf *m, uint32_t offset) base = sctp_finalize_crc32c(base); return (base); } -#endif /* !defined(SCTP_WITH_NO_CSUM) */ void sctp_delayed_cksum(struct mbuf *m, uint32_t offset) { -#if defined(SCTP_WITH_NO_CSUM) -#ifdef INVARIANTS - panic("sctp_delayed_cksum() called when using no SCTP CRC."); -#endif -#else uint32_t checksum; checksum = sctp_calculate_cksum(m, offset); @@ -142,5 +135,4 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) return; } *(uint32_t *)(m->m_data + offset) = checksum; -#endif } Modified: stable/11/sys/netinet/sctp_crc32.h ============================================================================== --- stable/11/sys/netinet/sctp_crc32.h Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_crc32.h Sat Apr 7 20:22:04 2018 (r332227) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #define _NETINET_SCTP_CRC32_H_ #if defined(_KERNEL) -#if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); -#endif void sctp_delayed_cksum(struct mbuf *, uint32_t offset); #endif /* _KERNEL */ #endif /* __crc32c_h__ */ Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:22:04 2018 (r332227) @@ -5496,9 +5496,7 @@ void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, -#if !defined(SCTP_WITH_NO_CSUM) uint8_t compute_crc, -#endif uint8_t ecn_bits, uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, uint32_t vrf_id, uint16_t port) @@ -5518,7 +5516,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph sctp_audit_log(0xE0, 1); sctp_auditing(0, inp, stcb, net); #endif -#if !defined(SCTP_WITH_NO_CSUM) if (compute_crc != 0) { uint32_t check, calc_check; @@ -5563,7 +5560,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph goto out; } } -#endif /* Destination port of 0 is illegal, based on RFC4960. */ if (sh->dest_port == 0) { SCTP_STAT_INCR(sctps_hdrops); @@ -5881,9 +5877,7 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint struct sctphdr *sh; struct sctp_chunkhdr *ch; int length, offset; -#if !defined(SCTP_WITH_NO_CSUM) uint8_t compute_crc; -#endif uint32_t mflowid; uint8_t mflowtype; uint16_t fibnum; @@ -5953,9 +5947,6 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint goto out; } ecn_bits = ip->ip_tos; -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_recvnocrc); -#else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; @@ -5963,14 +5954,11 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint SCTP_STAT_INCR(sctps_recvswcrc); compute_crc = 1; } -#endif sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, sh, ch, -#if !defined(SCTP_WITH_NO_CSUM) compute_crc, -#endif ecn_bits, mflowtype, mflowid, fibnum, vrf_id, port); Modified: stable/11/sys/netinet/sctp_input.h ============================================================================== --- stable/11/sys/netinet/sctp_input.h Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_input.h Sat Apr 7 20:22:04 2018 (r332227) @@ -41,9 +41,7 @@ void sctp_common_input_processing(struct mbuf **, int, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, -#if !defined(SCTP_WITH_NO_CSUM) uint8_t, -#endif uint8_t, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t); Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:22:04 2018 (r332227) @@ -4224,23 +4224,15 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); -#endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else m->m_pkthdr.csum_flags = CSUM_SCTP; m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) @@ -4564,23 +4556,15 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); -#endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } /* send it out. table id is taken from stcb */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -11225,23 +11209,15 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad } ip->ip_len = htons(len); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); -#endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else mout->m_pkthdr.csum_flags = CSUM_SCTP; mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { @@ -11255,23 +11231,15 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad case AF_INET6: ip6->ip6_plen = (uint16_t)(len - sizeof(struct ip6_hdr)); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); -#endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { Modified: stable/11/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/11/sys/netinet/sctp_sysctl.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_sysctl.c Sat Apr 7 20:22:04 2018 (r332227) @@ -713,7 +713,6 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS) sb.sctps_recvauthfailed += sarry->sctps_recvauthfailed; sb.sctps_recvexpress += sarry->sctps_recvexpress; sb.sctps_recvexpressm += sarry->sctps_recvexpressm; - sb.sctps_recvnocrc += sarry->sctps_recvnocrc; sb.sctps_recvswcrc += sarry->sctps_recvswcrc; sb.sctps_recvhwcrc += sarry->sctps_recvhwcrc; sb.sctps_sendpackets += sarry->sctps_sendpackets; @@ -726,7 +725,6 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS) sb.sctps_sendecne += sarry->sctps_sendecne; sb.sctps_sendauth += sarry->sctps_sendauth; sb.sctps_senderrors += sarry->sctps_senderrors; - sb.sctps_sendnocrc += sarry->sctps_sendnocrc; sb.sctps_sendswcrc += sarry->sctps_sendswcrc; sb.sctps_sendhwcrc += sarry->sctps_sendhwcrc; sb.sctps_pdrpfmbox += sarry->sctps_pdrpfmbox; Modified: stable/11/sys/netinet/sctp_uio.h ============================================================================== --- stable/11/sys/netinet/sctp_uio.h Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_uio.h Sat Apr 7 20:22:04 2018 (r332227) @@ -984,7 +984,7 @@ struct sctpstat { uint32_t sctps_recvexpress; /* total fast path receives all one * chunk */ uint32_t sctps_recvexpressm; /* total fast path multi-part data */ - uint32_t sctps_recvnocrc; + uint32_t sctps_recv_spare; /* formerly sctps_recvnocrc */ uint32_t sctps_recvswcrc; uint32_t sctps_recvhwcrc; @@ -1004,7 +1004,7 @@ struct sctpstat { uint32_t sctps_sendecne;/* total output ECNE chunks */ uint32_t sctps_sendauth;/* total output AUTH chunks FIXME */ uint32_t sctps_senderrors; /* ip_output error counter */ - uint32_t sctps_sendnocrc; + uint32_t sctps_send_spare; /* formerly sctps_sendnocrc */ uint32_t sctps_sendswcrc; uint32_t sctps_sendhwcrc; /* PCKDROPREP statistics: */ Modified: stable/11/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 20:22:04 2018 (r332227) @@ -69,9 +69,7 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, struct sctphdr *sh; struct sctp_chunkhdr *ch; int length, offset; -#if !defined(SCTP_WITH_NO_CSUM) uint8_t compute_crc; -#endif uint32_t mflowid; uint8_t mflowtype; uint16_t fibnum; @@ -142,9 +140,6 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, goto out; } ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_recvnocrc); -#else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; @@ -152,14 +147,11 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, SCTP_STAT_INCR(sctps_recvswcrc); compute_crc = 1; } -#endif sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, sh, ch, -#if !defined(SCTP_WITH_NO_CSUM) compute_crc, -#endif ecn_bits, mflowtype, mflowid, fibnum, vrf_id, port); Modified: stable/11/usr.bin/systat/sctp.c ============================================================================== --- stable/11/usr.bin/systat/sctp.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/usr.bin/systat/sctp.c Sat Apr 7 20:22:04 2018 (r332227) @@ -180,7 +180,6 @@ domode(struct sctpstat *ret) DO(sctps_recvauthfailed); DO(sctps_recvexpress); DO(sctps_recvexpressm); - DO(sctps_recvnocrc); DO(sctps_recvswcrc); DO(sctps_recvhwcrc); @@ -194,7 +193,6 @@ domode(struct sctpstat *ret) DO(sctps_sendecne); DO(sctps_sendauth); DO(sctps_senderrors); - DO(sctps_sendnocrc); DO(sctps_sendswcrc); DO(sctps_sendhwcrc); From owner-svn-src-all@freebsd.org Sat Apr 7 20:23:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29242F82449; Sat, 7 Apr 2018 20:23:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC9D37EB4B; Sat, 7 Apr 2018 20:23:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5BFD259EB; Sat, 7 Apr 2018 20:23:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KNY4C088059; Sat, 7 Apr 2018 20:23:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KNYJU088057; Sat, 7 Apr 2018 20:23:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072023.w37KNYJU088057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332228 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:23:35 -0000 Author: tuexen Date: Sat Apr 7 20:23:34 2018 New Revision: 332228 URL: https://svnweb.freebsd.org/changeset/base/332228 Log: MFC r326829: Cleaup, no functional change. Modified: stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:22:04 2018 (r332227) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:23:34 2018 (r332228) @@ -3208,9 +3208,9 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, sctp_next); + stcb->asoc.ctrl_queue_cnt--; sctp_m_freem(chk->data); chk->data = NULL; - stcb->asoc.ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (override == 0) { break; @@ -3642,26 +3642,23 @@ static void sctp_clean_up_stream_reset(struct sctp_tcb *stcb) { struct sctp_association *asoc; - struct sctp_tmit_chunk *chk = stcb->asoc.str_reset; + struct sctp_tmit_chunk *chk; - if (stcb->asoc.str_reset == NULL) { + asoc = &stcb->asoc; + chk = asoc->str_reset; + if (chk == NULL) { return; } - asoc = &stcb->asoc; - + asoc->str_reset = NULL; sctp_timer_stop(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo, SCTP_FROM_SCTP_INPUT + SCTP_LOC_28); - TAILQ_REMOVE(&asoc->control_send_queue, - chk, - sctp_next); + TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); + asoc->ctrl_queue_cnt--; if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } - asoc->ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); - /* sa_ignore NO_NULL_CHK */ - stcb->asoc.str_reset = NULL; } Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:22:04 2018 (r332227) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:23:34 2018 (r332228) @@ -6896,11 +6896,11 @@ sctp_toss_old_cookies(struct sctp_tcb *stcb, struct sc TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) { TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); + asoc->ctrl_queue_cnt--; if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } - asoc->ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } @@ -6925,11 +6925,11 @@ sctp_toss_old_asconf(struct sctp_tcb *stcb) } } TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next); + asoc->ctrl_queue_cnt--; if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } - asoc->ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } @@ -7053,13 +7053,14 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_a /* Stray chunks must be cleaned up */ clean_up_anyway: TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); + asoc->ctrl_queue_cnt--; if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; } - asoc->ctrl_queue_cnt--; - if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) + if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) { asoc->fwd_tsn_cnt--; + } sctp_free_a_chunk(stcb, chk, so_locked); } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { /* special handling, we must look into the param */ From owner-svn-src-all@freebsd.org Sat Apr 7 20:27:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F1BF8280C; Sat, 7 Apr 2018 20:27:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 238CE809ED; Sat, 7 Apr 2018 20:27:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B716259ED; Sat, 7 Apr 2018 20:27:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KRCsF088251; Sat, 7 Apr 2018 20:27:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KRCNN088242; Sat, 7 Apr 2018 20:27:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072027.w37KRCNN088242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332229 - in stable/11: sbin/ipfw sys/conf sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/conf sys/netinet sys/netpfil/ipfw X-SVN-Commit-Revision: 332229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:27:13 -0000 Author: tuexen Date: Sat Apr 7 20:27:11 2018 New Revision: 332229 URL: https://svnweb.freebsd.org/changeset/base/332229 Log: MFC r326233: Add to ipfw support for sending an SCTP packet containing an ABORT chunk. This is similar to the TCP case. where a TCP RST segment can be sent. There is one limitation: When sending an ABORT in response to an incoming packet, it should be tested if there is no ABORT chunk in the received packet. Currently, it is only checked if the first chunk is an ABORT chunk to avoid parsing the whole packet, which could result in a DOS attack. Thanks to Timo Voelker for helping me to test this patch. MFC r327200: When adding support for sending SCTP packets containing an ABORT chunk to ipfw in https://svnweb.freebsd.org/changeset/base/326233, a dependency on the SCTP stack was added to ipfw by accident. This was noted by Kevel Bowling in https://reviews.freebsd.org/D13594 where also a solution was suggested. This patch is based on Kevin's suggestion, but implements the required SCTP checksum computation without any dependency on other SCTP sources. While there, do some cleanups and improve comments. Thanks to Kevin Kevin Bowling for reporting the issue and suggesting a fix. Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sbin/ipfw/ipfw2.c stable/11/sbin/ipfw/ipfw2.h stable/11/sys/conf/files stable/11/sys/netinet/ip_fw.h stable/11/sys/netinet/sctp_crc32.c stable/11/sys/netinet/sctp_crc32.h stable/11/sys/netpfil/ipfw/ip_fw2.c stable/11/sys/netpfil/ipfw/ip_fw_log.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sbin/ipfw/ipfw.8 Sat Apr 7 20:27:11 2018 (r332229) @@ -1173,6 +1173,14 @@ ipfw add reass all from any to any in .Ed .Pp is all you need at the beginning of your ruleset. +.It Cm abort +Discard packets that match this rule, and if the packet is an SCTP packet, +try to send an SCTP packet containing an ABORT chunk. +The search terminates. +.It Cm abort6 +Discard packets that match this rule, and if the packet is an SCTP packet, +try to send an SCTP packet containing an ABORT chunk. +The search terminates. .El .Ss RULE BODY The body of a rule contains zero or more patterns (such as Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sbin/ipfw/ipfw2.c Sat Apr 7 20:27:11 2018 (r332229) @@ -244,6 +244,8 @@ static struct _s_x rule_eactions[] = { }; static struct _s_x rule_actions[] = { + { "abort6", TOK_ABORT6 }, + { "abort", TOK_ABORT }, { "accept", TOK_ACCEPT }, { "pass", TOK_ACCEPT }, { "allow", TOK_ACCEPT }, @@ -1507,6 +1509,8 @@ show_static_rule(struct cmdline_opts *co, struct forma case O_REJECT: if (cmd->arg1 == ICMP_REJECT_RST) bprintf(bp, "reset"); + else if (cmd->arg1 == ICMP_REJECT_ABORT) + bprintf(bp, "abort"); else if (cmd->arg1 == ICMP_UNREACH_HOST) bprintf(bp, "reject"); else @@ -1516,6 +1520,8 @@ show_static_rule(struct cmdline_opts *co, struct forma case O_UNREACH6: if (cmd->arg1 == ICMP6_UNREACH_RST) bprintf(bp, "reset6"); + else if (cmd->arg1 == ICMP6_UNREACH_ABORT) + bprintf(bp, "abort6"); else print_unreach6_code(bp, cmd->arg1); break; @@ -3753,6 +3759,16 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize break; } errx(EX_DATAERR, "Invalid state name %s", *av); + break; + + case TOK_ABORT: + action->opcode = O_REJECT; + action->arg1 = ICMP_REJECT_ABORT; + break; + + case TOK_ABORT6: + action->opcode = O_UNREACH6; + action->arg1 = ICMP6_UNREACH_ABORT; break; case TOK_ACCEPT: Modified: stable/11/sbin/ipfw/ipfw2.h ============================================================================== --- stable/11/sbin/ipfw/ipfw2.h Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sbin/ipfw/ipfw2.h Sat Apr 7 20:27:11 2018 (r332229) @@ -81,6 +81,8 @@ enum tokens { TOK_STARTBRACE, TOK_ENDBRACE, + TOK_ABORT6, + TOK_ABORT, TOK_ACCEPT, TOK_COUNT, TOK_EACTION, Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sys/conf/files Sat Apr 7 20:27:11 2018 (r332229) @@ -4094,7 +4094,7 @@ netinet/sctp_asconf.c optional inet sctp | inet6 sctp netinet/sctp_auth.c optional inet sctp | inet6 sctp netinet/sctp_bsd_addr.c optional inet sctp | inet6 sctp netinet/sctp_cc_functions.c optional inet sctp | inet6 sctp -netinet/sctp_crc32.c optional inet sctp | inet6 sctp +netinet/sctp_crc32.c optional inet | inet6 netinet/sctp_indata.c optional inet sctp | inet6 sctp netinet/sctp_input.c optional inet sctp | inet6 sctp netinet/sctp_output.c optional inet sctp | inet6 sctp Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sys/netinet/ip_fw.h Sat Apr 7 20:27:11 2018 (r332229) @@ -728,6 +728,8 @@ struct _ipfw_dyn_rule { #define ICMP_REJECT_RST 0x100 /* fake ICMP code (send a TCP RST) */ #define ICMP6_UNREACH_RST 0x100 /* fake ICMPv6 code (send a TCP RST) */ +#define ICMP_REJECT_ABORT 0x101 /* fake ICMP code (send an SCTP ABORT) */ +#define ICMP6_UNREACH_ABORT 0x101 /* fake ICMPv6 code (send an SCTP ABORT) */ /* * These are used for lookup tables. Modified: stable/11/sys/netinet/sctp_crc32.c ============================================================================== --- stable/11/sys/netinet/sctp_crc32.c Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sys/netinet/sctp_crc32.c Sat Apr 7 20:27:11 2018 (r332229) @@ -33,29 +33,36 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_sctp.h" + +#ifdef SCTP #include #include #include #include +#else +#include +#include +#include +#include +#endif - static uint32_t sctp_finalize_crc32c(uint32_t crc32c) { uint32_t result; - #if BYTE_ORDER == BIG_ENDIAN uint8_t byte0, byte1, byte2, byte3; - #endif + /* Complement the result */ result = ~crc32c; #if BYTE_ORDER == BIG_ENDIAN /* - * For BIG-ENDIAN.. aka Motorola byte order the result is in - * little-endian form. So we must manually swap the bytes. Then we - * can call htonl() which does nothing... + * For BIG-ENDIAN platforms the result is in little-endian form. So + * we must swap the bytes to return the result in network byte + * order. */ byte0 = result & 0x000000ff; byte1 = (result >> 8) & 0x000000ff; @@ -64,56 +71,54 @@ sctp_finalize_crc32c(uint32_t crc32c) crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3); #else /* - * For INTEL platforms the result comes out in network order. No - * htonl is required or the swap above. So we optimize out both the - * htonl and the manual swap above. + * For LITTLE ENDIAN platforms the result is in already in network + * byte order. */ crc32c = result; #endif return (crc32c); } +/* + * Compute the SCTP checksum in network byte order for a given mbuf chain m + * which contains an SCTP packet starting at offset. + * Since this function is also called by ipfw, don't assume that + * it is compiled on a kernel with SCTP support. + */ uint32_t sctp_calculate_cksum(struct mbuf *m, uint32_t offset) { - /* - * given a mbuf chain with a packetheader offset by 'offset' - * pointing at a sctphdr (with csum set to 0) go through the chain - * of SCTP_BUF_NEXT()'s and calculate the SCTP checksum. This also - * has a side bonus as it will calculate the total length of the - * mbuf chain. Note: if offset is greater than the total mbuf - * length, checksum=1, pktlen=0 is returned (ie. no real error code) - */ uint32_t base = 0xffffffff; - struct mbuf *at; - at = m; - /* find the correct mbuf and offset into mbuf */ - while ((at != NULL) && (offset > (uint32_t)SCTP_BUF_LEN(at))) { - offset -= SCTP_BUF_LEN(at); /* update remaining offset - * left */ - at = SCTP_BUF_NEXT(at); - } - while (at != NULL) { - if ((SCTP_BUF_LEN(at) - offset) > 0) { - base = calculate_crc32c(base, - (unsigned char *)(SCTP_BUF_AT(at, offset)), - (unsigned int)(SCTP_BUF_LEN(at) - offset)); + while (offset > 0) { + KASSERT(m != NULL, ("sctp_calculate_cksum, offset > length of mbuf chain")); + if (offset < (uint32_t)m->m_len) { + break; } - if (offset) { - /* we only offset once into the first mbuf */ - if (offset < (uint32_t)SCTP_BUF_LEN(at)) - offset = 0; - else - offset -= SCTP_BUF_LEN(at); - } - at = SCTP_BUF_NEXT(at); + offset -= m->m_len; + m = m->m_next; } + if (offset > 0) { + base = calculate_crc32c(base, + (unsigned char *)(m->m_data + offset), + (unsigned int)(m->m_len - offset)); + m = m->m_next; + } + while (m != NULL) { + base = calculate_crc32c(base, + (unsigned char *)m->m_data, + (unsigned int)m->m_len); + m = m->m_next; + } base = sctp_finalize_crc32c(base); return (base); } - +#ifdef SCTP +/* + * Compute and insert the SCTP checksum in network byte order for a given + * mbuf chain m which contains an SCTP packet starting at offset. + */ void sctp_delayed_cksum(struct mbuf *m, uint32_t offset) { @@ -125,14 +130,15 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) offset += offsetof(struct sctphdr, checksum); if (offset + sizeof(uint32_t) > (uint32_t)(m->m_len)) { - SCTP_PRINTF("sctp_delayed_cksum(): m->len: %d, off: %d.\n", - (uint32_t)m->m_len, offset); - /* - * XXX this shouldn't happen, but if it does, the correct - * behavior may be to insert the checksum in the appropriate - * next mbuf in the chain. - */ +#ifdef INVARIANTS + panic("sctp_delayed_cksum(): m->m_len: %d, offset: %u.", + m->m_len, offset); +#else + SCTP_PRINTF("sctp_delayed_cksum(): m->m_len: %d, offset: %u.\n", + m->m_len, offset); +#endif return; } *(uint32_t *)(m->m_data + offset) = checksum; } +#endif Modified: stable/11/sys/netinet/sctp_crc32.h ============================================================================== --- stable/11/sys/netinet/sctp_crc32.h Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sys/netinet/sctp_crc32.h Sat Apr 7 20:27:11 2018 (r332229) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); +#ifdef SCTP void sctp_delayed_cksum(struct mbuf *, uint32_t offset); +#endif #endif /* _KERNEL */ #endif /* __crc32c_h__ */ Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Sat Apr 7 20:27:11 2018 (r332229) @@ -80,6 +80,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -469,6 +471,113 @@ verify_path(struct in_addr src, struct ifnet *ifp, u_i } /* + * Generate an SCTP packet containing an ABORT chunk. The verification tag + * is given by vtag. The T-bit is set in the ABORT chunk if and only if + * reflected is not 0. + */ + +static struct mbuf * +ipfw_send_abort(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t vtag, + int reflected) +{ + struct mbuf *m; + struct ip *ip; +#ifdef INET6 + struct ip6_hdr *ip6; +#endif + struct sctphdr *sctp; + struct sctp_chunkhdr *chunk; + u_int16_t hlen, plen, tlen; + + MGETHDR(m, M_NOWAIT, MT_DATA); + if (m == NULL) + return (NULL); + + M_SETFIB(m, id->fib); +#ifdef MAC + if (replyto != NULL) + mac_netinet_firewall_reply(replyto, m); + else + mac_netinet_firewall_send(m); +#else + (void)replyto; /* don't warn about unused arg */ +#endif + + switch (id->addr_type) { + case 4: + hlen = sizeof(struct ip); + break; +#ifdef INET6 + case 6: + hlen = sizeof(struct ip6_hdr); + break; +#endif + default: + /* XXX: log me?!? */ + FREE_PKT(m); + return (NULL); + } + plen = sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + tlen = hlen + plen; + m->m_data += max_linkhdr; + m->m_flags |= M_SKIP_FIREWALL; + m->m_pkthdr.len = m->m_len = tlen; + m->m_pkthdr.rcvif = NULL; + bzero(m->m_data, tlen); + + switch (id->addr_type) { + case 4: + ip = mtod(m, struct ip *); + + ip->ip_v = 4; + ip->ip_hl = sizeof(struct ip) >> 2; + ip->ip_tos = IPTOS_LOWDELAY; + ip->ip_len = htons(tlen); + ip->ip_id = htons(0); + ip->ip_off = htons(0); + ip->ip_ttl = V_ip_defttl; + ip->ip_p = IPPROTO_SCTP; + ip->ip_sum = 0; + ip->ip_src.s_addr = htonl(id->dst_ip); + ip->ip_dst.s_addr = htonl(id->src_ip); + + sctp = (struct sctphdr *)(ip + 1); + break; +#ifdef INET6 + case 6: + ip6 = mtod(m, struct ip6_hdr *); + + ip6->ip6_vfc = IPV6_VERSION; + ip6->ip6_plen = htons(plen); + ip6->ip6_nxt = IPPROTO_SCTP; + ip6->ip6_hlim = IPV6_DEFHLIM; + ip6->ip6_src = id->dst_ip6; + ip6->ip6_dst = id->src_ip6; + + sctp = (struct sctphdr *)(ip6 + 1); + break; +#endif + } + + sctp->src_port = htons(id->dst_port); + sctp->dest_port = htons(id->src_port); + sctp->v_tag = htonl(vtag); + sctp->checksum = htonl(0); + + chunk = (struct sctp_chunkhdr *)(sctp + 1); + chunk->chunk_type = SCTP_ABORT_ASSOCIATION; + chunk->chunk_flags = 0; + if (reflected != 0) { + chunk->chunk_flags |= SCTP_HAD_NO_TCB; + } + chunk->chunk_length = htons(sizeof(struct sctp_chunkhdr)); + + sctp->checksum = sctp_calculate_cksum(m, hlen); + + return (m); +} + +/* * Generate a TCP packet, containing either a RST or a keepalive. * When flags & TH_RST, we are sending a RST packet, because of a * "reset" action matched the packet. @@ -756,7 +865,71 @@ send_reject6(struct ip_fw_args *args, int code, u_int NULL); } FREE_PKT(m); - } else if (code != ICMP6_UNREACH_RST) { /* Send an ICMPv6 unreach. */ + } else if (code == ICMP6_UNREACH_ABORT && + args->f_id.proto == IPPROTO_SCTP) { + struct mbuf *m0; + struct sctphdr *sctp; + u_int32_t v_tag; + int reflected; + + sctp = (struct sctphdr *)((char *)ip6 + hlen); + reflected = 1; + v_tag = ntohl(sctp->v_tag); + /* Investigate the first chunk header if available */ + if (m->m_len >= hlen + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr)) { + struct sctp_chunkhdr *chunk; + + chunk = (struct sctp_chunkhdr *)(sctp + 1); + switch (chunk->chunk_type) { + case SCTP_INITIATION: + /* + * Packets containing an INIT chunk MUST have + * a zero v-tag. + */ + if (v_tag != 0) { + v_tag = 0; + break; + } + /* INIT chunk MUST NOT be bundled */ + if (m->m_pkthdr.len > + hlen + sizeof(struct sctphdr) + + ntohs(chunk->chunk_length) + 3) { + break; + } + /* Use the initiate tag if available */ + if ((m->m_len >= hlen + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd))) { + struct sctp_init *init; + + init = (struct sctp_init *)(chunk + 1); + v_tag = ntohl(init->initiate_tag); + reflected = 0; + } + break; + case SCTP_ABORT_ASSOCIATION: + /* + * If the packet contains an ABORT chunk, don't + * reply. + * XXX: We should search through all chunks, + * but don't do to avoid attacks. + */ + v_tag = 0; + break; + } + } + if (v_tag == 0) { + m0 = NULL; + } else { + m0 = ipfw_send_abort(args->m, &(args->f_id), v_tag, + reflected); + } + if (m0 != NULL) + ip6_output(m0, NULL, NULL, 0, NULL, NULL, NULL); + FREE_PKT(m); + } else if (code != ICMP6_UNREACH_RST && code != ICMP6_UNREACH_ABORT) { + /* Send an ICMPv6 unreach. */ #if 0 /* * Unlike above, the mbufs need to line up with the ip6 hdr, @@ -796,9 +969,10 @@ send_reject(struct ip_fw_args *args, int code, int ipl if (args->L3offset) m_adj(m, args->L3offset); #endif - if (code != ICMP_REJECT_RST) { /* Send an ICMP unreach */ + if (code != ICMP_REJECT_RST && code != ICMP_REJECT_ABORT) { + /* Send an ICMP unreach */ icmp_error(args->m, ICMP_UNREACH, code, 0L, 0); - } else if (args->f_id.proto == IPPROTO_TCP) { + } else if (code == ICMP_REJECT_RST && args->f_id.proto == IPPROTO_TCP) { struct tcphdr *const tcp = L3HDR(struct tcphdr, mtod(args->m, struct ip *)); if ( (tcp->th_flags & TH_RST) == 0) { @@ -810,6 +984,68 @@ send_reject(struct ip_fw_args *args, int code, int ipl ip_output(m, NULL, NULL, 0, NULL, NULL); } FREE_PKT(args->m); + } else if (code == ICMP_REJECT_ABORT && + args->f_id.proto == IPPROTO_SCTP) { + struct mbuf *m; + struct sctphdr *sctp; + struct sctp_chunkhdr *chunk; + struct sctp_init *init; + u_int32_t v_tag; + int reflected; + + sctp = L3HDR(struct sctphdr, mtod(args->m, struct ip *)); + reflected = 1; + v_tag = ntohl(sctp->v_tag); + if (iplen >= (ip->ip_hl << 2) + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr)) { + /* Look at the first chunk header if available */ + chunk = (struct sctp_chunkhdr *)(sctp + 1); + switch (chunk->chunk_type) { + case SCTP_INITIATION: + /* + * Packets containing an INIT chunk MUST have + * a zero v-tag. + */ + if (v_tag != 0) { + v_tag = 0; + break; + } + /* INIT chunk MUST NOT be bundled */ + if (iplen > + (ip->ip_hl << 2) + sizeof(struct sctphdr) + + ntohs(chunk->chunk_length) + 3) { + break; + } + /* Use the initiate tag if available */ + if ((iplen >= (ip->ip_hl << 2) + + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd))) { + init = (struct sctp_init *)(chunk + 1); + v_tag = ntohl(init->initiate_tag); + reflected = 0; + } + break; + case SCTP_ABORT_ASSOCIATION: + /* + * If the packet contains an ABORT chunk, don't + * reply. + * XXX: We should search through all chunks, + * but don't do to avoid attacks. + */ + v_tag = 0; + break; + } + } + if (v_tag == 0) { + m = NULL; + } else { + m = ipfw_send_abort(args->m, &(args->f_id), v_tag, + reflected); + } + if (m != NULL) + ip_output(m, NULL, NULL, 0, NULL, NULL); + FREE_PKT(args->m); } else FREE_PKT(args->m); args->m = NULL; @@ -1232,7 +1468,18 @@ do { \ break; case IPPROTO_SCTP: - PULLUP_TO(hlen, ulp, struct sctphdr); + if (pktlen >= hlen + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd)) + PULLUP_LEN(hlen, ulp, + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd)); + else if (pktlen >= hlen + sizeof(struct sctphdr)) + PULLUP_LEN(hlen, ulp, pktlen - hlen); + else + PULLUP_LEN(hlen, ulp, + sizeof(struct sctphdr)); src_port = SCTP(ulp)->src_port; dst_port = SCTP(ulp)->dest_port; break; @@ -1410,7 +1657,18 @@ do { \ break; case IPPROTO_SCTP: - PULLUP_TO(hlen, ulp, struct sctphdr); + if (pktlen >= hlen + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd)) + PULLUP_LEN(hlen, ulp, + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd)); + else if (pktlen >= hlen + sizeof(struct sctphdr)) + PULLUP_LEN(hlen, ulp, pktlen - hlen); + else + PULLUP_LEN(hlen, ulp, + sizeof(struct sctphdr)); src_port = SCTP(ulp)->src_port; dst_port = SCTP(ulp)->dest_port; break; Modified: stable/11/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_log.c Sat Apr 7 20:23:34 2018 (r332228) +++ stable/11/sys/netpfil/ipfw/ip_fw_log.c Sat Apr 7 20:27:11 2018 (r332229) @@ -165,6 +165,8 @@ ipfw_log(struct ip_fw_chain *chain, struct ip_fw *f, u case O_REJECT: if (cmd->arg1==ICMP_REJECT_RST) action = "Reset"; + else if (cmd->arg1==ICMP_REJECT_ABORT) + action = "Abort"; else if (cmd->arg1==ICMP_UNREACH_HOST) action = "Reject"; else @@ -175,6 +177,8 @@ ipfw_log(struct ip_fw_chain *chain, struct ip_fw *f, u case O_UNREACH6: if (cmd->arg1==ICMP6_UNREACH_RST) action = "Reset"; + else if (cmd->arg1==ICMP6_UNREACH_ABORT) + action = "Abort"; else snprintf(SNPARGS(action2, 0), "Unreach %d", cmd->arg1); From owner-svn-src-all@freebsd.org Sat Apr 7 20:34:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E18B5F83089; Sat, 7 Apr 2018 20:34:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA8F845D4; Sat, 7 Apr 2018 20:34:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 877C925B96; Sat, 7 Apr 2018 20:34:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KY3m6093650; Sat, 7 Apr 2018 20:34:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KY3Zn093649; Sat, 7 Apr 2018 20:34:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072034.w37KY3Zn093649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332230 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 332230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:34:04 -0000 Author: tuexen Date: Sat Apr 7 20:34:03 2018 New Revision: 332230 URL: https://svnweb.freebsd.org/changeset/base/332230 Log: MFC r327844: Ensure that the vnet is set when calling pru_sockaddr() and pru_peeraddr(). This is already true when called via kern_getsockname() and kern_getpeername(). This patch sets it also, when they arecalled via soo_fill_kinfo(). This is necessary, since the corresponding functions for SCTP require the vnet to be set. Without this, if a process having an wildcard bound SCTP socket is terminated and a core is written, the kernel panics. Modified: stable/11/sys/kern/sys_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sys_socket.c ============================================================================== --- stable/11/sys/kern/sys_socket.c Sat Apr 7 20:27:11 2018 (r332229) +++ stable/11/sys/kern/sys_socket.c Sat Apr 7 20:34:03 2018 (r332230) @@ -346,6 +346,7 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif kif->kf_type = KF_TYPE_SOCKET; so = fp->f_data; + CURVNET_SET(so->so_vnet); kif->kf_sock_domain = so->so_proto->pr_domain->dom_family; kif->kf_sock_type = so->so_type; kif->kf_sock_protocol = so->so_proto->pr_protocol; @@ -387,6 +388,7 @@ soo_fill_kinfo(struct file *fp, struct kinfo_file *kif } strncpy(kif->kf_path, so->so_proto->pr_domain->dom_name, sizeof(kif->kf_path)); + CURVNET_RESTORE(); return (0); } From owner-svn-src-all@freebsd.org Sat Apr 7 20:34:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28520F8319C; Sat, 7 Apr 2018 20:34:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCCCD84DFA; Sat, 7 Apr 2018 20:34:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C79BE25B97; Sat, 7 Apr 2018 20:34:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KYvUd093720; Sat, 7 Apr 2018 20:34:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KYve9093719; Sat, 7 Apr 2018 20:34:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072034.w37KYve9093719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 20:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332231 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:34:58 -0000 Author: ian Date: Sat Apr 7 20:34:57 2018 New Revision: 332231 URL: https://svnweb.freebsd.org/changeset/base/332231 Log: Generate a spibus_set_[ivarname]() convenience function for each ivar, now that they can be set. Modified: head/sys/dev/spibus/spibusvar.h Modified: head/sys/dev/spibus/spibusvar.h ============================================================================== --- head/sys/dev/spibus/spibusvar.h Sat Apr 7 20:34:03 2018 (r332230) +++ head/sys/dev/spibus/spibusvar.h Sat Apr 7 20:34:57 2018 (r332231) @@ -60,8 +60,14 @@ spibus_get_ ## A(device_t dev, T *t) \ { \ return BUS_READ_IVAR(device_get_parent(dev), dev, \ SPIBUS_IVAR_ ## B, (uintptr_t *) t); \ +} \ +static inline int \ +spibus_set_ ## A(device_t dev, T t) \ +{ \ + return BUS_WRITE_IVAR(device_get_parent(dev), dev, \ + SPIBUS_IVAR_ ## B, (uintptr_t) t); \ } - + SPIBUS_ACCESSOR(cs, CS, uint32_t) SPIBUS_ACCESSOR(mode, MODE, uint32_t) SPIBUS_ACCESSOR(clock, CLOCK, uint32_t) From owner-svn-src-all@freebsd.org Sat Apr 7 20:37:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6BAF8340A; Sat, 7 Apr 2018 20:37:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD308680C; Sat, 7 Apr 2018 20:37:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CD9125B99; Sat, 7 Apr 2018 20:37:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KbiOI093876; Sat, 7 Apr 2018 20:37:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Kbibe093875; Sat, 7 Apr 2018 20:37:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072037.w37Kbibe093875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332232 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:37:45 -0000 Author: tuexen Date: Sat Apr 7 20:37:44 2018 New Revision: 332232 URL: https://svnweb.freebsd.org/changeset/base/332232 Log: MFC r328028: Don't provide a (meaningless) cmsg when proving a notification in a recvmsg() call. Modified: stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sat Apr 7 20:34:57 2018 (r332231) +++ stable/11/sys/netinet/sctputil.c Sat Apr 7 20:37:44 2018 (r332232) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* for sctp_deliver_data() */ +#include #include #include #include @@ -6091,7 +6091,7 @@ sctp_m_free(struct mbuf *m) return (m_free(m)); } -void +void sctp_m_freem(struct mbuf *mb) { while (mb != NULL) @@ -6161,6 +6161,7 @@ sctp_soreceive(struct socket *so, struct sockaddr *from; struct sctp_extrcvinfo sinfo; int filling_sinfo = 1; + int flags; struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; @@ -6188,15 +6189,24 @@ sctp_soreceive(struct socket *so, if (filling_sinfo) { memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo)); } - error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp, + if (flagsp != NULL) { + flags = *flagsp; + } else { + flags = 0; + } + error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, &flags, (struct sctp_sndrcvinfo *)&sinfo, filling_sinfo); + if (flagsp != NULL) { + *flagsp = flags; + } if (controlp != NULL) { /* copy back the sinfo in a CMSG format */ - if (filling_sinfo) + if (filling_sinfo && ((flags & MSG_NOTIFICATION) == 0)) { *controlp = sctp_build_ctl_nchunk(inp, (struct sctp_sndrcvinfo *)&sinfo); - else + } else { *controlp = NULL; + } } if (psa) { /* copy back the address info */ From owner-svn-src-all@freebsd.org Sat Apr 7 20:38:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CA28F83478; Sat, 7 Apr 2018 20:38:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC8386AFE; Sat, 7 Apr 2018 20:38:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2941025B9A; Sat, 7 Apr 2018 20:38:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Kc2GC093933; Sat, 7 Apr 2018 20:38:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Kc2tr093932; Sat, 7 Apr 2018 20:38:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072038.w37Kc2tr093932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332233 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:38:02 -0000 Author: ian Date: Sat Apr 7 20:38:01 2018 New Revision: 332233 URL: https://svnweb.freebsd.org/changeset/base/332233 Log: Add an ioctl to get/set the SPI transfer mode. Also, make the bus clock frequency ioctl actually set the corresponding ivar instead of just storing the value locally in the softc (and then not using it for anything). Also, return the correct error code if the ioctl cmd is not recognized. Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Sat Apr 7 20:37:44 2018 (r332232) +++ head/sys/dev/spibus/spigen.c Sat Apr 7 20:38:01 2018 (r332233) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef FDT #include @@ -64,7 +65,6 @@ struct spigen_softc { device_t sc_dev; struct cdev *sc_cdev; struct mtx sc_mtx; - uint32_t sc_clock_speed; uint32_t sc_command_length_max; /* cannot change while mmapped */ uint32_t sc_data_length_max; /* cannot change while mmapped */ vm_object_t sc_mmap_buffer; /* command, then data */ @@ -320,7 +320,6 @@ spigen_ioctl(struct cdev *cdev, u_long cmd, caddr_t da struct thread *td) { device_t dev = cdev->si_drv1; - struct spigen_softc *sc = device_get_softc(dev); int error; switch (cmd) { @@ -331,20 +330,20 @@ spigen_ioctl(struct cdev *cdev, u_long cmd, caddr_t da error = spigen_transfer_mmapped(cdev, (struct spigen_transfer_mmapped *)data); break; case SPIGENIOC_GET_CLOCK_SPEED: - mtx_lock(&sc->sc_mtx); - *(uint32_t *)data = sc->sc_clock_speed; - /* XXX TODO: implement spibus ivar call */ - mtx_unlock(&sc->sc_mtx); - error = 0; + error = spibus_get_clock(dev, (uintptr_t *)data); break; case SPIGENIOC_SET_CLOCK_SPEED: - mtx_lock(&sc->sc_mtx); - sc->sc_clock_speed = *(uint32_t *)data; - mtx_unlock(&sc->sc_mtx); - error = 0; + error = spibus_set_clock(dev, *(uint32_t *)data); break; + case SPIGENIOC_GET_SPI_MODE: + error = spibus_get_mode(dev, (uintptr_t *)data); + break; + case SPIGENIOC_SET_SPI_MODE: + error = spibus_set_mode(dev, *(uint32_t *)data); + break; default: - error = EOPNOTSUPP; + error = ENOTTY; + break; } return (error); } From owner-svn-src-all@freebsd.org Sat Apr 7 20:39:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7238AF83594; Sat, 7 Apr 2018 20:39:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FDAB87545; Sat, 7 Apr 2018 20:39:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3D7725B9B; Sat, 7 Apr 2018 20:39:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Kd99T094021; Sat, 7 Apr 2018 20:39:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Kd9pv094020; Sat, 7 Apr 2018 20:39:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072039.w37Kd9pv094020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332234 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:39:10 -0000 Author: tuexen Date: Sat Apr 7 20:39:09 2018 New Revision: 332234 URL: https://svnweb.freebsd.org/changeset/base/332234 Log: MFC r328066: Fix a bug related to fast retransmissions. When processing a SACK advancing the cumtsn-ack in fast recovery, increment the miss-indications for all TSN's reported as missing. Thanks to Fabian Ising for finding the bug and to Timo Voelker for provinding a fix. This fix moves also CMT related initialisation of some variables to a more appropriate place. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sat Apr 7 20:38:01 2018 (r332233) +++ stable/11/sys/netinet/sctp_indata.c Sat Apr 7 20:39:09 2018 (r332234) @@ -3362,7 +3362,8 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru } } } - if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap)) { + if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) && + !(accum_moved && asoc->fast_retran_loss_recovery)) { /* we are beyond the tsn in the sack */ break; } @@ -3386,8 +3387,10 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru * FR using this SACK. */ continue; - } else if (tp1->whoTo && SCTP_TSN_GT(tp1->rec.data.tsn, - tp1->whoTo->this_sack_highest_newack)) { + } else if (tp1->whoTo && + SCTP_TSN_GT(tp1->rec.data.tsn, + tp1->whoTo->this_sack_highest_newack) && + !(accum_moved && asoc->fast_retran_loss_recovery)) { /* * CMT: New acks were receieved for data sent to * this dest. But no new acks were seen for data @@ -3672,7 +3675,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru tp1->whoTo->find_pseudo_cumack = 1; tp1->whoTo->find_rtx_pseudo_cumack = 1; } - } else {/* CMT is OFF */ + } else { /* CMT is OFF */ #ifdef SCTP_FR_TO_ALTERNATE /* Can we find an alternate? */ @@ -4601,6 +4604,13 @@ hopeless_peer: if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); } + /* + * CMT: SFR algo (and HTNA) - this_sack_highest_newack has + * to be greater than the cumack. Also reset saw_newack to 0 + * for all dests. + */ + net->saw_newack = 0; + net->this_sack_highest_newack = last_tsn; } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { @@ -4726,16 +4736,6 @@ hopeless_peer: asoc->this_sack_highest_gap = last_tsn; if ((num_seg > 0) || (num_nr_seg > 0)) { - - /* - * CMT: SFR algo (and HTNA) - this_sack_highest_newack has - * to be greater than the cumack. Also reset saw_newack to 0 - * for all dests. - */ - TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - net->saw_newack = 0; - net->this_sack_highest_newack = last_tsn; - } /* * thisSackHighestGap will increase while handling NEW From owner-svn-src-all@freebsd.org Sat Apr 7 20:40:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 123CFF83765; Sat, 7 Apr 2018 20:40:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF3AA682E4; Sat, 7 Apr 2018 20:40:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FEAB25BB4; Sat, 7 Apr 2018 20:40:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KeecS094850; Sat, 7 Apr 2018 20:40:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Keev6094849; Sat, 7 Apr 2018 20:40:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072040.w37Keev6094849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332235 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:40:41 -0000 Author: tuexen Date: Sat Apr 7 20:40:40 2018 New Revision: 332235 URL: https://svnweb.freebsd.org/changeset/base/332235 Log: MFC r328477: Update references in comments, since the IDs have become an RFC long time ago. Also cleanup whitespaces. No functional change. Modified: stable/11/sys/netinet/sctp_constants.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sat Apr 7 20:39:09 2018 (r332234) +++ stable/11/sys/netinet/sctp_constants.h Sat Apr 7 20:40:40 2018 (r332235) @@ -398,43 +398,32 @@ __FBSDID("$FreeBSD$"); #define SCTP_HOSTNAME_ADDRESS 0x000b #define SCTP_SUPPORTED_ADDRTYPE 0x000c -/* draft-ietf-stewart-tsvwg-strreset-xxx */ +/* RFC 6525 */ #define SCTP_STR_RESET_OUT_REQUEST 0x000d #define SCTP_STR_RESET_IN_REQUEST 0x000e #define SCTP_STR_RESET_TSN_REQUEST 0x000f #define SCTP_STR_RESET_RESPONSE 0x0010 #define SCTP_STR_RESET_ADD_OUT_STREAMS 0x0011 -#define SCTP_STR_RESET_ADD_IN_STREAMS 0x0012 +#define SCTP_STR_RESET_ADD_IN_STREAMS 0x0012 #define SCTP_MAX_RESET_PARAMS 2 -#define SCTP_STREAM_RESET_TSN_DELTA 0x1000 +#define SCTP_STREAM_RESET_TSN_DELTA 0x1000 /*************0x4000 series*************/ /*************0x8000 series*************/ #define SCTP_ECN_CAPABLE 0x8000 -/* draft-ietf-tsvwg-auth-xxx */ +/* RFC 4895 */ #define SCTP_RANDOM 0x8002 #define SCTP_CHUNK_LIST 0x8003 #define SCTP_HMAC_LIST 0x8004 -/* - * draft-ietf-tsvwg-addip-sctp-xx param=0x8008 len=0xNNNN Byte | Byte | Byte - * | Byte Byte | Byte ... - * - * Where each byte is a chunk type extension supported. For example, to support - * all chunks one would have (in hex): - * - * 80 01 00 09 C0 C1 80 81 82 00 00 00 - * - * Has the parameter. C0 = PR-SCTP (RFC3758) C1, 80 = ASCONF (addip draft) 81 - * = Packet Drop 82 = Stream Reset 83 = Authentication - */ -#define SCTP_SUPPORTED_CHUNK_EXT 0x8008 +/* RFC 5061 */ +#define SCTP_SUPPORTED_CHUNK_EXT 0x8008 /*************0xC000 series*************/ #define SCTP_PRSCTP_SUPPORTED 0xc000 -/* draft-ietf-tsvwg-addip-sctp */ +/* RFC 5061 */ #define SCTP_ADD_IP_ADDRESS 0xc001 #define SCTP_DEL_IP_ADDRESS 0xc002 #define SCTP_ERROR_CAUSE_IND 0xc003 @@ -442,8 +431,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_SUCCESS_REPORT 0xc005 #define SCTP_ULP_ADAPTATION 0xc006 /* behave-nat-draft */ -#define SCTP_HAS_NAT_SUPPORT 0xc007 -#define SCTP_NAT_VTAGS 0xc008 +#define SCTP_HAS_NAT_SUPPORT 0xc007 +#define SCTP_NAT_VTAGS 0xc008 /* bits for TOS field */ #define SCTP_ECT0_BIT 0x02 @@ -622,7 +611,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ -#define SCTP_INP_KILL_TIMEOUT 20/* number of ms to retry kill of inpcb */ +#define SCTP_INP_KILL_TIMEOUT 20 /* number of ms to retry kill of inpcb */ #define SCTP_ASOC_KILL_TIMEOUT 10 /* number of ms to retry kill of inpcb */ #define SCTP_DEF_MAX_INIT 8 From owner-svn-src-all@freebsd.org Sat Apr 7 20:42:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C31FF83A5D; Sat, 7 Apr 2018 20:42:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C90F7690EB; Sat, 7 Apr 2018 20:42:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C22A325D15; Sat, 7 Apr 2018 20:42:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Kg6GE097928; Sat, 7 Apr 2018 20:42:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Kg66k097927; Sat, 7 Apr 2018 20:42:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072042.w37Kg66k097927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332236 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:42:07 -0000 Author: tuexen Date: Sat Apr 7 20:42:06 2018 New Revision: 332236 URL: https://svnweb.freebsd.org/changeset/base/332236 Log: MFC r328478: Add constant for the PAD chunk as defined in RFC 4820. This will be used by traceroute and traceroute6 soon. Modified: stable/11/sys/netinet/sctp_constants.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sat Apr 7 20:40:40 2018 (r332235) +++ stable/11/sys/netinet/sctp_constants.h Sat Apr 7 20:42:06 2018 (r332236) @@ -418,6 +418,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_RANDOM 0x8002 #define SCTP_CHUNK_LIST 0x8003 #define SCTP_HMAC_LIST 0x8004 +/* RFC 4820 */ +#define SCTP_PAD 0x8005 /* RFC 5061 */ #define SCTP_SUPPORTED_CHUNK_EXT 0x8008 From owner-svn-src-all@freebsd.org Sat Apr 7 20:44:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1404BF83CBC; Sat, 7 Apr 2018 20:44:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B52AB6A7B3; Sat, 7 Apr 2018 20:44:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFFDB25D3D; Sat, 7 Apr 2018 20:44:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KiUUR098775; Sat, 7 Apr 2018 20:44:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KiUGm098772; Sat, 7 Apr 2018 20:44:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072044.w37KiUGm098772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332237 - in stable/11: contrib/traceroute usr.sbin/traceroute6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11: contrib/traceroute usr.sbin/traceroute6 X-SVN-Commit-Revision: 332237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:44:31 -0000 Author: tuexen Date: Sat Apr 7 20:44:30 2018 New Revision: 332237 URL: https://svnweb.freebsd.org/changeset/base/332237 Log: MFC r328488: When using SCTP for sending probe packets, use INIT chunks for payloads larger than or equal to 32 bytes. For smaller probe packets, keep using SHUTDOWN-ACK chunks, possibly bundled with a PAD chunk. Packets with INIT chunks more likely pass through firewalls. Therefore, use them when possible. Modified: stable/11/contrib/traceroute/traceroute.c stable/11/usr.sbin/traceroute6/traceroute6.8 stable/11/usr.sbin/traceroute6/traceroute6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/traceroute/traceroute.c ============================================================================== --- stable/11/contrib/traceroute/traceroute.c Sat Apr 7 20:42:06 2018 (r332236) +++ stable/11/contrib/traceroute/traceroute.c Sat Apr 7 20:44:30 2018 (r332237) @@ -220,6 +220,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -1489,26 +1490,71 @@ sctp_prep(struct outdata *outdata) { struct sctphdr *const sctp = (struct sctphdr *) outp; struct sctp_chunkhdr *chk; + struct sctp_init_chunk *init; + struct sctp_paramhdr *param; sctp->src_port = htons(ident); sctp->dest_port = htons(port + (fixedPort ? 0 : outdata->seq)); - sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port; + if (protlen >= (int)(sizeof(struct sctphdr) + + sizeof(struct sctp_init_chunk))) { + sctp->v_tag = 0; + } else { + sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port; + } sctp->checksum = htonl(0); - if (protlen >= - (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))) { - chk = (struct sctp_chunkhdr *)(sctp + 1); - chk->chunk_type = SCTP_SHUTDOWN_ACK; - chk->chunk_flags = 0; - chk->chunk_length = htons(4); + if (protlen >= (int)(sizeof(struct sctphdr) + + sizeof(struct sctp_init_chunk))) { + /* + * Send a packet containing an INIT chunk. This works + * better in case of firewalls on the path, but + * results in a probe packet containing at least + * 32 bytes of payload. For shorter payloads, use + * SHUTDOWN-ACK chunks. + */ + init = (struct sctp_init_chunk *)(sctp + 1); + init->ch.chunk_type = SCTP_INITIATION; + init->ch.chunk_flags = 0; + init->ch.chunk_length = htons((u_int16_t)(protlen - + sizeof(struct sctphdr))); + init->init.initiate_tag = (sctp->src_port << 16) | + sctp->dest_port; + init->init.a_rwnd = htonl(1500); + init->init.num_outbound_streams = htons(1); + init->init.num_inbound_streams = htons(1); + init->init.initial_tsn = htonl(0); + if (protlen >= (int)(sizeof(struct sctphdr) + + sizeof(struct sctp_init_chunk) + + sizeof(struct sctp_paramhdr))) { + param = (struct sctp_paramhdr *)(init + 1); + param->param_type = htons(SCTP_PAD); + param->param_length = + htons((u_int16_t)(protlen - + sizeof(struct sctphdr) - + sizeof(struct sctp_init_chunk))); + } + } else { + /* + * Send a packet containing a SHUTDOWN-ACK chunk, + * possibly followed by a PAD chunk. + */ + if (protlen >= + (int)(sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr))) { + chk = (struct sctp_chunkhdr *)(sctp + 1); + chk->chunk_type = SCTP_SHUTDOWN_ACK; + chk->chunk_flags = 0; + chk->chunk_length = htons(4); + } + if (protlen >= + (int)(sizeof(struct sctphdr) + + 2 * sizeof(struct sctp_chunkhdr))) { + chk = chk + 1; + chk->chunk_type = SCTP_PAD_CHUNK; + chk->chunk_flags = 0; + chk->chunk_length = htons(protlen - + (sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); + } } - if (protlen >= - (int)(sizeof(struct sctphdr) + 2 * sizeof(struct sctp_chunkhdr))) { - chk = chk + 1; - chk->chunk_type = SCTP_PAD_CHUNK; - chk->chunk_flags = 0; - chk->chunk_length = htons(protlen - - (sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); - } if (doipcksum) { sctp->checksum = sctp_crc32c(sctp, protlen); } @@ -1519,10 +1565,20 @@ sctp_check(const u_char *data, int seq) { struct sctphdr *const sctp = (struct sctphdr *) data; - return (ntohs(sctp->src_port) == ident - && ntohs(sctp->dest_port) == port + (fixedPort ? 0 : seq) - && sctp->v_tag == - (u_int32_t)((sctp->src_port << 16) | sctp->dest_port)); + if (ntohs(sctp->src_port) != ident || + ntohs(sctp->dest_port) != port + (fixedPort ? 0 : seq)) + return (0); + if (protlen < (int)(sizeof(struct sctphdr) + + sizeof(struct sctp_init_chunk))) { + return (sctp->v_tag == + (u_int32_t)((sctp->src_port << 16) | sctp->dest_port)); + } else { + /* + * Don't verify the initiate_tag, since it is not available, + * most of the time. + */ + return (sctp->v_tag == 0); + } } void Modified: stable/11/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.8 Sat Apr 7 20:42:06 2018 (r332236) +++ stable/11/usr.sbin/traceroute6/traceroute6.8 Sat Apr 7 20:44:30 2018 (r332237) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2017 +.Dd January 27, 2018 .Dt TRACEROUTE6 8 .Os .\" @@ -140,6 +140,11 @@ that has no route through it specifies the source IPv6 address to be used. .It Fl S Use SCTP packets for the probes. +The size of probe packets must be a multiple of 4. +If +.Ar datalen +is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled +with a PAD chunk. For larger probe packets, an INIT chunk is used. .It Fl T Use TCP segments for the probes. .It Fl U Modified: stable/11/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 20:42:06 2018 (r332236) +++ stable/11/usr.sbin/traceroute6/traceroute6.c Sat Apr 7 20:44:30 2018 (r332237) @@ -272,6 +272,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -676,6 +677,11 @@ main(int argc, char *argv[]) } if (useproto == IPPROTO_UDP) datalen -= sizeof(struct udphdr); + if ((useproto == IPPROTO_SCTP) && (datalen & 3)) { + fprintf(stderr, + "traceroute6: packet size must be a multiple of 4.\n"); + exit(1); + } outpacket = malloc(datalen); if (!outpacket) { perror("malloc"); @@ -1049,6 +1055,8 @@ send_probe(int seq, u_long hops) struct icmp6_hdr *icp; struct sctphdr *sctp; struct sctp_chunkhdr *chk; + struct sctp_init_chunk *init; + struct sctp_paramhdr *param; struct tcphdr *tcp; int i; @@ -1080,23 +1088,64 @@ send_probe(int seq, u_long hops) sctp->src_port = htons(ident); sctp->dest_port = htons(port + seq); - sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port; - sctp->checksum = htonl(0); if (datalen >= (u_long)(sizeof(struct sctphdr) + - sizeof(struct sctp_chunkhdr))) { - chk = (struct sctp_chunkhdr *)(sctp + 1); - chk->chunk_type = SCTP_SHUTDOWN_ACK; - chk->chunk_flags = 0; - chk->chunk_length = htons(4); + sizeof(struct sctp_init_chunk))) { + sctp->v_tag = 0; + } else { + sctp->v_tag = (sctp->src_port << 16) | sctp->dest_port; } + sctp->checksum = htonl(0); if (datalen >= (u_long)(sizeof(struct sctphdr) + - 2 * sizeof(struct sctp_chunkhdr))) { - chk = chk + 1; - chk->chunk_type = SCTP_PAD_CHUNK; - chk->chunk_flags = 0; - chk->chunk_length = htons((u_int16_t)(datalen - - sizeof(struct sctphdr) - - sizeof(struct sctp_chunkhdr))); + sizeof(struct sctp_init_chunk))) { + /* + * Send a packet containing an INIT chunk. This works + * better in case of firewalls on the path, but + * results in a probe packet containing at least + * 32 bytes of payload. For shorter payloads, use + * SHUTDOWN-ACK chunks. + */ + init = (struct sctp_init_chunk *)(sctp + 1); + init->ch.chunk_type = SCTP_INITIATION; + init->ch.chunk_flags = 0; + init->ch.chunk_length = htons((u_int16_t)(datalen - + sizeof(struct sctphdr))); + init->init.initiate_tag = (sctp->src_port << 16) | + sctp->dest_port; + init->init.a_rwnd = htonl(1500); + init->init.num_outbound_streams = htons(1); + init->init.num_inbound_streams = htons(1); + init->init.initial_tsn = htonl(0); + if (datalen >= (u_long)(sizeof(struct sctphdr) + + sizeof(struct sctp_init_chunk) + + sizeof(struct sctp_paramhdr))) { + param = (struct sctp_paramhdr *)(init + 1); + param->param_type = htons(SCTP_PAD); + param->param_length = + htons((u_int16_t)(datalen - + sizeof(struct sctphdr) - + sizeof(struct sctp_init_chunk))); + } + } else { + /* + * Send a packet containing a SHUTDOWN-ACK chunk, + * possibly followed by a PAD chunk. + */ + if (datalen >= (u_long)(sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr))) { + chk = (struct sctp_chunkhdr *)(sctp + 1); + chk->chunk_type = SCTP_SHUTDOWN_ACK; + chk->chunk_flags = 0; + chk->chunk_length = htons(4); + } + if (datalen >= (u_long)(sizeof(struct sctphdr) + + 2 * sizeof(struct sctp_chunkhdr))) { + chk = chk + 1; + chk->chunk_type = SCTP_PAD_CHUNK; + chk->chunk_flags = 0; + chk->chunk_length = htons((u_int16_t)(datalen - + sizeof(struct sctphdr) - + sizeof(struct sctp_chunkhdr))); + } } sctp->checksum = sctp_crc32c(outpacket, datalen); break; @@ -1289,6 +1338,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) || type == ICMP6_DST_UNREACH) { struct ip6_hdr *hip; struct icmp6_hdr *icmp; + struct sctp_init_chunk *init; struct sctphdr *sctp; struct tcphdr *tcp; struct udphdr *udp; @@ -1317,12 +1367,34 @@ packet_ok(struct msghdr *mhdr, int cc, int seq) break; case IPPROTO_SCTP: sctp = (struct sctphdr *)up; - if (sctp->src_port == htons(ident) && - sctp->dest_port == htons(port + seq) && - sctp->v_tag == - (u_int32_t)((sctp->src_port << 16) | sctp->dest_port)) - return (type == ICMP6_TIME_EXCEEDED ? - -1 : code + 1); + if (sctp->src_port != htons(ident) || + sctp->dest_port != htons(port + seq)) { + break; + } + if (datalen >= (u_long)(sizeof(struct sctphdr) + + sizeof(struct sctp_init_chunk))) { + if (sctp->v_tag != 0) { + break; + } + init = (struct sctp_init_chunk *)(sctp + 1); + /* Check the initiate tag, if available. */ + if ((char *)&init->init.a_rwnd > buf + cc) { + return (type == ICMP6_TIME_EXCEEDED ? + -1 : code + 1); + } + if (init->init.initiate_tag == (u_int32_t) + ((sctp->src_port << 16) | sctp->dest_port)) { + return (type == ICMP6_TIME_EXCEEDED ? + -1 : code + 1); + } + } else { + if (sctp->v_tag == + (u_int32_t)((sctp->src_port << 16) | + sctp->dest_port)) { + return (type == ICMP6_TIME_EXCEEDED ? + -1 : code + 1); + } + } break; case IPPROTO_TCP: tcp = (struct tcphdr *)up; From owner-svn-src-all@freebsd.org Sat Apr 7 20:47:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D5CF83FDF; Sat, 7 Apr 2018 20:47:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07A2A6C0AC; Sat, 7 Apr 2018 20:47:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3F7425D40; Sat, 7 Apr 2018 20:47:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KlP71098944; Sat, 7 Apr 2018 20:47:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KlPBl098943; Sat, 7 Apr 2018 20:47:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072047.w37KlPBl098943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332238 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:47:26 -0000 Author: tuexen Date: Sat Apr 7 20:47:25 2018 New Revision: 332238 URL: https://svnweb.freebsd.org/changeset/base/332238 Log: MFC r331061: Set the inp_vflag consistently for accepted TCP/IPv6 connections when net.inet6.ip6.v6only=0. Without this patch, the inp_vflag would have INP_IPV4 and the INP_IPV6 flags for accepted TCP/IPv6 connections if the sysctl variable net.inet6.ip6.v6only is 0. This resulted in netstat to report the source and destination addresses as IPv4 addresses, even they are IPv6 addresses. PR: 226421 Reviewed by: bz, hiren, kib Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D13514 Modified: stable/11/sys/netinet/tcp_syncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Sat Apr 7 20:44:30 2018 (r332237) +++ stable/11/sys/netinet/tcp_syncache.c Sat Apr 7 20:47:25 2018 (r332238) @@ -687,6 +687,8 @@ syncache_socket(struct syncache *sc, struct socket *ls inp->inp_inc.inc_flags = sc->sc_inc.inc_flags; #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { + inp->inp_vflag &= ~INP_IPV4; + inp->inp_vflag |= INP_IPV6; inp->in6p_laddr = sc->sc_inc.inc6_laddr; } else { inp->inp_vflag &= ~INP_IPV6; From owner-svn-src-all@freebsd.org Sat Apr 7 20:52:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A029F845B8; Sat, 7 Apr 2018 20:52:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F28BF6EABA; Sat, 7 Apr 2018 20:52:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB53225EB3; Sat, 7 Apr 2018 20:52:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Kq5x9003685; Sat, 7 Apr 2018 20:52:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Kq57f003683; Sat, 7 Apr 2018 20:52:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072052.w37Kq57f003683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332239 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:52:06 -0000 Author: tuexen Date: Sat Apr 7 20:52:05 2018 New Revision: 332239 URL: https://svnweb.freebsd.org/changeset/base/332239 Log: MFC r327919: Add support for readv() and writev() to truss. Sponsored by:i Netflix, Inc. Modified: stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscall.h ============================================================================== --- stable/11/usr.bin/truss/syscall.h Sat Apr 7 20:47:25 2018 (r332238) +++ stable/11/usr.bin/truss/syscall.h Sat Apr 7 20:52:05 2018 (r332239) @@ -81,7 +81,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, Kevent11, + PSig, Siginfo, Kevent11, Iovec, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 20:47:25 2018 (r332238) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 20:52:05 2018 (r332239) @@ -370,6 +370,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, + { .name = "readv", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, @@ -504,6 +506,8 @@ static struct syscall decoded_syscalls[] = { { Siginfo | OUT, 5 } } }, { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, + { .name = "writev", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, /* Linux ABI */ { .name = "linux_access", .ret_type = 1, .nargs = 2, @@ -2062,6 +2066,68 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, " }"); } else fprintf(fp, "0x%lx", args[sc->offset]); + break; + } +#define IOV_LIMIT 26 + case Iovec: { + /* + * Print argument as an array of struct iovec, where the next + * syscall argument is the number of elements of the array. + */ + struct iovec iov[IOV_LIMIT]; + size_t max_string = trussinfo->strsize; + char tmp2[max_string + 1], *tmp3; + size_t len; + int i, iovcnt; + bool buf_truncated, iov_truncated; + + iovcnt = args[sc->offset + 1]; + if (iovcnt <= 0) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + if (iovcnt > IOV_LIMIT) { + iovcnt = IOV_LIMIT; + iov_truncated = true; + } else { + iov_truncated = false; + } + if (get_struct(pid, (void *)args[sc->offset], + &iov, iovcnt * sizeof(struct iovec)) == -1) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + + fprintf(fp, "%s", "["); + for (i = 0; i < iovcnt; i++) { + len = iov[i].iov_len; + if (len > max_string) { + len = max_string; + buf_truncated = true; + } else { + buf_truncated = false; + } + fprintf(fp, "%s{", (i > 0) ? "," : ""); + if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) + != -1) { + tmp3 = malloc(len * 4 + 1); + while (len) { + if (strvisx(tmp3, tmp2, len, + VIS_CSTYLE|VIS_TAB|VIS_NL) <= + (int)max_string) + break; + len--; + buf_truncated = true; + } + fprintf(fp, "\"%s\"%s", tmp3, + buf_truncated ? "..." : ""); + free(tmp3); + } else { + fprintf(fp, "0x%p", iov[i].iov_base); + } + fprintf(fp, ",%zu}", iov[i].iov_len); + } + fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); break; } From owner-svn-src-all@freebsd.org Sat Apr 7 20:53:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19912F84776; Sat, 7 Apr 2018 20:53:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF81A6F815; Sat, 7 Apr 2018 20:53:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6FD125ED3; Sat, 7 Apr 2018 20:53:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KrYkt003785; Sat, 7 Apr 2018 20:53:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KrYba003784; Sat, 7 Apr 2018 20:53:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072053.w37KrYba003784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 20:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332240 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 332240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:53:35 -0000 Author: ian Date: Sat Apr 7 20:53:34 2018 New Revision: 332240 URL: https://svnweb.freebsd.org/changeset/base/332240 Log: Add the ioctl definitions for spigen get/set spi mode. Should have been part of r332233. Modified: head/sys/sys/spigenio.h Modified: head/sys/sys/spigenio.h ============================================================================== --- head/sys/sys/spigenio.h Sat Apr 7 20:52:05 2018 (r332239) +++ head/sys/sys/spigenio.h Sat Apr 7 20:53:34 2018 (r332240) @@ -50,5 +50,7 @@ struct spigen_transfer_mmapped { struct spigen_transfer_mmapped) #define SPIGENIOC_GET_CLOCK_SPEED _IOR(SPIGENIOC_BASE, 2, uint32_t) #define SPIGENIOC_SET_CLOCK_SPEED _IOW(SPIGENIOC_BASE, 3, uint32_t) +#define SPIGENIOC_GET_SPI_MODE _IOR(SPIGENIOC_BASE, 4, uint32_t) +#define SPIGENIOC_SET_SPI_MODE _IOW(SPIGENIOC_BASE, 5, uint32_t) #endif /* !_SYS_SPIGENIO_H_ */ From owner-svn-src-all@freebsd.org Sat Apr 7 20:54:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310FCF848A2; Sat, 7 Apr 2018 20:54:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D18E170198; Sat, 7 Apr 2018 20:54:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB65925ED4; Sat, 7 Apr 2018 20:54:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KsbOD003867; Sat, 7 Apr 2018 20:54:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Ksbmg003866; Sat, 7 Apr 2018 20:54:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072054.w37Ksbmg003866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332241 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:54:38 -0000 Author: tuexen Date: Sat Apr 7 20:54:37 2018 New Revision: 332241 URL: https://svnweb.freebsd.org/changeset/base/332241 Log: MFC r327921: Fix a typo introduced in r327919. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 20:53:34 2018 (r332240) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 20:54:37 2018 (r332241) @@ -2068,7 +2068,7 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, "0x%lx", args[sc->offset]); break; } -#define IOV_LIMIT 26 +#define IOV_LIMIT 16 case Iovec: { /* * Print argument as an array of struct iovec, where the next From owner-svn-src-all@freebsd.org Sat Apr 7 20:56:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64D9BF84ABC; Sat, 7 Apr 2018 20:56:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1660F70EF6; Sat, 7 Apr 2018 20:56:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E4FE25ED6; Sat, 7 Apr 2018 20:56:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37Ku7mL003997; Sat, 7 Apr 2018 20:56:07 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37Ku74o003996; Sat, 7 Apr 2018 20:56:07 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072056.w37Ku74o003996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332242 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:56:08 -0000 Author: tuexen Date: Sat Apr 7 20:56:07 2018 New Revision: 332242 URL: https://svnweb.freebsd.org/changeset/base/332242 Log: MFC r327961: Mark the iovec parameters of writev() and readv() as IN and OUT. This makes truss work on readv() as expected. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 20:54:37 2018 (r332241) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 20:56:07 2018 (r332242) @@ -371,7 +371,7 @@ static struct syscall decoded_syscalls[] = { { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, { .name = "readv", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, + .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlinkat", .ret_type = 1, .nargs = 4, @@ -507,7 +507,7 @@ static struct syscall decoded_syscalls[] = { { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, { .name = "writev", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Iovec, 1 }, { Int, 2 } } }, + .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 } } }, /* Linux ABI */ { .name = "linux_access", .ret_type = 1, .nargs = 2, From owner-svn-src-all@freebsd.org Sat Apr 7 20:57:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8DB0F84C1C; Sat, 7 Apr 2018 20:57:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5056971AEE; Sat, 7 Apr 2018 20:57:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B69525ED7; Sat, 7 Apr 2018 20:57:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37KvSc4004098; Sat, 7 Apr 2018 20:57:28 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37KvR0P004093; Sat, 7 Apr 2018 20:57:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072057.w37KvR0P004093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 20:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332243 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 332243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 20:57:29 -0000 Author: tuexen Date: Sat Apr 7 20:57:27 2018 New Revision: 332243 URL: https://svnweb.freebsd.org/changeset/base/332243 Log: MFC r327962: Add support for the supported PR-SCTP policies. Modified: stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/flags.c stable/11/lib/libsysdecode/mktables stable/11/lib/libsysdecode/sysdecode.h stable/11/lib/libsysdecode/sysdecode_enum.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Sat Apr 7 20:56:07 2018 (r332242) +++ stable/11/lib/libsysdecode/Makefile Sat Apr 7 20:57:27 2018 (r332243) @@ -50,6 +50,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_rlimit.3 \ sysdecode_enum.3 sysdecode_rtprio_function.3 \ sysdecode_enum.3 sysdecode_scheduler_policy.3 \ + sysdecode_enum.3 sysdecode_sctp_pr_policy.3 \ sysdecode_enum.3 sysdecode_semctl_cmd.3 \ sysdecode_enum.3 sysdecode_shmctl_cmd.3 \ sysdecode_enum.3 sysdecode_shutdown_how.3 \ Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Sat Apr 7 20:56:07 2018 (r332242) +++ stable/11/lib/libsysdecode/flags.c Sat Apr 7 20:57:27 2018 (r332243) @@ -1156,3 +1156,10 @@ sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) } } } + +const char * +sysdecode_sctp_pr_policy(int policy) +{ + + return (lookup_value(sctpprpolicy, policy)); +} Modified: stable/11/lib/libsysdecode/mktables ============================================================================== --- stable/11/lib/libsysdecode/mktables Sat Apr 7 20:56:07 2018 (r332242) +++ stable/11/lib/libsysdecode/mktables Sat Apr 7 20:57:27 2018 (r332243) @@ -157,6 +157,7 @@ gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" +gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_BUF|SCTP_PR_SCTP_MAX|SCTP_PR_SCTP_ALL" if [ -e "${include_dir}/x86/sysarch.h" ]; then gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" else Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 20:56:07 2018 (r332242) +++ stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 20:57:27 2018 (r332243) @@ -89,6 +89,7 @@ bool sysdecode_rfork_flags(FILE *_fp, int _flags, int const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); +const char *sysdecode_sctp_pr_policy(int _policy); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); Modified: stable/11/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_enum.3 Sat Apr 7 20:56:07 2018 (r332242) +++ stable/11/lib/libsysdecode/sysdecode_enum.3 Sat Apr 7 20:57:27 2018 (r332243) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 3, 2017 +.Dd January 14, 2018 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -53,6 +53,7 @@ .Nm sysdecode_rlimit , .Nm sysdecode_rtprio_function , .Nm sysdecode_scheduler_policy , +.Nm sysdecode_sctp_pr_policy , .Nm sysdecode_semctl_cmd , .Nm sysdecode_shmctl_cmd , .Nm sysdecode_shutdown_how , @@ -126,6 +127,8 @@ .Ft const char * .Fn sysdecode_scheduler_policy "int policy" .Ft const char * +.Fn sysdecode_sctp_pr_policy "int policy" +.Ft const char * .Fn sysdecode_semctl_cmd "int cmd" .Ft const char * .Fn sysdecode_shmctl_cmd "int cmd" @@ -229,6 +232,8 @@ Other functions decode the values described below: .Bl -tag -width "Fn sysdecode_sockaddr_family" .It Fn sysdecode_ipproto An IP protocol. +.It Fn sysdecode_sctp_pr_policy +A PR-SCTP policy. .It Fn sysdecode_signal A process signal. .It Fn sysdecode_sockaddr_family From owner-svn-src-all@freebsd.org Sat Apr 7 21:00:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB4C5F84F7D; Sat, 7 Apr 2018 21:00:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69626733BD; Sat, 7 Apr 2018 21:00:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E9E325EDB; Sat, 7 Apr 2018 21:00:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L0MmO004299; Sat, 7 Apr 2018 21:00:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L0LfE004293; Sat, 7 Apr 2018 21:00:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072100.w37L0LfE004293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332244 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 332244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:00:23 -0000 Author: tuexen Date: Sat Apr 7 21:00:21 2018 New Revision: 332244 URL: https://svnweb.freebsd.org/changeset/base/332244 Log: MFC r327966: Add a function is decode the sinfo_flags of struct sctp_sndrcvinfo. Added: stable/11/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 - copied unchanged from r327966, head/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 Modified: stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/flags.c stable/11/lib/libsysdecode/sysdecode.3 stable/11/lib/libsysdecode/sysdecode.h stable/11/lib/libsysdecode/sysdecode_enum.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Sat Apr 7 20:57:27 2018 (r332243) +++ stable/11/lib/libsysdecode/Makefile Sat Apr 7 21:00:21 2018 (r332244) @@ -21,6 +21,7 @@ MAN= sysdecode.3 \ sysdecode_ioctlname.3 \ sysdecode_mask.3 \ sysdecode_quotactl_cmd.3 \ + sysdecode_sctp_sinfo_flags.3 \ sysdecode_sigcode.3 \ sysdecode_sockopt_name.3 \ sysdecode_socket_protocol.3 \ Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Sat Apr 7 20:57:27 2018 (r332243) +++ stable/11/lib/libsysdecode/flags.c Sat Apr 7 21:00:21 2018 (r332244) @@ -1163,3 +1163,31 @@ sysdecode_sctp_pr_policy(int policy) return (lookup_value(sctpprpolicy, policy)); } + +static struct name_table sctpsinfoflags[] = { + X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) + X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND +}; + +void +sysdecode_sctp_sinfo_flags(FILE *fp, int sinfo_flags) +{ + const char *temp; + int rem; + bool printed; + + printed = print_mask_0(fp, sctpsinfoflags, sinfo_flags, &rem); + if (rem & ~SCTP_PR_SCTP_ALL) { + fprintf(fp, "%s%#x", printed ? "|" : "", rem & ~SCTP_PR_SCTP_ALL); + printed = true; + rem &= ~SCTP_PR_SCTP_ALL; + } + if (rem != 0) { + temp = sysdecode_sctp_pr_policy(rem); + if (temp != NULL) { + fprintf(fp, "%s%s", printed ? "|" : "", temp); + } else { + fprintf(fp, "%s%#x", printed ? "|" : "", rem); + } + } +} Modified: stable/11/lib/libsysdecode/sysdecode.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.3 Sat Apr 7 20:57:27 2018 (r332243) +++ stable/11/lib/libsysdecode/sysdecode.3 Sat Apr 7 21:00:21 2018 (r332244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2017 +.Dd January 14, 2018 .Dt SYSDECODE 3 .Os .Sh NAME @@ -76,6 +76,7 @@ A placeholder for use when the ABI is not known. .Xr sysdecode_kevent 3 , .Xr sysdecode_mask 3 , .Xr sysdecode_quotactl_cmd 3 , +.Xr sysdecode_sctp_sinfo_flags 3 , .Xr sysdecode_sigcode 3 , .Xr sysdecode_socket_protocol 3 , .Xr sysdecode_sockopt_name 3 , Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 20:57:27 2018 (r332243) +++ stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 21:00:21 2018 (r332244) @@ -90,6 +90,7 @@ const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); const char *sysdecode_sctp_pr_policy(int _policy); +void sysdecode_sctp_sinfo_flags(FILE *_fp, int _sinfo_flags); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); Modified: stable/11/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_enum.3 Sat Apr 7 20:57:27 2018 (r332243) +++ stable/11/lib/libsysdecode/sysdecode_enum.3 Sat Apr 7 21:00:21 2018 (r332244) @@ -54,6 +54,7 @@ .Nm sysdecode_rtprio_function , .Nm sysdecode_scheduler_policy , .Nm sysdecode_sctp_pr_policy , +.Nm sysdecode_sctp_sinfo_flags , .Nm sysdecode_semctl_cmd , .Nm sysdecode_shmctl_cmd , .Nm sysdecode_shutdown_how , Copied: stable/11/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 (from r327966, head/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3 Sat Apr 7 21:00:21 2018 (r332244, copy of r327966, head/lib/libsysdecode/sysdecode_sctp_sinfo_flags.3) @@ -0,0 +1,55 @@ +.\" +.\" Copyright (c) 2018 Michael Tuexen +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 14, 2018 +.Dt sysdecode_sctp_sinfo_flags 3 +.Os +.Sh NAME +.Nm sysdecode_sctp_sinfo_flags +.Nd output textual description of the sinfo_flags field of struct sctp_sndrcvinfo +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In stdio.h +.In sysdecode.h +.Ft void +.Fn sysdecode_sctp_sinfo_flags "FILE *fp" "int sinfo_flags" +.Sh DESCRIPTION +The +.Fn sysdecode_sctp_sinfo_flags +function outputs a textual description of the +.Fa sinfo_flags +member of a +.Vt struct sctp_sndrcvinfo +to the stream +.Fa fp . +In particular, the embedded PR-SCTP policies are handled. +.Sh SEE ALSO +.Xr sysdecode 3 +.Xr sysdecode_sctp_pr_policy 3 From owner-svn-src-all@freebsd.org Sat Apr 7 21:01:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBD2FF85233; Sat, 7 Apr 2018 21:01:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81974740E1; Sat, 7 Apr 2018 21:01:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7997425F37; Sat, 7 Apr 2018 21:01:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L1ifU006670; Sat, 7 Apr 2018 21:01:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L1iQK006668; Sat, 7 Apr 2018 21:01:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072101.w37L1iQK006668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332245 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:01:45 -0000 Author: tuexen Date: Sat Apr 7 21:01:43 2018 New Revision: 332245 URL: https://svnweb.freebsd.org/changeset/base/332245 Log: MFC r327967: Improve support for sctp_generic_recvmsg() and sctp_generic_sendmsg() and add support for sctp_generic_sendmsg_iov(). Handle the struct iovec argument and the struct sctp_sndrcvinfo arguments. Modified: stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscall.h ============================================================================== --- stable/11/usr.bin/truss/syscall.h Sat Apr 7 21:00:21 2018 (r332244) +++ stable/11/usr.bin/truss/syscall.h Sat Apr 7 21:01:43 2018 (r332245) @@ -81,7 +81,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, Kevent11, Iovec, + PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:00:21 2018 (r332244) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:01:43 2018 (r332245) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -412,13 +413,17 @@ static struct syscall decoded_syscalls[] = { { .name = "sched_setscheduler", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Schedpolicy, 1 }, { Schedparam, 2 } } }, { .name = "sctp_generic_recvmsg", .ret_type = 1, .nargs = 7, - .args = { { Int, 0 }, { Ptr | IN, 1 }, { Int, 2 }, - { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, { Ptr | OUT, 5 }, - { Ptr | OUT, 6 } } }, + .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 }, + { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, + { Sctpsndrcvinfo | OUT, 5 }, { Ptr | OUT, 6 } } }, { .name = "sctp_generic_sendmsg", .ret_type = 1, .nargs = 7, .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, - { Sockaddr | IN, 3 }, { Socklent, 4 }, { Ptr | IN, 5 }, - { Msgflags, 6 } } }, + { Sockaddr | IN, 3 }, { Socklent, 4 }, + { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, + { .name = "sctp_generic_sendmsg_iov", .ret_type = 1, .nargs = 7, + .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 }, + { Sockaddr | IN, 3 }, { Socklent, 4 }, + { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, @@ -2128,6 +2133,33 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, ",%zu}", iov[i].iov_len); } fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); + break; + } + case Sctpsndrcvinfo: { + struct sctp_sndrcvinfo info; + + if (get_struct(pid, (void *)args[sc->offset], + &info, sizeof(struct sctp_sndrcvinfo)) == -1) { + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + fprintf(fp, "{sid=%u,", info.sinfo_stream); + if (sc->type & OUT) { + fprintf(fp, "ssn=%u,", info.sinfo_ssn); + } + fputs("flgs=", fp); + sysdecode_sctp_sinfo_flags(fp, info.sinfo_flags); + fprintf(fp, ",ppid=%u,", ntohl(info.sinfo_ppid)); + /* Can't use IN here, since IN is 0 */ + if ((sc->type & OUT) == 0) { + fprintf(fp, "ctx=%u,", info.sinfo_context); + fprintf(fp, "ttl=%u,", info.sinfo_timetolive); + } + if (sc->type & OUT) { + fprintf(fp, "tsn=%u,", info.sinfo_tsn); + fprintf(fp, "cumtsn=%u,", info.sinfo_cumtsn); + } + fprintf(fp, "id=%u}", info.sinfo_assoc_id); break; } From owner-svn-src-all@freebsd.org Sat Apr 7 21:02:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A63F8538C; Sat, 7 Apr 2018 21:02:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2492749E9; Sat, 7 Apr 2018 21:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD1882607E; Sat, 7 Apr 2018 21:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L2gOf009143; Sat, 7 Apr 2018 21:02:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L2geB009142; Sat, 7 Apr 2018 21:02:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072102.w37L2geB009142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332246 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 332246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:02:43 -0000 Author: tuexen Date: Sat Apr 7 21:02:42 2018 New Revision: 332246 URL: https://svnweb.freebsd.org/changeset/base/332246 Log: MFC r327994: Simplify table generation. Modified: stable/11/lib/libsysdecode/mktables Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/mktables ============================================================================== --- stable/11/lib/libsysdecode/mktables Sat Apr 7 21:01:43 2018 (r332245) +++ stable/11/lib/libsysdecode/mktables Sat Apr 7 21:02:42 2018 (r332246) @@ -157,7 +157,7 @@ gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" -gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_BUF|SCTP_PR_SCTP_MAX|SCTP_PR_SCTP_ALL" +gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL" if [ -e "${include_dir}/x86/sysarch.h" ]; then gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" else From owner-svn-src-all@freebsd.org Sat Apr 7 21:03:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A85F854A1; Sat, 7 Apr 2018 21:03:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C43CF7535B; Sat, 7 Apr 2018 21:03:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB9D22607F; Sat, 7 Apr 2018 21:03:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L3lcX009240; Sat, 7 Apr 2018 21:03:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L3l3N009233; Sat, 7 Apr 2018 21:03:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072103.w37L3l3N009233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332247 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 332247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:03:48 -0000 Author: tuexen Date: Sat Apr 7 21:03:46 2018 New Revision: 332247 URL: https://svnweb.freebsd.org/changeset/base/332247 Log: MFC r327995: Add support for decoding the type of a cmsg. Added: stable/11/lib/libsysdecode/sysdecode_cmsg_type.3 - copied unchanged from r327995, head/lib/libsysdecode/sysdecode_cmsg_type.3 Modified: stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/flags.c stable/11/lib/libsysdecode/mktables stable/11/lib/libsysdecode/sysdecode.3 stable/11/lib/libsysdecode/sysdecode.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Sat Apr 7 21:02:42 2018 (r332246) +++ stable/11/lib/libsysdecode/Makefile Sat Apr 7 21:03:46 2018 (r332247) @@ -15,6 +15,7 @@ CFLAGS+= -I${SRCTOP}/libexec/rtld-elf MAN= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ sysdecode_cap_rights.3 \ + sysdecode_cmsg_type.3 \ sysdecode_enum.3 \ sysdecode_fcntl_arg.3 \ sysdecode_kevent.3 \ Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Sat Apr 7 21:02:42 2018 (r332246) +++ stable/11/lib/libsysdecode/flags.c Sat Apr 7 21:03:46 2018 (r332247) @@ -1157,6 +1157,46 @@ sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp) } } +static struct name_table cmsgtypeip[] = { + X(IP_RECVDSTADDR) X(IP_RECVTTL) X(IP_RECVOPTS) X(IP_RECVRETOPTS) + X(IP_RECVIF) X(IP_RECVTOS) X(IP_FLOWID) X(IP_FLOWTYPE) + X(IP_RSSBUCKETID) XEND +}; + +static struct name_table cmsgtypeipv6[] = { +#if 0 + /* The RFC 2292 defines are kernel space only. */ + X(IPV6_2292PKTINFO) X(IPV6_2292HOPLIMIT) X(IPV6_2292HOPOPTS) + X(IPV6_2292DSTOPTS) X(IPV6_2292RTHDR) X(IPV6_2292NEXTHOP) +#endif + X(IPV6_PKTINFO) X(IPV6_HOPLIMIT) X(IPV6_HOPOPTS) + X(IPV6_DSTOPTS) X(IPV6_RTHDR) X(IPV6_NEXTHOP) + X(IPV6_TCLASS) X(IPV6_FLOWID) X(IPV6_FLOWTYPE) X(IPV6_RSSBUCKETID) + X(IPV6_PATHMTU) X(IPV6_RTHDRDSTOPTS) X(IPV6_USE_MIN_MTU) + X(IPV6_DONTFRAG) X(IPV6_PREFER_TEMPADDR) XEND +}; + +static struct name_table cmsgtypesctp[] = { + X(SCTP_INIT) X(SCTP_SNDRCV) X(SCTP_EXTRCV) X(SCTP_SNDINFO) + X(SCTP_RCVINFO) X(SCTP_NXTINFO) X(SCTP_PRINFO) X(SCTP_AUTHINFO) + X(SCTP_DSTADDRV4) X(SCTP_DSTADDRV6) XEND +}; + +const char * +sysdecode_cmsg_type(int cmsg_level, int cmsg_type) +{ + + if (cmsg_level == SOL_SOCKET) + return (lookup_value(cmsgtypesocket, cmsg_type)); + if (cmsg_level == IPPROTO_IP) + return (lookup_value(cmsgtypeip, cmsg_type)); + if (cmsg_level == IPPROTO_IPV6) + return (lookup_value(cmsgtypeipv6, cmsg_type)); + if (cmsg_level == IPPROTO_SCTP) + return (lookup_value(cmsgtypesctp, cmsg_type)); + return (NULL); +} + const char * sysdecode_sctp_pr_policy(int policy) { Modified: stable/11/lib/libsysdecode/mktables ============================================================================== --- stable/11/lib/libsysdecode/mktables Sat Apr 7 21:02:42 2018 (r332246) +++ stable/11/lib/libsysdecode/mktables Sat Apr 7 21:03:46 2018 (r332247) @@ -158,6 +158,7 @@ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]] gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL" +gen_table "cmsgtypesocket" "SCM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/socket.h" if [ -e "${include_dir}/x86/sysarch.h" ]; then gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" else Modified: stable/11/lib/libsysdecode/sysdecode.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.3 Sat Apr 7 21:02:42 2018 (r332246) +++ stable/11/lib/libsysdecode/sysdecode.3 Sat Apr 7 21:03:46 2018 (r332247) @@ -70,6 +70,7 @@ A placeholder for use when the ABI is not known. .Sh SEE ALSO .Xr sysdecode_abi_to_freebsd_errno 3 , .Xr sysdecode_cap_rights 3 , +.Xr sysdecode_cmsg_type 3 , .Xr sysdecode_enum 3 , .Xr sysdecode_fcntl_arg 3 , .Xr sysdecode_ioctlname 3 , Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 21:02:42 2018 (r332246) +++ stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 21:03:46 2018 (r332247) @@ -45,6 +45,7 @@ const char *sysdecode_atfd(int _fd); bool sysdecode_atflags(FILE *_fp, int _flags, int *_rem); bool sysdecode_cap_fcntlrights(FILE *_fp, uint32_t _rights, uint32_t *_rem); void sysdecode_cap_rights(FILE *_fp, cap_rights_t *_rightsp); +const char *sysdecode_cmsg_type(int _cmsg_level, int _cmsg_type); const char *sysdecode_extattrnamespace(int _namespace); const char *sysdecode_fadvice(int _advice); void sysdecode_fcntl_arg(FILE *_fp, int _cmd, uintptr_t _arg, int _base); Copied: stable/11/lib/libsysdecode/sysdecode_cmsg_type.3 (from r327995, head/lib/libsysdecode/sysdecode_cmsg_type.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libsysdecode/sysdecode_cmsg_type.3 Sat Apr 7 21:03:46 2018 (r332247, copy of r327995, head/lib/libsysdecode/sysdecode_cmsg_type.3) @@ -0,0 +1,54 @@ +.\" +.\" Copyright (c) 2018 Michael Tuexen +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 15, 2018 +.Dt sysdecode_cmsg_type 3 +.Os +.Sh NAME +.Nm sysdecode_cmsg_type +.Nd lookup name of cmsg type +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In sysdecode.h +.Ft const char * +.Fn sysdecode_cmsg_type "int cmsg_level" "int cmsg_type" +.Sh DESCRIPTION +The +.Fn sysdecode_cmsg_type +function returns a text description of the +.Fa cmsg_type +member of a +.Vt struct cmsghdr . +.Fn sysdecode_cmsg_type +also takes the +.Fa cmsg_level +to uniquely identify the type. +.Sh SEE ALSO +.Xr sysdecode 3 From owner-svn-src-all@freebsd.org Sat Apr 7 21:04:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09022F855D5; Sat, 7 Apr 2018 21:04:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC21275D30; Sat, 7 Apr 2018 21:04:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A59CC26080; Sat, 7 Apr 2018 21:04:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L4htl009329; Sat, 7 Apr 2018 21:04:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L4ha2009324; Sat, 7 Apr 2018 21:04:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072104.w37L4ha2009324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332248 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 332248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:04:44 -0000 Author: tuexen Date: Sat Apr 7 21:04:43 2018 New Revision: 332248 URL: https://svnweb.freebsd.org/changeset/base/332248 Log: MFC r328014: Add support for decoding the nxt_flags, rcv_flags, and snd_flags of SCTP level cmsgs. Modified: stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/flags.c stable/11/lib/libsysdecode/sysdecode.h stable/11/lib/libsysdecode/sysdecode_mask.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Sat Apr 7 21:03:46 2018 (r332247) +++ stable/11/lib/libsysdecode/Makefile Sat Apr 7 21:04:43 2018 (r332248) @@ -96,6 +96,9 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ sysdecode_mask.3 sysdecode_semget_flags.3 \ sysdecode_mask.3 sysdecode_sendfile_flags.3 \ sysdecode_mask.3 sysdecode_shmat_flags.3 \ + sysdecode_mask.3 sysdecode_sctp_nxt_flags.3 \ + sysdecode_mask.3 sysdecode_sctp_rcv_flags.3 \ + sysdecode_mask.3 sysdecode_sctp_snd_flags.3 \ sysdecode_mask.3 sysdecode_socket_type.3 \ sysdecode_mask.3 sysdecode_thr_create_flags.3 \ sysdecode_mask.3 sysdecode_umtx_cvwait_flags.3 \ Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Sat Apr 7 21:03:46 2018 (r332247) +++ stable/11/lib/libsysdecode/flags.c Sat Apr 7 21:04:43 2018 (r332248) @@ -1204,6 +1204,40 @@ sysdecode_sctp_pr_policy(int policy) return (lookup_value(sctpprpolicy, policy)); } +static struct name_table sctpsndflags[] = { + X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) + X(SCTP_SENDALL) X(SCTP_SACK_IMMEDIATELY) XEND +}; + +bool +sysdecode_sctp_snd_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, sctpsndflags, flags, rem)); +} + +static struct name_table sctprcvflags[] = { + X(SCTP_UNORDERED) XEND +}; + +bool +sysdecode_sctp_rcv_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, sctprcvflags, flags, rem)); +} + +static struct name_table sctpnxtflags[] = { + X(SCTP_UNORDERED) X(SCTP_COMPLETE) X(SCTP_NOTIFICATION) XEND +}; + +bool +sysdecode_sctp_nxt_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, sctpnxtflags, flags, rem)); +} + static struct name_table sctpsinfoflags[] = { X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 21:03:46 2018 (r332247) +++ stable/11/lib/libsysdecode/sysdecode.h Sat Apr 7 21:04:43 2018 (r332248) @@ -90,8 +90,11 @@ bool sysdecode_rfork_flags(FILE *_fp, int _flags, int const char *sysdecode_rlimit(int _resource); const char *sysdecode_rtprio_function(int _function); const char *sysdecode_scheduler_policy(int _policy); +bool sysdecode_sctp_nxt_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_sctp_pr_policy(int _policy); +bool sysdecode_sctp_rcv_flags(FILE *_fp, int _flags, int *_rem); void sysdecode_sctp_sinfo_flags(FILE *_fp, int _sinfo_flags); +bool sysdecode_sctp_snd_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_semctl_cmd(int _cmd); bool sysdecode_semget_flags(FILE *_fp, int _flag, int *_rem); bool sysdecode_sendfile_flags(FILE *_fp, int _flags, int *_rem); Modified: stable/11/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_mask.3 Sat Apr 7 21:03:46 2018 (r332247) +++ stable/11/lib/libsysdecode/sysdecode_mask.3 Sat Apr 7 21:04:43 2018 (r332248) @@ -50,6 +50,9 @@ .Nm sysdecode_semget_flags , .Nm sysdecode_sendfile_flags , .Nm sysdecode_shmat_flags , +.Nm sysdecode_sctp_nxt_flags , +.Nm sysdecode_sctp_rcv_flags , +.Nm sysdecode_sctp_snd_flags , .Nm sysdecode_socket_type , .Nm sysdecode_thr_create_flags , .Nm sysdecode_umtx_cvwait_flags , @@ -100,6 +103,12 @@ .Ft bool .Fn sysdecode_rfork_flags "FILE *fp" "int flags" "int *rem" .Ft bool +.Fn sysdecode_sctp_nxt_flags "FILE *fp" "int flags" "int *rem" +.Ft bool +.Fn sysdecode_sctp_rcv_flags "FILE *fp" "int flags" "int *rem" +.Ft bool +.Fn sysdecode_sctp_snd_flags "FILE *fp" "int flags" "int *rem" +.Ft bool .Fn sysdecode_semget_flags "FILE *fp" "int flags" "int *rem" .Ft bool .Fn sysdecode_sendfile_flags "FILE *fp" "int flags" "int *rem" @@ -185,6 +194,21 @@ and .Dv F_SETFL .Xr fcntl 2 commands. +.It Fn sysdecode_sctp_nxt_flags +The +.Fa nxt_flags +member of a +.Vt struct sctp_nxtinfo . +.It Fn sysdecode_sctp_rcv_flags +The +.Fa rcv_flags +member of a +.Vt struct sctp_rcvinfo . +.It Fn sysdecode_sctp_snd_flags +The +.Fa snd_flags +member of a +.Vt struct sctp_sndinfo . .It Fn sysdecode_umtx_cvwait_flags The .Fa val From owner-svn-src-all@freebsd.org Sat Apr 7 21:05:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0EE4F856CB; Sat, 7 Apr 2018 21:05:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AEAC765E7; Sat, 7 Apr 2018 21:05:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747AB26081; Sat, 7 Apr 2018 21:05:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L5dDs009422; Sat, 7 Apr 2018 21:05:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L5dbW009420; Sat, 7 Apr 2018 21:05:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072105.w37L5dbW009420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332249 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:05:40 -0000 Author: tuexen Date: Sat Apr 7 21:05:39 2018 New Revision: 332249 URL: https://svnweb.freebsd.org/changeset/base/332249 Log: MFC r328015: Decode msghdr argument of sendmsg() and recvmsg(). Modified: stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscall.h ============================================================================== --- stable/11/usr.bin/truss/syscall.h Sat Apr 7 21:04:43 2018 (r332248) +++ stable/11/usr.bin/truss/syscall.h Sat Apr 7 21:05:39 2018 (r332249) @@ -81,7 +81,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, + PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, Msghdr, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:04:43 2018 (r332248) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:05:39 2018 (r332249) @@ -385,7 +385,7 @@ static struct syscall decoded_syscalls[] = { { Msgflags, 3 }, { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } }, { .name = "recvmsg", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Ptr, 1 }, { Msgflags, 2 } } }, + .args = { { Int, 0 }, { Msghdr | OUT, 1 }, { Msgflags, 2 } } }, { .name = "rename", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Name, 1 } } }, { .name = "renameat", .ret_type = 1, .nargs = 4, @@ -428,7 +428,7 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, { .name = "sendmsg", .ret_type = 1, .nargs = 3, - .args = { { Int, 0 }, { Ptr, 1 }, { Msgflags, 2 } } }, + .args = { { Int, 0 }, { Msghdr | IN, 1 }, { Msgflags, 2 } } }, { .name = "sendto", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | IN, 4 }, @@ -1142,6 +1142,378 @@ print_utrace(FILE *fp, void *utrace_addr, size_t len) fprintf(fp, " }"); } +static void +print_sockaddr(FILE *fp, struct trussinfo *trussinfo, void *arg, socklen_t len) +{ + char addr[64]; + struct sockaddr_in *lsin; + struct sockaddr_in6 *lsin6; + struct sockaddr_un *sun; + struct sockaddr *sa; + u_char *q; + pid_t pid = trussinfo->curthread->proc->pid; + + if (arg == NULL) { + fputs("NULL", fp); + return; + } + /* If the length is too small, just bail. */ + if (len < sizeof(*sa)) { + fprintf(fp, "0x%p", arg); + return; + } + + sa = calloc(1, len); + if (get_struct(pid, arg, sa, len) == -1) { + free(sa); + fprintf(fp, "0x%p", arg); + return; + } + + switch (sa->sa_family) { + case AF_INET: + if (len < sizeof(*lsin)) + goto sockaddr_short; + lsin = (struct sockaddr_in *)(void *)sa; + inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr)); + fprintf(fp, "{ AF_INET %s:%d }", addr, + htons(lsin->sin_port)); + break; + case AF_INET6: + if (len < sizeof(*lsin6)) + goto sockaddr_short; + lsin6 = (struct sockaddr_in6 *)(void *)sa; + inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, + sizeof(addr)); + fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, + htons(lsin6->sin6_port)); + break; + case AF_UNIX: + sun = (struct sockaddr_un *)sa; + fprintf(fp, "{ AF_UNIX \"%.*s\" }", + (int)(len - offsetof(struct sockaddr_un, sun_path)), + sun->sun_path); + break; + default: + sockaddr_short: + fprintf(fp, + "{ sa_len = %d, sa_family = %d, sa_data = {", + (int)sa->sa_len, (int)sa->sa_family); + for (q = (u_char *)sa->sa_data; + q < (u_char *)sa + len; q++) + fprintf(fp, "%s 0x%02x", + q == (u_char *)sa->sa_data ? "" : ",", + *q); + fputs(" } }", fp); + } + free(sa); +} + +#define IOV_LIMIT 16 + +static void +print_iovec(FILE *fp, struct trussinfo *trussinfo, void *arg, int iovcnt) +{ + struct iovec iov[IOV_LIMIT]; + size_t max_string = trussinfo->strsize; + char tmp2[max_string + 1], *tmp3; + size_t len; + pid_t pid = trussinfo->curthread->proc->pid; + int i; + bool buf_truncated, iov_truncated; + + if (iovcnt <= 0) { + fprintf(fp, "0x%p", arg); + return; + } + if (iovcnt > IOV_LIMIT) { + iovcnt = IOV_LIMIT; + iov_truncated = true; + } else { + iov_truncated = false; + } + if (get_struct(pid, arg, &iov, iovcnt * sizeof(struct iovec)) == -1) { + fprintf(fp, "0x%p", arg); + return; + } + + fputs("[", fp); + for (i = 0; i < iovcnt; i++) { + len = iov[i].iov_len; + if (len > max_string) { + len = max_string; + buf_truncated = true; + } else { + buf_truncated = false; + } + fprintf(fp, "%s{", (i > 0) ? "," : ""); + if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) != -1) { + tmp3 = malloc(len * 4 + 1); + while (len) { + if (strvisx(tmp3, tmp2, len, + VIS_CSTYLE|VIS_TAB|VIS_NL) <= + (int)max_string) + break; + len--; + buf_truncated = true; + } + fprintf(fp, "\"%s\"%s", tmp3, + buf_truncated ? "..." : ""); + free(tmp3); + } else { + fprintf(fp, "0x%p", iov[i].iov_base); + } + fprintf(fp, ",%zu}", iov[i].iov_len); + } + fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); +} + +static void +print_gen_cmsg(FILE *fp, struct cmsghdr *cmsghdr) +{ + u_char *q; + + fputs("{", fp); + for (q = CMSG_DATA(cmsghdr); + q < (u_char *)cmsghdr + cmsghdr->cmsg_len; q++) { + fprintf(fp, "%s0x%02x", q == CMSG_DATA(cmsghdr) ? "" : ",", *q); + } + fputs("}", fp); +} + +static void +print_sctp_initmsg(FILE *fp, struct sctp_initmsg *init) +{ + fprintf(fp, "{out=%u,", init->sinit_num_ostreams); + fprintf(fp, "in=%u,", init->sinit_max_instreams); + fprintf(fp, "max_rtx=%u,", init->sinit_max_attempts); + fprintf(fp, "max_rto=%u}", init->sinit_max_init_timeo); +} + +static void +print_sctp_sndrcvinfo(FILE *fp, bool recv, struct sctp_sndrcvinfo *info) +{ + fprintf(fp, "{sid=%u,", info->sinfo_stream); + if (recv) { + fprintf(fp, "ssn=%u,", info->sinfo_ssn); + } + fputs("flgs=", fp); + sysdecode_sctp_sinfo_flags(fp, info->sinfo_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->sinfo_ppid)); + if (!recv) { + fprintf(fp, "ctx=%u,", info->sinfo_context); + fprintf(fp, "ttl=%u,", info->sinfo_timetolive); + } + if (recv) { + fprintf(fp, "tsn=%u,", info->sinfo_tsn); + fprintf(fp, "cumtsn=%u,", info->sinfo_cumtsn); + } + fprintf(fp, "id=%u}", info->sinfo_assoc_id); +} + +static void +print_sctp_sndinfo(FILE *fp, struct sctp_sndinfo *info) +{ + fprintf(fp, "{sid=%u,", info->snd_sid); + fputs("flgs=", fp); + print_mask_arg(sysdecode_sctp_snd_flags, fp, info->snd_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->snd_ppid)); + fprintf(fp, "ctx=%u,", info->snd_context); + fprintf(fp, "id=%u}", info->snd_assoc_id); +} + +static void +print_sctp_rcvinfo(FILE *fp, struct sctp_rcvinfo *info) +{ + fprintf(fp, "{sid=%u,", info->rcv_sid); + fprintf(fp, "ssn=%u,", info->rcv_ssn); + fputs("flgs=", fp); + print_mask_arg(sysdecode_sctp_rcv_flags, fp, info->rcv_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->rcv_ppid)); + fprintf(fp, "tsn=%u,", info->rcv_tsn); + fprintf(fp, "cumtsn=%u,", info->rcv_cumtsn); + fprintf(fp, "ctx=%u,", info->rcv_context); + fprintf(fp, "id=%u}", info->rcv_assoc_id); +} + +static void +print_sctp_nxtinfo(FILE *fp, struct sctp_nxtinfo *info) +{ + fprintf(fp, "{sid=%u,", info->nxt_sid); + fputs("flgs=", fp); + print_mask_arg(sysdecode_sctp_nxt_flags, fp, info->nxt_flags); + fprintf(fp, ",ppid=%u,", ntohl(info->nxt_ppid)); + fprintf(fp, "len=%u,", info->nxt_length); + fprintf(fp, "id=%u}", info->nxt_assoc_id); +} + +static void +print_sctp_prinfo(FILE *fp, struct sctp_prinfo *info) +{ + fputs("{pol=", fp); + print_integer_arg(sysdecode_sctp_pr_policy, fp, info->pr_policy); + fprintf(fp, ",val=%u}", info->pr_value); +} + +static void +print_sctp_authinfo(FILE *fp, struct sctp_authinfo *info) +{ + fprintf(fp, "{num=%u}", info->auth_keynumber); +} + +static void +print_sctp_ipv4_addr(FILE *fp, struct in_addr *addr) +{ + char buf[INET_ADDRSTRLEN]; + const char *s; + + s = inet_ntop(AF_INET, addr, buf, INET_ADDRSTRLEN); + if (s != NULL) + fprintf(fp, "{addr=%s}", s); + else + fputs("{addr=???}", fp); +} + +static void +print_sctp_ipv6_addr(FILE *fp, struct in6_addr *addr) +{ + char buf[INET6_ADDRSTRLEN]; + const char *s; + + s = inet_ntop(AF_INET6, addr, buf, INET6_ADDRSTRLEN); + if (s != NULL) + fprintf(fp, "{addr=%s}", s); + else + fputs("{addr=???}", fp); +} + +static void +print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *cmsghdr) +{ + void *data; + socklen_t len; + + len = cmsghdr->cmsg_len; + data = CMSG_DATA(cmsghdr); + switch (cmsghdr->cmsg_type) { + case SCTP_INIT: + if (len == CMSG_LEN(sizeof(struct sctp_initmsg))) + print_sctp_initmsg(fp, (struct sctp_initmsg *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_SNDRCV: + if (len == CMSG_LEN(sizeof(struct sctp_sndrcvinfo))) + print_sctp_sndrcvinfo(fp, recv, + (struct sctp_sndrcvinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; +#if 0 + case SCTP_EXTRCV: + if (len == CMSG_LEN(sizeof(struct sctp_extrcvinfo))) + print_sctp_extrcvinfo(fp, + (struct sctp_extrcvinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; +#endif + case SCTP_SNDINFO: + if (len == CMSG_LEN(sizeof(struct sctp_sndinfo))) + print_sctp_sndinfo(fp, (struct sctp_sndinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_RCVINFO: + if (len == CMSG_LEN(sizeof(struct sctp_rcvinfo))) + print_sctp_rcvinfo(fp, (struct sctp_rcvinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_NXTINFO: + if (len == CMSG_LEN(sizeof(struct sctp_nxtinfo))) + print_sctp_nxtinfo(fp, (struct sctp_nxtinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_PRINFO: + if (len == CMSG_LEN(sizeof(struct sctp_prinfo))) + print_sctp_prinfo(fp, (struct sctp_prinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_AUTHINFO: + if (len == CMSG_LEN(sizeof(struct sctp_authinfo))) + print_sctp_authinfo(fp, (struct sctp_authinfo *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_DSTADDRV4: + if (len == CMSG_LEN(sizeof(struct in_addr))) + print_sctp_ipv4_addr(fp, (struct in_addr *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + case SCTP_DSTADDRV6: + if (len == CMSG_LEN(sizeof(struct in6_addr))) + print_sctp_ipv6_addr(fp, (struct in6_addr *)data); + else + print_gen_cmsg(fp, cmsghdr); + break; + default: + print_gen_cmsg(fp, cmsghdr); + } +} + +static void +print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msghdr *msghdr) +{ + struct cmsghdr *cmsghdr; + char *cmsgbuf; + const char *temp; + socklen_t len; + int level, type; + bool first; + + len = msghdr->msg_controllen; + cmsgbuf = calloc(1, len); + if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { + fprintf(fp, "0x%p", msghdr); + free(cmsgbuf); + } + msghdr->msg_control = cmsgbuf; + first = true; + fputs("{", fp); + for (cmsghdr = CMSG_FIRSTHDR(msghdr); + cmsghdr != NULL; + cmsghdr = CMSG_NXTHDR(msghdr, cmsghdr)) { + level = cmsghdr->cmsg_level; + type = cmsghdr->cmsg_type; + len = cmsghdr->cmsg_len; + fprintf(fp, "%s{level=", first ? "" : ","); + print_integer_arg(sysdecode_sockopt_level, fp, level); + fputs(",type=", fp); + temp = sysdecode_cmsg_type(level, type); + if (temp) { + fputs(temp, fp); + } else { + fprintf(fp, "%d", type); + } + fputs(",data=", fp); + switch (level) { + case IPPROTO_SCTP: + print_sctp_cmsg(fp, recv, cmsghdr); + break; + default: + print_gen_cmsg(fp, cmsghdr); + break; + } + fputs("}", fp); + } + fputs("}", fp); + free(cmsgbuf); +} + /* * Converts a syscall argument into a string. Said string is * allocated via malloc(), so needs to be free()'d. sc is @@ -1596,13 +1968,7 @@ print_arg(struct syscall_args *sc, unsigned long *args print_mask_arg(sysdecode_rfork_flags, fp, args[sc->offset]); break; case Sockaddr: { - char addr[64]; - struct sockaddr_in *lsin; - struct sockaddr_in6 *lsin6; - struct sockaddr_un *sun; - struct sockaddr *sa; socklen_t len; - u_char *q; if (args[sc->offset] == 0) { fputs("NULL", fp); @@ -1624,56 +1990,7 @@ print_arg(struct syscall_args *sc, unsigned long *args } else len = args[sc->offset + 1]; - /* If the length is too small, just bail. */ - if (len < sizeof(*sa)) { - fprintf(fp, "0x%lx", args[sc->offset]); - break; - } - - sa = calloc(1, len); - if (get_struct(pid, (void *)args[sc->offset], sa, len) == -1) { - free(sa); - fprintf(fp, "0x%lx", args[sc->offset]); - break; - } - - switch (sa->sa_family) { - case AF_INET: - if (len < sizeof(*lsin)) - goto sockaddr_short; - lsin = (struct sockaddr_in *)(void *)sa; - inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr)); - fprintf(fp, "{ AF_INET %s:%d }", addr, - htons(lsin->sin_port)); - break; - case AF_INET6: - if (len < sizeof(*lsin6)) - goto sockaddr_short; - lsin6 = (struct sockaddr_in6 *)(void *)sa; - inet_ntop(AF_INET6, &lsin6->sin6_addr, addr, - sizeof(addr)); - fprintf(fp, "{ AF_INET6 [%s]:%d }", addr, - htons(lsin6->sin6_port)); - break; - case AF_UNIX: - sun = (struct sockaddr_un *)sa; - fprintf(fp, "{ AF_UNIX \"%.*s\" }", - (int)(len - offsetof(struct sockaddr_un, sun_path)), - sun->sun_path); - break; - default: - sockaddr_short: - fprintf(fp, - "{ sa_len = %d, sa_family = %d, sa_data = {", - (int)sa->sa_len, (int)sa->sa_family); - for (q = (u_char *)sa->sa_data; - q < (u_char *)sa + len; q++) - fprintf(fp, "%s 0x%02x", - q == (u_char *)sa->sa_data ? "" : ",", - *q); - fputs(" } }", fp); - } - free(sa); + print_sockaddr(fp, trussinfo, (void *)args[sc->offset], len); break; } case Sigaction: { @@ -2073,93 +2390,43 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, "0x%lx", args[sc->offset]); break; } -#define IOV_LIMIT 16 - case Iovec: { + case Iovec: /* * Print argument as an array of struct iovec, where the next * syscall argument is the number of elements of the array. */ - struct iovec iov[IOV_LIMIT]; - size_t max_string = trussinfo->strsize; - char tmp2[max_string + 1], *tmp3; - size_t len; - int i, iovcnt; - bool buf_truncated, iov_truncated; - iovcnt = args[sc->offset + 1]; - if (iovcnt <= 0) { - fprintf(fp, "0x%lx", args[sc->offset]); - break; - } - if (iovcnt > IOV_LIMIT) { - iovcnt = IOV_LIMIT; - iov_truncated = true; - } else { - iov_truncated = false; - } + print_iovec(fp, trussinfo, (void *)args[sc->offset], + (int)args[sc->offset + 1]); + break; + case Sctpsndrcvinfo: { + struct sctp_sndrcvinfo info; + if (get_struct(pid, (void *)args[sc->offset], - &iov, iovcnt * sizeof(struct iovec)) == -1) { + &info, sizeof(struct sctp_sndrcvinfo)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } - - fprintf(fp, "%s", "["); - for (i = 0; i < iovcnt; i++) { - len = iov[i].iov_len; - if (len > max_string) { - len = max_string; - buf_truncated = true; - } else { - buf_truncated = false; - } - fprintf(fp, "%s{", (i > 0) ? "," : ""); - if (len && get_struct(pid, iov[i].iov_base, &tmp2, len) - != -1) { - tmp3 = malloc(len * 4 + 1); - while (len) { - if (strvisx(tmp3, tmp2, len, - VIS_CSTYLE|VIS_TAB|VIS_NL) <= - (int)max_string) - break; - len--; - buf_truncated = true; - } - fprintf(fp, "\"%s\"%s", tmp3, - buf_truncated ? "..." : ""); - free(tmp3); - } else { - fprintf(fp, "0x%p", iov[i].iov_base); - } - fprintf(fp, ",%zu}", iov[i].iov_len); - } - fprintf(fp, "%s%s", iov_truncated ? ",..." : "", "]"); + print_sctp_sndrcvinfo(fp, sc->type & OUT, &info); break; } - case Sctpsndrcvinfo: { - struct sctp_sndrcvinfo info; + case Msghdr: { + struct msghdr msghdr; if (get_struct(pid, (void *)args[sc->offset], - &info, sizeof(struct sctp_sndrcvinfo)) == -1) { + &msghdr, sizeof(struct msghdr)) == -1) { fprintf(fp, "0x%lx", args[sc->offset]); break; } - fprintf(fp, "{sid=%u,", info.sinfo_stream); - if (sc->type & OUT) { - fprintf(fp, "ssn=%u,", info.sinfo_ssn); - } - fputs("flgs=", fp); - sysdecode_sctp_sinfo_flags(fp, info.sinfo_flags); - fprintf(fp, ",ppid=%u,", ntohl(info.sinfo_ppid)); - /* Can't use IN here, since IN is 0 */ - if ((sc->type & OUT) == 0) { - fprintf(fp, "ctx=%u,", info.sinfo_context); - fprintf(fp, "ttl=%u,", info.sinfo_timetolive); - } - if (sc->type & OUT) { - fprintf(fp, "tsn=%u,", info.sinfo_tsn); - fprintf(fp, "cumtsn=%u,", info.sinfo_cumtsn); - } - fprintf(fp, "id=%u}", info.sinfo_assoc_id); + fputs("{", fp); + print_sockaddr(fp, trussinfo, msghdr.msg_name, msghdr.msg_namelen); + fprintf(fp, ",%d,", msghdr.msg_namelen); + print_iovec(fp, trussinfo, msghdr.msg_iov, msghdr.msg_iovlen); + fprintf(fp, ",%d,", msghdr.msg_iovlen); + print_cmsgs(fp, pid, sc->type & OUT, &msghdr); + fprintf(fp, ",%u,", msghdr.msg_controllen); + print_mask_arg(sysdecode_msg_flags, fp, msghdr.msg_flags); + fputs("}", fp); break; } From owner-svn-src-all@freebsd.org Sat Apr 7 21:06:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02EB2F857AD; Sat, 7 Apr 2018 21:06:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA60E76F35; Sat, 7 Apr 2018 21:06:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A43E426083; Sat, 7 Apr 2018 21:06:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L6d1k009509; Sat, 7 Apr 2018 21:06:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L6dl3009508; Sat, 7 Apr 2018 21:06:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072106.w37L6dl3009508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332250 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/lib/libsysdecode X-SVN-Commit-Revision: 332250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:06:40 -0000 Author: tuexen Date: Sat Apr 7 21:06:39 2018 New Revision: 332250 URL: https://svnweb.freebsd.org/changeset/base/332250 Log: MFC r328033: Bump date, which I missed in r328014. Thanks to jhb@ for reporting. Modified: stable/11/lib/libsysdecode/sysdecode_mask.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_mask.3 Sat Apr 7 21:05:39 2018 (r332249) +++ stable/11/lib/libsysdecode/sysdecode_mask.3 Sat Apr 7 21:06:39 2018 (r332250) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2017 +.Dd January 16, 2018 .Dt sysdecode_mask 3 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sat Apr 7 21:07:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 699F3F858CA; Sat, 7 Apr 2018 21:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14ADD77990; Sat, 7 Apr 2018 21:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EB1126085; Sat, 7 Apr 2018 21:07:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L7lYO009601; Sat, 7 Apr 2018 21:07:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L7lEs009600; Sat, 7 Apr 2018 21:07:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072107.w37L7lEs009600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332251 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:07:48 -0000 Author: tuexen Date: Sat Apr 7 21:07:47 2018 New Revision: 332251 URL: https://svnweb.freebsd.org/changeset/base/332251 Log: MFC r328058: Using %p already prints "0x", so don't do it explicitly. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:06:39 2018 (r332250) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:07:47 2018 (r332251) @@ -1159,14 +1159,14 @@ print_sockaddr(FILE *fp, struct trussinfo *trussinfo, } /* If the length is too small, just bail. */ if (len < sizeof(*sa)) { - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } sa = calloc(1, len); if (get_struct(pid, arg, sa, len) == -1) { free(sa); - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } @@ -1223,7 +1223,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi bool buf_truncated, iov_truncated; if (iovcnt <= 0) { - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } if (iovcnt > IOV_LIMIT) { @@ -1233,7 +1233,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi iov_truncated = false; } if (get_struct(pid, arg, &iov, iovcnt * sizeof(struct iovec)) == -1) { - fprintf(fp, "0x%p", arg); + fprintf(fp, "%p", arg); return; } @@ -1261,7 +1261,7 @@ print_iovec(FILE *fp, struct trussinfo *trussinfo, voi buf_truncated ? "..." : ""); free(tmp3); } else { - fprintf(fp, "0x%p", iov[i].iov_base); + fprintf(fp, "%p", iov[i].iov_base); } fprintf(fp, ",%zu}", iov[i].iov_len); } @@ -1478,7 +1478,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msg len = msghdr->msg_controllen; cmsgbuf = calloc(1, len); if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { - fprintf(fp, "0x%p", msghdr); + fprintf(fp, "%p", msghdr->msg_control); free(cmsgbuf); } msghdr->msg_control = cmsgbuf; From owner-svn-src-all@freebsd.org Sat Apr 7 21:08:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCDDEF85A17; Sat, 7 Apr 2018 21:08:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7817F7828C; Sat, 7 Apr 2018 21:08:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F9B126086; Sat, 7 Apr 2018 21:08:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L8ip1009688; Sat, 7 Apr 2018 21:08:44 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L8iWU009687; Sat, 7 Apr 2018 21:08:44 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072108.w37L8iWU009687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332252 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:08:45 -0000 Author: tuexen Date: Sat Apr 7 21:08:44 2018 New Revision: 332252 URL: https://svnweb.freebsd.org/changeset/base/332252 Log: MFC r328059: Improve the printing of cmgs when the length is 0. Fix error handling. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:07:47 2018 (r332251) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:08:44 2018 (r332252) @@ -1476,10 +1476,15 @@ print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msg bool first; len = msghdr->msg_controllen; + if (len == 0) { + fputs("{}", fp); + return; + } cmsgbuf = calloc(1, len); if (get_struct(pid, msghdr->msg_control, cmsgbuf, len) == -1) { fprintf(fp, "%p", msghdr->msg_control); free(cmsgbuf); + return; } msghdr->msg_control = cmsgbuf; first = true; From owner-svn-src-all@freebsd.org Sat Apr 7 21:09:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43269F85B6D; Sat, 7 Apr 2018 21:09:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E34DC78CAD; Sat, 7 Apr 2018 21:09:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD6AF26087; Sat, 7 Apr 2018 21:09:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37L9pY0009778; Sat, 7 Apr 2018 21:09:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37L9pkv009777; Sat, 7 Apr 2018 21:09:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072109.w37L9pkv009777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332253 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:09:52 -0000 Author: tuexen Date: Sat Apr 7 21:09:51 2018 New Revision: 332253 URL: https://svnweb.freebsd.org/changeset/base/332253 Log: MFC r328081: Add missing assignment to make sure non-first cmsgs are handled as such. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:08:44 2018 (r332252) +++ stable/11/usr.bin/truss/syscalls.c Sat Apr 7 21:09:51 2018 (r332253) @@ -1514,6 +1514,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msg break; } fputs("}", fp); + first = false; } fputs("}", fp); free(cmsgbuf); From owner-svn-src-all@freebsd.org Sat Apr 7 21:12:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 772B5F85F07; Sat, 7 Apr 2018 21:12:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27D427A3E4; Sat, 7 Apr 2018 21:12:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2111626204; Sat, 7 Apr 2018 21:12:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37LCHV8014751; Sat, 7 Apr 2018 21:12:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37LCHkT014750; Sat, 7 Apr 2018 21:12:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072112.w37LCHkT014750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332254 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 332254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:12:17 -0000 Author: tuexen Date: Sat Apr 7 21:12:16 2018 New Revision: 332254 URL: https://svnweb.freebsd.org/changeset/base/332254 Log: MFC r327205: Fix an assignment. While there, do some whitespace cleanups. CID: 1008936 Modified: stable/11/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:09:51 2018 (r332253) +++ stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:12:16 2018 (r332254) @@ -2116,31 +2116,31 @@ FindSctpGlobal(struct libalias *la, struct in_addr g_a * @return pointer to association or NULL */ static struct sctp_nat_assoc* -FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) +FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) { u_int i; struct sctp_nat_assoc *assoc = NULL, *lastmatch = NULL; struct sctp_GlobalAddress *G_Addr = NULL; int cnt = 0; - + if (l_vtag != 0) { /* an init packet, vtag==0 */ i = SN_TABLE_HASH(l_vtag, g_port, la->sctpNatTableSize); LIST_FOREACH(assoc, &la->sctpTableGlobal[i], list_G) { if ((assoc->g_vtag == l_vtag) && (assoc->g_port == g_port) && (assoc->l_port == l_port)) { if (assoc->num_Gaddr) { LIST_FOREACH(G_Addr, &(assoc->Gaddr), list_Gaddr) { - if(G_Addr->g_addr.s_addr == G_Addr->g_addr.s_addr) - return(assoc); /* full match */ + if (G_Addr->g_addr.s_addr == g_addr.s_addr) + return (assoc); /* full match */ } } else { - if (++cnt > 1) return(NULL); + if (++cnt > 1) return (NULL); lastmatch = assoc; } } } } /* If there is more than one match we do not know which local address to send to */ - return( cnt ? lastmatch : NULL ); + return (cnt ? lastmatch : NULL); } /** @ingroup Hash From owner-svn-src-all@freebsd.org Sat Apr 7 21:22:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 567D2F86A79; Sat, 7 Apr 2018 21:22:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03BC67FCD9; Sat, 7 Apr 2018 21:22:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F21B7263B1; Sat, 7 Apr 2018 21:22:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37LMTCY019593; Sat, 7 Apr 2018 21:22:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37LMTNX019592; Sat, 7 Apr 2018 21:22:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072122.w37LMTNX019592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332255 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 332255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:22:30 -0000 Author: tuexen Date: Sat Apr 7 21:22:29 2018 New Revision: 332255 URL: https://svnweb.freebsd.org/changeset/base/332255 Log: Clarify that the break is not missing. CID: 1008198 Modified: stable/11/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:12:16 2018 (r332254) +++ stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:22:29 2018 (r332255) @@ -1374,6 +1374,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s case SCTP_ADD_IP_ADDRESS: /* skip to address parameter - leave param_size so bytes left will be calculated properly*/ param = (struct sctp_paramhdr *) &((struct sctp_asconf_addrv4_param *) param)->addrp; + /* FALLTHROUGH */ case SCTP_IPV4_ADDRESS: ipv4_param = (struct sctp_ipv4addr_param *) param; /* add addresses to association */ From owner-svn-src-all@freebsd.org Sat Apr 7 21:24:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0B34F86CA5; Sat, 7 Apr 2018 21:24:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E43C80C9A; Sat, 7 Apr 2018 21:24:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88239263B7; Sat, 7 Apr 2018 21:24:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37LOH1l019712; Sat, 7 Apr 2018 21:24:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37LOH6E019711; Sat, 7 Apr 2018 21:24:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072124.w37LOH6E019711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332256 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 332256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:24:18 -0000 Author: tuexen Date: Sat Apr 7 21:24:17 2018 New Revision: 332256 URL: https://svnweb.freebsd.org/changeset/base/332256 Log: MFC r327209: Clarify that there is no break missing. While there, cleanup whitespaces. Modified: stable/11/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:22:29 2018 (r332255) +++ stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:24:17 2018 (r332256) @@ -1735,27 +1735,28 @@ ProcessSctpMsg(struct libalias *la, int direction, str static int ID_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm) { - switch(sm->msg) { + switch (sm->msg) { case SN_SCTP_ASCONF: /* a packet containing an ASCONF chunk with ADDIP */ if (!sysctl_accept_global_ootb_addip && (direction == SN_TO_LOCAL)) - return(SN_DROP_PKT); + return (SN_DROP_PKT); /* if this Asconf packet does not contain the Vtag parameters it is of no use in Idle state */ if (!GetAsconfVtags(la, sm, &(assoc->l_vtag), &(assoc->g_vtag), direction)) - return(SN_DROP_PKT); + return (SN_DROP_PKT); + /* FALLTHROUGH */ case SN_SCTP_INIT: /* a packet containing an INIT chunk or an ASCONF AddIP */ if (sysctl_track_global_addresses) AddGlobalIPAddresses(sm, assoc, direction); - switch(direction){ + switch (direction) { case SN_TO_GLOBAL: assoc->l_addr = sm->ip_hdr->ip_src; assoc->a_addr = FindAliasAddress(la, assoc->l_addr); assoc->l_port = sm->sctp_hdr->src_port; assoc->g_port = sm->sctp_hdr->dest_port; - if(sm->msg == SN_SCTP_INIT) + if (sm->msg == SN_SCTP_INIT) assoc->g_vtag = sm->sctpchnk.Init->initiate_tag; if (AddSctpAssocGlobal(la, assoc)) /* DB clash *///**** need to add dst address return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR); - if(sm->msg == SN_SCTP_ASCONF) { + if (sm->msg == SN_SCTP_ASCONF) { if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_dst)) /* DB clash */ return(SN_REPLY_ERROR); assoc->TableRegister |= SN_WAIT_TOLOCAL; /* wait for tolocal ack */ @@ -1766,25 +1767,25 @@ ID_process(struct libalias *la, int direction, struct assoc->a_addr = sm->ip_hdr->ip_dst; assoc->l_port = sm->sctp_hdr->dest_port; assoc->g_port = sm->sctp_hdr->src_port; - if(sm->msg == SN_SCTP_INIT) + if (sm->msg == SN_SCTP_INIT) assoc->l_vtag = sm->sctpchnk.Init->initiate_tag; if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_src)) /* DB clash */ return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR); - if(sm->msg == SN_SCTP_ASCONF) { + if (sm->msg == SN_SCTP_ASCONF) { if (AddSctpAssocGlobal(la, assoc)) /* DB clash */ //**** need to add src address return(SN_REPLY_ERROR); assoc->TableRegister |= SN_WAIT_TOGLOBAL; /* wait for toglobal ack */ } break; } - assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa; - assoc->exp = SN_I_T(la); - sctp_AddTimeOut(la,assoc); - return(SN_NAT_PKT); + assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa; + assoc->exp = SN_I_T(la); + sctp_AddTimeOut(la,assoc); + return (SN_NAT_PKT); default: /* Any other type of SCTP message is not valid in Idle */ - return(SN_DROP_PKT); + return (SN_DROP_PKT); } -return(SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ + return (SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ } /** @ingroup state_machine From owner-svn-src-all@freebsd.org Sat Apr 7 21:25:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4373FF86DDF; Sat, 7 Apr 2018 21:25:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E551981767; Sat, 7 Apr 2018 21:25:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF86F263B9; Sat, 7 Apr 2018 21:25:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37LPTTN019824; Sat, 7 Apr 2018 21:25:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37LPTcE019823; Sat, 7 Apr 2018 21:25:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804072125.w37LPTcE019823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 7 Apr 2018 21:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332257 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 332257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:25:30 -0000 Author: tuexen Date: Sat Apr 7 21:25:29 2018 New Revision: 332257 URL: https://svnweb.freebsd.org/changeset/base/332257 Log: MFC r327214: Whitespace changes. Modified: stable/11/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:24:17 2018 (r332256) +++ stable/11/sys/netinet/libalias/alias_sctp.c Sat Apr 7 21:25:29 2018 (r332257) @@ -25,7 +25,7 @@ */ /* - * Alias_sctp forms part of the libalias kernel module to handle + * Alias_sctp forms part of the libalias kernel module to handle * Network Address Translation (NAT) for the SCTP protocol. * * This software was developed by David A. Hayes and Jason But @@ -37,13 +37,13 @@ * proposed by Jason But and Grenville Armitage: * http://caia.swin.edu.au/urp/sonata/ * - * + * * This project has been made possible in part by a grant from * the Cisco University Research Program Fund at Community * Foundation Silicon Valley. * */ -/** @mainpage +/** @mainpage * Alias_sctp is part of the SONATA (http://caia.swin.edu.au/urp/sonata) project * to develop and release a BSD licensed implementation of a Network Address * Translation (NAT) module that supports the Stream Control Transmission @@ -174,7 +174,7 @@ static void SctpAliasLog(const char *format, ...); * * Calls the higher level ShowAliasStats() in alias_db.c which logs all current * statistics about the libalias instance - including SCTP statistics - * + * * @param la Pointer to the libalias instance */ void SctpShowAliasStats(struct libalias *la); @@ -259,7 +259,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d * Define various log levels and a macro to call specified log functions only if * the current log level (sysctl_log_level) matches the specified level @{ */ -#define SN_LOG_LOW 0 +#define SN_LOG_LOW 0 #define SN_LOG_EVENT 1 #define SN_LOG_INFO 2 #define SN_LOG_DETAIL 3 @@ -420,8 +420,8 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &level, 0, req); if (error) return (error); - level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); - level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); + level = (level > SN_LOG_DEBUG_MAX) ? (SN_LOG_DEBUG_MAX) : (level); + level = (level < SN_LOG_LOW) ? (SN_LOG_LOW) : (level); sysctl_log_level = level; return (0); } @@ -441,12 +441,11 @@ int sysctl_chg_timer(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &timer, 0, req); if (error) return (error); - timer = (timer > SN_MAX_TIMER)?(SN_MAX_TIMER):(timer); + timer = (timer > SN_MAX_TIMER) ? (SN_MAX_TIMER) : (timer); - if (((u_int *)arg1) != &sysctl_holddown_timer) - { - timer = (timer < SN_MIN_TIMER)?(SN_MIN_TIMER):(timer); - } + if (((u_int *)arg1) != &sysctl_holddown_timer) { + timer = (timer < SN_MIN_TIMER) ? (SN_MIN_TIMER) : (timer); + } *(u_int *)arg1 = timer; @@ -470,11 +469,11 @@ int sysctl_chg_hashtable_size(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &size, 0, req); if (error) return (error); - size = (size < SN_MIN_HASH_SIZE)?(SN_MIN_HASH_SIZE):((size > SN_MAX_HASH_SIZE)?(SN_MAX_HASH_SIZE):(size)); + size = (size < SN_MIN_HASH_SIZE) ? (SN_MIN_HASH_SIZE) : ((size > SN_MAX_HASH_SIZE) ? (SN_MAX_HASH_SIZE) : (size)); size |= 0x00000001; /* make odd */ - for(;(((size % 3) == 0) || ((size % 5) == 0) || ((size % 7) == 0) || ((size % 11) == 0)); size+=2); + for (;(((size % 3) == 0) || ((size % 5) == 0) || ((size % 7) == 0) || ((size % 11) == 0)); size+=2); sysctl_hashtable_size = size; return (0); @@ -483,7 +482,7 @@ int sysctl_chg_hashtable_size(SYSCTL_HANDLER_ARGS) /** @ingroup sysctl * @brief sysctl callback for changing net.inet.ip.alias.sctp.error_on_ootb * - * Updates the error_on_clash sysctl variable. + * Updates the error_on_clash sysctl variable. * If set to 0, no ErrorM will be sent if there is a look up table clash * If set to 1, an ErrorM is sent only to the local side * If set to 2, an ErrorM is sent to the local side and global side if there is @@ -538,16 +537,16 @@ int sysctl_chg_initialising_chunk_proc_limit(SYSCTL_HA if (error) return (error); sysctl_initialising_chunk_proc_limit = (proclimit < 1) ? 1: proclimit; - sysctl_chunk_proc_limit = + sysctl_chunk_proc_limit = (sysctl_chunk_proc_limit < sysctl_initialising_chunk_proc_limit) ? sysctl_initialising_chunk_proc_limit : sysctl_chunk_proc_limit; - + return (0); } /** @ingroup sysctl * @brief sysctl callback for changing net.inet.ip.alias.sctp.chunk_proc_limit * - * Updates the chunk_proc_limit sysctl variable. + * Updates the chunk_proc_limit sysctl variable. * Number of chunks that should be processed to find key chunk: * >= initialising_chunk_proc_limit (A high value is a DoS risk) */ @@ -559,7 +558,7 @@ int sysctl_chg_chunk_proc_limit(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &proclimit, 0, req); if (error) return (error); - sysctl_chunk_proc_limit = + sysctl_chunk_proc_limit = (proclimit < sysctl_initialising_chunk_proc_limit) ? sysctl_initialising_chunk_proc_limit : proclimit; return (0); @@ -569,7 +568,7 @@ int sysctl_chg_chunk_proc_limit(SYSCTL_HANDLER_ARGS) /** @ingroup sysctl * @brief sysctl callback for changing net.inet.ip.alias.sctp.param_proc_limit * - * Updates the param_proc_limit sysctl variable. + * Updates the param_proc_limit sysctl variable. * Number of parameters that should be processed to find key parameters: * > 1 (A high value is a DoS risk) */ @@ -581,7 +580,7 @@ int sysctl_chg_param_proc_limit(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &proclimit, 0, req); if (error) return (error); - sysctl_param_proc_limit = + sysctl_param_proc_limit = (proclimit < 2) ? 2 : proclimit; return (0); @@ -612,9 +611,9 @@ int sysctl_chg_track_global_addresses(SYSCTL_HANDLER_A * CODE BEGINS HERE * ---------------------------------------------------------------------- */ -/** +/** * @brief Initialises the SCTP NAT Implementation - * + * * Creates the look-up tables and the timer queue and initialises all state * variables * @@ -648,7 +647,7 @@ void AliasSctpInit(struct libalias *la) la->sctpLinkCount = 0; } -/** +/** * @brief Cleans-up the SCTP NAT Implementation prior to unloading * * Removes all entries from the timer queue, freeing associations as it goes. @@ -703,7 +702,7 @@ void AliasSctpTerm(struct libalias *la) * @param la Pointer to the relevant libalias instance * @param pip Pointer to IP packet to process * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * * @return PKT_ALIAS_OK | PKT_ALIAS_IGNORE | PKT_ALIAS_ERROR */ int @@ -715,10 +714,10 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir if ((direction != SN_TO_LOCAL) && (direction != SN_TO_GLOBAL)) { SctpAliasLog("ERROR: Invalid direction\n"); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } - sctp_CheckTimers(la); /* Check timers */ + sctp_CheckTimers(la); /* Check timers */ /* Parse the packet */ rtnval = sctp_PktParser(la, direction, pip, &msg, &assoc); //using *char (change to mbuf when get code from paolo) @@ -733,24 +732,24 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir } SN_LOG(SN_LOG_EVENT, logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction)); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); case SN_PARSE_ERROR_PARTIALLOOKUP: if (sysctl_error_on_ootb > SN_LOCALandPARTIAL_ERROR_ON_OOTB) { SN_LOG(SN_LOG_EVENT, logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction)); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } case SN_PARSE_ERROR_LOOKUP: if (sysctl_error_on_ootb == SN_ERROR_ON_OOTB || (sysctl_error_on_ootb == SN_LOCALandPARTIAL_ERROR_ON_OOTB && direction == SN_TO_LOCAL) || (sysctl_error_on_ootb == SN_LOCAL_ERROR_ON_OOTB && direction == SN_TO_GLOBAL)) { TxAbortErrorM(la, &msg, assoc, SN_REFLECT_ERROR, direction); /*NB assoc=NULL */ - return(PKT_ALIAS_RESPOND); + return (PKT_ALIAS_RESPOND); } default: SN_LOG(SN_LOG_EVENT, logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction)); - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } SN_LOG(SN_LOG_DETAIL, @@ -768,9 +767,9 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir ); SN_LOG(SN_LOG_DEBUG, logTimerQ(la)); - switch(rtnval){ + switch (rtnval) { case SN_NAT_PKT: - switch(direction) { + switch (direction) { case SN_TO_LOCAL: DifferentialChecksum(&(msg.ip_hdr->ip_sum), &(assoc->l_addr), &(msg.ip_hdr->ip_dst), 2); @@ -792,7 +791,7 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir break; case SN_REPLY_ABORT: case SN_REPLY_ERROR: - case SN_SEND_ABORT: + case SN_SEND_ABORT: TxAbortErrorM(la, &msg, assoc, rtnval, direction); break; default: @@ -812,22 +811,22 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir freeGlobalAddressList(assoc); sn_free(assoc); } - switch(rtnval) { + switch (rtnval) { case SN_NAT_PKT: - return(PKT_ALIAS_OK); + return (PKT_ALIAS_OK); case SN_SEND_ABORT: - return(PKT_ALIAS_OK); + return (PKT_ALIAS_OK); case SN_REPLY_ABORT: case SN_REPLY_ERROR: case SN_REFLECT_ERROR: - return(PKT_ALIAS_RESPOND); + return (PKT_ALIAS_RESPOND); case SN_DROP_PKT: default: - return(PKT_ALIAS_ERROR); + return (PKT_ALIAS_ERROR); } } -/** +/** * @brief Send an AbortM or ErrorM * * We construct the new SCTP packet to send in place of the existing packet we @@ -863,7 +862,7 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir static uint32_t local_sctp_finalize_crc32(uint32_t crc32c) { - /* This routine is duplicated from SCTP + /* This routine is duplicated from SCTP * we need to do that since it MAY be that SCTP * is NOT compiled into the kernel. The CRC32C routines * however are always available in libkern. @@ -922,7 +921,7 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg ip->ip_hl = 5; /* 5*32 bit words */ ip->ip_tos = 0; ip->ip_len = htons(ip_size); - ip->ip_id = sm->ip_hdr->ip_id; + ip->ip_id = sm->ip_hdr->ip_id; ip->ip_off = 0; ip->ip_ttl = 255; ip->ip_p = IPPROTO_SCTP; @@ -935,7 +934,7 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg chunk_hdr->chunk_type = (sndrply & SN_TX_ABORT) ? SCTP_ABORT_ASSOCIATION : SCTP_OPERATION_ERROR; chunk_hdr->chunk_flags = SCTP_MIDDLEBOX_FLAG; if (include_error_cause) { - error_cause->code = htons((sndrply & SN_REFLECT_ERROR) ? SCTP_MISSING_NAT : SCTP_NAT_TABLE_COLLISION); + error_cause->code = htons((sndrply & SN_REFLECT_ERROR) ? SCTP_MISSING_NAT : SCTP_NAT_TABLE_COLLISION); error_cause->length = htons(sizeof(struct sctp_error_cause)); chunk_hdr->chunk_length = htons(sizeof(*chunk_hdr) + sizeof(struct sctp_error_cause)); } else { @@ -943,22 +942,22 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg } /* set specific values */ - switch(sndrply) { + switch (sndrply) { case SN_REFLECT_ERROR: chunk_hdr->chunk_flags |= SCTP_HAD_NO_TCB; /* set Tbit */ - sctp_hdr->v_tag = sm->sctp_hdr->v_tag; + sctp_hdr->v_tag = sm->sctp_hdr->v_tag; break; case SN_REPLY_ERROR: - sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag : assoc->l_vtag ; + sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag : assoc->l_vtag ; break; case SN_SEND_ABORT: - sctp_hdr->v_tag = sm->sctp_hdr->v_tag; + sctp_hdr->v_tag = sm->sctp_hdr->v_tag; break; case SN_REPLY_ABORT: sctp_hdr->v_tag = sm->sctpchnk.Init->initiate_tag; break; } - + /* Set send/reply values */ if (sndrply == SN_SEND_ABORT) { /*pass through NAT */ ip->ip_src = (direction == SN_TO_LOCAL) ? sm->ip_hdr->ip_src : assoc->a_addr; @@ -971,10 +970,10 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg sctp_hdr->src_port = sm->sctp_hdr->dest_port; sctp_hdr->dest_port = sm->sctp_hdr->src_port; } - + /* Calculate IP header checksum */ ip->ip_sum = in_cksum_hdr(ip); - + /* calculate SCTP header CRC32 */ sctp_hdr->checksum = 0; sctp_hdr->checksum = local_sctp_finalize_crc32(calculate_crc32c(0xffffffff, (unsigned char *) sctp_hdr, sctp_size)); @@ -1001,18 +1000,18 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg */ /** @ingroup packet_parser * @brief Parses SCTP packets for the key SCTP chunk that will be processed - * + * * This module parses SCTP packets for the key SCTP chunk that will be processed * The module completes the sctp_nat_msg structure and either retrieves the * relevant (existing) stored association from the Hash Tables or creates a new * association entity with state SN_ID * * @param la Pointer to the relevant libalias instance - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * @param pip + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * @param pip * @param sm Pointer to sctp message information * @param passoc Pointer to the association this SCTP Message belongs to - * + * * @return SN_PARSE_OK | SN_PARSE_ERROR_* */ static int @@ -1047,26 +1046,26 @@ sctp_PktParser(struct libalias *la, int direction, str /* Check SCTP header length and move to first chunk */ if (bytes_left < sizeof(struct sctphdr)) { sm->sctp_hdr = NULL; - return(SN_PARSE_ERROR_IPSHL); /* packet not long enough*/ + return (SN_PARSE_ERROR_IPSHL); /* packet not long enough*/ } sm->sctp_hdr = sctp_hdr = (struct sctphdr *) ip_next(pip); bytes_left -= sizeof(struct sctphdr); - + /* Check for valid ports (zero valued ports would find partially initialised associations */ if (sctp_hdr->src_port == 0 || sctp_hdr->dest_port == 0) - return(SN_PARSE_ERROR_PORT); + return (SN_PARSE_ERROR_PORT); /* Check length of first chunk */ if (bytes_left < SN_MIN_CHUNK_SIZE) /* malformed chunk - could cause endless loop*/ - return(SN_PARSE_ERROR_CHHL); /* packet not long enough for this chunk */ - + return (SN_PARSE_ERROR_CHHL); /* packet not long enough for this chunk */ + /* First chunk */ chunk_hdr = SN_SCTP_FIRSTCHUNK(sctp_hdr); - + chunk_length = SCTP_SIZE32(ntohs(chunk_hdr->chunk_length)); if ((chunk_length < SN_MIN_CHUNK_SIZE) || (chunk_length > bytes_left)) /* malformed chunk - could cause endless loop*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); if ((chunk_hdr->chunk_flags & SCTP_HAD_NO_TCB) && ((chunk_hdr->chunk_type == SCTP_ABORT_ASSOCIATION) || @@ -1089,43 +1088,43 @@ sctp_PktParser(struct libalias *la, int direction, str sm->msg = SN_SCTP_OTHER;/* Initialise to largest value*/ sm->chunk_length = 0; /* only care about length for key chunks */ while (IS_SCTP_CONTROL(chunk_hdr)) { - switch(chunk_hdr->chunk_type) { + switch (chunk_hdr->chunk_type) { case SCTP_INITIATION: if (chunk_length < sizeof(struct sctp_init_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); sm->msg = SN_SCTP_INIT; sm->sctpchnk.Init = (struct sctp_init *) ((char *) chunk_hdr + sizeof(struct sctp_chunkhdr)); sm->chunk_length = chunk_length; /* if no existing association, create a new one */ if (*passoc == NULL) { - if (sctp_hdr->v_tag == 0){ //Init requires vtag=0 + if (sctp_hdr->v_tag == 0) { //Init requires vtag=0 *passoc = (struct sctp_nat_assoc *) sn_malloc(sizeof(struct sctp_nat_assoc)); - if (*passoc == NULL) {/* out of resources */ - return(SN_PARSE_ERROR_AS_MALLOC); + if (*passoc == NULL) {/* out of resources */ + return (SN_PARSE_ERROR_AS_MALLOC); } /* Initialise association - malloc initialises memory to zeros */ (*passoc)->state = SN_ID; LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */ (*passoc)->TableRegister = SN_NULL_TBL; - return(SN_PARSE_OK); + return (SN_PARSE_OK); } - return(SN_PARSE_ERROR_VTAG); + return (SN_PARSE_ERROR_VTAG); } - return(SN_PARSE_ERROR_LOOKUP); + return (SN_PARSE_ERROR_LOOKUP); case SCTP_INITIATION_ACK: if (chunk_length < sizeof(struct sctp_init_ack_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); sm->msg = SN_SCTP_INITACK; sm->sctpchnk.InitAck = (struct sctp_init_ack *) ((char *) chunk_hdr + sizeof(struct sctp_chunkhdr)); sm->chunk_length = chunk_length; - return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK)); + return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK)); case SCTP_ABORT_ASSOCIATION: /* access only minimum sized chunk */ sm->msg = SN_SCTP_ABORT; sm->chunk_length = chunk_length; - return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP_ABORT):(SN_PARSE_OK)); + return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP_ABORT) : (SN_PARSE_OK)); case SCTP_SHUTDOWN_ACK: if (chunk_length < sizeof(struct sctp_shutdown_ack_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); if (sm->msg > SN_SCTP_SHUTACK) { sm->msg = SN_SCTP_SHUTACK; sm->chunk_length = chunk_length; @@ -1136,11 +1135,11 @@ sctp_PktParser(struct libalias *la, int direction, str sm->msg = SN_SCTP_SHUTCOMP; sm->chunk_length = chunk_length; } - return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK)); + return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK)); case SCTP_ASCONF: if (sm->msg > SN_SCTP_ASCONF) { if (chunk_length < (sizeof(struct sctp_asconf_chunk) + sizeof(struct sctp_ipv4addr_param))) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); //leave parameter searching to later, if required param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + sizeof(struct sctp_asconf_chunk)); /*compulsory IP parameter*/ if (ntohs(param_hdr->param_type) == SCTP_IPV4_ADDRESS) { @@ -1149,38 +1148,38 @@ sctp_PktParser(struct libalias *la, int direction, str ipv4addr.s_addr = ((struct sctp_ipv4addr_param *) param_hdr)->addr; *passoc = FindSctpGlobal(la, ipv4addr, sctp_hdr->v_tag, sctp_hdr->src_port, sctp_hdr->dest_port, &partial_match); } - param_hdr = (struct sctp_paramhdr *) + param_hdr = (struct sctp_paramhdr *) ((char *) param_hdr + sizeof(struct sctp_ipv4addr_param)); /*asconf's compulsory address parameter */ sm->chunk_length = chunk_length - sizeof(struct sctp_asconf_chunk) - sizeof(struct sctp_ipv4addr_param); /* rest of chunk */ } else { if (chunk_length < (sizeof(struct sctp_asconf_chunk) + sizeof(struct sctp_ipv6addr_param))) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); - param_hdr = (struct sctp_paramhdr *) - ((char *) param_hdr + sizeof(struct sctp_ipv6addr_param)); /*asconf's compulsory address parameter */ + return (SN_PARSE_ERROR_CHHL); + param_hdr = (struct sctp_paramhdr *) + ((char *) param_hdr + sizeof(struct sctp_ipv6addr_param)); /*asconf's compulsory address parameter */ sm->chunk_length = chunk_length - sizeof(struct sctp_asconf_chunk) - sizeof(struct sctp_ipv6addr_param); /* rest of chunk */ } sm->msg = SN_SCTP_ASCONF; sm->sctpchnk.Asconf = param_hdr; - + if (*passoc == NULL) { /* AddIP with no association */ *passoc = (struct sctp_nat_assoc *) sn_malloc(sizeof(struct sctp_nat_assoc)); - if (*passoc == NULL) {/* out of resources */ - return(SN_PARSE_ERROR_AS_MALLOC); + if (*passoc == NULL) {/* out of resources */ + return (SN_PARSE_ERROR_AS_MALLOC); } /* Initialise association - malloc initialises memory to zeros */ (*passoc)->state = SN_ID; LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */ (*passoc)->TableRegister = SN_NULL_TBL; - return(SN_PARSE_OK); + return (SN_PARSE_OK); } } break; case SCTP_ASCONF_ACK: if (sm->msg > SN_SCTP_ASCONFACK) { if (chunk_length < sizeof(struct sctp_asconf_ack_chunk)) /* malformed chunk*/ - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); //leave parameter searching to later, if required - param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + sizeof(struct sctp_asconf_ack_chunk)); sm->msg = SN_SCTP_ASCONFACK; sm->sctpchnk.Asconf = param_hdr; @@ -1193,33 +1192,33 @@ sctp_PktParser(struct libalias *la, int direction, str /* if no association is found exit - we need to find an Init or AddIP within sysctl_initialising_chunk_proc_limit */ if ((*passoc == NULL) && (chunk_count >= sysctl_initialising_chunk_proc_limit)) - return(SN_PARSE_ERROR_LOOKUP); + return (SN_PARSE_ERROR_LOOKUP); /* finished with this chunk, on to the next chunk*/ bytes_left-= chunk_length; /* Is this the end of the packet ? */ if (bytes_left == 0) - return (*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK); + return (*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK); /* Are there enough bytes in packet to at least retrieve length of next chunk ? */ if (bytes_left < SN_MIN_CHUNK_SIZE) - return(SN_PARSE_ERROR_CHHL); + return (SN_PARSE_ERROR_CHHL); chunk_hdr = SN_SCTP_NEXTCHUNK(chunk_hdr); /* Is the chunk long enough to not cause endless look and are there enough bytes in packet to read the chunk ? */ chunk_length = SCTP_SIZE32(ntohs(chunk_hdr->chunk_length)); if ((chunk_length < SN_MIN_CHUNK_SIZE) || (chunk_length > bytes_left)) - return(SN_PARSE_ERROR_CHHL); - if(++chunk_count > sysctl_chunk_proc_limit) - return(SN_PARSE_OK); /* limit for processing chunks, take what we get */ + return (SN_PARSE_ERROR_CHHL); + if (++chunk_count > sysctl_chunk_proc_limit) + return (SN_PARSE_OK); /* limit for processing chunks, take what we get */ } if (*passoc == NULL) - return (partial_match)?(SN_PARSE_ERROR_PARTIALLOOKUP):(SN_PARSE_ERROR_LOOKUP); + return (partial_match) ? (SN_PARSE_ERROR_PARTIALLOOKUP) : (SN_PARSE_ERROR_LOOKUP); else - return(SN_PARSE_OK); + return (SN_PARSE_OK); } /** @ingroup packet_parser @@ -1227,7 +1226,7 @@ sctp_PktParser(struct libalias *la, int direction, str * * GetAsconfVtags scans an Asconf Chunk for the vtags parameter, and then * extracts the vtags. - * + * * GetAsconfVtags is not called from within sctp_PktParser. It is called only * from within ID_process when an AddIP has been received. * @@ -1235,9 +1234,9 @@ sctp_PktParser(struct libalias *la, int direction, str * @param sm Pointer to sctp message information * @param l_vtag Pointer to the local vtag in the association this SCTP Message belongs to * @param g_vtag Pointer to the local vtag in the association this SCTP Message belongs to - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * - * @return 1 - success | 0 - fail + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * + * @return 1 - success | 0 - fail */ static int GetAsconfVtags(struct libalias *la, struct sctp_nat_msg *sm, uint32_t *l_vtag, uint32_t *g_vtag, int direction) @@ -1249,7 +1248,7 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms uint32_t local_vtag; uint32_t remote_vtag; } __attribute__((packed)); - + struct sctp_vtag_param *vtag_param; struct sctp_paramhdr *param; int bytes_left; @@ -1264,7 +1263,7 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms while((bytes_left >= param_size) && (bytes_left >= SN_VTAG_PARAM_SIZE)) { if (ntohs(param->param_type) == SCTP_VTAG_PARAM) { vtag_param = (struct sctp_vtag_param *) param; - switch(direction) { + switch (direction) { /* The Internet draft is a little ambigious as to order of these vtags. We think it is this way around. If we are wrong, the order will need to be changed. */ @@ -1277,11 +1276,11 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms *l_vtag = vtag_param->local_vtag; break; } - return(1); /* found */ + return (1); /* found */ } bytes_left -= param_size; - if (bytes_left < SN_MIN_PARAM_SIZE) return(0); + if (bytes_left < SN_MIN_PARAM_SIZE) return (0); param = SN_SCTP_NEXTPARAM(param); param_size = SCTP_SIZE32(ntohs(param->param_length)); @@ -1289,22 +1288,22 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms SN_LOG(SN_LOG_EVENT, logsctperror("Parameter parse limit exceeded (GetAsconfVtags)", sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction)); - return(0); /* not found limit exceeded*/ + return (0); /* not found limit exceeded*/ } } - return(0); /* not found */ + return (0); /* not found */ } /** @ingroup packet_parser * @brief AddGlobalIPAddresses from Init,InitAck,or AddIP packets - * + * * AddGlobalIPAddresses scans an SCTP chunk (in sm) for Global IP addresses, and * adds them. * * @param sm Pointer to sctp message information * @param assoc Pointer to the association this SCTP Message belongs to - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * */ static void AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction) @@ -1317,7 +1316,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s int param_size; int param_count, addr_param_count = 0; - switch(direction) { + switch (direction) { case SN_TO_GLOBAL: /* does not contain global addresses */ g_addr = sm->ip_hdr->ip_dst; bytes_left = 0; /* force exit */ @@ -1325,7 +1324,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s case SN_TO_LOCAL: g_addr = sm->ip_hdr->ip_src; param_count = 1; - switch(sm->msg) { + switch (sm->msg) { case SN_SCTP_INIT: bytes_left = sm->chunk_length - sizeof(struct sctp_init_chunk); param = (struct sctp_paramhdr *)((char *)sm->sctpchnk.Init + sizeof(struct sctp_init)); @@ -1340,16 +1339,16 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s break; } } - if (bytes_left >= SN_MIN_PARAM_SIZE) + if (bytes_left >= SN_MIN_PARAM_SIZE) param_size = SCTP_SIZE32(ntohs(param->param_length)); else param_size = bytes_left+1; /* force skip loop */ - - if ((assoc->state == SN_ID) && ((sm->msg == SN_SCTP_INIT) || (bytes_left < SN_MIN_PARAM_SIZE))) {/* add pkt address */ + + if ((assoc->state == SN_ID) && ((sm->msg == SN_SCTP_INIT) || (bytes_left < SN_MIN_PARAM_SIZE))) {/* add pkt address */ G_Addr = (struct sctp_GlobalAddress *) sn_malloc(sizeof(struct sctp_GlobalAddress)); - if (G_Addr == NULL) {/* out of resources */ + if (G_Addr == NULL) {/* out of resources */ SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", + logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", sm->sctp_hdr->v_tag, 0, direction)); assoc->num_Gaddr = 0; /* don't track any more for this assoc*/ sysctl_track_global_addresses=0; @@ -1358,7 +1357,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s G_Addr->g_addr = g_addr; if (!Add_Global_Address_to_List(assoc, G_Addr)) SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Address already in list", + logsctperror("AddGlobalIPAddress: Address already in list", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } @@ -1366,11 +1365,11 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s while((bytes_left >= param_size) && (bytes_left >= sizeof(struct sctp_ipv4addr_param))) { if (assoc->num_Gaddr >= sysctl_track_global_addresses) { SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Maximum Number of addresses reached", + logsctperror("AddGlobalIPAddress: Maximum Number of addresses reached", sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction)); return; } - switch(ntohs(param->param_type)) { + switch (ntohs(param->param_type)) { case SCTP_ADD_IP_ADDRESS: /* skip to address parameter - leave param_size so bytes left will be calculated properly*/ param = (struct sctp_paramhdr *) &((struct sctp_asconf_addrv4_param *) param)->addrp; @@ -1379,9 +1378,9 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s ipv4_param = (struct sctp_ipv4addr_param *) param; /* add addresses to association */ G_Addr = (struct sctp_GlobalAddress *) sn_malloc(sizeof(struct sctp_GlobalAddress)); - if (G_Addr == NULL) {/* out of resources */ + if (G_Addr == NULL) {/* out of resources */ SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", + logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", sm->sctp_hdr->v_tag, 0, direction)); assoc->num_Gaddr = 0; /* don't track any more for this assoc*/ sysctl_track_global_addresses=0; @@ -1393,22 +1392,22 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s G_Addr->g_addr = g_addr; if (!Add_Global_Address_to_List(assoc, G_Addr)) SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Address already in list", + logsctperror("AddGlobalIPAddress: Address already in list", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); return; /*shouldn't be any other addresses if the zero address is given*/ } else { G_Addr->g_addr.s_addr = ipv4_param->addr; if (!Add_Global_Address_to_List(assoc, G_Addr)) SN_LOG(SN_LOG_EVENT, - logsctperror("AddGlobalIPAddress: Address already in list", + logsctperror("AddGlobalIPAddress: Address already in list", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } - } - + } + bytes_left -= param_size; if (bytes_left < SN_MIN_PARAM_SIZE) break; - + param = SN_SCTP_NEXTPARAM(param); param_size = SCTP_SIZE32(ntohs(param->param_length)); if (++param_count > sysctl_param_proc_limit) { @@ -1420,39 +1419,39 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s } if (addr_param_count == 0) { SN_LOG(SN_LOG_DETAIL, - logsctperror("AddGlobalIPAddress: no address parameters to add", + logsctperror("AddGlobalIPAddress: no address parameters to add", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } } -/** +/** * @brief Add_Global_Address_to_List * * Adds a global IP address to an associations address list, if it is not * already there. The first address added us usually the packet's address, and * is most likely to be used, so it is added at the beginning. Subsequent * addresses are added after this one. - * + * * @param assoc Pointer to the association this SCTP Message belongs to * @param G_addr Pointer to the global address to add * - * @return 1 - success | 0 - fail + * @return 1 - success | 0 - fail */ static int Add_Global_Address_to_List(struct sctp_nat_assoc *assoc, struct sctp_GlobalAddress *G_addr) { - struct sctp_GlobalAddress *iter_G_Addr = NULL, *first_G_Addr = NULL; - first_G_Addr = LIST_FIRST(&(assoc->Gaddr)); + struct sctp_GlobalAddress *iter_G_Addr = NULL, *first_G_Addr = NULL; + first_G_Addr = LIST_FIRST(&(assoc->Gaddr)); if (first_G_Addr == NULL) { LIST_INSERT_HEAD(&(assoc->Gaddr), G_addr, list_Gaddr); /* add new address to beginning of list*/ } else { LIST_FOREACH(iter_G_Addr, &(assoc->Gaddr), list_Gaddr) { if (G_addr->g_addr.s_addr == iter_G_Addr->g_addr.s_addr) - return(0); /* already exists, so don't add */ + return (0); /* already exists, so don't add */ } LIST_INSERT_AFTER(first_G_Addr, G_addr, list_Gaddr); /* add address to end of list*/ } - assoc->num_Gaddr++; - return(1); /* success */ + assoc->num_Gaddr++; + return (1); /* success */ } /** @ingroup packet_parser @@ -1465,8 +1464,8 @@ static int Add_Global_Address_to_List(struct sctp_nat * * @param sm Pointer to sctp message information * @param assoc Pointer to the association this SCTP Message belongs to - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * */ static void RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction) @@ -1479,7 +1478,7 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc int param_size; int param_count; - if(direction == SN_TO_GLOBAL) + if (direction == SN_TO_GLOBAL) g_addr = sm->ip_hdr->ip_dst; else g_addr = sm->ip_hdr->ip_src; @@ -1487,29 +1486,29 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc bytes_left = sm->chunk_length; param_count = 1; param = sm->sctpchnk.Asconf; - if (bytes_left >= SN_MIN_PARAM_SIZE) { + if (bytes_left >= SN_MIN_PARAM_SIZE) { param_size = SCTP_SIZE32(ntohs(param->param_length)); } else { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: truncated packet - cannot remove IP addresses", + logsctperror("RmGlobalIPAddress: truncated packet - cannot remove IP addresses", sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction)); return; } - + /* step through Asconf parameters */ while((bytes_left >= param_size) && (bytes_left >= sizeof(struct sctp_ipv4addr_param))) { if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) { asconf_ipv4_param = (struct sctp_asconf_addrv4_param *) param; if (asconf_ipv4_param->addrp.addr == INADDR_ANY) { /* remove all bar pkt address */ LIST_FOREACH_SAFE(G_Addr, &(assoc->Gaddr), list_Gaddr, G_Addr_tmp) { - if(G_Addr->g_addr.s_addr != sm->ip_hdr->ip_src.s_addr) { + if (G_Addr->g_addr.s_addr != sm->ip_hdr->ip_src.s_addr) { if (assoc->num_Gaddr > 1) { /* only delete if more than one */ LIST_REMOVE(G_Addr, list_Gaddr); sn_free(G_Addr); assoc->num_Gaddr--; } else { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", + logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } } @@ -1517,7 +1516,7 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc return; /*shouldn't be any other addresses if the zero address is given*/ } else { LIST_FOREACH_SAFE(G_Addr, &(assoc->Gaddr), list_Gaddr, G_Addr_tmp) { - if(G_Addr->g_addr.s_addr == asconf_ipv4_param->addrp.addr) { + if (G_Addr->g_addr.s_addr == asconf_ipv4_param->addrp.addr) { if (assoc->num_Gaddr > 1) { /* only delete if more than one */ LIST_REMOVE(G_Addr, list_Gaddr); sn_free(G_Addr); @@ -1525,22 +1524,22 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc break; /* Since add only adds new addresses, there should be no double entries */ } else { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", + logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction)); } } } } - } + } bytes_left -= param_size; if (bytes_left == 0) return; else if (bytes_left < SN_MIN_PARAM_SIZE) { SN_LOG(SN_LOG_EVENT, - logsctperror("RmGlobalIPAddress: truncated packet - may not have removed all IP addresses", + logsctperror("RmGlobalIPAddress: truncated packet - may not have removed all IP addresses", sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction)); return; } - + param = SN_SCTP_NEXTPARAM(param); param_size = SCTP_SIZE32(ntohs(param->param_length)); if (++param_count > sysctl_param_proc_limit) { @@ -1567,11 +1566,11 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc * Since there is currently no connection on this path, there should be no other * ASCONF configuration parameters outstanding, so we presume that if there is * an ACK that it is responding to the AddIP and activate the new association. - * + * * @param la Pointer to the relevant libalias instance * @param sm Pointer to sctp message information - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * * @return 1 - success | 0 - fail */ static int @@ -1586,45 +1585,45 @@ IsASCONFack(struct libalias *la, struct sctp_nat_msg * param = sm->sctpchnk.Asconf; param_size = SCTP_SIZE32(ntohs(param->param_length)); if (param_size == 8) - return(1); /*success - default acknowledgement of everything */ + return (1); /*success - default acknowledgement of everything */ bytes_left = sm->chunk_length; if (bytes_left < param_size) - return(0); /* not found */ + return (0); /* not found */ /* step through Asconf parameters */ while(bytes_left >= SN_ASCONFACK_PARAM_SIZE) { if (ntohs(param->param_type) == SCTP_SUCCESS_REPORT) - return(1); /* success - but can't match correlation IDs - should only be one */ + return (1); /* success - but can't match correlation IDs - should only be one */ /* check others just in case */ bytes_left -= param_size; if (bytes_left >= SN_MIN_PARAM_SIZE) { param = SN_SCTP_NEXTPARAM(param); } else { - return(0); + return (0); } param_size = SCTP_SIZE32(ntohs(param->param_length)); - if (bytes_left < param_size) return(0); + if (bytes_left < param_size) return (0); if (++param_count > sysctl_param_proc_limit) { SN_LOG(SN_LOG_EVENT, - logsctperror("Parameter parse limit exceeded (IsASCONFack)", + logsctperror("Parameter parse limit exceeded (IsASCONFack)", sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction)); - return(0); /* not found limit exceeded*/ + return (0); /* not found limit exceeded*/ } } - return(0); /* not success */ + return (0); /* not success */ } /** @ingroup packet_parser - * @brief Check to see if ASCONF contains an Add IP or Del IP parameter - * + * @brief Check to see if ASCONF contains an Add IP or Del IP parameter + * * IsADDorDEL scans an ASCONF packet to see if it contains an AddIP or DelIP * parameter * * @param la Pointer to the relevant libalias instance * @param sm Pointer to sctp message information - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL - * + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * * @return SCTP_ADD_IP_ADDRESS | SCTP_DEL_IP_ADDRESS | 0 - fail */ static int @@ -1641,31 +1640,31 @@ IsADDorDEL(struct libalias *la, struct sctp_nat_msg *s bytes_left = sm->chunk_length; if (bytes_left < param_size) - return(0); /* not found */ + return (0); /* not found */ /* step through Asconf parameters */ while(bytes_left >= SN_ASCONFACK_PARAM_SIZE) { if (ntohs(param->param_type) == SCTP_ADD_IP_ADDRESS) - return(SCTP_ADD_IP_ADDRESS); - else if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) - return(SCTP_DEL_IP_ADDRESS); + return (SCTP_ADD_IP_ADDRESS); + else if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) + return (SCTP_DEL_IP_ADDRESS); /* check others just in case */ bytes_left -= param_size; if (bytes_left >= SN_MIN_PARAM_SIZE) { param = SN_SCTP_NEXTPARAM(param); } else { - return(0); /*Neither found */ + return (0); /*Neither found */ } param_size = SCTP_SIZE32(ntohs(param->param_length)); - if (bytes_left < param_size) return(0); + if (bytes_left < param_size) return (0); if (++param_count > sysctl_param_proc_limit) { SN_LOG(SN_LOG_EVENT, - logsctperror("Parameter parse limit exceeded IsADDorDEL)", + logsctperror("Parameter parse limit exceeded IsADDorDEL)", sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction)); - return(0); /* not found limit exceeded*/ + return (0); /* not found limit exceeded*/ } } - return(0); /*Neither found */ + return (0); /*Neither found */ } /* ---------------------------------------------------------------------- @@ -1688,7 +1687,7 @@ IsADDorDEL(struct libalias *la, struct sctp_nat_msg *s * each state. * * @param la Pointer to the relevant libalias instance - * @param direction SN_TO_LOCAL | SN_TO_GLOBAL + * @param direction SN_TO_LOCAL | SN_TO_GLOBAL * @param sm Pointer to sctp message information * @param assoc Pointer to the association this SCTP Message belongs to * @@ -1705,17 +1704,17 @@ ProcessSctpMsg(struct libalias *la, int direction, str *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 7 21:31:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14B1F873AC; Sat, 7 Apr 2018 21:31:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F41284910; Sat, 7 Apr 2018 21:31:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59214263E9; Sat, 7 Apr 2018 21:31:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37LV9Sk020078; Sat, 7 Apr 2018 21:31:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37LV9fv020077; Sat, 7 Apr 2018 21:31:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072131.w37LV9fv020077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 21:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332258 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 21:31:09 -0000 Author: ian Date: Sat Apr 7 21:31:09 2018 New Revision: 332258 URL: https://svnweb.freebsd.org/changeset/base/332258 Log: Don't check for impossible NULL return from malloc(..., M_WAITOK). Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Sat Apr 7 21:25:29 2018 (r332257) +++ head/sys/dev/spibus/spigen.c Sat Apr 7 21:31:09 2018 (r332258) @@ -242,15 +242,9 @@ spigen_transfer(struct cdev *cdev, struct spigen_trans #endif transfer.tx_cmd = transfer.rx_cmd = malloc(st->st_command.iov_len, M_DEVBUF, M_WAITOK); - if (transfer.tx_cmd == NULL) - return (ENOMEM); if (st->st_data.iov_len > 0) { transfer.tx_data = transfer.rx_data = malloc(st->st_data.iov_len, M_DEVBUF, M_WAITOK); - if (transfer.tx_data == NULL) { - free(transfer.tx_cmd, M_DEVBUF); - return (ENOMEM); - } } else transfer.tx_data = transfer.rx_data = NULL; From owner-svn-src-all@freebsd.org Sat Apr 7 22:00:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31AC9F89438; Sat, 7 Apr 2018 22:00:24 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95477745C8; Sat, 7 Apr 2018 22:00:23 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.179.50.133]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M09Ee-1eDEIi1fkC-00uMVM; Sun, 08 Apr 2018 00:00:20 +0200 Date: Sat, 7 Apr 2018 23:59:46 +0200 From: "O. Hartmann" To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332258 - head/sys/dev/spibus Message-ID: <20180408000013.1fc266c4@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201804072131.w37LV9fv020077@repo.freebsd.org> References: <201804072131.w37LV9fv020077@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:x1mGWjwZd5TdWkJziJCTYgIgJavPdoeG2cUKVUQjEUhGw5h+7hd q/h8HUNJN8H+rjr3tlxMUmReYOYDpBvvXnVF8qW1kJ+Efy3AgsxDkZkm7Rns+wX8BXWRW9x O7S9g4qO3B9cbQHMX/E/abeG9Fbpd1NtgUUz9oWnU9+Z0Q+AFrGOCH7WqT0+MKb6PlTP4wn FIj/Cx6N6qEq4XMQR0fUw== X-UI-Out-Filterresults: notjunk:1;V01:K0:qthFfxGA4Q8=:py7vSWf7cPHkNU1syqSmXb jU++4PreJQhHKd4TyHexMiW/HTZKTWYoQNJflD2FNVe53Cl6R2pPvq8ehKXjfsEA4fpxVEEZO 1FaZXT1qgTIjwJGLYv1zXIRPFb/oyFTYNa/BF90lu/JP+G9MYjTmSkJdVd2n1hplquQ4qGo4y DD8QfqUNOTL+MvtOTw9wbkXF8c933x2dM6J05sT7S3I2Lt4mzOefPF4ubja4MDi33fZ2IqXyY fDGSGpBCemNs/LbVDsHAGsuFjNHh/u4klcpvxd17yFcChWVhqDO3TT9sEphoiVPaBeGIx/bJc usEN/J+4bUb7RojuWy7Aro/wtvuLVcr/T1vSWqG/awEXHKB/a0MhCSNb6MpIhX6sq5LGOOxjS 7ESzKBU5Me7FAGoU9ixP1Nj2KJlUMBnv+eAw65giqWBh1MPYwcejwjbgUHbCKKZd1p7YJeED2 IvCUeH8x6XYj9/sbAYpyIM431iGWBy6gDwxFz7Id10gmir3KHLXBPBmE0DY+ydI32aNCUb83W 1+sotBYXyiyPMW+bU7EH+LFoqr3ZlMH7qvP9BaFamMiG9i9tfOnNRn6etcW5cfsCmtDEBuozx Fy69Hw9/Apc4XzOQeQfgPAjFilta7EZd0qgjR7aV8ap68Hfv+g/kfV/YHbwcBYAT87yrUI3fj xDMWGHJUOnYaCLpe89cfedfQhchMhotdkyeql1ylFNITfEWUTCGs7uCMhwavQFjKgynxevGW/ FGQ6oDXQF/cAk23QB+d0AEtZHGSHYBCVaBE7cIZW9kWCnF+WFHib3DcWal0sORYoa8mZmyG4V /oIB1sYDVJo2pa/eUlEU9DbSXgUHkfBeLYFrAjBEFQNhQ9kBIA= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 22:00:24 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFNh dCwgNyBBcHIgMjAxOCAyMTozMTowOSArMDAwMCAoVVRDKQ0KSWFuIExlcG9yZSA8aWFuQEZyZWVC U0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjogaWFuDQo+IERhdGU6IFNhdCBBcHIgIDcgMjE6 MzE6MDkgMjAxOA0KPiBOZXcgUmV2aXNpb246IDMzMjI1OA0KPiBVUkw6IGh0dHBzOi8vc3Zud2Vi LmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzMzMjI1OA0KPiANCj4gTG9nOg0KPiAgIERvbid0 IGNoZWNrIGZvciBpbXBvc3NpYmxlIE5VTEwgcmV0dXJuIGZyb20gbWFsbG9jKC4uLiwgTV9XQUlU T0spLg0KPiANCj4gTW9kaWZpZWQ6DQo+ICAgaGVhZC9zeXMvZGV2L3NwaWJ1cy9zcGlnZW4uYw0K PiANCj4gTW9kaWZpZWQ6IGhlYWQvc3lzL2Rldi9zcGlidXMvc3BpZ2VuLmMNCj4gPT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9kZXYvc3BpYnVzL3NwaWdlbi5jCVNhdCBBcHIg IDcgMjE6MjU6MjkgMjAxOAkocjMzMjI1NykNCj4gKysrIGhlYWQvc3lzL2Rldi9zcGlidXMvc3Bp Z2VuLmMJU2F0IEFwciAgNyAyMTozMTowOSAyMDE4CShyMzMyMjU4KQ0KPiBAQCAtMjQyLDE1ICsy NDIsOSBAQCBzcGlnZW5fdHJhbnNmZXIoc3RydWN0IGNkZXYgKmNkZXYsIHN0cnVjdCBzcGlnZW5f dHJhbnMNCj4gICNlbmRpZg0KPiAgCXRyYW5zZmVyLnR4X2NtZCA9IHRyYW5zZmVyLnJ4X2NtZCA9 IG1hbGxvYyhzdC0+c3RfY29tbWFuZC5pb3ZfbGVuLA0KPiAgCSAgICBNX0RFVkJVRiwgTV9XQUlU T0spOw0KPiAtCWlmICh0cmFuc2Zlci50eF9jbWQgPT0gTlVMTCkNCj4gLQkJcmV0dXJuIChFTk9N RU0pOw0KPiAgCWlmIChzdC0+c3RfZGF0YS5pb3ZfbGVuID4gMCkgew0KPiAgCQl0cmFuc2Zlci50 eF9kYXRhID0gdHJhbnNmZXIucnhfZGF0YSA9IG1hbGxvYyhzdC0+c3RfZGF0YS5pb3ZfbGVuLA0K PiAgCQkgICAgTV9ERVZCVUYsIE1fV0FJVE9LKTsNCj4gLQkJaWYgKHRyYW5zZmVyLnR4X2RhdGEg PT0gTlVMTCkgew0KPiAtCQkJZnJlZSh0cmFuc2Zlci50eF9jbWQsIE1fREVWQlVGKTsNCj4gLQkJ CXJldHVybiAoRU5PTUVNKTsNCj4gLQkJfQ0KPiAgCX0NCj4gIAllbHNlDQo+ICAJCXRyYW5zZmVy LnR4X2RhdGEgPSB0cmFuc2Zlci5yeF9kYXRhID0gTlVMTDsNCj4gX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1oZWFkQGZyZWVic2Qub3Jn IG1haWxpbmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4vbGlzdGlu Zm8vc3ZuLXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWlsIHRvICJzdm4t c3JjLWhlYWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNClRoaXMgb25lIGtpbGxzIGJ1aWxk a2VybmVsOg0KDQpbLi4uXQ0KLSAtLS0gc3BpZ2VuLm8gLS0tDQovdXNyL3NyYy9zeXMvZGV2L3Nw aWJ1cy9zcGlnZW4uYzozMjc6MzM6IGVycm9yOiBpbmNvbXBhdGlibGUgcG9pbnRlciB0eXBlcyBw YXNzaW5nDQondWludHB0cl90IConIChha2EgJ3Vuc2lnbmVkIGxvbmcgKicpIHRvIHBhcmFtZXRl ciBvZiB0eXBlICd1aW50MzJfdCAqJyAoYWthICd1bnNpZ25lZA0KaW50IConKSBbLVdlcnJvciwt V2luY29tcGF0aWJsZS1wb2ludGVyLXR5cGVzXSBlcnJvciA9IHNwaWJ1c19nZXRfY2xvY2soZGV2 LCAodWludHB0cl90DQoqKWRhdGEpOyBefn5+fn5+fn5+fn5+fn5+fg0KDQotIC0tIA0KTy4gSGFy dG1hbm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVuZyBvZGVyIMOcYmVybWl0dGx1bmcg bWVpbmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIgZsO8ciBkaWUgTWFya3QtIG9kZXIg TWVpbnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNHKS4NCi0tLS0tQkVHSU4gUEdQIFNJ R05BVFVSRS0tLS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16QXR3QzJULzg2VHJTNTI4ZnlGaFls QVVDV3NrL2JRQUtDUkRTNTI4ZnlGaFkNCmxFM1hBZjQvaHhORGlzZUtmNERvNE95Z2RadE52K0pE QzM2ajNBUTUrRTk2R3dwSC9raEZCRUx4S0lSSEg4NVkNClRvZi9RTEw4VW40M3daVHI2bW95ZEU1 ZU9kaVJBZjlaMHZ2VnZvZEVrbVZQYldzZnFuMGxZVFZqWHFua1VmREgNCjdRTW8zUUJST3RNVUJv NExPYTdmTTdPbFpadjlvTUdVQnNCV3FITWpQWGVxVU9xYk0rQTQNCj14R1dzDQotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-all@freebsd.org Sat Apr 7 22:21:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D2BBF8A9D9; Sat, 7 Apr 2018 22:21:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B271C7F99E; Sat, 7 Apr 2018 22:21:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC17326C06; Sat, 7 Apr 2018 22:21:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37ML6Sr045537; Sat, 7 Apr 2018 22:21:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37ML6ei045536; Sat, 7 Apr 2018 22:21:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072221.w37ML6ei045536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 22:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332259 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 22:21:07 -0000 Author: ian Date: Sat Apr 7 22:21:06 2018 New Revision: 332259 URL: https://svnweb.freebsd.org/changeset/base/332259 Log: Cast the data pointer to the correct type for the data being accessed (as opposed to one that accidentally worked on the one arch I test-compiled for on my first try). Reported by: np@, O. Hartmann Pointy hat: ian@ Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Sat Apr 7 21:31:09 2018 (r332258) +++ head/sys/dev/spibus/spigen.c Sat Apr 7 22:21:06 2018 (r332259) @@ -324,13 +324,13 @@ spigen_ioctl(struct cdev *cdev, u_long cmd, caddr_t da error = spigen_transfer_mmapped(cdev, (struct spigen_transfer_mmapped *)data); break; case SPIGENIOC_GET_CLOCK_SPEED: - error = spibus_get_clock(dev, (uintptr_t *)data); + error = spibus_get_clock(dev, (uint32_t *)data); break; case SPIGENIOC_SET_CLOCK_SPEED: error = spibus_set_clock(dev, *(uint32_t *)data); break; case SPIGENIOC_GET_SPI_MODE: - error = spibus_get_mode(dev, (uintptr_t *)data); + error = spibus_get_mode(dev, (uint32_t *)data); break; case SPIGENIOC_SET_SPI_MODE: error = spibus_set_mode(dev, *(uint32_t *)data); From owner-svn-src-all@freebsd.org Sat Apr 7 22:23:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F3EDF8ACEC for ; Sat, 7 Apr 2018 22:23:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2987680CDF for ; Sat, 7 Apr 2018 22:23:13 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 41618142-3ab2-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 41618142-3ab2-11e8-91c6-33ffc249f3e8; Sat, 07 Apr 2018 22:23:12 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w37MN53j094272; Sat, 7 Apr 2018 16:23:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1523139785.89422.3.camel@freebsd.org> Subject: Re: svn commit: r332258 - head/sys/dev/spibus From: Ian Lepore To: "O. Hartmann" , Navdeep Parhar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 07 Apr 2018 16:23:05 -0600 In-Reply-To: <20180408000013.1fc266c4@thor.intern.walstatt.dynvpn.de> References: <201804072131.w37LV9fv020077@repo.freebsd.org> <20180408000013.1fc266c4@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2018 22:23:14 -0000 On Sat, 2018-04-07 at 23:59 +0200, O. Hartmann wrote: > Am Sat, 7 Apr 2018 21:31:09 +0000 (UTC) > Ian Lepore schrieb: > > > > > Author: ian > > Date: Sat Apr  7 21:31:09 2018 > > New Revision: 332258 > > URL: https://svnweb.freebsd.org/changeset/base/332258 > > > > Log: > >   Don't check for impossible NULL return from malloc(..., M_WAITOK). > > > > Modified: > >   head/sys/dev/spibus/spigen.c > > > > [...] > > [...] > --- spigen.o --- > /usr/src/sys/dev/spibus/spigen.c:327:33: error: incompatible pointer types passing > 'uintptr_t *' (aka 'unsigned long *') to parameter of type 'uint32_t *' (aka 'unsigned > int *') [-Werror,-Wincompatible-pointer-types] error = spibus_get_clock(dev, (uintptr_t > *)data); ^~~~~~~~~~~~~~~~~ > Doh!  Sorry about that, fixed in r332259. -- Ian From owner-svn-src-all@freebsd.org Sat Apr 7 22:23:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0540F8AD27; Sat, 7 Apr 2018 22:23:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 27CB080EB9; Sat, 7 Apr 2018 22:23:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 4wErfZLAmU5pn4wEtfWqM6; Sat, 07 Apr 2018 16:23:17 -0600 X-Authority-Analysis: v=2.3 cv=Tai4SyYh c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=VxmjJ2MpAAAA:8 a=JzwRw_2MAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=PPDduXdDeSw3b1VufPgA:9 a=CjuIK1q_8ugA:10 a=jDxBBm0fxBEA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=_bBvcJC8wCc67rcU61zu:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 7B9317EC; Sat, 7 Apr 2018 15:23:13 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w37MNDY0009251; Sat, 7 Apr 2018 15:23:13 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w37MNBQI009248; Sat, 7 Apr 2018 15:23:11 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804072223.w37MNBQI009248@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Bruce Evans , Jeff Roberson , Justin Hibbits , Jeff Roberson , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331369 - head/sys/vm In-Reply-To: Message from Cy Schubert of "Thu, 22 Mar 2018 23:15:29 -0700." <201803230615.w2N6FTMJ040628@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 07 Apr 2018 15:23:11 -0700 X-CMAE-Envelope: MS4wfLmTrm+kXE4yT2WiGQXNAxaj3sHgnMQZFvjqxVSvxkYVLBd6MEgCpgvAWJtQB15ClybSmQkj7bdD/0MScMA76TZvyufO9t/NHjHVN7BdSj0T64jXio1j VVJ+/Cdt4NGkiNEJQiDjO5fWMLZn9SZHEHfoK7HASabke9QE48OX/69GglPqdRaplXgWwQUPOTqM27fFBknAxfmWam7xMKwS0YZfrOntQCJ2cXYiNdRlEcze g7BTmvbuXwMlm1/QImkvIUwneCs1WMIyNNnoCuZMrhRhJQRISoPl79JJophX0nH/SkkFJhpdOTBWD3cB6JyaAuQjSwRVLRraACtWxI5tdPq/oKDWex8PSMYo AhdNIO2B7h78Zn2ygwWb5UMH/ABtbA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 22:23:25 -0000 In message <201803230615.w2N6FTMJ040628@slippy.cwsent.com>, Cy Schubert writes: > In message <20180323150709.H968@besplex.bde.org>, Bruce Evans writes: > > On Thu, 22 Mar 2018, Jeff Roberson wrote: > > > > > On Thu, 22 Mar 2018, Cy Schubert wrote: > > > > > >> It broke i386 too. > > > > > > I just did > > > TARGET_ARCH=i386 make buildworld > > > TARGET_ARCH=i386 make buildkernel > > > > > > This worked for me? > > >> > > >> Index: sys/vm/vm_reserv.c > > >> =================================================================== > > >> --- sys/vm/vm_reserv.c (revision 331399) > > >> +++ sys/vm/vm_reserv.c (working copy) > > >> @@ -45,8 +45,6 @@ > > >> > > >> #include > > >> #include > > >> -#include > > >> -#include > > >> #include > > >> #include > > >> #include > > >> @@ -55,6 +53,8 @@ > > >> #include > > >> #include > > >> #include > > >> +#include > > >> +#include > > >> #include > > >> #include > > >> > > >> This is because sys/i386/include/machine.h uses critical_enter() and > > >> critical_exit() which are defined in sys/systm.h. > > > > Wrong fix. I see you committed this. Now there are more bugs to fix. > > > > is a prerequisite for all kernel headers except > > , since it defines and declares things like KASSERT() and > > critical_enter() which might be used in other headers (except > > sys/param.h and its standard pollution). Sometimes sys/systm.h is > > included as undocumented namespace pollution in headers that are > > accidentally included before the (other) ones that use KASSERT(), etc. > > The headers that have this bug have it to work around bugs in .c files > > like the one above. It is more usual to have this bug by not including > > sys/systm.h at all than to have it by including it in a wrong order. > > Sorting it alphabetically almost always gives a wrong order. It must > > be included after sys/param.h and that must be included first. > > Agreed on alphabetic sorting. > > > > > It is a related bug to include only sys/types.h and not sys/param.h. > > This requires chumminess with the current implementation and all > > future implementations. sys/param.h provides certain undocumented > > but standard namespace pollution which might vary with the implementation, > > as necessary to satisfy some of the pollution requirements of all current > > and future implementations of other headers. (The pollution should be > > monotonically decreasing but it was only that for a few years about 20 > > years ago when I worked on fixing it.) .c files that include sys/types.h > > instead of sys/param.h have do some subset of the includes in sys/param.h. > > Since nothing is documented and the subset might depend on the arch and > > user options, it is hard to know the minimal subset. > > That's not the case here. sys/types.h is not included in this file but > point taken. > > > > > .c files that include sys/types.h tend to have lots of other #include > > bugs like not including sys/systm.h. Again it is hard to know the > > minimal replacement for sys/systm.h and its undocumented but standard > > pollution. It is a style bug to include both sys/types.h and sys/param.h. > > style(9) even explicitly forbids including both. It is a larger style > > bug to include the standard pollution in sys/systm.h direction. This > > includes especially and . These > > should be considered as being implemented in sys/systm.h, with the > > headers for them only and implementation detail. Similarly > > for . > > > > >> It built nicely on my amd64's though. > > > > amd64 apparently has more namespace pollution which breaks detection > > of the bug. But I couldn't find where it is. sys/systm.h isn't included > > nested in any amd64 or x86 headers. Apparently some amd64 option gives > > it. > > The reason is amd64 doesn't use critical_enter() and critical_exit() > because counter_enter() and counter_exit() are NOPs. The reason they > are NOPs in amd64 and not in i386 is not all i386 processors support > cmpxchg8b. It is only then that the critical_*() functions are called. > > > > > Bruce > > I can create a phabricator revision to clean this instance up and move > sys/systm.h just after sys/param.h. I'm just about to head out of town > so I'll create it after I get back, after April 4. > > Thank you for your input Bruce. Hi Bruce, Can you please give this a once over? diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index d8869e3bdbe..6d31d79da39 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" #include +#include #include #include #include @@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Apr 7 22:28:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34712F8B179; Sat, 7 Apr 2018 22:28:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCE8C83DD2; Sat, 7 Apr 2018 22:28:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3A4F26D71; Sat, 7 Apr 2018 22:28:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37MShEM049959; Sat, 7 Apr 2018 22:28:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37MShU5049956; Sat, 7 Apr 2018 22:28:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804072228.w37MShU5049956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 7 Apr 2018 22:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332260 - head/sys/dts/arm/overlays X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dts/arm/overlays X-SVN-Commit-Revision: 332260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 22:28:44 -0000 Author: kevans Date: Sat Apr 7 22:28:43 2018 New Revision: 332260 URL: https://svnweb.freebsd.org/changeset/base/332260 Log: Add a83t overlays for sid and emac The sun8i-a83t-bananapi-m3-emac overlay technically doesn't match what will be coming from upstream. The tx-delay and rx-delay should be specified in terms of allwinner,tx-delay-ps and allwinner,rx-delay-ps respectively. The values are still technically correct for what we write in if_awg, and support for the new bindings will be coming soon. Added: head/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso (contents, props changed) head/sys/dts/arm/overlays/sun8i-a83t-emac.dtso (contents, props changed) head/sys/dts/arm/overlays/sun8i-a83t-sid.dtso (contents, props changed) Added: head/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/overlays/sun8i-a83t-bananapi-m3-emac.dtso Sat Apr 7 22:28:43 2018 (r332260) @@ -0,0 +1,29 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "sinovoip,bpi-m3"; + + fragment@0 { + target = <&mdio>; + __overlay__ { + rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x1>; + }; + }; + }; + + fragment@1 { + target = <&emac>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&emac_rgmii_pins>; + phy-handle = <&rgmii_phy>; + phy-mode = "rgmii"; + rx-delay = <0x7>; + tx-delay = <0x7>; + status = "okay"; + }; + }; +}; Added: head/sys/dts/arm/overlays/sun8i-a83t-emac.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/overlays/sun8i-a83t-emac.dtso Sat Apr 7 22:28:43 2018 (r332260) @@ -0,0 +1,44 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-a83t"; + + fragment@0 { + target = <&pio>; + __overlay__ { + emac_rgmii_pins: emac-rgmii-pins { + pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", + "PD11", "PD12", "PD13", "PD14", "PD18", + "PD19", "PD20", "PD21", "PD22", "PD23"; + function = "emac"; + drive-strength = <0x28>; + }; + }; + }; + + fragment@1 { + target-path = "/soc"; + __overlay__ { + emac: ethernet@1c30000 { + compatible = "allwinner,sun8i-a83t-emac"; + syscon = <&syscon>; + reg = <0x1c30000 0x104>; + interrupts = <0x0 0x52 0x4>; + interrupt-names = "macirq"; + resets = <&ccu 0xd>; + reset-names = "ahb"; + clocks = <&ccu 0x1b>; + clock-names = "ahb"; + #address-cells = <0x1>; + #size-cells = <0x0>; + status = "disabled"; + mdio: mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <0x1>; + #size-cells = <0x0>; + }; + }; + }; + }; +}; Added: head/sys/dts/arm/overlays/sun8i-a83t-sid.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/overlays/sun8i-a83t-sid.dtso Sat Apr 7 22:28:43 2018 (r332260) @@ -0,0 +1,17 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-a83t"; + + fragment@0 { + target-path = "/soc"; + __overlay__ { + sid: eeprom@1c14000 { + compatible = "allwinner,sun8i-a83t-sid"; + reg = <0x1c14000 0x400>; + status = "okay"; + }; + }; + }; +}; From owner-svn-src-all@freebsd.org Sat Apr 7 23:31:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F27D8F8ECC1; Sat, 7 Apr 2018 23:31:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F33D86543; Sat, 7 Apr 2018 23:31:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96DF427872; Sat, 7 Apr 2018 23:31:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w37NVt4q081170; Sat, 7 Apr 2018 23:31:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37NVt7w081169; Sat, 7 Apr 2018 23:31:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804072331.w37NVt7w081169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 23:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332261 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 332261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Apr 2018 23:31:56 -0000 Author: ian Date: Sat Apr 7 23:31:55 2018 New Revision: 332261 URL: https://svnweb.freebsd.org/changeset/base/332261 Log: Add a manpage for spigen(4). Added: head/share/man/man4/spigen.4 (contents, props changed) Added: head/share/man/man4/spigen.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/spigen.4 Sat Apr 7 23:31:55 2018 (r332261) @@ -0,0 +1,206 @@ +.\" +.\" Copyright (c) 2018 Ian Lepore +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 April 7, 2018 +.Dt SPIGEN 4 +.Os +.Sh NAME +.Nm spigen +.Nd SPI generic I/O device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device spi" +.Cd "device spibus" +.Cd "device spigen" +.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 +spigen_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides direct access to a slave device on the SPI bus. +Each instance of a +.Nm +device is associated with a single chip-select +line on the bus, and all I/O performed through that instance is done +with that chip-select line asserted. +.Pp +SPI data transfers are inherently bi-directional; there are not separate +read and write operations. +When commands and data are sent to a device, data also comes back from +the device, although in some cases the data may not be useful (or even +documented or predictable for some devices). +Likewise on a read operation, whatever data is in the buffer at the start +of the operation is sent to (and typically ignored by) the device, with each +outgoing byte then replaced in the buffer by the corresponding incoming byte. +Thus, all buffers passed to the transfer functions are both input and +output buffers. +.Pp +The +.Nm +driver provides access to the SPI slave device with the following +.Xr ioctl 2 +calls, defined in +.In sys/spigenio.h : +.Bl -tag -width indent +.It Dv SPIGENIOC_TRANSFER Pq Vt "struct spigen_transfer" +Transfer a command and optional associated data to/from the device, +using the buffers described by the st_command and st_data fields in the +.Vt spigen_transfer . +Set +.Vt st_data.iov_len +to zero if there is no data associated with the command. +.Bd -literal +struct spigen_transfer { + struct iovec st_command; + struct iovec st_data; +}; +.Ed +.It Dv SPIGENIOC_TRANSFER_MMAPPED Pq Vt "spigen_transfer_mmapped" +Transfer a command and optional associated data to/from the device. +The buffers for the transfer are a previously-mmap'd region. +The length of the command and data within that region are described by the +.Vt stm_command_length +and +.Vt stm_data_length +fields of +.Vt spigen_transfer_mmapped . +If +.Vt stm_data_length +is non-zero, the data appears in the memory region immediately +following the command (that is, at offset +.Vt stm_command_length +from the start of the mapped region). +.Bd -literal +struct spigen_transfer_mmapped { + size_t stm_command_length; + size_t stm_data_length; +}; +.Ed +.It Dv SPIGENIOC_GET_CLOCK_SPEED Pq Vt uint32_t +Get the maximum clock speed (bus frequency in Hertz) to be used +when communicating with this slave device. +.It Dv SPIGENIOC_SET_CLOCK_SPEED Pq Vt uint32_t +Set the maximum clock speed (bus frequency in Hertz) to be used +when communicating with this slave device. +The setting remains in effect for subsequent transfers; it +is not necessary to reset this before each transfer. +The actual bus frequency may be lower due to hardware limitiations +of the SPI bus controller device. +.It Dv SPIGENIOC_GET_SPI_MODE Pq Vt uint32_t +Get the SPI mode (clock polarity and phase) to be used +when communicating with this device. +.It Dv SPIGENIOC_SET_SPI_MODE Pq Vt uint32_t +Set the SPI mode (clock polarity and phase) to be used +when communicating with this device. +The setting remains in effect for subsequent transfers; it +is not necessary to reset this before each transfer. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.spigen.%d.at +The spibus the +.Nm +instance is attached to. +.It Va hint.spigen.%d.clock +The maximum bus frequency to use when communicating with this device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.It Va hint.spigen.%d.cs +The chip-select number to assert when performing I/O for this device. +Set the high bit (1 << 31) to invert the logic level of the chip select line. +.It Va hint.spigen.%d.mode +The SPI mode (0-3) to use when communicating with this device. +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, the spigen device is defined as a slave device subnode +of the SPI bus controller node. +All properties documented in the +.Va spibus.txt +bindings document can be used with the +.Nm +device. +The most commonly-used ones are documented below. +.Pp +The following properties are required in the +.Nm +device subnode: +.Bl -tag -width indent +.It Va compatible +Must be the string "freebsd,spigen". +.It Va reg +Chip select address of device. +.It Va spi-max-frequency +The maximum bus frequency to use when communicating with this slave device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.El +.Pp +The following properties are optional for the +.Nm +device subnode: +.Bl -tag -width indent +.It Va spi-cpha +Empty property indicating the slave device requires shifted clock +phase (CPHA) mode. +.It Va spi-cpol +Empty property indicating the slave device requires inverse clock +polarity (CPOL) mode. +.It Va spi-cs-high +Empty property indicating the slave device requires chip select active high. +.El +.Sh FILES +.Bl -tag -width -compact +.It Pa /dev/spigen* +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr device.hints 5 +.Sh HISTORY +The +.Nm +driver +appeared in +.Fx 11.0 . +FDT support appeared in +.Fx 11.2 .