From owner-svn-src-stable-11@freebsd.org Sun Nov 19 00:32:18 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FBBDE1092; Sun, 19 Nov 2017 00:32:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D039F354F; Sun, 19 Nov 2017 00:32:17 +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 vAJ0WG2g020014; Sun, 19 Nov 2017 00:32:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJ0WGlx020013; Sun, 19 Nov 2017 00:32:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711190032.vAJ0WGlx020013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Nov 2017 00:32: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: r325989 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 325989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 00:32:18 -0000 Author: emaste Date: Sun Nov 19 00:32:16 2017 New Revision: 325989 URL: https://svnweb.freebsd.org/changeset/base/325989 Log: MFC r325444: ANSIfy sys/kern/md4c.c PR: 223453 Submitted by: ota@j.email.ne.jp Modified: stable/11/sys/kern/md4c.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/md4c.c ============================================================================== --- stable/11/sys/kern/md4c.c Sun Nov 19 00:31:13 2017 (r325988) +++ stable/11/sys/kern/md4c.c Sun Nov 19 00:32:16 2017 (r325989) @@ -90,8 +90,8 @@ static unsigned char PADDING[64] = { /* MD4 initialization. Begins an MD4 operation, writing a new context. */ -void MD4Init (context) -MD4_CTX *context; /* context */ +void +MD4Init(MD4_CTX *context) { context->count[0] = context->count[1] = 0; @@ -107,10 +107,9 @@ MD4_CTX *context; operation, processing another message block, and updating the context. */ -void MD4Update (context, input, inputLen) -MD4_CTX *context; /* context */ -const unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ +void +MD4Update(MD4_CTX *context, const unsigned char *input, + unsigned int inputLen) { unsigned int i, index, partLen; @@ -142,8 +141,8 @@ unsigned int inputLen; /* length o } /* MD4 padding. */ -void MD4Pad (context) -MD4_CTX *context; /* context */ +void +MD4Pad(MD4_CTX *context) { unsigned char bits[8]; unsigned int index, padLen; @@ -164,7 +163,8 @@ MD4_CTX *context; /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (unsigned char digest[static 16], MD4_CTX *context) +void +MD4Final(unsigned char digest[static 16], MD4_CTX *context) { /* Do padding */ MD4Pad (context); @@ -179,9 +179,8 @@ void MD4Final (unsigned char digest[static 16], MD4_CT /* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (state, block) -UINT4 state[4]; -const unsigned char block[64]; +static void +MD4Transform(UINT4 state[4], const unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; @@ -254,10 +253,8 @@ const unsigned char block[64]; /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; +static void +Encode(unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; @@ -272,11 +269,8 @@ unsigned int len; /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (output, input, len) - -UINT4 *output; -const unsigned char *input; -unsigned int len; +static void +Decode(UINT4 *output, const unsigned char *input, unsigned int len) { unsigned int i, j; From owner-svn-src-stable-11@freebsd.org Sun Nov 19 11:24:25 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA4FDF24E3; Sun, 19 Nov 2017 11:24:25 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6681674884; Sun, 19 Nov 2017 11:24:25 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJBOONr016490; Sun, 19 Nov 2017 11:24:24 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJBOOIA016489; Sun, 19 Nov 2017 11:24:24 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201711191124.vAJBOOIA016489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 19 Nov 2017 11:24: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: r325996 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 325996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 11:24:25 -0000 Author: bcr (doc committer) Date: Sun Nov 19 11:24:24 2017 New Revision: 325996 URL: https://svnweb.freebsd.org/changeset/base/325996 Log: MFC r325441: Extend the synopsis section of md(4) to look more like other manpages of this kind. Describe how to compile the driver into the kernel and how to load it as a module. This is useful for people using the MINIMAL kernel configuration file. PR: 218610 Submitted by: Harald Schmalzbauer (bugzilla.freebsd@omnilan.de) Reviewed by: noone (1 month inactivity) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12271 Modified: stable/11/share/man/man4/md.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/md.4 ============================================================================== --- stable/11/share/man/man4/md.4 Sun Nov 19 11:21:16 2017 (r325995) +++ stable/11/share/man/man4/md.4 Sun Nov 19 11:24:24 2017 (r325996) @@ -7,14 +7,26 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd November 5, 2017 .Dt MD 4 .Os .Sh NAME .Nm md .Nd memory disk .Sh SYNOPSIS -.Cd device md +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device md" +.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 +geom_md_load="YES" +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-stable-11@freebsd.org Mon Nov 20 06:48:12 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AF27DE37A9; Mon, 20 Nov 2017 06:48:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDB5072F48; Mon, 20 Nov 2017 06:48:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAK6mB78003558; Mon, 20 Nov 2017 06:48:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAK6mAjg003554; Mon, 20 Nov 2017 06:48:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711200648.vAK6mAjg003554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 20 Nov 2017 06: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: r326005 - in stable/11/sys/dev: hpt27xx hptnr X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11/sys/dev: hpt27xx hptnr X-SVN-Commit-Revision: 326005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 06:48:12 -0000 Author: delphij Date: Mon Nov 20 06:48:10 2017 New Revision: 326005 URL: https://svnweb.freebsd.org/changeset/base/326005 Log: MFC r325383: Avoid calling get_controller_count() until attaching, this would avoid costly PCI config space operations that slows down systems without the hardware. Many thanks to HighPoint for continued support of FreeBSD! Submitted by: Steve Chang Reported by: cperciva Modified: stable/11/sys/dev/hpt27xx/hpt27xx_config.c stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c stable/11/sys/dev/hptnr/hptnr_config.c stable/11/sys/dev/hptnr/hptnr_osm_bsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hpt27xx/hpt27xx_config.c ============================================================================== --- stable/11/sys/dev/hpt27xx/hpt27xx_config.c Mon Nov 20 04:32:01 2017 (r326004) +++ stable/11/sys/dev/hpt27xx/hpt27xx_config.c Mon Nov 20 06:48:10 2017 (r326005) @@ -60,7 +60,7 @@ int init_config(void) const char driver_name[] = "hpt27xx"; const char driver_name_long[] = "RocketRAID 27xx controller driver"; -const char driver_ver[] = "v1.2.7"; +const char driver_ver[] = "v1.2.8"; int osm_max_targets = 0xff; Modified: stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Mon Nov 20 04:32:01 2017 (r326004) +++ stable/11/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Mon Nov 20 06:48:10 2017 (r326005) @@ -31,7 +31,7 @@ #include #include -static HIM *hpt_match(device_t dev) +static HIM *hpt_match(device_t dev, int scan) { PCI_ID pci_id; HIM *him; @@ -39,7 +39,7 @@ static HIM *hpt_match(device_t dev) for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { - if (him->get_controller_count) + if (scan && him->get_controller_count) him->get_controller_count(&pci_id,0,0); if ((pci_get_vendor(dev) == pci_id.vid) && (pci_get_device(dev) == pci_id.did)){ @@ -54,7 +54,7 @@ static int hpt_probe(device_t dev) { HIM *him; - him = hpt_match(dev); + him = hpt_match(dev, 0); if (him != NULL) { KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) @@ -77,7 +77,7 @@ static int hpt_attach(device_t dev) KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); - him = hpt_match(dev); + him = hpt_match(dev, 1); hba->ext_type = EXT_TYPE_HBA; hba->ldm_adapter.him = him; pci_enable_busmaster(dev); Modified: stable/11/sys/dev/hptnr/hptnr_config.c ============================================================================== --- stable/11/sys/dev/hptnr/hptnr_config.c Mon Nov 20 04:32:01 2017 (r326004) +++ stable/11/sys/dev/hptnr/hptnr_config.c Mon Nov 20 06:48:10 2017 (r326005) @@ -46,7 +46,7 @@ int init_config(void) const char driver_name[] = "hptnr"; const char driver_name_long[] = "R750/DC7280 controller driver"; -const char driver_ver[] = "v1.1.4"; +const char driver_ver[] = "v1.1.5"; int osm_max_targets = 0xff; Modified: stable/11/sys/dev/hptnr/hptnr_osm_bsd.c ============================================================================== --- stable/11/sys/dev/hptnr/hptnr_osm_bsd.c Mon Nov 20 04:32:01 2017 (r326004) +++ stable/11/sys/dev/hptnr/hptnr_osm_bsd.c Mon Nov 20 06:48:10 2017 (r326005) @@ -32,7 +32,7 @@ #include int msi = 0; int debug_flag = 0; -static HIM *hpt_match(device_t dev) +static HIM *hpt_match(device_t dev, int scan) { PCI_ID pci_id; HIM *him; @@ -40,7 +40,7 @@ static HIM *hpt_match(device_t dev) for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { - if (him->get_controller_count) + if (scan && him->get_controller_count) him->get_controller_count(&pci_id,0,0); if ((pci_get_vendor(dev) == pci_id.vid) && (pci_get_device(dev) == pci_id.did)){ @@ -56,7 +56,7 @@ static int hpt_probe(device_t dev) { HIM *him; - him = hpt_match(dev); + him = hpt_match(dev, 0); if (him != NULL) { KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) @@ -79,7 +79,7 @@ static int hpt_attach(device_t dev) KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); - him = hpt_match(dev); + him = hpt_match(dev, 1); hba->ext_type = EXT_TYPE_HBA; hba->ldm_adapter.him = him; From owner-svn-src-stable-11@freebsd.org Mon Nov 20 08:12:41 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A4EDE4F3C; Mon, 20 Nov 2017 08:12:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 408CA74F67; Mon, 20 Nov 2017 08:12:41 +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 vAK8CeLt040821; Mon, 20 Nov 2017 08:12:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAK8CeNK040820; Mon, 20 Nov 2017 08:12:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711200812.vAK8CeNK040820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Nov 2017 08:12: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: r326009 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 326009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 08:12:41 -0000 Author: kib Date: Mon Nov 20 08:12:40 2017 New Revision: 326009 URL: https://svnweb.freebsd.org/changeset/base/326009 Log: MFC r325759: Do not leak PMC_PO_OWNS_LOGFILE on error. Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_logging.c Mon Nov 20 06:59:03 2017 (r326008) +++ stable/11/sys/dev/hwpmc/hwpmc_logging.c Mon Nov 20 08:12:40 2017 (r326009) @@ -687,6 +687,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o (void) fdrop(po->po_file, curthread); po->po_file = NULL; /* clear file and error state */ po->po_error = 0; + po->po_flags &= ~PMC_PO_OWNS_LOGFILE; return (error); } From owner-svn-src-stable-11@freebsd.org Mon Nov 20 09:23:10 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 737A8DE6471; Mon, 20 Nov 2017 09:23:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id 29E1476D4E; Mon, 20 Nov 2017 09:23:10 +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 vAK9N9u5070152; Mon, 20 Nov 2017 09:23:09 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAK9N98f070151; Mon, 20 Nov 2017 09:23:09 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711200923.vAK9N98f070151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 20 Nov 2017 09:23: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: r326011 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 326011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 09:23:10 -0000 Author: eugen Date: Mon Nov 20 09:23:08 2017 New Revision: 326011 URL: https://svnweb.freebsd.org/changeset/base/326011 Log: MFC r325436: RTF_PINNED for an interface Allow a process to assign an IP address to local ppp interface even if kernel routing table already has a route to the address in question installed by some routing daemon (PR 223129). Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647). PR: 222647, 223129 Reviewed by: gnn Approved by: mav (mentor) Differential Revision: https://reviews.freebsd.org/D12747 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Mon Nov 20 08:52:33 2017 (r326010) +++ stable/11/sys/net/if.c Mon Nov 20 09:23:08 2017 (r326011) @@ -1708,7 +1708,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype bzero(&info, sizeof(info)); if (cmd != RTM_DELETE) info.rti_ifp = V_loif; - info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); From owner-svn-src-stable-11@freebsd.org Mon Nov 20 15:46:25 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B992DEF5FE; Mon, 20 Nov 2017 15:46:25 +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 mx1.freebsd.org (Postfix) with ESMTPS id E9C233233; Mon, 20 Nov 2017 15:46:24 +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 vAKFkOp9033765; Mon, 20 Nov 2017 15:46:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKFkOlU033764; Mon, 20 Nov 2017 15:46:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711201546.vAKFkOlU033764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 20 Nov 2017 15:46: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: r326014 - 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: 326014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 15:46:25 -0000 Author: gjb Date: Mon Nov 20 15:46:23 2017 New Revision: 326014 URL: https://svnweb.freebsd.org/changeset/base/326014 Log: MFC r325863: Only copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does not already exist within ${CHROOTDIR}. This allows re-using a build chroot with CHROOTBUILD_SKIP set to a non-empty value and CHROOTDIR set to '/' in release.conf. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/release.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/11/release/release.sh ============================================================================== --- stable/11/release/release.sh Mon Nov 20 15:03:03 2017 (r326013) +++ stable/11/release/release.sh Mon Nov 20 15:46:23 2017 (r326014) @@ -252,8 +252,8 @@ chroot_setup() { extra_chroot_setup() { mkdir -p ${CHROOTDIR}/dev mount -t devfs devfs ${CHROOTDIR}/dev - [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \ - ${CHROOTDIR}/etc/resolv.conf + [ -e /etc/resolv.conf -a ! -e ${CHROOTDIR}/etc/resolv.conf ] && \ + cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints # is created. This is needed by ports-mgmt/pkg. eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart From owner-svn-src-stable-11@freebsd.org Mon Nov 20 15:57:14 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 900F9DEF980; Mon, 20 Nov 2017 15:57:14 +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 mx1.freebsd.org (Postfix) with ESMTPS id 447773892; Mon, 20 Nov 2017 15:57:14 +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 vAKFvDZD038170; Mon, 20 Nov 2017 15:57:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKFvBDE038151; Mon, 20 Nov 2017 15:57:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711201557.vAKFvBDE038151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 20 Nov 2017 15:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326015 - in stable/11/release: amd64 arm arm64 i386 powerpc sparc64 X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11/release: amd64 arm arm64 i386 powerpc sparc64 X-SVN-Commit-Revision: 326015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 15:57:14 -0000 Author: gjb Date: Mon Nov 20 15:57:11 2017 New Revision: 326015 URL: https://svnweb.freebsd.org/changeset/base/326015 Log: MFC r325950, r325953: r325950: Sort variables for consistency. r325953: Add general configuration files used by release/release.sh for big-iron installation images. Sponsored by: The FreeBSD Foundation Added: stable/11/release/amd64/amd64.conf - copied unchanged from r325953, head/release/amd64/amd64.conf stable/11/release/arm64/aarch64.conf - copied unchanged from r325953, head/release/arm64/aarch64.conf stable/11/release/i386/i386.conf - copied unchanged from r325953, head/release/i386/i386.conf stable/11/release/powerpc/powerpc.conf - copied unchanged from r325953, head/release/powerpc/powerpc.conf stable/11/release/powerpc/powerpc64.conf - copied unchanged from r325953, head/release/powerpc/powerpc64.conf stable/11/release/powerpc/powerpcspe.conf - copied unchanged from r325953, head/release/powerpc/powerpcspe.conf stable/11/release/sparc64/sparc64.conf - copied unchanged from r325953, head/release/sparc64/sparc64.conf Modified: stable/11/release/arm/BANANAPI.conf stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/CUBIEBOARD.conf stable/11/release/arm/CUBIEBOARD2.conf stable/11/release/arm/CUBOX-HUMMINGBOARD.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf stable/11/release/arm/RPI-B.conf stable/11/release/arm/RPI2.conf stable/11/release/arm/WANDBOARD.conf Directory Properties: stable/11/ (props changed) Copied: stable/11/release/amd64/amd64.conf (from r325953, head/release/amd64/amd64.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/amd64/amd64.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/amd64/amd64.conf) @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build amd64/amd64. + +TARGET="amd64" +TARGET_ARCH="amd64" +KERNEL="GENERIC" Modified: stable/11/release/arm/BANANAPI.conf ============================================================================== --- stable/11/release/arm/BANANAPI.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/BANANAPI.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-bananapi" -KERNEL="ALLWINNER" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="1G" +KERNEL="ALLWINNER" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" export BOARDNAME="BANANAPI" arm_install_uboot() { Modified: stable/11/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/11/release/arm/BEAGLEBONE.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/BEAGLEBONE.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -KERNEL="BEAGLEBONE" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" +IMAGE_SIZE="1G" +KERNEL="BEAGLEBONE" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" Modified: stable/11/release/arm/CUBIEBOARD.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/CUBIEBOARD.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -KERNEL="ALLWINNER_UP" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="1G" +KERNEL="ALLWINNER_UP" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-cubieboard" Modified: stable/11/release/arm/CUBIEBOARD2.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD2.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/CUBIEBOARD2.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -KERNEL="ALLWINNER" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="1G" +KERNEL="ALLWINNER" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" export BOARDNAME="CUBIEBOARD2" arm_install_uboot() { Modified: stable/11/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" -KERNEL="IMX6" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1536M" -PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" +IMAGE_SIZE="1536M" +KERNEL="IMX6" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" export BOARDNAME="CUBOX-HUMMINGBOARD" arm_install_uboot() { Modified: stable/11/release/arm/GUMSTIX.conf ============================================================================== --- stable/11/release/arm/GUMSTIX.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/GUMSTIX.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="arm" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" -KERNEL="GUMSTIX" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" +IMAGE_SIZE="1G" +KERNEL="GUMSTIX" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-duovero" Modified: stable/11/release/arm/PANDABOARD.conf ============================================================================== --- stable/11/release/arm/PANDABOARD.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/PANDABOARD.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -KERNEL="PANDABOARD" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" +IMAGE_SIZE="1G" +KERNEL="PANDABOARD" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-pandaboard" Modified: stable/11/release/arm/RPI-B.conf ============================================================================== --- stable/11/release/arm/RPI-B.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/RPI-B.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi" -KERNEL="RPI-B" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="1G" -PART_SCHEME="MBR" FAT_SIZE="17m" FAT_TYPE="16" +IMAGE_SIZE="1G" +KERNEL="RPI-B" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" Modified: stable/11/release/arm/RPI2.conf ============================================================================== --- stable/11/release/arm/RPI2.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/RPI2.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi2" -KERNEL="RPI2" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="1536M" -PART_SCHEME="MBR" FAT_SIZE="50m" FAT_TYPE="16" +IMAGE_SIZE="1536M" +KERNEL="RPI2" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" Modified: stable/11/release/arm/WANDBOARD.conf ============================================================================== --- stable/11/release/arm/WANDBOARD.conf Mon Nov 20 15:46:23 2017 (r326014) +++ stable/11/release/arm/WANDBOARD.conf Mon Nov 20 15:57:11 2017 (r326015) @@ -3,18 +3,18 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-wandboard" -KERNEL="IMX6" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1536M" -PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" +IMAGE_SIZE="1536M" +KERNEL="IMX6" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" +WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" export BOARDNAME="WANDBOARD" arm_install_uboot() { Copied: stable/11/release/arm64/aarch64.conf (from r325953, head/release/arm64/aarch64.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/arm64/aarch64.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/arm64/aarch64.conf) @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build arm64/aarch64 +# big-iron installation images (not system-on-chip (SoC) images). + +TARGET="arm64" +TARGET_ARCH="aarch64" +KERNEL="GENERIC" Copied: stable/11/release/i386/i386.conf (from r325953, head/release/i386/i386.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/i386/i386.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/i386/i386.conf) @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build i386/i386. +# Note: CHROOT_MAKEENV assumes the build host is amd64. + +TARGET="i386" +TARGET_ARCH="i386" +KERNEL="GENERIC" +CHROOT_MAKEENV="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" Copied: stable/11/release/powerpc/powerpc.conf (from r325953, head/release/powerpc/powerpc.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/powerpc/powerpc.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/powerpc/powerpc.conf) @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build powerpc/powerpc. + +TARGET="powerpc" +TARGET_ARCH="powerpc" +KERNEL="GENERIC" Copied: stable/11/release/powerpc/powerpc64.conf (from r325953, head/release/powerpc/powerpc64.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/powerpc/powerpc64.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/powerpc/powerpc64.conf) @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build powerpc/powerpc64. + +TARGET="powerpc" +TARGET_ARCH="powerpc64" +KERNEL="GENERIC64" Copied: stable/11/release/powerpc/powerpcspe.conf (from r325953, head/release/powerpc/powerpcspe.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/powerpc/powerpcspe.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/powerpc/powerpcspe.conf) @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build powerpc/powerpcspe. + +TARGET="powerpc" +TARGET_ARCH="powerpcspe" +KERNEL="MPC85XXSPE" Copied: stable/11/release/sparc64/sparc64.conf (from r325953, head/release/sparc64/sparc64.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/release/sparc64/sparc64.conf Mon Nov 20 15:57:11 2017 (r326015, copy of r325953, head/release/sparc64/sparc64.conf) @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build sparc64/sparc64. + +TARGET="sparc64" +TARGET_ARCH="sparc64" +KERNEL="GENERIC" From owner-svn-src-stable-11@freebsd.org Mon Nov 20 19:05:10 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63141DF2F5C; Mon, 20 Nov 2017 19:05:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2DF9C6844F; Mon, 20 Nov 2017 19:05:10 +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 vAKJ59Vl016909; Mon, 20 Nov 2017 19:05:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJ58h1016898; Mon, 20 Nov 2017 19:05:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711201905.vAKJ58h1016898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 20 Nov 2017 19:05: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: r326017 - stable/11/release/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/arm X-SVN-Commit-Revision: 326017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 19:05:10 -0000 Author: gjb Date: Mon Nov 20 19:05:08 2017 New Revision: 326017 URL: https://svnweb.freebsd.org/changeset/base/326017 Log: MFC r325373, r325861: r325373 (manu): release/arm: Do not install ubldr r325861 (manu): release: Update u-boot and firmware file for RPI-B target. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/arm/BANANAPI.conf stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/CUBIEBOARD.conf stable/11/release/arm/CUBIEBOARD2.conf stable/11/release/arm/CUBOX-HUMMINGBOARD.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf stable/11/release/arm/RPI-B.conf stable/11/release/arm/RPI2.conf stable/11/release/arm/WANDBOARD.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/arm/BANANAPI.conf ============================================================================== --- stable/11/release/arm/BANANAPI.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/BANANAPI.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -27,7 +27,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: stable/11/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/11/release/arm/BEAGLEBONE.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/BEAGLEBONE.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -25,7 +25,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} ln ${UFSMOUNT}/boot/dtb/beaglebone.dtb \ Modified: stable/11/release/arm/CUBIEBOARD.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/CUBIEBOARD.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -26,7 +26,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: stable/11/release/arm/CUBIEBOARD2.conf ============================================================================== --- stable/11/release/arm/CUBIEBOARD2.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/CUBIEBOARD2.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -27,7 +27,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} ln ${UFSMOUNT}/boot/dtb/cubieboard2.dtb \ Modified: stable/11/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/CUBOX-HUMMINGBOARD.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -27,7 +27,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: stable/11/release/arm/GUMSTIX.conf ============================================================================== --- stable/11/release/arm/GUMSTIX.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/GUMSTIX.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -25,7 +25,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: stable/11/release/arm/PANDABOARD.conf ============================================================================== --- stable/11/release/arm/PANDABOARD.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/PANDABOARD.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -25,7 +25,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: stable/11/release/arm/RPI-B.conf ============================================================================== --- stable/11/release/arm/RPI-B.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/RPI-B.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -6,7 +6,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 -EMBEDDEDPORTS="sysutils/u-boot-rpi" +EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" FAT_SIZE="17m" FAT_TYPE="16" IMAGE_SIZE="1G" @@ -18,8 +18,11 @@ WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" - UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ - start.elf start_cd.elf u-boot.img" + RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" + UBOOT_FILES="u-boot.bin" + RPI_FIRMWARE_FILES="bootcode.bin config.txt \ + fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ + start.elf start_cd.elf start_db.elf start_x.elf" FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -29,7 +32,10 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr + for _UF in ${RPI_FIRMWARE_FILES}; do + chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi.dtb \ Modified: stable/11/release/arm/RPI2.conf ============================================================================== --- stable/11/release/arm/RPI2.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/RPI2.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -29,7 +29,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi2.dtb \ Modified: stable/11/release/arm/WANDBOARD.conf ============================================================================== --- stable/11/release/arm/WANDBOARD.conf Mon Nov 20 15:57:56 2017 (r326016) +++ stable/11/release/arm/WANDBOARD.conf Mon Nov 20 19:05:08 2017 (r326017) @@ -27,7 +27,6 @@ arm_install_uboot() { chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} - chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot From owner-svn-src-stable-11@freebsd.org Tue Nov 21 02:10:02 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31C8DBFC55; Tue, 21 Nov 2017 02:10:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 849CE78571; Tue, 21 Nov 2017 02:10:01 +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 vAL2A0hS093223; Tue, 21 Nov 2017 02:10:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL29xaV093186; Tue, 21 Nov 2017 02:09:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711210209.vAL29xaV093186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 21 Nov 2017 02:09: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: r326044 - in stable/11: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Commit-Revision: 326044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 02:10:02 -0000 Author: jhb Date: Tue Nov 21 02:09:59 2017 New Revision: 326044 URL: https://svnweb.freebsd.org/changeset/base/326044 Log: MFC 319493,319509,319520,319595,319677,319679-319681,319688,319689, 319761-319768,320010,322899,322959,323020,323021,323151: Sync libsysdecode, kdump, and truss with head (aside from changes such as ino64 that are not applicable to 11). 319493: Decode the arguments passed to __cap_rights_get() and cap_rights_limit(). 319509: Decode the argument passed to cap_getmode(). The returned integer value is output. 319520: Decode the 'who' argument passed to getrusage(). Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant passed as the first argument to getrusage(). Use this function in both kdump and truss to decode the first argument to getrusage(). 319595: Decode arguments to dup, dup2, getdirentries, pread, and pwrite. - dup and dup2 print fd arguments in decimal. - pread and pwrite are similar to read and write with the addition of the file offset. - getdirentries displays the output entries as a string for now and also prints the value returned in *basep. Eventually the buffer for getdirentries should perhaps be decoded as an array of dirent structures. 319677: Decode arguments to ACL related system calls. This only decodes the raw arguments but not the contents of the struct acl objects. 319679: Decode arguments passed to extended attribute related system calls. The cmd argument passed to extattrctl() is not decoded as a string constant but is just printed in hex. The value is filesystem-specific but in practice is only used with UFS1 filesystems. 319680: Decode arguments to minherit(). 319681: Decode arguments to mlock(), mlockall(), and munlock(). 319688: Decode flags passed to mount(), nmount(), and unmount(). 319689: Decode arguments passed to msync(). 319761: Fix decoding of setpriority() arguments. The PRIO_* 'which' value is stored in the first argument to setpriority(2), not the last. While here, decode the arguments to getpriority(2). 319762: Decode arguments to getpriority() and setpriority(). 319763: Decode the arguments to ptrace(). This does not decode structures returned by ptrace(). 319764: Decode the arguments to quotactl(). 319765: Improve decoding of RB_AUTOBOOT in the 'howto' argument to reboot(). The reboot() system call accepts a mode (RB_AUTOBOOT, RB_HALT, RB_POWEROFF, or RB_REROOT) as well as zero or more optional flags in 'howto'. However, RB_AUTOBOOT was only displayed if 'howto' was exactly 0. Combinations like 'RB_AUTOBOOT | RB_DUMP' were decoded as 'RB_DUMP'. Instead, imply that RB_AUTOBOOT was specified if none of the other "mode" flags were specified. 319766: Decode the 'howto' argument to reboot(). 319767: Decode arguments to rtprio_thread() (same as rtprio()). 319768: Decode arguments to rtprio() and rtprio_thread(). 320010: Decode arguments to sched_* family of system calls. This includes decoding both scheduler policy constants and the sched_param structure for sched_get_priority_max(), sched_get_priority_min(), sched_getparam(), sched_getscheduler(), sched_rr_get_interval(), sched_setparam(), and sched_setscheduler(). 322899: Decode arguments passed to thr_set_name(). 322959: Decode extra signal information for caught signals. Decode fields from the siginfo_t stored in the PT_LWPINFO structure when a signal is caught by a traced process. This includes the signal code (si_code) as well as additional members such as si_addr, si_pid, etc. 323020: Trim stale prototype for ioctlname(). 323021: Decode signal information returned by system calls. Specifically, decode the siginfo structure returned by sigtimedwait(), sigwaitinfo(), and wait6(). While here, also decode the signal number returned in the second argument to sigwait(). 323151: Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode. Move tables that were previously in truss over to libsysdecode. truss output is unchanged, but kdump has been updated to decode these fields. In addition, sysdecode_sysarch_number() should support all platforms whereas the old table in truss only supported x86. PR: 214885, 215448 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 stable/11/lib/libsysdecode/sysdecode_mask.3 stable/11/usr.bin/kdump/kdump.c stable/11/usr.bin/truss/extern.h stable/11/usr.bin/truss/setup.c stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/Makefile Tue Nov 21 02:09:59 2017 (r326044) @@ -32,6 +32,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_fadvice.3 \ sysdecode_enum.3 sysdecode_fcntl_cmd.3 \ sysdecode_enum.3 sysdecode_getfsstat_mode.3 \ + sysdecode_enum.3 sysdecode_getrusage_who.3 \ sysdecode_enum.3 sysdecode_idtype.3 \ sysdecode_enum.3 sysdecode_ipproto.3 \ sysdecode_enum.3 sysdecode_kldsym_cmd.3 \ @@ -41,6 +42,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_minherit_flags.3 \ sysdecode_enum.3 sysdecode_msgctl_cmd.3 \ sysdecode_enum.3 sysdecode_nfssvc_flags.3 \ + sysdecode_enum.3 sysdecode_pathconf_name.3 \ sysdecode_enum.3 sysdecode_prio_which.3 \ sysdecode_enum.3 sysdecode_procctl_cmd.3 \ sysdecode_enum.3 sysdecode_ptrace_request.3 \ @@ -62,11 +64,13 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_socketdomain.3 \ sysdecode_enum.3 sysdecode_sockettype.3 \ sysdecode_enum.3 sysdecode_sockopt_level.3 \ + sysdecode_enum.3 sysdecode_sysarch_number.3 \ sysdecode_enum.3 sysdecode_umtx_op.3 \ sysdecode_enum.3 sysdecode_vmresult.3 \ sysdecode_enum.3 sysdecode_whence.3 MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3 MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ + sysdecode_mask.3 sysdecode_atflags.3 \ sysdecode_mask.3 sysdecode_capfcntlrights.3 \ sysdecode_mask.3 sysdecode_fcntl_fileflags.3 \ sysdecode_mask.3 sysdecode_fileflags.3 \ Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/flags.c Tue Nov 21 02:09:59 2017 (r326044) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -250,6 +251,13 @@ sysdecode_atfd(int fd) return (NULL); } +bool +sysdecode_atflags(FILE *fp, int flag, int *rem) +{ + + return (print_mask_int(fp, atflags, flag, rem)); +} + static struct name_table semctlops[] = { X(GETNCNT) X(GETPID) X(GETVAL) X(GETALL) X(GETZCNT) X(SETVAL) X(SETALL) X(IPC_RMID) X(IPC_SET) X(IPC_STAT) XEND @@ -487,6 +495,13 @@ sysdecode_getfsstat_mode(int mode) } const char * +sysdecode_getrusage_who(int who) +{ + + return (lookup_value(rusage, who)); +} + +const char * sysdecode_kldsym_cmd(int cmd) { @@ -627,8 +642,19 @@ sysdecode_quotactl_cmd(FILE *fp, int cmd) bool sysdecode_reboot_howto(FILE *fp, int howto, int *rem) { + bool printed; - return (print_mask_int(fp, rebootopt, howto, rem)); + /* + * RB_AUTOBOOT is special in that its value is zero, but it is + * also an implied argument if a different operation is not + * requested via RB_HALT, RB_POWEROFF, or RB_REROOT. + */ + if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT)) == 0) { + fputs("RB_AUTOBOOT|", fp); + printed = true; + } else + printed = false; + return (print_mask_int(fp, rebootopt, howto, rem) || printed); } bool @@ -930,6 +956,13 @@ sysdecode_mmap_flags(FILE *fp, int flags, int *rem) } const char * +sysdecode_pathconf_name(int name) +{ + + return (lookup_value(pathconfname, name)); +} + +const char * sysdecode_rtprio_function(int function) { @@ -968,6 +1001,13 @@ sysdecode_sigcode(int sig, int si_code) default: return (NULL); } +} + +const char * +sysdecode_sysarch_number(int number) +{ + + return (lookup_value(sysarchnum, number)); } bool Modified: stable/11/lib/libsysdecode/mktables ============================================================================== --- stable/11/lib/libsysdecode/mktables Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/mktables Tue Nov 21 02:09:59 2017 (r326044) @@ -91,6 +91,7 @@ _EOF_ gen_table "accessmode" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" gen_table "acltype" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" +gen_table "atflags" "AT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" gen_table "capfcntl" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capsicum.h" gen_table "extattrns" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" gen_table "fadvisebehav" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" @@ -109,6 +110,7 @@ gen_table "filemode" "S_[A-Z]+[[:space:]]+[0-6] gen_table "mountflags" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h" gen_table "msyncflags" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/nfssvc.h" +gen_table "pathconfname" "_PC_[A-Z4_]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "prio" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" gen_table "procctlcmd" "PROC_[A-Z_]+[[:space:]]+[0-9]" "sys/procctl.h" "PROC_TRACE_CTL_" gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" @@ -116,6 +118,7 @@ gen_table "quotactlcmds" "Q_[A-Z]+[[:space:]]+0x[0- gen_table "rebootopt" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h" gen_table "rforkflags" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h" gen_table "rlimit" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" +gen_table "rusage" "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" "sys/resource.h" gen_table "schedpolicy" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" gen_table "sendfileflags" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" gen_table "shmatflags" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" @@ -152,6 +155,11 @@ 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" +if [ -e "${include_dir}/x86/sysarch.h" ]; then + gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" +else + gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h" +fi # Generate a .depend file for our output file if [ -n "$output_file" ]; then Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/sysdecode.h Tue Nov 21 02:09:59 2017 (r326044) @@ -42,6 +42,7 @@ int sysdecode_abi_to_freebsd_errno(enum sysdecode_abi bool sysdecode_access_mode(FILE *_fp, int _mode, int *_rem); const char *sysdecode_acltype(int _type); 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_extattrnamespace(int _namespace); @@ -55,6 +56,7 @@ bool sysdecode_filemode(FILE *_fp, int _mode, int *_re bool sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem); int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error); const char *sysdecode_getfsstat_mode(int _mode); +const char *sysdecode_getrusage_who(int _who); const char *sysdecode_idtype(int _idtype); const char *sysdecode_ioctlname(unsigned long _val); const char *sysdecode_ipproto(int _protocol); @@ -72,6 +74,7 @@ bool sysdecode_msg_flags(FILE *_fp, int _flags, int *_ bool sysdecode_msync_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_nfssvc_flags(int _flags); bool sysdecode_open_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_pathconf_name(int _name); bool sysdecode_pipe2_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_prio_which(int _which); const char *sysdecode_procctl_cmd(int _cmd); @@ -104,6 +107,7 @@ bool sysdecode_socket_type(FILE *_fp, int _type, int * const char *sysdecode_sockopt_level(int _level); const char *sysdecode_sockopt_name(int _level, int _optname); const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); +const char *sysdecode_sysarch_number(int _number); bool sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem); const char *sysdecode_umtx_op(int _op); Modified: stable/11/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_enum.3 Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/sysdecode_enum.3 Tue Nov 21 02:09:59 2017 (r326044) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd September 3, 2017 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nm sysdecode_fadvice , .Nm sysdecode_fcntl_cmd , .Nm sysdecode_getfsstat_mode , +.Nm sysdecode_getrusage_who , .Nm sysdecode_idtype , .Nm sysdecode_ipproto , .Nm sysdecode_kldsym_cmd , @@ -45,6 +46,7 @@ .Nm sysdecode_minherit_flags , .Nm sysdecode_msgctl_cmd , .Nm sysdecode_nfssvc_flags , +.Nm sysdecode_pathconf_name , .Nm sysdecode_prio_which , .Nm sysdecode_procctl_cmd , .Nm sysdecode_ptrace_request , @@ -66,6 +68,7 @@ .Nm sysdecode_socketdomain , .Nm sysdecode_sockettype , .Nm sysdecode_sockopt_level , +.Nm sysdecode_sysarch_number , .Nm sysdecode_umtx_op , .Nm sysdecode_vmresult , .Nm sysdecode_whence @@ -89,6 +92,8 @@ .Ft const char * .Fn sysdecode_getfsstat_mode "int mode" .Ft const char * +.Fn sysdecode_getrusage_who "int who" +.Ft const char * .Fn sysdecode_idtype "int idtype" .Ft const char * .Fn sysdecode_ipproto "int protocol" @@ -107,6 +112,8 @@ .Ft const char * .Fn sysdecode_nfssvc_flags "int flags" .Ft const char * +.Fn sysdecode_pathconf_name "int name" +.Ft const char * .Fn sysdecode_prio_which "int which" .Ft const char * .Fn sysdecode_procctl_cmd "int cmd" @@ -149,6 +156,8 @@ .Ft const char * .Fn sysdecode_sockopt_level "int level" .Ft const char * +.Fn sysdecode_sysarch_number "int number" +.Ft const char * .Fn sysdecode_umtx_op "int op" .Ft const char * .Fn sysdecode_vmresult "int result" @@ -183,17 +192,20 @@ Most of these functions decode an argument passed to a .It Fn sysdecode_minherit_inherit Ta Xr minherit 2 Ta Fa inherit .It Fn sysdecode_msgctl_cmd Ta Xr msgctl 2 Ta Fa cmd .It Fn sysdecode_nfssvc_flags Ta Xr nfssvc 2 Ta Fa flags +.It Fn sysdecode_pathconf_name Ta Xr pathconf 2 Ta Fa name .It Fn sysdecode_prio_which Ta Xr getpriority 2 Ta Fa which .It Fn sysdecode_procctl_cmd Ta Xr procctl 2 Ta Fa cmd .It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request .It Fn sysdecode_rlimit Ta Xr getrlimit 2 Ta Fa resource .It Fn sysdecode_rtprio_function Ta Xr rtprio 2 Ta Fa function +.It Fn sysdecode_getrusage_who Ta Xr getrusage 2 Ta Fa who .It Fn sysdecode_scheduler_policy Ta Xr sched_setscheduler 2 Ta Fa policy .It Fn sysdecode_semctl_cmd Ta Xr semctl 2 Ta Fa cmd .It Fn sysdecode_shmctl_cmd Ta Xr shmctl 2 Ta Fa cmd .It Fn sysdecode_shutdown_how Ta Xr shutdown 2 Ta Fa how .It Fn sysdecode_sigprocmask_how Ta Xr sigprocmask 2 Ta Fa how .It Fn sysdecode_sockopt_level Ta Xr getsockopt 2 Ta Fa level +.It Fn sysdecode_sysarch_number Ta Xr sysarch 2 Ta Fa number .It Fn sysdecode_umtx_op Ta Xr _umtx_op 2 Ta Fa op .It Fn sysdecode_whence Ta Xr lseek 2 Ta Fa whence .El Modified: stable/11/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_mask.3 Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/sysdecode_mask.3 Tue Nov 21 02:09:59 2017 (r326044) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd September 3, 2017 .Dt sysdecode_mask 3 .Os .Sh NAME .Nm sysdecode_mask , .Nm sysdecode_accessmode , +.Nm sysdecode_atflags , .Nm sysdecode_capfcntlrights , .Nm sysdecode_fcntl_fileflags , .Nm sysdecode_fileflags , @@ -66,6 +67,8 @@ .Ft bool .Fn sysdecode_access_mode "FILE *fp" "int mode" "int *rem" .Ft bool +.Fn sysdecode_atflags "FILE *fp" "int flags" "int *rem" +.Ft bool .Fn sysdecode_cap_fcntlrights "FILE *fp" "uint32_t rights" "uint32_t *rem" .Ft bool .Fn sysdecode_fcntl_fileflags "FILE *fp" "int flags" "int *rem" @@ -148,6 +151,7 @@ Most of these functions decode an argument passed to a .Bl -column "Fn sysdecode_flock_operation" "Xr cap_fcntls_limit 2" .It Sy Function Ta Sy System Call Ta Sy Argument .It Fn sysdecode_access_mode Ta Xr access 2 Ta Fa mode +.It Fn sysdecode_atflags Ta Xr chflagsat 2 , Xr fstatat 2 Ta Fa atflag , Fa flag .It Fn sysdecode_cap_fcntlrights Ta Xr cap_fcntls_limit 2 Ta Fa fcntlrights .It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags .It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/kdump/kdump.c Tue Nov 21 02:09:59 2017 (r326044) @@ -1097,11 +1097,20 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) ip++; narg--; break; - case SYS_setpriority: + case SYS_pathconf: + case SYS_lpathconf: + case SYS_fpathconf: print_number(ip, narg, c); - print_number(ip, narg, c); putchar(','); + print_integer_arg(sysdecode_pathconf_name, *ip); + ip++; + narg--; + break; + case SYS_getpriority: + case SYS_setpriority: + putchar('('); print_integer_arg(sysdecode_prio_which, *ip); + c = ','; ip++; narg--; break; @@ -1227,6 +1236,13 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) narg--; c = ','; break; + case SYS_getrusage: + putchar('('); + print_integer_arg(sysdecode_getrusage_who, *ip); + ip++; + narg--; + c = ','; + break; case SYS_quotactl: print_number(ip, narg, c); putchar(','); @@ -1249,6 +1265,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) c = ','; break; case SYS_rtprio: + case SYS_rtprio_thread: putchar('('); print_integer_arg(sysdecode_rtprio_function, *ip); @@ -1448,6 +1465,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) print_integer_arg_valid(sysdecode_atfd, *ip); ip++; narg--; + print_number(ip, narg, c); break; case SYS_cap_fcntls_limit: print_number(ip, narg, c); @@ -1505,6 +1523,41 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) case SYS_truncate: print_number(ip, narg, c); print_number64(first, ip, narg, c); + break; + case SYS_fchownat: + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + break; + case SYS_fstatat: + case SYS_utimensat: + print_number(ip, narg, c); + print_number(ip, narg, c); + break; + case SYS_unlinkat: + print_number(ip, narg, c); + break; + case SYS_sysarch: + putchar('('); + print_integer_arg(sysdecode_sysarch_number, *ip); + ip++; + narg--; + c = ','; + break; + } + switch (ktr->ktr_code) { + case SYS_chflagsat: + case SYS_fchownat: + case SYS_faccessat: + case SYS_fchmodat: + case SYS_fstatat: + case SYS_linkat: + case SYS_unlinkat: + case SYS_utimensat: + putchar(','); + print_mask_arg0(sysdecode_atflags, *ip); + ip++; + narg--; break; } } Modified: stable/11/usr.bin/truss/extern.h ============================================================================== --- stable/11/usr.bin/truss/extern.h Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/extern.h Tue Nov 21 02:09:59 2017 (r326044) @@ -35,5 +35,5 @@ extern int print_line_prefix(struct trussinfo *); extern void setup_and_wait(struct trussinfo *, char **); extern void start_tracing(struct trussinfo *, pid_t); extern void restore_proc(int); +extern void decode_siginfo(FILE *, siginfo_t *); extern void eventloop(struct trussinfo *); -extern const char *ioctlname(unsigned long val); Modified: stable/11/usr.bin/truss/setup.c ============================================================================== --- stable/11/usr.bin/truss/setup.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/setup.c Tue Nov 21 02:09:59 2017 (r326044) @@ -584,8 +584,62 @@ report_new_child(struct trussinfo *info) fprintf(info->outfile, "\n"); } +void +decode_siginfo(FILE *fp, siginfo_t *si) +{ + const char *str; + + fprintf(fp, " code="); + str = sysdecode_sigcode(si->si_signo, si->si_code); + if (str == NULL) + fprintf(fp, "%d", si->si_code); + else + fprintf(fp, "%s", str); + switch (si->si_code) { + case SI_NOINFO: + break; + case SI_QUEUE: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + /* FALLTHROUGH */ + case SI_USER: + case SI_LWP: + fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid, + (intmax_t)si->si_uid); + break; + case SI_TIMER: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + fprintf(fp, " timerid=%d", si->si_timerid); + fprintf(fp, " overrun=%d", si->si_overrun); + if (si->si_errno != 0) + fprintf(fp, " errno=%d", si->si_errno); + break; + case SI_ASYNCIO: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + break; + case SI_MESGQ: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + fprintf(fp, " mqd=%d", si->si_mqd); + break; + default: + switch (si->si_signo) { + case SIGILL: + case SIGFPE: + case SIGSEGV: + case SIGBUS: + fprintf(fp, " trapno=%d", si->si_trapno); + fprintf(fp, " addr=%p", si->si_addr); + break; + case SIGCHLD: + fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid, + (intmax_t)si->si_uid); + fprintf(fp, " status=%d", si->si_status); + break; + } + } +} + static void -report_signal(struct trussinfo *info, siginfo_t *si) +report_signal(struct trussinfo *info, siginfo_t *si, struct ptrace_lwpinfo *pl) { struct threadinfo *t; const char *signame; @@ -596,7 +650,11 @@ report_signal(struct trussinfo *info, siginfo_t *si) signame = sysdecode_signal(si->si_status); if (signame == NULL) signame = "?"; - fprintf(info->outfile, "SIGNAL %u (%s)\n", si->si_status, signame); + fprintf(info->outfile, "SIGNAL %u (%s)", si->si_status, signame); + if (pl->pl_event == PL_EVENT_SIGNAL && pl->pl_flags & PL_FLAG_SI) + decode_siginfo(info->outfile, &pl->pl_siginfo); + fprintf(info->outfile, "\n"); + } /* @@ -673,7 +731,7 @@ eventloop(struct trussinfo *info) pending_signal = 0; } else { if ((info->flags & NOSIGS) == 0) - report_signal(info, &si); + report_signal(info, &si, &pl); pending_signal = si.si_status; } ptrace(PT_SYSCALL, si.si_pid, (caddr_t)1, Modified: stable/11/usr.bin/truss/syscall.h ============================================================================== --- stable/11/usr.bin/truss/syscall.h Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/syscall.h Tue Nov 21 02:09:59 2017 (r326044) @@ -28,6 +28,7 @@ * Kevent -- a pointer to an array of struct kevents. Prints all elements. * Pathconf -- the 2nd argument of pathconf(). * Utrace -- utrace(2) buffer. + * CapRights -- a pointer to a cap_rights_t. Prints all set capabilities. * * In addition, the pointer types (String, Ptr) may have OUT masked in -- * this means that the data is set on *return* from the system call -- or @@ -41,13 +42,16 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open, - Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, - Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, + Fcntlflag, Rusage, RusageWho, BinString, Shutdown, Resource, Rlimit, + Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long, Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, - Sockoptname, Msgflags, + Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, + Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, + Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, + PSig, Siginfo, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/syscalls.c Tue Nov 21 02:09:59 2017 (r326044) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); * arguments. */ +#include #include #include #include @@ -47,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -76,6 +77,32 @@ __FBSDID("$FreeBSD$"); */ static struct syscall decoded_syscalls[] = { /* Native ABI */ + { .name = "__acl_aclcheck_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_aclcheck_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_aclcheck_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_delete_fd", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Acltype, 1 } } }, + { .name = "__acl_delete_file", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Acltype, 1 } } }, + { .name = "__acl_delete_link", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Acltype, 1 } } }, + { .name = "__acl_get_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_get_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_get_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_set_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_set_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_set_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__cap_rights_get", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Int, 1 }, { CapRights | OUT, 2 } } }, { .name = "__getcwd", .ret_type = 1, .nargs = 2, .args = { { Name | OUT, 0 }, { Int, 1 } } }, { .name = "_umtx_op", .ret_type = 1, .nargs = 5, @@ -96,6 +123,10 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } }, { .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights, 1 } } }, + { .name = "cap_getmode", .ret_type = 1, .nargs = 1, + .args = { { PUInt | OUT, 0 } } }, + { .name = "cap_rights_limit", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { CapRights, 1 } } }, { .name = "chdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "chflags", .ret_type = 1, .nargs = 2, @@ -118,6 +149,10 @@ static struct syscall decoded_syscalls[] = { { .name = "connectat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 }, { Int, 3 } } }, + { .name = "dup", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "dup2", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Int, 1 } } }, { .name = "eaccess", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Accessmode, 1 } } }, { .name = "execve", .ret_type = 1, .nargs = 3, @@ -125,6 +160,42 @@ static struct syscall decoded_syscalls[] = { { ExecEnv | IN, 2 } } }, { .name = "exit", .ret_type = 0, .nargs = 1, .args = { { Hex, 0 } } }, + { .name = "extattr_delete_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, + { .name = "extattr_delete_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, + { .name = "extattr_delete_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, + { .name = "extattr_get_fd", .ret_type = 1, .nargs = 5, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | OUT, 3 }, { Sizet, 4 } } }, + { .name = "extattr_get_file", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | OUT, 3 }, { Sizet, 4 } } }, + { .name = "extattr_get_link", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | OUT, 3 }, { Sizet, 4 } } }, + { .name = "extattr_list_fd", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, + { Sizet, 3 } } }, + { .name = "extattr_list_file", .ret_type = 1, .nargs = 4, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, + { Sizet, 3 } } }, + { .name = "extattr_list_link", .ret_type = 1, .nargs = 4, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, + { Sizet, 3 } } }, + { .name = "extattr_set_fd", .ret_type = 1, .nargs = 5, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | IN, 3 }, { Sizet, 4 } } }, + { .name = "extattr_set_file", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | IN, 3 }, { Sizet, 4 } } }, + { .name = "extattr_set_link", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | IN, 3 }, { Sizet, 4 } } }, + { .name = "extattrctl", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Hex, 1 }, { Name, 2 }, + { Extattrnamespace, 3 }, { Name, 4 } } }, { .name = "faccessat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 }, { Atflags, 3 } } }, @@ -158,6 +229,9 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Timeval2 | IN, 1 } } }, { .name = "futimesat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timeval2 | IN, 2 } } }, + { .name = "getdirentries", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, + { PQuadHex | OUT, 3 } } }, { .name = "getfsstat", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Long, 1 }, { Getfsstatmode, 2 } } }, { .name = "getitimer", .ret_type = 1, .nargs = 2, @@ -166,10 +240,12 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "getpgid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, + { .name = "getpriority", .ret_type = 1, .nargs = 2, + .args = { { Priowhich, 0 }, { Int, 1 } } }, { .name = "getrlimit", .ret_type = 1, .nargs = 2, .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } }, { .name = "getrusage", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { Rusage | OUT, 1 } } }, + .args = { { RusageWho, 0 }, { Rusage | OUT, 1 } } }, { .name = "getsid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "getsockname", .ret_type = 1, .nargs = 3, @@ -225,6 +301,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } }, { .name = "madvise", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Madvice, 2 } } }, + { .name = "minherit", .ret_type = 1, .nargs = 3, + .args = { { Ptr, 0 }, { Sizet, 1 }, { Minherit, 2 } } }, { .name = "mkdir", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "mkdirat", .ret_type = 1, .nargs = 3, @@ -237,19 +315,29 @@ static struct syscall decoded_syscalls[] = { .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } }, { .name = "mknodat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } }, + { .name = "mlock", .ret_type = 1, .nargs = 2, + .args = { { Ptr, 0 }, { Sizet, 1 } } }, + { .name = "mlockall", .ret_type = 1, .nargs = 1, + .args = { { Mlockall, 0 } } }, { .name = "mmap", .ret_type = 1, .nargs = 6, .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { QuadHex, 5 } } }, { .name = "modfind", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "mount", .ret_type = 1, .nargs = 4, - .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } }, + .args = { { Name, 0 }, { Name, 1 }, { Mountflags, 2 }, { Ptr, 3 } } }, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 } } }, + { .name = "msync", .ret_type = 1, .nargs = 3, + .args = { { Ptr, 0 }, { Sizet, 1 }, { Msync, 2 } } }, + { .name = "munlock", .ret_type = 1, .nargs = 2, + .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "munmap", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "nanosleep", .ret_type = 1, .nargs = 1, .args = { { Timespec, 0 } } }, + { .name = "nmount", .ret_type = 1, .nargs = 3, + .args = { { Ptr, 0 }, { UInt, 1 }, { Mountflags, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, { .name = "openat", .ret_type = 1, .nargs = 4, @@ -268,8 +356,18 @@ static struct syscall decoded_syscalls[] = { { Fadvice, 3 } } }, { .name = "posix_openpt", .ret_type = 1, .nargs = 1, .args = { { Open, 0 } } }, + { .name = "pread", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, + { QuadHex, 3 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Quad, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, + { .name = "ptrace", .ret_type = 1, .nargs = 4, + .args = { { Ptraceop, 0 }, { Int, 1 }, { Ptr, 2 }, { Int, 3 } } }, + { .name = "pwrite", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, + { QuadHex, 3 } } }, + { .name = "quotactl", .ret_type = 1, .nargs = 4, + .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 = "readlink", .ret_type = 1, .nargs = 3, @@ -277,6 +375,8 @@ static struct syscall decoded_syscalls[] = { { .name = "readlinkat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, { Sizet, 3 } } }, + { .name = "reboot", .ret_type = 1, .nargs = 1, + .args = { { Reboothowto, 0 } } }, { .name = "recvfrom", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | OUT, 4 }, @@ -291,6 +391,24 @@ static struct syscall decoded_syscalls[] = { .args = { { Rforkflags, 0 } } }, { .name = "rmdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, + { .name = "rtprio", .ret_type = 1, .nargs = 3, + .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, + { .name = "rtprio_thread", .ret_type = 1, .nargs = 3, + .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, + { .name = "sched_get_priority_max", .ret_type = 1, .nargs = 1, + .args = { { Schedpolicy, 0 } } }, + { .name = "sched_get_priority_min", .ret_type = 1, .nargs = 1, + .args = { { Schedpolicy, 0 } } }, + { .name = "sched_getparam", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Schedparam | OUT, 1 } } }, + { .name = "sched_getscheduler", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "sched_rr_get_interval", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, + { .name = "sched_setparam", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Schedparam, 1 } } }, + { .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 }, @@ -310,6 +428,8 @@ static struct syscall decoded_syscalls[] = { { Socklent | IN, 5 } } }, { .name = "setitimer", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } }, + { .name = "setpriority", .ret_type = 1, .nargs = 3, + .args = { { Priowhich, 0 }, { Int, 1 }, { Int, 2 } } }, { .name = "setrlimit", .ret_type = 1, .nargs = 2, .args = { { Resource, 0 }, { Rlimit | IN, 1 } } }, { .name = "setsockopt", .ret_type = 1, .nargs = 5, @@ -331,11 +451,12 @@ static struct syscall decoded_syscalls[] = { { .name = "sigsuspend", .ret_type = 1, .nargs = 1, .args = { { Sigset | IN, 0 } } }, { .name = "sigtimedwait", .ret_type = 1, .nargs = 3, - .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } }, + .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 }, + { Timespec | IN, 2 } } }, { .name = "sigwait", .ret_type = 1, .nargs = 2, - .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + .args = { { Sigset | IN, 0 }, { PSig | OUT, 1 } } }, { .name = "sigwaitinfo", .ret_type = 1, .nargs = 2, - .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 } } }, { .name = "socket", .ret_type = 1, .nargs = 3, .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } }, { .name = "stat", .ret_type = 1, .nargs = 2, @@ -352,6 +473,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Long, 0 }, { Signal, 1 } } }, { .name = "thr_self", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, + { .name = "thr_set_name", .ret_type = 1, .nargs = 2, + .args = { { Long, 0 }, { Name, 1 } } }, { .name = "truncate", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { QuadHex | IN, 1 } } }, #if 0 @@ -364,7 +487,7 @@ static struct syscall decoded_syscalls[] = { { .name = "unlinkat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } }, { .name = "unmount", .ret_type = 1, .nargs = 2, - .args = { { Name, 0 }, { Int, 1 } } }, + .args = { { Name, 0 }, { Mountflags, 1 } } }, { .name = "utimensat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timespec2 | IN, 2 }, { Atflags, 3 } } }, @@ -377,7 +500,8 @@ static struct syscall decoded_syscalls[] = { { Rusage | OUT, 3 } } }, { .name = "wait6", .ret_type = 1, .nargs = 6, .args = { { Idtype, 0 }, { Quad, 1 }, { ExitStatus | OUT, 2 }, - { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, + { Waitoptions, 3 }, { Rusage | OUT, 4 }, + { Siginfo | OUT, 5 } } }, { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, @@ -562,35 +686,6 @@ static struct xlat sigaction_flags[] = { X(SA_NODEFER) X(SA_NOCLDWAIT) X(SA_SIGINFO) XEND }; -static struct xlat pathconf_arg[] = { - X(_PC_LINK_MAX) X(_PC_MAX_CANON) X(_PC_MAX_INPUT) - X(_PC_NAME_MAX) X(_PC_PATH_MAX) X(_PC_PIPE_BUF) - X(_PC_CHOWN_RESTRICTED) X(_PC_NO_TRUNC) X(_PC_VDISABLE) - X(_PC_ASYNC_IO) X(_PC_PRIO_IO) X(_PC_SYNC_IO) - X(_PC_ALLOC_SIZE_MIN) X(_PC_FILESIZEBITS) - X(_PC_REC_INCR_XFER_SIZE) X(_PC_REC_MAX_XFER_SIZE) - X(_PC_REC_MIN_XFER_SIZE) X(_PC_REC_XFER_ALIGN) - X(_PC_SYMLINK_MAX) X(_PC_ACL_EXTENDED) X(_PC_ACL_PATH_MAX) - X(_PC_CAP_PRESENT) X(_PC_INF_PRESENT) X(_PC_MAC_PRESENT) - X(_PC_ACL_NFS4) X(_PC_MIN_HOLE_SIZE) XEND -}; - -static struct xlat at_flags[] = { - X(AT_EACCESS) X(AT_SYMLINK_NOFOLLOW) X(AT_SYMLINK_FOLLOW) - X(AT_REMOVEDIR) XEND -}; - -static struct xlat sysarch_ops[] = { -#if defined(__i386__) || defined(__amd64__) - X(I386_GET_LDT) X(I386_SET_LDT) X(I386_GET_IOPERM) X(I386_SET_IOPERM) - X(I386_VM86) X(I386_GET_FSBASE) X(I386_SET_FSBASE) X(I386_GET_GSBASE) - X(I386_SET_GSBASE) X(I386_GET_XFPUSTATE) X(AMD64_GET_FSBASE) - X(AMD64_SET_FSBASE) X(AMD64_GET_GSBASE) X(AMD64_SET_GSBASE) - X(AMD64_GET_XFPUSTATE) -#endif - XEND -}; - static struct xlat linux_socketcall_ops[] = { X(LINUX_SOCKET) X(LINUX_BIND) X(LINUX_CONNECT) X(LINUX_LISTEN) X(LINUX_ACCEPT) X(LINUX_GETSOCKNAME) X(LINUX_GETPEERNAME) @@ -1135,6 +1230,16 @@ print_arg(struct syscall_args *sc, unsigned long *args case UInt: fprintf(fp, "%u", (unsigned int)args[sc->offset]); break; + case PUInt: { + unsigned int val; + + if (get_struct(pid, (void *)args[sc->offset], &val, + sizeof(val)) == 0) + fprintf(fp, "{ %u }", val); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case LongHex: fprintf(fp, "0x%lx", args[sc->offset]); break; @@ -1287,6 +1392,16 @@ print_arg(struct syscall_args *sc, unsigned long *args break; } #endif + case PQuadHex: { + uint64_t val; + + if (get_struct(pid, (void *)args[sc->offset], &val, + sizeof(val)) == 0) + fprintf(fp, "{ 0x%jx }", (uintmax_t)val); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case Ptr: fprintf(fp, "0x%lx", args[sc->offset]); break; @@ -1529,8 +1644,11 @@ print_arg(struct syscall_args *sc, unsigned long *args case Resource: print_integer_arg(sysdecode_rlimit, fp, args[sc->offset]); break; + case RusageWho: + print_integer_arg(sysdecode_getrusage_who, fp, args[sc->offset]); + break; case Pathconf: - fputs(xlookup(pathconf_arg, args[sc->offset]), fp); + print_integer_arg(sysdecode_pathconf_name, fp, args[sc->offset]); break; case Rforkflags: print_mask_arg(sysdecode_rfork_flags, fp, args[sc->offset]); @@ -1779,13 +1897,14 @@ print_arg(struct syscall_args *sc, unsigned long *args print_integer_arg(sysdecode_atfd, fp, args[sc->offset]); break; case Atflags: - fputs(xlookup_bits(at_flags, args[sc->offset]), fp); + print_mask_arg(sysdecode_atflags, fp, args[sc->offset]); break; case Accessmode: print_mask_arg(sysdecode_access_mode, fp, args[sc->offset]); break; case Sysarch: - fputs(xlookup(sysarch_ops, args[sc->offset]), fp); + print_integer_arg(sysdecode_sysarch_number, fp, + args[sc->offset]); break; case PipeFds: /* @@ -1926,6 +2045,92 @@ print_arg(struct syscall_args *sc, unsigned long *args case Msgflags: print_mask_arg(sysdecode_msg_flags, fp, args[sc->offset]); break; + case CapRights: { + cap_rights_t rights; + + if (get_struct(pid, (void *)args[sc->offset], &rights, + sizeof(rights)) != -1) { + fputs("{ ", fp); + sysdecode_cap_rights(fp, &rights); + fputs(" }", fp); + } else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + case Acltype: + print_integer_arg(sysdecode_acltype, fp, args[sc->offset]); + break; + case Extattrnamespace: + print_integer_arg(sysdecode_extattrnamespace, fp, + args[sc->offset]); + break; + case Minherit: + print_integer_arg(sysdecode_minherit_inherit, fp, + args[sc->offset]); + break; + case Mlockall: + print_mask_arg(sysdecode_mlockall_flags, fp, args[sc->offset]); + break; + case Mountflags: + print_mask_arg(sysdecode_mount_flags, fp, args[sc->offset]); + break; + case Msync: + print_mask_arg(sysdecode_msync_flags, fp, args[sc->offset]); + break; + case Priowhich: + print_integer_arg(sysdecode_prio_which, fp, args[sc->offset]); + break; + case Ptraceop: + print_integer_arg(sysdecode_ptrace_request, fp, + args[sc->offset]); + break; + case Quotactlcmd: + if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) + fprintf(fp, "%#x", (int)args[sc->offset]); + break; + case Reboothowto: + print_mask_arg(sysdecode_reboot_howto, fp, args[sc->offset]); + break; + case Rtpriofunc: + print_integer_arg(sysdecode_rtprio_function, fp, + args[sc->offset]); + break; + case Schedpolicy: + print_integer_arg(sysdecode_scheduler_policy, fp, + args[sc->offset]); + break; + case Schedparam: { + struct sched_param sp; + + if (get_struct(pid, (void *)args[sc->offset], &sp, + sizeof(sp)) != -1) + fprintf(fp, "{ %d }", sp.sched_priority); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + case PSig: { + int sig; + + if (get_struct(pid, (void *)args[sc->offset], &sig, + sizeof(sig)) == 0) + fprintf(fp, "{ %s }", strsig2(sig)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Tue Nov 21 13:59:41 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD192DEFBC6; Tue, 21 Nov 2017 13:59:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99BF56FBF3; Tue, 21 Nov 2017 13:59:41 +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 vALDxeYe090881; Tue, 21 Nov 2017 13:59:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALDxeCw090880; Tue, 21 Nov 2017 13:59:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711211359.vALDxeCw090880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 Nov 2017 13: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: r326059 - stable/11/sys/dev/vnic X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/vnic X-SVN-Commit-Revision: 326059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:59:41 -0000 Author: emaste Date: Tue Nov 21 13:59:40 2017 New Revision: 326059 URL: https://svnweb.freebsd.org/changeset/base/326059 Log: MFC r325811: vnic: report that the driver supports multicast The driver is currently hardcoded to force promiscuous mode, so all of the MAC filtering code is presently unused and multicast should "just work." Report to the higher layers that multicast is supported. PR: 223573 Reported by: bz Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/vnic/nicvf_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vnic/nicvf_main.c ============================================================================== --- stable/11/sys/dev/vnic/nicvf_main.c Tue Nov 21 13:56:30 2017 (r326058) +++ stable/11/sys/dev/vnic/nicvf_main.c Tue Nov 21 13:59:40 2017 (r326059) @@ -350,7 +350,7 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setsoftc(ifp, nic); if_initname(ifp, device_get_name(nic->dev), device_get_unit(nic->dev)); - if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_settransmitfn(ifp, nicvf_if_transmit); if_setqflushfn(ifp, nicvf_if_qflush); From owner-svn-src-stable-11@freebsd.org Tue Nov 21 15:34:27 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C89DF19FA; Tue, 21 Nov 2017 15:34:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2C5472C18; Tue, 21 Nov 2017 15:34:26 +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 vALFYQ0L032840; Tue, 21 Nov 2017 15:34:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALFYQq8032839; Tue, 21 Nov 2017 15:34:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711211534.vALFYQq8032839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 Nov 2017 15:34: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: r326062 - stable/11/sys/dev/vnic X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/vnic X-SVN-Commit-Revision: 326062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 15:34:27 -0000 Author: emaste Date: Tue Nov 21 15:34:25 2017 New Revision: 326062 URL: https://svnweb.freebsd.org/changeset/base/326062 Log: MFC r325813 (bz): Unbreak IPv6. No longer return ENXIO when trying to send an IPv6 packet in nicvf_sq_add_hdr_subdesc(). Restructure the code so that the upper layer protocol parts are agnostic of the L3 protocol (and no longer specific to IPv4). With this basic IPv6 packets go through. We are still seeing weird behaviour which needs further diagnosis. PR: 223669 Modified: stable/11/sys/dev/vnic/nicvf_queues.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vnic/nicvf_queues.c ============================================================================== --- stable/11/sys/dev/vnic/nicvf_queues.c Tue Nov 21 15:03:38 2017 (r326061) +++ stable/11/sys/dev/vnic/nicvf_queues.c Tue Nov 21 15:34:25 2017 (r326062) @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -1752,7 +1754,7 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen struct tcphdr *th; #endif uint16_t etype; - int ehdrlen, iphlen, poff; + int ehdrlen, iphlen, poff, proto; nic = sq->nic; @@ -1776,13 +1778,21 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen etype = ntohs(eh->evl_encap_proto); } + poff = proto = -1; switch (etype) { #ifdef INET6 case ETHERTYPE_IPV6: - /* ARM64TODO: Add support for IPv6 */ - hdr->csum_l3 = 0; - sq->snd_buff[qentry].mbuf = NULL; - return (ENXIO); + if (mbuf->m_len < ehdrlen + sizeof(struct ip6_hdr)) { + mbuf = m_pullup(mbuf, ehdrlen +sizeof(struct ip6_hdr)); + sq->snd_buff[qentry].mbuf = NULL; + if (mbuf == NULL) + return (ENOBUFS); + } + poff = ip6_lasthdr(mbuf, ehdrlen, IPPROTO_IPV6, &proto); + if (poff < 0) + return (ENOBUFS); + poff += ehdrlen; + break; #endif #ifdef INET case ETHERTYPE_IP: @@ -1796,71 +1806,70 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qen ip = (struct ip *)(mbuf->m_data + ehdrlen); iphlen = ip->ip_hl << 2; poff = ehdrlen + iphlen; + proto = ip->ip_p; + break; +#endif + default: + hdr->csum_l3 = 0; + } - if (mbuf->m_pkthdr.csum_flags != 0) { - hdr->csum_l3 = 1; /* Enable IP csum calculation */ - switch (ip->ip_p) { - case IPPROTO_TCP: - if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0) - break; - - if (mbuf->m_len < (poff + sizeof(struct tcphdr))) { - mbuf = m_pullup(mbuf, poff + sizeof(struct tcphdr)); - sq->snd_buff[qentry].mbuf = mbuf; - if (mbuf == NULL) - return (ENOBUFS); - } - hdr->csum_l4 = SEND_L4_CSUM_TCP; +#if defined(INET6) || defined(INET) + if (poff > 0 && mbuf->m_pkthdr.csum_flags != 0) { + hdr->csum_l3 = 1; /* Enable IP csum calculation */ + switch (proto) { + case IPPROTO_TCP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0) break; - case IPPROTO_UDP: - if ((mbuf->m_pkthdr.csum_flags & CSUM_UDP) == 0) - break; - if (mbuf->m_len < (poff + sizeof(struct udphdr))) { - mbuf = m_pullup(mbuf, poff + sizeof(struct udphdr)); - sq->snd_buff[qentry].mbuf = mbuf; - if (mbuf == NULL) - return (ENOBUFS); - } - hdr->csum_l4 = SEND_L4_CSUM_UDP; + if (mbuf->m_len < (poff + sizeof(struct tcphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct tcphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_TCP; + break; + case IPPROTO_UDP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_UDP) == 0) break; - case IPPROTO_SCTP: - if ((mbuf->m_pkthdr.csum_flags & CSUM_SCTP) == 0) - break; - if (mbuf->m_len < (poff + sizeof(struct sctphdr))) { - mbuf = m_pullup(mbuf, poff + sizeof(struct sctphdr)); - sq->snd_buff[qentry].mbuf = mbuf; - if (mbuf == NULL) - return (ENOBUFS); - } - hdr->csum_l4 = SEND_L4_CSUM_SCTP; + if (mbuf->m_len < (poff + sizeof(struct udphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct udphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); + } + hdr->csum_l4 = SEND_L4_CSUM_UDP; + break; + case IPPROTO_SCTP: + if ((mbuf->m_pkthdr.csum_flags & CSUM_SCTP) == 0) break; - default: - break; + + if (mbuf->m_len < (poff + sizeof(struct sctphdr))) { + mbuf = m_pullup(mbuf, poff + sizeof(struct sctphdr)); + sq->snd_buff[qentry].mbuf = mbuf; + if (mbuf == NULL) + return (ENOBUFS); } - hdr->l3_offset = ehdrlen; - hdr->l4_offset = ehdrlen + iphlen; + hdr->csum_l4 = SEND_L4_CSUM_SCTP; + break; + default: + break; } + hdr->l3_offset = ehdrlen; + hdr->l4_offset = poff; + } - if ((mbuf->m_pkthdr.tso_segsz != 0) && nic->hw_tso) { - /* - * Extract ip again as m_data could have been modified. - */ - ip = (struct ip *)(mbuf->m_data + ehdrlen); - th = (struct tcphdr *)((caddr_t)ip + iphlen); + if ((mbuf->m_pkthdr.tso_segsz != 0) && nic->hw_tso) { + th = (struct tcphdr *)((caddr_t)(mbuf->m_data + poff)); - hdr->tso = 1; - hdr->tso_start = ehdrlen + iphlen + (th->th_off * 4); - hdr->tso_max_paysize = mbuf->m_pkthdr.tso_segsz; - hdr->inner_l3_offset = ehdrlen - 2; - nic->drv_stats.tx_tso++; - } - break; -#endif - default: - hdr->csum_l3 = 0; + hdr->tso = 1; + hdr->tso_start = poff + (th->th_off * 4); + hdr->tso_max_paysize = mbuf->m_pkthdr.tso_segsz; + hdr->inner_l3_offset = ehdrlen - 2; + nic->drv_stats.tx_tso++; } +#endif return (0); } From owner-svn-src-stable-11@freebsd.org Wed Nov 22 06:33:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD46DE250B; Wed, 22 Nov 2017 06:33:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0BE36F223; Wed, 22 Nov 2017 06:33:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAM6XpAY020231; Wed, 22 Nov 2017 06:33:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM6XpsQ020228; Wed, 22 Nov 2017 06:33:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711220633.vAM6XpsQ020228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 22 Nov 2017 06:33: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: r326087 - in stable/11: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 326087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 06:33:53 -0000 Author: delphij Date: Wed Nov 22 06:33:51 2017 New Revision: 326087 URL: https://svnweb.freebsd.org/changeset/base/326087 Log: MFC r325532: Update arcmsr(4) to 1.40.00.01: - Fix clear doorbell queue buffer for ADAPTER_TYPE_B - Fix release memory resource when detach device - Add support for ARC-1216, 1226 SAS 12Gb controllers - Declare some functions as static - Change checking dword read/write for IOP rqbuffer. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/11/share/man/man4/arcmsr.4 stable/11/sys/dev/arcmsr/arcmsr.c stable/11/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/arcmsr.4 ============================================================================== --- stable/11/share/man/man4/arcmsr.4 Wed Nov 22 05:49:21 2017 (r326086) +++ stable/11/share/man/man4/arcmsr.4 Wed Nov 22 06:33:51 2017 (r326087) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2017 +.Dd November 8, 2017 .Dt ARCMSR 4 .Os .Sh NAME @@ -104,6 +104,8 @@ ARC-1213 .It ARC-1214 .It +ARC-1216 +.It ARC-1220 .It ARC-1222 @@ -111,6 +113,8 @@ ARC-1222 ARC-1223 .It ARC-1224 +.It +ARC-1226 .It ARC-1230 .It Modified: stable/11/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/11/sys/dev/arcmsr/arcmsr.c Wed Nov 22 05:49:21 2017 (r326086) +++ stable/11/sys/dev/arcmsr/arcmsr.c Wed Nov 22 06:33:51 2017 (r326087) @@ -78,6 +78,7 @@ ** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 +** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ****************************************************************************************** */ @@ -149,7 +150,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.00 2017-07-11" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.01 2017-10-30" #include /* ************************************************************************** @@ -187,7 +188,7 @@ static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); -void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); +static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); #endif @@ -910,6 +911,10 @@ static void arcmsr_drain_donequeue(struct AdapterContr /* check if command done with no error*/ switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: + case ACB_ADAPTER_TYPE_B: + srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ + break; case ACB_ADAPTER_TYPE_C: case ACB_ADAPTER_TYPE_D: srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ @@ -917,8 +922,6 @@ static void arcmsr_drain_donequeue(struct AdapterContr case ACB_ADAPTER_TYPE_E: srb = acb->psrb_pool[flag_srb]; break; - case ACB_ADAPTER_TYPE_A: - case ACB_ADAPTER_TYPE_B: default: srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ break; @@ -1585,8 +1588,7 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct u_int8_t *iop_data; u_int32_t iop_len; - if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || - (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { + if(acb->adapter_type >= ACB_ADAPTER_TYPE_B) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1681,8 +1683,7 @@ static void arcmsr_Write_data_2iop_wqbuffer(struct Ada u_int8_t *iop_data; int32_t allxfer_len=0; - if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || - (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { + if(acb->adapter_type >= ACB_ADAPTER_TYPE_B) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -2495,7 +2496,7 @@ static void arcmsr_iop_parking(struct AdapterControlBl ** ************************************************************************ */ -u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_cmd, caddr_t arg) +static u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_cmd, caddr_t arg) { struct CMD_MESSAGE_FIELD *pcmdmessagefld; u_int32_t retvalue = EINVAL; @@ -2683,7 +2684,7 @@ static void arcmsr_free_srb(struct CommandControlBlock ************************************************************************** ************************************************************************** */ -struct CommandControlBlock *arcmsr_get_freesrb(struct AdapterControlBlock *acb) +static struct CommandControlBlock *arcmsr_get_freesrb(struct AdapterControlBlock *acb) { struct CommandControlBlock *srb = NULL; u_int32_t workingsrb_startindex, workingsrb_doneindex; @@ -4115,12 +4116,11 @@ static void arcmsr_clear_doorbell_queue_buffer( struct outbound_doorbell = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_doorbell); CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_doorbell, outbound_doorbell); /*clear doorbell interrupt */ CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_doorbell, ARCMSR_INBOUND_DRIVER_DATA_READ_OK); - } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt and message state*/ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN);/*clear interrupt and message state*/ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); /* let IOP know data has been read */ } @@ -4139,7 +4139,6 @@ static void arcmsr_clear_doorbell_queue_buffer( struct outbound_doorbell = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell); CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, outbound_doorbell); /*clear doorbell interrupt */ CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); - } break; case ACB_ADAPTER_TYPE_E: { @@ -4353,7 +4352,8 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg srb_phyaddr = srb_phyaddr + SRB_SIZE; srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp + SRB_SIZE); } - acb->pCompletionQ = (pCompletion_Q)srb_tmp; + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + acb->pCompletionQ = (pCompletion_Q)srb_tmp; acb->vir2phy_offset = (unsigned long)srb_tmp - (unsigned long)srb_phyaddr; } /* @@ -4414,7 +4414,9 @@ static u_int32_t arcmsr_initialize(device_t dev) case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: { acb->adapter_type = ACB_ADAPTER_TYPE_C; - if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) + if ((acb->sub_device_id == ARECA_SUB_DEV_ID_1883) || + (acb->sub_device_id == ARECA_SUB_DEV_ID_1216) || + (acb->sub_device_id == ARECA_SUB_DEV_ID_1226)) acb->adapter_bus_speed = ACB_BUS_SPEED_12G; else acb->adapter_bus_speed = ACB_BUS_SPEED_6G; @@ -4598,7 +4600,7 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); acb->pmu = (struct MessageUnit_UNION *)mem_base0; - acb->rid = 0; + acb->rid[0] = rid0; } break; case ACB_ADAPTER_TYPE_B: { @@ -4606,19 +4608,8 @@ static u_int32_t arcmsr_initialize(device_t dev) struct CommandControlBlock *freesrb; u_int32_t rid[]={ PCIR_BAR(0), PCIR_BAR(2) }; vm_offset_t mem_base[]={0,0}; - u_long size; - if (vendor_dev_id == PCIDevVenIDARC1203) - size = sizeof(struct HBB_DOORBELL_1203); - else - size = sizeof(struct HBB_DOORBELL); for(i=0; i < 2; i++) { - if(i == 0) { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } else { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], RF_ACTIVE); if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource %d failure!\n", device_get_unit(dev), i); @@ -4654,7 +4645,8 @@ static u_int32_t arcmsr_initialize(device_t dev) phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL, iop2drv_doorbell); phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL, iop2drv_doorbell_mask); } - acb->rid = 0; + acb->rid[0] = rid[0]; + acb->rid[1] = rid[1]; } break; case ACB_ADAPTER_TYPE_C: { @@ -4681,7 +4673,7 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); acb->pmu = (struct MessageUnit_UNION *)mem_base0; - acb->rid = 1; + acb->rid[0] = rid0; } break; case ACB_ADAPTER_TYPE_D: { @@ -4711,14 +4703,14 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->pmu = (struct MessageUnit_UNION *)((unsigned long)acb->uncacheptr+ARCMSR_SRBS_POOL_SIZE); phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; phbdmu->phbdmu = (struct HBD_MessageUnit *)mem_base0; - acb->rid = 0; + acb->rid[0] = rid0; } break; case ACB_ADAPTER_TYPE_E: { u_int32_t rid0 = PCIR_BAR(1); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, sizeof(struct HBE_MessageUnit), RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4741,7 +4733,7 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->doneq_index = 0; acb->in_doorbell = 0; acb->out_doorbell = 0; - acb->rid = 1; + acb->rid[0] = rid0; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear interrupt*/ CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, ARCMSR_HBEMU_DOORBELL_SYNC); /* synchronize doorbell to 0 */ } @@ -4773,7 +4765,7 @@ static int arcmsr_setup_msix(struct AdapterControlBloc int i; for (i = 0; i < acb->msix_vectors; i++) { - acb->irq_id[i] = acb->rid + i; + acb->irq_id[i] = 1 + i; acb->irqres[i] = bus_alloc_resource_any(acb->pci_dev, SYS_RES_IRQ, &acb->irq_id[i], RF_ACTIVE); if (acb->irqres[i] == NULL) { @@ -4825,7 +4817,7 @@ static int arcmsr_attach(device_t dev) if (arcmsr_setup_msix(acb) == TRUE) goto irqx; } - acb->irq_id[0] = acb->rid; + acb->irq_id[0] = 0; irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &acb->irq_id[0], RF_SHAREABLE | RF_ACTIVE); if(irqres == NULL || #if __FreeBSD_version >= 700025 @@ -4957,7 +4949,9 @@ static int arcmsr_probe(device_t dev) case PCIDevVenIDARC1882: case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: - if (sub_device_id == ARECA_SUB_DEV_ID_1883) + if ((sub_device_id == ARECA_SUB_DEV_ID_1883) || + (sub_device_id == ARECA_SUB_DEV_ID_1216) || + (sub_device_id == ARECA_SUB_DEV_ID_1226)) type = "SAS 12G"; else type = "SAS 6G"; @@ -5027,7 +5021,7 @@ static int arcmsr_shutdown(device_t dev) ************************************************************************ ************************************************************************ */ -void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb) +static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb) { int i; @@ -5066,7 +5060,7 @@ static int arcmsr_detach(device_t dev) arcmsr_shutdown(dev); arcmsr_free_resource(acb); for(i=0; (acb->sys_res_arcmsr[i]!=NULL) && (i<2); i++) { - bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(i), acb->sys_res_arcmsr[i]); + bus_release_resource(dev, SYS_RES_MEMORY, acb->rid[i], acb->sys_res_arcmsr[i]); } ARCMSR_LOCK_ACQUIRE(&acb->isr_lock); xpt_async(AC_LOST_DEVICE, acb->ppath, NULL); @@ -5089,4 +5083,3 @@ static void arcmsr_dump_data(struct AdapterControlBloc printf("Queued Command Count =0x%x\n",acb->srboutstandingcount); } #endif - Modified: stable/11/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/11/sys/dev/arcmsr/arcmsr.h Wed Nov 22 05:49:21 2017 (r326086) +++ stable/11/sys/dev/arcmsr/arcmsr.h Wed Nov 22 06:33:51 2017 (r326087) @@ -125,8 +125,10 @@ #define ARECA_SUB_DEV_ID_1884 0x1884 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1216 0x1216 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1226 0x1226 /* Subsystem Device ID */ #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ @@ -1326,7 +1328,7 @@ struct AdapterControlBlock { u_int32_t completionQ_entry; pCompletion_Q pCompletionQ; int msix_vectors; - int rid; + int rid[2]; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-stable-11@freebsd.org Wed Nov 22 14:06:41 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C26D0DEC6AA; Wed, 22 Nov 2017 14:06:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 867217B7D4; Wed, 22 Nov 2017 14:06:41 +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 vAME6eiV007590; Wed, 22 Nov 2017 14:06:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAME6ebQ007586; Wed, 22 Nov 2017 14:06:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711221406.vAME6ebQ007586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Nov 2017 14: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: r326091 - in stable/11: share/man/man4 sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/cam/ctl X-SVN-Commit-Revision: 326091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 14:06:41 -0000 Author: manu Date: Wed Nov 22 14:06:40 2017 New Revision: 326091 URL: https://svnweb.freebsd.org/changeset/base/326091 Log: MFC r325517, r325554 r325517: ctl: Make max_luns and max_ports tunable variables instead of hardcoded defines. Reviewed by: trasz (earlier version), bapt (earlier version), bcr (manpages) Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D12836 r325554: ctl(4): Insert a new line after a sentence-ending full stop. Reported by: bjk Sponsored by: Gandi.net X-MFC-With: r325517 Modified: stable/11/share/man/man4/ctl.4 stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_ioctl.h stable/11/sys/cam/ctl/ctl_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ctl.4 ============================================================================== --- stable/11/share/man/man4/ctl.4 Wed Nov 22 10:04:09 2017 (r326090) +++ stable/11/share/man/man4/ctl.4 Wed Nov 22 14:06:40 2017 (r326091) @@ -191,6 +191,17 @@ If there is no primary node (both nodes are secondary, no connection to primary one), secondary node(s) report Transitioning state. State with two primary nodes is illegal (split brain condition). .El +.Sh TUNABLE VARIABLES +The following variables are available as +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va kern.cam.ctl.max_luns +Specifies the maximum number of LUNs we support, must be a power of 2. +The default value is 1024. +.It Va kern.cam.ctl.max_ports +Specifies the maximum number of ports we support, must be a power of 2. +The default value is 256. .Sh SEE ALSO .Xr cfiscsi 4 , .Xr cfumass 4 , Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Wed Nov 22 10:04:09 2017 (r326090) +++ stable/11/sys/cam/ctl/ctl.c Wed Nov 22 14:06:40 2017 (r326091) @@ -415,6 +415,29 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, time_io_secs, CTLF #endif /* + * Maximum number of LUNs we support. MUST be a power of 2. + */ +#define CTL_DEFAULT_MAX_LUNS 1024 +static int ctl_max_luns = CTL_DEFAULT_MAX_LUNS; +TUNABLE_INT("kern.cam.ctl.max_luns", &ctl_max_luns); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, max_luns, CTLFLAG_RDTUN, + &ctl_max_luns, CTL_DEFAULT_MAX_LUNS, "Maximum number of LUNs"); + +/* + * Maximum number of ports registered at one time. + */ +#define CTL_DEFAULT_MAX_PORTS 256 +static int ctl_max_ports = CTL_DEFAULT_MAX_PORTS; +TUNABLE_INT("kern.cam.ctl.max_ports", &ctl_max_ports); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, max_ports, CTLFLAG_RDTUN, + &ctl_max_ports, CTL_DEFAULT_MAX_LUNS, "Maximum number of ports"); + +/* + * Maximum number of initiators we support. + */ +#define CTL_MAX_INITIATORS (CTL_MAX_INIT_PER_PORT * ctl_max_ports) + +/* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), * Extended INQUIRY Data (0x86), Mode Page Policy (0x87), * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0), @@ -1005,8 +1028,8 @@ ctl_isc_ha_link_up(struct ctl_softc *softc) msg.login.version = CTL_HA_VERSION; msg.login.ha_mode = softc->ha_mode; msg.login.ha_id = softc->ha_id; - msg.login.max_luns = CTL_MAX_LUNS; - msg.login.max_ports = CTL_MAX_PORTS; + msg.login.max_luns = ctl_max_luns; + msg.login.max_ports = ctl_max_ports; msg.login.max_init_per_port = CTL_MAX_INIT_PER_PORT; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg.login, sizeof(msg.login), M_WAITOK); @@ -1069,7 +1092,7 @@ ctl_isc_ua(struct ctl_softc *softc, union ctl_ha_msg * uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_mapped_lun >= CTL_MAX_LUNS || + if (msg->hdr.nexus.targ_mapped_lun >= ctl_max_luns || (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1103,7 +1126,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc, union ctl_ha targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1325,8 +1348,8 @@ ctl_isc_login(struct ctl_softc *softc, union ctl_ha_ms ctl_ha_msg_abort(CTL_HA_CHAN_CTL); return; } - if (msg->login.max_luns != CTL_MAX_LUNS || - msg->login.max_ports != CTL_MAX_PORTS || + if (msg->login.max_luns != ctl_max_luns || + msg->login.max_ports != ctl_max_ports || msg->login.max_init_per_port != CTL_MAX_INIT_PER_PORT) { printf("CTL HA peers have different limits\n"); ctl_ha_msg_abort(CTL_HA_CHAN_CTL); @@ -1343,7 +1366,7 @@ ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_h targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1873,6 +1896,26 @@ ctl_init(void) OID_AUTO, "ha_mode", CTLFLAG_RDTUN, (int *)&softc->ha_mode, 0, "HA mode (0 - act/stby, 1 - serialize only, 2 - xfer)"); + if (ctl_max_luns <= 0 || powerof2(ctl_max_luns) == 0) { + printf("Bad value %d for kern.cam.ctl.max_luns, must be a power of two, using %d\n", + ctl_max_luns, CTL_DEFAULT_MAX_LUNS); + ctl_max_luns = CTL_DEFAULT_MAX_LUNS; + } + softc->ctl_luns = malloc(sizeof(struct ctl_lun *) * ctl_max_luns, + M_DEVBUF, M_WAITOK | M_ZERO); + softc->ctl_lun_mask = malloc(sizeof(uint32_t) * + ((ctl_max_luns + 31) / 32), M_DEVBUF, M_WAITOK | M_ZERO); + if (ctl_max_ports <= 0 || powerof2(ctl_max_ports) == 0) { + printf("Bad value %d for kern.cam.ctl.max_ports, must be a power of two, using %d\n", + ctl_max_ports, CTL_DEFAULT_MAX_PORTS); + ctl_max_ports = CTL_DEFAULT_MAX_PORTS; + } + softc->ctl_port_mask = malloc(sizeof(uint32_t) * + ((ctl_max_ports + 31) / 32), M_DEVBUF, M_WAITOK | M_ZERO); + softc->ctl_ports = malloc(sizeof(struct ctl_port *) * ctl_max_ports, + M_DEVBUF, M_WAITOK | M_ZERO); + + /* * In Copan's HA scheme, the "master" and "slave" roles are * figured out through the slot the controller is in. Although it @@ -1884,10 +1927,10 @@ ctl_init(void) if (softc->ha_id == 0 || softc->ha_id > NUM_HA_SHELVES) { softc->flags |= CTL_FLAG_ACTIVE_SHELF; softc->is_single = 1; - softc->port_cnt = CTL_MAX_PORTS; + softc->port_cnt = ctl_max_ports; softc->port_min = 0; } else { - softc->port_cnt = CTL_MAX_PORTS / NUM_HA_SHELVES; + softc->port_cnt = ctl_max_ports / NUM_HA_SHELVES; softc->port_min = (softc->ha_id - 1) * softc->port_cnt; } softc->port_max = softc->port_min + softc->port_cnt; @@ -1988,6 +2031,11 @@ ctl_shutdown(void) uma_zdestroy(softc->io_zone); mtx_destroy(&softc->ctl_lock); + free(softc->ctl_luns, M_DEVBUF); + free(softc->ctl_lun_mask, M_DEVBUF); + free(softc->ctl_port_mask, M_DEVBUF); + free(softc->ctl_ports, M_DEVBUF); + sysctl_ctx_free(&softc->sysctl_ctx); free(softc, M_DEVBUF); @@ -2249,7 +2297,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) /* Make sure that we know about this LUN. */ mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); @@ -2717,7 +2765,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, mtx_lock(&softc->ctl_lock); if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && - (ooa_hdr->lun_num >= CTL_MAX_LUNS || + (ooa_hdr->lun_num >= ctl_max_luns || softc->ctl_luns[ooa_hdr->lun_num] == NULL)) { mtx_unlock(&softc->ctl_lock); free(entries, M_CTL); @@ -2770,7 +2818,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, #ifdef CTL_IO_DELAY mtx_lock(&softc->ctl_lock); - if (delay_info->lun_id >= CTL_MAX_LUNS || + if (delay_info->lun_id >= ctl_max_luns || (lun = softc->ctl_luns[delay_info->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; @@ -2849,7 +2897,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); - if (err_desc->lun_id >= CTL_MAX_LUNS || + if (err_desc->lun_id >= ctl_max_luns || (lun = softc->ctl_luns[err_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); free(new_err_desc, M_CTL); @@ -2893,7 +2941,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, delete_done = 0; mtx_lock(&softc->ctl_lock); - if (delete_desc->lun_id >= CTL_MAX_LUNS || + if (delete_desc->lun_id >= ctl_max_luns || (lun = softc->ctl_luns[delete_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); printf("%s: CTL_ERROR_INJECT_DELETE: invalid LUN %ju\n", @@ -2936,7 +2984,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, continue; } - for (j = 0; j < CTL_MAX_PORTS; j++) { + for (j = 0; j < ctl_max_ports; j++) { if (lun->pr_keys[j] == NULL) continue; for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ @@ -3411,7 +3459,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, if (lm->plun != UINT32_MAX) { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_unset(port, lm->plun); - else if (lm->lun < CTL_MAX_LUNS && + else if (lm->lun < ctl_max_luns && softc->ctl_luns[lm->lun] != NULL) retval = ctl_lun_map_set(port, lm->plun, lm->lun); else @@ -4519,6 +4567,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ if (lun_malloced) lun->flags = CTL_LUN_MALLOCED; + lun->pending_sense = malloc(sizeof(struct scsi_sense_data *) * + ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); + lun->pending_ua = malloc(sizeof(ctl_ua_type *) * ctl_max_ports, + M_DEVBUF, M_WAITOK | M_ZERO); + lun->pr_keys = malloc(sizeof(uint64_t *) * ctl_max_ports, + M_DEVBUF, M_WAITOK | M_ZERO); + /* Generate LUN ID. */ devidlen = max(CTL_DEVID_MIN_LEN, strnlen(be_lun->device_id, CTL_DEVID_LEN)); @@ -4605,13 +4660,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ * if it is available. Otherwise, allocate the first available LUN. */ if (be_lun->flags & CTL_LUN_FLAG_ID_REQ) { - if ((be_lun->req_lun_id > (CTL_MAX_LUNS - 1)) + if ((be_lun->req_lun_id > (ctl_max_luns - 1)) || (ctl_is_set(ctl_softc->ctl_lun_mask, be_lun->req_lun_id))) { mtx_unlock(&ctl_softc->ctl_lock); - if (be_lun->req_lun_id > (CTL_MAX_LUNS - 1)) { + if (be_lun->req_lun_id > (ctl_max_luns - 1)) { printf("ctl: requested LUN ID %d is higher " - "than CTL_MAX_LUNS - 1 (%d)\n", - be_lun->req_lun_id, CTL_MAX_LUNS - 1); + "than ctl_max_luns - 1 (%d)\n", + be_lun->req_lun_id, ctl_max_luns - 1); } else { /* * XXX KDM return an error, or just assign @@ -4630,7 +4685,7 @@ fail: } lun_number = be_lun->req_lun_id; } else { - lun_number = ctl_ffz(ctl_softc->ctl_lun_mask, 0, CTL_MAX_LUNS); + lun_number = ctl_ffz(ctl_softc->ctl_lun_mask, 0, ctl_max_luns); if (lun_number == -1) { mtx_unlock(&ctl_softc->ctl_lock); printf("ctl: can't allocate LUN, out of LUNs\n"); @@ -4697,7 +4752,9 @@ fail: lun->legacy_stats.blocksize = be_lun->blocksize; if (be_lun->blocksize == 0) lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - for (len = 0; len < CTL_MAX_PORTS; len++) + lun->legacy_stats.ports = malloc(sizeof(struct ctl_lun_io_port_stats) * + ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); + for (len = 0; len < ctl_max_ports; len++) lun->legacy_stats.ports[len].targ_port = len; #endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; @@ -4760,10 +4817,12 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); - for (i = 0; i < CTL_MAX_PORTS; i++) + for (i = 0; i < ctl_max_ports; i++) free(lun->pending_ua[i], M_CTL); - for (i = 0; i < CTL_MAX_PORTS; i++) + free(lun->pending_ua, M_DEVBUF); + for (i = 0; i < ctl_max_ports; i++) free(lun->pr_keys[i], M_CTL); + free(lun->pr_keys, M_DEVBUF); free(lun->write_buffer, M_CTL); free(lun->prevent, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) @@ -8483,7 +8542,7 @@ ctl_hndl_per_res_out_on_other_sc(union ctl_io *io) targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -9010,7 +9069,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_report_luns\n")); num_luns = 0; - num_port_luns = port->lun_map ? port->lun_map_size : CTL_MAX_LUNS; + num_port_luns = port->lun_map ? port->lun_map_size : ctl_max_luns; mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0; targ_lun_id < num_port_luns; targ_lun_id++) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) @@ -11200,7 +11259,7 @@ ctl_failover_lun(union ctl_io *rio) /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); - if (targ_lun > CTL_MAX_LUNS || + if (targ_lun > ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -11282,7 +11341,7 @@ ctl_scsiio_precheck(struct ctl_softc *softc, struct ct lun = NULL; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - if (targ_lun < CTL_MAX_LUNS) + if (targ_lun < ctl_max_luns) lun = softc->ctl_luns[targ_lun]; if (lun) { /* @@ -11672,7 +11731,7 @@ ctl_do_lun_reset(struct ctl_lun *lun, uint32_t initidx xio->io_hdr.flags |= CTL_FLAG_ABORT | CTL_FLAG_ABORT_STATUS; } /* Clear CA. */ - for (i = 0; i < CTL_MAX_PORTS; i++) { + for (i = 0; i < ctl_max_ports; i++) { free(lun->pending_sense[i], M_CTL); lun->pending_sense[i] = NULL; } @@ -11705,7 +11764,7 @@ ctl_lun_reset(union ctl_io *io) targ_lun = io->io_hdr.nexus.targ_mapped_lun; initidx = ctl_get_initindex(&io->io_hdr.nexus); mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -11784,7 +11843,7 @@ ctl_abort_task_set(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -11886,7 +11945,7 @@ ctl_abort_task(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12010,7 +12069,7 @@ ctl_query_task(union ctl_io *io, int task_set) targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12049,7 +12108,7 @@ ctl_query_async_event(union ctl_io *io) targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12141,7 +12200,7 @@ ctl_handle_isc(union ctl_io *io) break; case CTL_MSG_R2R: /* Only used in SER_ONLY mode. */ entry = ctl_get_cmd_entry(&io->scsiio, NULL); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { ctl_done(io); break; @@ -12161,7 +12220,7 @@ ctl_handle_isc(union ctl_io *io) ctl_done(io); break; } - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { ctl_free_io(io); break; @@ -13130,7 +13189,7 @@ ctl_queue_sense(union ctl_io *io) * If we don't have a LUN for this, just toss the sense information. */ mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); goto bailout; Modified: stable/11/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_ioctl.h Wed Nov 22 10:04:09 2017 (r326090) +++ stable/11/sys/cam/ctl/ctl_ioctl.h Wed Nov 22 14:06:40 2017 (r326091) @@ -59,25 +59,10 @@ #define CTL_MAX_TARGID 15 /* - * Maximum number of LUNs we support at the moment. MUST be a power of 2. - */ -#define CTL_MAX_LUNS 1024 - -/* * Maximum number of initiators per port. */ #define CTL_MAX_INIT_PER_PORT 2048 -/* - * Maximum number of ports registered at one time. - */ -#define CTL_MAX_PORTS 256 - -/* - * Maximum number of initiators we support. - */ -#define CTL_MAX_INITIATORS (CTL_MAX_INIT_PER_PORT * CTL_MAX_PORTS) - /* Hopefully this won't conflict with new misc devices that pop up */ #define CTL_MINOR 225 @@ -150,7 +135,7 @@ struct ctl_lun_io_stats { uint64_t lun_number; uint32_t blocksize; ctl_lun_stats_flags flags; - struct ctl_lun_io_port_stats ports[CTL_MAX_PORTS]; + struct ctl_lun_io_port_stats *ports; }; struct ctl_stats { Modified: stable/11/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_private.h Wed Nov 22 10:04:09 2017 (r326090) +++ stable/11/sys/cam/ctl/ctl_private.h Wed Nov 22 14:06:40 2017 (r326091) @@ -390,8 +390,8 @@ struct ctl_lun { TAILQ_HEAD(ctl_ooaq, ctl_io_hdr) ooa_queue; TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue; STAILQ_ENTRY(ctl_lun) links; - struct scsi_sense_data *pending_sense[CTL_MAX_PORTS]; - ctl_ua_type *pending_ua[CTL_MAX_PORTS]; + struct scsi_sense_data **pending_sense; + ctl_ua_type **pending_ua; uint8_t ua_tpt_info[8]; time_t lasttpt; uint8_t ie_asc; /* Informational exceptions */ @@ -407,7 +407,7 @@ struct ctl_lun { struct ctl_io_stats stats; uint32_t res_idx; uint32_t pr_generation; - uint64_t *pr_keys[CTL_MAX_PORTS]; + uint64_t **pr_keys; int pr_key_count; uint32_t pr_res_idx; uint8_t pr_res_type; @@ -436,44 +436,44 @@ struct ctl_thread { struct tpc_token; struct ctl_softc { - struct mtx ctl_lock; - struct cdev *dev; - int num_luns; - ctl_gen_flags flags; - ctl_ha_mode ha_mode; - int ha_id; - int is_single; - ctl_ha_link_state ha_link; - int port_min; - int port_max; - int port_cnt; - int init_min; - int init_max; - struct sysctl_ctx_list sysctl_ctx; - struct sysctl_oid *sysctl_tree; - void *othersc_pool; - struct proc *ctl_proc; - uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32]; - struct ctl_lun *ctl_luns[CTL_MAX_LUNS]; - uint32_t ctl_port_mask[(CTL_MAX_PORTS + 31) / 32]; - STAILQ_HEAD(, ctl_lun) lun_list; - STAILQ_HEAD(, ctl_be_lun) pending_lun_queue; - uint32_t num_frontends; - STAILQ_HEAD(, ctl_frontend) fe_list; - uint32_t num_ports; - STAILQ_HEAD(, ctl_port) port_list; - struct ctl_port *ctl_ports[CTL_MAX_PORTS]; - uint32_t num_backends; - STAILQ_HEAD(, ctl_backend_driver) be_list; - struct uma_zone *io_zone; - uint32_t cur_pool_id; - int shutdown; - struct ctl_thread threads[CTL_MAX_THREADS]; - struct thread *lun_thread; - struct thread *thresh_thread; - TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens; - struct callout tpc_timeout; - struct mtx tpc_lock; + struct mtx ctl_lock; + struct cdev *dev; + int num_luns; + ctl_gen_flags flags; + ctl_ha_mode ha_mode; + int ha_id; + int is_single; + ctl_ha_link_state ha_link; + int port_min; + int port_max; + int port_cnt; + int init_min; + int init_max; + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; + void *othersc_pool; + struct proc *ctl_proc; + uint32_t *ctl_lun_mask; + struct ctl_lun **ctl_luns; + uint32_t *ctl_port_mask; + STAILQ_HEAD(, ctl_lun) lun_list; + STAILQ_HEAD(, ctl_be_lun) pending_lun_queue; + uint32_t num_frontends; + STAILQ_HEAD(, ctl_frontend) fe_list; + uint32_t num_ports; + STAILQ_HEAD(, ctl_port) port_list; + struct ctl_port **ctl_ports; + uint32_t num_backends; + STAILQ_HEAD(, ctl_backend_driver) be_list; + struct uma_zone *io_zone; + uint32_t cur_pool_id; + int shutdown; + struct ctl_thread threads[CTL_MAX_THREADS]; + struct thread *lun_thread; + struct thread *thresh_thread; + TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens; + struct callout tpc_timeout; + struct mtx tpc_lock; }; #ifdef _KERNEL From owner-svn-src-stable-11@freebsd.org Wed Nov 22 21:20:27 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31CCDF602D; Wed, 22 Nov 2017 21:20:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id BF77A6A7B0; Wed, 22 Nov 2017 21:20:27 +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 vAMLKQGR003114; Wed, 22 Nov 2017 21:20:26 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMLKQil003113; Wed, 22 Nov 2017 21:20:26 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201711222120.vAMLKQil003113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Nov 2017 21:20: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: r326103 - stable/11/usr.sbin/syslogd X-SVN-Group: stable-11 X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: stable/11/usr.sbin/syslogd X-SVN-Commit-Revision: 326103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 21:20:28 -0000 Author: glebius Date: Wed Nov 22 21:20:26 2017 New Revision: 326103 URL: https://svnweb.freebsd.org/changeset/base/326103 Log: MFC r325558: When parsing UDP messages skip optional hostname as described by RFC 3164. PR: 200933 Submitted by: maxim Reported by: Konstantin Pavlov Modified: stable/11/usr.sbin/syslogd/syslogd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/11/usr.sbin/syslogd/syslogd.c Wed Nov 22 20:27:46 2017 (r326102) +++ stable/11/usr.sbin/syslogd/syslogd.c Wed Nov 22 21:20:26 2017 (r326103) @@ -972,7 +972,7 @@ static void logmsg(int pri, const char *msg, const char *from, int flags) { struct filed *f; - int i, fac, msglen, omask, prilev; + int i, j, fac, msglen, omask, prilev; const char *timestamp; char prog[NAME_MAX+1]; char buf[MAXLINE+1]; @@ -1018,6 +1018,19 @@ logmsg(int pri, const char *msg, const char *from, int } prilev = LOG_PRI(pri); + + /* skip hostname, see RFC 3164 */ + for (i = 0, j = 0; i < NAME_MAX; i++) { + if (isspace(msg[i])) { + j = i + 1; + } + if (msg[i] == ':') + break; + } + if (j <= msglen) { + msg += j; + msglen -= j; + } /* extract program name */ for (i = 0; i < NAME_MAX; i++) { From owner-svn-src-stable-11@freebsd.org Wed Nov 22 21:22:11 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B61DF622E; Wed, 22 Nov 2017 21:22:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D22686ABB4; Wed, 22 Nov 2017 21:22:10 +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 vAMLM9LN007084; Wed, 22 Nov 2017 21:22:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMLM9nc007081; Wed, 22 Nov 2017 21:22:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201711222122.vAMLM9nc007081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Nov 2017 21:22: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: r326104 - in stable/11: lib/libnetgraph tools/build/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: lib/libnetgraph tools/build/mk X-SVN-Commit-Revision: 326104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 21:22:11 -0000 Author: mav Date: Wed Nov 22 21:22:09 2017 New Revision: 326104 URL: https://svnweb.freebsd.org/changeset/base/326104 Log: MFC r325552: s/NgSendMsgReply/NgSendReplyMsg/ in man to match the code. Submitted by: Dmitry Luhtionov Modified: stable/11/lib/libnetgraph/Makefile stable/11/lib/libnetgraph/netgraph.3 stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libnetgraph/Makefile ============================================================================== --- stable/11/lib/libnetgraph/Makefile Wed Nov 22 21:20:26 2017 (r326103) +++ stable/11/lib/libnetgraph/Makefile Wed Nov 22 21:22:09 2017 (r326104) @@ -15,7 +15,7 @@ MLINKS+= netgraph.3 NgMkSockNode.3 MLINKS+= netgraph.3 NgNameNode.3 MLINKS+= netgraph.3 NgSendMsg.3 MLINKS+= netgraph.3 NgSendAsciiMsg.3 -MLINKS+= netgraph.3 NgSendMsgReply.3 +MLINKS+= netgraph.3 NgSendReplyMsg.3 MLINKS+= netgraph.3 NgRecvMsg.3 MLINKS+= netgraph.3 NgAllocRecvMsg.3 MLINKS+= netgraph.3 NgRecvAsciiMsg.3 Modified: stable/11/lib/libnetgraph/netgraph.3 ============================================================================== --- stable/11/lib/libnetgraph/netgraph.3 Wed Nov 22 21:20:26 2017 (r326103) +++ stable/11/lib/libnetgraph/netgraph.3 Wed Nov 22 21:22:09 2017 (r326104) @@ -43,7 +43,7 @@ .Nm NgNameNode , .Nm NgSendMsg , .Nm NgSendAsciiMsg , -.Nm NgSendMsgReply , +.Nm NgSendReplyMsg , .Nm NgRecvMsg , .Nm NgAllocRecvMsg , .Nm NgRecvAsciiMsg , @@ -70,7 +70,7 @@ .Ft int .Fn NgSendAsciiMsg "int cs" "const char *path" "const char *fmt" ... .Ft int -.Fo NgSendMsgReply +.Fo NgSendReplyMsg .Fa "int cs" "const char *path" "struct ng_mesg *msg" "const void *arg" .Fa "size_t arglen" .Fc @@ -162,7 +162,7 @@ header is returned. This value is typically used to associate replies. .Pp Use -.Fn NgSendMsgReply +.Fn NgSendReplyMsg to send reply to a previously received control message. The original message header should be pointed to by .Fa msg . Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Nov 22 21:20:26 2017 (r326103) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Nov 22 21:22:09 2017 (r326104) @@ -6404,7 +6404,7 @@ OLD_FILES+=usr/share/man/man3/NgRecvMsg.3.gz OLD_FILES+=usr/share/man/man3/NgSendAsciiMsg.3.gz OLD_FILES+=usr/share/man/man3/NgSendData.3.gz OLD_FILES+=usr/share/man/man3/NgSendMsg.3.gz -OLD_FILES+=usr/share/man/man3/NgSendMsgReply.3.gz +OLD_FILES+=usr/share/man/man3/NgSendReplyMsg.3.gz OLD_FILES+=usr/share/man/man3/NgSetDebug.3.gz OLD_FILES+=usr/share/man/man3/NgSetErrLog.3.gz OLD_FILES+=usr/share/man/man3/netgraph.3.gz From owner-svn-src-stable-11@freebsd.org Thu Nov 23 09:35:03 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15E1BDE5BC7; Thu, 23 Nov 2017 09:35:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3D9D63D35; Thu, 23 Nov 2017 09:35:02 +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 vAN9Z14V015114; Thu, 23 Nov 2017 09:35:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN9Z178015112; Thu, 23 Nov 2017 09:35:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711230935.vAN9Z178015112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 23 Nov 2017 09:35: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: r326119 - in stable/11/sys/cam: ata scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in stable/11/sys/cam: ata scsi X-SVN-Commit-Revision: 326119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 09:35:03 -0000 Author: bapt Date: Thu Nov 23 09:35:01 2017 New Revision: 326119 URL: https://svnweb.freebsd.org/changeset/base/326119 Log: MFC r325888: Add some 4k quirks for Samsung pm863a SSDs Submitted by: Nikita Kozlov Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D13093 Modified: stable/11/sys/cam/ata/ata_da.c stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Nov 23 08:02:02 2017 (r326118) +++ stable/11/sys/cam/ata/ata_da.c Thu Nov 23 09:35:01 2017 (r326119) @@ -660,6 +660,14 @@ static struct ada_quirk_entry ada_quirk_table[] = }, { /* + * Same as for SAMSUNG MZ7* but enable the quirks for SSD + * starting with MZ7* too + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "MZ7*", "*" }, + /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN + }, + { + /* * Samsung PM851 Series SSDs Dell OEM * device model "SAMSUNG SSD PM851 mSATA 256GB" * 4k optimised, NCQ broken Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Thu Nov 23 08:02:02 2017 (r326118) +++ stable/11/sys/cam/scsi/scsi_da.c Thu Nov 23 09:35:01 2017 (r326119) @@ -1271,6 +1271,14 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Same as for SAMSUNG MZ7* but enable the quirks for SSD + * starting with MZ7* too + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "MZ7*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-stable-11@freebsd.org Thu Nov 23 10:09:50 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C50DE6804; Thu, 23 Nov 2017 10:09:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B93564DF8; Thu, 23 Nov 2017 10:09:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vANA9nSe027483; Thu, 23 Nov 2017 10:09:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANA9nEC027482; Thu, 23 Nov 2017 10:09:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201711231009.vANA9nEC027482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 23 Nov 2017 10:09: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: r326120 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ahci X-SVN-Commit-Revision: 326120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 10:09:50 -0000 Author: mav Date: Thu Nov 23 10:09:49 2017 New Revision: 326120 URL: https://svnweb.freebsd.org/changeset/base/326120 Log: MFC r325571: Add some PCI IDs found on AMD Epyc system. Modified: stable/11/sys/dev/ahci/ahci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci_pci.c Thu Nov 23 09:35:01 2017 (r326119) +++ stable/11/sys/dev/ahci/ahci_pci.c Thu Nov 23 10:09:49 2017 (r326120) @@ -73,6 +73,11 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, + {0x79001022, 0x00, "AMD KERNCZ", 0}, + {0x79011022, 0x00, "AMD KERNCZ", 0}, + {0x79021022, 0x00, "AMD KERNCZ", 0}, + {0x79031022, 0x00, "AMD KERNCZ", 0}, + {0x79041022, 0x00, "AMD KERNCZ", 0}, {0x06011b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, {0x06021b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, {0x06111b21, 0x00, "ASMedia ASM1061", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, From owner-svn-src-stable-11@freebsd.org Thu Nov 23 13:59:35 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2960DED682; Thu, 23 Nov 2017 13:59:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DA76C094; Thu, 23 Nov 2017 13:59:35 +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 vANDxYcf024808; Thu, 23 Nov 2017 13:59:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANDxY8Y024806; Thu, 23 Nov 2017 13:59:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711231359.vANDxY8Y024806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Nov 2017 13:59: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: r326128 - stable/11/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Commit-Revision: 326128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 13:59:36 -0000 Author: markj Date: Thu Nov 23 13:59:34 2017 New Revision: 326128 URL: https://svnweb.freebsd.org/changeset/base/326128 Log: MFC r324864, r324865: Cleanups for ctf.5. Modified: stable/11/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Thu Nov 23 13:57:44 2017 (r326127) +++ stable/11/cddl/contrib/opensolaris/lib/libctf/common/ctf.5 Thu Nov 23 13:59:34 2017 (r326128) @@ -39,7 +39,8 @@ data contained in each file has information about the sizes of C types, including intrinsic types, enumerations, structures, typedefs, and unions, that are used by the corresponding .Sy ELF -object. The +object. +The .Nm data may also include information about the types of global objects and the return type and arguments of functions in the symbol table. @@ -51,41 +52,43 @@ file itself, it may also be referred to as a .Nm .Sy container . .Lp -On illumos systems, +On +.Fx +systems, .Nm -data is consumed by multiple programs. It can be used by the modular -debugger, -.Xr mdb 1 , -as well as by -.Xr dtrace 1M . +data is consumed by +.Xr dtrace 1 . Programmatic access to .Nm -data can be obtained through -.Xr libctf 3LIB . +data can be obtained through libctf. .Lp The .Nm -file format is broken down into seven different sections. The first -section is the +file format is broken down into seven different sections. +The first section is the .Sy preamble and .Sy header , which describes the version of the .Nm -file, links it has to other +file, the links it has to other .Nm -files, and the sizes of the other sections. The next section is the +files, and the sizes of the other sections. +The next section is the .Sy label section, which provides a way of identifying similar groups of .Nm -data across multiple files. This is followed by the +data across multiple files. +This is followed by the .Sy object -information section, which describes the type of global -symbols. The subsequent section is the +information section, which describes the types of global +symbols. +The subsequent section is the .Sy function information section, which describes the return -types and arguments of functions. The next section is the +types and arguments of functions. +The next section is the .Sy type information section, which describes the format and layout of the C types themselves, and finally the last @@ -106,29 +109,35 @@ A file may contain all of the type information that it requires, or it may optionally refer to another .Nm -file which holds the remaining types. When a +file which holds the remaining types. +When a .Nm file refers to another file, it is called the .Sy child and the file it refers to is called the .Sy parent . -A given file may only refer to one parent. This process is called +A given file may only refer to one parent. +This process is called .Em uniquification because it ensures each child only has type information that is -unique to it. A common example of this is that most kernel modules in -illumos are uniquified against the kernel module +unique to it. +A common example of this is that most kernel modules in illumos are uniquified +against the kernel module .Sy genunix and the type information that comes from the .Sy IP -module. This means that a module only has types that are unique to -itself and the most common types in the kernel are not duplicated. +module. +This means that a module only has types that are unique to itself and the most +common types in the kernel are not duplicated. .Sh FILE FORMAT This documents version .Em two of the .Nm -file format. All applications and tools currently produce and operate on -this version. +file format. +All applications and tools on +.Fx +currently produce and operate on this version. .Lp The file format can be summarized with the following image, the following sections will cover this in more detail. @@ -235,26 +244,31 @@ This .Sy preamble defines the version of the .Nm -file which defines the format of the rest of the header. While the -header may change in subsequent versions, the preamble will not change +file which defines the format of the rest of the header. +While the header may change in subsequent versions, the preamble will not change across versions, though the interpretation of its flags may change from -version to version. The +version to version. +The .Em ctp_magic member defines the magic number for the .Nm -file format. This must always be +file format. +This must always be .Li 0xcff1 . If another value is encountered, then the file should not be treated as a .Nm -file. The +file. +The .Em ctp_version member defines the version of the .Nm -file. The current version is +file. +The current version is .Li 2 . -It is possible to encounter an unsupported version. In that case, -software should not try to parse the format, as it may have changed. +It is possible to encounter an unsupported version. +In that case, software should not try to parse the format, as it may have +changed. Finally, the .Em ctp_flags member describes aspects of the file which modify its interpretation. @@ -273,9 +287,10 @@ has been compressed through the .Sy zlib library and its .Sy deflate -algorithm. If this flag is not present, then the body has not been -compressed and no special action is needed to interpret it. All offsets -into the data as described by +algorithm. +If this flag is not present, then the body has not been compressed and no +special action is needed to interpret it. +All offsets into the data as described by .Sy header , always refer to the .Sy uncompressed @@ -285,13 +300,13 @@ In version two of the .Nm file format, the .Sy header -denotes whether whether or not this +denotes whether or not this .Nm file is the child of another .Nm -file and also indicates the size of the remaining sections. The -structure for the -.Sy header , +file and also indicates the size of the remaining sections. +The structure for the +.Sy header logically contains a copy of the .Sy preamble and the two have a combined size of 36 bytes. @@ -315,37 +330,40 @@ the next two members .Em cth_parlablel and .Em cth_parname , -are used to identify the parent. The value of both members are offsets -into the +are used to identify the parent. +The value of both members are offsets into the .Sy string -section which point to the start of a null-terminated string. For more -information on the encoding of strings, see the subsection on +section which point to the start of a null-terminated string. +For more information on the encoding of strings, see the subsection on .Sx String Identifiers . If the value of either is zero, then there is no entry for that -member. If the member +member. +If the member .Em cth_parlabel is set, then the .Em ctf_parname member must be set, otherwise it will not be possible to find the -parent. If +parent. +If .Em ctf_parname is set, it is not necessary to define .Em cth_parlabel , -as the parent may not have a label. For more information on labels -and their interpretation, see +as the parent may not have a label. +For more information on labels and their interpretation, see .Sx The Label Section . .Lp The remaining members (excepting .Em cth_strlen ) -describe the beginning of the corresponding sections. These offsets are -relative to the end of the +describe the beginning of the corresponding sections. +These offsets are relative to the end of the .Sy header . Therefore, something with an offset of 0 is at an offset of thirty-six bytes relative to the start of the .Nm -file. The difference between members -indicates the size of the section itself. Different offsets have -different alignment requirements. The start of the +file. +The difference between members indicates the size of the section itself. +Different offsets have different alignment requirements. +The start of the .Em cth_objotoff and .Em cth_funcoff @@ -353,13 +371,14 @@ must be two byte aligned, while the sections .Em cth_lbloff and .Em cth_typeoff -must be four-byte aligned. The section +must be four-byte aligned. +The section .Em cth_stroff -has no alignment requirements. To calculate the size of a given section, -excepting the +has no alignment requirements. +To calculate the size of a given section, excepting the .Sy string -section, one should subtract the offset of the section from the following one. For -example, the size of the +section, one should subtract the offset of the section from the following one. +For example, the size of the .Sy types section can be calculated by subtracting .Em cth_stroff @@ -368,8 +387,8 @@ from .Lp Finally, the member .Em cth_strlen -describes the length of the string section itself. From it, you can also -calculate the size of the entire +describes the length of the string section itself. +From it, you can also calculate the size of the entire .Nm file by adding together the size of the .Sy ctf_header_t , @@ -380,9 +399,11 @@ and the size of the string section in .Ss Type Identifiers Through the .Nm ctf -data, types are referred to by identifiers. A given +data, types are referred to by identifiers. +A given .Nm -file supports up to 32767 (0x7fff) types. The first valid type identifier is 0x1. +file supports up to 32767 (0x7fff) types. +The first valid type identifier is 0x1. When a given .Nm file is a child, indicated by a non-zero entry for the @@ -403,18 +424,20 @@ Other consumers of information may use larger or opaque identifiers. .Ss String Identifiers String identifiers are always encoded as four byte unsigned integers -which are an offset into a string table. The +which are an offset into a string table. +The .Nm format supports two different string tables which have an identifier of -zero or one. This identifier is stored in the high-order bit of the -unsigned four byte offset. Therefore, the maximum supported offset into -one of these tables is 0x7ffffffff. +zero or one. +This identifier is stored in the high-order bit of the unsigned four byte +offset. +Therefore, the maximum supported offset into one of these tables is 0x7ffffffff. .Lp Table identifier zero, always refers to the .Sy string -section in the CTF file itself. String table identifier one refers to an -external string table which is the ELF string table for the ELF symbol -table associated with the +section in the CTF file itself. +String table identifier one refers to an external string table which is the ELF +string table for the ELF symbol table associated with the .Nm container. .Ss Type Encoding @@ -434,8 +457,8 @@ The length of the variable data .Lp The 16 bits that make up the encoding are broken down such that you have five bits for the kind, one bit for indicating whether or not it is a -root type, and 10 bits for the variable length. This is laid out as -follows: +root type, and 10 bits for the variable length. +This is laid out as follows: .Bd -literal -offset indent +--------------------+ | kind | root | vlen | @@ -443,12 +466,13 @@ follows: 15 11 10 9 0 .Ed .Lp -The current version of the file format defines 14 different kinds. The -interpretation of these different kinds will be discussed in the section +The current version of the file format defines 14 different kinds. +The interpretation of these different kinds will be discussed in the section .Sx The Type Section . If a kind is encountered that is not listed below, then it is not a valid .Nm -file. The kinds are defined as follows: +file. +The kinds are defined as follows: .Bd -literal -offset indent #define CTF_K_UNKNOWN 0 #define CTF_K_INTEGER 1 @@ -467,14 +491,16 @@ file. The kinds are defined as follows: .Ed .Lp Programs directly reference many types; however, other types are referenced -indirectly because they are part of some other structure. These types that are -referenced directly and used are called +indirectly because they are part of some other structure. +These types that are referenced directly and used are called .Sy root -types. Other types may be used indirectly, for example, a program may reference -a structure directly, but not one of its members which has a type. That type is -not considered a +types. +Other types may be used indirectly, for example, a program may reference +a structure directly, but not one of its members which has a type. +That type is not considered a .Sy root -type. If a type is a +type. +If a type is a .Sy root type, then it will have bit 10 set. .Lp @@ -499,16 +525,17 @@ When consuming .Nm data, it is often useful to know whether two different .Nm -containers come from the same source base and version. For example, when -building illumos, there are many kernel modules that are built against a -single collection of source code. A label is encoded into the +containers come from the same source base and version. +For example, when building illumos, there are many kernel modules that are built +against a single collection of source code. +A label is encoded into the .Nm -files that corresponds with the particular build. This ensures that if -files on the system were to become mixed up from multiple releases, that -they are not used together by tools, particularly when a child needs to -refer to a type in the parent. Because they are linked used the type -identifiers, if the wrong parent is used then the wrong type will be -encountered. +files that corresponds with the particular build. +This ensures that if files on the system were to become mixed up from multiple +releases, that they are not used together by tools, particularly when a child +needs to refer to a type in the parent. +Because they are linked using the type identifiers, if the wrong parent is used +then the wrong type will be encountered. .Lp Each label is encoded in the file format using the following eight byte structure: @@ -530,21 +557,22 @@ section. The type identifier encoded in the member .Em ctl_typeidx refers to the last type identifier that a label refers to in the current -file. Labels only refer to types in the current file, if the +file. +Labels only refer to types in the current file, if the .Nm file is a child, then it will have the same label as its parent; -however, its label will only refer to its types, not its parents. +however, its label will only refer to its types, not its parent's. .Lp It is also possible, though rather uncommon, for a .Nm -file to have multiple labels. Labels are placed one after another, every -eight bytes. When multiple labels are present, types may only belong to -a single label. +file to have multiple labels. +Labels are placed one after another, every eight bytes. +When multiple labels are present, types may only belong to a single label. .Ss The Object Section The object section provides a mapping from ELF symbols of type .Sy STT_OBJECT -in the symbol table to a type identifier. Every entry in this section is -a +in the symbol table to a type identifier. +Every entry in this section is a .Sy uint16_t which contains a type identifier as described in the section .Sx Type Identifiers . @@ -555,9 +583,10 @@ To walk the object section, you need to have a corresp .Sy symbol table in the ELF object that contains the .Nm -data. Not every object is included in this section. Specifically, when -walking the symbol table. An entry is skipped if it matches any of the -following conditions: +data. +Not every object is included in this section. +Specifically, when walking the symbol table, an entry is skipped if it matches +any of the following conditions: .Lp .Bl -bullet -offset indent -compact .It @@ -628,40 +657,45 @@ walk_symbols(uint16_t *objtoff, Elf_Data *symdata, Elf The function section of the .Nm file encodes the types of both the function's arguments and the function's -return type. Similar to +return value. +Similar to .Sx The Object Section , the function section encodes information for all symbols of type .Sy STT_FUNCTION , -excepting those that fit specific criteria. Unlike with objects, because -functions have a variable number of arguments, they start with a type encoding -as defined in +excepting those that fit specific criteria. +Unlike with objects, because functions have a variable number of arguments, they +start with a type encoding as defined in .Sx Type Encoding , which is the size of a .Sy uint16_t . For functions which have no type information available, they are encoded as .Li CTF_TYPE_INFO(CTF_K_UNKNOWN, 0, 0) . -Functions with arguments are encoded differently. Here, the variable length is -turned into the number of arguments in the function. If a function is a +Functions with arguments are encoded differently. +Here, the variable length is turned into the number of arguments in the +function. +If a function is a .Sy varargs -type function, then the number of arguments is increased by one. Functions with -type information are encoded as: +type function, then the number of arguments is increased by one. +Functions with type information are encoded as: .Li CTF_TYPE_INFO(CTF_K_FUNCTION, 0, nargs) . .Lp For functions that have no type information, nothing else is encoded, and the -next function is encoded. For functions with type information, the next +next function is encoded. +For functions with type information, the next .Sy uint16_t -is encoded with the type identifier of the return type of the function. It is -followed by each of the type identifiers of the arguments, if any exist, in the -order that they appear in the function. Therefore, argument 0 is the first type -identifier and so on. When a function has a final varargs argument, that is -encoded with the type identifier of zero. +is encoded with the type identifier of the return type of the function. +It is followed by each of the type identifiers of the arguments, if any exist, +in the order that they appear in the function. +Therefore, argument 0 is the first type identifier and so on. +When a function has a final varargs argument, that is encoded with the type +identifier of zero. .Lp Like .Sx The Object Section , -the function section is encoded in the order of the symbol table. It has -similar, but slightly different considerations from objects. While iterating the -symbol table, if any of the following conditions are true, then the entry is -skipped and no corresponding entry is written: +the function section is encoded in the order of the symbol table. +It has similar, but slightly different considerations from objects. +While iterating the symbol table, if any of the following conditions are true, +then the entry is skipped and no corresponding entry is written: .Lp .Bl -bullet -offset indent -compact .It @@ -683,10 +717,11 @@ ELF. .Ss The Type Section The type section is the heart of the .Nm -data. It encodes all of the information about the types themselves. The base of -the type information comes in two forms, a short form and a long form, each of -which may be followed by a variable number of arguments. The following -definitions describe the short and long forms: +data. +It encodes all of the information about the types themselves. +The base of the type information comes in two forms, a short form and a long +form, each of which may be followed by a variable number of arguments. +The following definitions describe the short and long forms: .Bd -literal #define CTF_MAX_SIZE 0xfffe /* max size of a type in bytes */ #define CTF_LSIZE_SENT 0xffff /* sentinel for ctt_size */ @@ -720,14 +755,17 @@ Type sizes are stored in .Sy bytes . The basic small form uses a .Sy ushort_t -to store the number of bytes. If the number of bytes in a structure would exceed -0xfffe, then the alternate form, the +to store the number of bytes. +If the number of bytes in a structure would exceed 0xfffe, then the alternate +form, the .Sy ctf_type_t , -is used instead. To indicate that the larger form is being used, the member +is used instead. +To indicate that the larger form is being used, the member .Em ctt_size is set to value of .Sy CTF_LSIZE_SENT -(0xffff). In general, when going through the type section, consumers use the +(0xffff). +In general, when going through the type section, consumers use the .Sy ctf_type_t structure, but pay attention to the value of the member .Em ctt_size @@ -739,36 +777,43 @@ Not all kinds of types use .Sy ctt_size . Those which do not, will always use the .Sy ctf_stype_t -structure. The individual sections for each kind have more information. +structure. +The individual sections for each kind have more information. .Lp -Types are written out in order. Therefore the first entry encountered has a type -id of 0x1, or 0x8000 if a child. The member +Types are written out in order. +Therefore the first entry encountered has a type id of 0x1, or 0x8000 if a +child. +The member .Em ctt_name is encoded as described in the section .Sx String Identifiers . -The string that it points to is the name of the type. If the identifier points -to an empty string (one that consists solely of a null terminator) then the type -does not have a name, this is common with anonymous structures and unions that -only have a typedef to name them, as well as, pointers and qualifiers. +The string that it points to is the name of the type. +If the identifier points to an empty string (one that consists solely of a null +terminator) then the type does not have a name, this is common with anonymous +structures and unions that only have a typedef to name them, as well as +pointers and qualifiers. .Lp The next member, the .Em ctt_info , is encoded as described in the section .Sx Type Encoding . -The types kind tells us how to interpret the remaining data in the +The type's kind tells us how to interpret the remaining data in the .Sy ctf_type_t -and any variable length data that may exist. The rest of this section will be -broken down into the interpretation of the various kinds. +and any variable length data that may exist. +The rest of this section will be broken down into the interpretation of the +various kinds. .Ss Encoding of Integers Integers, which are of type .Sy CTF_K_INTEGER , -have no variable length arguments. Instead, they are followed by a four byte +have no variable length arguments. +Instead, they are followed by a four byte .Sy uint_t -which describes their encoding. All integers must be encoded with a variable -length of zero. The +which describes their encoding. +All integers must be encoded with a variable length of zero. +The .Em ctt_size -member describes the length of the integer in bytes. In general, integer sizes -will be rounded up to the closest power of two. +member describes the length of the integer in bytes. +In general, integer sizes will be rounded up to the closest power of two. .Lp The integer encoding contains three different pieces of information: .Bl -bullet -offset indent -compact @@ -804,33 +849,37 @@ The following flags are defined for the encoding at th .Lp By default, an integer is considered to be unsigned, unless it has the .Sy CTF_INT_SIGNED -flag set. If the flag +flag set. +If the flag .Sy CTF_INT_CHAR is set, that indicates that the integer is of a type that stores character data, for example the intrinsic C type .Sy char would have the .Sy CTF_INT_CHAR -flag set. If the flag +flag set. +If the flag .Sy CTF_INT_BOOL -is set, that indicates that the integer represents a boolean type. For example, -the intrinsic C type +is set, that indicates that the integer represents a boolean type. +For example, the intrinsic C type .Sy _Bool would have the .Sy CTF_INT_BOOL -flag set. Finally, the flag +flag set. +Finally, the flag .Sy CTF_INT_VARARGS indicates that the integer is used as part of a variable number of arguments. This encoding is rather uncommon. .Ss Encoding of Floats Floats, which are of type .Sy CTF_K_FLOAT , -are similar to their integer counterparts. They have no variable length -arguments and are followed by a four byte encoding which describes the kind of -float that exists. The +are similar to their integer counterparts. +They have no variable length arguments and are followed by a four byte encoding +which describes the kind of float that exists. +The .Em ctt_size -member is the size, in bytes, of the float. The float encoding has three -different pieces of information inside of it: +member is the size, in bytes, of the float. +The float encoding has three different pieces of information inside of it: .Lp .Bl -bullet -offset indent -compact .It @@ -855,11 +904,12 @@ This encoding can be expressed through the following m (((encoding) << 24) | ((offset) << 16) | (bits)) .Ed .Lp -Where as the encoding for integers was a series of flags, the encoding for -floats maps to a specific kind of float. It is not a flag-based value. The kinds of floats -correspond to both their size, and the encoding. This covers all of the basic C -intrinsic floating point types. The following are the different kinds of floats -represented in the encoding: +Where as the encoding for integers is a series of flags, the encoding for +floats maps to a specific kind of float. +It is not a flag-based value. +The kinds of floats correspond to both their size, and the encoding. +This covers all of the basic C intrinsic floating point types. +The following are the different kinds of floats represented in the encoding: .Bd -literal -offset indent #define CTF_FP_SINGLE 1 /* IEEE 32-bit float encoding */ #define CTF_FP_DOUBLE 2 /* IEEE 64-bit float encoding */ @@ -877,12 +927,14 @@ represented in the encoding: .Ss Encoding of Arrays Arrays, which are of type .Sy CTF_K_ARRAY , -have no variable length arguments. They are followed by a structure which -describes the number of elements in the array, the type identifier of the -elements in the array, and the type identifier of the index of the array. With -arrays, the +have no variable length arguments. +They are followed by a structure which describes the number of elements in the +array, the type identifier of the elements in the array, and the type identifier +of the index of the array. +With arrays, the .Em ctt_size -member is set to zero. The structure that follows an array is defined as: +member is set to zero. +The structure that follows an array is defined as: .Bd -literal typedef struct ctf_array { ushort_t cta_contents; /* reference to type of array contents */ @@ -901,14 +953,15 @@ are type identifiers which are encoded as per the sect .Sx Type Identifiers . The member .Em cta_nelems -is a simple four byte unsigned count of the number of elements. This count may -be zero when encountering C99's flexible array members. +is a simple four byte unsigned count of the number of elements. +This count may be zero when encountering C99's flexible array members. .Ss Encoding of Functions Function types, which are of type .Sy CTF_K_FUNCTION , -use the variable length list to be the number of arguments in the function. When -the function has a final member which is a varargs, then the argument count is -incremented by one to account for the variable argument. Here, the +use the variable length list to be the number of arguments in the function. +When the function has a final member which is a varargs, then the argument count +is incremented by one to account for the variable argument. +Here, the .Em ctt_type member is encoded with the type identifier of the return type of the function. Note that the @@ -916,31 +969,40 @@ Note that the member is not used here. .Lp The variable argument list contains the type identifiers for the arguments of -the function, if any. Each one is represented by a +the function, if any. +Each one is represented by a .Sy uint16_t and encoded according to the .Sx Type Identifiers -section. If the function's last argument is of type varargs, then it is also -written out, but the type identifier is zero. This is included in the count of -the function's arguments. +section. +If the function's last argument is of type varargs, then it is also written out, +but the type identifier is zero. +This is included in the count of the function's arguments. +An extra type identifier may follow the argument and return type identifiers +in order to maintain four-byte alignment for the following type definition. +Such a type identifier is not included in the argument count and has a value +of zero. .Ss Encoding of Structures and Unions Structures and Unions, which are encoded with .Sy CTF_K_STRUCT and .Sy CTF_K_UNION -respectively, are very similar constructs in C. The main difference -between them is the fact that every member of a structure follows one another, -where as in a union, all members share the same memory. They are also very -similar in terms of their encoding in +respectively, are very similar constructs in C. +The main difference between them is the fact that members of a structure +follow one another, where as in a union, all members share the same memory. +They are also very similar in terms of their encoding in .Nm . The variable length argument for structures and unions represents the number of -members that they have. The value of the member +members that they have. +The value of the member .Em ctt_size -is the size of the structure and union. There are two different structures which -are used to encode members in the variable list. When the size of a structure or -union is greater than or equal to the large member threshold, 8192, then a -different structure is used to encode the member, all members are encoded using -the same structure. The structure for members is as follows: +is the size of the structure and union. +There are two different structures which are used to encode members in the +variable list. +When the size of a structure or union is greater than or equal to the large +member threshold, 8192, then a different structure is used to encode the member, +all members are encoded using the same structure. +The structure for members is as follows: .Bd -literal typedef struct ctf_member { uint_t ctm_name; /* reference to name in string table */ @@ -961,54 +1023,66 @@ Both the .Em ctm_name and .Em ctlm_name -refer to the name of the member. The name is encoded as an offset into the -string table as described by the section +refer to the name of the member. +The name is encoded as an offset into the string table as described by the +section .Sx String Identifiers . The members .Sy ctm_type and .Sy ctlm_type -both refer to the type of the member. They are encoded as per the section +both refer to the type of the member. +They are encoded as per the section .Sx Type Identifiers . .Lp The last piece of information that is present is the offset which describes the -offset in memory that the member begins at. For unions, this value will always -be zero because the start of unions in memory is always zero. For structures, -this is the offset in +offset in memory at which the member begins. +For unions, this value will always be zero because each member of a union has +an offset of zero. +For structures, this is the offset in .Sy bits -that the member begins at. Note that a compiler may lay out a type with padding. +at which the member begins. +Note that a compiler may lay out a type with padding. This means that the difference in offset between two consecutive members may be -larger than the size of the member. When the size of the overall structure is -strictly less than 8192 bytes, the normal structure, +larger than the size of the member. +When the size of the overall structure is strictly less than 8192 bytes, the +normal structure, .Sy ctf_member_t , is used and the offset in bits is stored in the member .Em ctm_offset . However, when the size of the structure is greater than or equal to 8192 bytes, -then the number of bits is split into two 32-bit quantities. One member, +then the number of bits is split into two 32-bit quantities. +One member, .Em ctlm_offsethi , represents the upper 32 bits of the offset, while the other member, .Em ctlm_offsetlo , -represents the lower 32 bits of the offset. These can be joined together to get -a 64-bit sized offset in bits by shifting the member +represents the lower 32 bits of the offset. +These can be joined together to get a 64-bit sized offset in bits by shifting +the member .Em ctlm_offsethi to the left by thirty two and then doing a binary or of .Em ctlm_offsetlo . .Ss Encoding of Enumerations Enumerations, noted by the type .Sy CTF_K_ENUM , -are similar to structures. Enumerations use the variable list to note the number -of values that the enumeration contains, which we'll term enumerators. In C, an -enumeration is always equivalent to the intrinsic type +are similar to structures. +Enumerations use the variable list to note the number of values that the +enumeration contains, which we'll term enumerators. +In C, an enumeration is always equivalent to the intrinsic type .Sy int , thus the value of the member .Em ctt_size is always the size of an integer which is determined based on the current model. -For illumos systems, this will always be 4, as an integer is always defined to +For +.Fx +systems, this will always be 4, as an integer is always defined to be 4 bytes large in both .Sy ILP32 and .Sy LP64 , regardless of the architecture. +For further details, see +.Xr arch 7 . .Lp The enumerators encoded in an enumeration have the following structure in the variable list: @@ -1032,25 +1106,27 @@ Forward references, types of kind .Sy CTF_K_FORWARD , in a .Nm -file refer to types which may not have a definition at all, only a name. If -the +file refer to types which may not have a definition at all, only a name. +If the .Nm file is a child, then it may be that the forward is resolved to an actual type in the parent, otherwise the definition may be in another .Nm -container or may not be known at all. The only member of the +container or may not be known at all. +The only member of the .Sy ctf_type_t that matters for a forward declaration is the .Em ctt_name which points to the name of the forward reference in the string table as -described earlier. There is no other information recorded for forward -references. +described earlier. +There is no other information recorded for forward references. .Ss Encoding of Pointers, Typedefs, Volatile, Const, and Restrict Pointers, typedefs, volatile, const, and restrict are all similar in .Nm . -They all refer to another type. In the case of typedefs, they provide an -alternate name, while volatile, const, and restrict change how the type is -interpreted in the C programming language. This covers the +They all refer to another type. +In the case of typedefs, they provide an alternate name, while volatile, const, +and restrict change how the type is interpreted in the C programming language. +This covers the .Nm kinds .Sy CTF_K_POINTER , @@ -1066,43 +1142,49 @@ to refer to the base type that they modify. .Ss Encoding of Unknown Types Types with the kind .Sy CTF_K_UNKNOWN -are used to indicate gaps in the type identifier space. These entries consume an -identifier, but do not define anything. Nothing should refer to these gap -identifiers. +are used to indicate gaps in the type identifier space. +These entries consume an identifier, but do not define anything. +Nothing should refer to these gap identifiers. .Ss Dependencies Between Types -C types can be imagined as a directed, cyclic, graph. Structures and unions may -refer to each other in a way that creates a cyclic dependency. In cases such as -these, the entire type section must be read in and processed. Consumers must -not assume that every type can be laid out in dependency order; they -cannot. +C types can be imagined as a directed, cyclic, graph. +Structures and unions may refer to each other in a way that creates a cyclic +dependency. +In cases such as these, the entire type section must be read in and processed. +Consumers must not assume that every type can be laid out in dependency order; +they cannot. .Ss The String Section The last section of the .Nm file is the .Sy string -section. This section encodes all of the strings that appear throughout -the other sections. It is laid out as a series of characters followed by -a null terminator. Generally, all names are written out in ASCII, as -most C compilers do not allow and characters to appear in identifiers -outside of a subset of ASCII. However, any extended characters sets -should be written out as a series of UTF-8 bytes. +section. +This section encodes all of the strings that appear throughout the other +sections. +It is laid out as a series of characters followed by a null terminator. +Generally, all names are written out in ASCII, as most C compilers do not allow +any characters to appear in identifiers outside of a subset of ASCII. +However, any extended characters sets should be written out as a series of UTF-8 +bytes. .Lp The first entry in the section, at offset zero, is a single null -terminator to reference the empty string. Following that, each C string -should be written out, including the null terminator. Offsets that refer -to something in this section should refer to the first byte which begins -a string. Beyond the first byte in the section being the null -terminator, the order of strings is unimportant. +terminator to reference the empty string. +Following that, each C string should be written out, including the null +terminator. +Offsets that refer to something in this section should refer to the first byte +which begins a string. +Beyond the first byte in the section being the null terminator, the order of +strings is unimportant. .Ss Data Encoding and ELF Considerations .Nm data is generally included in ELF objects which specify information to -identify the architecture and endianness of the file. A +identify the architecture and endianness of the file. +A .Nm -container inside such an object must match the endianness of the ELF -object. Aside from the question of the endian encoding of data, there -should be no other differences between architectures. While many of the -types in this document refer to non-fixed size C integral types, they -are equivalent in the models +container inside such an object must match the endianness of the ELF object. +Aside from the question of the endian encoding of data, there should be no other +differences between architectures. +While many of the types in this document refer to non-fixed size C integral +types, they are equivalent in the models .Sy ILP32 and .Sy LP64 . @@ -1118,15 +1200,16 @@ When placing a container inside of an ELF object, there are certain conventions that are expected for the purposes of tooling being able to find the .Nm -data. In particular, a given ELF object should only contain a single +data. +In particular, a given ELF object should only contain a single .Nm -section. Multiple containers should be merged together into a single -one. +section. +Multiple containers should be merged together into a single one. .Lp The .Nm -file should be included in its own ELF section. The section's name -must be +file should be included in its own ELF section. +The section's name must be .Ql .SUNW_ctf . The type of the section must be .Sy SHT_PROGBITS . @@ -1137,4 +1220,5 @@ alignment must be 4. .Xr elf 3 , .Xr gelf 3 , .Xr a.out 5 , -.Xr elf 5 +.Xr elf 5 , +.Xr arch 7 From owner-svn-src-stable-11@freebsd.org Thu Nov 23 14:01:53 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3078DED8C2; Thu, 23 Nov 2017 14:01:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B7D06C2F2; Thu, 23 Nov 2017 14:01:53 +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 vANE1q39027155; Thu, 23 Nov 2017 14:01:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANE1q4w027153; Thu, 23 Nov 2017 14:01:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711231401.vANE1q4w027153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Nov 2017 14:01: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: r326129 - in stable/11/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/intel/dtrace X-SVN-Commit-Revision: 326129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 14:01:53 -0000 Author: markj Date: Thu Nov 23 14:01:52 2017 New Revision: 326129 URL: https://svnweb.freebsd.org/changeset/base/326129 Log: MFC r325887: Avoid holding the process in uread() and uwrite(). Modified: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c ============================================================================== --- stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c Thu Nov 23 13:59:34 2017 (r326128) +++ stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c Thu Nov 23 14:01:52 2017 (r326129) @@ -35,9 +35,7 @@ uread(proc_t *p, void *kaddr, size_t len, uintptr_t ua { ssize_t n; - PHOLD(p); n = proc_readmem(curthread, p, uaddr, kaddr, len); - PRELE(p); if (n != len) return (ENOMEM); return (0); @@ -48,9 +46,7 @@ uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t u { ssize_t n; - PHOLD(p); n = proc_writemem(curthread, p, uaddr, kaddr, len); - PRELE(p); if (n != len) return (ENOMEM); return (0); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 23 13:59:34 2017 (r326128) +++ stable/11/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Nov 23 14:01:52 2017 (r326129) @@ -1728,11 +1728,7 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); -#ifdef illumos if (fasttrap_copyout(scratch, (char *)addr, i)) { -#else - if (uwrite(p, scratch, i, addr)) { -#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; From owner-svn-src-stable-11@freebsd.org Thu Nov 23 14:02:36 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C78F9DED92F; Thu, 23 Nov 2017 14:02:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F4F06C59C; Thu, 23 Nov 2017 14:02:36 +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 vANE2ZUW028795; Thu, 23 Nov 2017 14:02:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANE2ZPa028794; Thu, 23 Nov 2017 14:02:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711231402.vANE2ZPa028794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Nov 2017 14:02: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: r326130 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 326130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 14:02:36 -0000 Author: markj Date: Thu Nov 23 14:02:35 2017 New Revision: 326130 URL: https://svnweb.freebsd.org/changeset/base/326130 Log: MFC r325561: Allow various page daemon parameters to be set from loader.conf. Modified: stable/11/sys/vm/vm_pageout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Thu Nov 23 14:01:52 2017 (r326129) +++ stable/11/sys/vm/vm_pageout.c Thu Nov 23 14:02:35 2017 (r326130) @@ -170,44 +170,44 @@ SYSCTL_INT(_vm, OID_AUTO, panic_on_oom, "panic on out of memory instead of killing the largest process"); SYSCTL_INT(_vm, OID_AUTO, pageout_wakeup_thresh, - CTLFLAG_RW, &vm_pageout_wakeup_thresh, 0, + CTLFLAG_RWTUN, &vm_pageout_wakeup_thresh, 0, "free page threshold for waking up the pageout daemon"); SYSCTL_INT(_vm, OID_AUTO, pageout_update_period, - CTLFLAG_RW, &vm_pageout_update_period, 0, + CTLFLAG_RWTUN, &vm_pageout_update_period, 0, "Maximum active LRU update period"); -SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, &lowmem_period, 0, +SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RWTUN, &lowmem_period, 0, "Low memory callback period"); SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts, - CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); + CTLFLAG_RWTUN, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); static int pageout_lock_miss; SYSCTL_INT(_vm, OID_AUTO, pageout_lock_miss, CTLFLAG_RD, &pageout_lock_miss, 0, "vget() lock misses during pageout"); SYSCTL_INT(_vm, OID_AUTO, pageout_oom_seq, - CTLFLAG_RW, &vm_pageout_oom_seq, 0, + CTLFLAG_RWTUN, &vm_pageout_oom_seq, 0, "back-to-back calls to oom detector to start OOM"); static int act_scan_laundry_weight = 3; -SYSCTL_INT(_vm, OID_AUTO, act_scan_laundry_weight, CTLFLAG_RW, +SYSCTL_INT(_vm, OID_AUTO, act_scan_laundry_weight, CTLFLAG_RWTUN, &act_scan_laundry_weight, 0, "weight given to clean vs. dirty pages in active queue scans"); static u_int vm_background_launder_target; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_target, CTLFLAG_RW, +SYSCTL_UINT(_vm, OID_AUTO, background_launder_target, CTLFLAG_RWTUN, &vm_background_launder_target, 0, "background laundering target, in pages"); static u_int vm_background_launder_rate = 4096; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RW, +SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RWTUN, &vm_background_launder_rate, 0, "background laundering rate, in kilobytes per second"); static u_int vm_background_launder_max = 20 * 1024; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTLFLAG_RW, +SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTLFLAG_RWTUN, &vm_background_launder_max, 0, "background laundering cap, in kilobytes"); int vm_pageout_page_count = 32; From owner-svn-src-stable-11@freebsd.org Thu Nov 23 14:03:12 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08D72DED9F8; Thu, 23 Nov 2017 14:03:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C713F6C6E8; Thu, 23 Nov 2017 14:03:11 +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 vANE3AIA028876; Thu, 23 Nov 2017 14:03:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANE3A5i028875; Thu, 23 Nov 2017 14:03:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711231403.vANE3A5i028875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Nov 2017 14:03: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: r326131 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 326131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 14:03:12 -0000 Author: markj Date: Thu Nov 23 14:03:10 2017 New Revision: 326131 URL: https://svnweb.freebsd.org/changeset/base/326131 Log: MFC r325528: Correct the type of foff. Modified: stable/11/sys/vm/vm_mmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_mmap.c ============================================================================== --- stable/11/sys/vm/vm_mmap.c Thu Nov 23 14:02:35 2017 (r326130) +++ stable/11/sys/vm/vm_mmap.c Thu Nov 23 14:03:10 2017 (r326131) @@ -1196,7 +1196,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, { struct vattr va; vm_object_t obj; - vm_offset_t foff; + vm_ooffset_t foff; struct ucred *cred; int error, flags, locktype; From owner-svn-src-stable-11@freebsd.org Fri Nov 24 04:42:23 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ACE3DB973D; Fri, 24 Nov 2017 04:42:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F7216552B; Fri, 24 Nov 2017 04:42:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAO4gMKK002194; Fri, 24 Nov 2017 04:42:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAO4gM9D002192; Fri, 24 Nov 2017 04:42:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711240442.vAO4gM9D002192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 24 Nov 2017 04:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326142 - in stable/11/sys: modules/ipfw netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11/sys: modules/ipfw netpfil/ipfw X-SVN-Commit-Revision: 326142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 04:42:23 -0000 Author: ae Date: Fri Nov 24 04:42:21 2017 New Revision: 326142 URL: https://svnweb.freebsd.org/changeset/base/326142 Log: MFC r325960: Unconditionally enable support for O_IPSEC opcode. IPsec support can be loaded as kernel module, thus do not depend from kernel option IPSEC and always build O_IPSEC opcode implementation as enabled. MFC r325962: Do not invoke IPv4 NAT handler for non IPv4 packets. Libalias expects a packet is IPv4. And in case when it is IPv6, it just translates them as IPv4. This leads to corruption and in some cases to panics. In particular a panic can happen when value of ip6_plen modified to something that leads to IP fragmentation, but actual packet length does not match the IP length. Packets that are not IPv4 will be dropped by NAT rule. Modified: stable/11/sys/modules/ipfw/Makefile stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/ipfw/Makefile ============================================================================== --- stable/11/sys/modules/ipfw/Makefile Fri Nov 24 02:39:38 2017 (r326141) +++ stable/11/sys/modules/ipfw/Makefile Fri Nov 24 04:42:21 2017 (r326142) @@ -7,7 +7,7 @@ SRCS= ip_fw2.c ip_fw_pfil.c ip_fw_bpf.c SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_eaction.c SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c SRCS+= ip_fw_table_value.c -SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h opt_ipsec.h +SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h CFLAGS+= -DIPFIREWALL # Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Fri Nov 24 02:39:38 2017 (r326141) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Fri Nov 24 04:42:21 2017 (r326142) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #error "IPFIREWALL requires INET" #endif /* INET */ #include "opt_inet6.h" -#include "opt_ipsec.h" #include #include @@ -1945,10 +1944,8 @@ do { \ break; case O_IPSEC: -#ifdef IPSEC match = (m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL); -#endif /* otherwise no match */ break; @@ -2563,7 +2560,11 @@ do { \ case O_NAT: l = 0; /* exit inner loop */ done = 1; /* exit outer loop */ - if (!IPFW_NAT_LOADED) { + /* + * Ensure that we do not invoke NAT handler for + * non IPv4 packets. Libalias expects only IPv4. + */ + if (!is_ipv4 || !IPFW_NAT_LOADED) { retval = IP_FW_DENY; break; } From owner-svn-src-stable-11@freebsd.org Sat Nov 25 14:47:26 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 319B8DE7456; Sat, 25 Nov 2017 14:47:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F00603162; Sat, 25 Nov 2017 14:47:25 +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 vAPElP0l068070; Sat, 25 Nov 2017 14:47:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPElPnd068069; Sat, 25 Nov 2017 14:47:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711251447.vAPElPnd068069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Nov 2017 14: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: r326188 - 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: 326188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Nov 2017 14:47:26 -0000 Author: kib Date: Sat Nov 25 14:47:24 2017 New Revision: 326188 URL: https://svnweb.freebsd.org/changeset/base/326188 Log: MFC r326098: Return different error code for the guard page layout violation. PR: 223732 Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Sat Nov 25 09:47:31 2017 (r326187) +++ stable/11/sys/vm/vm_map.c Sat Nov 25 14:47:24 2017 (r326188) @@ -3610,12 +3610,13 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, KASSERT(orient != (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP), ("bi-dir stack")); - sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; if (addrbos < vm_map_min(map) || - addrbos > vm_map_max(map) || - addrbos + max_ssize < addrbos || - sgp >= max_ssize) - return (KERN_NO_SPACE); + addrbos + max_ssize > vm_map_max(map) || + addrbos + max_ssize <= addrbos) + return (KERN_INVALID_ADDRESS); + sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; + if (sgp >= max_ssize) + return (KERN_INVALID_ARGUMENT); init_ssize = growsize; if (max_ssize < init_ssize + sgp)