From owner-svn-src-head@freebsd.org Sun Aug 21 00:04:04 2016 Return-Path: Delivered-To: svn-src-head@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 6543ABC16F4; Sun, 21 Aug 2016 00:04:04 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 2468B1CEF; Sun, 21 Aug 2016 00:04:04 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbGF6-000D9f-CD; Sun, 21 Aug 2016 03:04:00 +0300 Date: Sun, 21 Aug 2016 03:04:00 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160821000400.GY8192@zxy.spb.ru> References: <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 00:04:04 -0000 On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: > On 20/08/16 23:05, Slawa Olhovchenkov wrote: > > I am think this substitution is very bad idea (by design). > > Also, on transmit side this is must be irrelevant on received L2 > > header (and this in many cases this is will be L2 unicast packet). For > > other cases packet will be created on host and don't have any received > > information. > > > > Whilst I agree with your concerns about multipoint, I support the > motivation behind Ryan's original change: optimize the common case. Oh, common case... I am have pmc profiling for TCP output and see on this SVG picture and don't find any simple way. You want to watch too? What benefits from this optimisation? I both cases we need check IP DST for broadcast address. This check my break some network setup (we already have broken tunnel interface in case of overlap remote inner and outer tunnel address). > On the other hand, I'm suggesting a slight extension to it -- one which > would probably require adoption across some L2-exposed subsystems, or > anywhere which might reinterpret an M_BCAST from re-entrant > encapsulation (i.e. I receive a UDP broadcast packet, but my VPN daemon > then decides it needs to be NATted and forwarded somewhere else). I think this is seperate task and forward or drop must be controlled separatly. In some cases broadcast must be forwarded. > Whilst I believe the scope for problems like this are limited (and > perhaps to Netgraph permutations), I do believe they exist, and should > be defensively coded for. > > And: If, the logic for this can be factored out into one additional bit, > in a conditional branch (or small set of those) in terms of delta to the > existing FreeBSD data plane path -- i.e. my suggestion; > > Then: we should be able to preserve correctness for multipoint > configurations, without sacrificing performance. I am fear about perforance impact, code complexy and network setup break. > Or, a possible tie-breaker: > > ...we ensure that M_BCAST is cleared at all times before possible > re-entry, and use a separate M_BCASTL3 bit. Let the ethernet protocols > decide themselves if re-entered about M_BCAST based on DMAC. And set only by NIC? By performance view. > > On received side for host relaing on L2 information for accepting > > packet as host targeting sound like security hole. > > > > In router case receiving broadcast packet in any way need additional > > check for dst IP address (host part is all zero or all one? what about > > handling this broadcast type (RFC talk about conroling variation of > > this)? what about sysctl control of receiving routed broadcast > > packets? what about handling 255.255.255.255?) > > I believe most of this is already special-cased in ip_fastfwd.c (which > gnn@ of course has merged, as it's full of sensible FIB-like operators > which most router forwarding planes adopt on *their* IP input paths up > to the forwarding decision), assuming the Ethernet input path colours > packets with the right flags. Yes. And MAC broadcast independed. And can't be depend on this. > Although, no direct distinction between IPv4 directed or undirected > broadcast is made, until that code (or a full rtalloc()) is hit. I am just about RFC1812 4.2.2.11 "a router MAY have a configuration option to prevent reception of these [Directed Broadcast] packets" and absent like options for Limited broadcast packets. > In the past, I have tried to "hack around" the issue on the output > (send) side, by introducing IP_ONESBCAST from BSD/OS. > > The fundamental problem there is that the IPv4 socket APIs were never > designed to deal with 'with link' as well as 'with destination' > particularly well -- i.e. to direct traffic to a particular host, with > correct L2 resolution, but over a specific choice of link (or even, > class of link). For load sharing over multiple NIC in one subnet? > So, for correct behaviour when handling packets like this, the XORP FEA > and libfeaclient frameworks would attempt to fully-bind control sockets > requiring broadcast input where possible (OLSR being one candidate, but > there are also other protocols requiring them). > > > In any way, this is irrelevant to L2 broadcast MAC and present L2 > > broadcast flags. > > On the contrary, I believe in teasing as much explanation about the > Layer 2 Soup 'out there' and how in FreeBSD it is treated, as this lends > much background to the original problem posed by Ryan's change, to those > who may not be from a primarily networking-oriented background. From owner-svn-src-head@freebsd.org Sun Aug 21 00:48:42 2016 Return-Path: Delivered-To: svn-src-head@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 B9AC1BB9032; Sun, 21 Aug 2016 00:48:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8D590116F; Sun, 21 Aug 2016 00:48:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7L0mfn5021049; Sun, 21 Aug 2016 00:48:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7L0mfS3021048; Sun, 21 Aug 2016 00:48:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608210048.u7L0mfS3021048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 21 Aug 2016 00:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304552 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 00:48:42 -0000 Author: adrian Date: Sun Aug 21 00:48:41 2016 New Revision: 304552 URL: https://svnweb.freebsd.org/changeset/base/304552 Log: [mips] add support for the "creative" GNU extensions and IRIX hilarity around MIPS LO16/HI16 relocations. This was .. an interesting headache. There are two halves: * The earlier IRIX stuff (yes, early) occasionally would do dead code removal and generate multiple consecutive LO16 entries. If this is done for REL entries then it's fine - there's no state kept between them. But gcc 5.x seems to do this for RELA entries. eg: HI1 LO1 HI2 LO2 LO3 HI4 LO4 .. in this instance, LO2 should affect HI2, but LO3 doesn't at all affect anything. The matching HI3 was in code that was deleted as "dead code". Then, the next one: * A "GCC extension" allows for multiple HI entries before a LO entry; and all of those HI entries use the first LO entry as their basis for RELA offset calculations. It does this so GCC can also do dead code deletion without necessarily having to geneate fake relocation entries for balanced HI/LO RELA entries. eg: HI1 LO1 HI2 HI3 HI4 LO4 LO5 HI6 LO6 LO7 in this instance, HI{2,3,4} are the same relocation as LO4 (eg .bss) and need to be buffered until LO4 - then the RELA offset is applied from LO4 to HI{2,3,4} calculations. /And/, the AHL from HI4 is used during the LO4 relocation calculation, just like in the normal (ie, before this commit) implementation. Then, LO5 doesn't trigger anything - the HI "buffer" is empty, so there are no HI relocations to flush out. HI6/LO6 are normal, and LO7 doesn't trigger any HI updates. Tested: * AR9344 SoC, kernel modules, using gcc-5.3 (mips-gcc-5.3.0 package) Notes: * Yes, I do feel dirty having written this code. Reviewed by: imp (after a handful of "this should be on fire" moments wrt gcc and this code) Modified: head/sys/mips/mips/elf_machdep.c Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Sun Aug 21 00:00:04 2016 (r304551) +++ head/sys/mips/mips/elf_machdep.c Sun Aug 21 00:48:41 2016 (r304552) @@ -161,6 +161,136 @@ elf32_dump_thread(struct thread *td __un } #endif +/* + * The following MIPS relocation code for tracking multiple + * consecutive HI32/LO32 entries is because of the following: + * + * https://dmz-portal.mips.com/wiki/MIPS_relocation_types + * + * === + * + * + R_MIPS_HI16 + * + * An R_MIPS_HI16 must be followed eventually by an associated R_MIPS_LO16 + * relocation record in the same SHT_REL section. The contents of the two + * fields to be relocated are combined to form a full 32-bit addend AHL. + * An R_MIPS_LO16 entry which does not immediately follow a R_MIPS_HI16 is + * combined with the most recent one encountered, i.e. multiple R_MIPS_LO16 + * entries may be associated with a single R_MIPS_HI16. Use of these + * relocation types in a SHT_REL section is discouraged and may be + * forbidden to avoid this complication. + * + * A GNU extension allows multiple R_MIPS_HI16 records to share the same + * R_MIPS_LO16 relocation record(s). The association works like this within + * a single relocation section: + * + * + From the beginning of the section moving to the end of the section, + * until R_MIPS_LO16 is not found each found R_MIPS_HI16 relocation will + * be associated with the first R_MIPS_LO16. + * + * + Until another R_MIPS_HI16 record is found all found R_MIPS_LO16 + * relocations found are associated with the last R_MIPS_HI16. + * + * === + * + * This is so gcc can do dead code detection/removal without having to + * generate HI/LO pairs even if one of them would be deleted. + * + * So, the summary is: + * + * + A HI16 entry must occur before any LO16 entries; + * + Multiple consecutive HI16 RELA entries need to be buffered until the + * first LO16 RELA entry occurs - and then all HI16 RELA relocations use + * the offset in the LOW16 RELA for calculating their offsets; + * + The last HI16 RELA entry before a LO16 RELA entry is used (the AHL) + * for the first subsequent LO16 calculation; + * + If multiple consecutive LO16 RELA entries occur, only the first + * LO16 RELA entry triggers an update of buffered HI16 RELA entries; + * any subsequent LO16 RELA entry before another HI16 RELA entry will + * not cause any further updates to the HI16 RELA entries. + * + * Additionally, flush out any outstanding HI16 entries that don't have + * a LO16 entry in case some garbage entries are left in the file. + */ + +struct mips_tmp_reloc; +struct mips_tmp_reloc { + struct mips_tmp_reloc *next; + + Elf_Addr ahl; + Elf32_Addr *where_hi16; +}; + +static struct mips_tmp_reloc *ml = NULL; + +/* + * Add a temporary relocation (ie, a HI16 reloc type.) + */ +static int +mips_tmp_reloc_add(Elf_Addr ahl, Elf32_Addr *where_hi16) +{ + struct mips_tmp_reloc *r; + + r = malloc(sizeof(struct mips_tmp_reloc), M_TEMP, M_NOWAIT); + if (r == NULL) { + printf("%s: failed to malloc\n", __func__); + return (0); + } + + r->ahl = ahl; + r->where_hi16 = where_hi16; + r->next = ml; + ml = r; + + return (1); +} + +/* + * Flush the temporary relocation list. + * + * This should be done after a file is completely loaded + * so no stale relocations exist to confuse the next + * load. + */ +static void +mips_tmp_reloc_flush(void) +{ + struct mips_tmp_reloc *r, *rn; + + r = ml; + ml = NULL; + while (r != NULL) { + rn = r->next; + free(r, M_TEMP); + r = rn; + } +} + +/* + * Get an entry from the reloc list; or NULL if we've run out. + */ +static struct mips_tmp_reloc * +mips_tmp_reloc_get(void) +{ + struct mips_tmp_reloc *r; + + r = ml; + if (r == NULL) + return (NULL); + ml = ml->next; + return (r); +} + +/* + * Free a relocation entry. + */ +static void +mips_tmp_reloc_free(struct mips_tmp_reloc *r) +{ + + free(r, M_TEMP); +} + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, @@ -170,15 +300,13 @@ elf_reloc_internal(linker_file_t lf, Elf Elf_Addr addr; Elf_Addr addend = (Elf_Addr)0; Elf_Word rtype = (Elf_Word)0, symidx; + struct mips_tmp_reloc *r; const Elf_Rel *rel = NULL; const Elf_Rela *rela = NULL; int error; - /* - * Stash R_MIPS_HI16 info so we can use it when processing R_MIPS_LO16 - */ - static Elf_Addr ahl; - static Elf32_Addr *where_hi16; + /* Store the last seen ahl from a HI16 for LO16 processing */ + static Elf_Addr last_ahl; switch (type) { case ELF_RELOC_REL: @@ -248,6 +376,24 @@ elf_reloc_internal(linker_file_t lf, Elf *(Elf64_Addr*)where = addr; break; + /* + * Handle the two GNU extension cases: + * + * + Multiple HI16s followed by a LO16, and + * + A HI16 followed by multiple LO16s. + * + * The former is tricky - the HI16 relocations need + * to be buffered until a LO16 occurs, at which point + * each HI16 is replayed against the LO16 relocation entry + * (with the relevant overflow information.) + * + * The latter should be easy to handle - when the + * first LO16 is seen, write out and flush the + * HI16 buffer. Any subsequent LO16 entries will + * find a blank relocation buffer. + * + */ + case R_MIPS_HI16: /* ((AHL + S) - ((short)(AHL + S)) >> 16 */ if (rela != NULL) { error = lookup(lf, symidx, 1, &addr); @@ -256,10 +402,24 @@ elf_reloc_internal(linker_file_t lf, Elf addr += addend; *where &= 0xffff0000; *where |= ((((long long) addr + 0x8000LL) >> 16) & 0xffff); - } - else { - ahl = addend << 16; - where_hi16 = where; + } else { + /* + * Add a temporary relocation to the list; + * will pop it off / free the list when + * we've found a suitable HI16. + */ + if (mips_tmp_reloc_add(addend << 16, where) == 0) + return (-1); + /* + * Track the last seen HI16 AHL for use by + * the first LO16 AHL calculation. + * + * The assumption is any intermediary deleted + * LO16's were optimised out, so the last + * HI16 before the LO16 is the "true" relocation + * entry to use for that LO16 write. + */ + last_ahl = addend << 16; } break; @@ -271,21 +431,48 @@ elf_reloc_internal(linker_file_t lf, Elf addr += addend; *where &= 0xffff0000; *where |= addr & 0xffff; - } - else { - ahl += (int16_t)addend; + } else { + Elf_Addr tmp_ahl; + Elf_Addr tmp_addend; + + tmp_ahl = last_ahl + (int16_t) addend; error = lookup(lf, symidx, 1, &addr); if (error != 0) return (-1); - addend &= 0xffff0000; - addend |= (uint16_t)(ahl + addr); - *where = addend; - - addend = *where_hi16; - addend &= 0xffff0000; - addend |= ((ahl + addr) - (int16_t)(ahl + addr)) >> 16; - *where_hi16 = addend; + tmp_addend = addend & 0xffff0000; + + /* Use the last seen ahl for calculating addend */ + tmp_addend |= (uint16_t)(tmp_ahl + addr); + *where = tmp_addend; + + /* + * This logic implements the "we saw multiple HI16 + * before a LO16" assignment /and/ "we saw multiple + * LO16s". + * + * Multiple LO16s will be handled as a blank + * relocation list. + * + * Multple HI16's are iterated over here. + */ + while ((r = mips_tmp_reloc_get()) != NULL) { + Elf_Addr rahl; + + /* + * We have the ahl from the HI16 entry, so + * offset it by the 16 bits of the low ahl. + */ + rahl = r->ahl; + rahl += (int16_t) addend; + + tmp_addend = *(r->where_hi16); + tmp_addend &= 0xffff0000; + tmp_addend |= ((rahl + addr) - + (int16_t)(rahl + addr)) >> 16; + *(r->where_hi16) = tmp_addend; + mips_tmp_reloc_free(r); + } } break; @@ -342,6 +529,9 @@ elf_cpu_load_file(linker_file_t lf __unu */ mips_icache_sync_all(); + /* Flush outstanding relocations */ + mips_tmp_reloc_flush(); + return (0); } From owner-svn-src-head@freebsd.org Sun Aug 21 04:46:15 2016 Return-Path: Delivered-To: svn-src-head@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 23EE5BB9717; Sun, 21 Aug 2016 04:46:15 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCEEB1788; Sun, 21 Aug 2016 04:46:14 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x230.google.com with SMTP id l203so112735270oib.1; Sat, 20 Aug 2016 21:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dU86YZZkjR6Dgn4h7xWpT/M8kGBvhypC6xE0V9aJSmw=; b=gAy8MJU1E/dZJFM00DLx4HnUW1W9T73FUIQIVMNOqoCnQ2NmGNnPi+FWUzWqBLhpAo nkZetmB8RNk4v/zV3gUqNLlRflG8flTuTjOKn9STBD6ZAZCoQzIwW+89/RGNzEH5cENE Znz0tl45EmFMKG4GC3TOOPE9i/a4DyEy8Vj8K6Sgtlcp0Nc1oHwRFrvDNiWYjDfspRYP 7pCz/w2eDmv8OzBQ4HvPr8rC1ifn5R3+95abFSPf6YMIP3R5Fxc0RRppYriq9LOASwGk Vo93JKghauboRr7COf0nfXn5uYHtpsF2v3TSVDcwFI5weOIjXjpR+4W3tVfZ05dDeMEk ymSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dU86YZZkjR6Dgn4h7xWpT/M8kGBvhypC6xE0V9aJSmw=; b=IXMNBk8s3AZfsQhGbtasuOJ3AWthMyXzU1JGxbQGG5xaDm/0nmiunRCQeJ8FQCqgRw qRLb43I/ElaH6qkm7zjh1knbW55118nCqkaLyJBQOcADCvR9aFDu2hj1c5PZWeRR+jPU yyNXukg75Q0ktlm7O06ZKtvd1kVY+nGZhtMAiMEmcCTqqFVZPajTbaYlISW7cvZ1J9Cw uJvADPpxZS4F+2uumW/GxdC2pwin/Zc71aAu9zsBeQnZIxEtxpE9Io4AaHRHl1O7RXJG b2U4IkaLAUKD+iiYf+RMvccvAGv8ymrZmymwvggjM8ENy1eWlbmUMkUAKaT3oQfzLigx if5g== X-Gm-Message-State: AEkooutIpRKOTn8wskuJj4k0OhMUAYwUSRJ3JpltELa/IEUUjyq0Q9nJWS/sv0pI3tY/uHguS0B0hzsvo6V5zg== X-Received: by 10.202.195.1 with SMTP id t1mr9404398oif.144.1471754773975; Sat, 20 Aug 2016 21:46:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.11.142 with HTTP; Sat, 20 Aug 2016 21:46:13 -0700 (PDT) In-Reply-To: <201608192213.u7JMD12W028152@repo.freebsd.org> References: <201608192213.u7JMD12W028152@repo.freebsd.org> From: Benjamin Kaduk Date: Sat, 20 Aug 2016 23:46:13 -0500 Message-ID: Subject: Re: svn commit: r304505 - head/release/doc/en_US.ISO8859-1/hardware To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 04:46:15 -0000 On Fri, Aug 19, 2016 at 5:13 PM, John Baldwin wrote: > Author: jhb > Date: Fri Aug 19 22:13:01 2016 > New Revision: 304505 > URL: https://svnweb.freebsd.org/changeset/base/304505 > > Log: > Remove mentions of the mcd(4), scd(4), and si(4) drivers. > Hmm, looks like ie(4) also needs removal (in order to fix the build)? -Ben From owner-svn-src-head@freebsd.org Sun Aug 21 07:28:40 2016 Return-Path: Delivered-To: svn-src-head@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 4F8A5BC0688; Sun, 21 Aug 2016 07:28:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06186165A; Sun, 21 Aug 2016 07:28:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7L7SdVX068205; Sun, 21 Aug 2016 07:28:39 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7L7Scqt068201; Sun, 21 Aug 2016 07:28:38 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608210728.u7L7Scqt068201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 07:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304554 - in head/sys: conf contrib/cloudabi modules/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 07:28:40 -0000 Author: ed Date: Sun Aug 21 07:28:38 2016 New Revision: 304554 URL: https://svnweb.freebsd.org/changeset/base/304554 Log: Rewrite the vDSOs for CloudABI in assembly. The reason why the old vDSOs were written in C using inline assembly was purely because they were embedded in the C library directly as static inline functions. This was practical during development, because it meant you could invoke system calls without any library dependencies. The vDSO was simply a copy of these functions. Now that we require the use of the vDSO, there is no longer any need for embedding them in C code directly. Rewriting them in assembly has the advantage that they are closer to ideal (less useless branching, less assumptions about registers remaining unclobbered by the kernel, etc). They are also easier to build, as they no longer depend on the C type information for CloudABI. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S (contents, props changed) head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S (contents, props changed) Deleted: head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.c head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.arm64 head/sys/modules/cloudabi64/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Aug 21 05:08:37 2016 (r304553) +++ head/sys/conf/files.amd64 Sun Aug 21 07:28:38 2016 (r304554) @@ -9,8 +9,8 @@ # # cloudabi64_vdso.o optional compat_cloudabi64 \ - dependency "$S/contrib/cloudabi/cloudabi_vdso_x86_64.c" \ - compile-with "${CC} -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s -D_KERNEL -I. -I$S -I$S/contrib/cloudabi -O2 -fomit-frame-pointer $S/contrib/cloudabi/cloudabi_vdso_x86_64.c -o ${.TARGET}" \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_x86_64.S" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s $S/contrib/cloudabi/cloudabi_vdso_x86_64.S -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "cloudabi64_vdso.o" # Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Aug 21 05:08:37 2016 (r304553) +++ head/sys/conf/files.arm64 Sun Aug 21 07:28:38 2016 (r304554) @@ -1,7 +1,7 @@ # $FreeBSD$ cloudabi64_vdso.o optional compat_cloudabi64 \ - dependency "$S/contrib/cloudabi/cloudabi_vdso_aarch64.c" \ - compile-with "${CC} -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s -D_KERNEL -I. -I$S -I$S/contrib/cloudabi -O2 -fomit-frame-pointer $S/contrib/cloudabi/cloudabi_vdso_aarch64.c -o ${.TARGET}" \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_aarch64.S" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s $S/contrib/cloudabi/cloudabi_vdso_aarch64.S -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "cloudabi64_vdso.o" # Added: head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S Sun Aug 21 07:28:38 2016 (r304554) @@ -0,0 +1,491 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#define ENTRY(name) \ + .text; \ + .p2align 2; \ + .global name; \ + .type name, @function; \ +name: + +#define END(name) .size name, . - name + +ENTRY(cloudabi_sys_clock_res_get) + str x1, [sp, #-8] + mov w8, #0 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_clock_res_get) + +ENTRY(cloudabi_sys_clock_time_get) + str x2, [sp, #-8] + mov w8, #1 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_clock_time_get) + +ENTRY(cloudabi_sys_condvar_signal) + mov w8, #2 + svc #0 + ret +END(cloudabi_sys_condvar_signal) + +ENTRY(cloudabi_sys_fd_close) + mov w8, #3 + svc #0 + ret +END(cloudabi_sys_fd_close) + +ENTRY(cloudabi_sys_fd_create1) + str x1, [sp, #-8] + mov w8, #4 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str w0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_create1) + +ENTRY(cloudabi_sys_fd_create2) + stp x1, x2, [sp, #-16] + mov w8, #5 + svc #0 + ldp x2, x3, [sp, #-16] + b.cs 1f + str w0, [x2] + str w1, [x3] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_create2) + +ENTRY(cloudabi_sys_fd_datasync) + mov w8, #6 + svc #0 + ret +END(cloudabi_sys_fd_datasync) + +ENTRY(cloudabi_sys_fd_dup) + str x1, [sp, #-8] + mov w8, #7 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str w0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_dup) + +ENTRY(cloudabi_sys_fd_pread) + str x4, [sp, #-8] + mov w8, #8 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_pread) + +ENTRY(cloudabi_sys_fd_pwrite) + str x4, [sp, #-8] + mov w8, #9 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_pwrite) + +ENTRY(cloudabi_sys_fd_read) + str x3, [sp, #-8] + mov w8, #10 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_read) + +ENTRY(cloudabi_sys_fd_replace) + mov w8, #11 + svc #0 + ret +END(cloudabi_sys_fd_replace) + +ENTRY(cloudabi_sys_fd_seek) + str x3, [sp, #-8] + mov w8, #12 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_seek) + +ENTRY(cloudabi_sys_fd_stat_get) + mov w8, #13 + svc #0 + ret +END(cloudabi_sys_fd_stat_get) + +ENTRY(cloudabi_sys_fd_stat_put) + mov w8, #14 + svc #0 + ret +END(cloudabi_sys_fd_stat_put) + +ENTRY(cloudabi_sys_fd_sync) + mov w8, #15 + svc #0 + ret +END(cloudabi_sys_fd_sync) + +ENTRY(cloudabi_sys_fd_write) + str x3, [sp, #-8] + mov w8, #16 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_fd_write) + +ENTRY(cloudabi_sys_file_advise) + mov w8, #17 + svc #0 + ret +END(cloudabi_sys_file_advise) + +ENTRY(cloudabi_sys_file_allocate) + mov w8, #18 + svc #0 + ret +END(cloudabi_sys_file_allocate) + +ENTRY(cloudabi_sys_file_create) + mov w8, #19 + svc #0 + ret +END(cloudabi_sys_file_create) + +ENTRY(cloudabi_sys_file_link) + mov w8, #20 + svc #0 + ret +END(cloudabi_sys_file_link) + +ENTRY(cloudabi_sys_file_open) + str x5, [sp, #-8] + mov w8, #21 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str w0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_file_open) + +ENTRY(cloudabi_sys_file_readdir) + str x4, [sp, #-8] + mov w8, #22 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_file_readdir) + +ENTRY(cloudabi_sys_file_readlink) + str x5, [sp, #-8] + mov w8, #23 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_file_readlink) + +ENTRY(cloudabi_sys_file_rename) + mov w8, #24 + svc #0 + ret +END(cloudabi_sys_file_rename) + +ENTRY(cloudabi_sys_file_stat_fget) + mov w8, #25 + svc #0 + ret +END(cloudabi_sys_file_stat_fget) + +ENTRY(cloudabi_sys_file_stat_fput) + mov w8, #26 + svc #0 + ret +END(cloudabi_sys_file_stat_fput) + +ENTRY(cloudabi_sys_file_stat_get) + mov w8, #27 + svc #0 + ret +END(cloudabi_sys_file_stat_get) + +ENTRY(cloudabi_sys_file_stat_put) + mov w8, #28 + svc #0 + ret +END(cloudabi_sys_file_stat_put) + +ENTRY(cloudabi_sys_file_symlink) + mov w8, #29 + svc #0 + ret +END(cloudabi_sys_file_symlink) + +ENTRY(cloudabi_sys_file_unlink) + mov w8, #30 + svc #0 + ret +END(cloudabi_sys_file_unlink) + +ENTRY(cloudabi_sys_lock_unlock) + mov w8, #31 + svc #0 + ret +END(cloudabi_sys_lock_unlock) + +ENTRY(cloudabi_sys_mem_advise) + mov w8, #32 + svc #0 + ret +END(cloudabi_sys_mem_advise) + +ENTRY(cloudabi_sys_mem_lock) + mov w8, #33 + svc #0 + ret +END(cloudabi_sys_mem_lock) + +ENTRY(cloudabi_sys_mem_map) + str x6, [sp, #-8] + mov w8, #34 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_mem_map) + +ENTRY(cloudabi_sys_mem_protect) + mov w8, #35 + svc #0 + ret +END(cloudabi_sys_mem_protect) + +ENTRY(cloudabi_sys_mem_sync) + mov w8, #36 + svc #0 + ret +END(cloudabi_sys_mem_sync) + +ENTRY(cloudabi_sys_mem_unlock) + mov w8, #37 + svc #0 + ret +END(cloudabi_sys_mem_unlock) + +ENTRY(cloudabi_sys_mem_unmap) + mov w8, #38 + svc #0 + ret +END(cloudabi_sys_mem_unmap) + +ENTRY(cloudabi_sys_poll) + str x3, [sp, #-8] + mov w8, #39 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_poll) + +ENTRY(cloudabi_sys_poll_fd) + str x6, [sp, #-8] + mov w8, #40 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str x0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_poll_fd) + +ENTRY(cloudabi_sys_proc_exec) + mov w8, #41 + svc #0 + ret +END(cloudabi_sys_proc_exec) + +ENTRY(cloudabi_sys_proc_exit) + mov w8, #42 + svc #0 +END(cloudabi_sys_proc_exit) + +ENTRY(cloudabi_sys_proc_fork) + stp x0, x1, [sp, #-16] + mov w8, #43 + svc #0 + ldp x2, x3, [sp, #-16] + b.cs 1f + str w0, [x2] + str w1, [x3] + mov w0, wzr +1: + ret +END(cloudabi_sys_proc_fork) + +ENTRY(cloudabi_sys_proc_raise) + mov w8, #44 + svc #0 + ret +END(cloudabi_sys_proc_raise) + +ENTRY(cloudabi_sys_random_get) + mov w8, #45 + svc #0 + ret +END(cloudabi_sys_random_get) + +ENTRY(cloudabi_sys_sock_accept) + str x2, [sp, #-8] + mov w8, #46 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str w0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_sock_accept) + +ENTRY(cloudabi_sys_sock_bind) + mov w8, #47 + svc #0 + ret +END(cloudabi_sys_sock_bind) + +ENTRY(cloudabi_sys_sock_connect) + mov w8, #48 + svc #0 + ret +END(cloudabi_sys_sock_connect) + +ENTRY(cloudabi_sys_sock_listen) + mov w8, #49 + svc #0 + ret +END(cloudabi_sys_sock_listen) + +ENTRY(cloudabi_sys_sock_recv) + mov w8, #50 + svc #0 + ret +END(cloudabi_sys_sock_recv) + +ENTRY(cloudabi_sys_sock_send) + mov w8, #51 + svc #0 + ret +END(cloudabi_sys_sock_send) + +ENTRY(cloudabi_sys_sock_shutdown) + mov w8, #52 + svc #0 + ret +END(cloudabi_sys_sock_shutdown) + +ENTRY(cloudabi_sys_sock_stat_get) + mov w8, #53 + svc #0 + ret +END(cloudabi_sys_sock_stat_get) + +ENTRY(cloudabi_sys_thread_create) + str x1, [sp, #-8] + mov w8, #54 + svc #0 + ldr x2, [sp, #-8] + b.cs 1f + str w0, [x2] + mov w0, wzr +1: + ret +END(cloudabi_sys_thread_create) + +ENTRY(cloudabi_sys_thread_exit) + mov w8, #55 + svc #0 +END(cloudabi_sys_thread_exit) + +ENTRY(cloudabi_sys_thread_yield) + mov w8, #56 + svc #0 + ret +END(cloudabi_sys_thread_yield) Added: head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S Sun Aug 21 07:28:38 2016 (r304554) @@ -0,0 +1,511 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#define ENTRY(name) \ + .text; \ + .p2align 4, 0x90; \ + .global name; \ + .type name, @function; \ +name: + +#define END(name) .size name, . - name + +ENTRY(cloudabi_sys_clock_res_get) + push %rsi + mov $0, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_clock_res_get) + +ENTRY(cloudabi_sys_clock_time_get) + push %rdx + mov $1, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_clock_time_get) + +ENTRY(cloudabi_sys_condvar_signal) + mov $2, %eax + syscall + ret +END(cloudabi_sys_condvar_signal) + +ENTRY(cloudabi_sys_fd_close) + mov $3, %eax + syscall + ret +END(cloudabi_sys_fd_close) + +ENTRY(cloudabi_sys_fd_create1) + push %rsi + mov $4, %eax + syscall + pop %rcx + jc 1f + mov %eax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_create1) + +ENTRY(cloudabi_sys_fd_create2) + push %rsi + push %rdx + mov $5, %eax + syscall + pop %rsi + pop %rcx + jc 1f + mov %eax, (%rcx) + mov %edx, (%rsi) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_create2) + +ENTRY(cloudabi_sys_fd_datasync) + mov $6, %eax + syscall + ret +END(cloudabi_sys_fd_datasync) + +ENTRY(cloudabi_sys_fd_dup) + push %rsi + mov $7, %eax + syscall + pop %rcx + jc 1f + mov %eax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_dup) + +ENTRY(cloudabi_sys_fd_pread) + mov %rcx, %r10 + push %r8 + mov $8, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_pread) + +ENTRY(cloudabi_sys_fd_pwrite) + mov %rcx, %r10 + push %r8 + mov $9, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_pwrite) + +ENTRY(cloudabi_sys_fd_read) + push %rcx + mov $10, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_read) + +ENTRY(cloudabi_sys_fd_replace) + mov $11, %eax + syscall + ret +END(cloudabi_sys_fd_replace) + +ENTRY(cloudabi_sys_fd_seek) + push %rcx + mov $12, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_seek) + +ENTRY(cloudabi_sys_fd_stat_get) + mov $13, %eax + syscall + ret +END(cloudabi_sys_fd_stat_get) + +ENTRY(cloudabi_sys_fd_stat_put) + mov $14, %eax + syscall + ret +END(cloudabi_sys_fd_stat_put) + +ENTRY(cloudabi_sys_fd_sync) + mov $15, %eax + syscall + ret +END(cloudabi_sys_fd_sync) + +ENTRY(cloudabi_sys_fd_write) + push %rcx + mov $16, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_write) + +ENTRY(cloudabi_sys_file_advise) + mov %rcx, %r10 + mov $17, %eax + syscall + ret +END(cloudabi_sys_file_advise) + +ENTRY(cloudabi_sys_file_allocate) + mov $18, %eax + syscall + ret +END(cloudabi_sys_file_allocate) + +ENTRY(cloudabi_sys_file_create) + mov %rcx, %r10 + mov $19, %eax + syscall + ret +END(cloudabi_sys_file_create) + +ENTRY(cloudabi_sys_file_link) + mov %rcx, %r10 + mov $20, %eax + syscall + ret +END(cloudabi_sys_file_link) + +ENTRY(cloudabi_sys_file_open) + mov %rcx, %r10 + push %r9 + mov $21, %eax + syscall + pop %rcx + jc 1f + mov %eax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_file_open) + +ENTRY(cloudabi_sys_file_readdir) + mov %rcx, %r10 + push %r8 + mov $22, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_file_readdir) + +ENTRY(cloudabi_sys_file_readlink) + mov %rcx, %r10 + push %r9 + mov $23, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_file_readlink) + +ENTRY(cloudabi_sys_file_rename) + mov %rcx, %r10 + mov $24, %eax + syscall + ret +END(cloudabi_sys_file_rename) + +ENTRY(cloudabi_sys_file_stat_fget) + mov $25, %eax + syscall + ret +END(cloudabi_sys_file_stat_fget) + +ENTRY(cloudabi_sys_file_stat_fput) + mov $26, %eax + syscall + ret +END(cloudabi_sys_file_stat_fput) + +ENTRY(cloudabi_sys_file_stat_get) + mov %rcx, %r10 + mov $27, %eax + syscall + ret +END(cloudabi_sys_file_stat_get) + +ENTRY(cloudabi_sys_file_stat_put) + mov %rcx, %r10 + mov $28, %eax + syscall + ret +END(cloudabi_sys_file_stat_put) + +ENTRY(cloudabi_sys_file_symlink) + mov %rcx, %r10 + mov $29, %eax + syscall + ret +END(cloudabi_sys_file_symlink) + +ENTRY(cloudabi_sys_file_unlink) + mov %rcx, %r10 + mov $30, %eax + syscall + ret +END(cloudabi_sys_file_unlink) + +ENTRY(cloudabi_sys_lock_unlock) + mov $31, %eax + syscall + ret +END(cloudabi_sys_lock_unlock) + +ENTRY(cloudabi_sys_mem_advise) + mov $32, %eax + syscall + ret +END(cloudabi_sys_mem_advise) + +ENTRY(cloudabi_sys_mem_lock) + mov $33, %eax + syscall + ret +END(cloudabi_sys_mem_lock) + +ENTRY(cloudabi_sys_mem_map) + mov %rcx, %r10 + mov $34, %eax + syscall + jc 1f + mov 8(%rsp), %rcx + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_mem_map) + +ENTRY(cloudabi_sys_mem_protect) + mov $35, %eax + syscall + ret +END(cloudabi_sys_mem_protect) + +ENTRY(cloudabi_sys_mem_sync) + mov $36, %eax + syscall + ret +END(cloudabi_sys_mem_sync) + +ENTRY(cloudabi_sys_mem_unlock) + mov $37, %eax + syscall + ret +END(cloudabi_sys_mem_unlock) + +ENTRY(cloudabi_sys_mem_unmap) + mov $38, %eax + syscall + ret +END(cloudabi_sys_mem_unmap) + +ENTRY(cloudabi_sys_poll) + push %rcx + mov $39, %eax + syscall + pop %rcx + jc 1f + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_poll) + +ENTRY(cloudabi_sys_poll_fd) + mov %rcx, %r10 + mov $40, %eax + syscall + jc 1f + mov 8(%rsp), %rcx + mov %rax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_poll_fd) + +ENTRY(cloudabi_sys_proc_exec) + mov %rcx, %r10 + mov $41, %eax + syscall + ret +END(cloudabi_sys_proc_exec) + +ENTRY(cloudabi_sys_proc_exit) + mov $42, %eax + syscall +END(cloudabi_sys_proc_exit) + +ENTRY(cloudabi_sys_proc_fork) + push %rdi + push %rsi + mov $43, %eax + syscall + pop %rsi + pop %rcx + jc 1f + mov %eax, (%rcx) + mov %edx, (%rsi) + xor %eax, %eax +1: + ret +END(cloudabi_sys_proc_fork) + +ENTRY(cloudabi_sys_proc_raise) + mov $44, %eax + syscall + ret +END(cloudabi_sys_proc_raise) + +ENTRY(cloudabi_sys_random_get) + mov $45, %eax + syscall + ret +END(cloudabi_sys_random_get) + +ENTRY(cloudabi_sys_sock_accept) + push %rdx + mov $46, %eax + syscall + pop %rcx + jc 1f + mov %eax, (%rcx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_sock_accept) + +ENTRY(cloudabi_sys_sock_bind) + mov %rcx, %r10 + mov $47, %eax + syscall + ret +END(cloudabi_sys_sock_bind) + +ENTRY(cloudabi_sys_sock_connect) + mov %rcx, %r10 + mov $48, %eax + syscall + ret +END(cloudabi_sys_sock_connect) + +ENTRY(cloudabi_sys_sock_listen) + mov $49, %eax + syscall + ret +END(cloudabi_sys_sock_listen) + +ENTRY(cloudabi_sys_sock_recv) + mov $50, %eax + syscall + ret +END(cloudabi_sys_sock_recv) + +ENTRY(cloudabi_sys_sock_send) + mov $51, %eax + syscall + ret +END(cloudabi_sys_sock_send) + +ENTRY(cloudabi_sys_sock_shutdown) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Aug 21 07:41:12 2016 Return-Path: Delivered-To: svn-src-head@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 4000EBC0A8F; Sun, 21 Aug 2016 07:41:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C15F1E2B; Sun, 21 Aug 2016 07:41:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7L7fBlp075024; Sun, 21 Aug 2016 07:41:11 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7L7fBnN075023; Sun, 21 Aug 2016 07:41:11 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608210741.u7L7fBnN075023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 07:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304555 - head/sys/compat/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 07:41:12 -0000 Author: ed Date: Sun Aug 21 07:41:11 2016 New Revision: 304555 URL: https://svnweb.freebsd.org/changeset/base/304555 Log: Use memcpy() to copy 64-bit timestamps into the syscall return values. On 32-bit platforms, our 64-bit timestamps need to be split up across two registers. A simple assignment to td_retval[0] will cause the top 32 bits to get lost. By using memcpy(), we will automatically either use 1 or 2 registers depending on the size of register_t. Modified: head/sys/compat/cloudabi/cloudabi_clock.c Modified: head/sys/compat/cloudabi/cloudabi_clock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:28:38 2016 (r304554) +++ head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:41:11 2016 (r304555) @@ -117,7 +117,7 @@ cloudabi_sys_clock_res_get(struct thread error = cloudabi_convert_timespec(&ts, &cts); if (error != 0) return (error); - td->td_retval[0] = cts; + memcpy(td->td_retval, &cts, sizeof(cts)); return (0); } @@ -129,6 +129,6 @@ cloudabi_sys_clock_time_get(struct threa int error; error = cloudabi_clock_time_get(td, uap->clock_id, &ts); - td->td_retval[0] = ts; + memcpy(td->td_retval, &ts, sizeof(ts)); return (error); } From owner-svn-src-head@freebsd.org Sun Aug 21 09:32:21 2016 Return-Path: Delivered-To: svn-src-head@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 7E45DBC1742; Sun, 21 Aug 2016 09:32:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6991994; Sun, 21 Aug 2016 09:32:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7L9WKvN016268; Sun, 21 Aug 2016 09:32:20 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7L9WKbs016267; Sun, 21 Aug 2016 09:32:20 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608210932.u7L9WKbs016267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 09:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304556 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 09:32:21 -0000 Author: ed Date: Sun Aug 21 09:32:20 2016 New Revision: 304556 URL: https://svnweb.freebsd.org/changeset/base/304556 Log: Use the right _MAX constant. Though uio_resid is of type ssize_t, we need to take into account that this source file contains an implementation specific to a certain userspace pointer size. If this file provided 32-bit implementations, this should have used INT32_MAX, even when running a 64-bit kernel. This change has no effect, but is simply in preparation for adding support for running 32-bit CloudABI executables. Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_fd.c Sun Aug 21 07:41:11 2016 (r304555) +++ head/sys/compat/cloudabi64/cloudabi64_fd.c Sun Aug 21 09:32:20 2016 (r304556) @@ -72,7 +72,7 @@ cloudabi64_copyinuio(const cloudabi64_io } iov[i].iov_base = (void *)iovobj.iov_base; iov[i].iov_len = iovobj.iov_len; - if (iov[i].iov_len > SSIZE_MAX - uio->uio_resid) { + if (iov[i].iov_len > INT64_MAX - uio->uio_resid) { free(uio, M_IOV); return (EINVAL); } From owner-svn-src-head@freebsd.org Sun Aug 21 10:52:12 2016 Return-Path: Delivered-To: svn-src-head@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 2F6E8BB9AE4; Sun, 21 Aug 2016 10:52:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 E91F01B4C; Sun, 21 Aug 2016 10:52:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbQMJ-0000dG-9Z; Sun, 21 Aug 2016 13:52:07 +0300 Date: Sun, 21 Aug 2016 13:52:07 +0300 From: Slawa Olhovchenkov To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160821105207.GS22212@zxy.spb.ru> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608210741.u7L7fBnN075023@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 10:52:12 -0000 On Sun, Aug 21, 2016 at 07:41:11AM +0000, Ed Schouten wrote: > Author: ed > Date: Sun Aug 21 07:41:11 2016 > New Revision: 304555 > URL: https://svnweb.freebsd.org/changeset/base/304555 > > Log: > Use memcpy() to copy 64-bit timestamps into the syscall return values. > > On 32-bit platforms, our 64-bit timestamps need to be split up across > two registers. A simple assignment to td_retval[0] will cause the top 32 > bits to get lost. By using memcpy(), we will automatically either use 1 > or 2 registers depending on the size of register_t. > > Modified: > head/sys/compat/cloudabi/cloudabi_clock.c > > Modified: head/sys/compat/cloudabi/cloudabi_clock.c > ============================================================================== > --- head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:28:38 2016 (r304554) > +++ head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:41:11 2016 (r304555) > @@ -117,7 +117,7 @@ cloudabi_sys_clock_res_get(struct thread > error = cloudabi_convert_timespec(&ts, &cts); > if (error != 0) > return (error); > - td->td_retval[0] = cts; > + memcpy(td->td_retval, &cts, sizeof(cts)); > return (0); > } > > @@ -129,6 +129,6 @@ cloudabi_sys_clock_time_get(struct threa > int error; > > error = cloudabi_clock_time_get(td, uap->clock_id, &ts); > - td->td_retval[0] = ts; > + memcpy(td->td_retval, &ts, sizeof(ts)); > return (error); Why do not use more simple solution: *(cloudabi_timestamp_t *)td->td_retval = cts; This is eliminate call to memcpy and allow compiler to use most effeicient way. From owner-svn-src-head@freebsd.org Sun Aug 21 11:32:48 2016 Return-Path: Delivered-To: svn-src-head@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 DF75EBBF658; Sun, 21 Aug 2016 11:32:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6F31D93; Sun, 21 Aug 2016 11:32:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 0C55CD6454C; Sun, 21 Aug 2016 21:32:36 +1000 (AEST) Date: Sun, 21 Aug 2016 21:32:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi In-Reply-To: <20160821105207.GS22212@zxy.spb.ru> Message-ID: <20160821210751.J2219@besplex.bde.org> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=CBc9DcqgLzKOA6Pp88gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 11:32:49 -0000 On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 07:41:11AM +0000, Ed Schouten wrote: >> ... >> Log: >> Use memcpy() to copy 64-bit timestamps into the syscall return values. >> >> On 32-bit platforms, our 64-bit timestamps need to be split up across >> two registers. A simple assignment to td_retval[0] will cause the top 32 >> bits to get lost. By using memcpy(), we will automatically either use 1 >> or 2 registers depending on the size of register_t. >> .. >> Modified: head/sys/compat/cloudabi/cloudabi_clock.c >> ============================================================================== >> --- head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:28:38 2016 (r304554) >> +++ head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:41:11 2016 (r304555) >> @@ -117,7 +117,7 @@ cloudabi_sys_clock_res_get(struct thread >> error = cloudabi_convert_timespec(&ts, &cts); >> if (error != 0) >> return (error); >> - td->td_retval[0] = cts; >> + memcpy(td->td_retval, &cts, sizeof(cts)); >> return (0); >> } >> >> @@ -129,6 +129,6 @@ cloudabi_sys_clock_time_get(struct threa >> int error; >> >> error = cloudabi_clock_time_get(td, uap->clock_id, &ts); >> - td->td_retval[0] = ts; >> + memcpy(td->td_retval, &ts, sizeof(ts)); >> return (error); > > Why do not use more simple solution: Because it doesn't work. > *(cloudabi_timestamp_t *)td->td_retval = cts; > > This is eliminate call to memcpy and allow compiler to use most > effeicient way. memcpy() is the most efficient way (except for the kernel pessimization of losing builtin memcpy with -ffreestanding 15 years ago and not bringing it back). *(foo_t *)asks for alignment bugs. We have already fixed lots of these bugs for copying struct timevals in places like ping.c. Compilers warn about misalignment when certain warnings are enabled, but only on arches where misalignment is more than a pessimization. There is no reason why td_retval would be always aligned on these arches. Alignment of 64-bit types on 32-bit arches is usually so unimportant that even int32_t is not required to be aligned by the ABI, and there is no point in aligning td_retval specially unless you also do it for a large fraction of 64-bit integers in the kernel, and there are negative points for doing that. Bruce From owner-svn-src-head@freebsd.org Sun Aug 21 12:00:20 2016 Return-Path: Delivered-To: svn-src-head@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 915ADBC002D; Sun, 21 Aug 2016 12:00:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 55B1A1B26; Sun, 21 Aug 2016 12:00:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbRQG-00024K-C3; Sun, 21 Aug 2016 15:00:16 +0300 Date: Sun, 21 Aug 2016 15:00:16 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160821120016.GZ8192@zxy.spb.ru> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160821210751.J2219@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 12:00:20 -0000 On Sun, Aug 21, 2016 at 09:32:35PM +1000, Bruce Evans wrote: > On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > > > On Sun, Aug 21, 2016 at 07:41:11AM +0000, Ed Schouten wrote: > >> ... > >> Log: > >> Use memcpy() to copy 64-bit timestamps into the syscall return values. > >> > >> On 32-bit platforms, our 64-bit timestamps need to be split up across > >> two registers. A simple assignment to td_retval[0] will cause the top 32 > >> bits to get lost. By using memcpy(), we will automatically either use 1 > >> or 2 registers depending on the size of register_t. > >> .. > >> Modified: head/sys/compat/cloudabi/cloudabi_clock.c > >> ============================================================================== > >> --- head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:28:38 2016 (r304554) > >> +++ head/sys/compat/cloudabi/cloudabi_clock.c Sun Aug 21 07:41:11 2016 (r304555) > >> @@ -117,7 +117,7 @@ cloudabi_sys_clock_res_get(struct thread > >> error = cloudabi_convert_timespec(&ts, &cts); > >> if (error != 0) > >> return (error); > >> - td->td_retval[0] = cts; > >> + memcpy(td->td_retval, &cts, sizeof(cts)); > >> return (0); > >> } > >> > >> @@ -129,6 +129,6 @@ cloudabi_sys_clock_time_get(struct threa > >> int error; > >> > >> error = cloudabi_clock_time_get(td, uap->clock_id, &ts); > >> - td->td_retval[0] = ts; > >> + memcpy(td->td_retval, &ts, sizeof(ts)); > >> return (error); > > > > Why do not use more simple solution: > > Because it doesn't work. > > > *(cloudabi_timestamp_t *)td->td_retval = cts; > > > > This is eliminate call to memcpy and allow compiler to use most > > effeicient way. > > memcpy() is the most efficient way (except for the kernel pessimization > of losing builtin memcpy with -ffreestanding 15 years ago and not bringing > it back). > *(foo_t *)asks for alignment bugs. We have already fixed lots of these > bugs for copying struct timevals in places like ping.c. Compilers warn > about misalignment when certain warnings are enabled, but only on arches > where misalignment is more than a pessimization. There is no reason why > td_retval would be always aligned on these arches. Alignment of 64-bit > types on 32-bit arches is usually so unimportant that even int32_t is > not required to be aligned by the ABI, and there is no point in > aligning td_retval specially unless you also do it for a large fraction > of 64-bit integers in the kernel, and there are negative points for > doing that. For eliminate aligment bugs need to replace all assigment more then 1 bytes to *td_retval by memcpy? From owner-svn-src-head@freebsd.org Sun Aug 21 13:14:52 2016 Return-Path: Delivered-To: svn-src-head@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 086F3BC06F0; Sun, 21 Aug 2016 13:14:52 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 BBB52149B; Sun, 21 Aug 2016 13:14:51 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbSaN-0003dZ-OF; Sun, 21 Aug 2016 16:14:47 +0300 Date: Sun, 21 Aug 2016 16:14:47 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160821131447.GA8192@zxy.spb.ru> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160821223255.K2478@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 13:14:52 -0000 On Sun, Aug 21, 2016 at 11:00:24PM +1000, Bruce Evans wrote: > On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > > > On Sun, Aug 21, 2016 at 09:32:35PM +1000, Bruce Evans wrote: > >... > >> *(foo_t *)asks for alignment bugs. We have already fixed lots of these > >> bugs for copying struct timevals in places like ping.c. Compilers warn > >> about misalignment when certain warnings are enabled, but only on arches > >> where misalignment is more than a pessimization. There is no reason why > >> td_retval would be always aligned on these arches. Alignment of 64-bit > >> types on 32-bit arches is usually so unimportant that even int32_t is > >> not required to be aligned by the ABI, and there is no point in > >> aligning td_retval specially unless you also do it for a large fraction > >> of 64-bit integers in the kernel, and there are negative points for > >> doing that. > > > > For eliminate aligment bugs need to replace all assigment more then 1 > > bytes to *td_retval by memcpy? > > The copying must be of size 1 or 2 ints unless you are making even larger > type puns than now. 1 int is obviously safe to just assign, and 2 ints > should use memcpy(). Why? I am remeber about platforms with missaligment trap when accessing int16 by odd address. Now platforms like this do not exist anymore? > There are also endianness problems. The old version was even more broken > on big endian systems. The current version needs some magic to reverse > the memcpy() of the bits. We already depend on this for some 64-bit > syscalls like lseek(). Can you explain some more? This is not transfer over network and don't read from external media. Where is problem? > Hmm, lseek() uses different magic. Instead of the memcpy(), we assign > to tdu_off in td_uretoff. td_retval is really td_uretoff.tdu_retval > obfuscated like this for compatibilty. This is slightly better than > the memcpy() since it makes tdu_off and also tdu_retval 64-bit aligned > if that is required for off_t. The same magic still occurs in userland. > On normal 32-bit arches, the 2 integers arrive in 2 registers that have > to be combined in the right order to give a 64-bit value. The magic is > just that things are arranged so that no code is needed to rearrange the > registers in the usual case where the application uses a similar ABI to > the kernel. Not the same ABI, since the application might be 32 bits > and the kernel 64 bits. This requires lots of conversions, but none for > register order for at least x86. > > Bruce From owner-svn-src-head@freebsd.org Sun Aug 21 13:18:54 2016 Return-Path: Delivered-To: svn-src-head@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 37D59BC0787; Sun, 21 Aug 2016 13:18:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 01DE3167A; Sun, 21 Aug 2016 13:18:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 049ED42672A; Sun, 21 Aug 2016 23:00:31 +1000 (AEST) Date: Sun, 21 Aug 2016 23:00:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Bruce Evans , Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi In-Reply-To: <20160821120016.GZ8192@zxy.spb.ru> Message-ID: <20160821223255.K2478@besplex.bde.org> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=5g0f9an9NMKHxossNRYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 13:18:54 -0000 On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 09:32:35PM +1000, Bruce Evans wrote: >... >> *(foo_t *)asks for alignment bugs. We have already fixed lots of these >> bugs for copying struct timevals in places like ping.c. Compilers warn >> about misalignment when certain warnings are enabled, but only on arches >> where misalignment is more than a pessimization. There is no reason why >> td_retval would be always aligned on these arches. Alignment of 64-bit >> types on 32-bit arches is usually so unimportant that even int32_t is >> not required to be aligned by the ABI, and there is no point in >> aligning td_retval specially unless you also do it for a large fraction >> of 64-bit integers in the kernel, and there are negative points for >> doing that. > > For eliminate aligment bugs need to replace all assigment more then 1 > bytes to *td_retval by memcpy? The copying must be of size 1 or 2 ints unless you are making even larger type puns than now. 1 int is obviously safe to just assign, and 2 ints should use memcpy(). There are also endianness problems. The old version was even more broken on big endian systems. The current version needs some magic to reverse the memcpy() of the bits. We already depend on this for some 64-bit syscalls like lseek(). Hmm, lseek() uses different magic. Instead of the memcpy(), we assign to tdu_off in td_uretoff. td_retval is really td_uretoff.tdu_retval obfuscated like this for compatibilty. This is slightly better than the memcpy() since it makes tdu_off and also tdu_retval 64-bit aligned if that is required for off_t. The same magic still occurs in userland. On normal 32-bit arches, the 2 integers arrive in 2 registers that have to be combined in the right order to give a 64-bit value. The magic is just that things are arranged so that no code is needed to rearrange the registers in the usual case where the application uses a similar ABI to the kernel. Not the same ABI, since the application might be 32 bits and the kernel 64 bits. This requires lots of conversions, but none for register order for at least x86. Bruce From owner-svn-src-head@freebsd.org Sun Aug 21 13:39:22 2016 Return-Path: Delivered-To: svn-src-head@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 B7FFBBC111C; Sun, 21 Aug 2016 13:39:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 805C5131E; Sun, 21 Aug 2016 13:39:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id BEB1BD43989; Sun, 21 Aug 2016 23:39:13 +1000 (AEST) Date: Sun, 21 Aug 2016 23:39:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Bruce Evans , Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi In-Reply-To: <20160821131447.GA8192@zxy.spb.ru> Message-ID: <20160821232721.G2639@besplex.bde.org> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=OPlg6owxQ1kcppeeVSEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 13:39:22 -0000 On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 11:00:24PM +1000, Bruce Evans wrote: > >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: >> >>> On Sun, Aug 21, 2016 at 09:32:35PM +1000, Bruce Evans wrote: >>> ... >>>> *(foo_t *)asks for alignment bugs. We have already fixed lots of these >>>> bugs for copying struct timevals in places like ping.c. Compilers warn >>>> about misalignment when certain warnings are enabled, but only on arches >>>> where misalignment is more than a pessimization. There is no reason why >>>> td_retval would be always aligned on these arches. Alignment of 64-bit >>>> types on 32-bit arches is usually so unimportant that even int32_t is >>>> not required to be aligned by the ABI, and there is no point in >>>> aligning td_retval specially unless you also do it for a large fraction >>>> of 64-bit integers in the kernel, and there are negative points for >>>> doing that. >>> >>> For eliminate aligment bugs need to replace all assigment more then 1 >>> bytes to *td_retval by memcpy? >> >> The copying must be of size 1 or 2 ints unless you are making even larger >> type puns than now. 1 int is obviously safe to just assign, and 2 ints >> should use memcpy(). > > Why? If it has size not 1 * sizeof(int) or 2 * sizeof(int) or is not an integer, than it is had to assign to a 2-byte array and might need more careful packing just to memcpy() it. > I am remeber about platforms with missaligment trap when > accessing int16 by odd address. Now platforms like this do not exist > anymore? i386 still exists, and it supports trapping on misalignement for at least CPL 3 (not kernel CPL 0). IIRC, amd64 drops support for this. >> There are also endianness problems. The old version was even more broken >> on big endian systems. The current version needs some magic to reverse >> the memcpy() of the bits. We already depend on this for some 64-bit >> syscalls like lseek(). > > Can you explain some more? > This is not transfer over network and don't read from external media. > Where is problem? It is similar to a network transfer. It needs a protocol to pass values to applications. Type puns are fragile even within a single compilation unit. Bruce From owner-svn-src-head@freebsd.org Sun Aug 21 13:58:29 2016 Return-Path: Delivered-To: svn-src-head@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 1EE50BC16E4; Sun, 21 Aug 2016 13:58:29 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 D60FD1D29; Sun, 21 Aug 2016 13:58:28 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbTGc-0004Xn-Ec; Sun, 21 Aug 2016 16:58:26 +0300 Date: Sun, 21 Aug 2016 16:58:26 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160821135826.GB8192@zxy.spb.ru> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> <20160821232721.G2639@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160821232721.G2639@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 13:58:29 -0000 On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote: > On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > > > On Sun, Aug 21, 2016 at 11:00:24PM +1000, Bruce Evans wrote: > > > >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > >> > >>> On Sun, Aug 21, 2016 at 09:32:35PM +1000, Bruce Evans wrote: > >>> ... > >>>> *(foo_t *)asks for alignment bugs. We have already fixed lots of these > >>>> bugs for copying struct timevals in places like ping.c. Compilers warn > >>>> about misalignment when certain warnings are enabled, but only on arches > >>>> where misalignment is more than a pessimization. There is no reason why > >>>> td_retval would be always aligned on these arches. Alignment of 64-bit > >>>> types on 32-bit arches is usually so unimportant that even int32_t is > >>>> not required to be aligned by the ABI, and there is no point in > >>>> aligning td_retval specially unless you also do it for a large fraction > >>>> of 64-bit integers in the kernel, and there are negative points for > >>>> doing that. > >>> > >>> For eliminate aligment bugs need to replace all assigment more then 1 > >>> bytes to *td_retval by memcpy? > >> > >> The copying must be of size 1 or 2 ints unless you are making even larger > >> type puns than now. 1 int is obviously safe to just assign, and 2 ints > >> should use memcpy(). > > > > Why? > > If it has size not 1 * sizeof(int) or 2 * sizeof(int) or is not an integer, > than it is had to assign to a 2-byte array and might need more careful > packing just to memcpy() it. I am miss you point. > > I am remeber about platforms with missaligment trap when > > accessing int16 by odd address. Now platforms like this do not exist > > anymore? > > i386 still exists, and it supports trapping on misalignement for at least > CPL 3 (not kernel CPL 0). IIRC, amd64 drops support for this. Someone enable and support this? I am don't see. May be PPC trap on this? Alpha trap on this, but support of Alpha is droped. > >> There are also endianness problems. The old version was even more broken > >> on big endian systems. The current version needs some magic to reverse > >> the memcpy() of the bits. We already depend on this for some 64-bit > >> syscalls like lseek(). > > > > Can you explain some more? > > This is not transfer over network and don't read from external media. > > Where is problem? > > It is similar to a network transfer. It needs a protocol to pass values > to applications. Type puns are fragile even within a single compilation > unit. Application ad kernel run with same byte order, not? From owner-svn-src-head@freebsd.org Sun Aug 21 15:14:07 2016 Return-Path: Delivered-To: svn-src-head@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 6AAD4BC0490; Sun, 21 Aug 2016 15:14:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4898F1A17; Sun, 21 Aug 2016 15:14:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LFE6tt045065; Sun, 21 Aug 2016 15:14:06 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LFE6cL045061; Sun, 21 Aug 2016 15:14:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211514.u7LFE6cL045061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 15:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304557 - in head/sys: compat/cloudabi compat/cloudabi64 conf modules/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 15:14:07 -0000 Author: ed Date: Sun Aug 21 15:14:06 2016 New Revision: 304557 URL: https://svnweb.freebsd.org/changeset/base/304557 Log: Move the linker script from cloudabi64/ to cloudabi/. It turns out that it works perfectly fine for generating 32-bits vDSOs as well. While there, get rid of the extraneous .s file extension. Added: head/sys/compat/cloudabi/cloudabi_vdso.lds - copied, changed from r304556, head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s Deleted: head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s Modified: head/sys/conf/files.amd64 head/sys/conf/files.arm64 head/sys/modules/cloudabi64/Makefile Copied and modified: head/sys/compat/cloudabi/cloudabi_vdso.lds (from r304556, head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_vdso.lds.s Sun Aug 21 09:32:20 2016 (r304556, copy source) +++ head/sys/compat/cloudabi/cloudabi_vdso.lds Sun Aug 21 15:14:06 2016 (r304557) @@ -1,5 +1,5 @@ /* - * Linker script for 64-bit vDSO for CloudABI. + * Linker script for the vDSO for CloudABI. * Based on sys/amd64/linux/linux_vdso.lds.s * * $FreeBSD$ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Aug 21 09:32:20 2016 (r304556) +++ head/sys/conf/files.amd64 Sun Aug 21 15:14:06 2016 (r304557) @@ -10,7 +10,7 @@ # cloudabi64_vdso.o optional compat_cloudabi64 \ dependency "$S/contrib/cloudabi/cloudabi_vdso_x86_64.S" \ - compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s $S/contrib/cloudabi/cloudabi_vdso_x86_64.S -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_x86_64.S -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "cloudabi64_vdso.o" # Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Aug 21 09:32:20 2016 (r304556) +++ head/sys/conf/files.arm64 Sun Aug 21 15:14:06 2016 (r304557) @@ -1,7 +1,7 @@ # $FreeBSD$ cloudabi64_vdso.o optional compat_cloudabi64 \ dependency "$S/contrib/cloudabi/cloudabi_vdso_aarch64.S" \ - compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi64/cloudabi64_vdso.lds.s $S/contrib/cloudabi/cloudabi_vdso_aarch64.S -o ${.TARGET}" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_aarch64.S -o ${.TARGET}" \ no-obj no-implicit-rule \ clean "cloudabi64_vdso.o" # Modified: head/sys/modules/cloudabi64/Makefile ============================================================================== --- head/sys/modules/cloudabi64/Makefile Sun Aug 21 09:32:20 2016 (r304556) +++ head/sys/modules/cloudabi64/Makefile Sun Aug 21 15:14:06 2016 (r304557) @@ -25,7 +25,7 @@ BINARY_ARCHITECTURE=i386 cloudabi64_vdso.o: ${VDSO_SRCS} ${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib \ - -Wl,-T${SYSDIR}/compat/cloudabi64/cloudabi64_vdso.lds.s \ + -Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \ ${VDSO_SRCS} -o ${.TARGET} cloudabi64_vdso_blob.o: cloudabi64_vdso.o From owner-svn-src-head@freebsd.org Sun Aug 21 15:36:20 2016 Return-Path: Delivered-To: svn-src-head@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 542BFBC09CF; Sun, 21 Aug 2016 15:36:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146DE1499; Sun, 21 Aug 2016 15:36:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LFaJo4052546; Sun, 21 Aug 2016 15:36:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LFaIkb052542; Sun, 21 Aug 2016 15:36:18 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211536.u7LFaIkb052542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 15:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304558 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 15:36:20 -0000 Author: ed Date: Sun Aug 21 15:36:18 2016 New Revision: 304558 URL: https://svnweb.freebsd.org/changeset/base/304558 Log: Add a utility macro for converting 64-bit pointers to native pointers. Right now we're casting uint64_t's to native pointers. This isn't causing any problems right now, but if we want to provide a 32-bit compatibility layer that works on 64-bit systems as well, this will cause problems. Casting a uint32_t to a 64-bit pointer throws a compiler error. Introduce a TO_PTR() macro that casts the value to uintptr_t before casting it to a pointer. Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi64/cloudabi64_sock.c head/sys/compat/cloudabi64/cloudabi64_util.h Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_fd.c Sun Aug 21 15:14:06 2016 (r304557) +++ head/sys/compat/cloudabi64/cloudabi64_fd.c Sun Aug 21 15:36:18 2016 (r304558) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* Copies in 64-bit iovec structures from userspace. */ static int @@ -70,7 +71,7 @@ cloudabi64_copyinuio(const cloudabi64_io free(uio, M_IOV); return (error); } - iov[i].iov_base = (void *)iovobj.iov_base; + iov[i].iov_base = TO_PTR(iovobj.iov_base); iov[i].iov_len = iovobj.iov_len; if (iov[i].iov_len > INT64_MAX - uio->uio_resid) { free(uio, M_IOV); @@ -105,8 +106,7 @@ cloudabi64_sys_fd_pwrite(struct thread * struct uio *uio; int error; - error = cloudabi64_copyinuio((const cloudabi64_iovec_t *)uap->iov, - uap->iovcnt, &uio); + error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); if (error != 0) return (error); error = kern_pwritev(td, uap->fd, uio, uap->offset); @@ -136,8 +136,7 @@ cloudabi64_sys_fd_write(struct thread *t struct uio *uio; int error; - error = cloudabi64_copyinuio((const cloudabi64_iovec_t *)uap->iov, - uap->iovcnt, &uio); + error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); if (error != 0) return (error); error = kern_writev(td, uap->fd, uio); Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Sun Aug 21 15:14:06 2016 (r304557) +++ head/sys/compat/cloudabi64/cloudabi64_poll.c Sun Aug 21 15:36:18 2016 (r304558) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* Converts a FreeBSD signal number to a CloudABI signal number. */ static cloudabi_signal_t @@ -98,7 +99,7 @@ cloudabi64_kevent_copyin(void *arg, stru return (error); memset(kevp, 0, sizeof(*kevp)); - kevp->udata = (void *)sub.userdata; + kevp->udata = TO_PTR(sub.userdata); switch (sub.type) { case CLOUDABI_EVENTTYPE_CLOCK: kevp->filter = EVFILT_TIMER; @@ -264,9 +265,9 @@ cloudabi64_sys_poll(struct thread *td, s ev.condvar.condvar = sub.condvar.condvar; ev.error = cloudabi_convert_errno( cloudabi_futex_condvar_wait( - td, (cloudabi_condvar_t *)sub.condvar.condvar, + td, TO_PTR(sub.condvar.condvar), sub.condvar.condvar_scope, - (cloudabi_lock_t *)sub.condvar.lock, + TO_PTR(sub.condvar.lock), sub.condvar.lock_scope, CLOUDABI_CLOCK_MONOTONIC, UINT64_MAX, 0)); td->td_retval[0] = 1; @@ -276,7 +277,7 @@ cloudabi64_sys_poll(struct thread *td, s ev.lock.lock = sub.lock.lock; ev.error = cloudabi_convert_errno( cloudabi_futex_lock_rdlock( - td, (cloudabi_lock_t *)sub.lock.lock, + td, TO_PTR(sub.lock.lock), sub.lock.lock_scope, CLOUDABI_CLOCK_MONOTONIC, UINT64_MAX, 0)); td->td_retval[0] = 1; @@ -286,7 +287,7 @@ cloudabi64_sys_poll(struct thread *td, s ev.lock.lock = sub.lock.lock; ev.error = cloudabi_convert_errno( cloudabi_futex_lock_wrlock( - td, (cloudabi_lock_t *)sub.lock.lock, + td, TO_PTR(sub.lock.lock), sub.lock.lock_scope, CLOUDABI_CLOCK_MONOTONIC, UINT64_MAX, 0)); td->td_retval[0] = 1; @@ -311,9 +312,9 @@ cloudabi64_sys_poll(struct thread *td, s ev[0].condvar.condvar = sub[0].condvar.condvar; ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_condvar_wait( - td, (cloudabi_condvar_t *)sub[0].condvar.condvar, + td, TO_PTR(sub[0].condvar.condvar), sub[0].condvar.condvar_scope, - (cloudabi_lock_t *)sub[0].condvar.lock, + TO_PTR(sub[0].condvar.lock), sub[0].condvar.lock_scope, sub[1].clock.clock_id, sub[1].clock.timeout, sub[1].clock.precision); if (error == ETIMEDOUT) { @@ -332,7 +333,7 @@ cloudabi64_sys_poll(struct thread *td, s ev[0].lock.lock = sub[0].lock.lock; ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_lock_rdlock( - td, (cloudabi_lock_t *)sub[0].lock.lock, + td, TO_PTR(sub[0].lock.lock), sub[0].lock.lock_scope, sub[1].clock.clock_id, sub[1].clock.timeout, sub[1].clock.precision); if (error == ETIMEDOUT) { @@ -351,7 +352,7 @@ cloudabi64_sys_poll(struct thread *td, s ev[0].lock.lock = sub[0].lock.lock; ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_lock_wrlock( - td, (cloudabi_lock_t *)sub[0].lock.lock, + td, TO_PTR(sub[0].lock.lock), sub[0].lock.lock_scope, sub[1].clock.clock_id, sub[1].clock.timeout, sub[1].clock.precision); if (error == ETIMEDOUT) { Modified: head/sys/compat/cloudabi64/cloudabi64_sock.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sock.c Sun Aug 21 15:14:06 2016 (r304557) +++ head/sys/compat/cloudabi64/cloudabi64_sock.c Sun Aug 21 15:36:18 2016 (r304558) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static MALLOC_DEFINE(M_SOCKET, "socket", "CloudABI socket"); @@ -52,6 +53,7 @@ cloudabi64_sys_sock_recv(struct thread * cloudabi64_recv_out_t ro = {}; cloudabi64_iovec_t iovobj; struct msghdr msghdr = {}; + const cloudabi64_iovec_t *user_iov; size_t i; int error; @@ -65,14 +67,14 @@ cloudabi64_sys_sock_recv(struct thread * msghdr.msg_iovlen = ri.ri_datalen; msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), M_SOCKET, M_WAITOK); + user_iov = TO_PTR(ri.ri_data); for (i = 0; i < msghdr.msg_iovlen; i++) { - error = copyin(&((cloudabi64_iovec_t *)ri.ri_data)[i], &iovobj, - sizeof(iovobj)); + error = copyin(&user_iov[i], &iovobj, sizeof(iovobj)); if (error != 0) { free(msghdr.msg_iov, M_SOCKET); return (error); } - msghdr.msg_iov[i].iov_base = (void *)iovobj.iov_base; + msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base); msghdr.msg_iov[i].iov_len = iovobj.iov_len; } msghdr.msg_name = &ss; @@ -104,6 +106,7 @@ cloudabi64_sys_sock_send(struct thread * cloudabi64_send_out_t so = {}; cloudabi64_ciovec_t iovobj; struct msghdr msghdr = {}; + const cloudabi64_ciovec_t *user_iov; size_t i; int error, flags; @@ -117,14 +120,14 @@ cloudabi64_sys_sock_send(struct thread * msghdr.msg_iovlen = si.si_datalen; msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), M_SOCKET, M_WAITOK); + user_iov = TO_PTR(si.si_data); for (i = 0; i < msghdr.msg_iovlen; i++) { - error = copyin(&((cloudabi64_ciovec_t *)si.si_data)[i], &iovobj, - sizeof(iovobj)); + error = copyin(&user_iov[i], &iovobj, sizeof(iovobj)); if (error != 0) { free(msghdr.msg_iov, M_SOCKET); return (error); } - msghdr.msg_iov[i].iov_base = (void *)iovobj.iov_base; + msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base); msghdr.msg_iov[i].iov_len = iovobj.iov_len; } Modified: head/sys/compat/cloudabi64/cloudabi64_util.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_util.h Sun Aug 21 15:14:06 2016 (r304557) +++ head/sys/compat/cloudabi64/cloudabi64_util.h Sun Aug 21 15:36:18 2016 (r304558) @@ -38,6 +38,8 @@ struct thread; extern Elf64_Brandinfo cloudabi64_brand; +#define TO_PTR(x) ((void *)(uintptr_t)(x)) + /* Stack initialization during process execution. */ register_t *cloudabi64_copyout_strings(struct image_params *); int cloudabi64_fixup(register_t **, struct image_params *); From owner-svn-src-head@freebsd.org Sun Aug 21 15:37:51 2016 Return-Path: Delivered-To: svn-src-head@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 07244BC0A49; Sun, 21 Aug 2016 15:37:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBB751663; Sun, 21 Aug 2016 15:37:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LFboNl052636; Sun, 21 Aug 2016 15:37:50 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LFbo28052635; Sun, 21 Aug 2016 15:37:50 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211537.u7LFbo28052635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 15:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304559 - head/sys/compat/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 15:37:51 -0000 Author: ed Date: Sun Aug 21 15:37:49 2016 New Revision: 304559 URL: https://svnweb.freebsd.org/changeset/base/304559 Log: Don't forget to define __ELF_WORD_SIZE. Without it, we only obtain the ELF types native to the system. In this we explicitly want the 64-bit versions. Modified: head/sys/compat/cloudabi64/cloudabi64_util.h Modified: head/sys/compat/cloudabi64/cloudabi64_util.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_util.h Sun Aug 21 15:36:18 2016 (r304558) +++ head/sys/compat/cloudabi64/cloudabi64_util.h Sun Aug 21 15:37:49 2016 (r304559) @@ -29,6 +29,7 @@ #define _CLOUDABI64_UTIL_H_ #include +#define __ELF_WORD_SIZE 64 #include #include From owner-svn-src-head@freebsd.org Sun Aug 21 15:39:47 2016 Return-Path: Delivered-To: svn-src-head@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 B4C6EBC0AB0; Sun, 21 Aug 2016 15:39:47 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 856881802; Sun, 21 Aug 2016 15:39:47 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LFdkZd052749; Sun, 21 Aug 2016 15:39:46 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LFdk6O052748; Sun, 21 Aug 2016 15:39:46 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201608211539.u7LFdk6O052748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Sun, 21 Aug 2016 15:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304560 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 15:39:47 -0000 Author: bjk (doc committer) Date: Sun Aug 21 15:39:46 2016 New Revision: 304560 URL: https://svnweb.freebsd.org/changeset/base/304560 Log: Remove the ie(4) hardware list from the release documentation The driver was removed by jhb in r304513, and the &hwlist.ie; entity is no longer generated, causing the website build to fail. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Aug 21 15:37:49 2016 (r304559) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sun Aug 21 15:39:46 2016 (r304560) @@ -836,8 +836,6 @@ &hwlist.hme; - &hwlist.ie; - &hwlist.igb; &hwlist.ipheth; From owner-svn-src-head@freebsd.org Sun Aug 21 15:41:20 2016 Return-Path: Delivered-To: svn-src-head@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 5EF4BBC0D00; Sun, 21 Aug 2016 15:41:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 232431C15; Sun, 21 Aug 2016 15:41:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LFfJHb055001; Sun, 21 Aug 2016 15:41:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LFfJD7054999; Sun, 21 Aug 2016 15:41:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211541.u7LFfJD7054999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 15:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304561 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 15:41:20 -0000 Author: ed Date: Sun Aug 21 15:41:19 2016 New Revision: 304561 URL: https://svnweb.freebsd.org/changeset/base/304561 Log: Import the 32-bit system call table and data types into the tree. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/contrib/cloudabi/cloudabi32_types.h (contents, props changed) head/sys/contrib/cloudabi/syscalls32.master (contents, props changed) Added: head/sys/contrib/cloudabi/cloudabi32_types.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi32_types.h Sun Aug 21 15:41:19 2016 (r304561) @@ -0,0 +1,232 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#ifndef CLOUDABI32_TYPES_H +#define CLOUDABI32_TYPES_H + +#include "cloudabi_types_common.h" + +typedef struct { + _Alignas(4) cloudabi_auxtype_t a_type; + union { + _Alignas(4) uint32_t a_val; + _Alignas(4) uint32_t a_ptr; + }; +} cloudabi32_auxv_t; +_Static_assert(offsetof(cloudabi32_auxv_t, a_type) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_auxv_t, a_val) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_auxv_t, a_ptr) == 4, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_auxv_t) == 8, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_auxv_t) == 4, "Incorrect layout"); + +typedef struct { + _Alignas(4) uint32_t iov_base; + _Alignas(4) uint32_t iov_len; +} cloudabi32_ciovec_t; +_Static_assert(offsetof(cloudabi32_ciovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_ciovec_t, iov_len) == 4, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_ciovec_t) == 8, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_ciovec_t) == 4, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_errno_t error; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + } clock; + struct { + _Alignas(4) uint32_t condvar; + } condvar; + struct { + _Alignas(8) cloudabi_filesize_t nbytes; + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_eventrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(4) uint32_t lock; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(1) cloudabi_signal_t signal; + _Alignas(4) cloudabi_exitcode_t exitcode; + } proc_terminate; + }; +} cloudabi32_event_t; +_Static_assert(offsetof(cloudabi32_event_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, error) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, proc_terminate.signal) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_event_t) == 32, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_event_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(4) uint32_t iov_base; + _Alignas(4) uint32_t iov_len; +} cloudabi32_iovec_t; +_Static_assert(offsetof(cloudabi32_iovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_iovec_t, iov_len) == 4, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_iovec_t) == 8, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_iovec_t) == 4, "Incorrect layout"); + +typedef void cloudabi32_processentry_t(uint32_t auxv); + +typedef struct { + _Alignas(4) uint32_t ri_data; + _Alignas(4) uint32_t ri_datalen; + _Alignas(4) uint32_t ri_fds; + _Alignas(4) uint32_t ri_fdslen; + _Alignas(2) cloudabi_msgflags_t ri_flags; +} cloudabi32_recv_in_t; +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_data) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_datalen) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fds) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fdslen) == 12, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_flags) == 16, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_recv_in_t) == 20, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_recv_in_t) == 4, "Incorrect layout"); + +typedef struct { + _Alignas(4) uint32_t si_data; + _Alignas(4) uint32_t si_datalen; + _Alignas(4) uint32_t si_fds; + _Alignas(4) uint32_t si_fdslen; + _Alignas(2) cloudabi_msgflags_t si_flags; +} cloudabi32_send_in_t; +_Static_assert(offsetof(cloudabi32_send_in_t, si_data) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_send_in_t, si_datalen) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_send_in_t, si_fds) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_send_in_t, si_fdslen) == 12, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_send_in_t, si_flags) == 16, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_send_in_t) == 20, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_send_in_t) == 4, "Incorrect layout"); + +typedef struct { + _Alignas(4) uint32_t so_datalen; +} cloudabi32_send_out_t; +_Static_assert(offsetof(cloudabi32_send_out_t, so_datalen) == 0, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_send_out_t) == 4, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_send_out_t) == 4, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_subflags_t flags; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + _Alignas(4) cloudabi_clockid_t clock_id; + _Alignas(8) cloudabi_timestamp_t timeout; + _Alignas(8) cloudabi_timestamp_t precision; + _Alignas(2) cloudabi_subclockflags_t flags; + } clock; + struct { + _Alignas(4) uint32_t condvar; + _Alignas(4) uint32_t lock; + _Alignas(1) cloudabi_scope_t condvar_scope; + _Alignas(1) cloudabi_scope_t lock_scope; + } condvar; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_subrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(4) uint32_t lock; + _Alignas(1) cloudabi_scope_t lock_scope; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + } proc_terminate; + }; +} cloudabi32_subscription_t; +_Static_assert(offsetof(cloudabi32_subscription_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, flags) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, clock.clock_id) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, clock.timeout) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, clock.precision) == 40, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, clock.flags) == 48, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, condvar.lock) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, condvar.condvar_scope) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, condvar.lock_scope) == 25, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, lock.lock_scope) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_subscription_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_subscription_t) == 56, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_subscription_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(4) uint32_t parent; +} cloudabi32_tcb_t; +_Static_assert(offsetof(cloudabi32_tcb_t, parent) == 0, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_tcb_t) == 4, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_tcb_t) == 4, "Incorrect layout"); + +typedef void cloudabi32_threadentry_t(cloudabi_tid_t tid, uint32_t aux); + +typedef struct { + _Alignas(4) uint32_t ro_datalen; + _Alignas(4) uint32_t ro_fdslen; + _Alignas(2) cloudabi_sockaddr_t ro_sockname; + _Alignas(2) cloudabi_sockaddr_t ro_peername; + _Alignas(2) cloudabi_msgflags_t ro_flags; +} cloudabi32_recv_out_t; +_Static_assert(offsetof(cloudabi32_recv_out_t, ro_datalen) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_out_t, ro_fdslen) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_out_t, ro_sockname) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_out_t, ro_peername) == 28, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_out_t, ro_flags) == 48, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_recv_out_t) == 52, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_recv_out_t) == 4, "Incorrect layout"); + +typedef struct { + _Alignas(4) uint32_t entry_point; + _Alignas(4) uint32_t stack; + _Alignas(4) uint32_t stack_size; + _Alignas(4) uint32_t argument; +} cloudabi32_threadattr_t; +_Static_assert(offsetof(cloudabi32_threadattr_t, entry_point) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_threadattr_t, stack) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_threadattr_t, stack_size) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_threadattr_t, argument) == 12, "Incorrect layout"); +_Static_assert(sizeof(cloudabi32_threadattr_t) == 16, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi32_threadattr_t) == 4, "Incorrect layout"); + +#endif Added: head/sys/contrib/cloudabi/syscalls32.master ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/syscalls32.master Sun Aug 21 15:41:19 2016 (r304561) @@ -0,0 +1,315 @@ + $FreeBSD$ + +; Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +; +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; 1. Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; 2. Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; +; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +; SUCH DAMAGE. +; +; This file is automatically generated. Do not edit. +; +; Source: https://github.com/NuxiNL/cloudabi + +#include +#include + +#include + +#include + +0 AUE_NULL STD { cloudabi_timestamp_t \ + cloudabi_sys_clock_res_get( \ + cloudabi_clockid_t clock_id); } + +1 AUE_NULL STD { cloudabi_timestamp_t \ + cloudabi_sys_clock_time_get( \ + cloudabi_clockid_t clock_id, \ + cloudabi_timestamp_t precision); } + +2 AUE_NULL STD { void cloudabi_sys_condvar_signal( \ + cloudabi_condvar_t *condvar, \ + cloudabi_scope_t scope, \ + cloudabi_nthreads_t nwaiters); } + +3 AUE_NULL STD { void cloudabi_sys_fd_close( \ + cloudabi_fd_t fd); } + +4 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_fd_create1( \ + cloudabi_filetype_t type); } + +5 AUE_NULL STD { void cloudabi_sys_fd_create2( \ + cloudabi_filetype_t type); } + +6 AUE_NULL STD { void cloudabi_sys_fd_datasync( \ + cloudabi_fd_t fd); } + +7 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_fd_dup( \ + cloudabi_fd_t from); } + +8 AUE_NULL STD { size_t cloudabi32_sys_fd_pread( \ + cloudabi_fd_t fd, \ + const cloudabi32_iovec_t *iov, \ + size_t iovcnt, \ + cloudabi_filesize_t offset); } + +9 AUE_NULL STD { size_t cloudabi32_sys_fd_pwrite( \ + cloudabi_fd_t fd, \ + const cloudabi32_ciovec_t *iov, \ + size_t iovcnt, \ + cloudabi_filesize_t offset); } + +10 AUE_NULL STD { size_t cloudabi32_sys_fd_read( \ + cloudabi_fd_t fd, \ + const cloudabi32_iovec_t *iov, \ + size_t iovcnt); } + +11 AUE_NULL STD { void cloudabi_sys_fd_replace( \ + cloudabi_fd_t from, \ + cloudabi_fd_t to); } + +12 AUE_NULL STD { cloudabi_filesize_t \ + cloudabi_sys_fd_seek( \ + cloudabi_fd_t fd, \ + cloudabi_filedelta_t offset, \ + cloudabi_whence_t whence); } + +13 AUE_NULL STD { void cloudabi_sys_fd_stat_get( \ + cloudabi_fd_t fd, \ + cloudabi_fdstat_t *buf); } + +14 AUE_NULL STD { void cloudabi_sys_fd_stat_put( \ + cloudabi_fd_t fd, \ + const cloudabi_fdstat_t *buf, \ + cloudabi_fdsflags_t flags); } + +15 AUE_NULL STD { void cloudabi_sys_fd_sync( \ + cloudabi_fd_t fd); } + +16 AUE_NULL STD { size_t cloudabi32_sys_fd_write( \ + cloudabi_fd_t fd, \ + const cloudabi32_ciovec_t *iov, \ + size_t iovcnt); } + +17 AUE_NULL STD { void cloudabi_sys_file_advise( \ + cloudabi_fd_t fd, \ + cloudabi_filesize_t offset, \ + cloudabi_filesize_t len, \ + cloudabi_advice_t advice); } + +18 AUE_NULL STD { void cloudabi_sys_file_allocate( \ + cloudabi_fd_t fd, \ + cloudabi_filesize_t offset, \ + cloudabi_filesize_t len); } + +19 AUE_NULL STD { void cloudabi_sys_file_create( \ + cloudabi_fd_t fd, \ + const char *path, \ + size_t pathlen, \ + cloudabi_filetype_t type); } + +20 AUE_NULL STD { void cloudabi_sys_file_link( \ + cloudabi_lookup_t fd1, \ + const char *path1, \ + size_t path1len, \ + cloudabi_fd_t fd2, \ + const char *path2, \ + size_t path2len); } + +21 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_file_open( \ + cloudabi_lookup_t dirfd, \ + const char *path, \ + size_t pathlen, \ + cloudabi_oflags_t oflags, \ + const cloudabi_fdstat_t *fds); } + +22 AUE_NULL STD { size_t cloudabi_sys_file_readdir( \ + cloudabi_fd_t fd, \ + void *buf, \ + size_t nbyte, \ + cloudabi_dircookie_t cookie); } + +23 AUE_NULL STD { size_t cloudabi_sys_file_readlink( \ + cloudabi_fd_t fd, \ + const char *path, \ + size_t pathlen, \ + char *buf, \ + size_t bufsize); } + +24 AUE_NULL STD { void cloudabi_sys_file_rename( \ + cloudabi_fd_t oldfd, \ + const char *old, \ + size_t oldlen, \ + cloudabi_fd_t newfd, \ + const char *new, \ + size_t newlen); } + +25 AUE_NULL STD { void cloudabi_sys_file_stat_fget( \ + cloudabi_fd_t fd, \ + cloudabi_filestat_t *buf); } + +26 AUE_NULL STD { void cloudabi_sys_file_stat_fput( \ + cloudabi_fd_t fd, \ + const cloudabi_filestat_t *buf, \ + cloudabi_fsflags_t flags); } + +27 AUE_NULL STD { void cloudabi_sys_file_stat_get( \ + cloudabi_lookup_t fd, \ + const char *path, \ + size_t pathlen, \ + cloudabi_filestat_t *buf); } + +28 AUE_NULL STD { void cloudabi_sys_file_stat_put( \ + cloudabi_lookup_t fd, \ + const char *path, \ + size_t pathlen, \ + const cloudabi_filestat_t *buf, \ + cloudabi_fsflags_t flags); } + +29 AUE_NULL STD { void cloudabi_sys_file_symlink( \ + const char *path1, \ + size_t path1len, \ + cloudabi_fd_t fd, \ + const char *path2, \ + size_t path2len); } + +30 AUE_NULL STD { void cloudabi_sys_file_unlink( \ + cloudabi_fd_t fd, \ + const char *path, \ + size_t pathlen, \ + cloudabi_ulflags_t flags); } + +31 AUE_NULL STD { void cloudabi_sys_lock_unlock( \ + cloudabi_lock_t *lock, \ + cloudabi_scope_t scope); } + +32 AUE_NULL STD { void cloudabi_sys_mem_advise( \ + void *addr, \ + size_t len, \ + cloudabi_advice_t advice); } + +33 AUE_NULL STD { void cloudabi_sys_mem_lock( \ + const void *addr, \ + size_t len); } + +34 AUE_NULL STD { void cloudabi_sys_mem_map( \ + void *addr, \ + size_t len, \ + cloudabi_mprot_t prot, \ + cloudabi_mflags_t flags, \ + cloudabi_fd_t fd, \ + cloudabi_filesize_t off); } + +35 AUE_NULL STD { void cloudabi_sys_mem_protect( \ + void *addr, \ + size_t len, \ + cloudabi_mprot_t prot); } + +36 AUE_NULL STD { void cloudabi_sys_mem_sync( \ + void *addr, \ + size_t len, \ + cloudabi_msflags_t flags); } + +37 AUE_NULL STD { void cloudabi_sys_mem_unlock( \ + const void *addr, \ + size_t len); } + +38 AUE_NULL STD { void cloudabi_sys_mem_unmap( \ + void *addr, \ + size_t len); } + +39 AUE_NULL STD { size_t cloudabi32_sys_poll( \ + const cloudabi32_subscription_t *in, \ + cloudabi32_event_t *out, \ + size_t nsubscriptions); } + +40 AUE_NULL STD { size_t cloudabi32_sys_poll_fd( \ + cloudabi_fd_t fd, \ + const cloudabi32_subscription_t *in, \ + size_t nin, \ + cloudabi32_event_t *out, \ + size_t nout, \ + const cloudabi32_subscription_t *timeout); } + +41 AUE_NULL STD { void cloudabi_sys_proc_exec( \ + cloudabi_fd_t fd, \ + const void *data, \ + size_t datalen, \ + const cloudabi_fd_t *fds, \ + size_t fdslen); } + +42 AUE_NULL STD { void cloudabi_sys_proc_exit( \ + cloudabi_exitcode_t rval); } + +43 AUE_NULL STD { void cloudabi_sys_proc_fork(); } + +44 AUE_NULL STD { void cloudabi_sys_proc_raise( \ + cloudabi_signal_t sig); } + +45 AUE_NULL STD { void cloudabi_sys_random_get( \ + void *buf, \ + size_t nbyte); } + +46 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \ + cloudabi_fd_t sock, \ + cloudabi_sockstat_t *buf); } + +47 AUE_NULL STD { void cloudabi_sys_sock_bind( \ + cloudabi_fd_t sock, \ + cloudabi_fd_t fd, \ + const char *path, \ + size_t pathlen); } + +48 AUE_NULL STD { void cloudabi_sys_sock_connect( \ + cloudabi_fd_t sock, \ + cloudabi_fd_t fd, \ + const char *path, \ + size_t pathlen); } + +49 AUE_NULL STD { void cloudabi_sys_sock_listen( \ + cloudabi_fd_t sock, \ + cloudabi_backlog_t backlog); } + +50 AUE_NULL STD { void cloudabi32_sys_sock_recv( \ + cloudabi_fd_t sock, \ + const cloudabi32_recv_in_t *in, \ + cloudabi32_recv_out_t *out); } + +51 AUE_NULL STD { void cloudabi32_sys_sock_send( \ + cloudabi_fd_t sock, \ + const cloudabi32_send_in_t *in, \ + cloudabi32_send_out_t *out); } + +52 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \ + cloudabi_fd_t sock, \ + cloudabi_sdflags_t how); } + +53 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \ + cloudabi_fd_t sock, \ + cloudabi_sockstat_t *buf, \ + cloudabi_ssflags_t flags); } + +54 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \ + cloudabi32_threadattr_t *attr); } + +55 AUE_NULL STD { void cloudabi_sys_thread_exit( \ + cloudabi_lock_t *lock, \ + cloudabi_scope_t scope); } + +56 AUE_NULL STD { void cloudabi_sys_thread_yield(); } From owner-svn-src-head@freebsd.org Sun Aug 21 15:56:20 2016 Return-Path: Delivered-To: svn-src-head@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 A9BF3BC11F8; Sun, 21 Aug 2016 15:56:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA65162D; Sun, 21 Aug 2016 15:56:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LFuJ2E060117; Sun, 21 Aug 2016 15:56:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LFuJJe060116; Sun, 21 Aug 2016 15:56:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211556.u7LFuJJe060116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 15:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304563 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 15:56:20 -0000 Author: ed Date: Sun Aug 21 15:56:19 2016 New Revision: 304563 URL: https://svnweb.freebsd.org/changeset/base/304563 Log: Fix s/64/32/ conversion errors in the system call table. We should pull in the 32 bit headers when using this system call table. Modified: head/sys/contrib/cloudabi/syscalls32.master Modified: head/sys/contrib/cloudabi/syscalls32.master ============================================================================== --- head/sys/contrib/cloudabi/syscalls32.master Sun Aug 21 15:45:12 2016 (r304562) +++ head/sys/contrib/cloudabi/syscalls32.master Sun Aug 21 15:56:19 2016 (r304563) @@ -30,9 +30,9 @@ #include #include -#include +#include -#include +#include 0 AUE_NULL STD { cloudabi_timestamp_t \ cloudabi_sys_clock_res_get( \ From owner-svn-src-head@freebsd.org Sun Aug 21 16:01:32 2016 Return-Path: Delivered-To: svn-src-head@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 A293EBC12EB; Sun, 21 Aug 2016 16:01:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FDE01983; Sun, 21 Aug 2016 16:01:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LG1VHm063691; Sun, 21 Aug 2016 16:01:31 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LG1U2n063681; Sun, 21 Aug 2016 16:01:30 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211601.u7LG1U2n063681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 16:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304564 - in head/sys: compat/cloudabi32 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 16:01:32 -0000 Author: ed Date: Sun Aug 21 16:01:30 2016 New Revision: 304564 URL: https://svnweb.freebsd.org/changeset/base/304564 Log: Add CPU independent code for running 32-bits CloudABI executables. Essentially, this is a literal copy of the code in sys/compat/cloudabi64, except that it now makes use of 32-bits datatypes and limits. In sys/conf/files, we now need to take care to build the code in sys/compat/cloudabi if either COMPAT_CLOUDABI32 or COMPAT_CLOUDABI64 is turned on. This change does not yet include any of the CPU dependent bits. Right now I have implementations for running i386 binaries both on i386 and x86-64, which I will send out for review separately. Added: head/sys/compat/cloudabi32/ head/sys/compat/cloudabi32/Makefile - copied, changed from r304561, head/sys/compat/cloudabi64/Makefile head/sys/compat/cloudabi32/cloudabi32_fd.c - copied, changed from r304561, head/sys/compat/cloudabi64/cloudabi64_fd.c head/sys/compat/cloudabi32/cloudabi32_module.c - copied, changed from r304561, head/sys/compat/cloudabi64/cloudabi64_module.c head/sys/compat/cloudabi32/cloudabi32_poll.c - copied, changed from r304561, head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi32/cloudabi32_sock.c - copied, changed from r304561, head/sys/compat/cloudabi64/cloudabi64_sock.c head/sys/compat/cloudabi32/cloudabi32_thread.c - copied, changed from r304561, head/sys/compat/cloudabi64/cloudabi64_thread.c head/sys/compat/cloudabi32/cloudabi32_util.h - copied, changed from r304561, head/sys/compat/cloudabi64/cloudabi64_util.h head/sys/compat/cloudabi32/syscalls.conf - copied, changed from r304561, head/sys/compat/cloudabi64/syscalls.conf Modified: head/sys/conf/files head/sys/conf/options Copied and modified: head/sys/compat/cloudabi32/Makefile (from r304561, head/sys/compat/cloudabi64/Makefile) ============================================================================== --- head/sys/compat/cloudabi64/Makefile Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/Makefile Sun Aug 21 16:01:30 2016 (r304564) @@ -3,12 +3,12 @@ all: @echo "make sysent only" -sysent: cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ - cloudabi64_syscalls.c cloudabi64_systrace_args.c +sysent: cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ + cloudabi32_syscalls.c cloudabi32_systrace_args.c -cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ - cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ +cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ + cloudabi32_syscalls.c cloudabi32_systrace_args.c: \ + ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ + sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ syscalls.conf Copied and modified: head/sys/compat/cloudabi32/cloudabi32_fd.c (from r304561, head/sys/compat/cloudabi64/cloudabi64_fd.c) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_fd.c Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/cloudabi32_fd.c Sun Aug 21 16:01:30 2016 (r304564) @@ -34,17 +34,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include -#include -#include +#include +#include -/* Copies in 64-bit iovec structures from userspace. */ +/* Copies in 32-bit iovec structures from userspace. */ static int -cloudabi64_copyinuio(const cloudabi64_iovec_t *iovp, size_t iovcnt, +cloudabi32_copyinuio(const cloudabi32_iovec_t *iovp, size_t iovcnt, struct uio **uiop) { - cloudabi64_iovec_t iovobj; + cloudabi32_iovec_t iovobj; struct uio *uio; struct iovec *iov; size_t i; @@ -73,7 +73,7 @@ cloudabi64_copyinuio(const cloudabi64_io } iov[i].iov_base = TO_PTR(iovobj.iov_base); iov[i].iov_len = iovobj.iov_len; - if (iov[i].iov_len > INT64_MAX - uio->uio_resid) { + if (iov[i].iov_len > INT32_MAX - uio->uio_resid) { free(uio, M_IOV); return (EINVAL); } @@ -85,13 +85,13 @@ cloudabi64_copyinuio(const cloudabi64_io } int -cloudabi64_sys_fd_pread(struct thread *td, - struct cloudabi64_sys_fd_pread_args *uap) +cloudabi32_sys_fd_pread(struct thread *td, + struct cloudabi32_sys_fd_pread_args *uap) { struct uio *uio; int error; - error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio); + error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio); if (error != 0) return (error); error = kern_preadv(td, uap->fd, uio, uap->offset); @@ -100,13 +100,13 @@ cloudabi64_sys_fd_pread(struct thread *t } int -cloudabi64_sys_fd_pwrite(struct thread *td, - struct cloudabi64_sys_fd_pwrite_args *uap) +cloudabi32_sys_fd_pwrite(struct thread *td, + struct cloudabi32_sys_fd_pwrite_args *uap) { struct uio *uio; int error; - error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); + error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); if (error != 0) return (error); error = kern_pwritev(td, uap->fd, uio, uap->offset); @@ -115,13 +115,13 @@ cloudabi64_sys_fd_pwrite(struct thread * } int -cloudabi64_sys_fd_read(struct thread *td, - struct cloudabi64_sys_fd_read_args *uap) +cloudabi32_sys_fd_read(struct thread *td, + struct cloudabi32_sys_fd_read_args *uap) { struct uio *uio; int error; - error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio); + error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio); if (error != 0) return (error); error = kern_readv(td, uap->fd, uio); @@ -130,13 +130,13 @@ cloudabi64_sys_fd_read(struct thread *td } int -cloudabi64_sys_fd_write(struct thread *td, - struct cloudabi64_sys_fd_write_args *uap) +cloudabi32_sys_fd_write(struct thread *td, + struct cloudabi32_sys_fd_write_args *uap) { struct uio *uio; int error; - error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); + error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); if (error != 0) return (error); error = kern_writev(td, uap->fd, uio); Copied and modified: head/sys/compat/cloudabi32/cloudabi32_module.c (from r304561, head/sys/compat/cloudabi64/cloudabi64_module.c) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_module.c Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/cloudabi32_module.c Sun Aug 21 16:01:30 2016 (r304564) @@ -36,17 +36,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include -#include +#include -extern char _binary_cloudabi64_vdso_o_start[]; -extern char _binary_cloudabi64_vdso_o_end[]; +extern char _binary_cloudabi32_vdso_o_start[]; +extern char _binary_cloudabi32_vdso_o_end[]; register_t * -cloudabi64_copyout_strings(struct image_params *imgp) +cloudabi32_copyout_strings(struct image_params *imgp) { struct image_args *args; uintptr_t begin; @@ -61,10 +61,10 @@ cloudabi64_copyout_strings(struct image_ } int -cloudabi64_fixup(register_t **stack_base, struct image_params *imgp) +cloudabi32_fixup(register_t **stack_base, struct image_params *imgp) { char canarybuf[64]; - Elf64_Auxargs *args; + Elf32_Auxargs *args; struct thread *td; void *argdata, *canary; size_t argdatalen; @@ -93,13 +93,13 @@ cloudabi64_fixup(register_t **stack_base * binary safe, we had to add a trailing null byte in * exec_copyin_data_fds(). Undo this by reducing the length. */ - args = (Elf64_Auxargs *)imgp->auxargs; + args = (Elf32_Auxargs *)imgp->auxargs; argdatalen = imgp->args->begin_envv - imgp->args->begin_argv; if (argdatalen > 0) --argdatalen; /* Write out an auxiliary vector. */ - cloudabi64_auxv_t auxv[] = { + cloudabi32_auxv_t auxv[] = { #define VAL(type, val) { .a_type = (type), .a_val = (val) } #define PTR(type, ptr) { .a_type = (type), .a_ptr = (uintptr_t)(ptr) } PTR(CLOUDABI_AT_ARGDATA, argdata), @@ -124,44 +124,44 @@ cloudabi64_fixup(register_t **stack_base return (error); /* Reserve space for storing the TCB. */ - *stack_base -= howmany(sizeof(cloudabi64_tcb_t), sizeof(register_t)); + *stack_base -= howmany(sizeof(cloudabi32_tcb_t), sizeof(register_t)); return (0); } static int -cloudabi64_modevent(module_t mod, int type, void *data) +cloudabi32_modevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - cloudabi_vdso_init(cloudabi64_brand.sysvec, - _binary_cloudabi64_vdso_o_start, - _binary_cloudabi64_vdso_o_end); - if (elf64_insert_brand_entry(&cloudabi64_brand) < 0) { + cloudabi_vdso_init(cloudabi32_brand.sysvec, + _binary_cloudabi32_vdso_o_start, + _binary_cloudabi32_vdso_o_end); + if (elf32_insert_brand_entry(&cloudabi32_brand) < 0) { printf("Failed to add CloudABI ELF brand handler\n"); return (EINVAL); } return (0); case MOD_UNLOAD: - if (elf64_brand_inuse(&cloudabi64_brand)) + if (elf32_brand_inuse(&cloudabi32_brand)) return (EBUSY); - if (elf64_remove_brand_entry(&cloudabi64_brand) < 0) { + if (elf32_remove_brand_entry(&cloudabi32_brand) < 0) { printf("Failed to remove CloudABI ELF brand handler\n"); return (EINVAL); } - cloudabi_vdso_destroy(cloudabi64_brand.sysvec); + cloudabi_vdso_destroy(cloudabi32_brand.sysvec); return (0); default: return (EOPNOTSUPP); } } -static moduledata_t cloudabi64_module = { - "cloudabi64", - cloudabi64_modevent, +static moduledata_t cloudabi32_module = { + "cloudabi32", + cloudabi32_modevent, NULL }; -DECLARE_MODULE_TIED(cloudabi64, cloudabi64_module, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(cloudabi64, cloudabi, 1, 1, 1); -FEATURE(cloudabi64, "CloudABI 64bit support"); +DECLARE_MODULE_TIED(cloudabi32, cloudabi32_module, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_DEPEND(cloudabi32, cloudabi, 1, 1, 1); +FEATURE(cloudabi32, "CloudABI 32bit support"); Copied and modified: head/sys/compat/cloudabi32/cloudabi32_poll.c (from r304561, head/sys/compat/cloudabi64/cloudabi64_poll.c) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/cloudabi32_poll.c Sun Aug 21 16:01:30 2016 (r304564) @@ -30,12 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include -#include -#include +#include +#include /* Converts a FreeBSD signal number to a CloudABI signal number. */ static cloudabi_signal_t @@ -76,18 +76,18 @@ convert_signal(int sig) return (signals[sig]); } -struct cloudabi64_kevent_args { - const cloudabi64_subscription_t *in; - cloudabi64_event_t *out; +struct cloudabi32_kevent_args { + const cloudabi32_subscription_t *in; + cloudabi32_event_t *out; bool once; }; /* Converts CloudABI's subscription objects to FreeBSD's struct kevent. */ static int -cloudabi64_kevent_copyin(void *arg, struct kevent *kevp, int count) +cloudabi32_kevent_copyin(void *arg, struct kevent *kevp, int count) { - cloudabi64_subscription_t sub; - struct cloudabi64_kevent_args *args; + cloudabi32_subscription_t sub; + struct cloudabi32_kevent_args *args; cloudabi_timestamp_t ts; int error; @@ -163,10 +163,10 @@ cloudabi64_kevent_copyin(void *arg, stru /* Converts FreeBSD's struct kevent to CloudABI's event objects. */ static int -cloudabi64_kevent_copyout(void *arg, struct kevent *kevp, int count) +cloudabi32_kevent_copyout(void *arg, struct kevent *kevp, int count) { - cloudabi64_event_t ev; - struct cloudabi64_kevent_args *args; + cloudabi32_event_t ev; + struct cloudabi32_kevent_args *args; int error; args = arg; @@ -233,16 +233,16 @@ cloudabi64_kevent_copyout(void *arg, str } int -cloudabi64_sys_poll(struct thread *td, struct cloudabi64_sys_poll_args *uap) +cloudabi32_sys_poll(struct thread *td, struct cloudabi32_sys_poll_args *uap) { - struct cloudabi64_kevent_args args = { + struct cloudabi32_kevent_args args = { .in = uap->in, .out = uap->out, .once = true, }; struct kevent_copyops copyops = { - .k_copyin = cloudabi64_kevent_copyin, - .k_copyout = cloudabi64_kevent_copyout, + .k_copyin = cloudabi32_kevent_copyin, + .k_copyout = cloudabi32_kevent_copyout, .arg = &args, }; @@ -251,8 +251,8 @@ cloudabi64_sys_poll(struct thread *td, s * implemented through FreeBSD's kqueue(). */ if (uap->nsubscriptions == 1) { - cloudabi64_subscription_t sub; - cloudabi64_event_t ev = {}; + cloudabi32_subscription_t sub; + cloudabi32_event_t ev = {}; int error; error = copyin(uap->in, &sub, sizeof(sub)); @@ -294,8 +294,8 @@ cloudabi64_sys_poll(struct thread *td, s return (copyout(&ev, uap->out, sizeof(ev))); } } else if (uap->nsubscriptions == 2) { - cloudabi64_subscription_t sub[2]; - cloudabi64_event_t ev[2] = {}; + cloudabi32_subscription_t sub[2]; + cloudabi32_event_t ev[2] = {}; int error; error = copyin(uap->in, &sub, sizeof(sub)); @@ -371,20 +371,20 @@ cloudabi64_sys_poll(struct thread *td, s } int -cloudabi64_sys_poll_fd(struct thread *td, - struct cloudabi64_sys_poll_fd_args *uap) +cloudabi32_sys_poll_fd(struct thread *td, + struct cloudabi32_sys_poll_fd_args *uap) { - struct cloudabi64_kevent_args args = { + struct cloudabi32_kevent_args args = { .in = uap->in, .out = uap->out, .once = false, }; struct kevent_copyops copyops = { - .k_copyin = cloudabi64_kevent_copyin, - .k_copyout = cloudabi64_kevent_copyout, + .k_copyin = cloudabi32_kevent_copyin, + .k_copyout = cloudabi32_kevent_copyout, .arg = &args, }; - cloudabi64_subscription_t subtimo; + cloudabi32_subscription_t subtimo; struct timespec timeout; int error; Copied and modified: head/sys/compat/cloudabi32/cloudabi32_sock.c (from r304561, head/sys/compat/cloudabi64/cloudabi64_sock.c) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sock.c Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/cloudabi32_sock.c Sun Aug 21 16:01:30 2016 (r304564) @@ -35,25 +35,25 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include -#include -#include +#include +#include static MALLOC_DEFINE(M_SOCKET, "socket", "CloudABI socket"); int -cloudabi64_sys_sock_recv(struct thread *td, - struct cloudabi64_sys_sock_recv_args *uap) +cloudabi32_sys_sock_recv(struct thread *td, + struct cloudabi32_sys_sock_recv_args *uap) { struct sockaddr_storage ss; - cloudabi64_recv_in_t ri; - cloudabi64_recv_out_t ro = {}; - cloudabi64_iovec_t iovobj; + cloudabi32_recv_in_t ri; + cloudabi32_recv_out_t ro = {}; + cloudabi32_iovec_t iovobj; struct msghdr msghdr = {}; - const cloudabi64_iovec_t *user_iov; + const cloudabi32_iovec_t *user_iov; size_t i; int error; @@ -99,14 +99,14 @@ cloudabi64_sys_sock_recv(struct thread * } int -cloudabi64_sys_sock_send(struct thread *td, - struct cloudabi64_sys_sock_send_args *uap) +cloudabi32_sys_sock_send(struct thread *td, + struct cloudabi32_sys_sock_send_args *uap) { - cloudabi64_send_in_t si; - cloudabi64_send_out_t so = {}; - cloudabi64_ciovec_t iovobj; + cloudabi32_send_in_t si; + cloudabi32_send_out_t so = {}; + cloudabi32_ciovec_t iovobj; struct msghdr msghdr = {}; - const cloudabi64_ciovec_t *user_iov; + const cloudabi32_ciovec_t *user_iov; size_t i; int error, flags; Copied and modified: head/sys/compat/cloudabi32/cloudabi32_thread.c (from r304561, head/sys/compat/cloudabi64/cloudabi64_thread.c) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_thread.c Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/cloudabi32_thread.c Sun Aug 21 16:01:30 2016 (r304564) @@ -30,14 +30,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include -#include -#include +#include +#include struct thread_create_args { - cloudabi64_threadattr_t attr; - uint64_t tcb; + cloudabi32_threadattr_t attr; + uint32_t tcb; lwpid_t tid; }; @@ -50,12 +50,12 @@ initialize_thread(struct thread *td, voi args->tid = td->td_tid; /* Set up initial register contents. */ - return (cloudabi64_thread_setregs(td, &args->attr, args->tcb)); + return (cloudabi32_thread_setregs(td, &args->attr, args->tcb)); } int -cloudabi64_sys_thread_create(struct thread *td, - struct cloudabi64_sys_thread_create_args *uap) +cloudabi32_sys_thread_create(struct thread *td, + struct cloudabi32_sys_thread_create_args *uap) { struct thread_create_args args; int error; @@ -66,7 +66,7 @@ cloudabi64_sys_thread_create(struct thre /* Remove some space on the top of the stack for the TCB. */ args.tcb = rounddown(args.attr.stack + args.attr.stack_size - - sizeof(cloudabi64_tcb_t), _Alignof(cloudabi64_tcb_t)); + sizeof(cloudabi32_tcb_t), _Alignof(cloudabi32_tcb_t)); args.attr.stack_size = args.tcb - args.attr.stack; error = thread_create(td, NULL, initialize_thread, &args); Copied and modified: head/sys/compat/cloudabi32/cloudabi32_util.h (from r304561, head/sys/compat/cloudabi64/cloudabi64_util.h) ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_util.h Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/cloudabi32_util.h Sun Aug 21 16:01:30 2016 (r304564) @@ -25,27 +25,27 @@ * $FreeBSD$ */ -#ifndef _CLOUDABI64_UTIL_H_ -#define _CLOUDABI64_UTIL_H_ +#ifndef _CLOUDABI32_UTIL_H_ +#define _CLOUDABI32_UTIL_H_ #include -#define __ELF_WORD_SIZE 64 +#define __ELF_WORD_SIZE 32 #include -#include +#include struct image_params; struct thread; -extern Elf64_Brandinfo cloudabi64_brand; +extern Elf32_Brandinfo cloudabi32_brand; #define TO_PTR(x) ((void *)(uintptr_t)(x)) /* Stack initialization during process execution. */ -register_t *cloudabi64_copyout_strings(struct image_params *); -int cloudabi64_fixup(register_t **, struct image_params *); +register_t *cloudabi32_copyout_strings(struct image_params *); +int cloudabi32_fixup(register_t **, struct image_params *); -int cloudabi64_thread_setregs(struct thread *, - const cloudabi64_threadattr_t *, uint64_t); +int cloudabi32_thread_setregs(struct thread *, + const cloudabi32_threadattr_t *, uint32_t); #endif Copied and modified: head/sys/compat/cloudabi32/syscalls.conf (from r304561, head/sys/compat/cloudabi64/syscalls.conf) ============================================================================== --- head/sys/compat/cloudabi64/syscalls.conf Sun Aug 21 15:41:19 2016 (r304561, copy source) +++ head/sys/compat/cloudabi32/syscalls.conf Sun Aug 21 16:01:30 2016 (r304564) @@ -1,14 +1,14 @@ # $FreeBSD$ -sysnames="cloudabi64_syscalls.c" -sysproto="cloudabi64_proto.h" -sysproto_h=_CLOUDABI64_SYSPROTO_H_ -syshdr="cloudabi64_syscall.h" -syssw="cloudabi64_sysent.c" +sysnames="cloudabi32_syscalls.c" +sysproto="cloudabi32_proto.h" +sysproto_h=_CLOUDABI32_SYSPROTO_H_ +syshdr="cloudabi32_syscall.h" +syssw="cloudabi32_sysent.c" sysmk="/dev/null" -syscallprefix="CLOUDABI64_SYS_" -switchname="cloudabi64_sysent" -namesname="cloudabi64_syscallnames" -systrace="cloudabi64_systrace_args.c" +syscallprefix="CLOUDABI32_SYS_" +switchname="cloudabi32_sysent" +namesname="cloudabi32_syscallnames" +systrace="cloudabi32_systrace_args.c" # Allow all system calls in capabilities mode. Extract the names of the # system calls from syscalls.master. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Aug 21 15:56:19 2016 (r304563) +++ head/sys/conf/files Sun Aug 21 16:01:30 2016 (r304564) @@ -274,17 +274,24 @@ cddl/dev/fbt/fbt.c optional dtrace_fbt cddl/dev/systrace/systrace.c optional dtrace_systrace | dtraceall compile-with "${CDDL_C}" cddl/dev/prototype.c optional dtrace_prototype | dtraceall compile-with "${CDDL_C}" fs/nfsclient/nfs_clkdtrace.c optional dtnfscl nfscl | dtraceall nfscl compile-with "${CDDL_C}" -compat/cloudabi/cloudabi_clock.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_errno.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_fd.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_file.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_futex.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_mem.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_proc.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_random.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_sock.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_thread.c optional compat_cloudabi64 -compat/cloudabi/cloudabi_vdso.c optional compat_cloudabi64 +compat/cloudabi/cloudabi_clock.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_errno.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_fd.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_file.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_futex.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_mem.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_proc.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_random.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_sock.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_thread.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi/cloudabi_vdso.c optional compat_cloudabi32 | compat_cloudabi64 +compat/cloudabi32/cloudabi32_fd.c optional compat_cloudabi32 +compat/cloudabi32/cloudabi32_module.c optional compat_cloudabi32 +compat/cloudabi32/cloudabi32_poll.c optional compat_cloudabi32 +compat/cloudabi32/cloudabi32_sock.c optional compat_cloudabi32 +compat/cloudabi32/cloudabi32_syscalls.c optional compat_cloudabi32 +compat/cloudabi32/cloudabi32_sysent.c optional compat_cloudabi32 +compat/cloudabi32/cloudabi32_thread.c optional compat_cloudabi32 compat/cloudabi64/cloudabi64_fd.c optional compat_cloudabi64 compat/cloudabi64/cloudabi64_module.c optional compat_cloudabi64 compat/cloudabi64/cloudabi64_poll.c optional compat_cloudabi64 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Aug 21 15:56:19 2016 (r304563) +++ head/sys/conf/options Sun Aug 21 16:01:30 2016 (r304564) @@ -86,6 +86,7 @@ COMPAT_FREEBSD6 opt_compat.h COMPAT_FREEBSD7 opt_compat.h COMPAT_FREEBSD9 opt_compat.h COMPAT_FREEBSD10 opt_compat.h +COMPAT_CLOUDABI32 opt_dontuse.h COMPAT_CLOUDABI64 opt_dontuse.h COMPAT_LINUXKPI opt_compat.h COMPILING_LINT opt_global.h From owner-svn-src-head@freebsd.org Sun Aug 21 16:02:26 2016 Return-Path: Delivered-To: svn-src-head@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 D55B2BC1516; Sun, 21 Aug 2016 16:02:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A43A1BF1; Sun, 21 Aug 2016 16:02:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LG2P4a063769; Sun, 21 Aug 2016 16:02:25 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LG2PiA063764; Sun, 21 Aug 2016 16:02:25 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608211602.u7LG2PiA063764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 21 Aug 2016 16:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304565 - head/sys/compat/cloudabi32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 16:02:26 -0000 Author: ed Date: Sun Aug 21 16:02:25 2016 New Revision: 304565 URL: https://svnweb.freebsd.org/changeset/base/304565 Log: Add source files generated from the 32-bit system call table. Added: head/sys/compat/cloudabi32/cloudabi32_proto.h (contents, props changed) head/sys/compat/cloudabi32/cloudabi32_syscall.h (contents, props changed) head/sys/compat/cloudabi32/cloudabi32_syscalls.c (contents, props changed) head/sys/compat/cloudabi32/cloudabi32_sysent.c (contents, props changed) head/sys/compat/cloudabi32/cloudabi32_systrace_args.c (contents, props changed) Added: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Sun Aug 21 16:02:25 2016 (r304565) @@ -0,0 +1,465 @@ +/* + * System call prototypes. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + */ + +#ifndef _CLOUDABI32_SYSPROTO_H_ +#define _CLOUDABI32_SYSPROTO_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include + +struct proc; + +struct thread; + +#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ + 0 : sizeof(register_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +struct cloudabi_sys_clock_res_get_args { + char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)]; +}; +struct cloudabi_sys_clock_time_get_args { + char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)]; + char precision_l_[PADL_(cloudabi_timestamp_t)]; cloudabi_timestamp_t precision; char precision_r_[PADR_(cloudabi_timestamp_t)]; +}; +struct cloudabi_sys_condvar_signal_args { + char condvar_l_[PADL_(cloudabi_condvar_t *)]; cloudabi_condvar_t * condvar; char condvar_r_[PADR_(cloudabi_condvar_t *)]; + char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; + char nwaiters_l_[PADL_(cloudabi_nthreads_t)]; cloudabi_nthreads_t nwaiters; char nwaiters_r_[PADR_(cloudabi_nthreads_t)]; +}; +struct cloudabi_sys_fd_close_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; +}; +struct cloudabi_sys_fd_create1_args { + char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; +}; +struct cloudabi_sys_fd_create2_args { + char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; +}; +struct cloudabi_sys_fd_datasync_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; +}; +struct cloudabi_sys_fd_dup_args { + char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; +}; +struct cloudabi32_sys_fd_pread_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; +}; +struct cloudabi32_sys_fd_pwrite_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; +}; +struct cloudabi32_sys_fd_read_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_fd_replace_args { + char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; + char to_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t to; char to_r_[PADR_(cloudabi_fd_t)]; +}; +struct cloudabi_sys_fd_seek_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char offset_l_[PADL_(cloudabi_filedelta_t)]; cloudabi_filedelta_t offset; char offset_r_[PADR_(cloudabi_filedelta_t)]; + char whence_l_[PADL_(cloudabi_whence_t)]; cloudabi_whence_t whence; char whence_r_[PADR_(cloudabi_whence_t)]; +}; +struct cloudabi_sys_fd_stat_get_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(cloudabi_fdstat_t *)]; cloudabi_fdstat_t * buf; char buf_r_[PADR_(cloudabi_fdstat_t *)]; +}; +struct cloudabi_sys_fd_stat_put_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * buf; char buf_r_[PADR_(const cloudabi_fdstat_t *)]; + char flags_l_[PADL_(cloudabi_fdsflags_t)]; cloudabi_fdsflags_t flags; char flags_r_[PADR_(cloudabi_fdsflags_t)]; +}; +struct cloudabi_sys_fd_sync_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; +}; +struct cloudabi32_sys_fd_write_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)]; + char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_file_advise_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; + char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)]; + char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; +}; +struct cloudabi_sys_file_allocate_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; + char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)]; +}; +struct cloudabi_sys_file_create_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; +}; +struct cloudabi_sys_file_link_args { + char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)]; + char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; + char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)]; + char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; + char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; + char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_file_open_args { + char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)]; + char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)]; +}; +struct cloudabi_sys_file_readdir_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; + char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)]; +}; +struct cloudabi_sys_file_readlink_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_file_rename_args { + char oldfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t oldfd; char oldfd_r_[PADR_(cloudabi_fd_t)]; + char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)]; + char oldlen_l_[PADL_(size_t)]; size_t oldlen; char oldlen_r_[PADR_(size_t)]; + char newfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t newfd; char newfd_r_[PADR_(cloudabi_fd_t)]; + char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)]; + char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_file_stat_fget_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; +}; +struct cloudabi_sys_file_stat_fput_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; + char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; +}; +struct cloudabi_sys_file_stat_get_args { + char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; +}; +struct cloudabi_sys_file_stat_put_args { + char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; + char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; +}; +struct cloudabi_sys_file_symlink_args { + char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; + char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)]; + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; + char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_file_unlink_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)]; +}; +struct cloudabi_sys_lock_unlock_args { + char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; + char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; +}; +struct cloudabi_sys_mem_advise_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; +}; +struct cloudabi_sys_mem_lock_args { + char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_mem_map_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; + char flags_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t flags; char flags_r_[PADR_(cloudabi_mflags_t)]; + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)]; +}; +struct cloudabi_sys_mem_protect_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; +}; +struct cloudabi_sys_mem_sync_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)]; +}; +struct cloudabi_sys_mem_unlock_args { + char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_mem_unmap_args { + char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; + char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; +}; +struct cloudabi32_sys_poll_args { + char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; + char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; + char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; +}; +struct cloudabi32_sys_poll_fd_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; + char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; + char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; + char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; + char timeout_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi32_subscription_t *)]; +}; +struct cloudabi_sys_proc_exec_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; + char datalen_l_[PADL_(size_t)]; size_t datalen; char datalen_r_[PADR_(size_t)]; + char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)]; + char fdslen_l_[PADL_(size_t)]; size_t fdslen; char fdslen_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_proc_exit_args { + char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)]; +}; +struct cloudabi_sys_proc_fork_args { + register_t dummy; +}; +struct cloudabi_sys_proc_raise_args { + char sig_l_[PADL_(cloudabi_signal_t)]; cloudabi_signal_t sig; char sig_r_[PADR_(cloudabi_signal_t)]; +}; +struct cloudabi_sys_random_get_args { + char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; + char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_sock_accept_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; +}; +struct cloudabi_sys_sock_bind_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_sock_connect_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; +}; +struct cloudabi_sys_sock_listen_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)]; +}; +struct cloudabi32_sys_sock_recv_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char in_l_[PADL_(const cloudabi32_recv_in_t *)]; const cloudabi32_recv_in_t * in; char in_r_[PADR_(const cloudabi32_recv_in_t *)]; + char out_l_[PADL_(cloudabi32_recv_out_t *)]; cloudabi32_recv_out_t * out; char out_r_[PADR_(cloudabi32_recv_out_t *)]; +}; +struct cloudabi32_sys_sock_send_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char in_l_[PADL_(const cloudabi32_send_in_t *)]; const cloudabi32_send_in_t * in; char in_r_[PADR_(const cloudabi32_send_in_t *)]; + char out_l_[PADL_(cloudabi32_send_out_t *)]; cloudabi32_send_out_t * out; char out_r_[PADR_(cloudabi32_send_out_t *)]; +}; +struct cloudabi_sys_sock_shutdown_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char how_l_[PADL_(cloudabi_sdflags_t)]; cloudabi_sdflags_t how; char how_r_[PADR_(cloudabi_sdflags_t)]; +}; +struct cloudabi_sys_sock_stat_get_args { + char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; + char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)]; + char flags_l_[PADL_(cloudabi_ssflags_t)]; cloudabi_ssflags_t flags; char flags_r_[PADR_(cloudabi_ssflags_t)]; +}; +struct cloudabi32_sys_thread_create_args { + char attr_l_[PADL_(cloudabi32_threadattr_t *)]; cloudabi32_threadattr_t * attr; char attr_r_[PADR_(cloudabi32_threadattr_t *)]; +}; +struct cloudabi_sys_thread_exit_args { + char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; + char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; +}; +struct cloudabi_sys_thread_yield_args { + register_t dummy; +}; +int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); +int cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *); +int cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *); +int cloudabi_sys_fd_close(struct thread *, struct cloudabi_sys_fd_close_args *); +int cloudabi_sys_fd_create1(struct thread *, struct cloudabi_sys_fd_create1_args *); +int cloudabi_sys_fd_create2(struct thread *, struct cloudabi_sys_fd_create2_args *); +int cloudabi_sys_fd_datasync(struct thread *, struct cloudabi_sys_fd_datasync_args *); +int cloudabi_sys_fd_dup(struct thread *, struct cloudabi_sys_fd_dup_args *); +int cloudabi32_sys_fd_pread(struct thread *, struct cloudabi32_sys_fd_pread_args *); +int cloudabi32_sys_fd_pwrite(struct thread *, struct cloudabi32_sys_fd_pwrite_args *); +int cloudabi32_sys_fd_read(struct thread *, struct cloudabi32_sys_fd_read_args *); +int cloudabi_sys_fd_replace(struct thread *, struct cloudabi_sys_fd_replace_args *); +int cloudabi_sys_fd_seek(struct thread *, struct cloudabi_sys_fd_seek_args *); +int cloudabi_sys_fd_stat_get(struct thread *, struct cloudabi_sys_fd_stat_get_args *); +int cloudabi_sys_fd_stat_put(struct thread *, struct cloudabi_sys_fd_stat_put_args *); +int cloudabi_sys_fd_sync(struct thread *, struct cloudabi_sys_fd_sync_args *); +int cloudabi32_sys_fd_write(struct thread *, struct cloudabi32_sys_fd_write_args *); +int cloudabi_sys_file_advise(struct thread *, struct cloudabi_sys_file_advise_args *); +int cloudabi_sys_file_allocate(struct thread *, struct cloudabi_sys_file_allocate_args *); +int cloudabi_sys_file_create(struct thread *, struct cloudabi_sys_file_create_args *); +int cloudabi_sys_file_link(struct thread *, struct cloudabi_sys_file_link_args *); +int cloudabi_sys_file_open(struct thread *, struct cloudabi_sys_file_open_args *); +int cloudabi_sys_file_readdir(struct thread *, struct cloudabi_sys_file_readdir_args *); +int cloudabi_sys_file_readlink(struct thread *, struct cloudabi_sys_file_readlink_args *); +int cloudabi_sys_file_rename(struct thread *, struct cloudabi_sys_file_rename_args *); +int cloudabi_sys_file_stat_fget(struct thread *, struct cloudabi_sys_file_stat_fget_args *); +int cloudabi_sys_file_stat_fput(struct thread *, struct cloudabi_sys_file_stat_fput_args *); +int cloudabi_sys_file_stat_get(struct thread *, struct cloudabi_sys_file_stat_get_args *); +int cloudabi_sys_file_stat_put(struct thread *, struct cloudabi_sys_file_stat_put_args *); +int cloudabi_sys_file_symlink(struct thread *, struct cloudabi_sys_file_symlink_args *); +int cloudabi_sys_file_unlink(struct thread *, struct cloudabi_sys_file_unlink_args *); +int cloudabi_sys_lock_unlock(struct thread *, struct cloudabi_sys_lock_unlock_args *); +int cloudabi_sys_mem_advise(struct thread *, struct cloudabi_sys_mem_advise_args *); +int cloudabi_sys_mem_lock(struct thread *, struct cloudabi_sys_mem_lock_args *); +int cloudabi_sys_mem_map(struct thread *, struct cloudabi_sys_mem_map_args *); +int cloudabi_sys_mem_protect(struct thread *, struct cloudabi_sys_mem_protect_args *); +int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *); +int cloudabi_sys_mem_unlock(struct thread *, struct cloudabi_sys_mem_unlock_args *); +int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); +int cloudabi32_sys_poll(struct thread *, struct cloudabi32_sys_poll_args *); +int cloudabi32_sys_poll_fd(struct thread *, struct cloudabi32_sys_poll_fd_args *); +int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); +int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); +int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); +int cloudabi_sys_proc_raise(struct thread *, struct cloudabi_sys_proc_raise_args *); +int cloudabi_sys_random_get(struct thread *, struct cloudabi_sys_random_get_args *); +int cloudabi_sys_sock_accept(struct thread *, struct cloudabi_sys_sock_accept_args *); +int cloudabi_sys_sock_bind(struct thread *, struct cloudabi_sys_sock_bind_args *); +int cloudabi_sys_sock_connect(struct thread *, struct cloudabi_sys_sock_connect_args *); +int cloudabi_sys_sock_listen(struct thread *, struct cloudabi_sys_sock_listen_args *); +int cloudabi32_sys_sock_recv(struct thread *, struct cloudabi32_sys_sock_recv_args *); +int cloudabi32_sys_sock_send(struct thread *, struct cloudabi32_sys_sock_send_args *); +int cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdown_args *); +int cloudabi_sys_sock_stat_get(struct thread *, struct cloudabi_sys_sock_stat_get_args *); +int cloudabi32_sys_thread_create(struct thread *, struct cloudabi32_sys_thread_create_args *); +int cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *); +int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *); + +#ifdef COMPAT_43 + + +#endif /* COMPAT_43 */ + + +#ifdef COMPAT_FREEBSD4 + + +#endif /* COMPAT_FREEBSD4 */ + + +#ifdef COMPAT_FREEBSD6 + + +#endif /* COMPAT_FREEBSD6 */ + + +#ifdef COMPAT_FREEBSD7 + + +#endif /* COMPAT_FREEBSD7 */ + + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ + +#define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_close AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_create1 AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_create2 AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_datasync AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_dup AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_pread AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_pwrite AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_read AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_replace AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_seek AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_stat_get AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_stat_put AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_fd_sync AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_write AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_advise AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_allocate AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_create AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_link AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_open AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_readdir AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_readlink AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_rename AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_fget AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_fput AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_get AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_put AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_symlink AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_file_unlink AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_lock_unlock AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_advise AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_lock AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_map AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_protect AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unlock AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll_fd AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_raise AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_random_get AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_accept AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_bind AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_connect AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_listen AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_recv AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_send AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_shutdown AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_sock_stat_get AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi32_sys_thread_create AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_thread_exit AUE_NULL +#define CLOUDABI32_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL + +#undef PAD_ +#undef PADL_ +#undef PADR_ + +#endif /* !_CLOUDABI32_SYSPROTO_H_ */ Added: head/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h Sun Aug 21 16:02:25 2016 (r304565) @@ -0,0 +1,66 @@ +/* + * System call numbers. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + */ + +#define CLOUDABI32_SYS_cloudabi_sys_clock_res_get 0 +#define CLOUDABI32_SYS_cloudabi_sys_clock_time_get 1 +#define CLOUDABI32_SYS_cloudabi_sys_condvar_signal 2 +#define CLOUDABI32_SYS_cloudabi_sys_fd_close 3 +#define CLOUDABI32_SYS_cloudabi_sys_fd_create1 4 +#define CLOUDABI32_SYS_cloudabi_sys_fd_create2 5 +#define CLOUDABI32_SYS_cloudabi_sys_fd_datasync 6 +#define CLOUDABI32_SYS_cloudabi_sys_fd_dup 7 +#define CLOUDABI32_SYS_cloudabi32_sys_fd_pread 8 +#define CLOUDABI32_SYS_cloudabi32_sys_fd_pwrite 9 +#define CLOUDABI32_SYS_cloudabi32_sys_fd_read 10 +#define CLOUDABI32_SYS_cloudabi_sys_fd_replace 11 +#define CLOUDABI32_SYS_cloudabi_sys_fd_seek 12 +#define CLOUDABI32_SYS_cloudabi_sys_fd_stat_get 13 +#define CLOUDABI32_SYS_cloudabi_sys_fd_stat_put 14 +#define CLOUDABI32_SYS_cloudabi_sys_fd_sync 15 +#define CLOUDABI32_SYS_cloudabi32_sys_fd_write 16 +#define CLOUDABI32_SYS_cloudabi_sys_file_advise 17 +#define CLOUDABI32_SYS_cloudabi_sys_file_allocate 18 +#define CLOUDABI32_SYS_cloudabi_sys_file_create 19 +#define CLOUDABI32_SYS_cloudabi_sys_file_link 20 +#define CLOUDABI32_SYS_cloudabi_sys_file_open 21 +#define CLOUDABI32_SYS_cloudabi_sys_file_readdir 22 +#define CLOUDABI32_SYS_cloudabi_sys_file_readlink 23 +#define CLOUDABI32_SYS_cloudabi_sys_file_rename 24 +#define CLOUDABI32_SYS_cloudabi_sys_file_stat_fget 25 +#define CLOUDABI32_SYS_cloudabi_sys_file_stat_fput 26 +#define CLOUDABI32_SYS_cloudabi_sys_file_stat_get 27 +#define CLOUDABI32_SYS_cloudabi_sys_file_stat_put 28 +#define CLOUDABI32_SYS_cloudabi_sys_file_symlink 29 +#define CLOUDABI32_SYS_cloudabi_sys_file_unlink 30 +#define CLOUDABI32_SYS_cloudabi_sys_lock_unlock 31 +#define CLOUDABI32_SYS_cloudabi_sys_mem_advise 32 +#define CLOUDABI32_SYS_cloudabi_sys_mem_lock 33 +#define CLOUDABI32_SYS_cloudabi_sys_mem_map 34 +#define CLOUDABI32_SYS_cloudabi_sys_mem_protect 35 +#define CLOUDABI32_SYS_cloudabi_sys_mem_sync 36 +#define CLOUDABI32_SYS_cloudabi_sys_mem_unlock 37 +#define CLOUDABI32_SYS_cloudabi_sys_mem_unmap 38 +#define CLOUDABI32_SYS_cloudabi32_sys_poll 39 +#define CLOUDABI32_SYS_cloudabi32_sys_poll_fd 40 +#define CLOUDABI32_SYS_cloudabi_sys_proc_exec 41 +#define CLOUDABI32_SYS_cloudabi_sys_proc_exit 42 +#define CLOUDABI32_SYS_cloudabi_sys_proc_fork 43 +#define CLOUDABI32_SYS_cloudabi_sys_proc_raise 44 +#define CLOUDABI32_SYS_cloudabi_sys_random_get 45 +#define CLOUDABI32_SYS_cloudabi_sys_sock_accept 46 +#define CLOUDABI32_SYS_cloudabi_sys_sock_bind 47 +#define CLOUDABI32_SYS_cloudabi_sys_sock_connect 48 +#define CLOUDABI32_SYS_cloudabi_sys_sock_listen 49 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 50 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 51 +#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 52 +#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 53 +#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 54 +#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 55 +#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 56 +#define CLOUDABI32_SYS_MAXSYSCALL 57 Added: head/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c Sun Aug 21 16:02:25 2016 (r304565) @@ -0,0 +1,67 @@ +/* + * System call names. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + */ + +const char *cloudabi32_syscallnames[] = { + "cloudabi_sys_clock_res_get", /* 0 = cloudabi_sys_clock_res_get */ + "cloudabi_sys_clock_time_get", /* 1 = cloudabi_sys_clock_time_get */ + "cloudabi_sys_condvar_signal", /* 2 = cloudabi_sys_condvar_signal */ + "cloudabi_sys_fd_close", /* 3 = cloudabi_sys_fd_close */ + "cloudabi_sys_fd_create1", /* 4 = cloudabi_sys_fd_create1 */ + "cloudabi_sys_fd_create2", /* 5 = cloudabi_sys_fd_create2 */ + "cloudabi_sys_fd_datasync", /* 6 = cloudabi_sys_fd_datasync */ + "cloudabi_sys_fd_dup", /* 7 = cloudabi_sys_fd_dup */ + "cloudabi32_sys_fd_pread", /* 8 = cloudabi32_sys_fd_pread */ + "cloudabi32_sys_fd_pwrite", /* 9 = cloudabi32_sys_fd_pwrite */ + "cloudabi32_sys_fd_read", /* 10 = cloudabi32_sys_fd_read */ + "cloudabi_sys_fd_replace", /* 11 = cloudabi_sys_fd_replace */ + "cloudabi_sys_fd_seek", /* 12 = cloudabi_sys_fd_seek */ + "cloudabi_sys_fd_stat_get", /* 13 = cloudabi_sys_fd_stat_get */ + "cloudabi_sys_fd_stat_put", /* 14 = cloudabi_sys_fd_stat_put */ + "cloudabi_sys_fd_sync", /* 15 = cloudabi_sys_fd_sync */ + "cloudabi32_sys_fd_write", /* 16 = cloudabi32_sys_fd_write */ + "cloudabi_sys_file_advise", /* 17 = cloudabi_sys_file_advise */ + "cloudabi_sys_file_allocate", /* 18 = cloudabi_sys_file_allocate */ + "cloudabi_sys_file_create", /* 19 = cloudabi_sys_file_create */ + "cloudabi_sys_file_link", /* 20 = cloudabi_sys_file_link */ + "cloudabi_sys_file_open", /* 21 = cloudabi_sys_file_open */ + "cloudabi_sys_file_readdir", /* 22 = cloudabi_sys_file_readdir */ + "cloudabi_sys_file_readlink", /* 23 = cloudabi_sys_file_readlink */ + "cloudabi_sys_file_rename", /* 24 = cloudabi_sys_file_rename */ + "cloudabi_sys_file_stat_fget", /* 25 = cloudabi_sys_file_stat_fget */ + "cloudabi_sys_file_stat_fput", /* 26 = cloudabi_sys_file_stat_fput */ + "cloudabi_sys_file_stat_get", /* 27 = cloudabi_sys_file_stat_get */ + "cloudabi_sys_file_stat_put", /* 28 = cloudabi_sys_file_stat_put */ + "cloudabi_sys_file_symlink", /* 29 = cloudabi_sys_file_symlink */ + "cloudabi_sys_file_unlink", /* 30 = cloudabi_sys_file_unlink */ + "cloudabi_sys_lock_unlock", /* 31 = cloudabi_sys_lock_unlock */ + "cloudabi_sys_mem_advise", /* 32 = cloudabi_sys_mem_advise */ + "cloudabi_sys_mem_lock", /* 33 = cloudabi_sys_mem_lock */ + "cloudabi_sys_mem_map", /* 34 = cloudabi_sys_mem_map */ + "cloudabi_sys_mem_protect", /* 35 = cloudabi_sys_mem_protect */ + "cloudabi_sys_mem_sync", /* 36 = cloudabi_sys_mem_sync */ + "cloudabi_sys_mem_unlock", /* 37 = cloudabi_sys_mem_unlock */ + "cloudabi_sys_mem_unmap", /* 38 = cloudabi_sys_mem_unmap */ + "cloudabi32_sys_poll", /* 39 = cloudabi32_sys_poll */ + "cloudabi32_sys_poll_fd", /* 40 = cloudabi32_sys_poll_fd */ + "cloudabi_sys_proc_exec", /* 41 = cloudabi_sys_proc_exec */ + "cloudabi_sys_proc_exit", /* 42 = cloudabi_sys_proc_exit */ + "cloudabi_sys_proc_fork", /* 43 = cloudabi_sys_proc_fork */ + "cloudabi_sys_proc_raise", /* 44 = cloudabi_sys_proc_raise */ + "cloudabi_sys_random_get", /* 45 = cloudabi_sys_random_get */ + "cloudabi_sys_sock_accept", /* 46 = cloudabi_sys_sock_accept */ + "cloudabi_sys_sock_bind", /* 47 = cloudabi_sys_sock_bind */ + "cloudabi_sys_sock_connect", /* 48 = cloudabi_sys_sock_connect */ + "cloudabi_sys_sock_listen", /* 49 = cloudabi_sys_sock_listen */ + "cloudabi32_sys_sock_recv", /* 50 = cloudabi32_sys_sock_recv */ + "cloudabi32_sys_sock_send", /* 51 = cloudabi32_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 52 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 53 = cloudabi_sys_sock_stat_get */ + "cloudabi32_sys_thread_create", /* 54 = cloudabi32_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 55 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */ +}; Added: head/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c Sun Aug 21 16:02:25 2016 (r304565) @@ -0,0 +1,75 @@ +/* + * System call switch table. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + */ + +#include +#include +#include +#include + +#define AS(name) (sizeof(struct name) / sizeof(register_t)) + +/* The casts are bogus but will do for now. */ +struct sysent cloudabi32_sysent[] = { + { AS(cloudabi_sys_clock_res_get_args), (sy_call_t *)cloudabi_sys_clock_res_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 0 = cloudabi_sys_clock_res_get */ + { AS(cloudabi_sys_clock_time_get_args), (sy_call_t *)cloudabi_sys_clock_time_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 1 = cloudabi_sys_clock_time_get */ + { AS(cloudabi_sys_condvar_signal_args), (sy_call_t *)cloudabi_sys_condvar_signal, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 2 = cloudabi_sys_condvar_signal */ + { AS(cloudabi_sys_fd_close_args), (sy_call_t *)cloudabi_sys_fd_close, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 3 = cloudabi_sys_fd_close */ + { AS(cloudabi_sys_fd_create1_args), (sy_call_t *)cloudabi_sys_fd_create1, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = cloudabi_sys_fd_create1 */ + { AS(cloudabi_sys_fd_create2_args), (sy_call_t *)cloudabi_sys_fd_create2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = cloudabi_sys_fd_create2 */ + { AS(cloudabi_sys_fd_datasync_args), (sy_call_t *)cloudabi_sys_fd_datasync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = cloudabi_sys_fd_datasync */ + { AS(cloudabi_sys_fd_dup_args), (sy_call_t *)cloudabi_sys_fd_dup, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 7 = cloudabi_sys_fd_dup */ + { AS(cloudabi32_sys_fd_pread_args), (sy_call_t *)cloudabi32_sys_fd_pread, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 8 = cloudabi32_sys_fd_pread */ + { AS(cloudabi32_sys_fd_pwrite_args), (sy_call_t *)cloudabi32_sys_fd_pwrite, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 9 = cloudabi32_sys_fd_pwrite */ + { AS(cloudabi32_sys_fd_read_args), (sy_call_t *)cloudabi32_sys_fd_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 10 = cloudabi32_sys_fd_read */ + { AS(cloudabi_sys_fd_replace_args), (sy_call_t *)cloudabi_sys_fd_replace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 11 = cloudabi_sys_fd_replace */ + { AS(cloudabi_sys_fd_seek_args), (sy_call_t *)cloudabi_sys_fd_seek, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 12 = cloudabi_sys_fd_seek */ + { AS(cloudabi_sys_fd_stat_get_args), (sy_call_t *)cloudabi_sys_fd_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 13 = cloudabi_sys_fd_stat_get */ + { AS(cloudabi_sys_fd_stat_put_args), (sy_call_t *)cloudabi_sys_fd_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 14 = cloudabi_sys_fd_stat_put */ + { AS(cloudabi_sys_fd_sync_args), (sy_call_t *)cloudabi_sys_fd_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 15 = cloudabi_sys_fd_sync */ + { AS(cloudabi32_sys_fd_write_args), (sy_call_t *)cloudabi32_sys_fd_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 16 = cloudabi32_sys_fd_write */ + { AS(cloudabi_sys_file_advise_args), (sy_call_t *)cloudabi_sys_file_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = cloudabi_sys_file_advise */ + { AS(cloudabi_sys_file_allocate_args), (sy_call_t *)cloudabi_sys_file_allocate, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 18 = cloudabi_sys_file_allocate */ + { AS(cloudabi_sys_file_create_args), (sy_call_t *)cloudabi_sys_file_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = cloudabi_sys_file_create */ + { AS(cloudabi_sys_file_link_args), (sy_call_t *)cloudabi_sys_file_link, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = cloudabi_sys_file_link */ + { AS(cloudabi_sys_file_open_args), (sy_call_t *)cloudabi_sys_file_open, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 21 = cloudabi_sys_file_open */ + { AS(cloudabi_sys_file_readdir_args), (sy_call_t *)cloudabi_sys_file_readdir, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 22 = cloudabi_sys_file_readdir */ + { AS(cloudabi_sys_file_readlink_args), (sy_call_t *)cloudabi_sys_file_readlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 23 = cloudabi_sys_file_readlink */ + { AS(cloudabi_sys_file_rename_args), (sy_call_t *)cloudabi_sys_file_rename, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 24 = cloudabi_sys_file_rename */ + { AS(cloudabi_sys_file_stat_fget_args), (sy_call_t *)cloudabi_sys_file_stat_fget, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 25 = cloudabi_sys_file_stat_fget */ + { AS(cloudabi_sys_file_stat_fput_args), (sy_call_t *)cloudabi_sys_file_stat_fput, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 26 = cloudabi_sys_file_stat_fput */ + { AS(cloudabi_sys_file_stat_get_args), (sy_call_t *)cloudabi_sys_file_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 27 = cloudabi_sys_file_stat_get */ + { AS(cloudabi_sys_file_stat_put_args), (sy_call_t *)cloudabi_sys_file_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 28 = cloudabi_sys_file_stat_put */ + { AS(cloudabi_sys_file_symlink_args), (sy_call_t *)cloudabi_sys_file_symlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 29 = cloudabi_sys_file_symlink */ + { AS(cloudabi_sys_file_unlink_args), (sy_call_t *)cloudabi_sys_file_unlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = cloudabi_sys_file_unlink */ + { AS(cloudabi_sys_lock_unlock_args), (sy_call_t *)cloudabi_sys_lock_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = cloudabi_sys_lock_unlock */ + { AS(cloudabi_sys_mem_advise_args), (sy_call_t *)cloudabi_sys_mem_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = cloudabi_sys_mem_advise */ + { AS(cloudabi_sys_mem_lock_args), (sy_call_t *)cloudabi_sys_mem_lock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_lock */ + { AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_map */ + { AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_protect */ + { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_sync */ + { AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */ + { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_mem_unmap */ + { AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi32_sys_poll */ + { AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi32_sys_poll_fd */ + { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exec */ + { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_exit */ + { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_fork */ + { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_proc_raise */ + { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_random_get */ + { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_accept */ + { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_bind */ + { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_connect */ + { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_sock_listen */ + { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi32_sys_sock_recv */ + { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi32_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi32_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */ +}; Added: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Sun Aug 21 16:02:25 2016 (r304565) @@ -0,0 +1,1702 @@ +/* + * System call argument to DTrace register array converstion. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + * This file is part of the DTrace syscall provider. + */ + +static void +systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) +{ + int64_t *iarg = (int64_t *) uarg; + switch (sysnum) { + /* cloudabi_sys_clock_res_get */ + case 0: { + struct cloudabi_sys_clock_res_get_args *p = params; + iarg[0] = p->clock_id; /* cloudabi_clockid_t */ + *n_args = 1; + break; + } + /* cloudabi_sys_clock_time_get */ + case 1: { + struct cloudabi_sys_clock_time_get_args *p = params; + iarg[0] = p->clock_id; /* cloudabi_clockid_t */ + iarg[1] = p->precision; /* cloudabi_timestamp_t */ + *n_args = 2; + break; + } + /* cloudabi_sys_condvar_signal */ + case 2: { + struct cloudabi_sys_condvar_signal_args *p = params; + uarg[0] = (intptr_t) p->condvar; /* cloudabi_condvar_t * */ + iarg[1] = p->scope; /* cloudabi_scope_t */ + iarg[2] = p->nwaiters; /* cloudabi_nthreads_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_fd_close */ + case 3: { + struct cloudabi_sys_fd_close_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + *n_args = 1; + break; + } + /* cloudabi_sys_fd_create1 */ + case 4: { + struct cloudabi_sys_fd_create1_args *p = params; + iarg[0] = p->type; /* cloudabi_filetype_t */ + *n_args = 1; + break; + } + /* cloudabi_sys_fd_create2 */ + case 5: { + struct cloudabi_sys_fd_create2_args *p = params; + iarg[0] = p->type; /* cloudabi_filetype_t */ + *n_args = 1; + break; + } + /* cloudabi_sys_fd_datasync */ + case 6: { + struct cloudabi_sys_fd_datasync_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + *n_args = 1; + break; + } + /* cloudabi_sys_fd_dup */ + case 7: { + struct cloudabi_sys_fd_dup_args *p = params; + iarg[0] = p->from; /* cloudabi_fd_t */ + *n_args = 1; + break; + } + /* cloudabi32_sys_fd_pread */ + case 8: { + struct cloudabi32_sys_fd_pread_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->iov; /* const cloudabi32_iovec_t * */ + uarg[2] = p->iovcnt; /* size_t */ + iarg[3] = p->offset; /* cloudabi_filesize_t */ + *n_args = 4; + break; + } + /* cloudabi32_sys_fd_pwrite */ + case 9: { + struct cloudabi32_sys_fd_pwrite_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->iov; /* const cloudabi32_ciovec_t * */ + uarg[2] = p->iovcnt; /* size_t */ + iarg[3] = p->offset; /* cloudabi_filesize_t */ + *n_args = 4; + break; + } + /* cloudabi32_sys_fd_read */ + case 10: { + struct cloudabi32_sys_fd_read_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->iov; /* const cloudabi32_iovec_t * */ + uarg[2] = p->iovcnt; /* size_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_fd_replace */ + case 11: { + struct cloudabi_sys_fd_replace_args *p = params; + iarg[0] = p->from; /* cloudabi_fd_t */ + iarg[1] = p->to; /* cloudabi_fd_t */ + *n_args = 2; + break; + } + /* cloudabi_sys_fd_seek */ + case 12: { + struct cloudabi_sys_fd_seek_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + iarg[1] = p->offset; /* cloudabi_filedelta_t */ + iarg[2] = p->whence; /* cloudabi_whence_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_fd_stat_get */ + case 13: { + struct cloudabi_sys_fd_stat_get_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->buf; /* cloudabi_fdstat_t * */ + *n_args = 2; + break; + } + /* cloudabi_sys_fd_stat_put */ + case 14: { + struct cloudabi_sys_fd_stat_put_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->buf; /* const cloudabi_fdstat_t * */ + iarg[2] = p->flags; /* cloudabi_fdsflags_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_fd_sync */ + case 15: { + struct cloudabi_sys_fd_sync_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + *n_args = 1; + break; + } + /* cloudabi32_sys_fd_write */ + case 16: { + struct cloudabi32_sys_fd_write_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->iov; /* const cloudabi32_ciovec_t * */ + uarg[2] = p->iovcnt; /* size_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_file_advise */ + case 17: { + struct cloudabi_sys_file_advise_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + iarg[1] = p->offset; /* cloudabi_filesize_t */ + iarg[2] = p->len; /* cloudabi_filesize_t */ + iarg[3] = p->advice; /* cloudabi_advice_t */ + *n_args = 4; + break; + } + /* cloudabi_sys_file_allocate */ + case 18: { + struct cloudabi_sys_file_allocate_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + iarg[1] = p->offset; /* cloudabi_filesize_t */ + iarg[2] = p->len; /* cloudabi_filesize_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_file_create */ + case 19: { + struct cloudabi_sys_file_create_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->path; /* const char * */ + uarg[2] = p->pathlen; /* size_t */ + iarg[3] = p->type; /* cloudabi_filetype_t */ + *n_args = 4; + break; + } + /* cloudabi_sys_file_link */ + case 20: { + struct cloudabi_sys_file_link_args *p = params; + iarg[0] = p->fd1; /* cloudabi_lookup_t */ + uarg[1] = (intptr_t) p->path1; /* const char * */ + uarg[2] = p->path1len; /* size_t */ + iarg[3] = p->fd2; /* cloudabi_fd_t */ + uarg[4] = (intptr_t) p->path2; /* const char * */ + uarg[5] = p->path2len; /* size_t */ + *n_args = 6; + break; + } + /* cloudabi_sys_file_open */ + case 21: { + struct cloudabi_sys_file_open_args *p = params; + iarg[0] = p->dirfd; /* cloudabi_lookup_t */ + uarg[1] = (intptr_t) p->path; /* const char * */ + uarg[2] = p->pathlen; /* size_t */ + iarg[3] = p->oflags; /* cloudabi_oflags_t */ + uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */ + *n_args = 5; + break; + } + /* cloudabi_sys_file_readdir */ + case 22: { + struct cloudabi_sys_file_readdir_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->buf; /* void * */ + uarg[2] = p->nbyte; /* size_t */ + iarg[3] = p->cookie; /* cloudabi_dircookie_t */ + *n_args = 4; + break; + } + /* cloudabi_sys_file_readlink */ + case 23: { + struct cloudabi_sys_file_readlink_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->path; /* const char * */ + uarg[2] = p->pathlen; /* size_t */ + uarg[3] = (intptr_t) p->buf; /* char * */ + uarg[4] = p->bufsize; /* size_t */ + *n_args = 5; + break; + } + /* cloudabi_sys_file_rename */ + case 24: { + struct cloudabi_sys_file_rename_args *p = params; + iarg[0] = p->oldfd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->old; /* const char * */ + uarg[2] = p->oldlen; /* size_t */ + iarg[3] = p->newfd; /* cloudabi_fd_t */ + uarg[4] = (intptr_t) p->new; /* const char * */ + uarg[5] = p->newlen; /* size_t */ + *n_args = 6; + break; + } + /* cloudabi_sys_file_stat_fget */ + case 25: { + struct cloudabi_sys_file_stat_fget_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ + *n_args = 2; + break; + } + /* cloudabi_sys_file_stat_fput */ + case 26: { + struct cloudabi_sys_file_stat_fput_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ + iarg[2] = p->flags; /* cloudabi_fsflags_t */ + *n_args = 3; + break; + } + /* cloudabi_sys_file_stat_get */ + case 27: { + struct cloudabi_sys_file_stat_get_args *p = params; + iarg[0] = p->fd; /* cloudabi_lookup_t */ + uarg[1] = (intptr_t) p->path; /* const char * */ + uarg[2] = p->pathlen; /* size_t */ + uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ + *n_args = 4; + break; + } + /* cloudabi_sys_file_stat_put */ + case 28: { + struct cloudabi_sys_file_stat_put_args *p = params; + iarg[0] = p->fd; /* cloudabi_lookup_t */ + uarg[1] = (intptr_t) p->path; /* const char * */ + uarg[2] = p->pathlen; /* size_t */ + uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ + iarg[4] = p->flags; /* cloudabi_fsflags_t */ + *n_args = 5; + break; + } + /* cloudabi_sys_file_symlink */ + case 29: { + struct cloudabi_sys_file_symlink_args *p = params; + uarg[0] = (intptr_t) p->path1; /* const char * */ + uarg[1] = p->path1len; /* size_t */ + iarg[2] = p->fd; /* cloudabi_fd_t */ + uarg[3] = (intptr_t) p->path2; /* const char * */ + uarg[4] = p->path2len; /* size_t */ + *n_args = 5; + break; + } + /* cloudabi_sys_file_unlink */ + case 30: { + struct cloudabi_sys_file_unlink_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->path; /* const char * */ + uarg[2] = p->pathlen; /* size_t */ + iarg[3] = p->flags; /* cloudabi_ulflags_t */ + *n_args = 4; + break; + } + /* cloudabi_sys_lock_unlock */ + case 31: { + struct cloudabi_sys_lock_unlock_args *p = params; + uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ + iarg[1] = p->scope; /* cloudabi_scope_t */ + *n_args = 2; + break; + } + /* cloudabi_sys_mem_advise */ + case 32: { + struct cloudabi_sys_mem_advise_args *p = params; + uarg[0] = (intptr_t) p->addr; /* void * */ + uarg[1] = p->len; /* size_t */ + iarg[2] = p->advice; /* cloudabi_advice_t */ + *n_args = 3; + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Aug 21 16:03:45 2016 Return-Path: Delivered-To: svn-src-head@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 C8FD7BC15A1; Sun, 21 Aug 2016 16:03:45 +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 9B50D1DBA; Sun, 21 Aug 2016 16:03:45 +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 u7LG3i7t063857; Sun, 21 Aug 2016 16:03:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LG3iax063856; Sun, 21 Aug 2016 16:03:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608211603.u7LG3iax063856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 21 Aug 2016 16:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304566 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 16:03:45 -0000 Author: manu Date: Sun Aug 21 16:03:44 2016 New Revision: 304566 URL: https://svnweb.freebsd.org/changeset/base/304566 Log: allwinner: Remove a20/a20_cpu_cfg.c from the build. This was needed when we used the SoC specific timer and not the generic-timer. Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Aug 21 16:02:25 2016 (r304565) +++ head/sys/arm/allwinner/files.allwinner Sun Aug 21 16:03:44 2016 (r304566) @@ -15,7 +15,6 @@ arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_rsb.c optional rsb arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard -arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/aw_machdep.c standard arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 From owner-svn-src-head@freebsd.org Sun Aug 21 16:06:01 2016 Return-Path: Delivered-To: svn-src-head@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 44D10BC1687; Sun, 21 Aug 2016 16:06:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1BC051186; Sun, 21 Aug 2016 16:06:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LG60Ad063984; Sun, 21 Aug 2016 16:06:00 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LG60pS063983; Sun, 21 Aug 2016 16:06:00 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608211606.u7LG60pS063983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 21 Aug 2016 16:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304567 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 16:06:01 -0000 Author: bde Date: Sun Aug 21 16:06:00 2016 New Revision: 304567 URL: https://svnweb.freebsd.org/changeset/base/304567 Log: Fix translation of the PrintScreen/SysRq and Pause/Break keys. Almost everything was broken. The cases that I noticed were Ctrl-PrintScreen not being mapped to the virtual scancode 0x5c (debug) and Pause not being mapped to the physical/virtual scancode 0x46 (slock). These keys are the most complicated ones due to kludges to give some compatibility back to before AT keyboards. Alt-PrintScreen must pretend to be a separate key from PrintScreen even at the "raw" level. The (unique) usb code for it is 0x8a and we just have to map this to our unique virtual scancode 0x54, but we mapped it first to the internal code 0x7e and then to 0x79 which is a key on the Japanese 106/109 keyboard. This fix is under the UKBD_EMULATE_ATASCANCODE option which shouldn't be used for non-AT keyboards. If it is, then the syscons Japanese keymaps have nothing of importance for code 0x79 and can easily be changed. 0x54 is also unimportant in Japanese and US keymaps. NonAlt-PrintScreen and NonCtl-Pause/Break had many much larger bugs with smaller compatibility problems from fixing them. The details are too ugly to give here. Summary of the changed (hex) codes: K_RAW PrintScreen (Ctl, Shift, Ctl-Shift): E0-2A-E0-37 -> E0-37 K_RAW Alt-PrintScreen (all shift states): 79 -> 54 K_RAW Pause/Break (unshifted, Shift, Alt, Alt-Shift)): E0-46 -> E1-1D-45 K_CODE ALT-PrintScreen (all shift states): 79 -> 54 That is 15 of 32 shift combinations for 2 keys fixed, with 8 easy cases from the 79 -> 54 remapping. The difference is only large and with no workaround using a keymap for for K_RAW, but this affects other modes when ukbd is layered under kbmux because kbmux keeps all subdevices in K_RAW mode and translates. Oops. I used kbdmux to generate the above table of changes. Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sun Aug 21 16:03:44 2016 (r304566) +++ head/sys/dev/usb/input/ukbd.c Sun Aug 21 16:06:00 2016 (r304567) @@ -323,7 +323,7 @@ static const uint8_t ukbd_trtab[256] = { NN, NN, NN, NN, 115, 108, 111, 113, /* 70 - 77 */ 109, 110, 112, 118, 114, 116, 117, 119, /* 78 - 7F */ 121, 120, NN, NN, NN, NN, NN, 123, /* 80 - 87 */ - 124, 125, 126, 127, 128, NN, NN, NN, /* 88 - 8F */ + 124, 125, 84, 127, 128, NN, NN, NN, /* 88 - 8F */ 129, 130, NN, NN, NN, NN, NN, NN, /* 90 - 97 */ NN, NN, NN, NN, NN, NN, NN, NN, /* 98 - 9F */ NN, NN, NN, NN, NN, NN, NN, NN, /* A0 - A7 */ @@ -1659,17 +1659,6 @@ next_code: } } break; - /* XXX: I don't like these... */ - case 0x5c: /* print screen */ - if (sc->sc_flags & ALTS) { - keycode = 0x54; /* sysrq */ - } - break; - case 0x68: /* pause/break */ - if (sc->sc_flags & CTLS) { - keycode = 0x6c; /* break */ - } - break; } /* return the key code in the K_CODE mode */ @@ -2049,7 +2038,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int /* 90-99 */ 0x11d, /* Ctrl-R */ 0x135, /* Divide */ - 0x137 | SCAN_PREFIX_SHIFT, /* PrintScreen */ + 0x137, /* PrintScreen */ 0x138, /* Alt-R */ 0x147, /* Home */ 0x148, /* Up */ @@ -2100,13 +2089,15 @@ ukbd_key2scan(struct ukbd_softc *sc, int if ((code >= 89) && (code < (int)(89 + nitems(scan)))) { code = scan[code - 89]; } + /* PrintScreen */ + if (code == 0x137 && (!(shift & (MOD_CONTROL_L | MOD_CONTROL_R | + MOD_ALT_L | MOD_ALT_R | MOD_SHIFT_L | MOD_SHIFT_R)))) { + code |= SCAN_PREFIX_SHIFT; + } /* Pause/Break */ - if ((code == 104) && (!(shift & (MOD_CONTROL_L | MOD_CONTROL_R)))) { + if ((code == 0x146) && (!(shift & (MOD_CONTROL_L | MOD_CONTROL_R)))) { code = (0x45 | SCAN_PREFIX_E1 | SCAN_PREFIX_CTL); } - if (shift & (MOD_SHIFT_L | MOD_SHIFT_R)) { - code &= ~SCAN_PREFIX_SHIFT; - } code |= (up ? SCAN_RELEASE : SCAN_PRESS); if (code & SCAN_PREFIX) { From owner-svn-src-head@freebsd.org Sun Aug 21 16:49:14 2016 Return-Path: Delivered-To: svn-src-head@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 522EDBC1ED1; Sun, 21 Aug 2016 16:49:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF87176A; Sun, 21 Aug 2016 16:49:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 5E133427193; Mon, 22 Aug 2016 02:49:08 +1000 (AEST) Date: Mon, 22 Aug 2016 02:49:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Bruce Evans , Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi In-Reply-To: <20160821135826.GB8192@zxy.spb.ru> Message-ID: <20160822022832.Q3214@besplex.bde.org> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> <20160821232721.G2639@besplex.bde.org> <20160821135826.GB8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Q4qeO4WkDawc_xgsBuMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 16:49:14 -0000 On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote: > >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: >>> I am remeber about platforms with missaligment trap when >>> accessing int16 by odd address. Now platforms like this do not exist >>> anymore? >> >> i386 still exists, and it supports trapping on misalignement for at least >> CPL 3 (not kernel CPL 0). IIRC, amd64 drops support for this. > > Someone enable and support this? I am don't see. > May be PPC trap on this? > Alpha trap on this, but support of Alpha is droped. It is a 1-line change in asm (or a little more in C with #includes) to enable the trap: %%% #include #include #include int main(void) { char ch[5]; write_eflags(read_eflags() | PSL_AC); *(int *)&ch[0] = 0; *(int *)&ch[1] = 1; /* NOTREACHED */ } %%% This works on amd64 too after s/eflags/rflags. It is a trillion-line change to fix the compilers and applications to not do misaligned accesses :-). I only tried to use this ~25 years ago. Then the most obvious compiler bug was generating 32-bit acccesses to assign large but misaligned structs. If the compiler just generated calls to memcpy(), that might work, but in practice libraries also assume alignment. >>>> There are also endianness problems. The old version was even more broken >>>> on big endian systems. The current version needs some magic to reverse >>>> the memcpy() of the bits. We already depend on this for some 64-bit >>>> syscalls like lseek(). >>> >>> Can you explain some more? >>> This is not transfer over network and don't read from external media. >>> Where is problem? >> >> It is similar to a network transfer. It needs a protocol to pass values >> to applications. Type puns are fragile even within a single compilation >> unit. > > Application ad kernel run with same byte order, not? The application can do anything it wants, but has to translate if it uses the kernel or a library written in another language. Bruce From owner-svn-src-head@freebsd.org Sun Aug 21 17:06:15 2016 Return-Path: Delivered-To: svn-src-head@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 64A12BC0577; Sun, 21 Aug 2016 17:06:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 273401275; Sun, 21 Aug 2016 17:06:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbWCJ-0008cV-RY; Sun, 21 Aug 2016 20:06:11 +0300 Date: Sun, 21 Aug 2016 20:06:11 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160821170611.GC8192@zxy.spb.ru> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> <20160821232721.G2639@besplex.bde.org> <20160821135826.GB8192@zxy.spb.ru> <20160822022832.Q3214@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160822022832.Q3214@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 17:06:15 -0000 On Mon, Aug 22, 2016 at 02:49:07AM +1000, Bruce Evans wrote: > On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > > > On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote: > > > >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > >>> I am remeber about platforms with missaligment trap when > >>> accessing int16 by odd address. Now platforms like this do not exist > >>> anymore? > >> > >> i386 still exists, and it supports trapping on misalignement for at least > >> CPL 3 (not kernel CPL 0). IIRC, amd64 drops support for this. > > > > Someone enable and support this? I am don't see. > > May be PPC trap on this? > > Alpha trap on this, but support of Alpha is droped. > > It is a 1-line change in asm (or a little more in C with #includes) to > enable the trap: OK, we can turn amd64 in this mode. And cat do request to kernel with unalligned access, this cause trap and panic, yes? > It is a trillion-line change to fix the compilers and applications to not > do misaligned accesses :-). I only tried to use this ~25 years ago. Then > the most obvious compiler bug was generating 32-bit acccesses to assign > large but misaligned structs. If the compiler just generated calls to > memcpy(), that might work, but in practice libraries also assume alignment. This issuse can be trigerred and by two-bytes assigmen, yes? > >>>> There are also endianness problems. The old version was even more broken > >>>> on big endian systems. The current version needs some magic to reverse > >>>> the memcpy() of the bits. We already depend on this for some 64-bit > >>>> syscalls like lseek(). > >>> > >>> Can you explain some more? > >>> This is not transfer over network and don't read from external media. > >>> Where is problem? > >> > >> It is similar to a network transfer. It needs a protocol to pass values > >> to applications. Type puns are fragile even within a single compilation > >> unit. > > > > Application ad kernel run with same byte order, not? > > The application can do anything it wants, but has to translate if it uses > the kernel or a library written in another language. You talk about different byte order in differenr languages? From owner-svn-src-head@freebsd.org Sun Aug 21 18:04:05 2016 Return-Path: Delivered-To: svn-src-head@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 2D145BC126E; Sun, 21 Aug 2016 18:04:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 EE1871E3F; Sun, 21 Aug 2016 18:04:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 06FD21FE023; Sun, 21 Aug 2016 20:04:01 +0200 (CEST) Subject: Re: svn commit: r304567 - head/sys/dev/usb/input To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608211606.u7LG60pS063983@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sun, 21 Aug 2016 20:08:33 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608211606.u7LG60pS063983@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 18:04:05 -0000 On 08/21/16 18:06, Bruce Evans wrote: > Author: bde > Date: Sun Aug 21 16:06:00 2016 > New Revision: 304567 > URL: https://svnweb.freebsd.org/changeset/base/304567 > Don't forget to MFC. --HPS From owner-svn-src-head@freebsd.org Sun Aug 21 18:12:50 2016 Return-Path: Delivered-To: svn-src-head@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 8BC16BC16FB; Sun, 21 Aug 2016 18:12:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 438B214A3; Sun, 21 Aug 2016 18:12:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LICnHq013158; Sun, 21 Aug 2016 18:12:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LICnEI013156; Sun, 21 Aug 2016 18:12:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201608211812.u7LICnEI013156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 21 Aug 2016 18:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304570 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 18:12:50 -0000 Author: trasz Date: Sun Aug 21 18:12:49 2016 New Revision: 304570 URL: https://svnweb.freebsd.org/changeset/base/304570 Log: Add the "-n" flag to cron(8), to prevent it from daemonizing. This makes it possible to use it with external supervisors. The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD. Reviewed by: jilles, pfg, wblock MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7581 Modified: head/usr.sbin/cron/cron/cron.8 head/usr.sbin/cron/cron/cron.c Modified: head/usr.sbin/cron/cron/cron.8 ============================================================================== --- head/usr.sbin/cron/cron/cron.8 Sun Aug 21 17:57:32 2016 (r304569) +++ head/usr.sbin/cron/cron/cron.8 Sun Aug 21 18:12:49 2016 (r304570) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29, 2008 +.Dd August 21, 2016 .Dt CRON 8 .Os .Sh NAME @@ -28,6 +28,7 @@ .Op Fl j Ar jitter .Op Fl J Ar rootjitter .Op Fl m Ar mailto +.Op Fl n .Op Fl s .Op Fl o .Op Fl x Ar debugflag Ns Op , Ns Ar ... @@ -132,6 +133,8 @@ set to a null string, usually specified .Li '' or .Li \*q\*q . +.It Fl n +Don't daemonize, run in foreground instead. .It Fl s Enable special handling of situations when the GMT offset of the local timezone changes, such as the switches between the standard time and Modified: head/usr.sbin/cron/cron/cron.c ============================================================================== --- head/usr.sbin/cron/cron/cron.c Sun Aug 21 17:57:32 2016 (r304569) +++ head/usr.sbin/cron/cron/cron.c Sun Aug 21 18:12:49 2016 (r304570) @@ -49,6 +49,7 @@ static int run_at_secres(cron_db *); static time_t last_time = 0; static int dst_enabled = 0; +static int dont_daemonize = 0; struct pidfh *pfh; static void @@ -58,7 +59,7 @@ usage() { #endif fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] " - "[-m mailto] [-s] [-o] [-x debugflag[,...]]\n"); + "[-m mailto] [-n ] [-s] [-o] [-x debugflag[,...]]\n"); #if DEBUGGING fprintf(stderr, "\ndebugflags: "); @@ -136,7 +137,7 @@ main(argc, argv) if (0) { # endif (void) fprintf(stderr, "[%d] cron started\n", getpid()); - } else { + } else if (dont_daemonize == 0) { if (daemon(1, 0) == -1) { pidfile_remove(pfh); log_it("CRON",getpid(),"DEATH","can't become daemon"); @@ -512,7 +513,7 @@ parse_args(argc, argv) int argch; char *endp; - while ((argch = getopt(argc, argv, "j:J:m:osx:")) != -1) { + while ((argch = getopt(argc, argv, "j:J:m:nosx:")) != -1) { switch (argch) { case 'j': Jitter = strtoul(optarg, &endp, 10); @@ -529,6 +530,9 @@ parse_args(argc, argv) case 'm': defmailto = optarg; break; + case 'n': + dont_daemonize = 1; + break; case 'o': dst_enabled = 0; break; From owner-svn-src-head@freebsd.org Sun Aug 21 18:37:22 2016 Return-Path: Delivered-To: svn-src-head@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 EE3F9BC1B85; Sun, 21 Aug 2016 18:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA6D81EEC; Sun, 21 Aug 2016 18:37:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LIbMEH020766; Sun, 21 Aug 2016 18:37:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LIbM1t020765; Sun, 21 Aug 2016 18:37:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608211837.u7LIbM1t020765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 21 Aug 2016 18:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304571 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 18:37:23 -0000 Author: hselasky Date: Sun Aug 21 18:37:21 2016 New Revision: 304571 URL: https://svnweb.freebsd.org/changeset/base/304571 Log: Make the UKBD USB transfers double buffered and set them up one by one, so they are memory independent which allows for handling panics triggered by the keyboard driver itself, typically via CTRL+ALT+ESC sequences. Or if the USB keyboard driver was processing a key at the moment of panic. Allow UKBD to be attached while keyboard polling is active. Tested by: Bruce Evans MFC after: 1 week Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sun Aug 21 18:12:49 2016 (r304570) +++ head/sys/dev/usb/input/ukbd.c Sun Aug 21 18:37:21 2016 (r304571) @@ -108,7 +108,7 @@ SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, pollr #define UKBD_NMOD 8 /* units */ #define UKBD_NKEYCODE 6 /* units */ #define UKBD_IN_BUF_SIZE (2*(UKBD_NMOD + (2*UKBD_NKEYCODE))) /* bytes */ -#define UKBD_IN_BUF_FULL (UKBD_IN_BUF_SIZE / 2) /* bytes */ +#define UKBD_IN_BUF_FULL ((UKBD_IN_BUF_SIZE / 2) - 1) /* bytes */ #define UKBD_NFKEY (sizeof(fkey_tab)/sizeof(fkey_tab[0])) /* units */ #define UKBD_BUFFER_SIZE 64 /* bytes */ @@ -129,7 +129,8 @@ struct ukbd_data { }; enum { - UKBD_INTR_DT, + UKBD_INTR_DT_0, + UKBD_INTR_DT_1, UKBD_CTRL_LED, UKBD_N_TRANSFER, }; @@ -478,7 +479,8 @@ ukbd_get_key(struct ukbd_softc *sc, uint if (sc->sc_inputs == 0 && (sc->sc_flags & UKBD_FLAG_GONE) == 0) { /* start transfer, if not already started */ - usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]); + usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT_0]); + usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT_1]); } if (sc->sc_flags & UKBD_FLAG_POLLING) @@ -954,7 +956,16 @@ ukbd_set_leds_callback(struct usb_xfer * static const struct usb_config ukbd_config[UKBD_N_TRANSFER] = { - [UKBD_INTR_DT] = { + [UKBD_INTR_DT_0] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &ukbd_intr_callback, + }, + + [UKBD_INTR_DT_1] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, @@ -1201,9 +1212,26 @@ ukbd_attach(device_t dev) usb_callout_init_mtx(&sc->sc_callout, &Giant, 0); +#ifdef UKBD_NO_POLLING err = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->sc_xfer, ukbd_config, UKBD_N_TRANSFER, sc, &Giant); +#else + /* + * Setup the UKBD USB transfers one by one, so they are memory + * independent which allows for handling panics triggered by + * the keyboard driver itself, typically via CTRL+ALT+ESC + * sequences. Or if the USB keyboard driver was processing a + * key at the moment of panic. + */ + for (n = 0; n != UKBD_N_TRANSFER; n++) { + err = usbd_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer + n, ukbd_config + n, + 1, sc, &Giant); + if (err) + break; + } +#endif if (err) { DPRINTF("error=%s\n", usbd_errstr(err)); @@ -1295,11 +1323,13 @@ ukbd_attach(device_t dev) rate = 1000 / rate; /* set new polling interval in ms */ - usbd_xfer_set_interval(sc->sc_xfer[UKBD_INTR_DT], rate); + usbd_xfer_set_interval(sc->sc_xfer[UKBD_INTR_DT_0], rate); + usbd_xfer_set_interval(sc->sc_xfer[UKBD_INTR_DT_1], rate); } #endif /* start the keyboard */ - usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]); + usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT_0]); + usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT_1]); return (0); /* success */ @@ -1325,7 +1355,8 @@ ukbd_detach(device_t dev) /* kill any stuck keys */ if (sc->sc_flags & UKBD_FLAG_ATTACHED) { /* stop receiving events from the USB keyboard */ - usbd_transfer_stop(sc->sc_xfer[UKBD_INTR_DT]); + usbd_transfer_stop(sc->sc_xfer[UKBD_INTR_DT_0]); + usbd_transfer_stop(sc->sc_xfer[UKBD_INTR_DT_1]); /* release all leftover keys, if any */ memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); @@ -1979,7 +2010,7 @@ ukbd_poll(keyboard_t *kbd, int on) */ if (on) sc->sc_polling++; - else + else if (sc->sc_polling > 0) sc->sc_polling--; if (sc->sc_polling != 0) { From owner-svn-src-head@freebsd.org Sun Aug 21 18:55:32 2016 Return-Path: Delivered-To: svn-src-head@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 2D24DBC009B; Sun, 21 Aug 2016 18:55:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 076BB1ABA; Sun, 21 Aug 2016 18:55:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7LItVPu028206; Sun, 21 Aug 2016 18:55:31 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7LItUo1028201; Sun, 21 Aug 2016 18:55:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608211855.u7LItUo1028201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 21 Aug 2016 18:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304572 - in head: sbin/ipfw sys/conf sys/netinet sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 18:55:32 -0000 Author: bz Date: Sun Aug 21 18:55:30 2016 New Revision: 304572 URL: https://svnweb.freebsd.org/changeset/base/304572 Log: Remove the kernel optoion for IPSEC_FILTERTUNNEL, which was deprecated more than 7 years ago in favour of a sysctl in r192648. Modified: head/sbin/ipfw/ipfw.8 head/sys/conf/NOTES head/sys/conf/options head/sys/netinet/ip_ipsec.c head/sys/netinet6/ip6_ipsec.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sun Aug 21 18:37:21 2016 (r304571) +++ head/sbin/ipfw/ipfw.8 Sun Aug 21 18:55:30 2016 (r304572) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2016 +.Dd August 21, 2016 .Dt IPFW 8 .Os .Sh NAME @@ -1588,8 +1588,7 @@ Matches IPv4 packets whose precedence fi .It Cm ipsec Matches packets that have IPSEC history associated with them (i.e., the packet comes encapsulated in IPSEC, the kernel -has IPSEC support and IPSEC_FILTERTUNNEL option, and can correctly -decapsulate it). +has IPSEC support, and can correctly decapsulate it). .Pp Note that specifying .Cm ipsec Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Aug 21 18:37:21 2016 (r304571) +++ head/sys/conf/NOTES Sun Aug 21 18:55:30 2016 (r304572) @@ -626,17 +626,6 @@ options TCP_OFFLOAD # TCP offload supp options IPSEC #IP security (requires device crypto) #options IPSEC_DEBUG #debug for IP security # -# #DEPRECATED# -# Set IPSEC_FILTERTUNNEL to change the default of the sysctl to force packets -# coming through a tunnel to be processed by any configured packet filtering -# twice. The default is that packets coming out of a tunnel are _not_ processed; -# they are assumed trusted. -# -# IPSEC history is preserved for such packets, and can be filtered -# using ipfw(8)'s 'ipsec' keyword, when this option is enabled. -# -#options IPSEC_FILTERTUNNEL #filter ipsec packets from a tunnel -# # Set IPSEC_NAT_T to enable NAT-Traversal support. This enables # optional UDP encapsulation of ESP packets. # Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Aug 21 18:37:21 2016 (r304571) +++ head/sys/conf/options Sun Aug 21 18:55:30 2016 (r304572) @@ -424,7 +424,6 @@ IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h -IPSEC_FILTERTUNNEL opt_ipsec.h IPSEC_NAT_T opt_ipsec.h IPSTEALTH KRPC Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Sun Aug 21 18:37:21 2016 (r304571) +++ head/sys/netinet/ip_ipsec.c Sun Aug 21 18:55:30 2016 (r304572) @@ -68,11 +68,7 @@ __FBSDID("$FreeBSD$"); extern struct protosw inetsw[]; -#ifdef IPSEC_FILTERTUNNEL -static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 1; -#else static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 0; -#endif #define V_ip4_ipsec_filtertunnel VNET(ip4_ipsec_filtertunnel) SYSCTL_DECL(_net_inet_ipsec); Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Sun Aug 21 18:37:21 2016 (r304571) +++ head/sys/netinet6/ip6_ipsec.c Sun Aug 21 18:55:30 2016 (r304572) @@ -79,11 +79,7 @@ __FBSDID("$FreeBSD$"); extern struct protosw inet6sw[]; -#ifdef IPSEC_FILTERTUNNEL -static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; -#else static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 0; -#endif #define V_ip6_ipsec6_filtertunnel VNET(ip6_ipsec6_filtertunnel) SYSCTL_DECL(_net_inet6_ipsec6); From owner-svn-src-head@freebsd.org Sun Aug 21 19:08:45 2016 Return-Path: Delivered-To: svn-src-head@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 67503BC03A9; Sun, 21 Aug 2016 19:08:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 1938B1198; Sun, 21 Aug 2016 19:08:45 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbY6q-000BWA-VU; Sun, 21 Aug 2016 22:08:40 +0300 Date: Sun, 21 Aug 2016 22:08:40 +0300 From: Slawa Olhovchenkov To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304572 - in head: sbin/ipfw sys/conf sys/netinet sys/netinet6 Message-ID: <20160821190840.GT22212@zxy.spb.ru> References: <201608211855.u7LItUo1028201@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608211855.u7LItUo1028201@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 19:08:45 -0000 On Sun, Aug 21, 2016 at 06:55:30PM +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Aug 21 18:55:30 2016 > New Revision: 304572 > URL: https://svnweb.freebsd.org/changeset/base/304572 > > Log: > Remove the kernel optoion for IPSEC_FILTERTUNNEL, which was deprecated > more than 7 years ago in favour of a sysctl in r192648. Need note to UPDAING. > Modified: > head/sbin/ipfw/ipfw.8 > head/sys/conf/NOTES > head/sys/conf/options > head/sys/netinet/ip_ipsec.c > head/sys/netinet6/ip6_ipsec.c > > Modified: head/sbin/ipfw/ipfw.8 > ============================================================================== > --- head/sbin/ipfw/ipfw.8 Sun Aug 21 18:37:21 2016 (r304571) > +++ head/sbin/ipfw/ipfw.8 Sun Aug 21 18:55:30 2016 (r304572) > @@ -1,7 +1,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 13, 2016 > +.Dd August 21, 2016 > .Dt IPFW 8 > .Os > .Sh NAME > @@ -1588,8 +1588,7 @@ Matches IPv4 packets whose precedence fi > .It Cm ipsec > Matches packets that have IPSEC history associated with them > (i.e., the packet comes encapsulated in IPSEC, the kernel > -has IPSEC support and IPSEC_FILTERTUNNEL option, and can correctly > -decapsulate it). > +has IPSEC support, and can correctly decapsulate it). > .Pp > Note that specifying > .Cm ipsec > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Sun Aug 21 18:37:21 2016 (r304571) > +++ head/sys/conf/NOTES Sun Aug 21 18:55:30 2016 (r304572) > @@ -626,17 +626,6 @@ options TCP_OFFLOAD # TCP offload supp > options IPSEC #IP security (requires device crypto) > #options IPSEC_DEBUG #debug for IP security > # > -# #DEPRECATED# > -# Set IPSEC_FILTERTUNNEL to change the default of the sysctl to force packets > -# coming through a tunnel to be processed by any configured packet filtering > -# twice. The default is that packets coming out of a tunnel are _not_ processed; > -# they are assumed trusted. > -# > -# IPSEC history is preserved for such packets, and can be filtered > -# using ipfw(8)'s 'ipsec' keyword, when this option is enabled. > -# > -#options IPSEC_FILTERTUNNEL #filter ipsec packets from a tunnel > -# > # Set IPSEC_NAT_T to enable NAT-Traversal support. This enables > # optional UDP encapsulation of ESP packets. > # > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sun Aug 21 18:37:21 2016 (r304571) > +++ head/sys/conf/options Sun Aug 21 18:55:30 2016 (r304572) > @@ -424,7 +424,6 @@ IPFIREWALL_VERBOSE opt_ipfw.h > IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h > IPSEC opt_ipsec.h > IPSEC_DEBUG opt_ipsec.h > -IPSEC_FILTERTUNNEL opt_ipsec.h > IPSEC_NAT_T opt_ipsec.h > IPSTEALTH > KRPC > > Modified: head/sys/netinet/ip_ipsec.c > ============================================================================== > --- head/sys/netinet/ip_ipsec.c Sun Aug 21 18:37:21 2016 (r304571) > +++ head/sys/netinet/ip_ipsec.c Sun Aug 21 18:55:30 2016 (r304572) > @@ -68,11 +68,7 @@ __FBSDID("$FreeBSD$"); > > extern struct protosw inetsw[]; > > -#ifdef IPSEC_FILTERTUNNEL > -static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 1; > -#else > static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 0; > -#endif > #define V_ip4_ipsec_filtertunnel VNET(ip4_ipsec_filtertunnel) > > SYSCTL_DECL(_net_inet_ipsec); > > Modified: head/sys/netinet6/ip6_ipsec.c > ============================================================================== > --- head/sys/netinet6/ip6_ipsec.c Sun Aug 21 18:37:21 2016 (r304571) > +++ head/sys/netinet6/ip6_ipsec.c Sun Aug 21 18:55:30 2016 (r304572) > @@ -79,11 +79,7 @@ __FBSDID("$FreeBSD$"); > > extern struct protosw inet6sw[]; > > -#ifdef IPSEC_FILTERTUNNEL > -static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; > -#else > static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 0; > -#endif > #define V_ip6_ipsec6_filtertunnel VNET(ip6_ipsec6_filtertunnel) > > SYSCTL_DECL(_net_inet6_ipsec6); > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Aug 21 19:20:22 2016 Return-Path: Delivered-To: svn-src-head@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 1F6A6BC07B4; Sun, 21 Aug 2016 19:20:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D5C7C194E; Sun, 21 Aug 2016 19:20:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6F3DE25D3860; Sun, 21 Aug 2016 19:20:18 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 4DEF5D1F7ED; Sun, 21 Aug 2016 19:20:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id XobLU-jWDNeV; Sun, 21 Aug 2016 19:20:16 +0000 (UTC) Received: from [10.111.64.116] (unknown [IPv6:fde9:577b:c1a9:4410:d50e:860c:232:d2a9]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2643CD1F7E4; Sun, 21 Aug 2016 19:20:14 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Slawa Olhovchenkov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304572 - in head: sbin/ipfw sys/conf sys/netinet sys/netinet6 Date: Sun, 21 Aug 2016 19:20:12 +0000 Message-ID: <4D050BB5-294C-495C-9B04-6CF7834E33FB@FreeBSD.org> In-Reply-To: <20160821190840.GT22212@zxy.spb.ru> References: <201608211855.u7LItUo1028201@repo.freebsd.org> <20160821190840.GT22212@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6051) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 19:20:22 -0000 On 21 Aug 2016, at 19:08, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 06:55:30PM +0000, Bjoern A. Zeeb wrote: > >> Author: bz >> Date: Sun Aug 21 18:55:30 2016 >> New Revision: 304572 >> URL: https://svnweb.freebsd.org/changeset/base/304572 >> >> Log: >> Remove the kernel optoion for IPSEC_FILTERTUNNEL, which was >> deprecated >> more than 7 years ago in favour of a sysctl in r192648. > > Need note to UPDAING. Why? The default behaviour hasn’t changed and a new custom kernel with the option will not compile anymore. Is there a compelling reason to warn users anyway? From owner-svn-src-head@freebsd.org Sun Aug 21 19:30:11 2016 Return-Path: Delivered-To: svn-src-head@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 7286CBC0B1F; Sun, 21 Aug 2016 19:30:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 367281E4C; Sun, 21 Aug 2016 19:30:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbYRd-000C5a-3q; Sun, 21 Aug 2016 22:30:09 +0300 Date: Sun, 21 Aug 2016 22:30:09 +0300 From: Slawa Olhovchenkov To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304572 - in head: sbin/ipfw sys/conf sys/netinet sys/netinet6 Message-ID: <20160821193009.GD8192@zxy.spb.ru> References: <201608211855.u7LItUo1028201@repo.freebsd.org> <20160821190840.GT22212@zxy.spb.ru> <4D050BB5-294C-495C-9B04-6CF7834E33FB@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4D050BB5-294C-495C-9B04-6CF7834E33FB@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 19:30:11 -0000 On Sun, Aug 21, 2016 at 07:20:12PM +0000, Bjoern A. Zeeb wrote: > On 21 Aug 2016, at 19:08, Slawa Olhovchenkov wrote: > > > On Sun, Aug 21, 2016 at 06:55:30PM +0000, Bjoern A. Zeeb wrote: > > > >> Author: bz > >> Date: Sun Aug 21 18:55:30 2016 > >> New Revision: 304572 > >> URL: https://svnweb.freebsd.org/changeset/base/304572 > >> > >> Log: > >> Remove the kernel optoion for IPSEC_FILTERTUNNEL, which was > >> deprecated > >> more than 7 years ago in favour of a sysctl in r192648. > > > > Need note to UPDAING. > > Why? The default behaviour hasn’t changed and a new custom kernel > with the option will not compile anymore. Is there a compelling reason > to warn users anyway? Old config don't compiling and need updating? This is break compatibility and need record in UPDATING (because this place where find information about like events). After config updating behaivor changed? Yes. This is need also record in UPDATING. For restoring old beheaivor need updating /boot/loader.conf? Yes. This is also need be documented. Good documentation is very positive for krama :) From owner-svn-src-head@freebsd.org Sun Aug 21 20:03:34 2016 Return-Path: Delivered-To: svn-src-head@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 B330FBC1547; Sun, 21 Aug 2016 20:03:34 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31E741320; Sun, 21 Aug 2016 20:03:33 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vps.rulingia.com (8.15.2/8.15.2) with ESMTPS id u7LK3JR4024677 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Aug 2016 06:03:25 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id u7LK3DEH051998 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Aug 2016 06:03:13 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id u7LK3DFU051997; Mon, 22 Aug 2016 06:03:13 +1000 (AEST) (envelope-from peter) Date: Mon, 22 Aug 2016 06:03:13 +1000 From: Peter Jeremy To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf Message-ID: <20160821200313.GE22564@server.rulingia.com> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> <1699917.hhfoKyASTk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/" Content-Disposition: inline In-Reply-To: <1699917.hhfoKyASTk@ralph.baldwin.cx> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2016 20:03:34 -0000 --GZVR6ND4mMseVXL/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2016-Aug-20 07:51:55 -0700, John Baldwin wrote: >- tty drivers that haven't been updated to new tty and have been disconnec= ted > from the build since 8.0 including digi(4) and cy(4). I know Bruce has > patches for sio(4) that I just haven't merged, so I'm inclined to leave > sio(4), but the other disconnected drivers are candidates I think. I have digi(4) patches but no longer have any digi cards. Judging by the time since they were disconnected, I think they can be deleted. --=20 Peter Jeremy --GZVR6ND4mMseVXL/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXugkBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs07PAP/0pOxZD8gufIjMTBly8jpyrS QNKfMUswqNYSg699C0joj23jZDvgyYetNxjfOvMu+IR2CR1SohTTjKL5hOllmY2c qMhNSeOtJ6TUMIyaF9M6fZM8lXikg1Zo4Wtr8sQ+Y+2PXZlVH2aZHo45lqBWa3nG W4si5OtE5XGHbqrrytqCPnRZ/OPiszHlBUkhAPhTXfPXS5jsFl3vd9L5wJbZws8i gKcZBCgZZNfHgqu8oekUT0+iGp66GB+1IdZrQu0lDq9nOoFp+DXd3jxg0Zt0JHa8 UYpgwgLjPB5dSqr/sgesAmClGnyWZOQ00x0xU0Kn6+6s/nJFETeIqYRpVo4oi7DM OToXTBDkqfOT//GR0tc4cXuMa2AF7YvVjeJjiHiLt/mj1LLIBBQ9tBjs9+eFbNwK JZJQo28POtRPIJfFZxlLVFhMcTRpjnALYKskyK6yWdOuOcFihOTgcP+yL1uNRwE8 v6byeEFVORN4LP+8e4vULq8TGM+l4d+O0yYeP7ZL+a7OzccvhrPL5Bhmh3yHos5H 6+qjDseo1vv6Azu6mzJdw8uaZPVRlflvoS7YvWM41x8WkxIo0IuIqjLfVd3VOraj A3YhjEpuqhwucPNMOb1F4I0HeH2IEJWlkc4jBPhvkDYtbFajYpR/GhWlQUY8HO1N nAcG1vzqNCyJtk1BkPgx =jgM6 -----END PGP SIGNATURE----- --GZVR6ND4mMseVXL/-- From owner-svn-src-head@freebsd.org Mon Aug 22 00:40:46 2016 Return-Path: Delivered-To: svn-src-head@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 51E22BC1088; Mon, 22 Aug 2016 00:40:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21A461886; Mon, 22 Aug 2016 00:40:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M0ejvh054614; Mon, 22 Aug 2016 00:40:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M0ejki054613; Mon, 22 Aug 2016 00:40:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608220040.u7M0ejki054613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 22 Aug 2016 00:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304573 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 00:40:46 -0000 Author: tuexen Date: Mon Aug 22 00:40:45 2016 New Revision: 304573 URL: https://svnweb.freebsd.org/changeset/base/304573 Log: Remove duplicate code, which is not protected by the appropriate locks. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Aug 21 18:55:30 2016 (r304572) +++ head/sys/netinet/sctp_usrreq.c Mon Aug 22 00:40:45 2016 (r304573) @@ -1506,11 +1506,6 @@ sctp_do_connect_x(struct socket *so, str sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); } SCTP_TCB_UNLOCK(stcb); - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { - stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; - /* Set the connected flag so we can queue data */ - soisconnecting(so); - } out_now: if (creat_lock_on) { SCTP_ASOC_CREATE_UNLOCK(inp); From owner-svn-src-head@freebsd.org Mon Aug 22 01:06:56 2016 Return-Path: Delivered-To: svn-src-head@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 4FDB6BC153A; Mon, 22 Aug 2016 01:06:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EA1A012E7; Mon, 22 Aug 2016 01:06:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M16trp064594; Mon, 22 Aug 2016 01:06:55 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M16tJq064593; Mon, 22 Aug 2016 01:06:55 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608220106.u7M16tJq064593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Mon, 22 Aug 2016 01:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304574 - head/sys/dev/alc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 01:06:56 -0000 Author: yongari Date: Mon Aug 22 01:06:54 2016 New Revision: 304574 URL: https://svnweb.freebsd.org/changeset/base/304574 Log: Correct DMA channel number selection on AR816x family of controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x except L1D controller, use vendor recommended ASPM parameters. While here, increase alc_dma_burst array size. Broken H/W can return bogus value in theory. Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Mon Aug 22 00:40:45 2016 (r304573) +++ head/sys/dev/alc/if_alc.c Mon Aug 22 01:06:54 2016 (r304574) @@ -255,7 +255,7 @@ static struct resource_spec alc_irq_spec { -1, 0, 0 } }; -static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0 }; +static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0, 0 }; static int alc_miibus_readreg(device_t dev, int phy, int reg) @@ -4184,13 +4184,17 @@ alc_init_locked(struct alc_softc *sc) reg = (RXQ_CFG_RD_BURST_DEFAULT << RXQ_CFG_RD_BURST_SHIFT) & RXQ_CFG_RD_BURST_MASK; reg |= RXQ_CFG_RSS_MODE_DIS; - if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) + if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) { reg |= (RXQ_CFG_816X_IDT_TBL_SIZE_DEFAULT << RXQ_CFG_816X_IDT_TBL_SIZE_SHIFT) & RXQ_CFG_816X_IDT_TBL_SIZE_MASK; - if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && - sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) - reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M; + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } else { + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && + sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } CSR_WRITE_4(sc, ALC_RXQ_CFG, reg); /* Configure DMA parameters. */ @@ -4214,12 +4218,12 @@ alc_init_locked(struct alc_softc *sc) switch (AR816X_REV(sc->alc_rev)) { case AR816X_REV_A0: case AR816X_REV_A1: - reg |= DMA_CFG_RD_CHNL_SEL_1; + reg |= DMA_CFG_RD_CHNL_SEL_2; break; case AR816X_REV_B0: /* FALLTHROUGH */ default: - reg |= DMA_CFG_RD_CHNL_SEL_3; + reg |= DMA_CFG_RD_CHNL_SEL_4; break; } } From owner-svn-src-head@freebsd.org Mon Aug 22 01:19:06 2016 Return-Path: Delivered-To: svn-src-head@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 94C59BC18B7; Mon, 22 Aug 2016 01:19:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7026517E6; Mon, 22 Aug 2016 01:19:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M1J5IK068410; Mon, 22 Aug 2016 01:19:05 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M1J5pR068406; Mon, 22 Aug 2016 01:19:05 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608220119.u7M1J5pR068406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Mon, 22 Aug 2016 01:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304575 - in head/sys/dev: alc pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 01:19:06 -0000 Author: yongari Date: Mon Aug 22 01:19:05 2016 New Revision: 304575 URL: https://svnweb.freebsd.org/changeset/base/304575 Log: Add Killer E2400 Gigabit Ethernet support. It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon bug which triggers DMA write errors when driver uses advertised maximum payload size. Force the maximum payload size to 128 bytes in DMA configuration. This change should fix occasional DMA write errors reported on Killer E2200. Tested by: Modified: head/sys/dev/alc/if_alc.c head/sys/dev/alc/if_alcreg.h head/sys/dev/pci/pci.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Mon Aug 22 01:06:54 2016 (r304574) +++ head/sys/dev/alc/if_alc.c Mon Aug 22 01:19:05 2016 (r304575) @@ -121,6 +121,8 @@ static struct alc_ident alc_ident_table[ "Atheros AR8172 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024, "Killer E2200 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, + "Killer E2400 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -1080,6 +1082,7 @@ alc_phy_down(struct alc_softc *sc) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1397,12 +1400,15 @@ alc_attach(device_t dev) * shows the same PHY model/revision number of AR8131. */ switch (sc->alc_ident->deviceid) { + case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: + sc->alc_flags |= ALC_FLAG_E2X00; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && pci_get_subdevice(dev) == 0x0091 && sc->alc_rev == 0) sc->alc_flags |= ALC_FLAG_LINK_WAR; /* FALLTHROUGH */ - case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_AR8171: sc->alc_flags |= ALC_FLAG_AR816X_FAMILY; break; @@ -1473,6 +1479,12 @@ alc_attach(device_t dev) sc->alc_dma_rd_burst = 3; if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; + /* + * Force maximum payload size to 128 bytes for E2200/E2400. + * Otherwise it triggers DMA write error. + */ + if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) + sc->alc_dma_wr_burst = 0; alc_init_pcie(sc); } Modified: head/sys/dev/alc/if_alcreg.h ============================================================================== --- head/sys/dev/alc/if_alcreg.h Mon Aug 22 01:06:54 2016 (r304574) +++ head/sys/dev/alc/if_alcreg.h Mon Aug 22 01:19:05 2016 (r304575) @@ -45,10 +45,11 @@ #define DEVICEID_ATHEROS_AR8152_B 0x2060 /* L2C V1.1 */ #define DEVICEID_ATHEROS_AR8152_B2 0x2062 /* L2C V2.0 */ #define DEVICEID_ATHEROS_AR8161 0x1091 -#define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_AR8162 0x1090 #define DEVICEID_ATHEROS_AR8171 0x10A1 #define DEVICEID_ATHEROS_AR8172 0x10A0 +#define DEVICEID_ATHEROS_E2200 0xE091 +#define DEVICEID_ATHEROS_E2400 0xE0A1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Aug 22 01:06:54 2016 (r304574) +++ head/sys/dev/pci/pci.c Mon Aug 22 01:19:05 2016 (r304575) @@ -281,12 +281,13 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200 Ethernet controllers have a bug that - * MSI interrupt does not assert if PCIM_CMD_INTxDIS bit of the - * command register is set. + * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a + * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-head@freebsd.org Mon Aug 22 01:28:03 2016 Return-Path: Delivered-To: svn-src-head@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 64D0EBC1AC0; Mon, 22 Aug 2016 01:28:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 23B2A1C69; Mon, 22 Aug 2016 01:28:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M1S27T072395; Mon, 22 Aug 2016 01:28:02 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M1S2WY072394; Mon, 22 Aug 2016 01:28:02 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608220128.u7M1S2WY072394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Mon, 22 Aug 2016 01:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304576 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 01:28:03 -0000 Author: yongari Date: Mon Aug 22 01:28:02 2016 New Revision: 304576 URL: https://svnweb.freebsd.org/changeset/base/304576 Log: Add Killer E2400 to the supported hardware list. Modified: head/share/man/man4/alc.4 Modified: head/share/man/man4/alc.4 ============================================================================== --- head/share/man/man4/alc.4 Mon Aug 22 01:19:05 2016 (r304575) +++ head/share/man/man4/alc.4 Mon Aug 22 01:28:02 2016 (r304576) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2014 +.Dd August 22, 2016 .Dt ALC 4 .Os .Sh NAME @@ -122,6 +122,8 @@ Atheros AR8171 PCI Express Gigabit Ether Atheros AR8172 PCI Express Fast Ethernet controller .It Killer E2200 Gigabit Ethernet controller +.It +Killer E2400 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the From owner-svn-src-head@freebsd.org Mon Aug 22 01:45:30 2016 Return-Path: Delivered-To: svn-src-head@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 A19D2BC1EFD; Mon, 22 Aug 2016 01:45:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 744091852; Mon, 22 Aug 2016 01:45:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M1jTRa079804; Mon, 22 Aug 2016 01:45:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M1jTws079803; Mon, 22 Aug 2016 01:45:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608220145.u7M1jTws079803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 22 Aug 2016 01:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304579 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 01:45:30 -0000 Author: tuexen Date: Mon Aug 22 01:45:29 2016 New Revision: 304579 URL: https://svnweb.freebsd.org/changeset/base/304579 Log: Improve the locking when sending user messages. First, keep a ref count on the stcb after looking it up, as done in the other lookup cases. Second, before looking again at sp, ensure that it is not freed, because the assoc is about to be freed. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Aug 22 01:43:47 2016 (r304578) +++ head/sys/netinet/sctp_output.c Mon Aug 22 01:45:29 2016 (r304579) @@ -12639,7 +12639,10 @@ sctp_lower_sosend(struct socket *so, } SCTP_INP_RUNLOCK(inp); } else if (sinfo_assoc_id) { - stcb = sctp_findassociation_ep_asocid(inp, sinfo_assoc_id, 0); + stcb = sctp_findassociation_ep_asocid(inp, sinfo_assoc_id, 1); + if (stcb != NULL) { + hold_tcblock = 1; + } } else if (addr) { /*- * Since we did not use findep we must @@ -13404,6 +13407,10 @@ skip_preblock: } } SCTP_TCB_SEND_LOCK(stcb); + if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + SCTP_TCB_SEND_UNLOCK(stcb); + goto out_unlocked; + } if (sp) { if (sp->msg_is_complete == 0) { strm->last_msg_incomplete = 1; From owner-svn-src-head@freebsd.org Mon Aug 22 03:28:07 2016 Return-Path: Delivered-To: svn-src-head@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 6968EBC17A4; Mon, 22 Aug 2016 03:28:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 33488176F; Mon, 22 Aug 2016 03:28:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M3S6ZE017672; Mon, 22 Aug 2016 03:28:06 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M3S6S2017671; Mon, 22 Aug 2016 03:28:06 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608220328.u7M3S6S2017671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Mon, 22 Aug 2016 03:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304584 - head/sys/dev/alc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 03:28:07 -0000 Author: yongari Date: Mon Aug 22 03:28:06 2016 New Revision: 304584 URL: https://svnweb.freebsd.org/changeset/base/304584 Log: Add a missing change in r304575. Noticed by: jhb Modified: head/sys/dev/alc/if_alcvar.h Modified: head/sys/dev/alc/if_alcvar.h ============================================================================== --- head/sys/dev/alc/if_alcvar.h Mon Aug 22 03:23:28 2016 (r304583) +++ head/sys/dev/alc/if_alcvar.h Mon Aug 22 03:28:06 2016 (r304584) @@ -235,7 +235,8 @@ struct alc_softc { #define ALC_FLAG_APS 0x1000 #define ALC_FLAG_AR816X_FAMILY 0x2000 #define ALC_FLAG_LINK_WAR 0x4000 -#define ALC_FLAG_LINK 0x8000 +#define ALC_FLAG_E2X00 0x8000 +#define ALC_FLAG_LINK 0x10000 struct callout alc_tick_ch; struct alc_hw_stats alc_stats; From owner-svn-src-head@freebsd.org Mon Aug 22 03:31:00 2016 Return-Path: Delivered-To: svn-src-head@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 C2DCFBC1833; Mon, 22 Aug 2016 03:31:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92F011969; Mon, 22 Aug 2016 03:31:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id ti13so33062572pac.0; Sun, 21 Aug 2016 20:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yEXFmaREryZ+6CgsE97KugBppxRbM+1TTgYkaVcP87s=; b=L7mC54abX1n7gJNVf/kY0BwrIuL219ao7spsVbkXJN1glj6GiDmYKhgwOoNsE5V6l+ ntrRCjHJDdt6GSd/wdCfDwhwMBH2xlGUvuZldHns+4I64TVi7CGjEW1o0FqlJyN8rvTC mOJkjiAuVKVmC2Rdfnbh5dI1c6l3AnKg++J52ggOepyWyl8cedXniYUTexQZsqshLhsq OKVMnJjzlCl2UMRK/x2N2rmO7L/gxfWtMhM0K65BglDj+3ZKSu3e2s/N5QR9GJFADpUr BwgTEofq1En+q7lSgGqXS8M6/OEIek2JPNvtU9X9LlUPNRrRzoORE8TDTUAFhsNPeKCr lKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=yEXFmaREryZ+6CgsE97KugBppxRbM+1TTgYkaVcP87s=; b=Kep1zAZdS69XTF0dJ6MG0K8FRs11Wx1iS2PWcrRzRHFXx79m6uz5dsVrhbyY7nkZ8G pK9pL4UFuRKUITmEKkcaUzQ53LSotv8oNORkNmEG/NgC+zu547gobp/Bj7UHA4/bYMPD DCGsPnfBQ0vShiZQhFMxCL0iUQSE/BrEtaf29O7V+DbtOZZ92R0Y8XCRp8/0n6TB63GI rPyH+JbxSlPPIHc+38N6aG1aFeP1MTu4oMJyrjSxrM6mRYqaEINSbuXkDh7V2l7yHDhO fBxKucptGnSzCemlF0D9oDvG+oaOZyXc0J5Qsthr/CTR5OywYRVfjLqECCJ1Pb/wNHsM R0DQ== X-Gm-Message-State: AEkoouuR/oHigmL2PnnwOMRQ5brkANlp2FjDHCJ5R4lg+DAABvLN0JAMwwAEDYd4BL5+0Q== X-Received: by 10.66.234.161 with SMTP id uf1mr37798846pac.93.1471836660099; Sun, 21 Aug 2016 20:31:00 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id v26sm23036296pfi.41.2016.08.21.20.30.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Aug 2016 20:30:59 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Mon, 22 Aug 2016 12:30:52 +0900 Date: Mon, 22 Aug 2016 12:30:52 +0900 To: Pyun YongHyeon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304584 - head/sys/dev/alc Message-ID: <20160822033052.GB1447@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608220328.u7M3S6S2017671@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608220328.u7M3S6S2017671@repo.freebsd.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 03:31:00 -0000 On Mon, Aug 22, 2016 at 03:28:06AM +0000, Pyun YongHyeon wrote: > Author: yongari > Date: Mon Aug 22 03:28:06 2016 > New Revision: 304584 > URL: https://svnweb.freebsd.org/changeset/base/304584 > > Log: > Add a missing change in r304575. > > Noticed by: jhb Actually it was pointed out by markj. Sorry. From owner-svn-src-head@freebsd.org Mon Aug 22 07:21:19 2016 Return-Path: Delivered-To: svn-src-head@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 89763BC28AA; Mon, 22 Aug 2016 07:21:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4615112DC; Mon, 22 Aug 2016 07:21:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA27422; Mon, 22 Aug 2016 10:21:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bbjXf-000PDn-7F; Mon, 22 Aug 2016 10:21:07 +0300 Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... To: Toomas Soome , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201608180037.u7I0b77A095653@repo.freebsd.org> From: Andriy Gapon Message-ID: <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> Date: Mon, 22 Aug 2016 10:20:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608180037.u7I0b77A095653@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 07:21:19 -0000 On 18/08/2016 03:37, Toomas Soome wrote: > Author: tsoome > Date: Thu Aug 18 00:37:07 2016 > New Revision: 304321 > URL: https://svnweb.freebsd.org/changeset/base/304321 > > Log: > Add SHA512, skein, large blocks support for loader zfs. > > Updated sha512 from illumos. > Using skein from freebsd crypto tree. > Since loader itself is using 64MB memory for heap, updated zfsboot to > use same, and this also allows to support zfs large blocks. > > Note, adding additional features does increate zfsboot code, therefore > this update does increase zfsboot code to 128k, also I have ported gptldr.S > update to zfsldr.S to support 64k+ code. This commit breaks boot process for me and in a quite weird way. I don't have a serial console, so a couple of screenshots. This is what happens with this change: https://people.freebsd.org/~avg/boot-fail-1024x768.jpg This is what I have with the previous loader: https://people.freebsd.org/~avg/boot-success-1024x768.jpg As you can see somehow the HDD gets misdetected as a floppy, BIOS disk ID is 0x0 as opposed to 0x80. Also, the disk size is incorrect too. Additionally the firewire is not detected. I suspect that the problem may have to do with the increased loader size. I must add that I have these in src.conf: LOADER_BZIP2_SUPPORT=yes LOADER_FIREWIRE_SUPPORT=yes My memory of loader's memory placement and layout has faded, so I can't elaborate further on my guess. Also, there is this report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212038 That problem could have a different cause. It should be easier to analyze as the it happens with bhyveload, i.e., in userland. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 22 07:34:41 2016 Return-Path: Delivered-To: svn-src-head@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 5D394BC2E09; Mon, 22 Aug 2016 07:34:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 26A3212A7; Mon, 22 Aug 2016 07:34:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M7Yevr009812; Mon, 22 Aug 2016 07:34:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M7YeEm009806; Mon, 22 Aug 2016 07:34:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608220734.u7M7YeEm009806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Aug 2016 07:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304591 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 07:34:41 -0000 Author: sephe Date: Mon Aug 22 07:34:39 2016 New Revision: 304591 URL: https://svnweb.freebsd.org/changeset/base/304591 Log: hyperv/hn: Move chimney sending buffer to hn_softc And don't recreate chimney sending buffer for each primary channel open, it is now created in device_attach DEVMETHOD and destroyed in device_detach DEVMETHOD. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7574 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:26:43 2016 (r304590) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:34:39 2016 (r304591) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -60,10 +61,10 @@ static void hv_nv_on_channel_callback(st void *xrxr); static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *, int); -static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); +static int hv_nv_destroy_send_buffer(struct hn_softc *sc); static int hv_nv_destroy_rx_buffer(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc); -static void hv_nv_on_send_completion(netvsc_dev *net_dev, +static void hv_nv_on_send_completion(struct hn_softc *sc, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); static void hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid); @@ -71,7 +72,7 @@ static void hv_nv_on_receive(netvsc_dev struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + struct hn_softc *, struct vmbus_channel *chan, const void *, int); static struct hn_send_ctx hn_send_ctx_none = @@ -111,31 +112,30 @@ hv_nv_get_inbound_net_device(struct hn_s return sc->net_dev; } -int -hv_nv_get_next_send_section(netvsc_dev *net_dev) +uint32_t +hn_chim_alloc(struct hn_softc *sc) { - unsigned long bitsmap_words = net_dev->bitsmap_words; - unsigned long *bitsmap = net_dev->send_section_bitsmap; - unsigned long idx; - int ret = HN_NVS_CHIM_IDX_INVALID; - int i; + int i, bmap_cnt = sc->hn_chim_bmap_cnt; + u_long *bmap = sc->hn_chim_bmap; + uint32_t ret = HN_NVS_CHIM_IDX_INVALID; - for (i = 0; i < bitsmap_words; i++) { - idx = ffsl(~bitsmap[i]); - if (0 == idx) + for (i = 0; i < bmap_cnt; ++i) { + int idx; + + idx = ffsl(~bmap[i]); + if (idx == 0) continue; - idx--; - KASSERT(i * BITS_PER_LONG + idx < net_dev->send_section_count, - ("invalid i %d and idx %lu", i, idx)); + --idx; /* ffsl is 1-based */ + KASSERT(i * LONG_BIT + idx < sc->hn_chim_cnt, + ("invalid i %d and idx %d", i, idx)); - if (atomic_testandset_long(&bitsmap[i], idx)) + if (atomic_testandset_long(&bmap[i], idx)) continue; - ret = i * BITS_PER_LONG + idx; + ret = i * LONG_BIT + idx; break; } - return (ret); } @@ -248,22 +248,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru const struct hn_nvs_chim_connresp *resp; size_t resp_len; uint32_t status, sectsz; - netvsc_dev *net_dev; int error; - net_dev = hv_nv_get_outbound_net_device(sc); - if (!net_dev) { - return (ENODEV); - } - - net_dev->send_buf = hyperv_dmamem_alloc(bus_get_dma_tag(sc->hn_dev), - PAGE_SIZE, 0, net_dev->send_buf_size, &net_dev->txbuf_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); - if (net_dev->send_buf == NULL) { - device_printf(sc->hn_dev, "allocate chimney txbuf failed\n"); - return (ENOMEM); - } - /* * Connect chimney sending buffer GPADL to the primary channel. * @@ -272,8 +258,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru * Sub-channels just share this chimney sending buffer. */ error = vmbus_chan_gpadl_connect(sc->hn_prichan, - net_dev->txbuf_dma.hv_paddr, net_dev->send_buf_size, - &net_dev->send_buf_gpadl_handle); + sc->hn_chim_dma.hv_paddr, NETVSC_SEND_BUFFER_SIZE, + &sc->hn_chim_gpadl); if (error) { if_printf(sc->hn_ifp, "chimney sending buffer gpadl " "connect failed: %d\n", error); @@ -293,7 +279,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru chim = vmbus_xact_req_data(xact); chim->nvs_type = HN_NVS_TYPE_CHIM_CONN; - chim->nvs_gpadl = net_dev->send_buf_gpadl_handle; + chim->nvs_gpadl = sc->hn_chim_gpadl; chim->nvs_sig = HN_NVS_CHIM_SIG; hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); @@ -340,23 +326,31 @@ hv_nv_init_send_buffer_with_net_vsp(stru return 0; } - net_dev->send_section_size = sectsz; - net_dev->send_section_count = - net_dev->send_buf_size / net_dev->send_section_size; - net_dev->bitsmap_words = howmany(net_dev->send_section_count, - BITS_PER_LONG); - net_dev->send_section_bitsmap = - malloc(net_dev->bitsmap_words * sizeof(long), M_NETVSC, - M_WAITOK | M_ZERO); + sc->hn_chim_szmax = sectsz; + sc->hn_chim_cnt = NETVSC_SEND_BUFFER_SIZE / sc->hn_chim_szmax; + if (NETVSC_SEND_BUFFER_SIZE % sc->hn_chim_szmax != 0) { + if_printf(sc->hn_ifp, "chimney sending sections are " + "not properly aligned\n"); + } + if (sc->hn_chim_cnt % LONG_BIT != 0) { + if_printf(sc->hn_ifp, "discard %d chimney sending sections\n", + sc->hn_chim_cnt % LONG_BIT); + } + + sc->hn_chim_bmap_cnt = sc->hn_chim_cnt / LONG_BIT; + sc->hn_chim_bmap = malloc(sc->hn_chim_bmap_cnt * sizeof(u_long), + M_NETVSC, M_WAITOK | M_ZERO); + /* Done! */ + sc->hn_flags |= HN_FLAG_CHIM_CONNECTED; if (bootverbose) { - if_printf(sc->hn_ifp, "chimney sending buffer %u/%u\n", - net_dev->send_section_size, net_dev->send_section_count); + if_printf(sc->hn_ifp, "chimney sending buffer %d/%d\n", + sc->hn_chim_szmax, sc->hn_chim_cnt); } return 0; cleanup: - hv_nv_destroy_send_buffer(net_dev); + hv_nv_destroy_send_buffer(sc); return (error); } @@ -379,9 +373,8 @@ hv_nv_destroy_rx_buffer(struct hn_softc disconn.nvs_sig = HN_NVS_RXBUF_SIG; /* NOTE: No response. */ - ret = hn_nvs_send(sc->hn_prichan, - VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), - &hn_send_ctx_none); + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + &disconn, sizeof(disconn), &hn_send_ctx_none); if (ret != 0) { if_printf(sc->hn_ifp, "send rxbuf disconn failed: %d\n", ret); @@ -410,11 +403,11 @@ hv_nv_destroy_rx_buffer(struct hn_softc * Net VSC destroy send buffer */ static int -hv_nv_destroy_send_buffer(netvsc_dev *net_dev) +hv_nv_destroy_send_buffer(struct hn_softc *sc) { int ret = 0; - if (net_dev->send_section_size) { + if (sc->hn_flags & HN_FLAG_CHIM_CONNECTED) { struct hn_nvs_chim_disconn disconn; /* @@ -425,39 +418,33 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne disconn.nvs_sig = HN_NVS_CHIM_SIG; /* NOTE: No response. */ - ret = hn_nvs_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), - &hn_send_ctx_none); + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + &disconn, sizeof(disconn), &hn_send_ctx_none); if (ret != 0) { - if_printf(net_dev->sc->hn_ifp, + if_printf(sc->hn_ifp, "send chim disconn failed: %d\n", ret); return (ret); } + sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED; } - /* Tear down the gpadl on the vsp end */ - if (net_dev->send_buf_gpadl_handle) { - ret = vmbus_chan_gpadl_disconnect(net_dev->sc->hn_prichan, - net_dev->send_buf_gpadl_handle); - + if (sc->hn_chim_gpadl != 0) { /* - * If we failed here, we might as well return and have a leak - * rather than continue and a bugchk + * Disconnect chimney sending buffer from primary channel. */ + ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + sc->hn_chim_gpadl); if (ret != 0) { + if_printf(sc->hn_ifp, + "chim disconn failed: %d\n", ret); return (ret); } - net_dev->send_buf_gpadl_handle = 0; - } - - if (net_dev->send_buf) { - /* Free up the receive buffer */ - hyperv_dmamem_free(&net_dev->txbuf_dma, net_dev->send_buf); - net_dev->send_buf = NULL; + sc->hn_chim_gpadl = 0; } - if (net_dev->send_section_bitsmap) { - free(net_dev->send_section_bitsmap, M_NETVSC); + if (sc->hn_chim_bmap != NULL) { + free(sc->hn_chim_bmap, M_NETVSC); + sc->hn_chim_bmap = NULL; } return (ret); @@ -622,7 +609,6 @@ hv_nv_connect_to_vsp(struct hn_softc *sc rxbuf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; else rxbuf_size = NETVSC_RECEIVE_BUFFER_SIZE; - net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE; ret = hv_nv_init_rx_buffer_with_net_vsp(sc, rxbuf_size); if (ret == 0) @@ -639,7 +625,7 @@ static void hv_nv_disconnect_from_vsp(struct hn_softc *sc) { hv_nv_destroy_rx_buffer(sc); - hv_nv_destroy_send_buffer(sc->net_dev); + hv_nv_destroy_send_buffer(sc); } void @@ -727,7 +713,7 @@ hv_nv_on_device_remove(struct hn_softc * void hn_nvs_sent_xact(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, + struct hn_softc *sc __unused, struct vmbus_channel *chan __unused, const void *data, int dlen) { @@ -736,42 +722,42 @@ hn_nvs_sent_xact(struct hn_send_ctx *snd static void hn_nvs_sent_none(struct hn_send_ctx *sndc __unused, - struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, + struct hn_softc *sc __unused, struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { /* EMPTY */ } void -hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx) +hn_chim_free(struct hn_softc *sc, uint32_t chim_idx) { u_long mask; uint32_t idx; - idx = chim_idx / BITS_PER_LONG; - KASSERT(idx < net_dev->bitsmap_words, + idx = chim_idx / LONG_BIT; + KASSERT(idx < sc->hn_chim_bmap_cnt, ("invalid chimney index 0x%x", chim_idx)); - mask = 1UL << (chim_idx % BITS_PER_LONG); - KASSERT(net_dev->send_section_bitsmap[idx] & mask, + mask = 1UL << (chim_idx % LONG_BIT); + KASSERT(sc->hn_chim_bmap[idx] & mask, ("index bitmap 0x%lx, chimney index %u, " "bitmap idx %d, bitmask 0x%lx", - net_dev->send_section_bitsmap[idx], chim_idx, idx, mask)); + sc->hn_chim_bmap[idx], chim_idx, idx, mask)); - atomic_clear_long(&net_dev->send_section_bitsmap[idx], mask); + atomic_clear_long(&sc->hn_chim_bmap[idx], mask); } /* * Net VSC on send completion */ static void -hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *chan, +hv_nv_on_send_completion(struct hn_softc *sc, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt) { struct hn_send_ctx *sndc; sndc = (struct hn_send_ctx *)(uintptr_t)pkt->cph_xactid; - sndc->hn_cb(sndc, net_dev, chan, VMBUS_CHANPKT_CONST_DATA(pkt), + sndc->hn_cb(sndc, sc, chan, VMBUS_CHANPKT_CONST_DATA(pkt), VMBUS_CHANPKT_DATALEN(pkt)); /* * NOTE: @@ -930,8 +916,7 @@ hv_nv_on_channel_callback(struct vmbus_c if (bytes_rxed > 0) { switch (pkt->cph_type) { case VMBUS_CHANPKT_TYPE_COMP: - hv_nv_on_send_completion(net_dev, chan, - pkt); + hv_nv_on_send_completion(sc, chan, pkt); break; case VMBUS_CHANPKT_TYPE_RXBUF: hv_nv_on_receive(net_dev, rxr, chan, pkt); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 22 07:26:43 2016 (r304590) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 22 07:34:39 2016 (r304591) @@ -217,20 +217,8 @@ typedef struct rndis_recv_scale_param_ { */ typedef struct netvsc_dev_ { struct hn_softc *sc; - - /* Send buffer allocated by us but manages by NetVSP */ - void *send_buf; - uint32_t send_buf_size; - uint32_t send_buf_gpadl_handle; - uint32_t send_section_size; - uint32_t send_section_count; - unsigned long bitsmap_words; - unsigned long *send_section_bitsmap; - /* Holds rndis device info */ void *extension; - - struct hyperv_dma txbuf_dma; } netvsc_dev; struct vmbus_channel; @@ -255,12 +243,6 @@ typedef void (*pfn_on_send_rx_completion #define TRANSPORT_TYPE_IPV6_TCP ((TYPE_IPV6 << 16) | TYPE_TCP) #define TRANSPORT_TYPE_IPV6_UDP ((TYPE_IPV6 << 16) | TYPE_UDP) -#ifdef __LP64__ -#define BITS_PER_LONG 64 -#else -#define BITS_PER_LONG 32 -#endif - typedef struct { uint8_t mac_addr[6]; /* Assumption unsigned long */ uint8_t link_state; @@ -333,7 +315,7 @@ struct hn_tx_ring { struct vmbus_channel *hn_chan; int hn_direct_tx_size; - int hn_tx_chimney_size; + int hn_chim_size; bus_dma_tag_t hn_tx_data_dtag; uint64_t hn_csum_assist; @@ -382,8 +364,13 @@ typedef struct hn_softc { int hn_tx_ring_inuse; struct hn_tx_ring *hn_tx_ring; + uint8_t *hn_chim; + u_long *hn_chim_bmap; + int hn_chim_bmap_cnt; + int hn_chim_cnt; + int hn_chim_szmax; + int hn_cpu; - int hn_tx_chimney_max; struct taskqueue *hn_tx_taskq; struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; @@ -394,9 +381,13 @@ typedef struct hn_softc { void *hn_rxbuf; uint32_t hn_rxbuf_gpadl; struct hyperv_dma hn_rxbuf_dma; + + uint32_t hn_chim_gpadl; + struct hyperv_dma hn_chim_dma; } hn_softc_t; #define HN_FLAG_RXBUF_CONNECTED 0x0001 +#define HN_FLAG_CHIM_CONNECTED 0x0002 /* * Externs @@ -411,7 +402,6 @@ int hv_nv_on_device_remove(struct hn_sof boolean_t destroy_channel); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); -int hv_nv_get_next_send_section(netvsc_dev *net_dev); void hv_nv_subchan_attach(struct vmbus_channel *chan, struct hn_rx_ring *rxr); Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Aug 22 07:26:43 2016 (r304590) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Aug 22 07:34:39 2016 (r304591) @@ -328,7 +328,7 @@ static int hn_lro_lenlim_sysctl(SYSCTL_H static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); -static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); @@ -344,7 +344,7 @@ static void hn_stop_tx_tasks(struct hn_s static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); -static void hn_set_tx_chimney_size(struct hn_softc *, int); +static void hn_set_chim_size(struct hn_softc *, int); static void hn_channel_attach(struct hn_softc *, struct vmbus_channel *); static void hn_subchan_attach(struct hn_softc *, struct vmbus_channel *); static void hn_subchan_setup(struct hn_softc *); @@ -606,11 +606,10 @@ netvsc_attach(device_t dev) ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); #endif - sc->hn_tx_chimney_max = sc->net_dev->send_section_size; - hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); + hn_set_chim_size(sc, sc->hn_chim_szmax); if (hn_tx_chimney_size > 0 && - hn_tx_chimney_size < sc->hn_tx_chimney_max) - hn_set_tx_chimney_size(sc, hn_tx_chimney_size); + hn_tx_chimney_size < sc->hn_chim_szmax) + hn_set_chim_size(sc, hn_tx_chimney_size); SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, @@ -796,14 +795,14 @@ hn_txeof(struct hn_tx_ring *txr) } static void -hn_tx_done(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, +hn_tx_done(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan, const void *data __unused, int dlen __unused) { struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) - hn_chim_free(net_dev, sndc->hn_chim_idx); + hn_chim_free(sc, sndc->hn_chim_idx); txr = txd->txr; KASSERT(txr->hn_chan == chan, @@ -986,16 +985,12 @@ hn_encap(struct hn_tx_ring *txr, struct /* * Chimney send, if the packet could fit into one chimney buffer. */ - if (tot_data_buf_len < txr->hn_tx_chimney_size) { - netvsc_dev *net_dev = txr->hn_sc->net_dev; - + if (tot_data_buf_len < txr->hn_chim_size) { txr->hn_tx_chimney_tried++; - send_buf_section_idx = - hv_nv_get_next_send_section(net_dev); + send_buf_section_idx = hn_chim_alloc(txr->hn_sc); if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { - uint8_t *dest = ((uint8_t *)net_dev->send_buf + - (send_buf_section_idx * - net_dev->send_section_size)); + uint8_t *dest = txr->hn_sc->hn_chim + + (send_buf_section_idx * txr->hn_sc->hn_chim_szmax); memcpy(dest, rndis_mesg, rndis_msg_size); dest += rndis_msg_size; @@ -1617,10 +1612,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, hn_subchan_setup(sc); } - sc->hn_tx_chimney_max = sc->net_dev->send_section_size; - if (sc->hn_tx_ring[0].hn_tx_chimney_size > - sc->hn_tx_chimney_max) - hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); + if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) + hn_set_chim_size(sc, sc->hn_chim_szmax); hn_ifinit_locked(sc); @@ -1984,20 +1977,20 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG } static int -hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS) +hn_chim_size_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - int chimney_size, error; + int chim_size, error; - chimney_size = sc->hn_tx_ring[0].hn_tx_chimney_size; - error = sysctl_handle_int(oidp, &chimney_size, 0, req); + chim_size = sc->hn_tx_ring[0].hn_chim_size; + error = sysctl_handle_int(oidp, &chim_size, 0, req); if (error || req->newptr == NULL) return error; - if (chimney_size > sc->hn_tx_chimney_max || chimney_size <= 0) + if (chim_size > sc->hn_chim_szmax || chim_size <= 0) return EINVAL; - hn_set_tx_chimney_size(sc, chimney_size); + hn_set_chim_size(sc, chim_size); return 0; } @@ -2359,6 +2352,11 @@ hn_destroy_rx_data(struct hn_softc *sc) { int i; + if (sc->hn_rxbuf != NULL) { + hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + sc->hn_rxbuf = NULL; + } + if (sc->hn_rx_ring_cnt == 0) return; @@ -2375,11 +2373,6 @@ hn_destroy_rx_data(struct hn_softc *sc) sc->hn_rx_ring_cnt = 0; sc->hn_rx_ring_inuse = 0; - - if (sc->hn_rxbuf != NULL) { - hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); - sc->hn_rxbuf = NULL; - } } static int @@ -2639,6 +2632,19 @@ hn_create_tx_data(struct hn_softc *sc, i struct sysctl_ctx_list *ctx; int i; + /* + * Create TXBUF for chimney sending. + * + * NOTE: It is shared by all channels. + */ + sc->hn_chim = hyperv_dmamem_alloc(bus_get_dma_tag(sc->hn_dev), + PAGE_SIZE, 0, NETVSC_SEND_BUFFER_SIZE, &sc->hn_chim_dma, + BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (sc->hn_chim == NULL) { + device_printf(sc->hn_dev, "allocate txbuf failed\n"); + return (ENOMEM); + } + sc->hn_tx_ring_cnt = ring_cnt; sc->hn_tx_ring_inuse = sc->hn_tx_ring_cnt; @@ -2688,12 +2694,11 @@ hn_create_tx_data(struct hn_softc *sc, i CTLFLAG_RD, &sc->hn_tx_ring[0].hn_txdesc_cnt, 0, "# of total TX descs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_chimney_max", - CTLFLAG_RD, &sc->hn_tx_chimney_max, 0, + CTLFLAG_RD, &sc->hn_chim_szmax, 0, "Chimney send packet size upper boundary"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, - hn_tx_chimney_size_sysctl, - "I", "Chimney send packet size limit"); + hn_chim_size_sysctl, "I", "Chimney send packet size limit"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "direct_tx_size", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_direct_tx_size), @@ -2714,13 +2719,13 @@ hn_create_tx_data(struct hn_softc *sc, i } static void -hn_set_tx_chimney_size(struct hn_softc *sc, int chimney_size) +hn_set_chim_size(struct hn_softc *sc, int chim_size) { int i; NV_LOCK(sc); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) - sc->hn_tx_ring[i].hn_tx_chimney_size = chimney_size; + sc->hn_tx_ring[i].hn_chim_size = chim_size; NV_UNLOCK(sc); } @@ -2729,6 +2734,11 @@ hn_destroy_tx_data(struct hn_softc *sc) { int i; + if (sc->hn_chim != NULL) { + hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + sc->hn_chim = NULL; + } + if (sc->hn_tx_ring_cnt == 0) return; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 22 07:26:43 2016 (r304590) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 22 07:34:39 2016 (r304591) @@ -86,10 +86,10 @@ hv_rf_send_offload_request(struct hn_sof rndis_offload_params *offloads); static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); /* @@ -240,7 +240,7 @@ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type) { - netvsc_dev *net_dev = device->net_dev; + struct hn_softc *sc = device->net_dev->sc; uint32_t send_buf_section_idx, tot_data_buf_len; struct vmbus_gpa gpa[2]; int gpa_cnt, send_buf_section_size; @@ -269,11 +269,11 @@ hv_rf_send_request(rndis_device *device, else cb = hn_rndis_sent_halt; - if (tot_data_buf_len < net_dev->send_section_size) { - send_buf_section_idx = hv_nv_get_next_send_section(net_dev); + if (tot_data_buf_len < sc->hn_chim_szmax) { + send_buf_section_idx = hn_chim_alloc(sc); if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { - char *dest = ((char *)net_dev->send_buf + - send_buf_section_idx * net_dev->send_section_size); + uint8_t *dest = sc->hn_chim + + (send_buf_section_idx * sc->hn_chim_szmax); memcpy(dest, &request->request_msg, request->request_msg.msg_len); send_buf_section_size = tot_data_buf_len; @@ -288,8 +288,8 @@ hv_rf_send_request(rndis_device *device, sendit: hn_send_ctx_init(&request->send_ctx, cb, request, send_buf_section_idx, send_buf_section_size); - return hv_nv_on_send(device->net_dev->sc->hn_prichan, - HN_NVS_RNDIS_MTYPE_CTRL, &request->send_ctx, gpa, gpa_cnt); + return hv_nv_on_send(sc->hn_prichan, HN_NVS_RNDIS_MTYPE_CTRL, + &request->send_ctx, gpa, gpa_cnt); } /* @@ -1247,23 +1247,23 @@ hv_rf_on_close(struct hn_softc *sc) } static void -hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, +hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) - hn_chim_free(net_dev, sndc->hn_chim_idx); + hn_chim_free(sc, sndc->hn_chim_idx); } static void -hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, +hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { rndis_request *request = sndc->hn_cbarg; if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) - hn_chim_free(net_dev, sndc->hn_chim_idx); + hn_chim_free(sc, sndc->hn_chim_idx); /* * Notify hv_rf_halt_device() about halt completion. Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 22 07:26:43 2016 (r304590) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 22 07:34:39 2016 (r304591) @@ -34,13 +34,13 @@ #include #include -struct netvsc_dev_; +struct hn_softc; struct vmbus_channel; struct hn_send_ctx; typedef void (*hn_sent_callback_t) - (struct hn_send_ctx *, struct netvsc_dev_ *, + (struct hn_send_ctx *, struct hn_softc *, struct vmbus_channel *, const void *, int); struct hn_send_ctx { @@ -108,8 +108,9 @@ hn_nvs_send_sglist(struct vmbus_channel } void hn_nvs_sent_xact(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, + struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); -void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); +uint32_t hn_chim_alloc(struct hn_softc *sc); +void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); #endif /* !_IF_HNVAR_H_ */ From owner-svn-src-head@freebsd.org Mon Aug 22 07:44:12 2016 Return-Path: Delivered-To: svn-src-head@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 C89E4BC1608; Mon, 22 Aug 2016 07:44:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A305E19AD; Mon, 22 Aug 2016 07:44:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M7iBfx013537; Mon, 22 Aug 2016 07:44:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M7iBMU013533; Mon, 22 Aug 2016 07:44:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608220744.u7M7iBMU013533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Aug 2016 07:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304593 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 07:44:12 -0000 Author: sephe Date: Mon Aug 22 07:44:11 2016 New Revision: 304593 URL: https://svnweb.freebsd.org/changeset/base/304593 Log: hyperv/hn: Get rid of netvsc_dev MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7575 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:38:44 2016 (r304592) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:44:11 2016 (r304593) @@ -68,7 +68,7 @@ static void hv_nv_on_send_completion(str struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); static void hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid); -static void hv_nv_on_receive(netvsc_dev *net_dev, +static void hv_nv_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, @@ -78,40 +78,6 @@ static void hn_nvs_sent_none(struct hn_s static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); -/* - * - */ -static inline netvsc_dev * -hv_nv_alloc_net_device(struct hn_softc *sc) -{ - netvsc_dev *net_dev; - - net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_WAITOK | M_ZERO); - - net_dev->sc = sc; - sc->net_dev = net_dev; - - return (net_dev); -} - -/* - * XXX unnecessary; nuke it. - */ -static inline netvsc_dev * -hv_nv_get_outbound_net_device(struct hn_softc *sc) -{ - return sc->net_dev; -} - -/* - * XXX unnecessary; nuke it. - */ -static inline netvsc_dev * -hv_nv_get_inbound_net_device(struct hn_softc *sc) -{ - return sc->net_dev; -} - uint32_t hn_chim_alloc(struct hn_softc *sc) { @@ -451,8 +417,7 @@ hv_nv_destroy_send_buffer(struct hn_soft } static int -hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, netvsc_dev *net_dev, - uint32_t nvs_ver) +hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, uint32_t nvs_ver) { struct hn_send_ctx sndc; struct vmbus_xact *xact; @@ -540,7 +505,6 @@ hv_nv_send_ndis_config(struct hn_softc * static int hv_nv_connect_to_vsp(struct hn_softc *sc) { - netvsc_dev *net_dev; uint32_t protocol_list[] = { NVSP_PROTOCOL_VERSION_1, NVSP_PROTOCOL_VERSION_2, NVSP_PROTOCOL_VERSION_4, @@ -553,14 +517,11 @@ hv_nv_connect_to_vsp(struct hn_softc *sc struct hn_nvs_ndis_init ndis; int rxbuf_size; - net_dev = hv_nv_get_outbound_net_device(sc); - /* * Negotiate the NVSP version. Try the latest NVSP first. */ for (i = protocol_number - 1; i >= 0; i--) { - if (hv_nv_negotiate_nvsp_protocol(sc, net_dev, - protocol_list[i]) == 0) { + if (hv_nv_negotiate_nvsp_protocol(sc, protocol_list[i]) == 0) { sc->hn_nvs_ver = protocol_list[i]; if (bootverbose) { device_printf(dev, "NVS version 0x%x\n", @@ -644,20 +605,12 @@ hv_nv_subchan_attach(struct vmbus_channe * * Callback when the device belonging to this driver is added */ -netvsc_dev * -hv_nv_on_device_add(struct hn_softc *sc, void *additional_info, - struct hn_rx_ring *rxr) +int +hv_nv_on_device_add(struct hn_softc *sc, struct hn_rx_ring *rxr) { struct vmbus_channel *chan = sc->hn_prichan; - netvsc_dev *net_dev; int ret = 0; - net_dev = hv_nv_alloc_net_device(sc); - if (net_dev == NULL) - return NULL; - - /* Initialize the NetVSC channel extension */ - /* * Open the channel */ @@ -677,20 +630,13 @@ hv_nv_on_device_add(struct hn_softc *sc, if (ret != 0) goto close; - return (net_dev); + return (0); close: /* Now, we can close the channel safely */ vmbus_chan_close(chan); - cleanup: - /* - * Free the packet buffers on the netvsc device packet queue. - * Release other resources. - */ - free(net_dev, M_NETVSC); - - return (NULL); + return (ret); } /* @@ -706,8 +652,6 @@ hv_nv_on_device_remove(struct hn_softc * vmbus_chan_close(sc->hn_prichan); - free(sc->net_dev, M_NETVSC); - return (0); } @@ -801,7 +745,7 @@ hv_nv_on_send(struct vmbus_channel *chan * with virtual addresses. */ static void -hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, +hv_nv_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr) { const struct vmbus_chanpkt_rxbuf *pkt; @@ -829,7 +773,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { - hv_rf_on_receive(net_dev, rxr, + hv_rf_on_receive(sc, rxr, rxr->hn_rxbuf + pkt->cp_rxbuf[i].rb_ofs, pkt->cp_rxbuf[i].rb_len); } @@ -896,14 +840,9 @@ hv_nv_on_channel_callback(struct vmbus_c { struct hn_rx_ring *rxr = xrxr; struct hn_softc *sc = rxr->hn_ifp->if_softc; - netvsc_dev *net_dev; void *buffer; int bufferlen = NETVSC_PACKET_SIZE; - net_dev = hv_nv_get_inbound_net_device(sc); - if (net_dev == NULL) - return; - buffer = rxr->hn_rdbuf; do { struct vmbus_chanpkt_hdr *pkt = buffer; @@ -919,7 +858,7 @@ hv_nv_on_channel_callback(struct vmbus_c hv_nv_on_send_completion(sc, chan, pkt); break; case VMBUS_CHANPKT_TYPE_RXBUF: - hv_nv_on_receive(net_dev, rxr, chan, pkt); + hv_nv_on_receive(sc, rxr, chan, pkt); break; case VMBUS_CHANPKT_TYPE_INBAND: hn_proc_notify(sc, pkt); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 22 07:38:44 2016 (r304592) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 22 07:44:11 2016 (r304593) @@ -212,15 +212,6 @@ typedef struct rndis_recv_scale_param_ { * Data types */ -/* - * Per netvsc channel-specific - */ -typedef struct netvsc_dev_ { - struct hn_softc *sc; - /* Holds rndis device info */ - void *extension; -} netvsc_dev; - struct vmbus_channel; typedef void (*pfn_on_send_rx_completion)(struct vmbus_channel *, void *); @@ -353,7 +344,7 @@ typedef struct hn_softc { int hn_initdone; /* See hv_netvsc_drv_freebsd.c for rules on how to use */ int temp_unusable; - netvsc_dev *net_dev; + struct rndis_device_ *rndis_dev; struct vmbus_channel *hn_prichan; int hn_rx_ring_cnt; @@ -396,8 +387,7 @@ extern int hv_promisc_mode; struct hn_send_ctx; void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); -netvsc_dev *hv_nv_on_device_add(struct hn_softc *sc, - void *additional_info, struct hn_rx_ring *rxr); +int hv_nv_on_device_add(struct hn_softc *sc, struct hn_rx_ring *rxr); int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 22 07:38:44 2016 (r304592) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 22 07:44:11 2016 (r304593) @@ -240,7 +240,7 @@ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type) { - struct hn_softc *sc = device->net_dev->sc; + struct hn_softc *sc = device->sc; uint32_t send_buf_section_idx, tot_data_buf_len; struct vmbus_gpa gpa[2]; int gpa_cnt, send_buf_section_size; @@ -346,9 +346,8 @@ hv_rf_send_offload_request(struct hn_sof rndis_set_request *set; rndis_offload_params *offload_req; rndis_set_complete *set_complete; - rndis_device *rndis_dev; + rndis_device *rndis_dev = sc->rndis_dev; device_t dev = sc->hn_dev; - netvsc_dev *net_dev = sc->net_dev; uint32_t extlen = sizeof(rndis_offload_params); int ret; @@ -361,8 +360,6 @@ hv_rf_send_offload_request(struct hn_sof offloads->udp_ipv6_csum = 0; } - rndis_dev = net_dev->extension; - request = hv_rndis_request(rndis_dev, REMOTE_NDIS_SET_MSG, RNDIS_MESSAGE_SIZE(rndis_set_request) + extlen); if (!request) @@ -423,14 +420,14 @@ hv_rf_receive_indicate_status(rndis_devi switch(indicate->status) { case RNDIS_STATUS_MEDIA_CONNECT: - netvsc_linkstatus_callback(device->net_dev->sc, 1); + netvsc_linkstatus_callback(device->sc, 1); break; case RNDIS_STATUS_MEDIA_DISCONNECT: - netvsc_linkstatus_callback(device->net_dev->sc, 0); + netvsc_linkstatus_callback(device->sc, 0); break; default: /* TODO: */ - device_printf(device->net_dev->sc->hn_dev, + device_printf(device->sc->hn_dev, "unknown status %d received\n", indicate->status); break; } @@ -557,17 +554,13 @@ hv_rf_receive_data(struct hn_rx_ring *rx * RNDIS filter on receive */ int -hv_rf_on_receive(netvsc_dev *net_dev, - struct hn_rx_ring *rxr, const void *data, int dlen) +hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, + const void *data, int dlen) { rndis_device *rndis_dev; const rndis_msg *rndis_hdr; - /* Make sure the rndis device state is initialized */ - if (net_dev->extension == NULL) - return (ENODEV); - - rndis_dev = (rndis_device *)net_dev->extension; + rndis_dev = sc->rndis_dev; if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) return (EINVAL); @@ -1039,7 +1032,6 @@ hv_rf_on_device_add(struct hn_softc *sc, { struct hn_send_ctx sndc; int ret; - netvsc_dev *net_dev; rndis_device *rndis_dev; rndis_offload_params offloads; struct rndis_recv_scale_cap rsscaps; @@ -1057,6 +1049,8 @@ hv_rf_on_device_add(struct hn_softc *sc, if (rndis_dev == NULL) { return (ENOMEM); } + sc->rndis_dev = rndis_dev; + rndis_dev->sc = sc; /* * Let the inner driver handle this first to create the netvsc channel @@ -1064,20 +1058,16 @@ hv_rf_on_device_add(struct hn_softc *sc, * (hv_rf_on_receive()) before this call is completed. * Note: Earlier code used a function pointer here. */ - net_dev = hv_nv_on_device_add(sc, additl_info, rxr); - if (!net_dev) { + ret = hv_nv_on_device_add(sc, rxr); + if (ret != 0) { hv_put_rndis_device(rndis_dev); - - return (ENOMEM); + return (ret); } /* * Initialize the rndis device */ - net_dev->extension = rndis_dev; - rndis_dev->net_dev = net_dev; - /* Send the rndis initialization message */ ret = hv_rf_init_device(rndis_dev); if (ret != 0) { @@ -1208,15 +1198,14 @@ out: int hv_rf_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel) { - netvsc_dev *net_dev = sc->net_dev; - rndis_device *rndis_dev = (rndis_device *)net_dev->extension; + rndis_device *rndis_dev = sc->rndis_dev; int ret; /* Halt and release the rndis device */ ret = hv_rf_halt_device(rndis_dev); + sc->rndis_dev = NULL; hv_put_rndis_device(rndis_dev); - net_dev->extension = NULL; /* Pass control to inner driver to remove the device */ ret |= hv_nv_on_device_remove(sc, destroy_channel); @@ -1230,9 +1219,8 @@ hv_rf_on_device_remove(struct hn_softc * int hv_rf_on_open(struct hn_softc *sc) { - netvsc_dev *net_dev = sc->net_dev; - return (hv_rf_open_device((rndis_device *)net_dev->extension)); + return (hv_rf_open_device(sc->rndis_dev)); } /* @@ -1241,9 +1229,8 @@ hv_rf_on_open(struct hn_softc *sc) int hv_rf_on_close(struct hn_softc *sc) { - netvsc_dev *net_dev = sc->net_dev; - return (hv_rf_close_device((rndis_device *)net_dev->extension)); + return (hv_rf_close_device(sc->rndis_dev)); } static void Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Aug 22 07:38:44 2016 (r304592) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Mon Aug 22 07:44:11 2016 (r304593) @@ -96,7 +96,7 @@ typedef struct rndis_request_ { } rndis_request; typedef struct rndis_device_ { - netvsc_dev *net_dev; + struct hn_softc *sc; rndis_device_state state; uint32_t link_status; @@ -112,12 +112,10 @@ typedef struct rndis_device_ { /* * Externs */ -struct hn_softc; struct hn_rx_ring; -int hv_rf_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, +int hv_rf_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, const void *data, int dlen); -void hv_rf_receive_rollup(netvsc_dev *net_dev); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan, struct hn_rx_ring *rxr); From owner-svn-src-head@freebsd.org Mon Aug 22 07:51:47 2016 Return-Path: Delivered-To: svn-src-head@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 B4D99BC1868; Mon, 22 Aug 2016 07:51:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7788D1DC6; Mon, 22 Aug 2016 07:51:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M7pkx1016421; Mon, 22 Aug 2016 07:51:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M7pkWV016418; Mon, 22 Aug 2016 07:51:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608220751.u7M7pkWV016418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Aug 2016 07:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304594 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 07:51:47 -0000 Author: sephe Date: Mon Aug 22 07:51:46 2016 New Revision: 304594 URL: https://svnweb.freebsd.org/changeset/base/304594 Log: hyperv/hn: Factor out function to execute NVS transactions. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7577 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:44:11 2016 (r304593) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:51:46 2016 (r304594) @@ -74,6 +74,8 @@ static void hv_nv_on_receive(struct hn_s static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct hn_softc *, struct vmbus_channel *chan, const void *, int); +static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc, + struct vmbus_channel *, const void *, int); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -105,6 +107,25 @@ hn_chim_alloc(struct hn_softc *sc) return (ret); } +const void * +hn_nvs_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, + void *req, int reqlen, size_t *resp_len) +{ + struct hn_send_ctx sndc; + int error; + + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); + vmbus_xact_activate(xact); + + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + req, reqlen, &sndc); + if (error) { + vmbus_xact_deactivate(xact); + return NULL; + } + return (vmbus_xact_wait(xact, resp_len)); +} + /* * Net VSC initialize receive buffer with net VSP * @@ -114,11 +135,10 @@ hn_chim_alloc(struct hn_softc *sc) static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc, int rxbuf_size) { - struct vmbus_xact *xact; + struct vmbus_xact *xact = NULL; struct hn_nvs_rxbuf_conn *conn; const struct hn_nvs_rxbuf_connresp *resp; size_t resp_len; - struct hn_send_ctx sndc; uint32_t status; int error; @@ -150,43 +170,33 @@ hv_nv_init_rx_buffer_with_net_vsp(struct error = ENXIO; goto cleanup; } - conn = vmbus_xact_req_data(xact); conn->nvs_type = HN_NVS_TYPE_RXBUF_CONN; conn->nvs_gpadl = sc->hn_rxbuf_gpadl; conn->nvs_sig = HN_NVS_RXBUF_SIG; - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - vmbus_xact_activate(xact); - - error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, - conn, sizeof(*conn), &sndc); - if (error != 0) { - if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n", - error); - vmbus_xact_deactivate(xact); - vmbus_xact_put(xact); + resp = hn_nvs_xact_execute(sc, xact, conn, sizeof(*conn), &resp_len); + if (resp == NULL) { + if_printf(sc->hn_ifp, "exec rxbuf conn failed\n"); + error = EIO; goto cleanup; } - - resp = vmbus_xact_wait(xact, &resp_len); if (resp_len < sizeof(*resp)) { if_printf(sc->hn_ifp, "invalid rxbuf conn resp length %zu\n", resp_len); - vmbus_xact_put(xact); error = EINVAL; goto cleanup; } if (resp->nvs_type != HN_NVS_TYPE_RXBUF_CONNRESP) { if_printf(sc->hn_ifp, "not rxbuf conn resp, type %u\n", resp->nvs_type); - vmbus_xact_put(xact); error = EINVAL; goto cleanup; } status = resp->nvs_status; vmbus_xact_put(xact); + xact = NULL; if (status != HN_NVS_STATUS_OK) { if_printf(sc->hn_ifp, "rxbuf conn failed: %x\n", status); @@ -198,6 +208,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct return (0); cleanup: + if (xact != NULL) + vmbus_xact_put(xact); hv_nv_destroy_rx_buffer(sc); return (error); } @@ -208,8 +220,7 @@ cleanup: static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc) { - struct hn_send_ctx sndc; - struct vmbus_xact *xact; + struct vmbus_xact *xact = NULL; struct hn_nvs_chim_conn *chim; const struct hn_nvs_chim_connresp *resp; size_t resp_len; @@ -242,37 +253,26 @@ hv_nv_init_send_buffer_with_net_vsp(stru error = ENXIO; goto cleanup; } - chim = vmbus_xact_req_data(xact); chim->nvs_type = HN_NVS_TYPE_CHIM_CONN; chim->nvs_gpadl = sc->hn_chim_gpadl; chim->nvs_sig = HN_NVS_CHIM_SIG; - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - vmbus_xact_activate(xact); - - error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, - chim, sizeof(*chim), &sndc); - if (error) { - if_printf(sc->hn_ifp, "send nvs chim conn failed: %d\n", - error); - vmbus_xact_deactivate(xact); - vmbus_xact_put(xact); + resp = hn_nvs_xact_execute(sc, xact, chim, sizeof(*chim), &resp_len); + if (resp == NULL) { + if_printf(sc->hn_ifp, "exec chim conn failed\n"); + error = EIO; goto cleanup; } - - resp = vmbus_xact_wait(xact, &resp_len); if (resp_len < sizeof(*resp)) { if_printf(sc->hn_ifp, "invalid chim conn resp length %zu\n", resp_len); - vmbus_xact_put(xact); error = EINVAL; goto cleanup; } if (resp->nvs_type != HN_NVS_TYPE_CHIM_CONNRESP) { if_printf(sc->hn_ifp, "not chim conn resp, type %u\n", resp->nvs_type); - vmbus_xact_put(xact); error = EINVAL; goto cleanup; } @@ -280,6 +280,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru status = resp->nvs_status; sectsz = resp->nvs_sectsz; vmbus_xact_put(xact); + xact = NULL; if (status != HN_NVS_STATUS_OK) { if_printf(sc->hn_ifp, "chim conn failed: %x\n", status); @@ -316,6 +317,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru return 0; cleanup: + if (xact != NULL) + vmbus_xact_put(xact); hv_nv_destroy_send_buffer(sc); return (error); } @@ -419,38 +422,28 @@ hv_nv_destroy_send_buffer(struct hn_soft static int hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, uint32_t nvs_ver) { - struct hn_send_ctx sndc; struct vmbus_xact *xact; struct hn_nvs_init *init; const struct hn_nvs_init_resp *resp; size_t resp_len; uint32_t status; - int error; xact = vmbus_xact_get(sc->hn_xact, sizeof(*init)); if (xact == NULL) { if_printf(sc->hn_ifp, "no xact for nvs init\n"); return (ENXIO); } - init = vmbus_xact_req_data(xact); init->nvs_type = HN_NVS_TYPE_INIT; init->nvs_ver_min = nvs_ver; init->nvs_ver_max = nvs_ver; - vmbus_xact_activate(xact); - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - - error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, - init, sizeof(*init), &sndc); - if (error) { - if_printf(sc->hn_ifp, "send nvs init failed: %d\n", error); - vmbus_xact_deactivate(xact); + resp = hn_nvs_xact_execute(sc, xact, init, sizeof(*init), &resp_len); + if (resp == NULL) { + if_printf(sc->hn_ifp, "exec init failed\n"); vmbus_xact_put(xact); - return (error); + return (EIO); } - - resp = vmbus_xact_wait(xact, &resp_len); if (resp_len < sizeof(*resp)) { if_printf(sc->hn_ifp, "invalid init resp length %zu\n", resp_len); @@ -655,7 +648,7 @@ hv_nv_on_device_remove(struct hn_softc * return (0); } -void +static void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct hn_softc *sc __unused, struct vmbus_channel *chan __unused, const void *data, int dlen) Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 22 07:44:11 2016 (r304593) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 22 07:51:46 2016 (r304594) @@ -1030,7 +1030,6 @@ int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan0, struct hn_rx_ring *rxr) { - struct hn_send_ctx sndc; int ret; rndis_device *rndis_dev; rndis_offload_params offloads; @@ -1041,7 +1040,7 @@ hv_rf_on_device_add(struct hn_softc *sc, struct hn_nvs_subch_req *req; const struct hn_nvs_subch_resp *resp; size_t resp_len; - struct vmbus_xact *xact; + struct vmbus_xact *xact = NULL; uint32_t status, nsubch; int nchan = *nchan0; @@ -1136,36 +1135,26 @@ hv_rf_on_device_add(struct hn_softc *sc, ret = ENXIO; goto out; } - req = vmbus_xact_req_data(xact); req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; req->nvs_nsubch = nchan - 1; - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - vmbus_xact_activate(xact); - - ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, - req, sizeof(*req), &sndc); - if (ret != 0) { - if_printf(sc->hn_ifp, "send nvs subch req failed: %d\n", ret); - vmbus_xact_deactivate(xact); - vmbus_xact_put(xact); + resp = hn_nvs_xact_execute(sc, xact, req, sizeof(*req), &resp_len); + if (resp == NULL) { + if_printf(sc->hn_ifp, "exec subch failed\n"); + ret = EIO; goto out; } - - resp = vmbus_xact_wait(xact, &resp_len); if (resp_len < sizeof(*resp)) { if_printf(sc->hn_ifp, "invalid subch resp length %zu\n", resp_len); - vmbus_xact_put(xact); ret = EINVAL; goto out; } if (resp->nvs_type != HN_NVS_TYPE_SUBCH_RESP) { if_printf(sc->hn_ifp, "not subch resp, type %u\n", resp->nvs_type); - vmbus_xact_put(xact); ret = EINVAL; goto out; } @@ -1173,6 +1162,7 @@ hv_rf_on_device_add(struct hn_softc *sc, status = resp->nvs_status; nsubch = resp->nvs_nsubch; vmbus_xact_put(xact); + xact = NULL; if (status != HN_NVS_STATUS_OK) { if_printf(sc->hn_ifp, "subch req failed: %x\n", status); @@ -1189,6 +1179,8 @@ hv_rf_on_device_add(struct hn_softc *sc, ret = hv_rf_set_rss_param(rndis_dev, nchan); *nchan0 = nchan; out: + if (xact != NULL) + vmbus_xact_put(xact); return (ret); } Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 22 07:44:11 2016 (r304593) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 22 07:51:46 2016 (r304594) @@ -107,9 +107,11 @@ hn_nvs_send_sglist(struct vmbus_channel (uint64_t)(uintptr_t)sndc)); } -void hn_nvs_sent_xact(struct hn_send_ctx *sndc, - struct hn_softc *sc, struct vmbus_channel *chan, - const void *data, int dlen); +struct vmbus_xact; + +const void *hn_nvs_xact_execute(struct hn_softc *sc, + struct vmbus_xact *xact, void *req, int reqlen, + size_t *resp_len); uint32_t hn_chim_alloc(struct hn_softc *sc); void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); From owner-svn-src-head@freebsd.org Mon Aug 22 08:00:16 2016 Return-Path: Delivered-To: svn-src-head@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 37612BC1D65; Mon, 22 Aug 2016 08:00:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E2BD9124D; Mon, 22 Aug 2016 08:00:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7M80Ftx017442; Mon, 22 Aug 2016 08:00:15 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7M80Fgs017441; Mon, 22 Aug 2016 08:00:15 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608220800.u7M80Fgs017441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 22 Aug 2016 08:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304595 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 08:00:16 -0000 Author: sephe Date: Mon Aug 22 08:00:14 2016 New Revision: 304595 URL: https://svnweb.freebsd.org/changeset/base/304595 Log: hyperv/hn: Factor out function to simplify NVS request sending MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7578 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 07:51:46 2016 (r304594) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 22 08:00:14 2016 (r304595) @@ -126,6 +126,14 @@ hn_nvs_xact_execute(struct hn_softc *sc, return (vmbus_xact_wait(xact, resp_len)); } +static __inline int +hn_nvs_req_send(struct hn_softc *sc, void *req, int reqlen) +{ + + return (hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + req, reqlen, &hn_send_ctx_none)); +} + /* * Net VSC initialize receive buffer with net VSP * @@ -342,8 +350,7 @@ hv_nv_destroy_rx_buffer(struct hn_softc disconn.nvs_sig = HN_NVS_RXBUF_SIG; /* NOTE: No response. */ - ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, - &disconn, sizeof(disconn), &hn_send_ctx_none); + ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); if (ret != 0) { if_printf(sc->hn_ifp, "send rxbuf disconn failed: %d\n", ret); @@ -387,8 +394,7 @@ hv_nv_destroy_send_buffer(struct hn_soft disconn.nvs_sig = HN_NVS_CHIM_SIG; /* NOTE: No response. */ - ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, - &disconn, sizeof(disconn), &hn_send_ctx_none); + ret = hn_nvs_req_send(sc, &disconn, sizeof(disconn)); if (ret != 0) { if_printf(sc->hn_ifp, "send chim disconn failed: %d\n", ret); @@ -485,8 +491,7 @@ hv_nv_send_ndis_config(struct hn_softc * conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; /* NOTE: No response. */ - error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, - &conf, sizeof(conf), &hn_send_ctx_none); + error = hn_nvs_req_send(sc, &conf, sizeof(conf)); if (error) if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); return (error); @@ -551,8 +556,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; /* NOTE: No response. */ - ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, - &ndis, sizeof(ndis), &hn_send_ctx_none); + ret = hn_nvs_req_send(sc, &ndis, sizeof(ndis)); if (ret != 0) { if_printf(sc->hn_ifp, "send nvs ndis init failed: %d\n", ret); goto cleanup; From owner-svn-src-head@freebsd.org Mon Aug 22 08:10:07 2016 Return-Path: Delivered-To: svn-src-head@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 393EEBB8172; Mon, 22 Aug 2016 08:10:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E2F551838; Mon, 22 Aug 2016 08:10:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA27576; Mon, 22 Aug 2016 11:10:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bbkJ1-000PHK-DT; Mon, 22 Aug 2016 11:10:03 +0300 Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... To: Toomas Soome , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> From: Andriy Gapon Message-ID: <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> Date: Mon, 22 Aug 2016 11:09:07 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 08:10:07 -0000 On 22/08/2016 10:20, Andriy Gapon wrote: > This commit breaks boot process for me and in a quite weird way. > I don't have a serial console, so a couple of screenshots. > This is what happens with this change: > https://people.freebsd.org/~avg/boot-fail-1024x768.jpg > This is what I have with the previous loader: > https://people.freebsd.org/~avg/boot-success-1024x768.jpg > > As you can see somehow the HDD gets misdetected as a floppy, BIOS disk ID is 0x0 > as opposed to 0x80. Also, the disk size is incorrect too. Additionally the > firewire is not detected. > > I suspect that the problem may have to do with the increased loader size. > I must add that I have these in src.conf: > LOADER_BZIP2_SUPPORT=yes > LOADER_FIREWIRE_SUPPORT=yes Removing both of those options allows the boot to succeed. Which sort of, maybe confirms the hypothesis. Also, as extra data points, this is how SMAP is reported by a good zfsloader: https://people.freebsd.org/~avg/boot-smap-1024x768.jpg And it seems to be corrupted when using the bad zfsloader: https://people.freebsd.org/~avg/boot-smap-corrupt-1024x768.jpg Base memory size is 634880 (almost enough for everyone). Extended memory is ~ 3.5GB and the high memory is 64MB at the top of it. File size of the loader that does not work is 483328 bytes. $ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin text data bss dec hex filename 438000 26416 130896 595312 0x91570 /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin File size of the loader that works is 450560 bytes. $ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin text data bss dec hex filename 410920 23304 50636 484860 0x765fc /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin So, it seems that there is a practical limit on a loader size for real-world x86 BIOS-based systems. We are very close to the limit with the default ZFS loader and we cross that limit if additional loader features are enabled. My opinion is that we should stop cramming all possible ZFS features into the loader. Instead we should admit that the boot pool, or at least boot filesystem, must have certain limitations on features that it can use. Then there is no need to add support for those features to the loader. Personally, I would prefer that this commit is backed out unless it can be strongly justified. Unless we can quickly find a way to run the loader at a different, less restricted memory location. > My memory of loader's memory placement and layout has faded, so I can't > elaborate further on my guess. > > Also, there is this report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212038 > That problem could have a different cause. It should be easier to analyze as > the it happens with bhyveload, i.e., in userland. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 22 08:22:50 2016 Return-Path: Delivered-To: svn-src-head@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 E7A8ABB85C7; Mon, 22 Aug 2016 08:22:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 693EB1F03; Mon, 22 Aug 2016 08:22:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA27617; Mon, 22 Aug 2016 11:22:47 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bbkVL-000PI7-3H; Mon, 22 Aug 2016 11:22:47 +0300 Subject: Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs To: Allan Jude , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Toomas Soome References: <201608011937.u71JbhGD055117@repo.freebsd.org> From: Andriy Gapon Message-ID: <893dc513-69b4-ae9e-e3d3-2d2d02d04348@FreeBSD.org> Date: Mon, 22 Aug 2016 11:21:45 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608011937.u71JbhGD055117@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 08:22:51 -0000 On 01/08/2016 22:37, Allan Jude wrote: > Author: allanjude > Date: Mon Aug 1 19:37:43 2016 > New Revision: 303630 > URL: https://svnweb.freebsd.org/changeset/base/303630 > > Log: > Make boot code and loader check for unsupported ZFS feature flags > > OpenZFS uses feature flags instead of a zpool version number to track > features since the split from Oracle. In addition to avoiding confusion > on ZFS vs OpenZFS version numbers, this also allows features to be added > to different operating systems that use OpenZFS in different order. > > The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly > tries to read the pool, and if failed provided only a vague error message. > > With this change, both the boot code and loader check the MOS features > list in the ZFS label and compare it against the list of features that > the loader supports. If any unsupported feature is active, the pool is > not considered as a candidate for booting, and a helpful diagnostic > message is printed to the screen. Features that are merely enabled via > zpool upgrade, but not in use, do not block booting from the pool. > > Submitted by: Toomas Soome > Reviewed by: delphij, mav > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D6857 It is really great to get a helpful diagnostic message when an unsupported feature is seen. Thank you for that! But I would prefer that the check is done on a filesystem level, not on a pool level. That is, I would like to be able to enable features that are not supported by ZFS boot chain on a boot pool as long as I do not enable such features on a boot filesystem. E.g., the large blocks support could be one of such features. And, as I've said in another email, I really do not think that we should strive to support all possible (non-essential) ZFS features in the ZFS boot chain. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 22 08:56:04 2016 Return-Path: Delivered-To: svn-src-head@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 3C3BBBC0578; Mon, 22 Aug 2016 08:56:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 0374C1190; Mon, 22 Aug 2016 08:56:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 39848D67B69; Mon, 22 Aug 2016 18:55:58 +1000 (AEST) Date: Mon, 22 Aug 2016 18:55:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Bruce Evans , Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi In-Reply-To: <20160821170611.GC8192@zxy.spb.ru> Message-ID: <20160822184056.M1897@besplex.bde.org> References: <201608210741.u7L7fBnN075023@repo.freebsd.org> <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> <20160821232721.G2639@besplex.bde.org> <20160821135826.GB8192@zxy.spb.ru> <20160822022832.Q3214@besplex.bde.org> <20160821170611.GC8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=kc8NhsJuO7BAuJf6d58A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 08:56:04 -0000 On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > On Mon, Aug 22, 2016 at 02:49:07AM +1000, Bruce Evans wrote: > >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: >> >>> On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote: >>> >>>> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: >>>>> I am remeber about platforms with missaligment trap when >>>>> accessing int16 by odd address. Now platforms like this do not exist >>>>> anymore? >>>> >>>> i386 still exists, and it supports trapping on misalignement for at least >>>> CPL 3 (not kernel CPL 0). IIRC, amd64 drops support for this. >>> >>> Someone enable and support this? I am don't see. >>> May be PPC trap on this? >>> Alpha trap on this, but support of Alpha is droped. >> >> It is a 1-line change in asm (or a little more in C with #includes) to >> enable the trap: > > OK, we can turn amd64 in this mode. > And cat do request to kernel with unalligned access, this cause trap > and panic, yes? No. PSL_AC is ignored in kernel mode. >> It is a trillion-line change to fix the compilers and applications to not >> do misaligned accesses :-). I only tried to use this ~25 years ago. Then >> the most obvious compiler bug was generating 32-bit acccesses to assign >> large but misaligned structs. If the compiler just generated calls to >> memcpy(), that might work, but in practice libraries also assume alignment. > > This issuse can be trigerred and by two-bytes assigmen, yes? Not quite that short. i386 has the 1-byte cli instruction for conveniently setting the interrupt enable flag, but setting PSL_AC seems to take at least 3 instructions and 6-7 bytes (pushf; orb $N,$M(%[re][bs]p); popf). >>>>>> There are also endianness problems. The old version was even more broken >>>>>> on big endian systems. The current version needs some magic to reverse >>>>>> the memcpy() of the bits. We already depend on this for some 64-bit >>>>>> syscalls like lseek(). >>>>> >>>>> Can you explain some more? >>>>> This is not transfer over network and don't read from external media. >>>>> Where is problem? >>>> >>>> It is similar to a network transfer. It needs a protocol to pass values >>>> to applications. Type puns are fragile even within a single compilation >>>> unit. >>> >>> Application ad kernel run with same byte order, not? >> >> The application can do anything it wants, but has to translate if it uses >> the kernel or a library written in another language. > > You talk about different byte order in differenr languages? Could be, or the same language with a different ABI. Bruce From owner-svn-src-head@freebsd.org Mon Aug 22 08:59:16 2016 Return-Path: Delivered-To: svn-src-head@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 8F39BBC06B2; Mon, 22 Aug 2016 08:59:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 59D49138F; Mon, 22 Aug 2016 08:59:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id DD9971A5940; Mon, 22 Aug 2016 18:59:05 +1000 (AEST) Date: Mon, 22 Aug 2016 18:59:05 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304567 - head/sys/dev/usb/input In-Reply-To: Message-ID: <20160822185617.I1897@besplex.bde.org> References: <201608211606.u7LG60pS063983@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=-OBM7eg6o35FdfRFdyMA:9 a=CjuIK1q_8ugA:10 a=pZq0WZoc-PEA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 08:59:16 -0000 On Sun, 21 Aug 2016, Hans Petter Selasky wrote: > On 08/21/16 18:06, Bruce Evans wrote: >> Author: bde >> Date: Sun Aug 21 16:06:00 2016 >> New Revision: 304567 >> URL: https://svnweb.freebsd.org/changeset/base/304567 > > Don't forget to MFC. I had forgotten if for this commit. I might do it for combined commits, but don't have enough svn fu for as many MFCs as I would like. I want a few things back to FreeBSD-7. Bruce From owner-svn-src-head@freebsd.org Mon Aug 22 09:21:58 2016 Return-Path: Delivered-To: svn-src-head@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 DD4B0BC0C32; Mon, 22 Aug 2016 09:21:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 A0B131DB0; Mon, 22 Aug 2016 09:21:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bblQT-0007TX-99; Mon, 22 Aug 2016 12:21:49 +0300 Date: Mon, 22 Aug 2016 12:21:49 +0300 From: Slawa Olhovchenkov To: Bruce Evans Cc: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160822092149.GE8192@zxy.spb.ru> References: <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> <20160821232721.G2639@besplex.bde.org> <20160821135826.GB8192@zxy.spb.ru> <20160822022832.Q3214@besplex.bde.org> <20160821170611.GC8192@zxy.spb.ru> <20160822184056.M1897@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160822184056.M1897@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 09:21:59 -0000 On Mon, Aug 22, 2016 at 06:55:58PM +1000, Bruce Evans wrote: > On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > > > On Mon, Aug 22, 2016 at 02:49:07AM +1000, Bruce Evans wrote: > > > >> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > >> > >>> On Sun, Aug 21, 2016 at 11:39:02PM +1000, Bruce Evans wrote: > >>> > >>>> On Sun, 21 Aug 2016, Slawa Olhovchenkov wrote: > >>>>> I am remeber about platforms with missaligment trap when > >>>>> accessing int16 by odd address. Now platforms like this do not exist > >>>>> anymore? > >>>> > >>>> i386 still exists, and it supports trapping on misalignement for at least > >>>> CPL 3 (not kernel CPL 0). IIRC, amd64 drops support for this. > >>> > >>> Someone enable and support this? I am don't see. > >>> May be PPC trap on this? > >>> Alpha trap on this, but support of Alpha is droped. > >> > >> It is a 1-line change in asm (or a little more in C with #includes) to > >> enable the trap: > > > > OK, we can turn amd64 in this mode. > > And cat do request to kernel with unalligned access, this cause trap > > and panic, yes? > > No. PSL_AC is ignored in kernel mode. OK. I.e. i386 and amd64 is not target. cloudabi work in kernel mode, yes? > >> It is a trillion-line change to fix the compilers and applications to not > >> do misaligned accesses :-). I only tried to use this ~25 years ago. Then > >> the most obvious compiler bug was generating 32-bit acccesses to assign > >> large but misaligned structs. If the compiler just generated calls to > >> memcpy(), that might work, but in practice libraries also assume alignment. > > > > This issuse can be trigerred and by two-bytes assigmen, yes? > > Not quite that short. i386 has the 1-byte cli instruction for conveniently > setting the interrupt enable flag, but setting PSL_AC seems to take at > least 3 instructions and 6-7 bytes (pushf; orb $N,$M(%[re][bs]p); popf). I am miss something. Why you talk about bytes per instruction? I think this is about returning value to applications unaligning buffer? 8 bytes in this commit or 2 bytes in my example. (for this commit, as I see, td_retval always aligned) > >>>>>> There are also endianness problems. The old version was even more broken > >>>>>> on big endian systems. The current version needs some magic to reverse > >>>>>> the memcpy() of the bits. We already depend on this for some 64-bit > >>>>>> syscalls like lseek(). > >>>>> > >>>>> Can you explain some more? > >>>>> This is not transfer over network and don't read from external media. > >>>>> Where is problem? > >>>> > >>>> It is similar to a network transfer. It needs a protocol to pass values > >>>> to applications. Type puns are fragile even within a single compilation > >>>> unit. > >>> > >>> Application ad kernel run with same byte order, not? > >> > >> The application can do anything it wants, but has to translate if it uses > >> the kernel or a library written in another language. > > > > You talk about different byte order in differenr languages? > > Could be, or the same language with a different ABI. ABI enforced by `server`, ex: kernel, or cloudabi in this case. If language need communicate -- language need adopted, not kernel or cloadabi. No simple way from kernel/cloudabi/etc detect caller abi. Or I am missunderstund you. From owner-svn-src-head@freebsd.org Mon Aug 22 09:44:30 2016 Return-Path: Delivered-To: svn-src-head@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 F3C76BBF385; Mon, 22 Aug 2016 09:44:29 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA2531C84; Mon, 22 Aug 2016 09:44:29 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCB00P001H08L00@st13p35im-asmtp001.me.com>; Mon, 22 Aug 2016 09:44:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471859063; bh=xnymKOt5AlJbXZxgmH15WGmA9j9E8rHbsfHIvIL3mvI=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=LG8sMVVP8ina1ldpG6DojBUdDwcdFKjJ+txZ3Ql7fXYMUUdfJWBLn5aFZNWoBq/cH +m7njlCDXIUipuRArUumMb+TqGEbRgNTp8aV6FIWKiNKPKDSFZ94mMWVOdFWEb79+G jg019hFK5JnbAPvDFSPDuwiihIx7w3/eQaQOJiBoIYOKh2G8yVkBA08Als5KmEIEKF tERWgCnGER1QkDXQjJYl8RnlWuoIkr1xVmmyh3pmbXLRApbGngVzrPSEMGlYTDBeKI IyRpKv2FzxP7uM7nxB2YarmuwUvgaGcUpdhnrSoFNzU6nTFfrOsa4FbBHH6ilSvLYo 0gDt1Vp5x1cEQ== Received: from 230-11-196-88.dyn.estpak.ee (230-11-196-88.dyn.estpak.ee [88.196.11.230]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCB00KSP1PWUM00@st13p35im-asmtp001.me.com>; Mon, 22 Aug 2016 09:44:22 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-22_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=10 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608220104 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> Date: Mon, 22 Aug 2016 12:44:19 +0300 Cc: Toomas Soome , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-transfer-encoding: quoted-printable Message-id: References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 09:44:30 -0000 > On 22. aug 2016, at 11:09, Andriy Gapon wrote: >=20 > On 22/08/2016 10:20, Andriy Gapon wrote: >> This commit breaks boot process for me and in a quite weird way. >> I don't have a serial console, so a couple of screenshots. >> This is what happens with this change: >> https://people.freebsd.org/~avg/boot-fail-1024x768.jpg >> This is what I have with the previous loader: >> https://people.freebsd.org/~avg/boot-success-1024x768.jpg >>=20 >> As you can see somehow the HDD gets misdetected as a floppy, BIOS = disk ID is 0x0 >> as opposed to 0x80. Also, the disk size is incorrect too. = Additionally the >> firewire is not detected. >>=20 >> I suspect that the problem may have to do with the increased loader = size. >> I must add that I have these in src.conf: >> LOADER_BZIP2_SUPPORT=3Dyes >> LOADER_FIREWIRE_SUPPORT=3Dyes >=20 > Removing both of those options allows the boot to succeed. > Which sort of, maybe confirms the hypothesis. >=20 yep, just enabling firewire does not blow it.=20 > Also, as extra data points, this is how SMAP is reported by a good = zfsloader: > https://people.freebsd.org/~avg/boot-smap-1024x768.jpg > And it seems to be corrupted when using the bad zfsloader: > https://people.freebsd.org/~avg/boot-smap-corrupt-1024x768.jpg >=20 > Base memory size is 634880 (almost enough for everyone). > Extended memory is ~ 3.5GB and the high memory is 64MB at the top of = it. >=20 > File size of the loader that does not work is 483328 bytes. > $ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin > text data bss dec hex filename > 438000 26416 130896 595312 0x91570 > /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin >=20 > File size of the loader that works is 450560 bytes. > $ size /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin > text data bss dec hex filename > 410920 23304 50636 484860 0x765fc > /usr/obj/usr/src/sys/boot/i386/zfsloader/zfsloader.bin >=20 > So, it seems that there is a practical limit on a loader size for = real-world x86 > BIOS-based systems. We are very close to the limit with the default = ZFS loader > and we cross that limit if additional loader features are enabled. >=20 > My opinion is that we should stop cramming all possible ZFS features = into the > loader. Instead we should admit that the boot pool, or at least boot > filesystem, must have certain limitations on features that it can use. = Then > there is no need to add support for those features to the loader. Well, it is arguable if its more important to have bzip in loader or = support for checksum algorithms, especially as zfs does compression, but = lets not get onto this slippery ground;) but, yes, the root cause of the issue is that if additional [relatively = large] code is included by src.conf setup, we will hit the ceiling of = <1MB memory area, as client base (0xa000) + code + data are all = occupying sequential memory and we are reaching EBDA area in low memory. And indeed, it does mean more conservative approach about what is = included and how. btw, just to compare, zfsloader with ficl 4 + zfs additionally with gzip = (as gzip is needed for for other reasons anyhow, so its =E2=80=9Cfree = lunch=E2=80=9D) in my illumos build is: -r--r--r-- 1 root sys 434176 aug 21 16:04 /boot/zfsloader and the current head + firewire in freebsd is: -rw-r--r-- 1 root wheel 454656 Aug 22 11:54 /boot/zfsloader I do suspect the size difference there is partially due to ficl, in = illumos (ficl 4): -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a and freebsd (ficl 3): -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a so, there definitely is some space=E2=80=A6=20 rgds, toomas >=20 > Personally, I would prefer that this commit is backed out unless it = can be > strongly justified. Unless we can quickly find a way to run the = loader at a > different, less restricted memory location. >=20 >> My memory of loader's memory placement and layout has faded, so I = can't >> elaborate further on my guess. >>=20 >> Also, there is this report: = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212038 >> That problem could have a different cause. It should be easier to = analyze as >> the it happens with bhyveload, i.e., in userland. >=20 >=20 > --=20 > Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 22 10:05:04 2016 Return-Path: Delivered-To: svn-src-head@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 19267BBFDEF; Mon, 22 Aug 2016 10:05:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D2D1F10; Mon, 22 Aug 2016 10:05:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7MA4wC8032050 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 22 Aug 2016 13:04:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7MA4wC8032050 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7MA4u0w032048; Mon, 22 Aug 2016 13:04:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 22 Aug 2016 13:04:56 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Slawa Olhovchenkov , Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304555 - head/sys/compat/cloudabi Message-ID: <20160822100456.GA83214@kib.kiev.ua> References: <20160821105207.GS22212@zxy.spb.ru> <20160821210751.J2219@besplex.bde.org> <20160821120016.GZ8192@zxy.spb.ru> <20160821223255.K2478@besplex.bde.org> <20160821131447.GA8192@zxy.spb.ru> <20160821232721.G2639@besplex.bde.org> <20160821135826.GB8192@zxy.spb.ru> <20160822022832.Q3214@besplex.bde.org> <20160821170611.GC8192@zxy.spb.ru> <20160822184056.M1897@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160822184056.M1897@besplex.bde.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 10:05:04 -0000 On Mon, Aug 22, 2016 at 06:55:58PM +1000, Bruce Evans wrote: > No. PSL_AC is ignored in kernel mode. Not quite. On recent processors there is a feature called SMAP. If enabled, user mode pages accesses from kernel mode require eflags.ac set to 1. If EFLAGS.AC == 0, usermode access causes #PF with protection violation AFAIR. > Not quite that short. i386 has the 1-byte cli instruction for conveniently > setting the interrupt enable flag, but setting PSL_AC seems to take at > least 3 instructions and 6-7 bytes (pushf; orb $N,$M(%[re][bs]p); popf). In ring 0, when SMAP is present, there are two new instructions STAC (set AC) and CLAC (clear AC). From the manual, the instructions are not available in ring 3 for convenient manipulation of EFLAGS.AC. But I think that the original question was about accesses which cause #AC and not about instructions which manipulate EFLAGS.AC. The description of #AC in SDM contains all relevant details. In short, or userspace accesses must be naturally aligned, otherwise #AC is triggered. I used to have trivial LD_PRELOAD-able dso which just set EFLAGS.AC, but it is not much useful exactly because x86 compilers systematically generate unaligned accesses. Typed languages runtimes sometimes use a witty trick with AC to get tag checking for free. If you assign e.g. a tag 0x7 to pointers, i.e. store tag 0x7 in three low bits of the pointer representation, then load instruction would be movq -0x7(%rdx), %rax and you get the #AC fault in case of any other tag. Quite nifty and gives zero runtime cost for basic dynamic type checking. From owner-svn-src-head@freebsd.org Mon Aug 22 10:21:10 2016 Return-Path: Delivered-To: svn-src-head@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 E29B5BC02AB; Mon, 22 Aug 2016 10:21:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3116194B; Mon, 22 Aug 2016 10:21:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MAL9R5070230; Mon, 22 Aug 2016 10:21:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MAL9Xf070229; Mon, 22 Aug 2016 10:21:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221021.u7MAL9Xf070229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 10:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304596 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 10:21:11 -0000 Author: andrew Date: Mon Aug 22 10:21:09 2016 New Revision: 304596 URL: https://svnweb.freebsd.org/changeset/base/304596 Log: Add KASSERTS in pmap_alloc_l3 to ensure we are not encountering superpages when we don't yet expect them; Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 08:00:14 2016 (r304595) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 10:21:09 2016 (r304596) @@ -1537,6 +1537,9 @@ pmap_alloc_l3(pmap_t pmap, vm_offset_t v { vm_pindex_t ptepindex; pd_entry_t *pde, tpde; +#ifdef INVARIANTS + pt_entry_t *pte; +#endif vm_page_t m; int lvl; @@ -1555,13 +1558,33 @@ retry: * and activate it. If we get a level 2 pde it will point to a level 3 * table. */ - if (lvl == 2) { + switch (lvl) { + case -1: + break; + case 0: +#ifdef INVARIANTS + pte = pmap_l0_to_l1(pde, va); + KASSERT(pmap_load(pte) == 0, + ("pmap_alloc_l3: TODO: l0 superpages")); +#endif + break; + case 1: +#ifdef INVARIANTS + pte = pmap_l1_to_l2(pde, va); + KASSERT(pmap_load(pte) == 0, + ("pmap_alloc_l3: TODO: l1 superpages")); +#endif + break; + case 2: tpde = pmap_load(pde); if (tpde != 0) { m = PHYS_TO_VM_PAGE(tpde & ~ATTR_MASK); m->wire_count++; return (m); } + break; + default: + panic("pmap_alloc_l3: Invalid level %d", lvl); } /* From owner-svn-src-head@freebsd.org Mon Aug 22 10:21:26 2016 Return-Path: Delivered-To: svn-src-head@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 A01CCBC03F4; Mon, 22 Aug 2016 10:21:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7036E1B09; Mon, 22 Aug 2016 10:21:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MALPYh070281; Mon, 22 Aug 2016 10:21:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MALP5m070280; Mon, 22 Aug 2016 10:21:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608221021.u7MALP5m070280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Aug 2016 10:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304597 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 10:21:26 -0000 Author: hselasky Date: Mon Aug 22 10:21:25 2016 New Revision: 304597 URL: https://svnweb.freebsd.org/changeset/base/304597 Log: Fix for invalid use of bits in input context. Basically split configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and xhci_cmd_configure_ep() respectivly. This resolves some errors when using XHCI under QEMU and gets is more in line with the XHCI specification. PR: 212021 MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Aug 22 10:21:09 2016 (r304596) +++ head/sys/dev/usb/controller/xhci.c Mon Aug 22 10:21:25 2016 (r304597) @@ -3867,12 +3867,10 @@ xhci_configure_reset_endpoint(struct usb xhci_configure_mask(udev, (1U << epno) | 1U, 0); - err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); - - if (err != 0) - DPRINTF("Could not configure endpoint %u\n", epno); - - err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); + if (epno > 1) + err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); + else + err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index); if (err != 0) DPRINTF("Could not configure endpoint %u\n", epno); @@ -4255,6 +4253,10 @@ xhci_device_state_change(struct usb_devi sc->sc_hw.devs[index].state = XHCI_ST_ADDRESSED; + /* set configure mask to slot only */ + xhci_configure_mask(udev, 1, 0); + + /* deconfigure all endpoints, except EP0 */ err = xhci_cmd_configure_ep(sc, 0, 1, index); if (err) { From owner-svn-src-head@freebsd.org Mon Aug 22 10:50:31 2016 Return-Path: Delivered-To: svn-src-head@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 7E170BC0D41; Mon, 22 Aug 2016 10:50:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 415411B07; Mon, 22 Aug 2016 10:50:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MAoU3p081132; Mon, 22 Aug 2016 10:50:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MAoUuS081131; Mon, 22 Aug 2016 10:50:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221050.u7MAoUuS081131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 10:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304598 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 10:50:31 -0000 Author: andrew Date: Mon Aug 22 10:50:30 2016 New Revision: 304598 URL: https://svnweb.freebsd.org/changeset/base/304598 Log: Add a size argument to pmap_update_entry. Make use of this in pmap_promote_l2. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 10:21:25 2016 (r304597) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 10:50:30 2016 (r304598) @@ -2258,7 +2258,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv */ static void pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, - vm_offset_t va) + vm_offset_t va, vm_size_t size) { register_t intr; @@ -2275,7 +2275,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_ /* Clear the old mapping */ pmap_load_clear(pte); PTE_SYNC(pte); - pmap_invalidate_page(pmap, va); + pmap_invalidate_range(pmap, va, size); /* Create the new mapping */ pmap_load_store(pte, newpte); @@ -2297,11 +2297,12 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t struct rwlock **lockp) { pt_entry_t *firstl3, *l3, newl2, oldl3, pa; - register_t intr; + vm_offset_t sva; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - firstl3 = (pt_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK); + sva = va & ~L2_OFFSET; + firstl3 = pmap_l2_to_l3(l2, sva); newl2 = pmap_load(firstl3); /* Ignore managed pages for now */ if ((newl2 & ATTR_SW_MANAGED) != 0) @@ -2322,26 +2323,7 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t newl2 &= ~ATTR_DESCR_MASK; newl2 |= L2_BLOCK; - /* - * Ensure we don't get switched out with the page table in an - * inconsistent state. We also need to ensure no interrupts fire - * as they may make use of an address we are about to invalidate. - */ - intr = intr_disable(); - critical_enter(); - - /* Clear the old mapping */ - pmap_load_clear(l2); - PTE_SYNC(l2); - pmap_invalidate_range(pmap, rounddown2(va, L2_SIZE), - roundup2(va, L2_SIZE)); - - /* Create the new mapping */ - pmap_load_store(l2, newl2); - PTE_SYNC(l2); - - critical_exit(); - intr_restore(intr); + pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE); } /* @@ -3621,7 +3603,8 @@ pmap_change_attr_locked(vm_offset_t va, l3 &= ~ATTR_IDX_MASK; l3 |= ATTR_IDX(mode); - pmap_update_entry(kernel_pmap, pte, l3, tmpva); + pmap_update_entry(kernel_pmap, pte, l3, tmpva, + PAGE_SIZE); /* * If moving to a non-cacheable entry flush @@ -3693,7 +3676,7 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t * l1 = (pt_entry_t *)(tmpl1 + ((vm_offset_t)l1 & PAGE_MASK)); } - pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va); + pmap_update_entry(pmap, l1, l2phys | L1_TABLE, va, PAGE_SIZE); if (tmpl1 != 0) { pmap_kremove(tmpl1); @@ -3760,7 +3743,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en l2 = (pt_entry_t *)(tmpl2 + ((vm_offset_t)l2 & PAGE_MASK)); } - pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va); + pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE); if (tmpl2 != 0) { pmap_kremove(tmpl2); From owner-svn-src-head@freebsd.org Mon Aug 22 12:17:41 2016 Return-Path: Delivered-To: svn-src-head@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 A4EBABC0718; Mon, 22 Aug 2016 12:17:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC3816DA; Mon, 22 Aug 2016 12:17:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MCHe8D014871; Mon, 22 Aug 2016 12:17:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MCHeHB014870; Mon, 22 Aug 2016 12:17:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221217.u7MCHeHB014870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 12:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304599 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 12:17:41 -0000 Author: andrew Date: Mon Aug 22 12:17:40 2016 New Revision: 304599 URL: https://svnweb.freebsd.org/changeset/base/304599 Log: Add sysctls to report on superpages statistics. While here add extra logging to these paths. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 10:50:30 2016 (r304598) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 12:17:40 2016 (r304599) @@ -874,6 +874,21 @@ pmap_init(void) rw_init(&pv_list_locks[i], "pmap pv list"); } +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, + "2MB page mapping counters"); + +static u_long pmap_l2_demotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD, + &pmap_l2_demotions, 0, "2MB page demotions"); + +static u_long pmap_l2_p_failures; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, p_failures, CTLFLAG_RD, + &pmap_l2_p_failures, 0, "2MB page promotion failures"); + +static u_long pmap_l2_promotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLAG_RD, + &pmap_l2_promotions, 0, "2MB page promotions"); + /* * Invalidate a single TLB entry. */ @@ -2309,14 +2324,22 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t return; /* Check the alingment is valid */ - if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) + if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" + " in pmap %p", va, pmap); return; + } pa = newl2 + L2_SIZE - PAGE_SIZE; for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) { oldl3 = pmap_load(l3); - if (oldl3 != pa) + if (oldl3 != pa) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" + " in pmap %p", va, pmap); return; + } pa -= PAGE_SIZE; } @@ -2324,6 +2347,8 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t newl2 |= L2_BLOCK; pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE); + + atomic_add_long(&pmap_l2_promotions, 1); } /* @@ -3745,6 +3770,10 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE); + atomic_add_long(&pmap_l2_demotions, 1); + CTR3(KTR_PMAP, "pmap_demote_l2: success for va %#lx" + " in pmap %p %lx", va, pmap, l3[0]); + if (tmpl2 != 0) { pmap_kremove(tmpl2); kva_free(tmpl2, PAGE_SIZE); From owner-svn-src-head@freebsd.org Mon Aug 22 12:56:41 2016 Return-Path: Delivered-To: svn-src-head@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 B2DDBBC153F; Mon, 22 Aug 2016 12:56:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE61196E; Mon, 22 Aug 2016 12:56:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MCue2H029988; Mon, 22 Aug 2016 12:56:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MCuewg029987; Mon, 22 Aug 2016 12:56:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221256.u7MCuewg029987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 12:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304600 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 12:56:41 -0000 Author: andrew Date: Mon Aug 22 12:56:40 2016 New Revision: 304600 URL: https://svnweb.freebsd.org/changeset/base/304600 Log: Use pmap_update_entry in pmap_enter when updating an entry with a new physical address. This is required when either mapping is writeable. While here remove an unneeded call to pmap_pde, we already have the pde from earlier in the function. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 12:17:40 2016 (r304599) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 12:56:40 2016 (r304600) @@ -2429,7 +2429,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, l3 = pmap_l2_to_l3(pde, va); } else { - pde = pmap_pde(pmap, va, &lvl); /* * If we get a level 2 pde it must point to a level 3 entry * otherwise we will need to create the intermediate tables @@ -2572,10 +2571,11 @@ havel3: */ if (orig_l3 != 0) { validate: - orig_l3 = pmap_load_store(l3, new_l3); + orig_l3 = pmap_load(l3); opa = orig_l3 & ~ATTR_MASK; if (opa != pa) { + pmap_update_entry(pmap, l3, new_l3, va, PAGE_SIZE); if ((orig_l3 & ATTR_SW_MANAGED) != 0) { om = PHYS_TO_VM_PAGE(opa); if (pmap_page_dirty(orig_l3)) @@ -2585,8 +2585,11 @@ validate: CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pmap_pvh_free(&om->md, pmap, va); } - } else if (pmap_page_dirty(orig_l3)) { - if ((orig_l3 & ATTR_SW_MANAGED) != 0) + } else { + pmap_load_store(l3, new_l3); + PTE_SYNC(l3); + pmap_invalidate_page(pmap, va); + if (pmap_page_dirty(orig_l3) && (orig_l3 & ATTR_SW_MANAGED) != 0) vm_page_dirty(m); } } else { From owner-svn-src-head@freebsd.org Mon Aug 22 13:43:27 2016 Return-Path: Delivered-To: svn-src-head@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 12B9EBC25EE; Mon, 22 Aug 2016 13:43:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D98901F86; Mon, 22 Aug 2016 13:43:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MDhQVQ050307; Mon, 22 Aug 2016 13:43:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MDhQia050306; Mon, 22 Aug 2016 13:43:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608221343.u7MDhQia050306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Aug 2016 13:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304601 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 13:43:27 -0000 Author: hselasky Date: Mon Aug 22 13:43:25 2016 New Revision: 304601 URL: https://svnweb.freebsd.org/changeset/base/304601 Log: Increase the maximum RX/TX queue size. This allows for a RX/TX queue size of 16384 mbufs. Previously the limit was 8192. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Aug 22 12:56:40 2016 (r304600) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Aug 22 13:43:25 2016 (r304601) @@ -70,11 +70,11 @@ #define MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE 0x7 #define MLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE 0xa -#define MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE 0xd +#define MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE 0xe #define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE 0x7 #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa -#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd +#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xe /* freeBSD HW LRO is limited by 16KB - the size of max mbuf */ #define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ MJUM16BYTES From owner-svn-src-head@freebsd.org Mon Aug 22 13:55:04 2016 Return-Path: Delivered-To: svn-src-head@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 32983BC2921; Mon, 22 Aug 2016 13:55:04 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 092AA1830; Mon, 22 Aug 2016 13:55:03 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 284A81090; Mon, 22 Aug 2016 13:55:02 +0000 (UTC) Subject: Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Toomas Soome References: <201608011937.u71JbhGD055117@repo.freebsd.org> <893dc513-69b4-ae9e-e3d3-2d2d02d04348@FreeBSD.org> From: Allan Jude Message-ID: <4139d778-9043-5f19-6f67-7f82ddfd9628@freebsd.org> Date: Mon, 22 Aug 2016 09:54:58 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <893dc513-69b4-ae9e-e3d3-2d2d02d04348@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kOtw74kS5Li2SL5h8sfvBk8sFLmJWROi9" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 13:55:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kOtw74kS5Li2SL5h8sfvBk8sFLmJWROi9 Content-Type: multipart/mixed; boundary="6nVxB4FDblsDCmnnVu0mHXcDWv58MEPVV" From: Allan Jude To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Toomas Soome Message-ID: <4139d778-9043-5f19-6f67-7f82ddfd9628@freebsd.org> Subject: Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs References: <201608011937.u71JbhGD055117@repo.freebsd.org> <893dc513-69b4-ae9e-e3d3-2d2d02d04348@FreeBSD.org> In-Reply-To: <893dc513-69b4-ae9e-e3d3-2d2d02d04348@FreeBSD.org> --6nVxB4FDblsDCmnnVu0mHXcDWv58MEPVV Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-22 04:21, Andriy Gapon wrote: > On 01/08/2016 22:37, Allan Jude wrote: >> Author: allanjude >> Date: Mon Aug 1 19:37:43 2016 >> New Revision: 303630 >> URL: https://svnweb.freebsd.org/changeset/base/303630 >> >> Log: >> Make boot code and loader check for unsupported ZFS feature flags >> =20 >> OpenZFS uses feature flags instead of a zpool version number to trac= k >> features since the split from Oracle. In addition to avoiding confus= ion >> on ZFS vs OpenZFS version numbers, this also allows features to be a= dded >> to different operating systems that use OpenZFS in different order. >> =20 >> The previous zfs boot code (gptzfsboot) and loader (zfsloader) blind= ly >> tries to read the pool, and if failed provided only a vague error me= ssage. >> =20 >> With this change, both the boot code and loader check the MOS featur= es >> list in the ZFS label and compare it against the list of features th= at >> the loader supports. If any unsupported feature is active, the pool = is >> not considered as a candidate for booting, and a helpful diagnostic >> message is printed to the screen. Features that are merely enabled v= ia >> zpool upgrade, but not in use, do not block booting from the pool. >> =20 >> Submitted by: Toomas Soome >> Reviewed by: delphij, mav >> Relnotes: yes >> Differential Revision: https://reviews.freebsd.org/D6857 >=20 > It is really great to get a helpful diagnostic message when an unsuppor= ted > feature is seen. Thank you for that! >=20 > But I would prefer that the check is done on a filesystem level, not on= a pool > level. That is, I would like to be able to enable features that are no= t > supported by ZFS boot chain on a boot pool as long as I do not enable s= uch > features on a boot filesystem. E.g., the large blocks support could be= one of > such features. This was my though originally, but it is not as easy to tell if a filesystem has ever used a feature. For pool wide, it is just a property.= Do you know of an easy way to get this information for a specific file system? >=20 > And, as I've said in another email, I really do not think that we shoul= d strive > to support all possible (non-essential) ZFS features in the ZFS boot ch= ain. >=20 --=20 Allan Jude --6nVxB4FDblsDCmnnVu0mHXcDWv58MEPVV-- --kOtw74kS5Li2SL5h8sfvBk8sFLmJWROi9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJXuwQ1AAoJEBmVNT4SmAt+oMwQAI6NoFMgcgiiQYkUKOocuWhV OCQB7toclrfAUNJfMCKordgL3czlCLwS2H7Z1kd5OJMAysTTRgYQErZUTzWKHP/f FrEbFaP4lt47EGsgQI7Vten9r2LjBKcuDIOaa/EyG/RxIeF3Ywp28p2GMUwGQr4s p41I2oyg/2ss862v7aIKRPGxPQz0mX+EGVrN1CvyiyecD4mHJhXeWyNvw6d4HBYv SsAv3PMVGJ83agGXAzICTScD/K0YX7y5GzH/vc+Zhw1Jzbxiw5A9wZ+REUNKs79r 9dhqWYY+TCCcBU6+Ly/RFe8psxm3NLwUn1B1Hx+bpTfENxiBT2noEEoR5W614KQY Bo0EzsnZo9xLyBxl5GxikmNX/22J0+Bp/qhaDixG2Uo6MP0WllnpFKTxGXGvO1jR JJcmeKB6LdtT3Z21maR2X4z8+vZtgCHOTm3nrkTJictLidBxSiV5Xs9oOTpceEs/ O/slUS+9Wu7SJWtZG5dP77926xP6g7Y7ITsrdmwUAvH7c96hAKrAttjX859GOHCs JZC6chIgzpm9vvMQ2p1piJzIJftqt/kUqZuhp+9uz1kxMlofQblwY4aeMVAf0m1N j3jmO9OciU9/tbey8xxgVDhYfIXOaTRTJiqjDmGTI2DszrkTfPdSlcICkxLALijQ x0C6ymh/F1Fs2X90HGW8 =sSiy -----END PGP SIGNATURE----- --kOtw74kS5Li2SL5h8sfvBk8sFLmJWROi9-- From owner-svn-src-head@freebsd.org Mon Aug 22 14:16:11 2016 Return-Path: Delivered-To: svn-src-head@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 7F518BC2E6C; Mon, 22 Aug 2016 14:16:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E949B140F; Mon, 22 Aug 2016 14:16:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA28441; Mon, 22 Aug 2016 17:16:07 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bbq1G-000PbF-SA; Mon, 22 Aug 2016 17:16:06 +0300 Subject: Re: svn commit: r303630 - in head/sys: boot/zfs cddl/boot/zfs To: Allan Jude , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Toomas Soome References: <201608011937.u71JbhGD055117@repo.freebsd.org> <893dc513-69b4-ae9e-e3d3-2d2d02d04348@FreeBSD.org> <4139d778-9043-5f19-6f67-7f82ddfd9628@freebsd.org> From: Andriy Gapon Message-ID: <42238d8b-2a05-740f-62fb-d119f74d1958@FreeBSD.org> Date: Mon, 22 Aug 2016 17:15:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <4139d778-9043-5f19-6f67-7f82ddfd9628@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:16:11 -0000 On 22/08/2016 16:54, Allan Jude wrote: > On 2016-08-22 04:21, Andriy Gapon wrote: >> On 01/08/2016 22:37, Allan Jude wrote: >>> Author: allanjude >>> Date: Mon Aug 1 19:37:43 2016 >>> New Revision: 303630 >>> URL: https://svnweb.freebsd.org/changeset/base/303630 >>> >>> Log: >>> Make boot code and loader check for unsupported ZFS feature flags >>> >>> OpenZFS uses feature flags instead of a zpool version number to track >>> features since the split from Oracle. In addition to avoiding confusion >>> on ZFS vs OpenZFS version numbers, this also allows features to be added >>> to different operating systems that use OpenZFS in different order. >>> >>> The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly >>> tries to read the pool, and if failed provided only a vague error message. >>> >>> With this change, both the boot code and loader check the MOS features >>> list in the ZFS label and compare it against the list of features that >>> the loader supports. If any unsupported feature is active, the pool is >>> not considered as a candidate for booting, and a helpful diagnostic >>> message is printed to the screen. Features that are merely enabled via >>> zpool upgrade, but not in use, do not block booting from the pool. >>> >>> Submitted by: Toomas Soome >>> Reviewed by: delphij, mav >>> Relnotes: yes >>> Differential Revision: https://reviews.freebsd.org/D6857 >> >> It is really great to get a helpful diagnostic message when an unsupported >> feature is seen. Thank you for that! >> >> But I would prefer that the check is done on a filesystem level, not on a pool >> level. That is, I would like to be able to enable features that are not >> supported by ZFS boot chain on a boot pool as long as I do not enable such >> features on a boot filesystem. E.g., the large blocks support could be one of >> such features. > > This was my though originally, but it is not as easy to tell if a > filesystem has ever used a feature. For pool wide, it is just a property. > > Do you know of an easy way to get this information for a specific file > system? I do not know any as easy way as just querying the feature flags. It's possible to query properties of a filesystem and reject any values that we do not support. Or we could do what we did before, that is, just try to read any data we need. But if we encounter something that we do not understand we can fail with a nice message (e.g. "unsupported checksum type foobar") instead of failing a "vague error message" like we did before. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Aug 22 14:19:18 2016 Return-Path: Delivered-To: svn-src-head@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 5E592BC105E for ; Mon, 22 Aug 2016 14:19:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0A3175D for ; Mon, 22 Aug 2016 14:19:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id e63so90690444ith.1 for ; Mon, 22 Aug 2016 07:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=AJyXbRyBo0dN/x5gBq7/6QYQzaBVJpDOy9rCYEqZjr0=; b=QX6isLLpO21+ZoNdNJEEfNrvm+hRuZngP+iRFPZHa+M2ju7NomdM/jAEnbmccRC+8M ea/JmD4IQJeyjmbAGqyo76sqDXdenqqqI2BC0NtJ9iXtcZb7rGv2R0a1JcRXUOSViGJw obnt0/hHFoqZ3t97tYVs5GMKbd13Z8vZiSLbmklBvT1JcfhtIrqn6auh3UxPl/hHxZqQ WyzNORp6o2JpUXKyoUudf5CbGJsSGOgx/lHIMtgzEMfYKqMvpQin7HTiNOxnLuhVxSES ilNOpso1uKAX/EiZBnUM1I1MaH926oyR72FZLs7PhO64koym/sBf0eK4dtNMWJbkvxNA +6Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=AJyXbRyBo0dN/x5gBq7/6QYQzaBVJpDOy9rCYEqZjr0=; b=IHJP1R+8p6f/JXbHdw6u2/GfL36h3r5LD75DZdfLHUAOFFSAcs+OknJP7ibSvDiJFP ArPzlKAq3LFfQBXHsu1XCMNQ6QzsLq01Pkr+3cUyzFLSjNFacYn092KpYAzVLtkKZSOz KvtO6jmfqjE0xE87AM3JExAMjFjFc+TWqax186M7mNMCln6+WBRLbmDGengUdlCA2C61 IgN0xjbKqJ9YV4n0lrBWAexabx0knpKcLh9SAFPfdCme1k6fdkQ3DvxZbFosfutlnf/a ehWf/2vuupkvvKRWQI8qYjBREzN0842dG9KpHOpCEJDYNaNS00pBPoQXjvjGtYWgGZdm a0Dw== X-Gm-Message-State: AEkoousB2qLqIuS+ZShfJ+DtYDctHm58/VjNgj/GWQ6eNHU+9RxgFpcGHz6EpHJ44IaAaXvY2U3BJ5te+7nbiA== X-Received: by 10.36.236.193 with SMTP id g184mr11336130ith.32.1471875557027; Mon, 22 Aug 2016 07:19:17 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Mon, 22 Aug 2016 07:19:16 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> From: Warner Losh Date: Mon, 22 Aug 2016 08:19:16 -0600 X-Google-Sender-Auth: p_SuMQ28l5P1hi2ZW6Gn6n9Asjw Message-ID: Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... To: Toomas Soome Cc: Andriy Gapon , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:19:18 -0000 On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome wrote: > I do suspect the size difference there is partially due to ficl, in illum= os (ficl 4): > > -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a > > and freebsd (ficl 3): > > -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a > > so, there definitely is some space=E2=80=A6 Same compiler? Clang bloats the boot code rather substantially, even after all the flags to tell it to generate smaller code are used. gcc 4.2.x built stuff was substantially smaller. There's a 520kb limit enforced in the boot1 for similar reasons. Looks like the combination of options makes us use just enough extra memory to sink the battleship... Warner From owner-svn-src-head@freebsd.org Mon Aug 22 14:48:35 2016 Return-Path: Delivered-To: svn-src-head@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 0A673BC26D3; Mon, 22 Aug 2016 14:48:35 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-yb0-x236.google.com (mail-yb0-x236.google.com [IPv6:2607:f8b0:4002:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCD57151F; Mon, 22 Aug 2016 14:48:34 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-yb0-x236.google.com with SMTP id b96so3193108ybi.0; Mon, 22 Aug 2016 07:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gE9YV155JnZp0/s1bpv7DmFdEOQkHdpWgzBiNuxjxVA=; b=Rk/A6ANf9xRIRWXtI1DK5EcgfC2mZYgee3yrP+on0jjYDM/KVCLDbtchr5rvr2d1Zh txYANgthEpeRVIHyHr9Gua7f2VQ8CqVyFY8+ukeKyy1lPRJBhTtgRd+cvqw/Q8GNnPrz Ay9j0knf1lSnhPtzy190+HIOBmxq7pgHNuoBxiwS310CMyK2DjuINArQ/SCNrOHoJhiN moMIzc0gZPodXgKvthI/FpefjvZJEKSHTa2Y3taFm6Z5HPTdo+QvG1zmWtg2vMe+Sq22 LKaqxhbqdamt+EheJJGHBZkatGpQUmWlzZtbs7cpqwHsGl83kAcdfEBwlwkhlHqfRCx5 7wSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gE9YV155JnZp0/s1bpv7DmFdEOQkHdpWgzBiNuxjxVA=; b=fTdfIZoeanLU8y34iP4PzL2GLHirk6a6+bEM9G3i0EPPRFXjDF9/Xrqoj5zHX+mGFz pvO7YmqYLpvG5Thg0tomgTcgm/iOoGCoEBUoJlF+d7S2HS5O/UrOrY+IHuTMWAkrZMAk gEXBZ/KjLvtRo5DVGbZsaHrWjhAIK9ZH/SQ+zJeUWtHAAADcRAAAJ1UJV92ko1QOBdHm DHu9YzxjcA8YlNXz45OrEUNBTPHvIh9Io5Ehp6DRSHOuStNM+MTpRCMr+wWQL0ptmnii GJU1lPRQu68LdSYSshFyz8SZldUxDXuyZi8nC61SC7LvyOzfbkt63pui+c967QjgmiI5 T+WA== X-Gm-Message-State: AEkoouuI8X3JyPzbzN7q4FcWg2H8U+bSJVLKAACZ57sPxof9NLrEPKjYQZCRS4h0jCcG9xfoCmKLbWmUG1L3pw== X-Received: by 10.36.77.85 with SMTP id l82mr4963581itb.77.1471877313689; Mon, 22 Aug 2016 07:48:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Mon, 22 Aug 2016 07:48:33 -0700 (PDT) In-Reply-To: <201608202212.u7KMCRQU065106@repo.freebsd.org> References: <201608202212.u7KMCRQU065106@repo.freebsd.org> From: Ryan Stone Date: Mon, 22 Aug 2016 10:48:33 -0400 Message-ID: Subject: Re: svn commit: r304548 - head/sys/netinet To: Marko Zec Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:48:35 -0000 Thanks! On Sat, Aug 20, 2016 at 6:12 PM, Marko Zec wrote: > Author: zec > Date: Sat Aug 20 22:12:26 2016 > New Revision: 304548 > URL: https://svnweb.freebsd.org/changeset/base/304548 > > Log: > Permit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels. > > The default value of the tunable introduced in r304436 couldn't be > effectively overrided on VIMAGE kernels, because instead of being > accessed via the appropriate VNET() accessor macro, it was accessed > via the VNET_NAME() macro, which resolves to the (should-be) read-only > master template of initial values of per-VNET data. Hence, while the > value of udp_require_l2_bcast could be altered on per-VNET basis, the > code in udp_input() would ignore it as it would always read the default > value (one) from the VNET master template. > > Silence from: rstone > > Modified: > head/sys/netinet/udp_usrreq.c > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================ > ================== > --- head/sys/netinet/udp_usrreq.c Sat Aug 20 21:34:41 2016 > (r304547) > +++ head/sys/netinet/udp_usrreq.c Sat Aug 20 22:12:26 2016 > (r304548) > @@ -127,6 +127,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac > "Do not send port unreachables for refused connects"); > > static VNET_DEFINE(int, udp_require_l2_bcast) = 1; > +#define V_udp_require_l2_bcast VNET(udp_require_l2_bcast) > SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | > CTLFLAG_RW, > &VNET_NAME(udp_require_l2_bcast), 0, > "Only treat packets sent to an L2 broadcast address as broadcast > packets"); > @@ -528,7 +529,7 @@ udp_input(struct mbuf **mp, int *offp, i > > pcbinfo = udp_get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > - ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && > + ((!V_udp_require_l2_bcast || m->m_flags & M_BCAST) && > in_broadcast(ip->ip_dst, ifp))) { > struct inpcb *last; > struct inpcbhead *pcblist; > > From owner-svn-src-head@freebsd.org Mon Aug 22 14:51:08 2016 Return-Path: Delivered-To: svn-src-head@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 6A5A8BC2758; Mon, 22 Aug 2016 14:51:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23730174E; Mon, 22 Aug 2016 14:51:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MEp7Dm072576; Mon, 22 Aug 2016 14:51:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MEp7li072575; Mon, 22 Aug 2016 14:51:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608221451.u7MEp7li072575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 22 Aug 2016 14:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304602 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:51:08 -0000 Author: cem Date: Mon Aug 22 14:51:07 2016 New Revision: 304602 URL: https://svnweb.freebsd.org/changeset/base/304602 Log: ioat(4): Don't process events past queue head Fix a race where the completion routine could overrun the active ring area in some situations. Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Aug 22 13:43:25 2016 (r304601) +++ head/sys/dev/ioat/ioat.c Mon Aug 22 14:51:07 2016 (r304602) @@ -678,19 +678,12 @@ ioat_process_events(struct ioat_softc *i } completed = 0; - comp_update = *ioat->comp_update; + comp_update = ioat_get_chansts(ioat); + CTR4(KTR_IOAT, "%s channel=%u hw_status=0x%lx last_seen=0x%lx", + __func__, ioat->chan_idx, comp_update, ioat->last_seen); status = comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK; - if (status == ioat->last_seen) { - /* - * If we landed in process_events and nothing has been - * completed, check for a timeout due to channel halt. - */ - comp_update = ioat_get_chansts(ioat); - goto out; - } - - while (1) { + while (ioat_get_active(ioat) > 0) { desc = ioat_get_ring_entry(ioat, ioat->tail); dmadesc = &desc->bus_dmadesc; CTR4(KTR_IOAT, "channel=%u completing desc %u ok cb %p(%p)", @@ -704,17 +697,13 @@ ioat_process_events(struct ioat_softc *i ioat->tail++; if (desc->hw_desc_bus_addr == status) break; - - KASSERT(ioat_get_active(ioat) > 0, ("overrunning ring t:%u " - "h:%u st:0x%016lx last_seen:%016lx completed:%u\n", - ioat->tail, ioat->head, comp_update, ioat->last_seen, - completed)); } - ioat->last_seen = desc->hw_desc_bus_addr; - ioat->stats.descriptors_processed += completed; + if (completed != 0) { + ioat->last_seen = desc->hw_desc_bus_addr; + ioat->stats.descriptors_processed += completed; + } -out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); /* Perform a racy check first; only take the locks if it passes. */ From owner-svn-src-head@freebsd.org Mon Aug 22 14:51:10 2016 Return-Path: Delivered-To: svn-src-head@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 BF706BC276E; Mon, 22 Aug 2016 14:51:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80D0B1765; Mon, 22 Aug 2016 14:51:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MEp956072620; Mon, 22 Aug 2016 14:51:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MEp9hX072619; Mon, 22 Aug 2016 14:51:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608221451.u7MEp9hX072619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 22 Aug 2016 14:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304603 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:51:10 -0000 Author: cem Date: Mon Aug 22 14:51:09 2016 New Revision: 304603 URL: https://svnweb.freebsd.org/changeset/base/304603 Log: ioat(4): Allow callouts to be scheduled after hw reset is_completion_pending governs whether or not a callout will be scheduled when new work is queued on the IOAT device. If true, a callout is already scheduled, so we do not need a new one. If false, we schedule one and set it true. Because resetting the hardware completed all outstanding work but failed to clear is_completion_pending, no new callout could be scheduled after a reset with pending work. This resulted in a driver hang for polled-only work. Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Aug 22 14:51:07 2016 (r304602) +++ head/sys/dev/ioat/ioat.c Mon Aug 22 14:51:09 2016 (r304603) @@ -768,6 +768,13 @@ ioat_process_events(struct ioat_softc *i ioat->stats.descriptors_error++; } + if (ioat->is_completion_pending) { + ioat->is_completion_pending = FALSE; + callout_reset(&ioat->shrink_timer, IOAT_SHRINK_PERIOD, + ioat_shrink_timer_callback, ioat); + callout_stop(&ioat->poll_timer); + } + /* Clear error status */ ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); @@ -1898,6 +1905,7 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat->tail = ioat->head = ioat->hw_head = 0; ioat->last_seen = 0; *ioat->comp_update = 0; + KASSERT(!ioat->is_completion_pending, ("bogus completion_pending")); ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); ioat_write_chancmp(ioat, ioat->comp_update_bus_addr); From owner-svn-src-head@freebsd.org Mon Aug 22 14:53:40 2016 Return-Path: Delivered-To: svn-src-head@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 7C552BC28BC; Mon, 22 Aug 2016 14:53:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 356321C91; Mon, 22 Aug 2016 14:53:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MErdEn076073; Mon, 22 Aug 2016 14:53:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MErdrp076072; Mon, 22 Aug 2016 14:53:39 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221453.u7MErdrp076072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 14:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304604 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:53:40 -0000 Author: andrew Date: Mon Aug 22 14:53:39 2016 New Revision: 304604 URL: https://svnweb.freebsd.org/changeset/base/304604 Log: Use switch statements in pmap_remove_pages. While only one level of pagetable is supported more will be added soon to support removing superpages. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 14:51:09 2016 (r304603) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 14:53:39 2016 (r304604) @@ -3115,14 +3115,21 @@ pmap_remove_pages(pmap_t pmap) pde = pmap_pde(pmap, pv->pv_va, &lvl); KASSERT(pde != NULL, ("Attempting to remove an unmapped page")); - KASSERT(lvl == 2, - ("Invalid page directory level: %d", lvl)); - pte = pmap_l2_to_l3(pde, pv->pv_va); - KASSERT(pte != NULL, - ("Attempting to remove an unmapped page")); - - tpte = pmap_load(pte); + switch(lvl) { + case 2: + pte = pmap_l2_to_l3(pde, pv->pv_va); + tpte = pmap_load(pte); + KASSERT((tpte & ATTR_DESCR_MASK) == + L3_PAGE, + ("Attempting to remove an invalid " + "page: %lx", tpte)); + break; + default: + panic( + "Invalid page directory level: %d", + lvl); + } /* * We cannot remove wired pages from a process' mapping at this time @@ -3156,18 +3163,27 @@ pmap_remove_pages(pmap_t pmap) /* * Update the vm_page_t clean/reference bits. */ - if ((tpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) - vm_page_dirty(m); + if ((tpte & ATTR_AP_RW_BIT) == + ATTR_AP(ATTR_AP_RW)) { + switch (lvl) { + case 2: + vm_page_dirty(m); + break; + } + } CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m); /* Mark free */ pc->pc_map[field] |= bitmask; - - pmap_resident_count_dec(pmap, 1); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); - m->md.pv_gen++; - + switch (lvl) { + case 2: + pmap_resident_count_dec(pmap, 1); + TAILQ_REMOVE(&m->md.pv_list, pv, + pv_next); + m->md.pv_gen++; + break; + } pmap_unuse_l3(pmap, pv->pv_va, pmap_load(pde), &free); freed++; From owner-svn-src-head@freebsd.org Mon Aug 22 14:56:24 2016 Return-Path: Delivered-To: svn-src-head@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 C3D33BC2920; Mon, 22 Aug 2016 14:56:24 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp003.me.com (st13p35im-asmtp003.me.com [17.164.199.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 914F91E26; Mon, 22 Aug 2016 14:56:24 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp003.me.com by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCB00600G3YSX00@st13p35im-asmtp003.me.com>; Mon, 22 Aug 2016 14:56:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471877777; bh=Ir94zlS+DcUnJOo6wiIhYfgixaEVlURjUxaFD1nENVo=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=jZgBwNRDwTuTWj0br+zum0h45I/VRRcZTYtR+olglA3QzQywnr0aZ6+PGEZSKRxTP DNjvPGY2hoYb6QyZp/uwPUpotAFUHfXdUXR97yXqhcu4Y1NkFuynhUCLCBauDzUnGi FalJVx/wD1LESaWV634MnYFtocMDhu9CLEIyc1/Yh9Uf5T1QnBOb/Kwxh11eOA65E7 wY2GRBKYAdZFBnDFjW7bjf3QTnx9cLmVw80nDN4Dxm05JxjGFWvDKmaOTCEA+xp8aA 39nLk9ST0hMzPRqdK4YfGOa/UXU1PWUvxR97n6iyiKPI1aKuxvbcTAINuQKiTGVzdU nKAIHTHVar2Gw== Received: from nazgul.lan (220-90-235-80.dyn.estpak.ee [80.235.90.220]) by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCB00N9EG5OLC50@st13p35im-asmtp003.me.com>; Mon, 22 Aug 2016 14:56:17 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-22_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=8 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608220156 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: Date: Mon, 22 Aug 2016 17:56:12 +0300 Cc: Andriy Gapon , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:56:24 -0000 > On 22. aug 2016, at 17:19, Warner Losh wrote: >=20 > On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome wrote: >> I do suspect the size difference there is partially due to ficl, in = illumos (ficl 4): >>=20 >> -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a >>=20 >> and freebsd (ficl 3): >>=20 >> -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a >>=20 >> so, there definitely is some space=E2=80=A6 >=20 > Same compiler? Clang bloats the boot code rather substantially, even = after > all the flags to tell it to generate smaller code are used. gcc 4.2.x > built stuff > was substantially smaller. >=20 > There's a 520kb limit enforced in the boot1 for similar reasons. Looks = like > the combination of options makes us use just enough extra memory to > sink the battleship... >=20 > Warner >=20 Actually I only now realized I was comparing apples with oranges=E2=80=A6 = I forgot the fbsd builds 32bit version in ficl32, this one is 64bit. and = yes the 32bit version is not that big at all:D Also, after done some digging, I have found few instances of duplicated = code (we can share sha2 with geli and so if sha512 is already needed, it = will become another =E2=80=9Cfree lunch=E2=80=9D). Also, unless I=E2=80=99= m mistaken, for some reason the bzip *compression* is brought in - = correct me if I=E2=80=99m wrong, but afaik only decompression is = needed=E2=80=A6 So before going after =E2=80=9Cuseless features=E2=80=9D, there are some = =E2=80=9Chidden=E2=80=9D resources to remove extra fat. rgds, toomas= From owner-svn-src-head@freebsd.org Mon Aug 22 15:01:41 2016 Return-Path: Delivered-To: svn-src-head@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 02770BC2B79; Mon, 22 Aug 2016 15:01:41 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D46601394; Mon, 22 Aug 2016 15:01:40 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MF1e9a077098; Mon, 22 Aug 2016 15:01:40 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MF1ddO077092; Mon, 22 Aug 2016 15:01:39 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608221501.u7MF1ddO077092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 22 Aug 2016 15:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304605 - in head/usr.sbin: ctld iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 15:01:41 -0000 Author: araujo Date: Mon Aug 22 15:01:39 2016 New Revision: 304605 URL: https://svnweb.freebsd.org/changeset/base/304605 Log: Fix calloc(3) argument order. Reviewed by: trasz MFC after: 4 weeks. Differential Revision: https://reviews.freebsd.org/D7532 Modified: head/usr.sbin/ctld/chap.c head/usr.sbin/ctld/keys.c head/usr.sbin/ctld/pdu.c head/usr.sbin/iscsid/chap.c head/usr.sbin/iscsid/keys.c head/usr.sbin/iscsid/pdu.c Modified: head/usr.sbin/ctld/chap.c ============================================================================== --- head/usr.sbin/ctld/chap.c Mon Aug 22 14:53:39 2016 (r304604) +++ head/usr.sbin/ctld/chap.c Mon Aug 22 15:01:39 2016 (r304605) @@ -232,7 +232,7 @@ chap_new(void) { struct chap *chap; - chap = calloc(sizeof(*chap), 1); + chap = calloc(1, sizeof(*chap)); if (chap == NULL) log_err(1, "calloc"); @@ -333,7 +333,7 @@ rchap_new(const char *secret) { struct rchap *rchap; - rchap = calloc(sizeof(*rchap), 1); + rchap = calloc(1, sizeof(*rchap)); if (rchap == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/ctld/keys.c ============================================================================== --- head/usr.sbin/ctld/keys.c Mon Aug 22 14:53:39 2016 (r304604) +++ head/usr.sbin/ctld/keys.c Mon Aug 22 15:01:39 2016 (r304605) @@ -43,7 +43,7 @@ keys_new(void) { struct keys *keys; - keys = calloc(sizeof(*keys), 1); + keys = calloc(1, sizeof(*keys)); if (keys == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/ctld/pdu.c ============================================================================== --- head/usr.sbin/ctld/pdu.c Mon Aug 22 14:53:39 2016 (r304604) +++ head/usr.sbin/ctld/pdu.c Mon Aug 22 15:01:39 2016 (r304605) @@ -81,11 +81,11 @@ pdu_new(struct connection *conn) { struct pdu *pdu; - pdu = calloc(sizeof(*pdu), 1); + pdu = calloc(1, sizeof(*pdu)); if (pdu == NULL) log_err(1, "calloc"); - pdu->pdu_bhs = calloc(sizeof(*pdu->pdu_bhs), 1); + pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs)); if (pdu->pdu_bhs == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/iscsid/chap.c ============================================================================== --- head/usr.sbin/iscsid/chap.c Mon Aug 22 14:53:39 2016 (r304604) +++ head/usr.sbin/iscsid/chap.c Mon Aug 22 15:01:39 2016 (r304605) @@ -232,7 +232,7 @@ chap_new(void) { struct chap *chap; - chap = calloc(sizeof(*chap), 1); + chap = calloc(1, sizeof(*chap)); if (chap == NULL) log_err(1, "calloc"); @@ -333,7 +333,7 @@ rchap_new(const char *secret) { struct rchap *rchap; - rchap = calloc(sizeof(*rchap), 1); + rchap = calloc(1, sizeof(*rchap)); if (rchap == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/iscsid/keys.c ============================================================================== --- head/usr.sbin/iscsid/keys.c Mon Aug 22 14:53:39 2016 (r304604) +++ head/usr.sbin/iscsid/keys.c Mon Aug 22 15:01:39 2016 (r304605) @@ -43,7 +43,7 @@ keys_new(void) { struct keys *keys; - keys = calloc(sizeof(*keys), 1); + keys = calloc(1, sizeof(*keys)); if (keys == NULL) log_err(1, "calloc"); Modified: head/usr.sbin/iscsid/pdu.c ============================================================================== --- head/usr.sbin/iscsid/pdu.c Mon Aug 22 14:53:39 2016 (r304604) +++ head/usr.sbin/iscsid/pdu.c Mon Aug 22 15:01:39 2016 (r304605) @@ -81,11 +81,11 @@ pdu_new(struct connection *conn) { struct pdu *pdu; - pdu = calloc(sizeof(*pdu), 1); + pdu = calloc(1, sizeof(*pdu)); if (pdu == NULL) log_err(1, "calloc"); - pdu->pdu_bhs = calloc(sizeof(*pdu->pdu_bhs), 1); + pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs)); if (pdu->pdu_bhs == NULL) log_err(1, "calloc"); From owner-svn-src-head@freebsd.org Mon Aug 22 15:27:39 2016 Return-Path: Delivered-To: svn-src-head@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 0B7F3BC225B; Mon, 22 Aug 2016 15:27:39 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D295B15D0; Mon, 22 Aug 2016 15:27:38 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MFRc3U087329; Mon, 22 Aug 2016 15:27:38 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MFRcAH087328; Mon, 22 Aug 2016 15:27:38 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608221527.u7MFRcAH087328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 22 Aug 2016 15:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304606 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 15:27:39 -0000 Author: rstone Date: Mon Aug 22 15:27:37 2016 New Revision: 304606 URL: https://svnweb.freebsd.org/changeset/base/304606 Log: Temporarily disable the optimization from r304436 r304436 attempted to optimize the handling of incoming UDP packet by only making an expensive call to in_broadcast() if the mbuf was marked as an broadcast packet. Unfortunately, this cannot work in the case of point-to- point L2 protocols like PPP, which have no notion of "broadcast". Discussions on how to properly fix r304436 are ongoing, but in the meantime disable the optimization to ensure that no existing network setups are broken. Reported by: bms Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Aug 22 15:01:39 2016 (r304605) +++ head/sys/netinet/udp_usrreq.c Mon Aug 22 15:27:37 2016 (r304606) @@ -126,7 +126,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac &VNET_NAME(udp_blackhole), 0, "Do not send port unreachables for refused connects"); -static VNET_DEFINE(int, udp_require_l2_bcast) = 1; +static VNET_DEFINE(int, udp_require_l2_bcast) = 0; #define V_udp_require_l2_bcast VNET(udp_require_l2_bcast) SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(udp_require_l2_bcast), 0, From owner-svn-src-head@freebsd.org Mon Aug 22 15:44:56 2016 Return-Path: Delivered-To: svn-src-head@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 1F91CBC2624; Mon, 22 Aug 2016 15:44:56 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D5E261E42; Mon, 22 Aug 2016 15:44:55 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MFitHo094722; Mon, 22 Aug 2016 15:44:55 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MFitOq094721; Mon, 22 Aug 2016 15:44:55 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608221544.u7MFitOq094721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Mon, 22 Aug 2016 15:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304607 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 15:44:56 -0000 Author: ache Date: Mon Aug 22 15:44:54 2016 New Revision: 304607 URL: https://svnweb.freebsd.org/changeset/base/304607 Log: Fix error processing. 1) Don't forget to set __SERR on __slbexpand() error. 2) Check for __fgetwc() errors using errno. Don't check for __SERR as PR suggested, it user-visible flag which can stick from previous functions and stdio code don't check it for this purpose. PR: 212033 MFC after: 3 days Modified: head/lib/libc/stdio/fgetwln.c Modified: head/lib/libc/stdio/fgetwln.c ============================================================================== --- head/lib/libc/stdio/fgetwln.c Mon Aug 22 15:27:37 2016 (r304606) +++ head/lib/libc/stdio/fgetwln.c Mon Aug 22 15:44:54 2016 (r304607) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include #include "un-namespace.h" @@ -47,12 +48,15 @@ fgetwln_l(FILE * __restrict fp, size_t * { wint_t wc; size_t len; + int saverrno; FIX_LOCALE(locale); FLOCKFILE(fp); ORIENT(fp, 1); len = 0; + saverrno = errno; + errno = 0; while ((wc = __fgetwc(fp, locale)) != WEOF) { #define GROW 512 if (len * sizeof(wchar_t) >= fp->_lb._size && @@ -61,19 +65,27 @@ fgetwln_l(FILE * __restrict fp, size_t * *((wchar_t *)fp->_lb._base + len++) = wc; if (wc == L'\n') break; + errno = 0; } - if (len == 0) + if (wc == WEOF && errno != 0) goto error; + if (errno == 0) + errno = saverrno; + if (len == 0) + goto eof; FUNLOCKFILE(fp); *lenp = len; return ((wchar_t *)fp->_lb._base); error: + fp->_flags |= __SERR; +eof: FUNLOCKFILE(fp); *lenp = 0; return (NULL); } + wchar_t * fgetwln(FILE * __restrict fp, size_t *lenp) { From owner-svn-src-head@freebsd.org Mon Aug 22 15:52:05 2016 Return-Path: Delivered-To: svn-src-head@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 16DB7BC2B01; Mon, 22 Aug 2016 15:52:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D837416D3; Mon, 22 Aug 2016 15:52:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MFq4Qi097733; Mon, 22 Aug 2016 15:52:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MFq4LU097732; Mon, 22 Aug 2016 15:52:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608221552.u7MFq4LU097732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 15:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304608 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 15:52:05 -0000 Author: bdrewery Date: Mon Aug 22 15:52:03 2016 New Revision: 304608 URL: https://svnweb.freebsd.org/changeset/base/304608 Log: Bump __FreeBSD_version for C++11 thread_local support in r303795. PR: 192320 Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Aug 22 15:44:54 2016 (r304607) +++ head/sys/sys/param.h Mon Aug 22 15:52:03 2016 (r304608) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200002 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200003 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Aug 22 16:39:52 2016 Return-Path: Delivered-To: svn-src-head@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 1A871BC2F5D; Mon, 22 Aug 2016 16:39:52 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 ECA971803; Mon, 22 Aug 2016 16:39:51 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MGdpGa014381; Mon, 22 Aug 2016 16:39:51 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MGdpaD014380; Mon, 22 Aug 2016 16:39:51 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608221639.u7MGdpaD014380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 22 Aug 2016 16:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304612 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 16:39:52 -0000 Author: bde Date: Mon Aug 22 16:39:51 2016 New Revision: 304612 URL: https://svnweb.freebsd.org/changeset/base/304612 Log: Further fixes for translation of PrintScreen/SysRq. The previous fix was tested mainly on 3 AT keyboards with USB adaptors where it works. 1 USB keyboard doesn't translate Alt-PrintScreen, so the software has to do it. Reorganize a little to share some code and to not translate the unusual usb scan code0x8a unless an Alt modified is set. Remove redundant check of Alt modifiers. Translation now more clearly filters out Alt-PrintScreen before the check. The table of errors fixed in the previous commit had many bugs. Correct table: K_RAW Ctl-PrintScreen: E0-2A-E0-37 -> E0-37 K_RAW Alt-PrintScreen (with 4 comb. of Ctl/Shift): 79 -> 54 K_RAW Pause/Break (with 4 comb. of Alt/Shift): E0-46 -> E1-1D-45 K_CODE PrintScreen (with 4 comb. of Ctl/Shift): 54 -> 5c K_CODE Alt-PrintScreen (with 4 comb. of Ctl/Shift): 7e -> 54 K_CODE Pause/Break (with 8 comb. of Ctl/Alt/Shift): 6c -> 68 That is 25 of 32 shift combinations for 2 keys fixed. All 16 combinations were broken for K_CODE and thus also for K_XLATE. Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Aug 22 16:35:50 2016 (r304611) +++ head/sys/dev/usb/input/ukbd.c Mon Aug 22 16:39:51 2016 (r304612) @@ -324,7 +324,7 @@ static const uint8_t ukbd_trtab[256] = { NN, NN, NN, NN, 115, 108, 111, 113, /* 70 - 77 */ 109, 110, 112, 118, 114, 116, 117, 119, /* 78 - 7F */ 121, 120, NN, NN, NN, NN, NN, 123, /* 80 - 87 */ - 124, 125, 84, 127, 128, NN, NN, NN, /* 88 - 8F */ + 124, 125, 126, 127, 128, NN, NN, NN, /* 88 - 8F */ 129, 130, NN, NN, NN, NN, NN, NN, /* 90 - 97 */ NN, NN, NN, NN, NN, NN, NN, NN, /* 98 - 9F */ NN, NN, NN, NN, NN, NN, NN, NN, /* A0 - A7 */ @@ -362,6 +362,7 @@ static void ukbd_timeout(void *); static void ukbd_set_leds(struct ukbd_softc *, uint8_t); static int ukbd_set_typematic(keyboard_t *, int); #ifdef UKBD_EMULATE_ATSCANCODE +static uint32_t ukbd_atkeycode(int, int); static int ukbd_key2scan(struct ukbd_softc *, int, int, int); #endif static uint32_t ukbd_read_char(keyboard_t *, int); @@ -1580,7 +1581,7 @@ ukbd_read(keyboard_t *kbd, int wait) ++(kbd->kb_count); #ifdef UKBD_EMULATE_ATSCANCODE - keycode = ukbd_trtab[KEY_INDEX(usbcode)]; + keycode = ukbd_atkeycode(usbcode, sc->sc_ndata.modifiers); if (keycode == NN) { return -1; } @@ -1651,7 +1652,7 @@ next_code: #ifdef UKBD_EMULATE_ATSCANCODE /* USB key index -> key code -> AT scan code */ - keycode = ukbd_trtab[KEY_INDEX(usbcode)]; + keycode = ukbd_atkeycode(usbcode, sc->sc_ndata.modifiers); if (keycode == NN) { return (NOKEY); } @@ -2060,6 +2061,31 @@ ukbd_set_typematic(keyboard_t *kbd, int } #ifdef UKBD_EMULATE_ATSCANCODE +static uint32_t +ukbd_atkeycode(int usbcode, int shift) +{ + uint32_t keycode; + + keycode = ukbd_trtab[KEY_INDEX(usbcode)]; + /* + * Translate Alt-PrintScreen to SysRq. + * + * Some or all AT keyboards connected through USB have already + * mapped Alted PrintScreens to an unusual usbcode (0x8a). + * ukbd_trtab translates this to 0x7e, and key2scan() would + * translate that to 0x79 (Intl' 4). Assume that if we have + * an Alted 0x7e here then it actually is an Alted PrintScreen. + * + * The usual usbcode for all PrintScreens is 0x46. ukbd_trtab + * translates this to 0x5c, so the Alt check to classify 0x5c + * is routine. + */ + if ((keycode == 0x5c || keycode == 0x7e) && + shift & (MOD_ALT_L | MOD_ALT_R)) + return (0x54); + return (keycode); +} + static int ukbd_key2scan(struct ukbd_softc *sc, int code, int shift, int up) { @@ -2082,7 +2108,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int 0x151, /* PageDown */ 0x152, /* Insert */ 0x153, /* Delete */ - 0x146, /* XXX Pause/Break */ + 0x146, /* Pause/Break */ 0x15b, /* Win_L(Super_L) */ 0x15c, /* Win_R(Super_R) */ 0x15d, /* Application(Menu) */ @@ -2122,7 +2148,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int } /* PrintScreen */ if (code == 0x137 && (!(shift & (MOD_CONTROL_L | MOD_CONTROL_R | - MOD_ALT_L | MOD_ALT_R | MOD_SHIFT_L | MOD_SHIFT_R)))) { + MOD_SHIFT_L | MOD_SHIFT_R)))) { code |= SCAN_PREFIX_SHIFT; } /* Pause/Break */ From owner-svn-src-head@freebsd.org Mon Aug 22 17:37:32 2016 Return-Path: Delivered-To: svn-src-head@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 9A156BC20EF; Mon, 22 Aug 2016 17:37:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5424E1F3C; Mon, 22 Aug 2016 17:37:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MHbVwD037634; Mon, 22 Aug 2016 17:37:31 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MHbVlp037630; Mon, 22 Aug 2016 17:37:31 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608221737.u7MHbVlp037630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 22 Aug 2016 17:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304615 - in head/sys: conf contrib/cloudabi i386/cloudabi32 i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 17:37:32 -0000 Author: ed Date: Mon Aug 22 17:37:31 2016 New Revision: 304615 URL: https://svnweb.freebsd.org/changeset/base/304615 Log: Make CloudABI work on i386. Copy over amd64's cloudabi64_sysvec.c into i386 and tailor it to work. Again, we use a system call convention similar to FreeBSD, except that there is no support for indirect system calls (%eax == 0). Where i386 differs from amd64 is that we have to store thread/process entry arguments on the stack instead of using registers. We also have to put an extra pointer on the stack for TLS (for GSBASE). Place that pointer in the empty slot that is normally used to hold return addresses. That seems to keep the code simple. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D7590 Added: head/sys/contrib/cloudabi/cloudabi_vdso_i686.S (contents, props changed) head/sys/i386/cloudabi32/ head/sys/i386/cloudabi32/cloudabi32_sysvec.c - copied, changed from r304565, head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Modified: head/sys/conf/files.i386 head/sys/i386/conf/NOTES Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Aug 22 17:23:27 2016 (r304614) +++ head/sys/conf/files.i386 Mon Aug 22 17:37:31 2016 (r304615) @@ -7,6 +7,18 @@ # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. # +cloudabi32_vdso.o optional compat_cloudabi32 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_i686.S" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_i686.S -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi32_vdso.o" +# +cloudabi32_vdso_blob.o optional compat_cloudabi32 \ + dependency "cloudabi32_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 cloudabi32_vdso.o ${.TARGET}" \ + no-implicit-rule \ + clean "cloudabi32_vdso_blob.o" +# linux_genassym.o optional compat_linux \ dependency "$S/i386/linux/linux_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ @@ -456,6 +468,7 @@ i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi +i386/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 #i386/i386/apic_vector.s optional apic i386/i386/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" Added: head/sys/contrib/cloudabi/cloudabi_vdso_i686.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_vdso_i686.S Mon Aug 22 17:37:31 2016 (r304615) @@ -0,0 +1,477 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#define ENTRY(name) \ + .text; \ + .p2align 2, 0x90; \ + .global name; \ + .type name, @function; \ + name: + +#define END(name) .size name, . - name + +ENTRY(cloudabi_sys_clock_res_get) + mov $0, %eax + int $0x80 + jc 1f + mov 0x8(%esp), %ecx + mov %eax, 0(%ecx) + mov %edx, 4(%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_clock_res_get) + +ENTRY(cloudabi_sys_clock_time_get) + mov $1, %eax + int $0x80 + jc 1f + mov 0x10(%esp), %ecx + mov %eax, 0(%ecx) + mov %edx, 4(%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_clock_time_get) + +ENTRY(cloudabi_sys_condvar_signal) + mov $2, %eax + int $0x80 + ret +END(cloudabi_sys_condvar_signal) + +ENTRY(cloudabi_sys_fd_close) + mov $3, %eax + int $0x80 + ret +END(cloudabi_sys_fd_close) + +ENTRY(cloudabi_sys_fd_create1) + mov $4, %eax + int $0x80 + jc 1f + mov 0x8(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_create1) + +ENTRY(cloudabi_sys_fd_create2) + mov $5, %eax + int $0x80 + jc 1f + mov 0x8(%esp), %ecx + mov %eax, (%ecx) + mov 0xc(%esp), %ecx + mov %edx, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_create2) + +ENTRY(cloudabi_sys_fd_datasync) + mov $6, %eax + int $0x80 + ret +END(cloudabi_sys_fd_datasync) + +ENTRY(cloudabi_sys_fd_dup) + mov $7, %eax + int $0x80 + jc 1f + mov 0x8(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_dup) + +ENTRY(cloudabi_sys_fd_pread) + mov $8, %eax + int $0x80 + jc 1f + mov 0x18(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_pread) + +ENTRY(cloudabi_sys_fd_pwrite) + mov $9, %eax + int $0x80 + jc 1f + mov 0x18(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_pwrite) + +ENTRY(cloudabi_sys_fd_read) + mov $10, %eax + int $0x80 + jc 1f + mov 0x10(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_read) + +ENTRY(cloudabi_sys_fd_replace) + mov $11, %eax + int $0x80 + ret +END(cloudabi_sys_fd_replace) + +ENTRY(cloudabi_sys_fd_seek) + mov $12, %eax + int $0x80 + jc 1f + mov 0x14(%esp), %ecx + mov %eax, 0(%ecx) + mov %edx, 4(%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_seek) + +ENTRY(cloudabi_sys_fd_stat_get) + mov $13, %eax + int $0x80 + ret +END(cloudabi_sys_fd_stat_get) + +ENTRY(cloudabi_sys_fd_stat_put) + mov $14, %eax + int $0x80 + ret +END(cloudabi_sys_fd_stat_put) + +ENTRY(cloudabi_sys_fd_sync) + mov $15, %eax + int $0x80 + ret +END(cloudabi_sys_fd_sync) + +ENTRY(cloudabi_sys_fd_write) + mov $16, %eax + int $0x80 + jc 1f + mov 0x10(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_fd_write) + +ENTRY(cloudabi_sys_file_advise) + mov $17, %eax + int $0x80 + ret +END(cloudabi_sys_file_advise) + +ENTRY(cloudabi_sys_file_allocate) + mov $18, %eax + int $0x80 + ret +END(cloudabi_sys_file_allocate) + +ENTRY(cloudabi_sys_file_create) + mov $19, %eax + int $0x80 + ret +END(cloudabi_sys_file_create) + +ENTRY(cloudabi_sys_file_link) + mov $20, %eax + int $0x80 + ret +END(cloudabi_sys_file_link) + +ENTRY(cloudabi_sys_file_open) + mov $21, %eax + int $0x80 + jc 1f + mov 0x1c(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_file_open) + +ENTRY(cloudabi_sys_file_readdir) + mov $22, %eax + int $0x80 + jc 1f + mov 0x18(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_file_readdir) + +ENTRY(cloudabi_sys_file_readlink) + mov $23, %eax + int $0x80 + jc 1f + mov 0x18(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_file_readlink) + +ENTRY(cloudabi_sys_file_rename) + mov $24, %eax + int $0x80 + ret +END(cloudabi_sys_file_rename) + +ENTRY(cloudabi_sys_file_stat_fget) + mov $25, %eax + int $0x80 + ret +END(cloudabi_sys_file_stat_fget) + +ENTRY(cloudabi_sys_file_stat_fput) + mov $26, %eax + int $0x80 + ret +END(cloudabi_sys_file_stat_fput) + +ENTRY(cloudabi_sys_file_stat_get) + mov $27, %eax + int $0x80 + ret +END(cloudabi_sys_file_stat_get) + +ENTRY(cloudabi_sys_file_stat_put) + mov $28, %eax + int $0x80 + ret +END(cloudabi_sys_file_stat_put) + +ENTRY(cloudabi_sys_file_symlink) + mov $29, %eax + int $0x80 + ret +END(cloudabi_sys_file_symlink) + +ENTRY(cloudabi_sys_file_unlink) + mov $30, %eax + int $0x80 + ret +END(cloudabi_sys_file_unlink) + +ENTRY(cloudabi_sys_lock_unlock) + mov $31, %eax + int $0x80 + ret +END(cloudabi_sys_lock_unlock) + +ENTRY(cloudabi_sys_mem_advise) + mov $32, %eax + int $0x80 + ret +END(cloudabi_sys_mem_advise) + +ENTRY(cloudabi_sys_mem_lock) + mov $33, %eax + int $0x80 + ret +END(cloudabi_sys_mem_lock) + +ENTRY(cloudabi_sys_mem_map) + mov $34, %eax + int $0x80 + jc 1f + mov 0x20(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_mem_map) + +ENTRY(cloudabi_sys_mem_protect) + mov $35, %eax + int $0x80 + ret +END(cloudabi_sys_mem_protect) + +ENTRY(cloudabi_sys_mem_sync) + mov $36, %eax + int $0x80 + ret +END(cloudabi_sys_mem_sync) + +ENTRY(cloudabi_sys_mem_unlock) + mov $37, %eax + int $0x80 + ret +END(cloudabi_sys_mem_unlock) + +ENTRY(cloudabi_sys_mem_unmap) + mov $38, %eax + int $0x80 + ret +END(cloudabi_sys_mem_unmap) + +ENTRY(cloudabi_sys_poll) + mov $39, %eax + int $0x80 + jc 1f + mov 0x10(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_poll) + +ENTRY(cloudabi_sys_poll_fd) + mov $40, %eax + int $0x80 + jc 1f + mov 0x1c(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_poll_fd) + +ENTRY(cloudabi_sys_proc_exec) + mov $41, %eax + int $0x80 + ret +END(cloudabi_sys_proc_exec) + +ENTRY(cloudabi_sys_proc_exit) + mov $42, %eax + int $0x80 +END(cloudabi_sys_proc_exit) + +ENTRY(cloudabi_sys_proc_fork) + mov $43, %eax + int $0x80 + jc 1f + mov 0x4(%esp), %ecx + mov %eax, (%ecx) + mov 0x8(%esp), %ecx + mov %edx, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_proc_fork) + +ENTRY(cloudabi_sys_proc_raise) + mov $44, %eax + int $0x80 + ret +END(cloudabi_sys_proc_raise) + +ENTRY(cloudabi_sys_random_get) + mov $45, %eax + int $0x80 + ret +END(cloudabi_sys_random_get) + +ENTRY(cloudabi_sys_sock_accept) + mov $46, %eax + int $0x80 + jc 1f + mov 0xc(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_sock_accept) + +ENTRY(cloudabi_sys_sock_bind) + mov $47, %eax + int $0x80 + ret +END(cloudabi_sys_sock_bind) + +ENTRY(cloudabi_sys_sock_connect) + mov $48, %eax + int $0x80 + ret +END(cloudabi_sys_sock_connect) + +ENTRY(cloudabi_sys_sock_listen) + mov $49, %eax + int $0x80 + ret +END(cloudabi_sys_sock_listen) + +ENTRY(cloudabi_sys_sock_recv) + mov $50, %eax + int $0x80 + ret +END(cloudabi_sys_sock_recv) + +ENTRY(cloudabi_sys_sock_send) + mov $51, %eax + int $0x80 + ret +END(cloudabi_sys_sock_send) + +ENTRY(cloudabi_sys_sock_shutdown) + mov $52, %eax + int $0x80 + ret +END(cloudabi_sys_sock_shutdown) + +ENTRY(cloudabi_sys_sock_stat_get) + mov $53, %eax + int $0x80 + ret +END(cloudabi_sys_sock_stat_get) + +ENTRY(cloudabi_sys_thread_create) + mov $54, %eax + int $0x80 + jc 1f + mov 0x8(%esp), %ecx + mov %eax, (%ecx) + xor %eax, %eax +1: + ret +END(cloudabi_sys_thread_create) + +ENTRY(cloudabi_sys_thread_exit) + mov $55, %eax + int $0x80 +END(cloudabi_sys_thread_exit) + +ENTRY(cloudabi_sys_thread_yield) + mov $56, %eax + int $0x80 + ret +END(cloudabi_sys_thread_yield) Copied and modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c (from r304565, head/sys/amd64/cloudabi64/cloudabi64_sysvec.c) ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Sun Aug 21 16:02:25 2016 (r304565, copy source) +++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Mon Aug 22 17:37:31 2016 (r304615) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,177 +41,164 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include -extern const char *cloudabi64_syscallnames[]; -extern struct sysent cloudabi64_sysent[]; +extern const char *cloudabi32_syscallnames[]; +extern struct sysent cloudabi32_sysent[]; static int -cloudabi64_fixup_tcb(register_t **stack_base, struct image_params *imgp) +cloudabi32_fixup_tcb(register_t **stack_base, struct image_params *imgp) { int error; - register_t tcbptr; + uint32_t args[2]; /* Place auxiliary vector and TCB on the stack. */ - error = cloudabi64_fixup(stack_base, imgp); + error = cloudabi32_fixup(stack_base, imgp); if (error != 0) return (error); - + /* - * On x86-64, the TCB is referred to by %fs:0. Take some space - * from the top of the stack to store a single element array, - * containing a pointer to the TCB. %fs base will point to this. + * On i386, the TCB is referred to by %gs:0. Reuse the empty + * space normally used by the return address (args[0]) to store + * a single element array, containing a pointer to the TCB. %gs + * base will point to this. + * + * Also let the first argument of the entry point (args[1]) + * refer to the auxiliary vector, which is stored right after + * the TCB. */ - tcbptr = (register_t)*stack_base; - return (copyout(&tcbptr, --*stack_base, sizeof(tcbptr))); + args[0] = (uintptr_t)*stack_base; + args[1] = (uintptr_t)*stack_base + + roundup(sizeof(cloudabi32_tcb_t), sizeof(register_t)); + *stack_base -= howmany(sizeof(args), sizeof(register_t)); + return (copyout(args, *stack_base, sizeof(args))); } static void -cloudabi64_proc_setregs(struct thread *td, struct image_params *imgp, +cloudabi32_proc_setregs(struct thread *td, struct image_params *imgp, unsigned long stack) { - struct trapframe *regs; exec_setregs(td, imgp, stack); - - /* - * The stack now contains a pointer to the TCB, the TCB itself, - * and the auxiliary vector. Let %rdx point to the auxiliary - * vector, and set %fs base to the address of the TCB. - */ - regs = td->td_frame; - regs->tf_rdi = stack + sizeof(register_t) + - roundup(sizeof(cloudabi64_tcb_t), sizeof(register_t)); (void)cpu_set_user_tls(td, (void *)stack); } static int -cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa) +cloudabi32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { struct trapframe *frame = td->td_frame; + int error; /* Obtain system call number. */ - sa->code = frame->tf_rax; - if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL) + sa->code = frame->tf_eax; + if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL) return (ENOSYS); - sa->callp = &cloudabi64_sysent[sa->code]; + sa->callp = &cloudabi32_sysent[sa->code]; sa->narg = sa->callp->sy_narg; - /* Fetch system call arguments. */ - sa->args[0] = frame->tf_rdi; - sa->args[1] = frame->tf_rsi; - sa->args[2] = frame->tf_rdx; - sa->args[3] = frame->tf_rcx; /* Actually %r10. */ - sa->args[4] = frame->tf_r8; - sa->args[5] = frame->tf_r9; + /* Fetch system call arguments from the stack. */ + error = copyin((void *)(frame->tf_esp + 4), sa->args, + sa->narg * sizeof(sa->args[0])); + if (error != 0) + return (error); /* Default system call return values. */ td->td_retval[0] = 0; - td->td_retval[1] = frame->tf_rdx; + td->td_retval[1] = frame->tf_edx; return (0); } static void -cloudabi64_set_syscall_retval(struct thread *td, int error) +cloudabi32_set_syscall_retval(struct thread *td, int error) { struct trapframe *frame = td->td_frame; switch (error) { case 0: /* System call succeeded. */ - frame->tf_rax = td->td_retval[0]; - frame->tf_rdx = td->td_retval[1]; - frame->tf_rflags &= ~PSL_C; + frame->tf_eax = td->td_retval[0]; + frame->tf_edx = td->td_retval[1]; + frame->tf_eflags &= ~PSL_C; break; case ERESTART: /* Restart system call. */ - frame->tf_rip -= frame->tf_err; - frame->tf_r10 = frame->tf_rcx; - set_pcb_flags(td->td_pcb, PCB_FULL_IRET); + frame->tf_eip -= frame->tf_err; break; case EJUSTRETURN: break; default: /* System call returned an error. */ - frame->tf_rax = cloudabi_convert_errno(error); - frame->tf_rflags |= PSL_C; + frame->tf_eax = cloudabi_convert_errno(error); + frame->tf_eflags |= PSL_C; break; } } static void -cloudabi64_schedtail(struct thread *td) +cloudabi32_schedtail(struct thread *td) { struct trapframe *frame = td->td_frame; /* Initial register values for processes returning from fork. */ - frame->tf_rax = CLOUDABI_PROCESS_CHILD; - frame->tf_rdx = td->td_tid; + frame->tf_eax = CLOUDABI_PROCESS_CHILD; + frame->tf_edx = td->td_tid; } int -cloudabi64_thread_setregs(struct thread *td, - const cloudabi64_threadattr_t *attr, uint64_t tcb) +cloudabi32_thread_setregs(struct thread *td, + const cloudabi32_threadattr_t *attr, uint32_t tcb) { - struct trapframe *frame; stack_t stack; - uint64_t tcbptr; + uint32_t args[3]; + void *frameptr; int error; - /* - * On x86-64, the TCB is referred to by %fs:0. Take some space - * from the top of the stack to store a single element array, - * containing a pointer to the TCB. %fs base will point to this. - */ - tcbptr = rounddown(attr->stack + attr->stack_size - sizeof(tcbptr), - _Alignof(tcbptr)); - error = copyout(&tcb, (void *)tcbptr, sizeof(tcb)); - if (error != 0) - return (error); - /* Perform standard register initialization. */ stack.ss_sp = (void *)attr->stack; - stack.ss_size = tcbptr - attr->stack; + stack.ss_size = attr->stack_size - sizeof(args); cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack); /* - * Pass in the thread ID of the new thread and the argument - * pointer provided by the parent thread in as arguments to the - * entry point. + * Copy the arguments for the thread entry point onto the stack + * (args[1] and args[2]). Similar to process startup, use the + * otherwise unused return address (args[0]) for TLS. */ - frame = td->td_frame; - frame->tf_rdi = td->td_tid; - frame->tf_rsi = attr->argument; - - return (cpu_set_user_tls(td, (void *)tcbptr)); + args[0] = tcb; + args[1] = td->td_tid; + args[2] = attr->argument; + frameptr = (void *)td->td_frame->tf_esp; + error = copyout(args, frameptr, sizeof(args)); + if (error != 0) + return (error); + + return (cpu_set_user_tls(td, frameptr)); } -static struct sysentvec cloudabi64_elf_sysvec = { - .sv_size = CLOUDABI64_SYS_MAXSYSCALL, - .sv_table = cloudabi64_sysent, - .sv_fixup = cloudabi64_fixup_tcb, - .sv_name = "CloudABI ELF64", - .sv_coredump = elf64_coredump, +static struct sysentvec cloudabi32_elf_sysvec = { + .sv_size = CLOUDABI32_SYS_MAXSYSCALL, + .sv_table = cloudabi32_sysent, + .sv_fixup = cloudabi32_fixup_tcb, + .sv_name = "CloudABI ELF32", + .sv_coredump = elf32_coredump, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, - .sv_copyout_strings = cloudabi64_copyout_strings, - .sv_setregs = cloudabi64_proc_setregs, - .sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_LP64, - .sv_set_syscall_retval = cloudabi64_set_syscall_retval, - .sv_fetch_syscall_args = cloudabi64_fetch_syscall_args, - .sv_syscallnames = cloudabi64_syscallnames, - .sv_schedtail = cloudabi64_schedtail, + .sv_copyout_strings = cloudabi32_copyout_strings, + .sv_setregs = cloudabi32_proc_setregs, + .sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_IA32 | SV_ILP32, + .sv_set_syscall_retval = cloudabi32_set_syscall_retval, + .sv_fetch_syscall_args = cloudabi32_fetch_syscall_args, + .sv_syscallnames = cloudabi32_syscallnames, + .sv_schedtail = cloudabi32_schedtail, }; -INIT_SYSENTVEC(elf_sysvec, &cloudabi64_elf_sysvec); +INIT_SYSENTVEC(elf_sysvec, &cloudabi32_elf_sysvec); -Elf64_Brandinfo cloudabi64_brand = { +Elf32_Brandinfo cloudabi32_brand = { .brand = ELFOSABI_CLOUDABI, - .machine = EM_X86_64, - .sysvec = &cloudabi64_elf_sysvec, - .flags = BI_CAN_EXEC_DYN, + .machine = EM_386, + .sysvec = &cloudabi32_elf_sysvec, .compat_3_brand = "CloudABI", }; Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Aug 22 17:23:27 2016 (r304614) +++ head/sys/i386/conf/NOTES Mon Aug 22 17:37:31 2016 (r304615) @@ -973,6 +973,9 @@ options NKPT=31 # Emulate spx device for client side of SVR3 local X interface options SPX_HACK +# Enable 32-bit runtime support for CloudABI binaries. +options COMPAT_CLOUDABI32 + # Enable Linux ABI emulation options COMPAT_LINUX From owner-svn-src-head@freebsd.org Mon Aug 22 17:45:31 2016 Return-Path: Delivered-To: svn-src-head@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 D28ABBC23B7; Mon, 22 Aug 2016 17:45:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A586415F0; Mon, 22 Aug 2016 17:45:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MHjUZL041226; Mon, 22 Aug 2016 17:45:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MHjUCK041225; Mon, 22 Aug 2016 17:45:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608221745.u7MHjUCK041225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Aug 2016 17:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304616 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 17:45:31 -0000 Author: emaste Date: Mon Aug 22 17:45:30 2016 New Revision: 304616 URL: https://svnweb.freebsd.org/changeset/base/304616 Log: Forcibly disable MK_TESTS if building without C++ Several atf components require C++, and the test suite is not usable if building WITHOUT_CXX. Reviewed by: bdrewery, jmmv Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7597 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Aug 22 17:37:31 2016 (r304615) +++ head/share/mk/src.opts.mk Mon Aug 22 17:45:30 2016 (r304616) @@ -318,6 +318,7 @@ MK_KERBEROS:= no MK_CLANG:= no MK_GROFF:= no MK_GNUCXX:= no +MK_TESTS:= no .endif .if ${MK_MAIL} == "no" From owner-svn-src-head@freebsd.org Mon Aug 22 17:53:19 2016 Return-Path: Delivered-To: svn-src-head@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 AFF6FBC291A; Mon, 22 Aug 2016 17:53:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82CDC1275; Mon, 22 Aug 2016 17:53:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MHrIwx045124; Mon, 22 Aug 2016 17:53:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MHrI1C045123; Mon, 22 Aug 2016 17:53:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608221753.u7MHrI1C045123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Aug 2016 17:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304618 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 17:53:19 -0000 Author: emaste Date: Mon Aug 22 17:53:18 2016 New Revision: 304618 URL: https://svnweb.freebsd.org/changeset/base/304618 Log: Regenerate src.conf.5 after r304616 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Mon Aug 22 17:52:10 2016 (r304617) +++ head/share/man/man5/src.conf.5 Mon Aug 22 17:53:18 2016 (r304618) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd July 28, 2016 +.Dd August 22, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -479,9 +479,15 @@ When set, it also enforces the following .It .Va WITHOUT_CLANG_FULL .It +.Va WITHOUT_DTRACE_TESTS +.It .Va WITHOUT_GNUCXX .It .Va WITHOUT_GROFF +.It +.Va WITHOUT_TESTS +.It +.Va WITHOUT_TESTS_SUPPORT .El .It Va WITHOUT_DEBUG_FILES .\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 2015-10-27 20:49:56Z emaste From owner-svn-src-head@freebsd.org Mon Aug 22 18:12:45 2016 Return-Path: Delivered-To: svn-src-head@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 8F870BC2FB4; Mon, 22 Aug 2016 18:12:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FEBE12E4; Mon, 22 Aug 2016 18:12:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MICi6I052649; Mon, 22 Aug 2016 18:12:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MICil5052648; Mon, 22 Aug 2016 18:12:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221812.u7MICil5052648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 18:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304620 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 18:12:45 -0000 Author: andrew Date: Mon Aug 22 18:12:44 2016 New Revision: 304620 URL: https://svnweb.freebsd.org/changeset/base/304620 Log: Fix pmap_update_entry, pmap_invalidate_range takes the end address, not the size. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 22 18:12:24 2016 (r304619) +++ head/sys/arm64/arm64/pmap.c Mon Aug 22 18:12:44 2016 (r304620) @@ -2290,7 +2290,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_ /* Clear the old mapping */ pmap_load_clear(pte); PTE_SYNC(pte); - pmap_invalidate_range(pmap, va, size); + pmap_invalidate_range(pmap, va, va + size); /* Create the new mapping */ pmap_load_store(pte, newpte); From owner-svn-src-head@freebsd.org Mon Aug 22 18:17:30 2016 Return-Path: Delivered-To: svn-src-head@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 D4074BC209E; Mon, 22 Aug 2016 18:17:30 +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 A43841619; Mon, 22 Aug 2016 18:17:30 +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 u7MIHTts053001; Mon, 22 Aug 2016 18:17:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MIHTfO052999; Mon, 22 Aug 2016 18:17:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608221817.u7MIHTfO052999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Aug 2016 18:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304621 - in head/share/man/man4: . man4.i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 18:17:30 -0000 Author: jhb Date: Mon Aug 22 18:17:29 2016 New Revision: 304621 URL: https://svnweb.freebsd.org/changeset/base/304621 Log: Remove cross references to el(4) and ie(4). Modified: head/share/man/man4/man4.i386/ep.4 head/share/man/man4/sn.4 Modified: head/share/man/man4/man4.i386/ep.4 ============================================================================== --- head/share/man/man4/man4.i386/ep.4 Mon Aug 22 18:12:44 2016 (r304620) +++ head/share/man/man4/man4.i386/ep.4 Mon Aug 22 18:17:29 2016 (r304621) @@ -200,8 +200,6 @@ This should never happen. .Sh SEE ALSO .Xr altq 4 , .Xr ed 4 , -.Xr el 4 , -.Xr ie 4 , .Xr intro 4 , .Xr ng_ether 4 , .Xr sn 4 , Modified: head/share/man/man4/sn.4 ============================================================================== --- head/share/man/man4/sn.4 Mon Aug 22 18:12:44 2016 (r304620) +++ head/share/man/man4/sn.4 Mon Aug 22 18:17:29 2016 (r304621) @@ -97,7 +97,6 @@ driver. .Sh SEE ALSO .Xr ed 4 , .Xr ep 4 , -.Xr ie 4 , .Xr intro 4 , .Xr ng_ether 4 , .Xr vx 4 , From owner-svn-src-head@freebsd.org Mon Aug 22 18:19:47 2016 Return-Path: Delivered-To: svn-src-head@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 EAECEBC20FD; Mon, 22 Aug 2016 18:19:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BACD817C3; Mon, 22 Aug 2016 18:19:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MIJkMs053116; Mon, 22 Aug 2016 18:19:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MIJkeV053115; Mon, 22 Aug 2016 18:19:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221819.u7MIJkeV053115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 18:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304622 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 18:19:48 -0000 Author: andrew Date: Mon Aug 22 18:19:46 2016 New Revision: 304622 URL: https://svnweb.freebsd.org/changeset/base/304622 Log: Ensure map is valid, even before userland exists and the fault address register points to an address in the userland range. Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: the FreeBSD Foundation Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Aug 22 18:17:29 2016 (r304621) +++ head/sys/arm64/arm64/trap.c Mon Aug 22 18:19:46 2016 (r304622) @@ -184,10 +184,13 @@ data_abort(struct trapframe *frame, uint map = &p->p_vmspace->vm_map; else { /* The top bit tells us which range to use */ - if ((far >> 63) == 1) + if ((far >> 63) == 1) { map = kernel_map; - else + } else { map = &p->p_vmspace->vm_map; + if (map == NULL) + map = kernel_map; + } } if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS) From owner-svn-src-head@freebsd.org Mon Aug 22 18:33:58 2016 Return-Path: Delivered-To: svn-src-head@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 0D853BC2556; Mon, 22 Aug 2016 18:33:58 +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 D45CB12C7; Mon, 22 Aug 2016 18:33:57 +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 u7MIXvDZ060162; Mon, 22 Aug 2016 18:33:57 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MIXvLN060161; Mon, 22 Aug 2016 18:33:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608221833.u7MIXvLN060161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 22 Aug 2016 18:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304623 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 18:33:58 -0000 Author: manu Date: Mon Aug 22 18:33:56 2016 New Revision: 304623 URL: https://svnweb.freebsd.org/changeset/base/304623 Log: Fix building for ARM kernel that have FLASHADDR, PHYSADDR and LOADERRAMADDR defined. Pointy Hat: myself Reported by: bz Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Mon Aug 22 18:19:46 2016 (r304622) +++ head/sys/arm/arm/elf_trampoline.c Mon Aug 22 18:33:56 2016 (r304623) @@ -228,7 +228,7 @@ _startC(unsigned r0, unsigned r1, unsign "mov pc, %0\n" : : "r" (target_addr), "r" (tmp_sp), "r" (s_boot_params.abp_r0), "r" (s_boot_params.abp_r1), - "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3), + "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3) : "r0", "r1", "r2", "r3"); } From owner-svn-src-head@freebsd.org Mon Aug 22 18:50:58 2016 Return-Path: Delivered-To: svn-src-head@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 BA265BC2BFA; Mon, 22 Aug 2016 18:50:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 897231EA1; Mon, 22 Aug 2016 18:50:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MIovLt064924; Mon, 22 Aug 2016 18:50:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MIov1S064923; Mon, 22 Aug 2016 18:50:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608221850.u7MIov1S064923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Aug 2016 18:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304624 - head/crypto/heimdal/lib/hx509 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 18:50:58 -0000 Author: emaste Date: Mon Aug 22 18:50:57 2016 New Revision: 304624 URL: https://svnweb.freebsd.org/changeset/base/304624 Log: Remove duplicate symbol from libhx509 version-script.map Upstream commit r21331 (7758a5d0) added semiprivate function _hx509_request_to_pkcs10 twice. This change has been committed upstream as 8ef0071d. Modified: head/crypto/heimdal/lib/hx509/version-script.map Modified: head/crypto/heimdal/lib/hx509/version-script.map ============================================================================== --- head/crypto/heimdal/lib/hx509/version-script.map Mon Aug 22 18:33:56 2016 (r304623) +++ head/crypto/heimdal/lib/hx509/version-script.map Mon Aug 22 18:50:57 2016 (r304624) @@ -23,7 +23,6 @@ HEIMDAL_X509_1.2 { _hx509_request_print; _hx509_request_set_email; _hx509_request_to_pkcs10; - _hx509_request_to_pkcs10; _hx509_unmap_file_os; _hx509_write_file; hx509_bitstring_print; From owner-svn-src-head@freebsd.org Mon Aug 22 19:05:13 2016 Return-Path: Delivered-To: svn-src-head@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 32E0EBC2138; Mon, 22 Aug 2016 19:05:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 004A31DAB; Mon, 22 Aug 2016 19:05:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MJ5C3R071657; Mon, 22 Aug 2016 19:05:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MJ5Cmu071656; Mon, 22 Aug 2016 19:05:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608221905.u7MJ5Cmu071656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 22 Aug 2016 19:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304625 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 19:05:13 -0000 Author: andrew Date: Mon Aug 22 19:05:11 2016 New Revision: 304625 URL: https://svnweb.freebsd.org/changeset/base/304625 Log: Fix the arm64 non-SMP build, active_irq is a uint64_t so cast it through a uintmax_t. Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/gic_v3.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Mon Aug 22 18:50:57 2016 (r304624) +++ head/sys/arm64/arm64/gic_v3.c Mon Aug 22 19:05:11 2016 (r304625) @@ -408,8 +408,8 @@ arm_gic_v3_intr(void *arg) #ifdef SMP intr_ipi_dispatch(sgi_to_ipi[gi->gi_irq], tf); #else - device_printf(sc->dev, "SGI %u on UP system detected\n", - active_irq - GIC_FIRST_SGI); + device_printf(sc->dev, "SGI %ju on UP system detected\n", + (uintmax_t)(active_irq - GIC_FIRST_SGI)); #endif } else if (active_irq >= GIC_FIRST_PPI && active_irq <= GIC_LAST_SPI) { From owner-svn-src-head@freebsd.org Mon Aug 22 19:07:28 2016 Return-Path: Delivered-To: svn-src-head@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 D7C68BC2251; Mon, 22 Aug 2016 19:07:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8E6C1162; Mon, 22 Aug 2016 19:07:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4A85FB963; Mon, 22 Aug 2016 15:07:27 -0400 (EDT) From: John Baldwin To: Benjamin Kaduk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304560 - head/release/doc/en_US.ISO8859-1/hardware Date: Mon, 22 Aug 2016 10:11:08 -0700 Message-ID: <2913576.xK0p2gucYF@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608211539.u7LFdk6O052748@repo.freebsd.org> References: <201608211539.u7LFdk6O052748@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 22 Aug 2016 15:07:27 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 19:07:29 -0000 On Sunday, August 21, 2016 03:39:46 PM Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Sun Aug 21 15:39:46 2016 > New Revision: 304560 > URL: https://svnweb.freebsd.org/changeset/base/304560 > > Log: > Remove the ie(4) hardware list from the release documentation > > The driver was removed by jhb in r304513, and the &hwlist.ie; entity > is no longer generated, causing the website build to fail. Sorry, I had grepped for other drivers but missed this one. :( -- John Baldwin From owner-svn-src-head@freebsd.org Mon Aug 22 19:27:22 2016 Return-Path: Delivered-To: svn-src-head@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 0FEA7BC292A; Mon, 22 Aug 2016 19:27:22 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D09511E21; Mon, 22 Aug 2016 19:27:21 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MJRKCi079139; Mon, 22 Aug 2016 19:27:20 GMT (envelope-from roberto@FreeBSD.org) Received: (from roberto@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MJRKfO079137; Mon, 22 Aug 2016 19:27:20 GMT (envelope-from roberto@FreeBSD.org) Message-Id: <201608221927.u7MJRKfO079137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: roberto set sender to roberto@FreeBSD.org using -f From: Ollivier Robert Date: Mon, 22 Aug 2016 19:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304626 - head/lib/libpam/modules/pam_ssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 19:27:22 -0000 Author: roberto Date: Mon Aug 22 19:27:20 2016 New Revision: 304626 URL: https://svnweb.freebsd.org/changeset/base/304626 Log: Add support for Ed25519 keys. Reported by: mwlucas MFH: 2 weeks Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 ============================================================================== --- head/lib/libpam/modules/pam_ssh/pam_ssh.8 Mon Aug 22 19:05:11 2016 (r304625) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.8 Mon Aug 22 19:27:20 2016 (r304626) @@ -137,6 +137,8 @@ SSH2 RSA key SSH2 DSA key .It Pa $HOME/.ssh/id_ecdsa SSH2 ECDSA key +.It Pa $HOME/.ssh/id_ed25519 +SSH2 Ed25519 key .El .Sh SEE ALSO .Xr ssh-agent 1 , Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c ============================================================================== --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 22 19:05:11 2016 (r304625) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 22 19:27:20 2016 (r304626) @@ -81,6 +81,7 @@ static const char *pam_ssh_keyfiles[] = ".ssh/id_rsa", /* SSH2 RSA key */ ".ssh/id_dsa", /* SSH2 DSA key */ ".ssh/id_ecdsa", /* SSH2 ECDSA key */ + ".ssh/id_ed25519", /* SSH2 Ed25519 key */ NULL }; From owner-svn-src-head@freebsd.org Mon Aug 22 19:32:51 2016 Return-Path: Delivered-To: svn-src-head@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 58405BC2AE6; Mon, 22 Aug 2016 19:32:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB8A15DA; Mon, 22 Aug 2016 19:32:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MJWomr082691; Mon, 22 Aug 2016 19:32:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MJWoRd082690; Mon, 22 Aug 2016 19:32:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608221932.u7MJWoRd082690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Aug 2016 19:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304629 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 19:32:51 -0000 Author: hselasky Date: Mon Aug 22 19:32:50 2016 New Revision: 304629 URL: https://svnweb.freebsd.org/changeset/base/304629 Log: Don't separate the status stage of the XHCI USB control transfers into its own job because this breaks the simplified QEMU XHCI TRB parser, which expects the complete USB control transfer as a series of back to back TRBs. The old behaviour is kept under #ifdef in case this change breaks enumeration of any USB devices. PR: 212021 MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Aug 22 19:28:54 2016 (r304628) +++ head/sys/dev/usb/controller/xhci.c Mon Aug 22 19:32:50 2016 (r304629) @@ -2221,7 +2221,11 @@ xhci_setup_generic_chain(struct usb_xfer * Send a DATA1 message and invert the current * endpoint direction. */ +#ifdef XHCI_STEP_STATUS_STAGE temp.step_td = (xfer->nframes != 0); +#else + temp.step_td = 0; +#endif temp.direction = UE_GET_DIR(xfer->endpointno) ^ UE_DIR_IN; temp.len = 0; temp.pc = NULL; From owner-svn-src-head@freebsd.org Mon Aug 22 20:48:48 2016 Return-Path: Delivered-To: svn-src-head@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 2FAA3BC2255; Mon, 22 Aug 2016 20:48:48 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0241617E8; Mon, 22 Aug 2016 20:48:47 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MKmlaI009304; Mon, 22 Aug 2016 20:48:47 GMT (envelope-from roberto@FreeBSD.org) Received: (from roberto@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MKmlJH009302; Mon, 22 Aug 2016 20:48:47 GMT (envelope-from roberto@FreeBSD.org) Message-Id: <201608222048.u7MKmlJH009302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: roberto set sender to roberto@FreeBSD.org using -f From: Ollivier Robert Date: Mon, 22 Aug 2016 20:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304635 - head/lib/libpam/modules/pam_ssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 20:48:48 -0000 Author: roberto Date: Mon Aug 22 20:48:46 2016 New Revision: 304635 URL: https://svnweb.freebsd.org/changeset/base/304635 Log: Remove support for SSH1 as it is already disabled in our OpenSSH. Submitted by: vangyzen MFC after: 2 weeks Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 ============================================================================== --- head/lib/libpam/modules/pam_ssh/pam_ssh.8 Mon Aug 22 20:23:39 2016 (r304634) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.8 Mon Aug 22 20:48:46 2016 (r304635) @@ -128,9 +128,7 @@ Start an agent even if no keys were decr authentication phase. .El .Sh FILES -.Bl -tag -width ".Pa $HOME/.ssh/identity" -compact -.It Pa $HOME/.ssh/identity -SSH1 RSA key +.Bl -tag -width ".Pa $HOME/.ssh/id_ed25519" -compact .It Pa $HOME/.ssh/id_rsa SSH2 RSA key .It Pa $HOME/.ssh/id_dsa Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c ============================================================================== --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 22 20:23:39 2016 (r304634) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Mon Aug 22 20:48:46 2016 (r304635) @@ -77,7 +77,6 @@ static const char *pam_ssh_prompt = "SSH static const char *pam_ssh_have_keys = "pam_ssh_have_keys"; static const char *pam_ssh_keyfiles[] = { - ".ssh/identity", /* SSH1 RSA key */ ".ssh/id_rsa", /* SSH2 RSA key */ ".ssh/id_dsa", /* SSH2 DSA key */ ".ssh/id_ecdsa", /* SSH2 ECDSA key */ From owner-svn-src-head@freebsd.org Mon Aug 22 20:59:35 2016 Return-Path: Delivered-To: svn-src-head@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 E9948BC2477; Mon, 22 Aug 2016 20:59:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C5561DD8; Mon, 22 Aug 2016 20:59:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MKxYoZ013043; Mon, 22 Aug 2016 20:59:34 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MKxYqt013036; Mon, 22 Aug 2016 20:59:34 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608222059.u7MKxYqt013036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 22 Aug 2016 20:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304636 - in head: crypto/openssl/crypto/bn/asm crypto/openssl/crypto/sha/asm secure/lib/libcrypto secure/lib/libcrypto/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 20:59:36 -0000 Author: jkim Date: Mon Aug 22 20:59:34 2016 New Revision: 304636 URL: https://svnweb.freebsd.org/changeset/base/304636 Log: Build OpenSSL assembly sources for arm. Tested with Raspberry Pi 2 Model B. MFC after: 1 week Added: head/secure/lib/libcrypto/arm/ head/secure/lib/libcrypto/arm/aes-armv4.S (contents, props changed) head/secure/lib/libcrypto/arm/aesv8-armx.S (contents, props changed) head/secure/lib/libcrypto/arm/armv4-gf2m.S (contents, props changed) head/secure/lib/libcrypto/arm/armv4-mont.S (contents, props changed) head/secure/lib/libcrypto/arm/bsaes-armv7.S (contents, props changed) head/secure/lib/libcrypto/arm/ghash-armv4.S (contents, props changed) head/secure/lib/libcrypto/arm/ghashv8-armx.S (contents, props changed) head/secure/lib/libcrypto/arm/sha1-armv4-large.S (contents, props changed) head/secure/lib/libcrypto/arm/sha256-armv4.S (contents, props changed) head/secure/lib/libcrypto/arm/sha512-armv4.S (contents, props changed) Modified: head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc Modified: head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl ============================================================================== --- head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Mon Aug 22 20:48:46 2016 (r304635) +++ head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Mon Aug 22 20:59:34 2016 (r304636) @@ -213,8 +213,8 @@ $code.=<<___; .align 5 .LNEON: ldr r12, [sp] @ 5th argument - vmov.32 $a, r2, r1 - vmov.32 $b, r12, r3 + vmov $a, r2, r1 + vmov $b, r12, r3 vmov.i64 $k48, #0x0000ffffffffffff vmov.i64 $k32, #0x00000000ffffffff vmov.i64 $k16, #0x000000000000ffff Modified: head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl ============================================================================== --- head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl Mon Aug 22 20:48:46 2016 (r304635) +++ head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl Mon Aug 22 20:59:34 2016 (r304636) @@ -595,7 +595,7 @@ sha256_block_data_order_armv8: adr $Ktbl,.LARMv8 sub $Ktbl,$Ktbl,#.LARMv8-K256 # else - adrl $Ktbl,K256 + sub $Ktbl,$Ktbl,#256+32 # endif add $len,$inp,$len,lsl#6 @ len to point at the end of inp Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Mon Aug 22 20:48:46 2016 (r304635) +++ head/secure/lib/libcrypto/Makefile Mon Aug 22 20:59:34 2016 (r304636) @@ -24,6 +24,8 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex o_fips.c o_init.c o_str.c o_time.c uid.c .if defined(ASM_amd64) SRCS+= x86_64cpuid.S +.elif defined(ASM_arm) +SRCS+= armcap.c armv4cpuid.S .elif defined(ASM_i386) SRCS+= x86cpuid.S .else @@ -36,6 +38,8 @@ SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes .if defined(ASM_amd64) SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S +.elif defined(ASM_arm) +SRCS+= aes-armv4.S aes_cbc.c aesv8-armx.S bsaes-armv7.S .elif defined(ASM_i386) SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else @@ -85,6 +89,8 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn .if defined(ASM_amd64) SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S +.elif defined(ASM_arm) +SRCS+= armv4-mont.S armv4-gf2m.S bn_asm.c .elif defined(ASM_i386) SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else @@ -234,6 +240,8 @@ SRCS+= cbc128.c ccm128.c cfb128.c ctr128 wrap128.c xts128.c .if defined(ASM_amd64) SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S +.elif defined(ASM_arm) +SRCS+= ghash-armv4.S ghashv8-armx.S .elif defined(ASM_i386) SRCS+= ghash-x86.S .endif @@ -319,6 +327,8 @@ SRCS+= sha1_one.c sha1dgst.c sha256.c sh .if defined(ASM_amd64) SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \ sha512-x86_64.S +.elif defined(ASM_arm) +SRCS+= sha1-armv4-large.S sha256-armv4.S sha512-armv4.S .elif defined(ASM_i386) SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Mon Aug 22 20:48:46 2016 (r304635) +++ head/secure/lib/libcrypto/Makefile.asm Mon Aug 22 20:59:34 2016 (r304636) @@ -78,6 +78,46 @@ ${s}.S: ${s}.s cat ${s}.s ) > ${.TARGET} .endfor +.elif defined(ASM_arm) + +.PATH: ${LCRYPTO_SRC}/crypto \ + ${LCRYPTO_SRC}/crypto/aes/asm \ + ${LCRYPTO_SRC}/crypto/bn/asm \ + ${LCRYPTO_SRC}/crypto/modes/asm \ + ${LCRYPTO_SRC}/crypto/sha/asm + +PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm + +# aes +SRCS= aesv8-armx.pl bsaes-armv7.pl + +# bn +SRCS+= armv4-mont.pl armv4-gf2m.pl + +# modes +SRCS+= ghash-armv4.pl ghashv8-armx.pl + +# sha +SRCS+= sha1-armv4-large.pl sha256-armv4.pl sha512-armv4.pl + +ASM= aes-armv4.S ${SRCS:R:S/$/.S/} + +all: ${ASM} + +CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} +.SUFFIXES: .pl + +aes-armv4.S: aes-armv4.pl + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.ALLSRC:T}.' ;\ + env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET} + +.pl.S: + env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/} + ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\ + cat ${.TARGET:R:S/$/.s/}) > ${.TARGET} + .elif defined(ASM_i386) .PATH: ${LCRYPTO_SRC}/crypto \ Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Mon Aug 22 20:48:46 2016 (r304635) +++ head/secure/lib/libcrypto/Makefile.inc Mon Aug 22 20:59:34 2016 (r304636) @@ -29,6 +29,8 @@ _ASM_AVX!= { \ .if ${_ASM_AVX} == yes ASM_${MACHINE_CPUARCH}= .endif +.elif ${MACHINE_CPUARCH} == "arm" +ASM_arm= .endif .if defined(ASM_amd64) @@ -40,6 +42,11 @@ CFLAGS+=-DMD5_ASM CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+=-DWHIRLPOOL_ASM +.elif defined(ASM_arm) +CFLAGS+=-DAES_ASM -DBSAES_ASM +CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m +CFLAGS+=-DGHASH_ASM +CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM .elif defined(ASM_i386) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM Added: head/secure/lib/libcrypto/arm/aes-armv4.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/arm/aes-armv4.S Mon Aug 22 20:59:34 2016 (r304636) @@ -0,0 +1,1179 @@ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aes-armv4.pl. + +@ ==================================================================== +@ Written by Andy Polyakov for the OpenSSL +@ project. The module is, however, dual licensed under OpenSSL and +@ CRYPTOGAMS licenses depending on where you obtain it. For further +@ details see http://www.openssl.org/~appro/cryptogams/. +@ ==================================================================== + +@ AES for ARMv4 + +@ January 2007. +@ +@ Code uses single 1K S-box and is >2 times faster than code generated +@ by gcc-3.4.1. This is thanks to unique feature of ARMv4 ISA, which +@ allows to merge logical or arithmetic operation with shift or rotate +@ in one instruction and emit combined result every cycle. The module +@ is endian-neutral. The performance is ~42 cycles/byte for 128-bit +@ key [on single-issue Xscale PXA250 core]. + +@ May 2007. +@ +@ AES_set_[en|de]crypt_key is added. + +@ July 2010. +@ +@ Rescheduling for dual-issue pipeline resulted in 12% improvement on +@ Cortex A8 core and ~25 cycles per byte processed with 128-bit key. + +@ February 2011. +@ +@ Profiler-assisted and platform-specific optimization resulted in 16% +@ improvement on Cortex A8 core and ~21.5 cycles per byte. + +#ifndef __KERNEL__ +# include "arm_arch.h" +#else +# define __ARM_ARCH__ __LINUX_ARM_ARCH__ +#endif + +.text +#if __ARM_ARCH__<7 +.code 32 +#else +.syntax unified +# ifdef __thumb2__ +.thumb +# else +.code 32 +# endif +#endif + +.type AES_Te,%object +.align 5 +AES_Te: +.word 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d +.word 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554 +.word 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d +.word 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a +.word 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87 +.word 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b +.word 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea +.word 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b +.word 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a +.word 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f +.word 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108 +.word 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f +.word 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e +.word 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5 +.word 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d +.word 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f +.word 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e +.word 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb +.word 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce +.word 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497 +.word 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c +.word 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed +.word 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b +.word 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a +.word 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16 +.word 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594 +.word 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81 +.word 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3 +.word 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a +.word 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504 +.word 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163 +.word 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d +.word 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f +.word 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739 +.word 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47 +.word 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395 +.word 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f +.word 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883 +.word 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c +.word 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76 +.word 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e +.word 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4 +.word 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6 +.word 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b +.word 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7 +.word 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0 +.word 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25 +.word 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818 +.word 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72 +.word 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651 +.word 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21 +.word 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85 +.word 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa +.word 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12 +.word 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0 +.word 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9 +.word 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133 +.word 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7 +.word 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920 +.word 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a +.word 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17 +.word 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8 +.word 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11 +.word 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a +@ Te4[256] +.byte 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5 +.byte 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76 +.byte 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0 +.byte 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0 +.byte 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc +.byte 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15 +.byte 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a +.byte 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75 +.byte 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0 +.byte 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84 +.byte 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b +.byte 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf +.byte 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85 +.byte 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8 +.byte 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5 +.byte 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2 +.byte 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17 +.byte 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73 +.byte 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88 +.byte 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb +.byte 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c +.byte 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79 +.byte 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9 +.byte 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08 +.byte 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6 +.byte 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a +.byte 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e +.byte 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e +.byte 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94 +.byte 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf +.byte 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68 +.byte 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 +@ rcon[] +.word 0x01000000, 0x02000000, 0x04000000, 0x08000000 +.word 0x10000000, 0x20000000, 0x40000000, 0x80000000 +.word 0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0 +.size AES_Te,.-AES_Te + +@ void AES_encrypt(const unsigned char *in, unsigned char *out, +@ const AES_KEY *key) { +.global AES_encrypt +.type AES_encrypt,%function +.align 5 +AES_encrypt: +#if __ARM_ARCH__<7 + sub r3,pc,#8 @ AES_encrypt +#else + adr r3,AES_encrypt +#endif + stmdb sp!,{r1,r4-r12,lr} + mov r12,r0 @ inp + mov r11,r2 + sub r10,r3,#AES_encrypt-AES_Te @ Te +#if __ARM_ARCH__<7 + ldrb r0,[r12,#3] @ load input data in endian-neutral + ldrb r4,[r12,#2] @ manner... + ldrb r5,[r12,#1] + ldrb r6,[r12,#0] + orr r0,r0,r4,lsl#8 + ldrb r1,[r12,#7] + orr r0,r0,r5,lsl#16 + ldrb r4,[r12,#6] + orr r0,r0,r6,lsl#24 + ldrb r5,[r12,#5] + ldrb r6,[r12,#4] + orr r1,r1,r4,lsl#8 + ldrb r2,[r12,#11] + orr r1,r1,r5,lsl#16 + ldrb r4,[r12,#10] + orr r1,r1,r6,lsl#24 + ldrb r5,[r12,#9] + ldrb r6,[r12,#8] + orr r2,r2,r4,lsl#8 + ldrb r3,[r12,#15] + orr r2,r2,r5,lsl#16 + ldrb r4,[r12,#14] + orr r2,r2,r6,lsl#24 + ldrb r5,[r12,#13] + ldrb r6,[r12,#12] + orr r3,r3,r4,lsl#8 + orr r3,r3,r5,lsl#16 + orr r3,r3,r6,lsl#24 +#else + ldr r0,[r12,#0] + ldr r1,[r12,#4] + ldr r2,[r12,#8] + ldr r3,[r12,#12] +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif +#endif + bl _armv4_AES_encrypt + + ldr r12,[sp],#4 @ pop out +#if __ARM_ARCH__>=7 +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif + str r0,[r12,#0] + str r1,[r12,#4] + str r2,[r12,#8] + str r3,[r12,#12] +#else + mov r4,r0,lsr#24 @ write output in endian-neutral + mov r5,r0,lsr#16 @ manner... + mov r6,r0,lsr#8 + strb r4,[r12,#0] + strb r5,[r12,#1] + mov r4,r1,lsr#24 + strb r6,[r12,#2] + mov r5,r1,lsr#16 + strb r0,[r12,#3] + mov r6,r1,lsr#8 + strb r4,[r12,#4] + strb r5,[r12,#5] + mov r4,r2,lsr#24 + strb r6,[r12,#6] + mov r5,r2,lsr#16 + strb r1,[r12,#7] + mov r6,r2,lsr#8 + strb r4,[r12,#8] + strb r5,[r12,#9] + mov r4,r3,lsr#24 + strb r6,[r12,#10] + mov r5,r3,lsr#16 + strb r2,[r12,#11] + mov r6,r3,lsr#8 + strb r4,[r12,#12] + strb r5,[r12,#13] + strb r6,[r12,#14] + strb r3,[r12,#15] +#endif +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size AES_encrypt,.-AES_encrypt + +.type _armv4_AES_encrypt,%function +.align 2 +_armv4_AES_encrypt: + str lr,[sp,#-4]! @ push lr + ldmia r11!,{r4-r7} + eor r0,r0,r4 + ldr r12,[r11,#240-16] + eor r1,r1,r5 + eor r2,r2,r6 + eor r3,r3,r7 + sub r12,r12,#1 + mov lr,#255 + + and r7,lr,r0 + and r8,lr,r0,lsr#8 + and r9,lr,r0,lsr#16 + mov r0,r0,lsr#24 +.Lenc_loop: + ldr r4,[r10,r7,lsl#2] @ Te3[s0>>0] + and r7,lr,r1,lsr#16 @ i0 + ldr r5,[r10,r8,lsl#2] @ Te2[s0>>8] + and r8,lr,r1 + ldr r6,[r10,r9,lsl#2] @ Te1[s0>>16] + and r9,lr,r1,lsr#8 + ldr r0,[r10,r0,lsl#2] @ Te0[s0>>24] + mov r1,r1,lsr#24 + + ldr r7,[r10,r7,lsl#2] @ Te1[s1>>16] + ldr r8,[r10,r8,lsl#2] @ Te3[s1>>0] + ldr r9,[r10,r9,lsl#2] @ Te2[s1>>8] + eor r0,r0,r7,ror#8 + ldr r1,[r10,r1,lsl#2] @ Te0[s1>>24] + and r7,lr,r2,lsr#8 @ i0 + eor r5,r5,r8,ror#8 + and r8,lr,r2,lsr#16 @ i1 + eor r6,r6,r9,ror#8 + and r9,lr,r2 + ldr r7,[r10,r7,lsl#2] @ Te2[s2>>8] + eor r1,r1,r4,ror#24 + ldr r8,[r10,r8,lsl#2] @ Te1[s2>>16] + mov r2,r2,lsr#24 + + ldr r9,[r10,r9,lsl#2] @ Te3[s2>>0] + eor r0,r0,r7,ror#16 + ldr r2,[r10,r2,lsl#2] @ Te0[s2>>24] + and r7,lr,r3 @ i0 + eor r1,r1,r8,ror#8 + and r8,lr,r3,lsr#8 @ i1 + eor r6,r6,r9,ror#16 + and r9,lr,r3,lsr#16 @ i2 + ldr r7,[r10,r7,lsl#2] @ Te3[s3>>0] + eor r2,r2,r5,ror#16 + ldr r8,[r10,r8,lsl#2] @ Te2[s3>>8] + mov r3,r3,lsr#24 + + ldr r9,[r10,r9,lsl#2] @ Te1[s3>>16] + eor r0,r0,r7,ror#24 + ldr r7,[r11],#16 + eor r1,r1,r8,ror#16 + ldr r3,[r10,r3,lsl#2] @ Te0[s3>>24] + eor r2,r2,r9,ror#8 + ldr r4,[r11,#-12] + eor r3,r3,r6,ror#8 + + ldr r5,[r11,#-8] + eor r0,r0,r7 + ldr r6,[r11,#-4] + and r7,lr,r0 + eor r1,r1,r4 + and r8,lr,r0,lsr#8 + eor r2,r2,r5 + and r9,lr,r0,lsr#16 + eor r3,r3,r6 + mov r0,r0,lsr#24 + + subs r12,r12,#1 + bne .Lenc_loop + + add r10,r10,#2 + + ldrb r4,[r10,r7,lsl#2] @ Te4[s0>>0] + and r7,lr,r1,lsr#16 @ i0 + ldrb r5,[r10,r8,lsl#2] @ Te4[s0>>8] + and r8,lr,r1 + ldrb r6,[r10,r9,lsl#2] @ Te4[s0>>16] + and r9,lr,r1,lsr#8 + ldrb r0,[r10,r0,lsl#2] @ Te4[s0>>24] + mov r1,r1,lsr#24 + + ldrb r7,[r10,r7,lsl#2] @ Te4[s1>>16] + ldrb r8,[r10,r8,lsl#2] @ Te4[s1>>0] + ldrb r9,[r10,r9,lsl#2] @ Te4[s1>>8] + eor r0,r7,r0,lsl#8 + ldrb r1,[r10,r1,lsl#2] @ Te4[s1>>24] + and r7,lr,r2,lsr#8 @ i0 + eor r5,r8,r5,lsl#8 + and r8,lr,r2,lsr#16 @ i1 + eor r6,r9,r6,lsl#8 + and r9,lr,r2 + ldrb r7,[r10,r7,lsl#2] @ Te4[s2>>8] + eor r1,r4,r1,lsl#24 + ldrb r8,[r10,r8,lsl#2] @ Te4[s2>>16] + mov r2,r2,lsr#24 + + ldrb r9,[r10,r9,lsl#2] @ Te4[s2>>0] + eor r0,r7,r0,lsl#8 + ldrb r2,[r10,r2,lsl#2] @ Te4[s2>>24] + and r7,lr,r3 @ i0 + eor r1,r1,r8,lsl#16 + and r8,lr,r3,lsr#8 @ i1 + eor r6,r9,r6,lsl#8 + and r9,lr,r3,lsr#16 @ i2 + ldrb r7,[r10,r7,lsl#2] @ Te4[s3>>0] + eor r2,r5,r2,lsl#24 + ldrb r8,[r10,r8,lsl#2] @ Te4[s3>>8] + mov r3,r3,lsr#24 + + ldrb r9,[r10,r9,lsl#2] @ Te4[s3>>16] + eor r0,r7,r0,lsl#8 + ldr r7,[r11,#0] + ldrb r3,[r10,r3,lsl#2] @ Te4[s3>>24] + eor r1,r1,r8,lsl#8 + ldr r4,[r11,#4] + eor r2,r2,r9,lsl#16 + ldr r5,[r11,#8] + eor r3,r6,r3,lsl#24 + ldr r6,[r11,#12] + + eor r0,r0,r7 + eor r1,r1,r4 + eor r2,r2,r5 + eor r3,r3,r6 + + sub r10,r10,#2 + ldr pc,[sp],#4 @ pop and return +.size _armv4_AES_encrypt,.-_armv4_AES_encrypt + +.global private_AES_set_encrypt_key +.type private_AES_set_encrypt_key,%function +.align 5 +private_AES_set_encrypt_key: +_armv4_AES_set_encrypt_key: +#if __ARM_ARCH__<7 + sub r3,pc,#8 @ AES_set_encrypt_key +#else + adr r3,private_AES_set_encrypt_key +#endif + teq r0,#0 +#if __ARM_ARCH__>=7 + itt eq @ Thumb2 thing, sanity check in ARM +#endif + moveq r0,#-1 + beq .Labrt + teq r2,#0 +#if __ARM_ARCH__>=7 + itt eq @ Thumb2 thing, sanity check in ARM +#endif + moveq r0,#-1 + beq .Labrt + + teq r1,#128 + beq .Lok + teq r1,#192 + beq .Lok + teq r1,#256 +#if __ARM_ARCH__>=7 + itt ne @ Thumb2 thing, sanity check in ARM +#endif + movne r0,#-1 + bne .Labrt + +.Lok: stmdb sp!,{r4-r12,lr} + sub r10,r3,#_armv4_AES_set_encrypt_key-AES_Te-1024 @ Te4 + + mov r12,r0 @ inp + mov lr,r1 @ bits + mov r11,r2 @ key + +#if __ARM_ARCH__<7 + ldrb r0,[r12,#3] @ load input data in endian-neutral + ldrb r4,[r12,#2] @ manner... + ldrb r5,[r12,#1] + ldrb r6,[r12,#0] + orr r0,r0,r4,lsl#8 + ldrb r1,[r12,#7] + orr r0,r0,r5,lsl#16 + ldrb r4,[r12,#6] + orr r0,r0,r6,lsl#24 + ldrb r5,[r12,#5] + ldrb r6,[r12,#4] + orr r1,r1,r4,lsl#8 + ldrb r2,[r12,#11] + orr r1,r1,r5,lsl#16 + ldrb r4,[r12,#10] + orr r1,r1,r6,lsl#24 + ldrb r5,[r12,#9] + ldrb r6,[r12,#8] + orr r2,r2,r4,lsl#8 + ldrb r3,[r12,#15] + orr r2,r2,r5,lsl#16 + ldrb r4,[r12,#14] + orr r2,r2,r6,lsl#24 + ldrb r5,[r12,#13] + ldrb r6,[r12,#12] + orr r3,r3,r4,lsl#8 + str r0,[r11],#16 + orr r3,r3,r5,lsl#16 + str r1,[r11,#-12] + orr r3,r3,r6,lsl#24 + str r2,[r11,#-8] + str r3,[r11,#-4] +#else + ldr r0,[r12,#0] + ldr r1,[r12,#4] + ldr r2,[r12,#8] + ldr r3,[r12,#12] +#ifdef __ARMEL__ + rev r0,r0 + rev r1,r1 + rev r2,r2 + rev r3,r3 +#endif + str r0,[r11],#16 + str r1,[r11,#-12] + str r2,[r11,#-8] + str r3,[r11,#-4] +#endif + + teq lr,#128 + bne .Lnot128 + mov r12,#10 + str r12,[r11,#240-16] + add r6,r10,#256 @ rcon + mov lr,#255 + +.L128_loop: + and r5,lr,r3,lsr#24 + and r7,lr,r3,lsr#16 + ldrb r5,[r10,r5] + and r8,lr,r3,lsr#8 + ldrb r7,[r10,r7] + and r9,lr,r3 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#24 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r6],#4 @ rcon[i++] + orr r5,r5,r9,lsl#8 + eor r5,r5,r4 + eor r0,r0,r5 @ rk[4]=rk[0]^... + eor r1,r1,r0 @ rk[5]=rk[1]^rk[4] + str r0,[r11],#16 + eor r2,r2,r1 @ rk[6]=rk[2]^rk[5] + str r1,[r11,#-12] + eor r3,r3,r2 @ rk[7]=rk[3]^rk[6] + str r2,[r11,#-8] + subs r12,r12,#1 + str r3,[r11,#-4] + bne .L128_loop + sub r2,r11,#176 + b .Ldone + +.Lnot128: +#if __ARM_ARCH__<7 + ldrb r8,[r12,#19] + ldrb r4,[r12,#18] + ldrb r5,[r12,#17] + ldrb r6,[r12,#16] + orr r8,r8,r4,lsl#8 + ldrb r9,[r12,#23] + orr r8,r8,r5,lsl#16 + ldrb r4,[r12,#22] + orr r8,r8,r6,lsl#24 + ldrb r5,[r12,#21] + ldrb r6,[r12,#20] + orr r9,r9,r4,lsl#8 + orr r9,r9,r5,lsl#16 + str r8,[r11],#8 + orr r9,r9,r6,lsl#24 + str r9,[r11,#-4] +#else + ldr r8,[r12,#16] + ldr r9,[r12,#20] +#ifdef __ARMEL__ + rev r8,r8 + rev r9,r9 +#endif + str r8,[r11],#8 + str r9,[r11,#-4] +#endif + + teq lr,#192 + bne .Lnot192 + mov r12,#12 + str r12,[r11,#240-24] + add r6,r10,#256 @ rcon + mov lr,#255 + mov r12,#8 + +.L192_loop: + and r5,lr,r9,lsr#24 + and r7,lr,r9,lsr#16 + ldrb r5,[r10,r5] + and r8,lr,r9,lsr#8 + ldrb r7,[r10,r7] + and r9,lr,r9 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#24 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r6],#4 @ rcon[i++] + orr r5,r5,r9,lsl#8 + eor r9,r5,r4 + eor r0,r0,r9 @ rk[6]=rk[0]^... + eor r1,r1,r0 @ rk[7]=rk[1]^rk[6] + str r0,[r11],#24 + eor r2,r2,r1 @ rk[8]=rk[2]^rk[7] + str r1,[r11,#-20] + eor r3,r3,r2 @ rk[9]=rk[3]^rk[8] + str r2,[r11,#-16] + subs r12,r12,#1 + str r3,[r11,#-12] +#if __ARM_ARCH__>=7 + itt eq @ Thumb2 thing, sanity check in ARM +#endif + subeq r2,r11,#216 + beq .Ldone + + ldr r7,[r11,#-32] + ldr r8,[r11,#-28] + eor r7,r7,r3 @ rk[10]=rk[4]^rk[9] + eor r9,r8,r7 @ rk[11]=rk[5]^rk[10] + str r7,[r11,#-8] + str r9,[r11,#-4] + b .L192_loop + +.Lnot192: +#if __ARM_ARCH__<7 + ldrb r8,[r12,#27] + ldrb r4,[r12,#26] + ldrb r5,[r12,#25] + ldrb r6,[r12,#24] + orr r8,r8,r4,lsl#8 + ldrb r9,[r12,#31] + orr r8,r8,r5,lsl#16 + ldrb r4,[r12,#30] + orr r8,r8,r6,lsl#24 + ldrb r5,[r12,#29] + ldrb r6,[r12,#28] + orr r9,r9,r4,lsl#8 + orr r9,r9,r5,lsl#16 + str r8,[r11],#8 + orr r9,r9,r6,lsl#24 + str r9,[r11,#-4] +#else + ldr r8,[r12,#24] + ldr r9,[r12,#28] +#ifdef __ARMEL__ + rev r8,r8 + rev r9,r9 +#endif + str r8,[r11],#8 + str r9,[r11,#-4] +#endif + + mov r12,#14 + str r12,[r11,#240-32] + add r6,r10,#256 @ rcon + mov lr,#255 + mov r12,#7 + +.L256_loop: + and r5,lr,r9,lsr#24 + and r7,lr,r9,lsr#16 + ldrb r5,[r10,r5] + and r8,lr,r9,lsr#8 + ldrb r7,[r10,r7] + and r9,lr,r9 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#24 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r6],#4 @ rcon[i++] + orr r5,r5,r9,lsl#8 + eor r9,r5,r4 + eor r0,r0,r9 @ rk[8]=rk[0]^... + eor r1,r1,r0 @ rk[9]=rk[1]^rk[8] + str r0,[r11],#32 + eor r2,r2,r1 @ rk[10]=rk[2]^rk[9] + str r1,[r11,#-28] + eor r3,r3,r2 @ rk[11]=rk[3]^rk[10] + str r2,[r11,#-24] + subs r12,r12,#1 + str r3,[r11,#-20] +#if __ARM_ARCH__>=7 + itt eq @ Thumb2 thing, sanity check in ARM +#endif + subeq r2,r11,#256 + beq .Ldone + + and r5,lr,r3 + and r7,lr,r3,lsr#8 + ldrb r5,[r10,r5] + and r8,lr,r3,lsr#16 + ldrb r7,[r10,r7] + and r9,lr,r3,lsr#24 + ldrb r8,[r10,r8] + orr r5,r5,r7,lsl#8 + ldrb r9,[r10,r9] + orr r5,r5,r8,lsl#16 + ldr r4,[r11,#-48] + orr r5,r5,r9,lsl#24 + + ldr r7,[r11,#-44] + ldr r8,[r11,#-40] + eor r4,r4,r5 @ rk[12]=rk[4]^... + ldr r9,[r11,#-36] + eor r7,r7,r4 @ rk[13]=rk[5]^rk[12] + str r4,[r11,#-16] + eor r8,r8,r7 @ rk[14]=rk[6]^rk[13] + str r7,[r11,#-12] + eor r9,r9,r8 @ rk[15]=rk[7]^rk[14] + str r8,[r11,#-8] + str r9,[r11,#-4] + b .L256_loop + +.align 2 +.Ldone: mov r0,#0 + ldmia sp!,{r4-r12,lr} +.Labrt: +#if __ARM_ARCH__>=5 + bx lr @ .word 0xe12fff1e +#else + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size private_AES_set_encrypt_key,.-private_AES_set_encrypt_key + +.global private_AES_set_decrypt_key +.type private_AES_set_decrypt_key,%function +.align 5 +private_AES_set_decrypt_key: + str lr,[sp,#-4]! @ push lr + bl _armv4_AES_set_encrypt_key + teq r0,#0 + ldr lr,[sp],#4 @ pop lr + bne .Labrt + + mov r0,r2 @ AES_set_encrypt_key preserves r2, + mov r1,r2 @ which is AES_KEY *key + b _armv4_AES_set_enc2dec_key +.size private_AES_set_decrypt_key,.-private_AES_set_decrypt_key + +@ void AES_set_enc2dec_key(const AES_KEY *inp,AES_KEY *out) +.global AES_set_enc2dec_key +.type AES_set_enc2dec_key,%function +.align 5 +AES_set_enc2dec_key: +_armv4_AES_set_enc2dec_key: + stmdb sp!,{r4-r12,lr} + + ldr r12,[r0,#240] + mov r7,r0 @ input + add r8,r0,r12,lsl#4 + mov r11,r1 @ ouput + add r10,r1,r12,lsl#4 + str r12,[r1,#240] + +.Linv: ldr r0,[r7],#16 + ldr r1,[r7,#-12] + ldr r2,[r7,#-8] + ldr r3,[r7,#-4] + ldr r4,[r8],#-16 + ldr r5,[r8,#16+4] + ldr r6,[r8,#16+8] + ldr r9,[r8,#16+12] + str r0,[r10],#-16 + str r1,[r10,#16+4] + str r2,[r10,#16+8] + str r3,[r10,#16+12] + str r4,[r11],#16 + str r5,[r11,#-12] + str r6,[r11,#-8] + str r9,[r11,#-4] + teq r7,r8 + bne .Linv + + ldr r0,[r7] + ldr r1,[r7,#4] + ldr r2,[r7,#8] + ldr r3,[r7,#12] + str r0,[r11] + str r1,[r11,#4] + str r2,[r11,#8] + str r3,[r11,#12] + sub r11,r11,r12,lsl#3 + ldr r0,[r11,#16]! @ prefetch tp1 + mov r7,#0x80 + mov r8,#0x1b + orr r7,r7,#0x8000 + orr r8,r8,#0x1b00 + orr r7,r7,r7,lsl#16 + orr r8,r8,r8,lsl#16 + sub r12,r12,#1 + mvn r9,r7 + mov r12,r12,lsl#2 @ (rounds-1)*4 + +.Lmix: and r4,r0,r7 + and r1,r0,r9 + sub r4,r4,r4,lsr#7 + and r4,r4,r8 + eor r1,r4,r1,lsl#1 @ tp2 + + and r4,r1,r7 + and r2,r1,r9 + sub r4,r4,r4,lsr#7 + and r4,r4,r8 + eor r2,r4,r2,lsl#1 @ tp4 + + and r4,r2,r7 + and r3,r2,r9 + sub r4,r4,r4,lsr#7 + and r4,r4,r8 + eor r3,r4,r3,lsl#1 @ tp8 + + eor r4,r1,r2 + eor r5,r0,r3 @ tp9 + eor r4,r4,r3 @ tpe + eor r4,r4,r1,ror#24 + eor r4,r4,r5,ror#24 @ ^= ROTATE(tpb=tp9^tp2,8) + eor r4,r4,r2,ror#16 + eor r4,r4,r5,ror#16 @ ^= ROTATE(tpd=tp9^tp4,16) + eor r4,r4,r5,ror#8 @ ^= ROTATE(tp9,24) + + ldr r0,[r11,#4] @ prefetch tp1 + str r4,[r11],#4 + subs r12,r12,#1 + bne .Lmix + + mov r0,#0 +#if __ARM_ARCH__>=5 + ldmia sp!,{r4-r12,pc} +#else + ldmia sp!,{r4-r12,lr} + tst lr,#1 + moveq pc,lr @ be binary compatible with V4, yet + .word 0xe12fff1e @ interoperable with Thumb ISA:-) +#endif +.size AES_set_enc2dec_key,.-AES_set_enc2dec_key + +.type AES_Td,%object +.align 5 +AES_Td: +.word 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96 +.word 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393 +.word 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25 +.word 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f +.word 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1 +.word 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6 +.word 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da +.word 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844 +.word 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd +.word 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4 +.word 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45 +.word 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94 +.word 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7 +.word 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a +.word 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5 +.word 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c +.word 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1 +.word 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a +.word 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75 +.word 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051 +.word 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46 +.word 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff +.word 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77 +.word 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb +.word 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000 +.word 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e +.word 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927 +.word 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a +.word 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e +.word 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16 +.word 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Aug 22 21:23:19 2016 Return-Path: Delivered-To: svn-src-head@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 3F1ECBC2B4B; Mon, 22 Aug 2016 21:23:19 +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 1AE661E51; Mon, 22 Aug 2016 21:23:19 +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 u7MLNI7l024252; Mon, 22 Aug 2016 21:23:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MLNHhw024248; Mon, 22 Aug 2016 21:23:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608222123.u7MLNHhw024248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Aug 2016 21:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304637 - in head/sys: amd64/include i386/include x86/x86 x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 21:23:19 -0000 Author: jhb Date: Mon Aug 22 21:23:17 2016 New Revision: 304637 URL: https://svnweb.freebsd.org/changeset/base/304637 Log: Fix build for !SMP kernels after the Xen MSIX workaround. Move msix_disable_migration under #ifdef SMP since it doesn't make sense for !SMP kernels. PR: 212014 Reported by: Glyn Grinstead MFC after: 3 days Modified: head/sys/amd64/include/intr_machdep.h head/sys/i386/include/intr_machdep.h head/sys/x86/x86/msi.c head/sys/x86/xen/hvm.c Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Mon Aug 22 20:59:34 2016 (r304636) +++ head/sys/amd64/include/intr_machdep.h Mon Aug 22 21:23:17 2016 (r304637) @@ -148,8 +148,9 @@ extern cpuset_t intr_cpus; #endif extern struct mtx icu_lock; extern int elcr_found; - +#ifdef SMP extern int msix_disable_migration; +#endif #ifndef DEV_ATPIC void atpic_reset(void); Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Mon Aug 22 20:59:34 2016 (r304636) +++ head/sys/i386/include/intr_machdep.h Mon Aug 22 21:23:17 2016 (r304637) @@ -139,8 +139,9 @@ extern cpuset_t intr_cpus; #endif extern struct mtx icu_lock; extern int elcr_found; - +#ifdef SMP extern int msix_disable_migration; +#endif #ifndef DEV_ATPIC void atpic_reset(void); Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Mon Aug 22 20:59:34 2016 (r304636) +++ head/sys/x86/x86/msi.c Mon Aug 22 21:23:17 2016 (r304637) @@ -149,6 +149,7 @@ struct pic msi_pic = { .pic_reprogram_pin = NULL, }; +#ifdef SMP /** * Xen hypervisors prior to 4.6.0 do not properly handle updates to * enabled MSI-X table entries. Allow migration of MSI-X interrupts @@ -162,6 +163,7 @@ int msix_disable_migration = -1; SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, CTLFLAG_RDTUN, &msix_disable_migration, 0, "Disable migration of MSI-X interrupts between CPUs"); +#endif static int msi_enabled; static int msi_last_irq; @@ -241,8 +243,10 @@ msi_assign_cpu(struct intsrc *isrc, u_in if (msi->msi_first != msi) return (EINVAL); +#ifdef SMP if (msix_disable_migration && msi->msi_msix) return (EINVAL); +#endif /* Store information to free existing irq. */ old_vector = msi->msi_vector; @@ -316,10 +320,12 @@ msi_init(void) return; } +#ifdef SMP if (msix_disable_migration == -1) { /* The default is to allow migration of MSI-X interrupts. */ msix_disable_migration = 0; } +#endif msi_enabled = 1; intr_register_pic(&msi_pic); Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Mon Aug 22 20:59:34 2016 (r304636) +++ head/sys/x86/xen/hvm.c Mon Aug 22 21:23:17 2016 (r304637) @@ -143,6 +143,7 @@ xen_hvm_init_hypercall_stubs(enum xen_hv printf("XEN: Hypervisor version %d.%d detected.\n", major, minor); +#ifdef SMP if (((major < 4) || (major == 4 && minor <= 5)) && msix_disable_migration == -1) { /* @@ -157,6 +158,7 @@ xen_hvm_init_hypercall_stubs(enum xen_hv "Set machdep.msix_disable_migration=0 to forcefully enable it.\n"); msix_disable_migration = 1; } +#endif } /* From owner-svn-src-head@freebsd.org Mon Aug 22 21:31:01 2016 Return-Path: Delivered-To: svn-src-head@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 B6B35BC2C48; Mon, 22 Aug 2016 21:31:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7642B1321; Mon, 22 Aug 2016 21:31:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MLV0jY026570; Mon, 22 Aug 2016 21:31:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MLUxZ0026553; Mon, 22 Aug 2016 21:30:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608222130.u7MLUxZ0026553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 22 Aug 2016 21:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304638 - in head/secure/lib/libcrypto: . amd64 arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 21:31:01 -0000 Author: jkim Date: Mon Aug 22 21:30:59 2016 New Revision: 304638 URL: https://svnweb.freebsd.org/changeset/base/304638 Log: Fix white spaces in assembly sources. Modified: head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/amd64/sha256-x86_64.S head/secure/lib/libcrypto/amd64/sha512-x86_64.S head/secure/lib/libcrypto/arm/aesv8-armx.S head/secure/lib/libcrypto/arm/armv4-gf2m.S head/secure/lib/libcrypto/arm/armv4-mont.S head/secure/lib/libcrypto/arm/bsaes-armv7.S head/secure/lib/libcrypto/arm/ghash-armv4.S head/secure/lib/libcrypto/arm/ghashv8-armx.S head/secure/lib/libcrypto/arm/sha1-armv4-large.S head/secure/lib/libcrypto/arm/sha256-armv4.S head/secure/lib/libcrypto/arm/sha512-armv4.S Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/Makefile.asm Mon Aug 22 21:30:59 2016 (r304638) @@ -73,8 +73,8 @@ ${SHA_TMP}: ${SHA_SRC} .for s in ${SHA_ASM} ${s}.S: ${s}.s - ( echo ' # $$'FreeBSD'$$' ;\ - echo ' # Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ cat ${s}.s ) > ${.TARGET} .endfor @@ -114,8 +114,8 @@ aes-armv4.S: aes-armv4.pl .pl.S: env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/} - ( echo ' # $$'FreeBSD'$$' ;\ - echo ' # Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\ + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\ cat ${.TARGET:R:S/$/.s/}) > ${.TARGET} .elif defined(ASM_i386) Modified: head/secure/lib/libcrypto/amd64/sha256-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha256-x86_64.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/amd64/sha256-x86_64.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha512-x86_64.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from sha512-x86_64.pl. .text Modified: head/secure/lib/libcrypto/amd64/sha512-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha512-x86_64.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/amd64/sha512-x86_64.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha512-x86_64.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from sha512-x86_64.pl. .text Modified: head/secure/lib/libcrypto/arm/aesv8-armx.S ============================================================================== --- head/secure/lib/libcrypto/arm/aesv8-armx.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/aesv8-armx.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from aesv8-armx.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from aesv8-armx.pl. #include "arm_arch.h" #if __ARM_MAX_ARCH__>=7 Modified: head/secure/lib/libcrypto/arm/armv4-gf2m.S ============================================================================== --- head/secure/lib/libcrypto/arm/armv4-gf2m.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/armv4-gf2m.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from armv4-gf2m.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from armv4-gf2m.pl. #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/armv4-mont.S ============================================================================== --- head/secure/lib/libcrypto/arm/armv4-mont.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/armv4-mont.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from armv4-mont.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from armv4-mont.pl. #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/bsaes-armv7.S ============================================================================== --- head/secure/lib/libcrypto/arm/bsaes-armv7.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/bsaes-armv7.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from bsaes-armv7.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from bsaes-armv7.pl. @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: head/secure/lib/libcrypto/arm/ghash-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/ghash-armv4.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/ghash-armv4.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from ghash-armv4.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from ghash-armv4.pl. #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/ghashv8-armx.S ============================================================================== --- head/secure/lib/libcrypto/arm/ghashv8-armx.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/ghashv8-armx.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from ghashv8-armx.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from ghashv8-armx.pl. #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/sha1-armv4-large.S ============================================================================== --- head/secure/lib/libcrypto/arm/sha1-armv4-large.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/sha1-armv4-large.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha1-armv4-large.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from sha1-armv4-large.pl. #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/sha256-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/sha256-armv4.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/sha256-armv4.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha256-armv4.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from sha256-armv4.pl. @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: head/secure/lib/libcrypto/arm/sha512-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/sha512-armv4.S Mon Aug 22 21:23:17 2016 (r304637) +++ head/secure/lib/libcrypto/arm/sha512-armv4.S Mon Aug 22 21:30:59 2016 (r304638) @@ -1,5 +1,5 @@ - # $FreeBSD$ - # Do not modify. This file is auto-generated from sha512-armv4.pl. +# $FreeBSD$ +# Do not modify. This file is auto-generated from sha512-armv4.pl. #include "arm_arch.h" #ifdef __ARMEL__ # define LO 0 From owner-svn-src-head@freebsd.org Mon Aug 22 21:49:25 2016 Return-Path: Delivered-To: svn-src-head@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 10A8EBC24FF; Mon, 22 Aug 2016 21:49:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC9061183; Mon, 22 Aug 2016 21:49:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MLnO8B031801; Mon, 22 Aug 2016 21:49:24 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MLnHOc031741; Mon, 22 Aug 2016 21:49:17 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608222149.u7MLnHOc031741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 22 Aug 2016 21:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304640 - in head/secure/lib/libcrypto: . amd64 arm i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 21:49:25 -0000 Author: jkim Date: Mon Aug 22 21:49:17 2016 New Revision: 304640 URL: https://svnweb.freebsd.org/changeset/base/304640 Log: Prefer C-style comments in assembly sources. Modified: head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/amd64/aes-x86_64.S head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S head/secure/lib/libcrypto/amd64/aesni-x86_64.S head/secure/lib/libcrypto/amd64/bsaes-x86_64.S head/secure/lib/libcrypto/amd64/cmll-x86_64.S head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S head/secure/lib/libcrypto/amd64/ghash-x86_64.S head/secure/lib/libcrypto/amd64/md5-x86_64.S head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S head/secure/lib/libcrypto/amd64/rc4-x86_64.S head/secure/lib/libcrypto/amd64/rsaz-avx2.S head/secure/lib/libcrypto/amd64/rsaz-x86_64.S head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha1-x86_64.S head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha256-x86_64.S head/secure/lib/libcrypto/amd64/sha512-x86_64.S head/secure/lib/libcrypto/amd64/vpaes-x86_64.S head/secure/lib/libcrypto/amd64/wp-x86_64.S head/secure/lib/libcrypto/amd64/x86_64-gf2m.S head/secure/lib/libcrypto/amd64/x86_64-mont.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/amd64/x86_64cpuid.S head/secure/lib/libcrypto/arm/aes-armv4.S head/secure/lib/libcrypto/arm/aesv8-armx.S head/secure/lib/libcrypto/arm/armv4-gf2m.S head/secure/lib/libcrypto/arm/armv4-mont.S head/secure/lib/libcrypto/arm/bsaes-armv7.S head/secure/lib/libcrypto/arm/ghash-armv4.S head/secure/lib/libcrypto/arm/ghashv8-armx.S head/secure/lib/libcrypto/arm/sha1-armv4-large.S head/secure/lib/libcrypto/arm/sha256-armv4.S head/secure/lib/libcrypto/arm/sha512-armv4.S head/secure/lib/libcrypto/i386/aes-586.S head/secure/lib/libcrypto/i386/aesni-x86.S head/secure/lib/libcrypto/i386/bf-586.S head/secure/lib/libcrypto/i386/bf-686.S head/secure/lib/libcrypto/i386/bn-586.S head/secure/lib/libcrypto/i386/cmll-x86.S head/secure/lib/libcrypto/i386/co-586.S head/secure/lib/libcrypto/i386/crypt586.S head/secure/lib/libcrypto/i386/des-586.S head/secure/lib/libcrypto/i386/ghash-x86.S head/secure/lib/libcrypto/i386/md5-586.S head/secure/lib/libcrypto/i386/rc4-586.S head/secure/lib/libcrypto/i386/rc5-586.S head/secure/lib/libcrypto/i386/rmd-586.S head/secure/lib/libcrypto/i386/sha1-586.S head/secure/lib/libcrypto/i386/sha256-586.S head/secure/lib/libcrypto/i386/sha512-586.S head/secure/lib/libcrypto/i386/vpaes-x86.S head/secure/lib/libcrypto/i386/wp-mmx.S head/secure/lib/libcrypto/i386/x86-gf2m.S head/secure/lib/libcrypto/i386/x86-mont.S head/secure/lib/libcrypto/i386/x86cpuid.S Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/Makefile.asm Mon Aug 22 21:49:17 2016 (r304640) @@ -64,8 +64,8 @@ CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} .SUFFIXES: .pl .pl.S: - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\ env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET} ${SHA_TMP}: ${SHA_SRC} @@ -73,8 +73,8 @@ ${SHA_TMP}: ${SHA_SRC} .for s in ${SHA_ASM} ${s}.S: ${s}.s - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${SHA_SRC}. */' ;\ cat ${s}.s ) > ${.TARGET} .endfor @@ -108,14 +108,14 @@ CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} .SUFFIXES: .pl aes-armv4.S: aes-armv4.pl - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.ALLSRC:T}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\ env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET} .pl.S: env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/} - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}. */' ;\ cat ${.TARGET:R:S/$/.s/}) > ${.TARGET} .elif defined(ASM_i386) @@ -183,8 +183,8 @@ CLEANFILES= ${ASM} .SUFFIXES: .pl .pl.S: - ( echo '# $$'FreeBSD'$$' ;\ - echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + ( echo '/* $$'FreeBSD'$$ */' ;\ + echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\ echo '#ifdef PIC' ;\ env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ echo '#else' ;\ Modified: head/secure/lib/libcrypto/amd64/aes-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aes-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/aes-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aes-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aes-x86_64.pl. */ .text .type _x86_64_AES_encrypt,@function .align 16 Modified: head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-gcm-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-gcm-x86_64.pl. */ .text .type _aesni_ctr32_ghash_6x,@function Modified: head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-mb-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-mb-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-sha1-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-sha1-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-sha256-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-sha256-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/aesni-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/aesni-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-x86_64.pl. */ .text .globl aesni_encrypt Modified: head/secure/lib/libcrypto/amd64/bsaes-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/bsaes-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/bsaes-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bsaes-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bsaes-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/cmll-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/cmll-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/cmll-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from cmll-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from cmll-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ecp_nistz256-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ecp_nistz256-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/ghash-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/ghash-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/ghash-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ghash-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghash-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/md5-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/md5-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/md5-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from md5-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from md5-x86_64.pl. */ .text .align 16 Modified: head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc4-md5-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc4-md5-x86_64.pl. */ .text .align 16 Modified: head/secure/lib/libcrypto/amd64/rc4-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/rc4-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/rc4-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc4-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc4-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/rsaz-avx2.S ============================================================================== --- head/secure/lib/libcrypto/amd64/rsaz-avx2.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/rsaz-avx2.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rsaz-avx2.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rsaz-avx2.pl. */ .text .globl rsaz_1024_sqr_avx2 Modified: head/secure/lib/libcrypto/amd64/rsaz-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/rsaz-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/rsaz-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rsaz-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rsaz-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-mb-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-mb-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/sha1-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha1-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/sha1-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha256-mb-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha256-mb-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/sha256-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha256-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/sha256-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha512-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/sha512-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/sha512-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/sha512-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha512-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/vpaes-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/vpaes-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/vpaes-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from vpaes-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from vpaes-x86_64.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/wp-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/wp-x86_64.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/wp-x86_64.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from wp-x86_64.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from wp-x86_64.pl. */ .text .globl whirlpool_block Modified: head/secure/lib/libcrypto/amd64/x86_64-gf2m.S ============================================================================== --- head/secure/lib/libcrypto/amd64/x86_64-gf2m.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/x86_64-gf2m.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64-gf2m.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64-gf2m.pl. */ .text .type _mul_1x1,@function Modified: head/secure/lib/libcrypto/amd64/x86_64-mont.S ============================================================================== --- head/secure/lib/libcrypto/amd64/x86_64-mont.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/x86_64-mont.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64-mont.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64-mont.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/x86_64-mont5.S ============================================================================== --- head/secure/lib/libcrypto/amd64/x86_64-mont5.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/x86_64-mont5.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64-mont5.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64-mont5.pl. */ .text Modified: head/secure/lib/libcrypto/amd64/x86_64cpuid.S ============================================================================== --- head/secure/lib/libcrypto/amd64/x86_64cpuid.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/amd64/x86_64cpuid.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86_64cpuid.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86_64cpuid.pl. */ .hidden OPENSSL_cpuid_setup .section .init Modified: head/secure/lib/libcrypto/arm/aes-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/aes-armv4.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/aes-armv4.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aes-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aes-armv4.pl. */ @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: head/secure/lib/libcrypto/arm/aesv8-armx.S ============================================================================== --- head/secure/lib/libcrypto/arm/aesv8-armx.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/aesv8-armx.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesv8-armx.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesv8-armx.pl. */ #include "arm_arch.h" #if __ARM_MAX_ARCH__>=7 Modified: head/secure/lib/libcrypto/arm/armv4-gf2m.S ============================================================================== --- head/secure/lib/libcrypto/arm/armv4-gf2m.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/armv4-gf2m.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from armv4-gf2m.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from armv4-gf2m.pl. */ #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/armv4-mont.S ============================================================================== --- head/secure/lib/libcrypto/arm/armv4-mont.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/armv4-mont.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from armv4-mont.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from armv4-mont.pl. */ #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/bsaes-armv7.S ============================================================================== --- head/secure/lib/libcrypto/arm/bsaes-armv7.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/bsaes-armv7.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bsaes-armv7.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bsaes-armv7.pl. */ @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: head/secure/lib/libcrypto/arm/ghash-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/ghash-armv4.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/ghash-armv4.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ghash-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghash-armv4.pl. */ #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/ghashv8-armx.S ============================================================================== --- head/secure/lib/libcrypto/arm/ghashv8-armx.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/ghashv8-armx.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ghashv8-armx.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghashv8-armx.pl. */ #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/sha1-armv4-large.S ============================================================================== --- head/secure/lib/libcrypto/arm/sha1-armv4-large.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/sha1-armv4-large.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-armv4-large.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-armv4-large.pl. */ #include "arm_arch.h" .text Modified: head/secure/lib/libcrypto/arm/sha256-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/sha256-armv4.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/sha256-armv4.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha256-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha256-armv4.pl. */ @ ==================================================================== @ Written by Andy Polyakov for the OpenSSL Modified: head/secure/lib/libcrypto/arm/sha512-armv4.S ============================================================================== --- head/secure/lib/libcrypto/arm/sha512-armv4.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/arm/sha512-armv4.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha512-armv4.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-armv4.pl. */ #include "arm_arch.h" #ifdef __ARMEL__ # define LO 0 Modified: head/secure/lib/libcrypto/i386/aes-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/aes-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/aes-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aes-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aes-586.pl. */ #ifdef PIC .file "aes-586.S" .text Modified: head/secure/lib/libcrypto/i386/aesni-x86.S ============================================================================== --- head/secure/lib/libcrypto/i386/aesni-x86.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/aesni-x86.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from aesni-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from aesni-x86.pl. */ #ifdef PIC .file "aesni-x86.S" .text Modified: head/secure/lib/libcrypto/i386/bf-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/bf-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/bf-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bf-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bf-586.pl. */ #ifdef PIC .file "bf-586.S" .text Modified: head/secure/lib/libcrypto/i386/bf-686.S ============================================================================== --- head/secure/lib/libcrypto/i386/bf-686.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/bf-686.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bf-686.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bf-686.pl. */ #ifdef PIC .file "bf-686.S" .text Modified: head/secure/lib/libcrypto/i386/bn-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/bn-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/bn-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from bn-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from bn-586.pl. */ #ifdef PIC .file "bn-586.S" .text Modified: head/secure/lib/libcrypto/i386/cmll-x86.S ============================================================================== --- head/secure/lib/libcrypto/i386/cmll-x86.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/cmll-x86.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from cmll-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from cmll-x86.pl. */ #ifdef PIC .file "cmll-x86.S" .text Modified: head/secure/lib/libcrypto/i386/co-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/co-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/co-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from co-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from co-586.pl. */ #ifdef PIC .file "co-586.S" .text Modified: head/secure/lib/libcrypto/i386/crypt586.S ============================================================================== --- head/secure/lib/libcrypto/i386/crypt586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/crypt586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from crypt586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from crypt586.pl. */ #ifdef PIC .file "crypt586.S" .text Modified: head/secure/lib/libcrypto/i386/des-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/des-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/des-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from des-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from des-586.pl. */ #ifdef PIC .file "des-586.S" .text Modified: head/secure/lib/libcrypto/i386/ghash-x86.S ============================================================================== --- head/secure/lib/libcrypto/i386/ghash-x86.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/ghash-x86.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from ghash-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from ghash-x86.pl. */ #ifdef PIC .file "ghash-x86.S" .text Modified: head/secure/lib/libcrypto/i386/md5-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/md5-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/md5-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from md5-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from md5-586.pl. */ #ifdef PIC .file "md5-586.S" .text Modified: head/secure/lib/libcrypto/i386/rc4-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/rc4-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/rc4-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc4-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc4-586.pl. */ #ifdef PIC .file "rc4-586.S" .text Modified: head/secure/lib/libcrypto/i386/rc5-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/rc5-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/rc5-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rc5-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rc5-586.pl. */ #ifdef PIC .file "rc5-586.S" .text Modified: head/secure/lib/libcrypto/i386/rmd-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/rmd-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/rmd-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from rmd-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from rmd-586.pl. */ #ifdef PIC .file "rmd-586.S" .text Modified: head/secure/lib/libcrypto/i386/sha1-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/sha1-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/sha1-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha1-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha1-586.pl. */ #ifdef PIC .file "sha1-586.S" .text Modified: head/secure/lib/libcrypto/i386/sha256-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/sha256-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/sha256-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha256-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha256-586.pl. */ #ifdef PIC .file "sha256-586.S" .text Modified: head/secure/lib/libcrypto/i386/sha512-586.S ============================================================================== --- head/secure/lib/libcrypto/i386/sha512-586.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/sha512-586.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from sha512-586.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from sha512-586.pl. */ #ifdef PIC .file "sha512-586.S" .text Modified: head/secure/lib/libcrypto/i386/vpaes-x86.S ============================================================================== --- head/secure/lib/libcrypto/i386/vpaes-x86.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/vpaes-x86.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from vpaes-x86.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from vpaes-x86.pl. */ #ifdef PIC .file "vpaes-x86.S" .text Modified: head/secure/lib/libcrypto/i386/wp-mmx.S ============================================================================== --- head/secure/lib/libcrypto/i386/wp-mmx.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/wp-mmx.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from wp-mmx.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from wp-mmx.pl. */ #ifdef PIC .file "wp-mmx.S" .text Modified: head/secure/lib/libcrypto/i386/x86-gf2m.S ============================================================================== --- head/secure/lib/libcrypto/i386/x86-gf2m.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/x86-gf2m.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86-gf2m.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86-gf2m.pl. */ #ifdef PIC .file "x86-gf2m.S" .text Modified: head/secure/lib/libcrypto/i386/x86-mont.S ============================================================================== --- head/secure/lib/libcrypto/i386/x86-mont.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/x86-mont.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86-mont.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86-mont.pl. */ #ifdef PIC .file "x86-mont.S" .text Modified: head/secure/lib/libcrypto/i386/x86cpuid.S ============================================================================== --- head/secure/lib/libcrypto/i386/x86cpuid.S Mon Aug 22 21:40:51 2016 (r304639) +++ head/secure/lib/libcrypto/i386/x86cpuid.S Mon Aug 22 21:49:17 2016 (r304640) @@ -1,5 +1,5 @@ -# $FreeBSD$ -# Do not modify. This file is auto-generated from x86cpuid.pl. +/* $FreeBSD$ */ +/* Do not modify. This file is auto-generated from x86cpuid.pl. */ #ifdef PIC .file "x86cpuid.S" .text From owner-svn-src-head@freebsd.org Mon Aug 22 22:28:42 2016 Return-Path: Delivered-To: svn-src-head@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 DD164BC2D4A; Mon, 22 Aug 2016 22:28:42 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8F8ED14E7; Mon, 22 Aug 2016 22:28:42 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMSfvV046609; Mon, 22 Aug 2016 22:28:41 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMSfkx046607; Mon, 22 Aug 2016 22:28:41 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608222228.u7MMSfkx046607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Mon, 22 Aug 2016 22:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304641 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:28:43 -0000 Author: ache Date: Mon Aug 22 22:28:41 2016 New Revision: 304641 URL: https://svnweb.freebsd.org/changeset/base/304641 Log: 1) Back out r304607 case 2). fgetwln() as its pair fgetln() supposed to return partial line on any errors. See the comment in fgetln.c. Add corresponding comment to fgetwln() too. 2) Rewrite r304607 case 1). 3) Remove "Fast path" from __fgetwc_mbs() since it can't detect encoding errors and ignores them all. PR: 212033 MFC after: 7 days Modified: head/lib/libc/stdio/fgetwc.c head/lib/libc/stdio/fgetwln.c Modified: head/lib/libc/stdio/fgetwc.c ============================================================================== --- head/lib/libc/stdio/fgetwc.c Mon Aug 22 21:49:17 2016 (r304640) +++ head/lib/libc/stdio/fgetwc.c Mon Aug 22 22:28:41 2016 (r304641) @@ -79,18 +79,9 @@ __fgetwc_mbs(FILE *fp, mbstate_t *mbs, i size_t nconv; struct xlocale_ctype *l = XLOCALE_CTYPE(locale); - if (fp->_r <= 0 && __srefill(fp)) { - *nread = 0; - return (WEOF); - } - if (MB_CUR_MAX == 1) { - /* Fast path for single-byte encodings. */ - wc = *fp->_p++; - fp->_r--; - *nread = 1; - return (wc); - } *nread = 0; + if (fp->_r <= 0 && __srefill(fp)) + return (WEOF); do { nconv = l->__mbrtowc(&wc, fp->_p, fp->_r, mbs); if (nconv == (size_t)-1) Modified: head/lib/libc/stdio/fgetwln.c ============================================================================== --- head/lib/libc/stdio/fgetwln.c Mon Aug 22 21:49:17 2016 (r304640) +++ head/lib/libc/stdio/fgetwln.c Mon Aug 22 22:28:41 2016 (r304641) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include #include #include #include "un-namespace.h" @@ -48,39 +47,32 @@ fgetwln_l(FILE * __restrict fp, size_t * { wint_t wc; size_t len; - int saverrno; FIX_LOCALE(locale); FLOCKFILE(fp); ORIENT(fp, 1); len = 0; - saverrno = errno; - errno = 0; + /* WEOF or error: return partial line, see fgetln(3). */ while ((wc = __fgetwc(fp, locale)) != WEOF) { #define GROW 512 if (len * sizeof(wchar_t) >= fp->_lb._size && - __slbexpand(fp, (len + GROW) * sizeof(wchar_t))) + __slbexpand(fp, (len + GROW) * sizeof(wchar_t))) { + fp->_flags |= __SERR; goto error; + } *((wchar_t *)fp->_lb._base + len++) = wc; if (wc == L'\n') break; - errno = 0; } - if (wc == WEOF && errno != 0) - goto error; - if (errno == 0) - errno = saverrno; if (len == 0) - goto eof; + goto error; FUNLOCKFILE(fp); *lenp = len; return ((wchar_t *)fp->_lb._base); error: - fp->_flags |= __SERR; -eof: FUNLOCKFILE(fp); *lenp = 0; return (NULL); From owner-svn-src-head@freebsd.org Mon Aug 22 22:50:59 2016 Return-Path: Delivered-To: svn-src-head@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 55461BC2A54; Mon, 22 Aug 2016 22:50:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F2B1BFC; Mon, 22 Aug 2016 22:50:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMowF6054230; Mon, 22 Aug 2016 22:50:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMowVV054229; Mon, 22 Aug 2016 22:50:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222250.u7MMowVV054229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 22:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304643 - head/share/i18n/esdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:50:59 -0000 Author: bdrewery Date: Mon Aug 22 22:50:58 2016 New Revision: 304643 URL: https://svnweb.freebsd.org/changeset/base/304643 Log: Fix building on read-only source trees. This partially reverts r296702 and reworks the original check to only look in .CURDIR. This avoids ever trying to rebuild a .src file that is already in the source tree as an override. PR: 211952 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/i18n/esdb/Makefile.part Modified: head/share/i18n/esdb/Makefile.part ============================================================================== --- head/share/i18n/esdb/Makefile.part Mon Aug 22 22:29:57 2016 (r304642) +++ head/share/i18n/esdb/Makefile.part Mon Aug 22 22:50:58 2016 (r304643) @@ -67,9 +67,11 @@ codesets: ${ESDB} .if !defined(NO_PREPROC) .for i in ${PART} +.if !exists(${.CURDIR}/${EPREFIX}${i:S/:/@/}.src) ${EPREFIX}${i:S/:/@/}.src: ${CODE}.src sed ${SED_EXP:S@%%PART%%@${i}@} ${.ALLSRC} > ${.TARGET} @echo ${.TARGET} >>.tmpfiles +.endif .endfor .endif From owner-svn-src-head@freebsd.org Mon Aug 22 22:51:02 2016 Return-Path: Delivered-To: svn-src-head@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 A401ABC2A76; Mon, 22 Aug 2016 22:51:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69D5D1C22; Mon, 22 Aug 2016 22:51:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMp1Rc054292; Mon, 22 Aug 2016 22:51:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMp1Z5054291; Mon, 22 Aug 2016 22:51:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222251.u7MMp1Z5054291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 22:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304644 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:51:02 -0000 Author: bdrewery Date: Mon Aug 22 22:51:01 2016 New Revision: 304644 URL: https://svnweb.freebsd.org/changeset/base/304644 Log: Stop using _SUBDIR internally for non-SUBDIR_PARALLEL builds. This is unifying more of the logic. Rather than create targets such as 'all: all_subdir_foo' when using SUBDIR_PARALLEL and using 'all: _SUBDIR' when not using SUBDIR_PARALLEL, always use the expanded out _subdir_ pattern. When not using SUBDIR_PARALLEL, have each directory-target depend on the previously defined targets as to respect the *order* of SUBDIR. Using 'make -N' now prints all directory traversals individually rather than using a loop, since a loop is no longer used to traverse. This is part of an effort to cleanup handling of some edge cases involving 'make ' and making it simpler in the sense that the pattern used to build is the same for all modes. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Mon Aug 22 22:50:58 2016 (r304643) +++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:01 2016 (r304644) @@ -114,6 +114,8 @@ _SUBDIR_SH= \ cd ${.CURDIR}/$${dir}; \ ${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/ +# This is kept for compatibility only. The normal handling of attaching to +# SUBDIR_TARGETS will create a target for each directory. _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}target=${.TARGET:realinstall=install}; \ @@ -139,29 +141,31 @@ SUBDIR:= ${SUBDIR:N.WAIT} .else _is_standalone_target= 0 .endif -.if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} .if ${__dir} == .WAIT __subdir_targets+= .WAIT .else -__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir} __deps= .if ${_is_standalone_target} == 0 +.if defined(SUBDIR_PARALLEL) +# Apply SUBDIR_DEPEND dependencies for SUBDIR_PARALLEL. .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${DIRPRFX}${__dep} .endfor -.endif +.else +# For non-parallel builds, directories depend on all targets before them. +__deps:= ${__subdir_targets} +.endif # defined(SUBDIR_PARALLEL) +.endif # ${_is_standalone_target} == 0 ${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE .SILENT ${__deps} @${_+_}target=${__target:realinstall=install}; \ dir=${__dir}; \ ${_SUBDIR_SH}; -.endif +__subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir} +.endif # ${__dir} == .WAIT .endfor # __dir in ${SUBDIR} ${__target}: ${__subdir_targets} .PHONY -.else -${__target}: _SUBDIR .PHONY -.endif # SUBDIR_PARALLEL || _is_standalone_target .endif # make(${__target}) .endfor # __target in ${SUBDIR_TARGETS} From owner-svn-src-head@freebsd.org Mon Aug 22 22:51:05 2016 Return-Path: Delivered-To: svn-src-head@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 DCE2DBC2A95; Mon, 22 Aug 2016 22:51:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1801CFC; Mon, 22 Aug 2016 22:51:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMp4vV054338; Mon, 22 Aug 2016 22:51:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMp4xZ054337; Mon, 22 Aug 2016 22:51:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222251.u7MMp4xZ054337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 22:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304645 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:51:06 -0000 Author: bdrewery Date: Mon Aug 22 22:51:04 2016 New Revision: 304645 URL: https://svnweb.freebsd.org/changeset/base/304645 Log: Always define the various _subdir_ targets, even if not used. This is part of an effort to cleanup handling of some edge cases involving 'make '. It also provides the targets for other uses. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:01 2016 (r304644) +++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:04 2016 (r304645) @@ -128,12 +128,6 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE ${_SUBDIR_SH}; .for __target in ${SUBDIR_TARGETS} -# Only recurse on directly-called targets. I.e., don't recurse on dependencies -# such as 'install' becoming {before,real,after}install, just recurse -# 'install'. Despite that, 'realinstall' is special due to ordering issues -# with 'afterinstall'. -.if !defined(NO_SUBDIR) && (make(${__target}) || \ - (${__target} == realinstall && make(install))) # Can ordering be skipped for this and SUBDIR_PARALLEL forced? .if ${STANDALONE_SUBDIR_TARGETS:M${__target}} _is_standalone_target= 1 @@ -165,6 +159,14 @@ ${__target}_subdir_${DIRPRFX}${__dir}: . __subdir_targets+= ${__target}_subdir_${DIRPRFX}${__dir} .endif # ${__dir} == .WAIT .endfor # __dir in ${SUBDIR} + +# Attach the subdir targets to the real target. +# Only recurse on directly-called targets. I.e., don't recurse on dependencies +# such as 'install' becoming {before,real,after}install, just recurse +# 'install'. Despite that, 'realinstall' is special due to ordering issues +# with 'afterinstall'. +.if !defined(NO_SUBDIR) && (make(${__target}) || \ + (${__target} == realinstall && make(install))) ${__target}: ${__subdir_targets} .PHONY .endif # make(${__target}) .endfor # __target in ${SUBDIR_TARGETS} From owner-svn-src-head@freebsd.org Mon Aug 22 22:51:08 2016 Return-Path: Delivered-To: svn-src-head@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 EA7B6BC2AB8; Mon, 22 Aug 2016 22:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A08BE1DCE; Mon, 22 Aug 2016 22:51:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMp72b054385; Mon, 22 Aug 2016 22:51:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMp7UT054384; Mon, 22 Aug 2016 22:51:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222251.u7MMp7UT054384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 22:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304646 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:51:09 -0000 Author: bdrewery Date: Mon Aug 22 22:51:07 2016 New Revision: 304646 URL: https://svnweb.freebsd.org/changeset/base/304646 Log: For 'make ' hook into the all_subdir_ targets. This fixes parallel build issues when trying to depend on ${SUBDIR}. An example of this in share/i18n/csmapper/Makefile where mapper.dir depends on ${SUBDIR} having been traversed and built already. Before this change running make in that directory would build the subdirectories twice. This led to obscure build races. While reworking that build may be possible, the framework should not so easily allow creating such problems. Now depending on will properly redirect to the all_subdir_ target rather than invoking the inline shell. This also makes 'make -jX ' now respect any SUBDIR_DEPEND_ statements when SUBDIR_PARALLEL is defined. This is not entirely intended and may be changed later. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:04 2016 (r304645) +++ head/share/mk/bsd.subdir.mk Mon Aug 22 22:51:07 2016 (r304646) @@ -122,10 +122,10 @@ _SUBDIR: .USEBEFORE for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif -${SUBDIR:N.WAIT}: .PHONY .MAKE - ${_+_}@target=all; \ - dir=${.TARGET}; \ - ${_SUBDIR_SH}; +# Create 'make subdir' targets to run the real 'all' target. +.for __dir in ${SUBDIR:N.WAIT} +${__dir}: all_subdir_${DIRPRFX}${__dir} .PHONY +.endfor .for __target in ${SUBDIR_TARGETS} # Can ordering be skipped for this and SUBDIR_PARALLEL forced? From owner-svn-src-head@freebsd.org Mon Aug 22 22:51:11 2016 Return-Path: Delivered-To: svn-src-head@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 DF49CBC2BCA; Mon, 22 Aug 2016 22:51:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D79D1EC5; Mon, 22 Aug 2016 22:51:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MMpArG054430; Mon, 22 Aug 2016 22:51:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MMpAha054429; Mon, 22 Aug 2016 22:51:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608222251.u7MMpAha054429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 22 Aug 2016 22:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304647 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 22:51:12 -0000 Author: bdrewery Date: Mon Aug 22 22:51:10 2016 New Revision: 304647 URL: https://svnweb.freebsd.org/changeset/base/304647 Log: Rename ORDERED to BOOTSTRAP since no order is respected in the list. The directories in SUBDIR_ORDERED are built in parallel, so the name is misleading. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Aug 22 22:51:07 2016 (r304646) +++ head/lib/Makefile Mon Aug 22 22:51:10 2016 (r304647) @@ -3,12 +3,13 @@ .include -# The SUBDIR_ORDERED list is a small set of libraries which are used by many +# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many # of the other libraries. These are built first with a .WAIT between them # and the main list to avoid needing a SUBDIR_DEPEND line on every library # naming just these few items. -SUBDIR_ORDERED= csu \ +SUBDIR_BOOTSTRAP= \ + csu \ .WAIT \ libc \ libc_nonshared \ @@ -21,7 +22,7 @@ SUBDIR_ORDERED= csu \ # The main list; please keep these sorted alphabetically. -SUBDIR= ${SUBDIR_ORDERED} \ +SUBDIR= ${SUBDIR_BOOTSTRAP} \ .WAIT \ libalias \ libarchive \ From owner-svn-src-head@freebsd.org Tue Aug 23 00:46:23 2016 Return-Path: Delivered-To: svn-src-head@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 EC1DBBB7B24; Tue, 23 Aug 2016 00:46:23 +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 BB84318DE; Tue, 23 Aug 2016 00:46:23 +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 u7N0kMg0098588; Tue, 23 Aug 2016 00:46:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N0kMdK098587; Tue, 23 Aug 2016 00:46:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608230046.u7N0kMdK098587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 23 Aug 2016 00:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304649 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 00:46:24 -0000 Author: manu Date: Tue Aug 23 00:46:22 2016 New Revision: 304649 URL: https://svnweb.freebsd.org/changeset/base/304649 Log: Do not include file from dt-bindings and simply use the already present defines. Reported by: jmcneill MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Tue Aug 23 00:00:06 2016 (r304648) +++ head/sys/arm/allwinner/a10_gpio.c Tue Aug 23 00:46:22 2016 (r304649) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #if defined(__aarch64__) #include "opt_soc.h" #endif @@ -602,8 +600,8 @@ aw_fdt_configure_pins(device_t dev, phan if (a10_gpio_get_drv(sc, pin_num) != pin_drive) a10_gpio_set_drv(sc, pin_num, pin_drive); if (a10_gpio_get_pud(sc, pin_num) != pin_pull && - (pin_pull == SUN4I_PINCTRL_PULL_UP || - pin_pull == SUN4I_PINCTRL_PULL_DOWN)) + (pin_pull == A10_GPIO_PULLUP || + pin_pull == A10_GPIO_PULLDOWN)) a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } From owner-svn-src-head@freebsd.org Tue Aug 23 01:40:46 2016 Return-Path: Delivered-To: svn-src-head@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 D0B63BC06DF; Tue, 23 Aug 2016 01:40:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D3971C60; Tue, 23 Aug 2016 01:40:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N1ejfY017794; Tue, 23 Aug 2016 01:40:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N1ejWr017792; Tue, 23 Aug 2016 01:40:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608230140.u7N1ejWr017792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 23 Aug 2016 01:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304650 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 01:40:46 -0000 Author: pfg Date: Tue Aug 23 01:40:45 2016 New Revision: 304650 URL: https://svnweb.freebsd.org/changeset/base/304650 Log: indent(1): Fix memory leaks pointed out by clang-analyzer. Shift the responsibility of allocating memory for the string duplicate from the caller (set_option, add_typedefs_from_file) to the callee (add_typename) as it has more knowledge about when the duplication actually needs to occur. Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/args.c head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/args.c ============================================================================== --- head/usr.bin/indent/args.c Tue Aug 23 00:46:22 2016 (r304649) +++ head/usr.bin/indent/args.c Tue Aug 23 01:40:45 2016 (r304650) @@ -294,12 +294,7 @@ found: case KEY: if (*param_start == 0) goto need_param; - { - char *str = strdup(param_start); - if (str == NULL) - err(1, NULL); - add_typename(str); - } + add_typename(param_start); break; case KEY_FILE: @@ -342,7 +337,6 @@ add_typedefs_from_file(const char *str) { FILE *file; char line[BUFSIZ]; - char *copy; if ((file = fopen(str, "r")) == NULL) { fprintf(stderr, "indent: cannot open file %s\n", str); @@ -351,10 +345,7 @@ add_typedefs_from_file(const char *str) while ((fgets(line, BUFSIZ, file)) != NULL) { /* Remove trailing whitespace */ line[strcspn(line, " \t\n\r")] = '\0'; - if ((copy = strdup(line)) == NULL) { - err(1, NULL); - } - add_typename(copy); + add_typename(line); } fclose(file); } Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Tue Aug 23 00:46:22 2016 (r304649) +++ head/usr.bin/indent/lexi.c Tue Aug 23 01:40:45 2016 (r304650) @@ -594,6 +594,7 @@ void add_typename(const char *key) { int comparison; + const char *copy; if (typename_top + 1 >= typename_count) { typenames = realloc((void *)typenames, @@ -602,11 +603,12 @@ add_typename(const char *key) err(1, NULL); } if (typename_top == -1) - typenames[++typename_top] = key; + typenames[++typename_top] = copy = strdup(key); else if ((comparison = strcmp(key, typenames[typename_top])) >= 0) { /* take advantage of sorted input */ - if (comparison != 0) /* remove duplicates */ - typenames[++typename_top] = key; + if (comparison == 0) /* remove duplicates */ + return; + typenames[++typename_top] = copy = strdup(key); } else { int p; @@ -617,6 +619,9 @@ add_typename(const char *key) return; memmove(&typenames[p + 1], &typenames[p], sizeof(typenames[0]) * (++typename_top - p)); - typenames[p] = key; + typenames[p] = copy = strdup(key); } + + if (copy == NULL) + err(1, NULL); } From owner-svn-src-head@freebsd.org Tue Aug 23 01:58:04 2016 Return-Path: Delivered-To: svn-src-head@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 369D0BC0F4A; Tue, 23 Aug 2016 01:58:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06CD3178E; Tue, 23 Aug 2016 01:58:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N1w3g6025160; Tue, 23 Aug 2016 01:58:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N1w3Tw025158; Tue, 23 Aug 2016 01:58:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608230158.u7N1w3Tw025158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 23 Aug 2016 01:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304651 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 01:58:04 -0000 Author: pfg Date: Tue Aug 23 01:58:02 2016 New Revision: 304651 URL: https://svnweb.freebsd.org/changeset/base/304651 Log: indent(1): add some comments to quiet down Coverity. Hopefully adding comments should help explain the code to both static checkers and humans. CID: 976543, 976544, 976545 Obtained from: Piotr Stephaniak Modified: head/usr.bin/indent/io.c head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Tue Aug 23 01:40:45 2016 (r304650) +++ head/usr.bin/indent/io.c Tue Aug 23 01:58:02 2016 (r304651) @@ -200,6 +200,7 @@ dump_line(void) break; case '\\': putc('\\', output); + /* add a backslash to escape the '\' */ default: putc(*follow, output); } Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Tue Aug 23 01:40:45 2016 (r304650) +++ head/usr.bin/indent/parse.c Tue Aug 23 01:58:02 2016 (r304651) @@ -95,6 +95,7 @@ parse(int tk) /* tk: the code for the co case ifstmt: /* scanned if (...) */ if (ps.p_stack[ps.tos] == elsehead && ps.else_if) /* "else if ..." */ ps.i_l_follow = ps.il[ps.tos]; + /* the rest is the same as for dolit and forstmt */ case dolit: /* 'do' */ case forstmt: /* for (...) */ ps.p_stack[++ps.tos] = tk; @@ -301,7 +302,7 @@ reduce(void) case swstmt: /* */ case_ind = ps.cstk[ps.tos - 1]; - + /* FALLTHROUGH */ case decl: /* finish of a declaration */ case elsehead: /* < else> */ From owner-svn-src-head@freebsd.org Tue Aug 23 02:06:21 2016 Return-Path: Delivered-To: svn-src-head@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 BBA84BC141D; Tue, 23 Aug 2016 02:06:21 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8E83A1D55; Tue, 23 Aug 2016 02:06:21 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N26KKf028738; Tue, 23 Aug 2016 02:06:20 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N26KK3028737; Tue, 23 Aug 2016 02:06:20 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201608230206.u7N26KK3028737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Tue, 23 Aug 2016 02:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304652 - head/sbin/resolvconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 02:06:21 -0000 Author: badger Date: Tue Aug 23 02:06:20 2016 New Revision: 304652 URL: https://svnweb.freebsd.org/changeset/base/304652 Log: Fix missing substitution of @SBINDIR@ in resolvconf scripts Certain features, such as resolv_conf_passthrough=NULL, do not work correctly due to this missing substitution. Also remove the @PREFIX@ substitution, which is no longer needed. Reviewed by: pfg Approved by: vangyzen (mentor) MFC after: 1 week Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7572 Modified: head/sbin/resolvconf/Makefile Modified: head/sbin/resolvconf/Makefile ============================================================================== --- head/sbin/resolvconf/Makefile Tue Aug 23 01:58:02 2016 (r304651) +++ head/sbin/resolvconf/Makefile Tue Aug 23 02:06:20 2016 (r304652) @@ -16,6 +16,7 @@ CLEANFILES= ${SCRIPTS} ${FILES} ${MAN} SYSCONFDIR= /etc RCDIR= ${SYSCONFDIR}/rc.d VARDIR= /var/run/resolvconf +SBINDIR= /sbin # We don't assume to restart the services in /sbin. So, though # our service(8) is in /usr/sbin, we can use it, here. @@ -28,13 +29,13 @@ RESTARTCMD= "/usr/sbin/service ${CMD1} \ .for f in ${SCRIPTS} ${FILES} ${MAN} ${f}: ${f}.in - sed -e 's:@PREFIX@::g' \ - -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ + sed -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ -e 's:@VARDIR@:${VARDIR}:g' \ -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \ -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \ -e 's:@RCDIR@:${RCDIR}:g' \ + -e 's:@SBINDIR@:${SBINDIR}:g' \ -e 's: vpn : ng[0-9]*&:g' \ ${DIST}/$@.in > $@ .endfor From owner-svn-src-head@freebsd.org Tue Aug 23 02:07:09 2016 Return-Path: Delivered-To: svn-src-head@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 3A604BC14F6; Tue, 23 Aug 2016 02:07:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ADAC1ECC; Tue, 23 Aug 2016 02:07:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N278J3028811; Tue, 23 Aug 2016 02:07:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N278NI028810; Tue, 23 Aug 2016 02:07:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608230207.u7N278NI028810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 23 Aug 2016 02:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304653 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 02:07:09 -0000 Author: pfg Date: Tue Aug 23 02:07:08 2016 New Revision: 304653 URL: https://svnweb.freebsd.org/changeset/base/304653 Log: indent(1): Fix off-by-one in control flow leading dead code. Coverity correctly reported that it's impossible for /comparison/ to be 0 here, because the only way for the for loop to end is by /comparison/ being < 0. Fortunately the consequences of this bug weren't severe; for duplicated entries in the typedef names file it would unnecessarily duplicate strings with strdup(), but pointers to those would replace existing ones. So this was a memory leak at worst. CID: 1361477 Obtained from: Piotr Stephaniak Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Tue Aug 23 02:06:20 2016 (r304652) +++ head/usr.bin/indent/lexi.c Tue Aug 23 02:07:08 2016 (r304653) @@ -613,7 +613,7 @@ add_typename(const char *key) else { int p; - for (p = 0; (comparison = strcmp(key, typenames[p])) >= 0; p++) + for (p = 0; (comparison = strcmp(key, typenames[p])) > 0; p++) /* find place for the new key */; if (comparison == 0) /* remove duplicates */ return; From owner-svn-src-head@freebsd.org Tue Aug 23 02:54:08 2016 Return-Path: Delivered-To: svn-src-head@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 630FBBC20A3; Tue, 23 Aug 2016 02:54:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2F43F1940; Tue, 23 Aug 2016 02:54:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N2s7hI047250; Tue, 23 Aug 2016 02:54:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N2s7fi047247; Tue, 23 Aug 2016 02:54:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608230254.u7N2s7fi047247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 23 Aug 2016 02:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304654 - in head/sys: dev/usb/net net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 02:54:08 -0000 Author: sephe Date: Tue Aug 23 02:54:06 2016 New Revision: 304654 URL: https://svnweb.freebsd.org/changeset/base/304654 Log: net: Split RNDIS protocol structs/macros out of dev/usb/net/if_urndisreg.h So that Hyper-V can leverage them instead of rolling its own definition. Discussed with: hps Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7592 Added: head/sys/net/rndis.h (contents, props changed) Modified: head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/net/if_urndisreg.h Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Tue Aug 23 02:07:08 2016 (r304653) +++ head/sys/dev/usb/net/if_urndis.c Tue Aug 23 02:54:06 2016 (r304654) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -79,17 +80,17 @@ static uether_fn_t urndis_setmulti; static uether_fn_t urndis_setpromisc; static uint32_t urndis_ctrl_query(struct urndis_softc *sc, uint32_t oid, - struct urndis_query_req *msg, uint16_t len, + struct rndis_query_req *msg, uint16_t len, const void **rbuf, uint16_t *rbufsz); static uint32_t urndis_ctrl_set(struct urndis_softc *sc, uint32_t oid, - struct urndis_set_req *msg, uint16_t len); + struct rndis_set_req *msg, uint16_t len); static uint32_t urndis_ctrl_handle_init(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr); + const struct rndis_comp_hdr *hdr); static uint32_t urndis_ctrl_handle_query(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr, const void **buf, + const struct rndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz); static uint32_t urndis_ctrl_handle_reset(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr); + const struct rndis_comp_hdr *hdr); static uint32_t urndis_ctrl_init(struct urndis_softc *sc); static uint32_t urndis_ctrl_halt(struct urndis_softc *sc); @@ -212,8 +213,8 @@ urndis_attach(device_t dev) { static struct { union { - struct urndis_query_req query; - struct urndis_set_req set; + struct rndis_query_req query; + struct rndis_set_req set; } hdr; union { uint8_t eaddr[ETHER_ADDR_LEN]; @@ -453,10 +454,10 @@ urndis_ctrl_send(struct urndis_softc *sc return (err); } -static struct urndis_comp_hdr * +static struct rndis_comp_hdr * urndis_ctrl_recv(struct urndis_softc *sc) { - struct urndis_comp_hdr *hdr; + struct rndis_comp_hdr *hdr; usb_error_t err; err = urndis_ctrl_msg(sc, UT_READ_CLASS_INTERFACE, @@ -466,7 +467,7 @@ urndis_ctrl_recv(struct urndis_softc *sc if (err != USB_ERR_NORMAL_COMPLETION) return (NULL); - hdr = (struct urndis_comp_hdr *)sc->sc_response_buf; + hdr = (struct rndis_comp_hdr *)sc->sc_response_buf; DPRINTF("type 0x%x len %u\n", le32toh(hdr->rm_type), le32toh(hdr->rm_len)); @@ -480,7 +481,7 @@ urndis_ctrl_recv(struct urndis_softc *sc } static uint32_t -urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr, +urndis_ctrl_handle(struct urndis_softc *sc, struct rndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz) { uint32_t rval; @@ -521,11 +522,11 @@ urndis_ctrl_handle(struct urndis_softc * static uint32_t urndis_ctrl_handle_init(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr) + const struct rndis_comp_hdr *hdr) { - const struct urndis_init_comp *msg; + const struct rndis_init_comp *msg; - msg = (const struct urndis_init_comp *)hdr; + msg = (const struct rndis_init_comp *)hdr; DPRINTF("len %u rid %u status 0x%x " "ver_major %u ver_minor %u devflags 0x%x medium 0x%x pktmaxcnt %u " @@ -564,12 +565,12 @@ urndis_ctrl_handle_init(struct urndis_so static uint32_t urndis_ctrl_handle_query(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz) + const struct rndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz) { - const struct urndis_query_comp *msg; + const struct rndis_query_comp *msg; uint64_t limit; - msg = (const struct urndis_query_comp *)hdr; + msg = (const struct rndis_query_comp *)hdr; DPRINTF("len %u rid %u status 0x%x " "buflen %u bufoff %u\n", @@ -609,12 +610,12 @@ urndis_ctrl_handle_query(struct urndis_s static uint32_t urndis_ctrl_handle_reset(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr) + const struct rndis_comp_hdr *hdr) { - const struct urndis_reset_comp *msg; + const struct rndis_reset_comp *msg; uint32_t rval; - msg = (const struct urndis_reset_comp *)hdr; + msg = (const struct rndis_reset_comp *)hdr; rval = le32toh(msg->rm_status); @@ -630,7 +631,7 @@ urndis_ctrl_handle_reset(struct urndis_s } if (msg->rm_adrreset != 0) { struct { - struct urndis_set_req hdr; + struct rndis_set_req hdr; uint32_t filter; } msg_filter; @@ -650,8 +651,8 @@ urndis_ctrl_handle_reset(struct urndis_s static uint32_t urndis_ctrl_init(struct urndis_softc *sc) { - struct urndis_init_req msg; - struct urndis_comp_hdr *hdr; + struct rndis_init_req msg; + struct rndis_comp_hdr *hdr; uint32_t rval; msg.rm_type = htole32(REMOTE_NDIS_INITIALIZE_MSG); @@ -688,7 +689,7 @@ urndis_ctrl_init(struct urndis_softc *sc static uint32_t urndis_ctrl_halt(struct urndis_softc *sc) { - struct urndis_halt_req msg; + struct rndis_halt_req msg; uint32_t rval; msg.rm_type = htole32(REMOTE_NDIS_HALT_MSG); @@ -714,10 +715,10 @@ urndis_ctrl_halt(struct urndis_softc *sc */ static uint32_t urndis_ctrl_query(struct urndis_softc *sc, uint32_t oid, - struct urndis_query_req *msg, uint16_t len, const void **rbuf, + struct rndis_query_req *msg, uint16_t len, const void **rbuf, uint16_t *rbufsz) { - struct urndis_comp_hdr *hdr; + struct rndis_comp_hdr *hdr; uint32_t datalen, rval; msg->rm_type = htole32(REMOTE_NDIS_QUERY_MSG); @@ -761,9 +762,9 @@ urndis_ctrl_query(struct urndis_softc *s static uint32_t urndis_ctrl_set(struct urndis_softc *sc, uint32_t oid, - struct urndis_set_req *msg, uint16_t len) + struct rndis_set_req *msg, uint16_t len) { - struct urndis_comp_hdr *hdr; + struct rndis_comp_hdr *hdr; uint32_t datalen, rval; msg->rm_type = htole32(REMOTE_NDIS_SET_MSG); @@ -813,7 +814,7 @@ urndis_bulk_read_callback(struct usb_xfe struct urndis_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc = usbd_xfer_get_frame(xfer, 0); struct ifnet *ifp = uether_getifp(&sc->sc_ue); - struct urndis_packet_msg msg; + struct rndis_packet_msg msg; struct mbuf *m; int actlen; int aframes; @@ -873,11 +874,11 @@ urndis_bulk_read_callback(struct usb_xfe "datalen %u\n", msg.rm_datalen, actlen); goto tr_setup; } else if ((msg.rm_dataoffset + msg.rm_datalen + - (uint32_t)__offsetof(struct urndis_packet_msg, + (uint32_t)__offsetof(struct rndis_packet_msg, rm_dataoffset)) > (uint32_t)actlen) { DPRINTF("invalid dataoffset %u larger than %u\n", msg.rm_dataoffset + msg.rm_datalen + - (uint32_t)__offsetof(struct urndis_packet_msg, + (uint32_t)__offsetof(struct rndis_packet_msg, rm_dataoffset), actlen); goto tr_setup; } else if (msg.rm_datalen < (uint32_t)sizeof(struct ether_header)) { @@ -903,7 +904,7 @@ urndis_bulk_read_callback(struct usb_xfe m_adj(m, ETHER_ALIGN); usbd_copy_out(pc, offset + msg.rm_dataoffset + - __offsetof(struct urndis_packet_msg, + __offsetof(struct rndis_packet_msg, rm_dataoffset), m->m_data, msg.rm_datalen); /* enqueue */ @@ -939,7 +940,7 @@ tr_setup: static void urndis_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) { - struct urndis_packet_msg msg; + struct rndis_packet_msg msg; struct urndis_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = uether_getifp(&sc->sc_ue); struct mbuf *m; Modified: head/sys/dev/usb/net/if_urndisreg.h ============================================================================== --- head/sys/dev/usb/net/if_urndisreg.h Tue Aug 23 02:07:08 2016 (r304653) +++ head/sys/dev/usb/net/if_urndisreg.h Tue Aug 23 02:54:06 2016 (r304654) @@ -55,242 +55,4 @@ struct urndis_softc { #define URNDIS_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define URNDIS_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->sc_mtx, (what)) -#define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L -#define RNDIS_STATUS_FAILURE 0xC0000001L -#define RNDIS_STATUS_INVALID_DATA 0xC0010015L -#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL -#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL -#define RNDIS_STATUS_NOT_SUPPORTED 0xC00000BBL -#define RNDIS_STATUS_PENDING STATUS_PENDING /* XXX */ -#define RNDIS_STATUS_RESOURCES 0xC000009AL -#define RNDIS_STATUS_SUCCESS 0x00000000L - -#define OID_GEN_SUPPORTED_LIST 0x00010101 -#define OID_GEN_HARDWARE_STATUS 0x00010102 -#define OID_GEN_MEDIA_SUPPORTED 0x00010103 -#define OID_GEN_MEDIA_IN_USE 0x00010104 -#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 -#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 -#define OID_GEN_LINK_SPEED 0x00010107 -#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 -#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 -#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A -#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B -#define OID_GEN_VENDOR_ID 0x0001010C -#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D -#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E -#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F -#define OID_GEN_DRIVER_VERSION 0x00010110 -#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 -#define OID_GEN_PROTOCOL_OPTIONS 0x00010112 -#define OID_GEN_MAC_OPTIONS 0x00010113 -#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 -#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 -#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 -#define OID_GEN_SUPPORTED_GUIDS 0x00010117 -#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 -#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 -#define OID_GEN_MACHINE_NAME 0x0001021A -#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B -#define OID_GEN_VLAN_ID 0x0001021C - -#define OID_802_3_PERMANENT_ADDRESS 0x01010101 -#define OID_802_3_CURRENT_ADDRESS 0x01010102 -#define OID_802_3_MULTICAST_LIST 0x01010103 -#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 -#define OID_802_3_MAC_OPTIONS 0x01010105 -#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 -#define OID_802_3_XMIT_ONE_COLLISION 0x01020102 -#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 -#define OID_802_3_XMIT_DEFERRED 0x01020201 -#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 -#define OID_802_3_RCV_OVERRUN 0x01020203 -#define OID_802_3_XMIT_UNDERRUN 0x01020204 -#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 -#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 -#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 - -#define RNDIS_MEDIUM_802_3 0x00000000 - -/* Device flags */ -#define RNDIS_DF_CONNECTIONLESS 0x00000001 -#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 - -/* - * RNDIS data message - */ -#define REMOTE_NDIS_PACKET_MSG 0x00000001 - -struct urndis_packet_msg { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_dataoffset; - uint32_t rm_datalen; - uint32_t rm_oobdataoffset; - uint32_t rm_oobdatalen; - uint32_t rm_oobdataelements; - uint32_t rm_pktinfooffset; - uint32_t rm_pktinfolen; - uint32_t rm_vchandle; - uint32_t rm_reserved; -}; - -/* - * RNDIS control messages - */ -struct urndis_comp_hdr { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_status; -}; - -/* Initialize the device. */ -#define REMOTE_NDIS_INITIALIZE_MSG 0x00000002 -#define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002 - -struct urndis_init_req { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_ver_major; - uint32_t rm_ver_minor; - uint32_t rm_max_xfersz; -}; - -struct urndis_init_comp { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_status; - uint32_t rm_ver_major; - uint32_t rm_ver_minor; - uint32_t rm_devflags; - uint32_t rm_medium; - uint32_t rm_pktmaxcnt; - uint32_t rm_pktmaxsz; - uint32_t rm_align; - uint32_t rm_aflistoffset; - uint32_t rm_aflistsz; -}; - -/* Halt the device. No response sent. */ -#define REMOTE_NDIS_HALT_MSG 0x00000003 - -struct urndis_halt_req { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; -}; - -/* Send a query object. */ -#define REMOTE_NDIS_QUERY_MSG 0x00000004 -#define REMOTE_NDIS_QUERY_CMPLT 0x80000004 - -struct urndis_query_req { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_oid; - uint32_t rm_infobuflen; - uint32_t rm_infobufoffset; - uint32_t rm_devicevchdl; -}; - -struct urndis_query_comp { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_status; - uint32_t rm_infobuflen; - uint32_t rm_infobufoffset; -}; - -/* Send a set object request. */ -#define REMOTE_NDIS_SET_MSG 0x00000005 -#define REMOTE_NDIS_SET_CMPLT 0x80000005 - -struct urndis_set_req { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_oid; - uint32_t rm_infobuflen; - uint32_t rm_infobufoffset; - uint32_t rm_devicevchdl; -}; - -struct urndis_set_comp { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_status; -}; - -#define REMOTE_NDIS_SET_PARAM_NUMERIC 0x00000000 -#define REMOTE_NDIS_SET_PARAM_STRING 0x00000002 - -struct urndis_set_parameter { - uint32_t rm_nameoffset; - uint32_t rm_namelen; - uint32_t rm_type; - uint32_t rm_valueoffset; - uint32_t rm_valuelen; -}; - -/* Perform a soft reset on the device. */ -#define REMOTE_NDIS_RESET_MSG 0x00000006 -#define REMOTE_NDIS_RESET_CMPLT 0x80000006 - -struct urndis_reset_req { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; -}; - -struct urndis_reset_comp { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_status; - uint32_t rm_adrreset; -}; - -/* 802.3 link-state or undefined message error. */ -#define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007 - -/* Keepalive messsage. May be sent by device. */ -#define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008 -#define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008 - -struct urndis_keepalive_req { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; -}; - -struct urndis_keepalive_comp { - uint32_t rm_type; - uint32_t rm_len; - uint32_t rm_rid; - uint32_t rm_status; -}; - -/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ -#define RNDIS_PACKET_TYPE_DIRECTED 0x00000001 -#define RNDIS_PACKET_TYPE_MULTICAST 0x00000002 -#define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 -#define RNDIS_PACKET_TYPE_BROADCAST 0x00000008 -#define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 -#define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 -#define RNDIS_PACKET_TYPE_SMT 0x00000040 -#define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 -#define RNDIS_PACKET_TYPE_GROUP 0x00001000 -#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 -#define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 -#define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000 - -/* RNDIS offsets */ -#define RNDIS_HEADER_OFFSET 8 /* bytes */ -#define RNDIS_DATA_OFFSET ((uint32_t)(sizeof(struct urndis_packet_msg) - RNDIS_HEADER_OFFSET)) - #endif /* _IF_URNDISREG_H_ */ Added: head/sys/net/rndis.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/rndis.h Tue Aug 23 02:54:06 2016 (r304654) @@ -0,0 +1,265 @@ +/* $FreeBSD$ */ +/* $OpenBSD: if_urndisreg.h,v 1.19 2013/11/21 14:08:05 mpi Exp $ */ + +/* + * Copyright (c) 2010 Jonathan Armani + * Copyright (c) 2010 Fabien Romano + * Copyright (c) 2010 Michael Knudsen + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _NET_RNDIS_H_ +#define _NET_RNDIS_H_ + +#define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L +#define RNDIS_STATUS_FAILURE 0xC0000001L +#define RNDIS_STATUS_INVALID_DATA 0xC0010015L +#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL +#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#define RNDIS_STATUS_NOT_SUPPORTED 0xC00000BBL +#define RNDIS_STATUS_PENDING STATUS_PENDING /* XXX */ +#define RNDIS_STATUS_RESOURCES 0xC000009AL +#define RNDIS_STATUS_SUCCESS 0x00000000L + +#define OID_GEN_SUPPORTED_LIST 0x00010101 +#define OID_GEN_HARDWARE_STATUS 0x00010102 +#define OID_GEN_MEDIA_SUPPORTED 0x00010103 +#define OID_GEN_MEDIA_IN_USE 0x00010104 +#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105 +#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 +#define OID_GEN_LINK_SPEED 0x00010107 +#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108 +#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109 +#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A +#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B +#define OID_GEN_VENDOR_ID 0x0001010C +#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D +#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E +#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F +#define OID_GEN_DRIVER_VERSION 0x00010110 +#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111 +#define OID_GEN_PROTOCOL_OPTIONS 0x00010112 +#define OID_GEN_MAC_OPTIONS 0x00010113 +#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114 +#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115 +#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116 +#define OID_GEN_SUPPORTED_GUIDS 0x00010117 +#define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118 +#define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119 +#define OID_GEN_MACHINE_NAME 0x0001021A +#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B +#define OID_GEN_VLAN_ID 0x0001021C + +#define OID_802_3_PERMANENT_ADDRESS 0x01010101 +#define OID_802_3_CURRENT_ADDRESS 0x01010102 +#define OID_802_3_MULTICAST_LIST 0x01010103 +#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 +#define OID_802_3_MAC_OPTIONS 0x01010105 +#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101 +#define OID_802_3_XMIT_ONE_COLLISION 0x01020102 +#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103 +#define OID_802_3_XMIT_DEFERRED 0x01020201 +#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202 +#define OID_802_3_RCV_OVERRUN 0x01020203 +#define OID_802_3_XMIT_UNDERRUN 0x01020204 +#define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205 +#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206 +#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207 + +#define RNDIS_MEDIUM_802_3 0x00000000 + +/* Device flags */ +#define RNDIS_DF_CONNECTIONLESS 0x00000001 +#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 + +/* + * RNDIS data message + */ +#define REMOTE_NDIS_PACKET_MSG 0x00000001 + +struct rndis_packet_msg { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_dataoffset; + uint32_t rm_datalen; + uint32_t rm_oobdataoffset; + uint32_t rm_oobdatalen; + uint32_t rm_oobdataelements; + uint32_t rm_pktinfooffset; + uint32_t rm_pktinfolen; + uint32_t rm_vchandle; + uint32_t rm_reserved; +}; + +/* + * RNDIS control messages + */ +struct rndis_comp_hdr { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_status; +}; + +/* Initialize the device. */ +#define REMOTE_NDIS_INITIALIZE_MSG 0x00000002 +#define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002 + +struct rndis_init_req { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_ver_major; + uint32_t rm_ver_minor; + uint32_t rm_max_xfersz; +}; + +struct rndis_init_comp { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_status; + uint32_t rm_ver_major; + uint32_t rm_ver_minor; + uint32_t rm_devflags; + uint32_t rm_medium; + uint32_t rm_pktmaxcnt; + uint32_t rm_pktmaxsz; + uint32_t rm_align; + uint32_t rm_aflistoffset; + uint32_t rm_aflistsz; +}; + +/* Halt the device. No response sent. */ +#define REMOTE_NDIS_HALT_MSG 0x00000003 + +struct rndis_halt_req { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; +}; + +/* Send a query object. */ +#define REMOTE_NDIS_QUERY_MSG 0x00000004 +#define REMOTE_NDIS_QUERY_CMPLT 0x80000004 + +struct rndis_query_req { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_oid; + uint32_t rm_infobuflen; + uint32_t rm_infobufoffset; + uint32_t rm_devicevchdl; +}; + +struct rndis_query_comp { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_status; + uint32_t rm_infobuflen; + uint32_t rm_infobufoffset; +}; + +/* Send a set object request. */ +#define REMOTE_NDIS_SET_MSG 0x00000005 +#define REMOTE_NDIS_SET_CMPLT 0x80000005 + +struct rndis_set_req { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_oid; + uint32_t rm_infobuflen; + uint32_t rm_infobufoffset; + uint32_t rm_devicevchdl; +}; + +struct rndis_set_comp { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_status; +}; + +#define REMOTE_NDIS_SET_PARAM_NUMERIC 0x00000000 +#define REMOTE_NDIS_SET_PARAM_STRING 0x00000002 + +struct rndis_set_parameter { + uint32_t rm_nameoffset; + uint32_t rm_namelen; + uint32_t rm_type; + uint32_t rm_valueoffset; + uint32_t rm_valuelen; +}; + +/* Perform a soft reset on the device. */ +#define REMOTE_NDIS_RESET_MSG 0x00000006 +#define REMOTE_NDIS_RESET_CMPLT 0x80000006 + +struct rndis_reset_req { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; +}; + +struct rndis_reset_comp { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_status; + uint32_t rm_adrreset; +}; + +/* 802.3 link-state or undefined message error. */ +#define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007 + +/* Keepalive messsage. May be sent by device. */ +#define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008 +#define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008 + +struct rndis_keepalive_req { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; +}; + +struct rndis_keepalive_comp { + uint32_t rm_type; + uint32_t rm_len; + uint32_t rm_rid; + uint32_t rm_status; +}; + +/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ +#define RNDIS_PACKET_TYPE_DIRECTED 0x00000001 +#define RNDIS_PACKET_TYPE_MULTICAST 0x00000002 +#define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 +#define RNDIS_PACKET_TYPE_BROADCAST 0x00000008 +#define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 +#define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 +#define RNDIS_PACKET_TYPE_SMT 0x00000040 +#define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 +#define RNDIS_PACKET_TYPE_GROUP 0x00001000 +#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 +#define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 +#define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000 + +/* RNDIS offsets */ +#define RNDIS_HEADER_OFFSET 8 /* bytes */ +#define RNDIS_DATA_OFFSET \ + ((uint32_t)(sizeof(struct rndis_packet_msg) - RNDIS_HEADER_OFFSET)) + +#endif /* !_NET_RNDIS_H_ */ From owner-svn-src-head@freebsd.org Tue Aug 23 04:26:31 2016 Return-Path: Delivered-To: svn-src-head@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 7325EBC1E15; Tue, 23 Aug 2016 04:26:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 386EB1F11; Tue, 23 Aug 2016 04:26:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N4QUIM081341; Tue, 23 Aug 2016 04:26:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N4QUHl081340; Tue, 23 Aug 2016 04:26:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608230426.u7N4QUHl081340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Aug 2016 04:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304655 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 04:26:31 -0000 Author: jhibbits Date: Tue Aug 23 04:26:30 2016 New Revision: 304655 URL: https://svnweb.freebsd.org/changeset/base/304655 Log: Take into account mas7/8 when reading/writing TLB entries on e6500 Summary: Current booke/pmap code ignores mas7 and mas8 on e6500 CPU. Submitted by: Ivan Krivonos Differential Revision: https://reviews.freebsd.org/D7606 Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Aug 23 02:54:06 2016 (r304654) +++ head/sys/powerpc/booke/pmap.c Tue Aug 23 04:26:30 2016 (r304655) @@ -3166,6 +3166,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsi case FSL_E500v2: case FSL_E500mc: case FSL_E5500: + case FSL_E6500: entry->mas7 = mfspr(SPR_MAS7); break; default: @@ -3206,6 +3207,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigne switch ((mfpvr() >> 16) & 0xFFFF) { case FSL_E500mc: case FSL_E5500: + case FSL_E6500: mtspr(SPR_MAS8, 0); __asm __volatile("isync"); /* FALLTHROUGH */ From owner-svn-src-head@freebsd.org Tue Aug 23 04:37:05 2016 Return-Path: Delivered-To: svn-src-head@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 38EECBC1FE3; Tue, 23 Aug 2016 04:37:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF01C15EA; Tue, 23 Aug 2016 04:37:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7N4b4AQ084977; Tue, 23 Aug 2016 04:37:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7N4b4iH084976; Tue, 23 Aug 2016 04:37:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608230437.u7N4b4iH084976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Aug 2016 04:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304656 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 04:37:05 -0000 Author: jhibbits Date: Tue Aug 23 04:37:03 2016 New Revision: 304656 URL: https://svnweb.freebsd.org/changeset/base/304656 Log: tlb1_init() can be called twice on BookE Summary: There is no need to call tlb1_init() twice. Now it is called first time from booke_init() and second time from powerpc_init() (where it is under BOOKE switch). Although this does not cause immediate problems in the mainline kernel, this can lead to undesirable side effects like two TLB entries with the same VA in the TLB1. Presence of two TLB entries with the same VA can hang CPU. Test Plan: Add initial mapping for UART to the tlb1_init(), build and boot the kernel, ensure that mapping presents only once (most convinient way - through Lauterbah or similar hardware debugger) Submitted by: Ivan Krivonos Differential Revision: https://reviews.freebsd.org/D7607 Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Tue Aug 23 04:26:30 2016 (r304655) +++ head/sys/powerpc/powerpc/machdep.c Tue Aug 23 04:37:03 2016 (r304656) @@ -288,10 +288,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_ bzero(__bss_start, _end - __bss_start); init_static_kenv(NULL, 0); } -#ifdef BOOKE - tlb1_init(); -#endif - /* Store boot environment state */ OF_initial_setup((void *)fdt, NULL, (int (*)(void *))ofentry); From owner-svn-src-head@freebsd.org Tue Aug 23 08:05:58 2016 Return-Path: Delivered-To: svn-src-head@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 0F29CBC388E; Tue, 23 Aug 2016 08:05:58 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF44016E7; Tue, 23 Aug 2016 08:05:57 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCC00E00RTA3900@st13p35im-asmtp004.me.com>; Tue, 23 Aug 2016 08:05:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471939550; bh=hTsRrjk7Gh4gVjGM3SFil9WEm7EzfsjSaUQ3AspYyb8=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=hFT+rsqMO59/ICVoGQDRHZXbm0bisMjf9TdTvDePJM0kUhk3FRzaUg9WlDZErz1qk ENQtSXxp6qRKmwR4l+Xubm06YyBvWCV+O3w6jmSGaX730/D/BDGhh5XfL3opWRdKXa Ngu0Z3fk5/K7q+QjRA1NqZrkR/IVwXNkV3OzFTqh2BMXcVmEFyeLboWVIw9RSUN4O8 v90vvlVu7mYoCRwPHvNoPwI0Fj5D0ddNRaHzBB877XN/wR8K0RZCUmyDjtS3d4/TBN VUouLN6QLgOErrFfwxenNqct6WI0OkAyl5QzZB+ShYaHCJhv4GhSgOHoH95N4htXlo jIm+0xhF3DeJg== Received: from [88.196.10.91] (91-10-196-88.dyn.estpak.ee [88.196.10.91]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCC00HQQRTNOP40@st13p35im-asmtp004.me.com>; Tue, 23 Aug 2016 08:05:50 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-23_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608230082 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: Date: Tue, 23 Aug 2016 11:05:47 +0300 Cc: Andriy Gapon , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 08:05:58 -0000 > On 22. aug 2016, at 17:56, Toomas Soome wrote: >=20 >=20 >> On 22. aug 2016, at 17:19, Warner Losh wrote: >>=20 >> On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome wrote: >>> I do suspect the size difference there is partially due to ficl, in = illumos (ficl 4): >>>=20 >>> -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a >>>=20 >>> and freebsd (ficl 3): >>>=20 >>> -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a >>>=20 >>> so, there definitely is some space=E2=80=A6 >>=20 >> Same compiler? Clang bloats the boot code rather substantially, even = after >> all the flags to tell it to generate smaller code are used. gcc 4.2.x >> built stuff >> was substantially smaller. >>=20 >> There's a 520kb limit enforced in the boot1 for similar reasons. = Looks like >> the combination of options makes us use just enough extra memory to >> sink the battleship... >>=20 >> Warner >>=20 >=20 >=20 > Actually I only now realized I was comparing apples with oranges=E2=80=A6= I forgot the fbsd builds 32bit version in ficl32, this one is 64bit. = and yes the 32bit version is not that big at all:D >=20 > Also, after done some digging, I have found few instances of = duplicated code (we can share sha2 with geli and so if sha512 is already = needed, it will become another =E2=80=9Cfree lunch=E2=80=9D). Also, = unless I=E2=80=99m mistaken, for some reason the bzip *compression* is = brought in - correct me if I=E2=80=99m wrong, but afaik only = decompression is needed=E2=80=A6 >=20 > So before going after =E2=80=9Cuseless features=E2=80=9D, there are = some =E2=80=9Chidden=E2=80=9D resources to remove extra fat. >=20 I did some more digging. while ld has =E2=80=94gc-sections to clean up = unused bits, to make it effective, the code build does also need -Os = -fdata-sections -ffunction-sections. So I did just very simple test by adding those flags to bsd.stand.mk = and: first the =E2=80=9Cdefault=E2=80=9D binaries from /boot: -r-xr-xr-x 1 root wheel 446464 Aug 19 08:46 /boot/zfsloader -rw-r--r-- 1 root wheel 438272 Aug 23 00:30 /boot/zfsloader.b -r-xr-xr-x 1 root wheel 446464 Aug 5 08:37 /boot/zfsloader.old -r--r--r-- 1 root wheel 406568 Aug 19 08:46 /boot/userboot.so (note, zfsloader.b here is built with https://reviews.freebsd.org/D7600) now after adding compile flags -Os -fdata-sections -ffunction-sections: -rw-r--r-- 1 root wheel 389120 Aug 23 10:12 zfsloader -rwxr-xr-x 1 root wheel 378156 Aug 23 10:12 zfsloader.bin -rwxr-xr-x 1 root wheel 437514 Aug 23 10:12 zfsloader.sym -rwxr-xr-x 1 root wheel 375912 Aug 23 10:03 userboot.so and finally test for Andriy with: LOADER_BZIP2_SUPPORT=3Dyes LOADER_FIREWIRE_SUPPORT=3Dyes -rw-r--r-- 1 root wheel 421888 Aug 23 10:22 zfsloader -rwxr-xr-x 1 root wheel 409932 Aug 23 10:22 zfsloader.bin -rwxr-xr-x 1 root wheel 472021 Aug 23 10:22 zfsloader.sym -rwxr-xr-x 1 root wheel 375912 Aug 23 10:22 userboot.so note the userboot.so did not change from those flags. This is just an result from compile, and by adding 3 options to = bsd.stand.mk; however, not all Makefiles in loader tree seem to include = it, and most importantly, haven=E2=80=99t tested real boot yet;) To conclude, some more work is needed to review the Makefiles, build = options used etc, also I don=E2=80=99t know all the background why the = compiler options are set as they currently are - were there any related = compiler/linker bugs, or any other reasons, also how/if other platforms = are affected - for example bsd.stand.mk does set -Os for pc98, but not = for others=E2=80=A6 rgds, toomas= From owner-svn-src-head@freebsd.org Tue Aug 23 08:23:55 2016 Return-Path: Delivered-To: svn-src-head@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 044CFBC3E06; Tue, 23 Aug 2016 08:23:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B9ECB14A8; Tue, 23 Aug 2016 08:23:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA01448; Tue, 23 Aug 2016 11:23:45 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bc6zo-0000m1-S4; Tue, 23 Aug 2016 11:23:44 +0300 Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... To: Toomas Soome , Warner Losh References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> Cc: Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andriy Gapon Message-ID: Date: Tue, 23 Aug 2016 11:22:48 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 08:23:55 -0000 On 22/08/2016 17:56, Toomas Soome wrote: > Actually I only now realized I was comparing apples with oranges… I forgot > the fbsd builds 32bit version in ficl32, this one is 64bit. and yes the 32bit > version is not that big at all:D > > Also, after done some digging, I have found few instances of duplicated code > (we can share sha2 with geli and so if sha512 is already needed, it will > become another “free lunch”). Also, unless I’m mistaken, for some reason the > bzip *compression* is brought in - correct me if I’m wrong, but afaik only > decompression is needed… > > So before going after “useless features”, there are some “hidden” resources > to remove extra fat. I certainly agree with this and those things would be good to do. But if we do not change the trend then sooner or later we will run out of things that we can optimize. But it's also possible that the current limitations will be a history by then. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Aug 23 08:51:56 2016 Return-Path: Delivered-To: svn-src-head@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 4B8B7BC1985; Tue, 23 Aug 2016 08:51:56 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC851653; Tue, 23 Aug 2016 08:51:56 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCC00P00TVF9N00@st13p35im-asmtp001.me.com>; Tue, 23 Aug 2016 08:51:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471942314; bh=Rmtn/KL3D9ovB67ar0N3uhyLAs8ukrdemuli1g5KNRc=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=Wa8Wjq8vo19BlubS9mb4BU0+GRkFaHq+5T080MTnehOhjVtJ1V4O8R0KnwlNuV580 PI8Xj3yWpN1g6trIWXO+ZtXDA4ZsASHF5FfkvqD5BtAq5P8BB5YJYEH0VOw8kvN5XO hMFjl4jrKwvO+Kw3q364zAT5LpBez5KM2ixAe1ygxcDu8nEt4Oo7ZSmpLsRRf7k8C9 YkSpm2K+RN1gPUcV0PU+ud8ynowTJ+4fNBN4kv00nEGrcV2hB9JwEGk+EsuxvX9ImU 4vDqfmnW4+TSRyAK+bc7wC6bHUvExMT+ubmIlIToeprs7jPSZKGVe+XYhwiGKpXGPG 5OEirx1DCwvMQ== Received: from [88.196.10.91] (91-10-196-88.dyn.estpak.ee [88.196.10.91]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCC006GCTYF8410@st13p35im-asmtp001.me.com>; Tue, 23 Aug 2016 08:51:54 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-23_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608230089 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: Date: Tue, 23 Aug 2016 11:51:51 +0300 Cc: Warner Losh , Toomas Soome , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <3587EDAA-35AE-4D71-8BA4-24C3E0254795@me.com> References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 08:51:56 -0000 > On 23. aug 2016, at 11:22, Andriy Gapon wrote: >=20 > On 22/08/2016 17:56, Toomas Soome wrote: >> Actually I only now realized I was comparing apples with oranges=E2=80=A6= I forgot >> the fbsd builds 32bit version in ficl32, this one is 64bit. and yes = the 32bit >> version is not that big at all:D >>=20 >> Also, after done some digging, I have found few instances of = duplicated code >> (we can share sha2 with geli and so if sha512 is already needed, it = will >> become another =E2=80=9Cfree lunch=E2=80=9D). Also, unless I=E2=80=99m = mistaken, for some reason the >> bzip *compression* is brought in - correct me if I=E2=80=99m wrong, = but afaik only >> decompression is needed=E2=80=A6 >>=20 >> So before going after =E2=80=9Cuseless features=E2=80=9D, there are = some =E2=80=9Chidden=E2=80=9D resources >> to remove extra fat. >=20 > I certainly agree with this and those things would be good to do. > But if we do not change the trend then sooner or later we will run out = of things > that we can optimize. But it's also possible that the current = limitations will > be a history by then. >=20 > --=20 > Andriy Gapon Yes, also from my illumos work, even building framebuffer based GFX = interface haven=E2=80=99t added too much extra code, but it is important = to recognize the limits, and this issue did provide really good lesson = about it;) Right now there are two tasks to finalize - complete the review/test/fix = for proper compiler options, and to understand the actual limits = regarding userboot module - for me it is absolutely unknown area. rgds, toomas From owner-svn-src-head@freebsd.org Tue Aug 23 10:40:54 2016 Return-Path: Delivered-To: svn-src-head@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 8D564BC225E; Tue, 23 Aug 2016 10:40:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEE01F94; Tue, 23 Aug 2016 10:40:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NAerSI019298; Tue, 23 Aug 2016 10:40:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NAerJt019297; Tue, 23 Aug 2016 10:40:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608231040.u7NAerJt019297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 23 Aug 2016 10:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304674 - head/sys/dev/intpm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 10:40:54 -0000 Author: avg Date: Tue Aug 23 10:40:53 2016 New Revision: 304674 URL: https://svnweb.freebsd.org/changeset/base/304674 Log: intpm: add support for SB800 This code should be able to support later AMD chipsets as well, but that hasn't been tested. SB800 supports accessing several different SMBus buses using the same set of constrol registeirs plus special PMIO registers that control which bus is selected. This could be exposed to consumers as several smb devices each talking to its bus. This feature is not implemented yet. MFC after: 2 weeks Modified: head/sys/dev/intpm/intpm.c Modified: head/sys/dev/intpm/intpm.c ============================================================================== --- head/sys/dev/intpm/intpm.c Tue Aug 23 08:13:08 2016 (r304673) +++ head/sys/dev/intpm/intpm.c Tue Aug 23 10:40:53 2016 (r304674) @@ -52,8 +52,10 @@ struct intsmb_softc { struct resource *irq_res; void *irq_hand; device_t smbus; + int io_rid; int isbusy; int cfg_irq9; + int sb8xx; int poll; struct mtx lock; }; @@ -102,10 +104,8 @@ intsmb_probe(device_t dev) device_set_desc(dev, "ATI IXP400 SMBus Controller"); break; case 0x43851002: - /* SB800 and newer can not be configured in a compatible way. */ - if (pci_get_revid(dev) >= 0x40) - return (ENXIO); - device_set_desc(dev, "AMD SB600/700/710/750 SMBus Controller"); + case 0x780b1022: /* AMD Hudson */ + device_set_desc(dev, "AMD SB600/7xx/8xx SMBus Controller"); /* XXX Maybe force polling right here? */ break; default: @@ -115,6 +115,87 @@ intsmb_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static uint8_t +sb8xx_pmio_read(struct resource *res, uint8_t reg) +{ + bus_write_1(res, 0, reg); /* Index */ + return (bus_read_1(res, 1)); /* Data */ +} + +static int +sb8xx_attach(device_t dev) +{ + static const int AMDSB_PMIO_INDEX = 0xcd6; + static const int AMDSB_PMIO_WIDTH = 2; + static const int AMDSB8_SMBUS_ADDR = 0x2c; + static const int AMDSB8_SMBUS_EN = 0x01; + static const int AMDSB8_SMBUS_ADDR_MASK = ~0x1fu; + static const int AMDSB_SMBIO_WIDTH = 0x14; + static const int AMDSB_SMBUS_CFG = 0x10; + static const int AMDSB_SMBUS_IRQ = 0x01; + static const int AMDSB_SMBUS_REV_MASK = ~0x0fu; + static const int AMDSB_SMBUS_REV_SHIFT = 4; + static const int AMDSB_IO_RID = 0; + + struct intsmb_softc *sc; + struct resource *res; + uint16_t addr; + uint8_t cfg; + int rid; + int rc; + + sc = device_get_softc(dev); + rid = AMDSB_IO_RID; + rc = bus_set_resource(dev, SYS_RES_IOPORT, rid, AMDSB_PMIO_INDEX, + AMDSB_PMIO_WIDTH); + if (rc != 0) { + device_printf(dev, "bus_set_resource for PM IO failed\n"); + return (ENXIO); + } + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (res == NULL) { + device_printf(dev, "bus_alloc_resource for PM IO failed\n"); + return (ENXIO); + } + + addr = sb8xx_pmio_read(res, AMDSB8_SMBUS_ADDR + 1); + addr <<= 8; + addr |= sb8xx_pmio_read(res, AMDSB8_SMBUS_ADDR); + + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + bus_delete_resource(dev, SYS_RES_IOPORT, rid); + + if ((addr & AMDSB8_SMBUS_EN) == 0) { + device_printf(dev, "SB8xx SMBus not enabled\n"); + return (ENXIO); + } + + addr &= AMDSB8_SMBUS_ADDR_MASK; + sc->io_rid = AMDSB_IO_RID; + rc = bus_set_resource(dev, SYS_RES_IOPORT, sc->io_rid, addr, + AMDSB_SMBIO_WIDTH); + if (rc != 0) { + device_printf(dev, "bus_set_resource for SMBus IO failed\n"); + return (ENXIO); + } + if (res == NULL) { + device_printf(dev, "bus_alloc_resource for SMBus IO failed\n"); + return (ENXIO); + } + sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->io_rid, + RF_ACTIVE | RF_SHAREABLE); + cfg = bus_read_1(sc->io_res, AMDSB_SMBUS_CFG); + + sc->poll = 1; + device_printf(dev, "intr %s disabled ", + (cfg & AMDSB_SMBUS_IRQ) != 0 ? "IRQ" : "SMI"); + printf("revision %d\n", + (cfg & AMDSB_SMBUS_REV_MASK) >> AMDSB_SMBUS_REV_SHIFT); + + return (0); +} + static int intsmb_attach(device_t dev) { @@ -128,18 +209,31 @@ intsmb_attach(device_t dev) mtx_init(&sc->lock, device_get_nameunit(dev), "intsmb", MTX_DEF); sc->cfg_irq9 = 0; -#ifndef NO_CHANGE_PCICONF switch (pci_get_devid(dev)) { +#ifndef NO_CHANGE_PCICONF case 0x71138086: /* Intel 82371AB */ case 0x719b8086: /* Intel 82443MX */ /* Changing configuration is allowed. */ sc->cfg_irq9 = 1; break; - } #endif + case 0x43851002: + case 0x780b1022: + if (pci_get_revid(dev) >= 0x40) + sc->sb8xx = 1; + break; + } + + if (sc->sb8xx) { + error = sb8xx_attach(dev); + if (error != 0) + goto fail; + else + goto no_intr; + } - rid = PCI_BASE_ADDR_SMB; - sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + sc->io_rid = PCI_BASE_ADDR_SMB; + sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->io_rid, RF_ACTIVE); if (sc->io_res == NULL) { device_printf(dev, "Could not allocate I/O space\n"); @@ -247,7 +341,7 @@ intsmb_detach(device_t dev) if (sc->irq_res) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); if (sc->io_res) - bus_release_resource(dev, SYS_RES_IOPORT, PCI_BASE_ADDR_SMB, + bus_release_resource(dev, SYS_RES_IOPORT, sc->io_rid, sc->io_res); mtx_destroy(&sc->lock); return (0); From owner-svn-src-head@freebsd.org Tue Aug 23 11:29:52 2016 Return-Path: Delivered-To: svn-src-head@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 53B77BC3A18; Tue, 23 Aug 2016 11:29:52 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 1208A1A13; Tue, 23 Aug 2016 11:29:52 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bc9tk-000MlA-Oq; Tue, 23 Aug 2016 14:29:40 +0300 Date: Tue, 23 Aug 2016 14:29:40 +0300 From: Slawa Olhovchenkov To: Toomas Soome Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Toomas Soome , Andriy Gapon Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... Message-ID: <20160823112940.GW22212@zxy.spb.ru> References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 11:29:52 -0000 On Tue, Aug 23, 2016 at 11:05:47AM +0300, Toomas Soome wrote: > > > On 22. aug 2016, at 17:56, Toomas Soome wrote: > > > > > >> On 22. aug 2016, at 17:19, Warner Losh wrote: > >> > >> On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome wrote: > >>> I do suspect the size difference there is partially due to ficl, in illumos (ficl 4): > >>> > >>> -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a > >>> > >>> and freebsd (ficl 3): > >>> > >>> -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a > >>> > >>> so, there definitely is some space… > >> > >> Same compiler? Clang bloats the boot code rather substantially, even after > >> all the flags to tell it to generate smaller code are used. gcc 4.2.x > >> built stuff > >> was substantially smaller. > >> > >> There's a 520kb limit enforced in the boot1 for similar reasons. Looks like > >> the combination of options makes us use just enough extra memory to > >> sink the battleship... > >> > >> Warner > >> > > > > > > Actually I only now realized I was comparing apples with oranges… I forgot the fbsd builds 32bit version in ficl32, this one is 64bit. and yes the 32bit version is not that big at all:D > > > > Also, after done some digging, I have found few instances of duplicated code (we can share sha2 with geli and so if sha512 is already needed, it will become another “free lunch”). Also, unless I’m mistaken, for some reason the bzip *compression* is brought in - correct me if I’m wrong, but afaik only decompression is needed… > > > > So before going after “useless features”, there are some “hidden” resources to remove extra fat. > > > > I did some more digging. while ld has —gc-sections to clean up unused bits, to make it effective, the code build does also need -Os -fdata-sections -ffunction-sections. > So I did just very simple test by adding those flags to bsd.stand.mk and: > > first the “default” binaries from /boot: > -r-xr-xr-x 1 root wheel 446464 Aug 19 08:46 /boot/zfsloader > -rw-r--r-- 1 root wheel 438272 Aug 23 00:30 /boot/zfsloader.b > -r-xr-xr-x 1 root wheel 446464 Aug 5 08:37 /boot/zfsloader.old > -r--r--r-- 1 root wheel 406568 Aug 19 08:46 /boot/userboot.so > > (note, zfsloader.b here is built with https://reviews.freebsd.org/D7600) > > now after adding compile flags -Os -fdata-sections -ffunction-sections: > > -rw-r--r-- 1 root wheel 389120 Aug 23 10:12 zfsloader > -rwxr-xr-x 1 root wheel 378156 Aug 23 10:12 zfsloader.bin > -rwxr-xr-x 1 root wheel 437514 Aug 23 10:12 zfsloader.sym > -rwxr-xr-x 1 root wheel 375912 Aug 23 10:03 userboot.so > > and finally test for Andriy with: > LOADER_BZIP2_SUPPORT=yes > LOADER_FIREWIRE_SUPPORT=yes > > -rw-r--r-- 1 root wheel 421888 Aug 23 10:22 zfsloader > -rwxr-xr-x 1 root wheel 409932 Aug 23 10:22 zfsloader.bin > -rwxr-xr-x 1 root wheel 472021 Aug 23 10:22 zfsloader.sym > -rwxr-xr-x 1 root wheel 375912 Aug 23 10:22 userboot.so > > note the userboot.so did not change from those flags. > > This is just an result from compile, and by adding 3 options to bsd.stand.mk; however, not all Makefiles in loader tree seem to include it, and most importantly, haven’t tested real boot yet;) > > To conclude, some more work is needed to review the Makefiles, build options used etc, also I don’t know all the background why the compiler options are set as they currently are - were there any related compiler/linker bugs, or any other reasons, also how/if other platforms are affected - for example bsd.stand.mk does set -Os for pc98, but not for others… This is only size on disk, memory consuming still same, IMHO. From owner-svn-src-head@freebsd.org Tue Aug 23 12:00:38 2016 Return-Path: Delivered-To: svn-src-head@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 0CA76BC39C1; Tue, 23 Aug 2016 12:00:38 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3080125D; Tue, 23 Aug 2016 12:00:37 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCD003002OLSR00@st13p35im-asmtp004.me.com>; Tue, 23 Aug 2016 12:00:36 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471953636; bh=DRP12xGUWrA+DhJcDCo5ipsoenYnLjrNnoWeZj2RHss=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=LEzfVyfTzvtDgZ+/rdYJSCbqrh+UYUTLmNM0lcUUoKuo69yiGFyamegflV/DYrMOO zkz+Ri8BJJN6Anu3WT5XMzfFp/tv2GAJUlF7opN34h+O4aO7bGZNTfT9L1kFFux/Aj WVZN7RaB8/BFkGHxSnqFEvYTIu0eESlyxeLESVzf/0oHqKov0S4jc/fJedCGxNwj+v r/0T8RuvuFcG1SXR/XlBDJahlFmo1f8bqfHydLb7xLvUJ+GdMzwXJCWiqm82HNIc01 WOAXpmi3bG9K6psMG6jMZ66rKD/wFwqpX98sERhMg25qSElx3m9YtZPHgvAN9XR/A9 cZJIt9wZkjkGw== Received: from [88.196.10.91] (91-10-196-88.dyn.estpak.ee [88.196.10.91]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCD007O92OXXH40@st13p35im-asmtp004.me.com>; Tue, 23 Aug 2016 12:00:36 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-23_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=50 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608230121 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: <20160823112940.GW22212@zxy.spb.ru> Date: Tue, 23 Aug 2016 15:00:32 +0300 Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Toomas Soome , Andriy Gapon Content-transfer-encoding: quoted-printable Message-id: References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> <20160823112940.GW22212@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 12:00:38 -0000 > On 23. aug 2016, at 14:29, Slawa Olhovchenkov wrote: >=20 > On Tue, Aug 23, 2016 at 11:05:47AM +0300, Toomas Soome wrote: >=20 >>=20 >>> On 22. aug 2016, at 17:56, Toomas Soome wrote: >>>=20 >>>=20 >>>> On 22. aug 2016, at 17:19, Warner Losh wrote: >>>>=20 >>>> On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome = wrote: >>>>> I do suspect the size difference there is partially due to ficl, = in illumos (ficl 4): >>>>>=20 >>>>> -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a >>>>>=20 >>>>> and freebsd (ficl 3): >>>>>=20 >>>>> -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a >>>>>=20 >>>>> so, there definitely is some space=E2=80=A6 >>>>=20 >>>> Same compiler? Clang bloats the boot code rather substantially, = even after >>>> all the flags to tell it to generate smaller code are used. gcc = 4.2.x >>>> built stuff >>>> was substantially smaller. >>>>=20 >>>> There's a 520kb limit enforced in the boot1 for similar reasons. = Looks like >>>> the combination of options makes us use just enough extra memory to >>>> sink the battleship... >>>>=20 >>>> Warner >>>>=20 >>>=20 >>>=20 >>> Actually I only now realized I was comparing apples with oranges=E2=80= =A6 I forgot the fbsd builds 32bit version in ficl32, this one is 64bit. = and yes the 32bit version is not that big at all:D >>>=20 >>> Also, after done some digging, I have found few instances of = duplicated code (we can share sha2 with geli and so if sha512 is already = needed, it will become another =E2=80=9Cfree lunch=E2=80=9D). Also, = unless I=E2=80=99m mistaken, for some reason the bzip *compression* is = brought in - correct me if I=E2=80=99m wrong, but afaik only = decompression is needed=E2=80=A6 >>>=20 >>> So before going after =E2=80=9Cuseless features=E2=80=9D, there are = some =E2=80=9Chidden=E2=80=9D resources to remove extra fat. >>>=20 >>=20 >> I did some more digging. while ld has =E2=80=94gc-sections to clean = up unused bits, to make it effective, the code build does also need -Os = -fdata-sections -ffunction-sections. >> So I did just very simple test by adding those flags to bsd.stand.mk = and: >>=20 >> first the =E2=80=9Cdefault=E2=80=9D binaries from /boot: >> -r-xr-xr-x 1 root wheel 446464 Aug 19 08:46 /boot/zfsloader >> -rw-r--r-- 1 root wheel 438272 Aug 23 00:30 /boot/zfsloader.b >> -r-xr-xr-x 1 root wheel 446464 Aug 5 08:37 /boot/zfsloader.old >> -r--r--r-- 1 root wheel 406568 Aug 19 08:46 /boot/userboot.so >>=20 >> (note, zfsloader.b here is built with = https://reviews.freebsd.org/D7600) >>=20 >> now after adding compile flags -Os -fdata-sections = -ffunction-sections: >>=20 >> -rw-r--r-- 1 root wheel 389120 Aug 23 10:12 zfsloader >> -rwxr-xr-x 1 root wheel 378156 Aug 23 10:12 zfsloader.bin >> -rwxr-xr-x 1 root wheel 437514 Aug 23 10:12 zfsloader.sym >> -rwxr-xr-x 1 root wheel 375912 Aug 23 10:03 userboot.so >>=20 >> and finally test for Andriy with: >> LOADER_BZIP2_SUPPORT=3Dyes >> LOADER_FIREWIRE_SUPPORT=3Dyes >>=20 >> -rw-r--r-- 1 root wheel 421888 Aug 23 10:22 zfsloader >> -rwxr-xr-x 1 root wheel 409932 Aug 23 10:22 zfsloader.bin >> -rwxr-xr-x 1 root wheel 472021 Aug 23 10:22 zfsloader.sym >> -rwxr-xr-x 1 root wheel 375912 Aug 23 10:22 userboot.so >>=20 >> note the userboot.so did not change from those flags. >>=20 >> This is just an result from compile, and by adding 3 options to = bsd.stand.mk; however, not all Makefiles in loader tree seem to include = it, and most importantly, haven=E2=80=99t tested real boot yet;) >>=20 >> To conclude, some more work is needed to review the Makefiles, build = options used etc, also I don=E2=80=99t know all the background why the = compiler options are set as they currently are - were there any related = compiler/linker bugs, or any other reasons, also how/if other platforms = are affected - for example bsd.stand.mk does set -Os for pc98, but not = for others=E2=80=A6 >=20 > This is only size on disk, memory consuming still same, IMHO. Actually this reduction above is entirely due to -Os, the =E2=80=94gc-sect= ions is not passed to linker (at least for zfsloader case). I think we = will need linker script to preserve set_Xcommand_set linker set to use = =E2=80=94gc-sections with ld. Loader heap is separate already and does not contribute to this issue. = Also, I already did test the boot with thinned zfsloader, both with and = without bzip2 are appearing to work, at least for this quick test = anyhow. rgds, toomas From owner-svn-src-head@freebsd.org Tue Aug 23 12:16:32 2016 Return-Path: Delivered-To: svn-src-head@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 C1734BC2795; Tue, 23 Aug 2016 12:16:32 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 7F4E51204; Tue, 23 Aug 2016 12:16:32 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bcAd3-000O31-9m; Tue, 23 Aug 2016 15:16:29 +0300 Date: Tue, 23 Aug 2016 15:16:29 +0300 From: Slawa Olhovchenkov To: Toomas Soome Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Toomas Soome , Andriy Gapon Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... Message-ID: <20160823121629.GA88122@zxy.spb.ru> References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> <20160823112940.GW22212@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 12:16:32 -0000 On Tue, Aug 23, 2016 at 03:00:32PM +0300, Toomas Soome wrote: > > > On 23. aug 2016, at 14:29, Slawa Olhovchenkov wrote: > > > > On Tue, Aug 23, 2016 at 11:05:47AM +0300, Toomas Soome wrote: > > > >> > >>> On 22. aug 2016, at 17:56, Toomas Soome wrote: > >>> > >>> > >>>> On 22. aug 2016, at 17:19, Warner Losh wrote: > >>>> > >>>> On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome wrote: > >>>>> I do suspect the size difference there is partially due to ficl, in illumos (ficl 4): > >>>>> > >>>>> -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a > >>>>> > >>>>> and freebsd (ficl 3): > >>>>> > >>>>> -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a > >>>>> > >>>>> so, there definitely is some space… > >>>> > >>>> Same compiler? Clang bloats the boot code rather substantially, even after > >>>> all the flags to tell it to generate smaller code are used. gcc 4.2.x > >>>> built stuff > >>>> was substantially smaller. > >>>> > >>>> There's a 520kb limit enforced in the boot1 for similar reasons. Looks like > >>>> the combination of options makes us use just enough extra memory to > >>>> sink the battleship... > >>>> > >>>> Warner > >>>> > >>> > >>> > >>> Actually I only now realized I was comparing apples with oranges… I forgot the fbsd builds 32bit version in ficl32, this one is 64bit. and yes the 32bit version is not that big at all:D > >>> > >>> Also, after done some digging, I have found few instances of duplicated code (we can share sha2 with geli and so if sha512 is already needed, it will become another “free lunch”). Also, unless I’m mistaken, for some reason the bzip *compression* is brought in - correct me if I’m wrong, but afaik only decompression is needed… > >>> > >>> So before going after “useless features”, there are some “hidden” resources to remove extra fat. > >>> > >> > >> I did some more digging. while ld has —gc-sections to clean up unused bits, to make it effective, the code build does also need -Os -fdata-sections -ffunction-sections. > >> So I did just very simple test by adding those flags to bsd.stand.mk and: > >> > >> first the “default” binaries from /boot: > >> -r-xr-xr-x 1 root wheel 446464 Aug 19 08:46 /boot/zfsloader > >> -rw-r--r-- 1 root wheel 438272 Aug 23 00:30 /boot/zfsloader.b > >> -r-xr-xr-x 1 root wheel 446464 Aug 5 08:37 /boot/zfsloader.old > >> -r--r--r-- 1 root wheel 406568 Aug 19 08:46 /boot/userboot.so > >> > >> (note, zfsloader.b here is built with https://reviews.freebsd.org/D7600) > >> > >> now after adding compile flags -Os -fdata-sections -ffunction-sections: > >> > >> -rw-r--r-- 1 root wheel 389120 Aug 23 10:12 zfsloader > >> -rwxr-xr-x 1 root wheel 378156 Aug 23 10:12 zfsloader.bin > >> -rwxr-xr-x 1 root wheel 437514 Aug 23 10:12 zfsloader.sym > >> -rwxr-xr-x 1 root wheel 375912 Aug 23 10:03 userboot.so > >> > >> and finally test for Andriy with: > >> LOADER_BZIP2_SUPPORT=yes > >> LOADER_FIREWIRE_SUPPORT=yes > >> > >> -rw-r--r-- 1 root wheel 421888 Aug 23 10:22 zfsloader > >> -rwxr-xr-x 1 root wheel 409932 Aug 23 10:22 zfsloader.bin > >> -rwxr-xr-x 1 root wheel 472021 Aug 23 10:22 zfsloader.sym > >> -rwxr-xr-x 1 root wheel 375912 Aug 23 10:22 userboot.so > >> > >> note the userboot.so did not change from those flags. > >> > >> This is just an result from compile, and by adding 3 options to bsd.stand.mk; however, not all Makefiles in loader tree seem to include it, and most importantly, haven’t tested real boot yet;) > >> > >> To conclude, some more work is needed to review the Makefiles, build options used etc, also I don’t know all the background why the compiler options are set as they currently are - were there any related compiler/linker bugs, or any other reasons, also how/if other platforms are affected - for example bsd.stand.mk does set -Os for pc98, but not for others… > > > > This is only size on disk, memory consuming still same, IMHO. > > Actually this reduction above is entirely due to -Os, the —gc-sections is not passed to linker (at least for zfsloader case). I think we will need linker script to preserve set_Xcommand_set linker set to use —gc-sections with ld. > > Loader heap is separate already and does not contribute to this issue. Also, I already did test the boot with thinned zfsloader, both with and without bzip2 are appearing to work, at least for this quick test anyhow. Main trouble (by kib@) is 640KB real mode limit. Separated heap don't soled this. May be solution is early switch to protected mode, boot2? From owner-svn-src-head@freebsd.org Tue Aug 23 12:26:15 2016 Return-Path: Delivered-To: svn-src-head@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 BC604BC31BA; Tue, 23 Aug 2016 12:26:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E00819E4; Tue, 23 Aug 2016 12:26:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCD000003OPX100@st13p35im-asmtp001.me.com>; Tue, 23 Aug 2016 12:26:09 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471955169; bh=j6FqPoVi04MO95ghKGnvLPxJW0UWVc8iJklvJ3l1zCM=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=rMZYisDx8w7ztNojjQlKdLaAn0ao5FyJle7KXNDw3fhcWz9MObPVozSqskFKQySjm pVjsW9hNzI7vYur8lbQa1PPFxl1qF8Sj3nvzFH7ayJqNvt48ThO+VGqvo9sYw/jRdK czOkNCLgH6DPwWwqzV5i0NxYKSyWPl2K9ZhDb6Ro++Guc2fVaBVsmz8jy7/kdCS/5M fzmZIPD6+mj8Hr6sq6jYbaUG7AHssfiGKNH1lQFaYhvLfqPcbeimT+yZGVvi6ilQ0L KWGj3VOsZa0LuBASJ/FxCcyqUUsNmX/MmffSfx9A040VdxpwS4zzNVbM93byk3cu23 0VC99pRZ6B55Q== Received: from [88.196.10.91] (91-10-196-88.dyn.estpak.ee [88.196.10.91]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCD005X83VG5T30@st13p35im-asmtp001.me.com>; Tue, 23 Aug 2016 12:26:09 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-23_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=50 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608230125 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: <20160823121629.GA88122@zxy.spb.ru> Date: Tue, 23 Aug 2016 15:26:04 +0300 Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Toomas Soome , Andriy Gapon Content-transfer-encoding: quoted-printable Message-id: <151A63A8-6444-4E84-80B8-B773C8F661EF@me.com> References: <201608180037.u7I0b77A095653@repo.freebsd.org> <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> <20160823112940.GW22212@zxy.spb.ru> <20160823121629.GA88122@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 12:26:15 -0000 > On 23. aug 2016, at 15:16, Slawa Olhovchenkov wrote: >=20 > On Tue, Aug 23, 2016 at 03:00:32PM +0300, Toomas Soome wrote: >=20 >>=20 >>> On 23. aug 2016, at 14:29, Slawa Olhovchenkov = wrote: >>>=20 >>> On Tue, Aug 23, 2016 at 11:05:47AM +0300, Toomas Soome wrote: >>>=20 >>>>=20 >>>>> On 22. aug 2016, at 17:56, Toomas Soome wrote: >>>>>=20 >>>>>=20 >>>>>> On 22. aug 2016, at 17:19, Warner Losh wrote: >>>>>>=20 >>>>>> On Mon, Aug 22, 2016 at 3:44 AM, Toomas Soome = wrote: >>>>>>> I do suspect the size difference there is partially due to ficl, = in illumos (ficl 4): >>>>>>>=20 >>>>>>> -rw-r--r-- 1 tsoome staff 132508 aug 22 09:18 libficl.a >>>>>>>=20 >>>>>>> and freebsd (ficl 3): >>>>>>>=20 >>>>>>> -rw-r--r-- 1 root wheel 213748 Aug 19 01:57 libficl.a >>>>>>>=20 >>>>>>> so, there definitely is some space=E2=80=A6 >>>>>>=20 >>>>>> Same compiler? Clang bloats the boot code rather substantially, = even after >>>>>> all the flags to tell it to generate smaller code are used. gcc = 4.2.x >>>>>> built stuff >>>>>> was substantially smaller. >>>>>>=20 >>>>>> There's a 520kb limit enforced in the boot1 for similar reasons. = Looks like >>>>>> the combination of options makes us use just enough extra memory = to >>>>>> sink the battleship... >>>>>>=20 >>>>>> Warner >>>>>>=20 >>>>>=20 >>>>>=20 >>>>> Actually I only now realized I was comparing apples with = oranges=E2=80=A6 I forgot the fbsd builds 32bit version in ficl32, this = one is 64bit. and yes the 32bit version is not that big at all:D >>>>>=20 >>>>> Also, after done some digging, I have found few instances of = duplicated code (we can share sha2 with geli and so if sha512 is already = needed, it will become another =E2=80=9Cfree lunch=E2=80=9D). Also, = unless I=E2=80=99m mistaken, for some reason the bzip *compression* is = brought in - correct me if I=E2=80=99m wrong, but afaik only = decompression is needed=E2=80=A6 >>>>>=20 >>>>> So before going after =E2=80=9Cuseless features=E2=80=9D, there = are some =E2=80=9Chidden=E2=80=9D resources to remove extra fat. >>>>>=20 >>>>=20 >>>> I did some more digging. while ld has =E2=80=94gc-sections to clean = up unused bits, to make it effective, the code build does also need -Os = -fdata-sections -ffunction-sections. >>>> So I did just very simple test by adding those flags to = bsd.stand.mk and: >>>>=20 >>>> first the =E2=80=9Cdefault=E2=80=9D binaries from /boot: >>>> -r-xr-xr-x 1 root wheel 446464 Aug 19 08:46 /boot/zfsloader >>>> -rw-r--r-- 1 root wheel 438272 Aug 23 00:30 /boot/zfsloader.b >>>> -r-xr-xr-x 1 root wheel 446464 Aug 5 08:37 /boot/zfsloader.old >>>> -r--r--r-- 1 root wheel 406568 Aug 19 08:46 /boot/userboot.so >>>>=20 >>>> (note, zfsloader.b here is built with = https://reviews.freebsd.org/D7600) >>>>=20 >>>> now after adding compile flags -Os -fdata-sections = -ffunction-sections: >>>>=20 >>>> -rw-r--r-- 1 root wheel 389120 Aug 23 10:12 zfsloader >>>> -rwxr-xr-x 1 root wheel 378156 Aug 23 10:12 zfsloader.bin >>>> -rwxr-xr-x 1 root wheel 437514 Aug 23 10:12 zfsloader.sym >>>> -rwxr-xr-x 1 root wheel 375912 Aug 23 10:03 userboot.so >>>>=20 >>>> and finally test for Andriy with: >>>> LOADER_BZIP2_SUPPORT=3Dyes >>>> LOADER_FIREWIRE_SUPPORT=3Dyes >>>>=20 >>>> -rw-r--r-- 1 root wheel 421888 Aug 23 10:22 zfsloader >>>> -rwxr-xr-x 1 root wheel 409932 Aug 23 10:22 zfsloader.bin >>>> -rwxr-xr-x 1 root wheel 472021 Aug 23 10:22 zfsloader.sym >>>> -rwxr-xr-x 1 root wheel 375912 Aug 23 10:22 userboot.so >>>>=20 >>>> note the userboot.so did not change from those flags. >>>>=20 >>>> This is just an result from compile, and by adding 3 options to = bsd.stand.mk; however, not all Makefiles in loader tree seem to include = it, and most importantly, haven=E2=80=99t tested real boot yet;) >>>>=20 >>>> To conclude, some more work is needed to review the Makefiles, = build options used etc, also I don=E2=80=99t know all the background why = the compiler options are set as they currently are - were there any = related compiler/linker bugs, or any other reasons, also how/if other = platforms are affected - for example bsd.stand.mk does set -Os for pc98, = but not for others=E2=80=A6 >>>=20 >>> This is only size on disk, memory consuming still same, IMHO. >>=20 >> Actually this reduction above is entirely due to -Os, the = =E2=80=94gc-sections is not passed to linker (at least for zfsloader = case). I think we will need linker script to preserve set_Xcommand_set = linker set to use =E2=80=94gc-sections with ld. >>=20 >> Loader heap is separate already and does not contribute to this = issue. Also, I already did test the boot with thinned zfsloader, both = with and without bzip2 are appearing to work, at least for this quick = test anyhow. >=20 > Main trouble (by kib@) is 640KB real mode limit. > Separated heap don't soled this. > May be solution is early switch to protected mode, boot2? hm, but boot2 is already btx client and btx is setting up the protected = mode. Only zfsboot/gpt[zfs]boot memory copy (boot2 relocator) is working = in segmented real mode, so the gptldr.S and zfsldr.S has to deal with = memory segments to set boot2 up. Or did got you wrong? rgds, toomas From owner-svn-src-head@freebsd.org Tue Aug 23 12:36:25 2016 Return-Path: Delivered-To: svn-src-head@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 1A4FDBC3545; Tue, 23 Aug 2016 12:36:25 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 C84291448; Tue, 23 Aug 2016 12:36:24 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bcAwH-000OXD-OH; Tue, 23 Aug 2016 15:36:21 +0300 Date: Tue, 23 Aug 2016 15:36:21 +0300 From: Slawa Olhovchenkov To: Toomas Soome Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Toomas Soome , Andriy Gapon Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... Message-ID: <20160823123621.GB88122@zxy.spb.ru> References: <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> <20160823112940.GW22212@zxy.spb.ru> <20160823121629.GA88122@zxy.spb.ru> <151A63A8-6444-4E84-80B8-B773C8F661EF@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <151A63A8-6444-4E84-80B8-B773C8F661EF@me.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 12:36:25 -0000 On Tue, Aug 23, 2016 at 03:26:04PM +0300, Toomas Soome wrote: > > Main trouble (by kib@) is 640KB real mode limit. > > Separated heap don't soled this. > > May be solution is early switch to protected mode, boot2? > > hm, but boot2 is already btx client and btx is setting up the > protected mode. Only zfsboot/gpt[zfs]boot memory copy (boot2 > relocator) is working in segmented real mode, so the gptldr.S and > zfsldr.S has to deal with memory segments to set boot2 up. Or did > got you wrong? Mat be I am wrong. May be I am not very clean. As I understund kib@ restriction caused by 640KB realmode limit. In case of boot2 start in real mode and read enterly by boot1 -- we also touch this trouble. How to resolve this: 1) start entirely; boot2 in protected mode and read all boot2 to extended memory 2) read only part of boot2 (boot2 relocator) by boot1 and switch to protected mode before reading rest of boot2 by boot2 code. From owner-svn-src-head@freebsd.org Tue Aug 23 13:19:43 2016 Return-Path: Delivered-To: svn-src-head@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 EF754BC32A7; Tue, 23 Aug 2016 13:19:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B8C311F07; Tue, 23 Aug 2016 13:19:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NDJgVN081067; Tue, 23 Aug 2016 13:19:42 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NDJg4R081065; Tue, 23 Aug 2016 13:19:42 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608231319.u7NDJg4R081065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 23 Aug 2016 13:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304676 - head/usr.sbin/fifolog/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 13:19:44 -0000 Author: araujo Date: Tue Aug 23 13:19:42 2016 New Revision: 304676 URL: https://svnweb.freebsd.org/changeset/base/304676 Log: Fix calloc(3) argument order. MFC after: 4 weeks. Modified: head/usr.sbin/fifolog/lib/fifolog_int.c head/usr.sbin/fifolog/lib/fifolog_reader.c Modified: head/usr.sbin/fifolog/lib/fifolog_int.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_int.c Tue Aug 23 12:22:35 2016 (r304675) +++ head/usr.sbin/fifolog/lib/fifolog_int.c Tue Aug 23 13:19:42 2016 (r304676) @@ -125,7 +125,7 @@ fifolog_int_open_i(struct fifolog_file * /* Initialize zlib handling */ - f->zs = calloc(sizeof *f->zs, 1); + f->zs = calloc(1, sizeof(*f->zs)); if (f->zs == NULL) return ("cannot malloc"); Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_reader.c Tue Aug 23 12:22:35 2016 (r304675) +++ head/usr.sbin/fifolog/lib/fifolog_reader.c Tue Aug 23 13:19:42 2016 (r304676) @@ -59,7 +59,7 @@ fifolog_reader_open(const char *fname) struct fifolog_reader *fr; int i; - fr = calloc(sizeof *fr, 1); + fr = calloc(1, sizeof(*fr)); if (fr == NULL) err(1, "Cannot malloc"); From owner-svn-src-head@freebsd.org Tue Aug 23 13:35:50 2016 Return-Path: Delivered-To: svn-src-head@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 71D3EBC3815; Tue, 23 Aug 2016 13:35:50 +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 356781A5F; Tue, 23 Aug 2016 13:35:50 +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 u7NDZnP3088250; Tue, 23 Aug 2016 13:35:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NDZnI1088246; Tue, 23 Aug 2016 13:35:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608231335.u7NDZnI1088246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 23 Aug 2016 13:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304677 - in head/sys/boot: common efi/libefi efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 13:35:50 -0000 Author: bapt Date: Tue Aug 23 13:35:48 2016 New Revision: 304677 URL: https://svnweb.freebsd.org/changeset/base/304677 Log: Add tftpfs support for the EFI loader Allow netbooting on efi without having to setup any NFS server by rebuilding the loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader Sponsored by: Gandi.net Modified: head/sys/boot/common/dev_net.c head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/conf.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Tue Aug 23 13:19:42 2016 (r304676) +++ head/sys/boot/common/dev_net.c Tue Aug 23 13:35:48 2016 (r304677) @@ -167,8 +167,13 @@ net_open(struct open_file *f, ...) setenv("boot.netif.ip", inet_ntoa(myip), 1); setenv("boot.netif.netmask", intoa(netmask), 1); setenv("boot.netif.gateway", inet_ntoa(gateip), 1); +#ifdef LOADER_TFTP_SUPPORT + setenv("boot.tftproot.server", inet_ntoa(rootip), 1); + setenv("boot.tftproot.path", rootpath, 1); +#else setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); +#endif if (intf_mtu != 0) { char mtu[16]; sprintf(mtu, "%u", intf_mtu); Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Aug 23 13:19:42 2016 (r304676) +++ head/sys/boot/efi/libefi/Makefile Tue Aug 23 13:35:48 2016 (r304677) @@ -13,6 +13,10 @@ SRCS+= time.c SRCS+= time_event.c .endif +.if defined(LOADER_TFTP_SUPPORT) +CFLAGS+= -DLOADER_TFTP_SUPPORT +.endif + # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Aug 23 13:19:42 2016 (r304676) +++ head/sys/boot/efi/loader/Makefile Tue Aug 23 13:35:48 2016 (r304677) @@ -21,6 +21,10 @@ SRCS= autoload.c \ smbios.c \ vers.c +.if defined(LOADER_TFTP_SUPPORT) +CFLAGS+= -DLOADER_TFTP_SUPPORT +.endif + .if ${MK_ZFS} != "no" SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs Modified: head/sys/boot/efi/loader/conf.c ============================================================================== --- head/sys/boot/efi/loader/conf.c Tue Aug 23 13:19:42 2016 (r304676) +++ head/sys/boot/efi/loader/conf.c Tue Aug 23 13:35:48 2016 (r304677) @@ -51,7 +51,11 @@ struct fs_ops *file_system[] = { &dosfs_fsops, &ufs_fsops, &cd9660_fsops, +#ifdef LOADER_TFTP_SUPPORT + &tftp_fsops, +#else &nfs_fsops, +#endif &gzipfs_fsops, &bzipfs_fsops, NULL From owner-svn-src-head@freebsd.org Tue Aug 23 13:43:44 2016 Return-Path: Delivered-To: svn-src-head@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 88FECBC3AE4; Tue, 23 Aug 2016 13:43:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5BC7A1F67; Tue, 23 Aug 2016 13:43:44 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NDhhxo091778; Tue, 23 Aug 2016 13:43:43 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NDhh9t091777; Tue, 23 Aug 2016 13:43:43 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608231343.u7NDhh9t091777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 23 Aug 2016 13:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304678 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 13:43:44 -0000 Author: araujo Date: Tue Aug 23 13:43:43 2016 New Revision: 304678 URL: https://svnweb.freebsd.org/changeset/base/304678 Log: Use roundup2() from sys/param.h. Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Tue Aug 23 13:35:48 2016 (r304677) +++ head/usr.sbin/kldxref/kldxref.c Tue Aug 23 13:43:43 2016 (r304678) @@ -74,7 +74,7 @@ static int reccnt; /* total record writt static void intalign(void) { - recpos = (recpos + sizeof(int) - 1) & ~(sizeof(int) - 1); + recpos = roundup2(recpos, sizeof(int)); } static void From owner-svn-src-head@freebsd.org Tue Aug 23 13:44:06 2016 Return-Path: Delivered-To: svn-src-head@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 DF912BC3B2E; Tue, 23 Aug 2016 13:44:06 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp003.me.com (st13p35im-asmtp003.me.com [17.164.199.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B13EE1230; Tue, 23 Aug 2016 13:44:06 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp003.me.com by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OCD00D007H1KI00@st13p35im-asmtp003.me.com>; Tue, 23 Aug 2016 13:44:05 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471959845; bh=bt00acq9frRgCDol9VDhWXuFAHcwtWpPDSwjT8/E+r4=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=S33lyaYnNx0Yte0Dfp8N7KagTnv0l2lYDmwaBMhSitAGPOiKT8/Eryi+J+upXnbQR M9QCvt73saUzTA/a8t8NPp8pKckJnxxZl34zFsUtXZDNuDFdgPz1G4BszTOtlxQmkY CU+qPgsUV2YtC2p2g9fzR8kTvL+nL+P4xBY0gHHKBRlF5ItoYntxFu1afTDbw9xvkO 3wz9fwITFHueOHg5n7svkOB2ENpx9B3gU0jmCxp+NZ52TYL5UD6qCXJyCWMUV4OYG9 9lGpOmYecrT1aBx71MgCnKkZhavO3wGwDfK3GTsVnTOQdguLKyo9MnGlhG/hRDHDI0 xHYLaYIFtNW5Q== Received: from [88.196.10.91] (91-10-196-88.dyn.estpak.ee [88.196.10.91]) by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OCD00JBI7HD5840@st13p35im-asmtp003.me.com>; Tue, 23 Aug 2016 13:44:05 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-23_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=18 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608230138 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... From: Toomas Soome In-reply-to: <20160823123621.GB88122@zxy.spb.ru> Date: Tue, 23 Aug 2016 16:44:01 +0300 Cc: Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Toomas Soome , Andriy Gapon Content-transfer-encoding: quoted-printable Message-id: <70353DFD-06E4-4D18-9D01-187C402BC302@me.com> References: <7bdb0cf5-e139-375b-8be6-c1280e39da25@FreeBSD.org> <4c76efd6-146a-e70b-c065-729d223e3398@FreeBSD.org> <1C479C8A-9F58-425C-8AC2-0A6809F39ACA@me.com> <20160823112940.GW22212@zxy.spb.ru> <20160823121629.GA88122@zxy.spb.ru> <151A63A8-6444-4E84-80B8-B773C8F661EF@me.com> <20160823123621.GB88122@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 13:44:07 -0000 > On 23. aug 2016, at 15:36, Slawa Olhovchenkov wrote: >=20 > On Tue, Aug 23, 2016 at 03:26:04PM +0300, Toomas Soome wrote: >=20 >>> Main trouble (by kib@) is 640KB real mode limit. >>> Separated heap don't soled this. >>> May be solution is early switch to protected mode, boot2? >>=20 >> hm, but boot2 is already btx client and btx is setting up the >> protected mode. Only zfsboot/gpt[zfs]boot memory copy (boot2 >> relocator) is working in segmented real mode, so the gptldr.S and >> zfsldr.S has to deal with memory segments to set boot2 up. Or did >> got you wrong? >=20 > Mat be I am wrong. > May be I am not very clean. > As I understund kib@ restriction caused by 640KB realmode limit. > In case of boot2 start in real mode and read enterly by boot1 -- we > also touch this trouble. >=20 > How to resolve this: >=20 > 1) start entirely; boot2 in protected mode and read all boot2 to > extended memory >=20 > 2) read only part of boot2 (boot2 relocator) by boot1 and switch to > protected mode before reading rest of boot2 by boot2 code. Ah, well, the boot2 by itself is not an issue - it is much smaller and = the only related problem was that real mode relocator was using segment = size (64k) for copy, but this limit is removed (was pre-requisite for = geli support in gptboot and I did port that change to zfsboot as well). = The size issue with loader (stage3) is due to fact that loader memory = image is located in low memory, base 0xa000 and the upper limit is EBDA = and video memory area. Since boot2 is running in protected mode, it can = load loader (or kernel) were needed, just that placing loader must be = careful=E2=80=A6 in that sense the current location is almost perfect = (with exception about the size limit;) and I would avoid moving it = without the very good reason. rgds, toomas= From owner-svn-src-head@freebsd.org Tue Aug 23 13:53:39 2016 Return-Path: Delivered-To: svn-src-head@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 75DD8BC3F48; Tue, 23 Aug 2016 13:53:39 +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 46E541A5E; Tue, 23 Aug 2016 13:53:39 +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 u7NDrcue095855; Tue, 23 Aug 2016 13:53:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NDrcXi095853; Tue, 23 Aug 2016 13:53:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608231353.u7NDrcXi095853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 23 Aug 2016 13:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304680 - in head/sys/boot/efi: libefi loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 13:53:39 -0000 Author: bapt Date: Tue Aug 23 13:53:38 2016 New Revision: 304680 URL: https://svnweb.freebsd.org/changeset/base/304680 Log: EFI loader: only open/close on the net device with tftpfs It prevents issuing a dhcp request before each file open As a consequence netbooting over tftpfs is significantly faster Sponsored by: Gandi.net Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Aug 23 13:51:55 2016 (r304679) +++ head/sys/boot/efi/libefi/Makefile Tue Aug 23 13:53:38 2016 (r304680) @@ -14,7 +14,7 @@ SRCS+= time_event.c .endif .if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT +CFLAGS+= -DLOADER_TFTP_SUPPORT -DNETIF_OPEN_CLOSE_ONCE .endif # We implement a slightly non-standard %S in that it always takes a Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Aug 23 13:51:55 2016 (r304679) +++ head/sys/boot/efi/loader/Makefile Tue Aug 23 13:53:38 2016 (r304680) @@ -22,7 +22,7 @@ SRCS= autoload.c \ vers.c .if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT +CFLAGS+= -DLOADER_TFTP_SUPPORT -DNETIF_OPEN_CLOSE_ONCE .endif .if ${MK_ZFS} != "no" From owner-svn-src-head@freebsd.org Tue Aug 23 15:20:33 2016 Return-Path: Delivered-To: svn-src-head@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 CC95EBC3EE4; Tue, 23 Aug 2016 15:20:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83AB11551; Tue, 23 Aug 2016 15:20:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFKWA7029333; Tue, 23 Aug 2016 15:20:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFKWIA029332; Tue, 23 Aug 2016 15:20:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608231520.u7NFKWIA029332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Aug 2016 15:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304681 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 15:20:33 -0000 Author: bdrewery Date: Tue Aug 23 15:20:32 2016 New Revision: 304681 URL: https://svnweb.freebsd.org/changeset/base/304681 Log: Always pass in -target and --sysroot flags for the build. The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX and target set by TARGET/TARGET_ARCH. However, there are several needs to always pass an explicit --sysroot and -target. - External compiler needs sysroot and target flags. - External ld needs sysroot. - To be clear about the use of a sysroot when using the internal compiler. - Easier debugging. - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to the flip-flopping build command when sometimes using external and sometimes using internal. - Allow using no lld which has support for default paths. The default sysroot in the bootstrap compiler is not changed. The buildenv compiler will still work with its default and will also include -target/--sysroot from CC in the environment. MFC after: 3 days Discussed with: emaste, brooks (BSDCam) Reviewed by: emaste Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 23 13:53:38 2016 (r304680) +++ head/Makefile.inc1 Tue Aug 23 15:20:32 2016 (r304681) @@ -550,8 +550,18 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="$ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif -# External compiler needs sysroot and target flags. -.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" + +# The internal bootstrap compiler has a default sysroot set by TOOLS_PREFIX +# and target set by TARGET/TARGET_ARCH. However, there are several needs to +# always pass an explicit --sysroot and -target. +# - External compiler needs sysroot and target flags. +# - External ld needs sysroot. +# - To be clear about the use of a sysroot when using the internal compiler. +# - Easier debugging. +# - Allowing WITH_SYSTEM_COMPILER+WITH_META_MODE to work together due to +# the flip-flopping build command when sometimes using external and +# sometimes using internal. +# - Allow using lld which has no support for default paths. .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif @@ -579,7 +589,6 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x8 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} -.endif # ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" .if !empty(BFLAGS) XCFLAGS+= ${BFLAGS} From owner-svn-src-head@freebsd.org Tue Aug 23 15:22:18 2016 Return-Path: Delivered-To: svn-src-head@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 4C229BC30F8; Tue, 23 Aug 2016 15:22:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D3C11A32; Tue, 23 Aug 2016 15:22:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFMHBX033003; Tue, 23 Aug 2016 15:22:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFMHra033002; Tue, 23 Aug 2016 15:22:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608231522.u7NFMHra033002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Aug 2016 15:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304682 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 15:22:18 -0000 Author: bdrewery Date: Tue Aug 23 15:22:17 2016 New Revision: 304682 URL: https://svnweb.freebsd.org/changeset/base/304682 Log: Re-enable WITH_SYSTEM_COMPILER with WITH_META_MODE. This was disabled in r301468 due to -target/--sysroot sometimes being used in the build and other times not being used. Now that it is always used since r304681, it is safe to combine the features. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Aug 23 15:20:32 2016 (r304681) +++ head/share/mk/src.opts.mk Tue Aug 23 15:22:17 2016 (r304682) @@ -356,10 +356,6 @@ MK_ELFTOOLCHAIN_BOOTSTRAP:= no MK_GCC_BOOTSTRAP:= no .endif -.if ${MK_META_MODE} == "yes" -MK_SYSTEM_COMPILER:= no -.endif - .if ${MK_TOOLCHAIN} == "no" MK_BINUTILS:= no MK_CLANG:= no From owner-svn-src-head@freebsd.org Tue Aug 23 15:31:54 2016 Return-Path: Delivered-To: svn-src-head@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 AC1B9BC345B; Tue, 23 Aug 2016 15:31:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D278156C; Tue, 23 Aug 2016 15:31:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFVrJx036935; Tue, 23 Aug 2016 15:31:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFVrkE036934; Tue, 23 Aug 2016 15:31:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608231531.u7NFVrkE036934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Aug 2016 15:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304683 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 15:31:54 -0000 Author: bdrewery Date: Tue Aug 23 15:31:53 2016 New Revision: 304683 URL: https://svnweb.freebsd.org/changeset/base/304683 Log: Regenerate Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Aug 23 15:22:17 2016 (r304682) +++ head/share/man/man5/src.conf.5 Tue Aug 23 15:31:53 2016 (r304683) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd August 22, 2016 +.Dd August 23, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -542,10 +542,6 @@ When set, it also enforces the following When set, the following options are also in effect: .Pp .Bl -inset -compact -.It Va WITHOUT_SYSTEM_COMPILER -(unless -.Va WITH_SYSTEM_COMPILER -is set explicitly) .It Va WITH_AUTO_OBJ (unless .Va WITHOUT_AUTO_OBJ @@ -1147,14 +1143,6 @@ to .Pp Currently this also enforces .Va WITHOUT_SYSTEM_COMPILER . -When set, the following options are also in effect: -.Pp -.Bl -inset -compact -.It Va WITHOUT_SYSTEM_COMPILER -(unless -.Va WITH_SYSTEM_COMPILER -is set explicitly) -.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , From owner-svn-src-head@freebsd.org Tue Aug 23 15:46:21 2016 Return-Path: Delivered-To: svn-src-head@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 63676BC3C6F; Tue, 23 Aug 2016 15:46:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3392B1F8B; Tue, 23 Aug 2016 15:46:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFkKQt041037; Tue, 23 Aug 2016 15:46:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFkKNf041034; Tue, 23 Aug 2016 15:46:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608231546.u7NFkKNf041034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 23 Aug 2016 15:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304684 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 15:46:21 -0000 Author: pfg Date: Tue Aug 23 15:46:20 2016 New Revision: 304684 URL: https://svnweb.freebsd.org/changeset/base/304684 Log: indent(1): remove dead assignments. Taken from: Piotr Sephaniak Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/io.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Tue Aug 23 15:31:53 2016 (r304683) +++ head/usr.bin/indent/indent.c Tue Aug 23 15:46:20 2016 (r304684) @@ -1161,7 +1161,6 @@ check_type: case comment: /* we have gotten a / followed by * this is a biggie */ if (flushed_nl) { /* we should force a broken line here */ - flushed_nl = false; dump_line(); ps.want_blank = false; /* dont insert blank at line start */ force_nl = false; Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Tue Aug 23 15:31:53 2016 (r304683) +++ head/usr.bin/indent/io.c Tue Aug 23 15:46:20 2016 (r304684) @@ -242,7 +242,7 @@ dump_line(void) } while (e_com > com_st && isspace(e_com[-1])) e_com--; - cur_col = pad_output(cur_col, target); + (void)pad_output(cur_col, target); fwrite(com_st, e_com - com_st, 1, output); ps.comment_delta = ps.n_comment_delta; ++ps.com_lines; /* count lines with comments */ From owner-svn-src-head@freebsd.org Tue Aug 23 15:48:28 2016 Return-Path: Delivered-To: svn-src-head@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 7C57FBC3D60; Tue, 23 Aug 2016 15:48:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4939B12B1; Tue, 23 Aug 2016 15:48:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFmRR2041149; Tue, 23 Aug 2016 15:48:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFmRuP041148; Tue, 23 Aug 2016 15:48:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608231548.u7NFmRuP041148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 23 Aug 2016 15:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304685 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 15:48:28 -0000 Author: andrew Date: Tue Aug 23 15:48:27 2016 New Revision: 304685 URL: https://svnweb.freebsd.org/changeset/base/304685 Log: Include the offset the virtual address is within an L1 or L2 block when finding the vm_page_t in pmap_extract_and_hold. Previously it would return the vm_page_t of the first page in a block. This would cause issues when, for example, fsck reads from a device into the middle of a superpage. In this case the read call would write to the start of the block, and not to the buffer passed in. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 23 15:46:20 2016 (r304684) +++ head/sys/arm64/arm64/pmap.c Tue Aug 23 15:48:27 2016 (r304685) @@ -995,6 +995,7 @@ vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { pt_entry_t *pte, tpte; + vm_offset_t off; vm_paddr_t pa; vm_page_t m; int lvl; @@ -1016,9 +1017,20 @@ retry: tpte & ATTR_DESCR_MASK)); if (((tpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) || ((prot & VM_PROT_WRITE) == 0)) { + switch(lvl) { + case 1: + off = va & L1_OFFSET; + break; + case 2: + off = va & L2_OFFSET; + break; + case 3: + default: + off = 0; + } if (vm_page_pa_tryrelock(pmap, tpte & ~ATTR_MASK, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE((tpte & ~ATTR_MASK) | off); vm_page_hold(m); } } From owner-svn-src-head@freebsd.org Tue Aug 23 15:49:32 2016 Return-Path: Delivered-To: svn-src-head@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 6D71CBC3E88; Tue, 23 Aug 2016 15:49:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF2015F8; Tue, 23 Aug 2016 15:49:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NFnVkj041226; Tue, 23 Aug 2016 15:49:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NFnViG041225; Tue, 23 Aug 2016 15:49:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608231549.u7NFnViG041225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 23 Aug 2016 15:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304686 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 15:49:32 -0000 Author: pfg Date: Tue Aug 23 15:49:31 2016 New Revision: 304686 URL: https://svnweb.freebsd.org/changeset/base/304686 Log: indent(1): have the memset invocation somewhat more canonical. While correct, the previous invocation was somewhat more error prone. Pointed out by: delphij, bde Modified: head/usr.bin/indent/io.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Tue Aug 23 15:48:27 2016 (r304685) +++ head/usr.bin/indent/io.c Tue Aug 23 15:49:31 2016 (r304686) @@ -630,7 +630,7 @@ parsefont(struct fstate *f, const char * const char *s = s0; int sizedelta = 0; - memset(f, 0, sizeof(struct fstate)); + memset(f, '\0', sizeof(*f)); while (*s) { if (isdigit(*s)) f->size = f->size * 10 + *s - '0'; From owner-svn-src-head@freebsd.org Tue Aug 23 16:12:26 2016 Return-Path: Delivered-To: svn-src-head@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 DCAA2BC2955; Tue, 23 Aug 2016 16:12:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF2C1E10; Tue, 23 Aug 2016 16:12:26 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NGCPuj052792; Tue, 23 Aug 2016 16:12:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NGCPi3052791; Tue, 23 Aug 2016 16:12:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608231612.u7NGCPi3052791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 23 Aug 2016 16:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304687 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 16:12:27 -0000 Author: andrew Date: Tue Aug 23 16:12:25 2016 New Revision: 304687 URL: https://svnweb.freebsd.org/changeset/base/304687 Log: If we find we have a superpage in pmap_enter_quick_locked return without trying to add a new level 3 page. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 23 15:49:31 2016 (r304686) +++ head/sys/arm64/arm64/pmap.c Tue Aug 23 16:12:25 2016 (r304687) @@ -2696,7 +2696,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ { struct spglist free; pd_entry_t *pde; - pt_entry_t *l3; + pt_entry_t *l2, *l3; vm_paddr_t pa; int lvl; @@ -2731,6 +2731,12 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * attempt to allocate a page table page. If this * attempt fails, we don't retry. Instead, we give up. */ + if (lvl == 1) { + l2 = pmap_l1_to_l2(pde, va); + if ((pmap_load(l2) & ATTR_DESCR_MASK) == + L2_BLOCK) + return (NULL); + } if (lvl == 2 && pmap_load(pde) != 0) { mpte = PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); From owner-svn-src-head@freebsd.org Tue Aug 23 16:17:33 2016 Return-Path: Delivered-To: svn-src-head@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 E8400BC2A1B; Tue, 23 Aug 2016 16:17:33 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (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 C819412E8; Tue, 23 Aug 2016 16:17:33 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.15.0.59/8.15.0.59) with SMTP id u7NGELLM007769; Tue, 23 Aug 2016 11:17:25 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 25067p8khs-1; Tue, 23 Aug 2016 11:17:25 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-205.lightspeed.hstntx.sbcglobal.net [108.254.203.205]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 3ED9A40412; Tue, 23 Aug 2016 11:17:25 -0500 (CDT) Subject: Re: svn commit: r304685 - head/sys/arm64/arm64 To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608231548.u7NFmRuP041148@repo.freebsd.org> From: Alan Cox Message-ID: <89eccc71-ec8a-545b-c212-387580b10965@rice.edu> Date: Tue, 23 Aug 2016 11:17:24 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608231548.u7NFmRuP041148@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608230161 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 16:17:34 -0000 On 08/23/2016 10:48, Andrew Turner wrote: > Author: andrew > Date: Tue Aug 23 15:48:27 2016 > New Revision: 304685 > URL: https://svnweb.freebsd.org/changeset/base/304685 > > Log: > Include the offset the virtual address is within an L1 or L2 block wh= en > finding the vm_page_t in pmap_extract_and_hold. Previously it would r= eturn > the vm_page_t of the first page in a block. This would cause issues w= hen, > for example, fsck reads from a device into the middle of a superpage.= In > this case the read call would write to the start of the block, and no= t to > the buffer passed in. > =20 > Obtained from: ABT Systems Ltd > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm64/arm64/pmap.c Tue Aug 23 15:46:20 2016 (r304684) > +++ head/sys/arm64/arm64/pmap.c Tue Aug 23 15:48:27 2016 (r304685) > @@ -995,6 +995,7 @@ vm_page_t > pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) > { > pt_entry_t *pte, tpte; > + vm_offset_t off; > vm_paddr_t pa; > vm_page_t m; > int lvl; > @@ -1016,9 +1017,20 @@ retry: > tpte & ATTR_DESCR_MASK)); > if (((tpte & ATTR_AP_RW_BIT) =3D=3D ATTR_AP(ATTR_AP_RW)) || > ((prot & VM_PROT_WRITE) =3D=3D 0)) { > + switch(lvl) { > + case 1: > + off =3D va & L1_OFFSET; > + break; > + case 2: > + off =3D va & L2_OFFSET; > + break; > + case 3: > + default: > + off =3D 0; > + } I would strongly suggest that you also include the page offset in the value passed to vm_page_pa_tryrelock(). Otherwise, if we ever change the mapping from physical addresses to page locks, this code will be acquiring the wrong lock. Other pmap implementations, e.g., amd64, do include the offset. > if (vm_page_pa_tryrelock(pmap, tpte & ~ATTR_MASK, &pa)) > goto retry; > - m =3D PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK); > + m =3D PHYS_TO_VM_PAGE((tpte & ~ATTR_MASK) | off); > vm_page_hold(m); > } > } > > From owner-svn-src-head@freebsd.org Tue Aug 23 16:20:57 2016 Return-Path: Delivered-To: svn-src-head@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 B31D1BC2B75; Tue, 23 Aug 2016 16:20:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 828A5159F; Tue, 23 Aug 2016 16:20:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NGKu2m055168; Tue, 23 Aug 2016 16:20:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NGKu0I055167; Tue, 23 Aug 2016 16:20:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608231620.u7NGKu0I055167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 23 Aug 2016 16:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304688 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 16:20:57 -0000 Author: andrew Date: Tue Aug 23 16:20:56 2016 New Revision: 304688 URL: https://svnweb.freebsd.org/changeset/base/304688 Log: Map memory as read-only in pmap_enter_quick_locked as is done in other pmap implementations. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 23 16:12:25 2016 (r304687) +++ head/sys/arm64/arm64/pmap.c Tue Aug 23 16:20:56 2016 (r304688) @@ -2794,7 +2794,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ pmap_resident_count_inc(pmap, 1); pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_IDX(m->md.pv_memattr) | - ATTR_AP(ATTR_AP_RW) | L3_PAGE; + ATTR_AP(ATTR_AP_RO) | L3_PAGE; /* * Now validate mapping with RO protection From owner-svn-src-head@freebsd.org Tue Aug 23 16:37:06 2016 Return-Path: Delivered-To: svn-src-head@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 2A377BC319A; Tue, 23 Aug 2016 16:37:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1355313B7; Tue, 23 Aug 2016 16:37:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 09887110B; Tue, 23 Aug 2016 16:37:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C1655231A4; Tue, 23 Aug 2016 16:37:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id bd1iWxHUPGRc; Tue, 23 Aug 2016 16:37:02 +0000 (UTC) Subject: Re: svn commit: r304681 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B2DBC2319C To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608231520.u7NFKWIA029332@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <2ccc112b-4c57-e8f5-3c9c-8c4707897094@FreeBSD.org> Date: Tue, 23 Aug 2016 09:37:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608231520.u7NFKWIA029332@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="K1wGR8uGiRKJdvI73MGPQaHihA4kP0BHp" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 16:37:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K1wGR8uGiRKJdvI73MGPQaHihA4kP0BHp Content-Type: multipart/mixed; boundary="faJluubEceASW2OPvqIJxW1LNGUPsGSxh" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2ccc112b-4c57-e8f5-3c9c-8c4707897094@FreeBSD.org> Subject: Re: svn commit: r304681 - head References: <201608231520.u7NFKWIA029332@repo.freebsd.org> In-Reply-To: <201608231520.u7NFKWIA029332@repo.freebsd.org> --faJluubEceASW2OPvqIJxW1LNGUPsGSxh Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/23/2016 8:20 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Aug 23 15:20:32 2016 > New Revision: 304681 > URL: https://svnweb.freebsd.org/changeset/base/304681 >=20 > Log: > Always pass in -target and --sysroot flags for the build. Sorry this breaks in-tree GCC builds. Testing a fix now. --=20 Regards, Bryan Drewery --faJluubEceASW2OPvqIJxW1LNGUPsGSxh-- --K1wGR8uGiRKJdvI73MGPQaHihA4kP0BHp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXvHuvAAoJEDXXcbtuRpfP/WkIALZ5a1CpjERlwV1+M9aOQpMh tbHHgFzDNW8YURVpawH34Y7LyjC1CcZKovB0xvwymyMU8bu3GakTWjp1CIRqAAe8 E/YlpC2FwmpCfuND2L7t9R5TJjNpaox2Vxt3oqbO+1tpb/I7ltUrcgENwoKAuxn5 FyozngDZ1FjpPMfNBPDx8Yw10VAWQvE2MvS9db5jHsI951jamJnyVG2XCHMxaQ6e jNcKoF1XPMzf35q4f4vhc2u1NzIGs4gh0JwkxVCda7ZY+eigLTOtWfKFxeaqR7g3 hQpXj+pE4+wFKzwWmmDHyhqyRag+WvAxowv9jopNEUu7ump3A1H8uFlvUcHdE/c= =5+Jy -----END PGP SIGNATURE----- --K1wGR8uGiRKJdvI73MGPQaHihA4kP0BHp-- From owner-svn-src-head@freebsd.org Tue Aug 23 16:37:35 2016 Return-Path: Delivered-To: svn-src-head@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 4B8E6BC3206; Tue, 23 Aug 2016 16:37:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18B5E1626; Tue, 23 Aug 2016 16:37:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NGbYAL060990; Tue, 23 Aug 2016 16:37:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NGbYsN060989; Tue, 23 Aug 2016 16:37:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608231637.u7NGbYsN060989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 23 Aug 2016 16:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304689 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 16:37:35 -0000 Author: andrew Date: Tue Aug 23 16:37:34 2016 New Revision: 304689 URL: https://svnweb.freebsd.org/changeset/base/304689 Log: Also adjust the virtual address passed to vm_page_pa_tryrelock. Reported by: alc Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Aug 23 16:20:56 2016 (r304688) +++ head/sys/arm64/arm64/pmap.c Tue Aug 23 16:37:34 2016 (r304689) @@ -1028,7 +1028,8 @@ retry: default: off = 0; } - if (vm_page_pa_tryrelock(pmap, tpte & ~ATTR_MASK, &pa)) + if (vm_page_pa_tryrelock(pmap, + (tpte & ~ATTR_MASK) | off, &pa)) goto retry; m = PHYS_TO_VM_PAGE((tpte & ~ATTR_MASK) | off); vm_page_hold(m); From owner-svn-src-head@freebsd.org Tue Aug 23 17:42:04 2016 Return-Path: Delivered-To: svn-src-head@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 C46B1BC4B34; Tue, 23 Aug 2016 17:42:04 +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 86E921B52; Tue, 23 Aug 2016 17:42:04 +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 u7NHg36K087423; Tue, 23 Aug 2016 17:42:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NHg32t087422; Tue, 23 Aug 2016 17:42:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608231742.u7NHg32t087422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 23 Aug 2016 17:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304691 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 17:42:04 -0000 Author: emaste Date: Tue Aug 23 17:42:03 2016 New Revision: 304691 URL: https://svnweb.freebsd.org/changeset/base/304691 Log: bspatch: apply style(9) Make style changes (and trivial refactoring of open calls) now in order to reduce noise in diffs for future capsicum changes. Reviewed by: oshogbo No objection: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7610 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Tue Aug 23 17:38:06 2016 (r304690) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Tue Aug 23 17:42:03 2016 (r304691) @@ -28,12 +28,12 @@ __FBSDID("$FreeBSD$"); #include -#include +#include +#include #include +#include #include -#include #include -#include #ifndef O_BINARY #define O_BINARY 0 @@ -43,18 +43,19 @@ static off_t offtin(u_char *buf) { off_t y; - y=buf[7]&0x7F; - y=y*256;y+=buf[6]; - y=y*256;y+=buf[5]; - y=y*256;y+=buf[4]; - y=y*256;y+=buf[3]; - y=y*256;y+=buf[2]; - y=y*256;y+=buf[1]; - y=y*256;y+=buf[0]; + y = buf[7] & 0x7F; + y = y * 256; y += buf[6]; + y = y * 256; y += buf[5]; + y = y * 256; y += buf[4]; + y = y * 256; y += buf[3]; + y = y * 256; y += buf[2]; + y = y * 256; y += buf[1]; + y = y * 256; y += buf[0]; - if(buf[7]&0x80) y=-y; + if (buf[7] & 0x80) + y = -y; - return y; + return (y); } static void @@ -65,17 +66,17 @@ usage(void) exit(1); } -int main(int argc,char * argv[]) +int main(int argc, char *argv[]) { - FILE * f, * cpf, * dpf, * epf; - BZFILE * cpfbz2, * dpfbz2, * epfbz2; + FILE *f, *cpf, *dpf, *epf; + BZFILE *cpfbz2, *dpfbz2, *epfbz2; int cbz2err, dbz2err, ebz2err; - int fd; - ssize_t oldsize,newsize; - ssize_t bzctrllen,bzdatalen; - u_char header[32],buf[8]; + int newfd, oldfd; + ssize_t oldsize, newsize; + ssize_t bzctrllen, bzdatalen; + u_char header[32], buf[8]; u_char *old, *new; - off_t oldpos,newpos; + off_t oldpos, newpos; off_t ctrl[3]; off_t lenread; off_t i; @@ -113,11 +114,11 @@ int main(int argc,char * argv[]) errx(1, "Corrupt patch\n"); /* Read lengths from header */ - bzctrllen=offtin(header+8); - bzdatalen=offtin(header+16); - newsize=offtin(header+24); - if((bzctrllen<0) || (bzdatalen<0) || (newsize<0)) - errx(1,"Corrupt patch\n"); + bzctrllen = offtin(header + 8); + bzdatalen = offtin(header + 16); + newsize = offtin(header + 24); + if ((bzctrllen < 0) || (bzdatalen < 0) || (newsize < 0)) + errx(1, "Corrupt patch\n"); /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) @@ -144,32 +145,37 @@ int main(int argc,char * argv[]) if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); - if(((fd=open(argv[1],O_RDONLY|O_BINARY,0))<0) || - ((oldsize=lseek(fd,0,SEEK_END))==-1) || - ((old=malloc(oldsize+1))==NULL) || - (lseek(fd,0,SEEK_SET)!=0) || - (read(fd,old,oldsize)!=oldsize) || - (close(fd)==-1)) err(1,"%s",argv[1]); - if((new=malloc(newsize+1))==NULL) err(1,NULL); - - oldpos=0;newpos=0; - while(newposnewsize) - errx(1,"Corrupt patch\n"); + if (newpos + ctrl[0] > newsize) + errx(1, "Corrupt patch\n"); /* Read diff string */ lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); @@ -178,17 +184,17 @@ int main(int argc,char * argv[]) errx(1, "Corrupt patch\n"); /* Add old data to diff string */ - for(i=0;i=0) && (oldpos+i= 0) && (oldpos + i < oldsize)) + new[newpos + i] += old[oldpos + i]; /* Adjust pointers */ - newpos+=ctrl[0]; - oldpos+=ctrl[0]; + newpos += ctrl[0]; + oldpos += ctrl[0]; /* Sanity-check */ - if(newpos+ctrl[1]>newsize) - errx(1,"Corrupt patch\n"); + if (newpos + ctrl[1] > newsize) + errx(1, "Corrupt patch\n"); /* Read extra string */ lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); @@ -209,12 +215,14 @@ int main(int argc,char * argv[]) err(1, "fclose(%s)", argv[3]); /* Write the new file */ - if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY|O_BINARY,0666))<0) || - (write(fd,new,newsize)!=newsize) || (close(fd)==-1)) - err(1,"%s",argv[2]); + newfd = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666); + if (newfd < 0) + err(1, "%s", argv[2]); + if (write(newfd, new, newsize) != newsize || close(newfd) == -1) + err(1, "%s", argv[2]); free(new); free(old); - return 0; + return (0); } From owner-svn-src-head@freebsd.org Tue Aug 23 19:03:12 2016 Return-Path: Delivered-To: svn-src-head@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 AD4ACBC4955; Tue, 23 Aug 2016 19:03:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 737F41C8B; Tue, 23 Aug 2016 19:03:12 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJ3BPj019152; Tue, 23 Aug 2016 19:03:11 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJ3Bjc019151; Tue, 23 Aug 2016 19:03:11 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608231903.u7NJ3Bjc019151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 23 Aug 2016 19:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304692 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:03:12 -0000 Author: landonf Date: Tue Aug 23 19:03:11 2016 New Revision: 304692 URL: https://svnweb.freebsd.org/changeset/base/304692 Log: bhndb(4): Fix unsigned integer underflow in dynamic register window handling. This resulted in the window target being left uninitialized when an underflow occured. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7617 Modified: head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Aug 23 17:42:03 2016 (r304691) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Aug 23 19:03:11 2016 (r304692) @@ -1728,8 +1728,9 @@ bhndb_io_resource(struct bhndb_softc *sc /* Adjust the window if the I/O request won't fit in the current * target range. */ - if (addr < dwa->target || - (dwa->target + dwa->win->win_size) - addr < size) + if (addr < dwa->target || + addr > dwa->target + dwa->win->win_size || + (dwa->target + dwa->win->win_size) - addr < size) { error = bhndb_dw_set_addr(sc->dev, sc->bus_res, dwa, addr, size); From owner-svn-src-head@freebsd.org Tue Aug 23 19:15:02 2016 Return-Path: Delivered-To: svn-src-head@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 56DCDBC4D2A; Tue, 23 Aug 2016 19:15:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 281E61643; Tue, 23 Aug 2016 19:15:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJF1b8023105; Tue, 23 Aug 2016 19:15:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJF1PL023104; Tue, 23 Aug 2016 19:15:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608231915.u7NJF1PL023104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 23 Aug 2016 19:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304693 - head/usr.bin/getconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:15:02 -0000 Author: ngie Date: Tue Aug 23 19:15:01 2016 New Revision: 304693 URL: https://svnweb.freebsd.org/changeset/base/304693 Log: Clean up trailing whitespace MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/getconf/getconf.c Modified: head/usr.bin/getconf/getconf.c ============================================================================== --- head/usr.bin/getconf/getconf.c Tue Aug 23 19:03:11 2016 (r304692) +++ head/usr.bin/getconf/getconf.c Tue Aug 23 19:15:01 2016 (r304693) @@ -109,13 +109,13 @@ main(int argc, char **argv) do_confstr(name, key); else printf("undefined\n"); - } else { + } else { valid = find_sysconf(name, &key); if (valid > 0) { do_sysconf(name, key); } else if (valid < 0) { printf("undefined\n"); - } else + } else errx(EX_USAGE, "no such configuration parameter `%s'", name); From owner-svn-src-head@freebsd.org Tue Aug 23 19:28:02 2016 Return-Path: Delivered-To: svn-src-head@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 4CFF9BC3287; Tue, 23 Aug 2016 19:28:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1E3A61246; Tue, 23 Aug 2016 19:28:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJS1Wc027138; Tue, 23 Aug 2016 19:28:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJS19V027137; Tue, 23 Aug 2016 19:28:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608231928.u7NJS19V027137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 23 Aug 2016 19:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304694 - head/usr.bin/getconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:28:02 -0000 Author: ngie Date: Tue Aug 23 19:28:01 2016 New Revision: 304694 URL: https://svnweb.freebsd.org/changeset/base/304694 Log: Add `MIN_HOLE_SIZE` pathconf(2) support to getconf This allows shell programs to programmatically determine whether or not a filesystem supports sparse files MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/getconf/pathconf.gperf Modified: head/usr.bin/getconf/pathconf.gperf ============================================================================== --- head/usr.bin/getconf/pathconf.gperf Tue Aug 23 19:15:01 2016 (r304693) +++ head/usr.bin/getconf/pathconf.gperf Tue Aug 23 19:28:01 2016 (r304694) @@ -24,6 +24,7 @@ FILESIZEBITS, _PC_FILESIZEBITS LINK_MAX, _PC_LINK_MAX MAX_CANON, _PC_MAX_CANON MAX_INPUT, _PC_MAX_INPUT +MIN_HOLE_SIZE, _PC_MIN_HOLE_SIZE NAME_MAX, _PC_NAME_MAX PATH_MAX, _PC_PATH_MAX PIPE_BUF, _PC_PIPE_BUF From owner-svn-src-head@freebsd.org Tue Aug 23 19:29:38 2016 Return-Path: Delivered-To: svn-src-head@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 B7AC8BC34BC; Tue, 23 Aug 2016 19:29:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93DB51729; Tue, 23 Aug 2016 19:29:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJTbKX027262; Tue, 23 Aug 2016 19:29:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJTbr4027260; Tue, 23 Aug 2016 19:29:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608231929.u7NJTbr4027260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Aug 2016 19:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304695 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:29:38 -0000 Author: bdrewery Date: Tue Aug 23 19:29:37 2016 New Revision: 304695 URL: https://svnweb.freebsd.org/changeset/base/304695 Log: Fix in-tree GCC builds after r304681. There were a few issues. - In-tree GCC won't have X_COMPILER_TYPE defined but will have WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can be used. Make the clang check specific to clang as well to ensure -target doesn't leak into a GCC build. - When using a cross-compiler GCC (with a default sysroot or arch) and also passing --sysroot, it basically forgets all internal paths for libraries. We've already worked around this quite a bit for the external toolchains. Now for the in-tree bootstrap cross-compiler GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt object files, but also -isystem and -L to fix the paths. This creates quite a spammy build log, but it is clear and still achieves the goals and stays consistent between internal and external build flags. Reducing the spam by using the '=' prefix feature will help and be done later. MFC after: 3 days X-MFC-With: r304681 Reported by: bz Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/Makefile.libcompat Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 23 19:28:01 2016 (r304694) +++ head/Makefile.inc1 Tue Aug 23 19:29:37 2016 (r304695) @@ -572,18 +572,23 @@ TARGET_ABI= gnueabihf TARGET_ABI= gnueabi .endif .endif -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +.if ${WANT_COMPILER_TYPE} == gcc || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) # GCC requires -isystem and -L when using a cross-compiler. --sysroot # won't set header path and -L is used to ensure the base library path # is added before the port PREFIX library path. XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib +# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler +# combined with --sysroot. +XCFLAGS+= -B${WORLDTMP}/usr/lib # Force using libc++ for external GCC. # XXX: This should be checking MK_GNUCXX == no .if ${X_COMPILER_VERSION} >= 40800 XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${WORLDTMP}/../lib/libc++ .endif -.else +.elif ${WANT_COMPILER_TYPE} == clang || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang) TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd12.0 XCFLAGS+= -target ${TARGET_TRIPLE} Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Tue Aug 23 19:28:01 2016 (r304694) +++ head/Makefile.libcompat Tue Aug 23 19:29:37 2016 (r304695) @@ -73,7 +73,8 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +.if ${WANT_COMPILER_TYPE} == gcc || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) # GCC requires -isystem when using a cross-compiler and --sysroot. Note that # Makefile.inc1 only applies this with an external compiler but libcompat # always does since even in-tree GCC 4.2 needs this to override the built-in From owner-svn-src-head@freebsd.org Tue Aug 23 19:31:44 2016 Return-Path: Delivered-To: svn-src-head@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 705E3BC370F; Tue, 23 Aug 2016 19:31:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4384E1D19; Tue, 23 Aug 2016 19:31:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJVhXC030407; Tue, 23 Aug 2016 19:31:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJVh6n030406; Tue, 23 Aug 2016 19:31:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608231931.u7NJVh6n030406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 23 Aug 2016 19:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304696 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:31:44 -0000 Author: dim Date: Tue Aug 23 19:31:43 2016 New Revision: 304696 URL: https://svnweb.freebsd.org/changeset/base/304696 Log: In addition to creating subdirectories under .OBJDIR for SRCS with relative paths, also create them for DPSRCS. This is needed for builds that generate files during the depend stage, which cannot be compiled by themselves, since those have to be put in DPSRCS. Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Tue Aug 23 19:29:37 2016 (r304695) +++ head/share/mk/bsd.obj.mk Tue Aug 23 19:31:43 2016 (r304696) @@ -102,7 +102,7 @@ obj: .PHONY fi; \ ${ECHO} "${CANONICALOBJDIR} created for ${.CURDIR}"; \ fi -.for dir in ${SRCS:H:O:u} +.for dir in ${SRCS:H:O:u} ${DPSRCS:H:O:u} @if ! test -d ${CANONICALOBJDIR}/${dir}/; then \ mkdir -p ${CANONICALOBJDIR}/${dir}; \ if ! test -d ${CANONICALOBJDIR}/${dir}/; then \ From owner-svn-src-head@freebsd.org Tue Aug 23 19:37:19 2016 Return-Path: Delivered-To: svn-src-head@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 EF1F4BC3ADA; Tue, 23 Aug 2016 19:37:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0D9E12C3; Tue, 23 Aug 2016 19:37:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJbIi8031513; Tue, 23 Aug 2016 19:37:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJbIap031511; Tue, 23 Aug 2016 19:37:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608231937.u7NJbIap031511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Aug 2016 19:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304697 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:37:20 -0000 Author: bdrewery Date: Tue Aug 23 19:37:18 2016 New Revision: 304697 URL: https://svnweb.freebsd.org/changeset/base/304697 Log: FAST_DEPEND: Fix 'make all install' not properly rebuilding based on .depend.* files. An optimization is in place to skip reading the .depend.* files with 'make install'. This was too strong and broke 'make all install' and 'make foo.o foo install'. Now only skip reading the dependency files if all make targets ran are install targets. The problem comes about because headers are only added in as a guessed dependency if .depend.* files do not yet exist. If they do exist, even if being skipped from being read, then the header dependencies are not applied. This applies to all #included files, and not just headers. Reported by: kib MFC after: 1 day Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Aug 23 19:31:43 2016 (r304696) +++ head/share/mk/bsd.dep.mk Tue Aug 23 19:37:18 2016 (r304697) @@ -76,12 +76,13 @@ tags: ${SRCS} _meta_filemon= 1 .endif -# Skip reading .depend when not needed to speed up tree-walks -# and simple lookups. +# Skip reading .depend when not needed to speed up tree-walks and simple +# lookups. For install, only do this if no other targets are specified. # Also skip generating or including .depend.* files if in meta+filemon mode # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ - make(install*) || make(analyze) || defined(_meta_filemon) + ${.TARGETS:M*install*} == ${.TARGETS} || \ + make(analyze) || defined(_meta_filemon) _SKIP_READ_DEPEND= 1 .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= /dev/null Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Aug 23 19:31:43 2016 (r304696) +++ head/sys/conf/kern.post.mk Tue Aug 23 19:37:18 2016 (r304697) @@ -196,12 +196,13 @@ ${SYSTEM_OBJS} genassym.o vers.o: opt_gl .if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) _meta_filemon= 1 .endif -# Skip reading .depend when not needed to speed up tree-walks -# and simple lookups. +# Skip reading .depend when not needed to speed up tree-walks and simple +# lookups. For install, only do this if no other targets are specified. # Also skip generating or including .depend.* files if in meta+filemon mode # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ - make(install*) || make(kernel-obj) || make(kernel-clean*) || \ + ${.TARGETS:M*install*} == ${.TARGETS} || \ + make(kernel-obj) || make(kernel-clean*) || \ make(kernel-install*) || defined(_meta_filemon) _SKIP_READ_DEPEND= 1 .MAKE.DEPENDFILE= /dev/null From owner-svn-src-head@freebsd.org Tue Aug 23 19:41:50 2016 Return-Path: Delivered-To: svn-src-head@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 B0792BC3DAA; Tue, 23 Aug 2016 19:41:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7E227176A; Tue, 23 Aug 2016 19:41:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJfnmF034932; Tue, 23 Aug 2016 19:41:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJfn5c034931; Tue, 23 Aug 2016 19:41:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608231941.u7NJfn5c034931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 23 Aug 2016 19:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304698 - head/usr.bin/getconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:41:50 -0000 Author: ngie Date: Tue Aug 23 19:41:49 2016 New Revision: 304698 URL: https://svnweb.freebsd.org/changeset/base/304698 Log: Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4 The TRUSTEDBSD prefix was chosen for consistency with the other related `_PC_ACL*` prefixed variables. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/getconf/pathconf.gperf Modified: head/usr.bin/getconf/pathconf.gperf ============================================================================== --- head/usr.bin/getconf/pathconf.gperf Tue Aug 23 19:37:18 2016 (r304697) +++ head/usr.bin/getconf/pathconf.gperf Tue Aug 23 19:41:49 2016 (r304698) @@ -35,6 +35,7 @@ POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFE POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN SYMLINK_MAX, _PC_SYMLINK_MAX TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED +TRUSTEDBSD_ACL_NFS4, _PC_ACL_NFS4 TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT From owner-svn-src-head@freebsd.org Tue Aug 23 19:50:18 2016 Return-Path: Delivered-To: svn-src-head@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 26EF7BC40D0; Tue, 23 Aug 2016 19:50:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CDEC31DC6; Tue, 23 Aug 2016 19:50:17 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NJoGTs035437; Tue, 23 Aug 2016 19:50:16 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NJoGD8035436; Tue, 23 Aug 2016 19:50:16 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608231950.u7NJoGD8035436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 23 Aug 2016 19:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304699 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:50:18 -0000 Author: bde Date: Tue Aug 23 19:50:16 2016 New Revision: 304699 URL: https://svnweb.freebsd.org/changeset/base/304699 Log: Fix key delay and repeat, part 1. kbdcontrol -r fast is documented to give a non-emulated atkbd's fastest rate of 250.34, but is misimplemented to request this as 0.0. ukbd supports many nonstandard rates, although it is currently too inaccurate by a factor of several hundred for non-huge nonstandard rates to be useful. It mapped 0.0 to 200.0. A repeat delay of 0 means a rate of infinity which is quite fast, but physical constraints limit this to a few MHz and the inaccuracies made it almost usable. Convert 0.0 to the documented 250.34. Also convert negative args and small args to the 250.34 minimal ones, like atkbd does. This is for KDSETREPEAT -- the 2 versions of the deprecated KDSETRAD have bounds checking. Keep not doing any bounds checking or conversions for upper limits since nonstandard large delays are useful for testing. The inaccuracies are dependent on HZ and the timeout implementation. With the old timeout implementation and HZ = 1000, 200.0 probably worked better to emulate 250.34 than 250.34 itself. HZ = 100 gives roundoff errors that accidentally reduce the inaaccuracies, and event timers reduce the inaccuracies even more, so 200.0 was giving more like itself (perhaps 215.15 on average but sometimes close to 10 msec repeat which is noticebly too fast). This commit makes 0.0 noticeably too slow, like 250.34 always was. Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Tue Aug 23 19:41:49 2016 (r304698) +++ head/sys/dev/usb/input/ukbd.c Tue Aug 23 19:50:16 2016 (r304699) @@ -1887,17 +1887,14 @@ ukbd_ioctl_locked(keyboard_t *kbd, u_lon if (!KBD_HAS_DEVICE(kbd)) { return (0); } - if (((int *)arg)[1] < 0) { - return (EINVAL); - } - if (((int *)arg)[0] < 0) { - return (EINVAL); - } - if (((int *)arg)[0] < 200) /* fastest possible value */ - kbd->kb_delay1 = 200; - else - kbd->kb_delay1 = ((int *)arg)[0]; - kbd->kb_delay2 = ((int *)arg)[1]; + /* + * Convert negative, zero and tiny args to the same limits + * as atkbd. We could support delays of 1 msec, but + * anything much shorter than the shortest atkbd value + * of 250.34 is almost unusable as well as incompatible. + */ + kbd->kb_delay1 = imax(((int *)arg)[0], 250); + kbd->kb_delay2 = imax(((int *)arg)[1], 34); return (0); #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ From owner-svn-src-head@freebsd.org Tue Aug 23 19:54:12 2016 Return-Path: Delivered-To: svn-src-head@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 E074BBC42D9 for ; Tue, 23 Aug 2016 19:54:12 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 794D5146B for ; Tue, 23 Aug 2016 19:54:12 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x229.google.com with SMTP id q128so176156920wma.1 for ; Tue, 23 Aug 2016 12:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fxtsZcwfTmEDDs0ADbAbQRHOAzU0rHLbaXpKxuOe1pQ=; b=n4LUdvUIuXbpZ2CnyhcfYHI6zSPERSCTJmTWpD1Gk3PtSw5obpfdYuLbyBvFtrTz3m ZV1sw3dR32uuUONPHW5P34AhL+8LTA2F4pMxzVCq6yHMZoztAcEvY1cXbMvdynXLf4QA WpUIzr2quudx+nlpz5bgu5zYVZ8VZoRlcdCNnGn0LeSnT6jHrQVq/KPuQvvXRyEYYyGB EfiUX4fu7IfZF5RveF2iYIbJEsXrxEh/N7wqS8IgiD+wZpAII43kOWux6qb7znrW9pHA D4AqaPkbYVBtdTBMlVOInIczAwNaE7c2GoROhx7CIn+WASE0TB5ibxi0wl6O3csqaSUF lRzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fxtsZcwfTmEDDs0ADbAbQRHOAzU0rHLbaXpKxuOe1pQ=; b=AqR/9Y4OXvEpc1UwoIvZjcoZ38bzNPRRoGOEnZPXWxwU1/gxU0xJUv0Zcr2W3S5njT bE20cvCAuWi2VQn6iRPKViOh9fGmNdh25puf8ImiS3sPH5+wLVMdjEKHR3KwXHiULnNP KW/isWS5FdII/aDh0iRhJqmRk/zCAIox13fO64yEy1MCvOEzZv0QdhleBRvacj/rvNdQ gJyYYNyGo+FyORm2SmhkbwUqSYd5V3X//4PoHcVuAd2QqTxFCKTRz+ibeITiTvYvIxoE qZlW8peGZ4imBMELKgdOnbrc80VsFfM/Gn9f/W3Qu5mLFjpLwk3oGMt98o90SWqe+cz0 7rTQ== X-Gm-Message-State: AEkoouvuLgoMTOzGq9ILpJ3C92AhM7oYl1jGizEQrDPf3IyrS3VJOex0hRZnagtqDPCZESLT4qbzHtKDv7nTRqs4 X-Received: by 10.194.144.114 with SMTP id sl18mr23357980wjb.123.1471982050964; Tue, 23 Aug 2016 12:54:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.221.7 with HTTP; Tue, 23 Aug 2016 12:54:10 -0700 (PDT) In-Reply-To: <201608231950.u7NJoGD8035436@repo.freebsd.org> References: <201608231950.u7NJoGD8035436@repo.freebsd.org> From: Oliver Pinter Date: Tue, 23 Aug 2016 21:54:10 +0200 Message-ID: Subject: Re: svn commit: r304699 - head/sys/dev/usb/input To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 19:54:13 -0000 On 8/23/16, Bruce Evans wrote: > Author: bde > Date: Tue Aug 23 19:50:16 2016 > New Revision: 304699 > URL: https://svnweb.freebsd.org/changeset/base/304699 > > Log: > Fix key delay and repeat, part 1. > > kbdcontrol -r fast is documented to give a non-emulated atkbd's fastest > rate of 250.34, but is misimplemented to request this as 0.0. ukbd > supports many nonstandard rates, although it is currently too inaccurate > by a factor of several hundred for non-huge nonstandard rates to be > useful. It mapped 0.0 to 200.0. A repeat delay of 0 means a rate of > infinity which is quite fast, but physical constraints limit this to > a few MHz and the inaccuracies made it almost usable. > > Convert 0.0 to the documented 250.34. > > Also convert negative args and small args to the 250.34 minimal ones, > like atkbd does. This is for KDSETREPEAT -- the 2 versions of the > deprecated KDSETRAD have bounds checking. Keep not doing any bounds > checking or conversions for upper limits since nonstandard large > delays are useful for testing. > > The inaccuracies are dependent on HZ and the timeout implementation. > With the old timeout implementation and HZ = 1000, 200.0 probably > worked better to emulate 250.34 than 250.34 itself. HZ = 100 gives > roundoff errors that accidentally reduce the inaaccuracies, and > event timers reduce the inaccuracies even more, so 200.0 was giving > more like itself (perhaps 215.15 on average but sometimes close to > 10 msec repeat which is noticebly too fast). This commit makes 0.0 > noticeably too slow, like 250.34 always was. > > Modified: > head/sys/dev/usb/input/ukbd.c > > Modified: head/sys/dev/usb/input/ukbd.c Hi Bruce! Do you plan to MFC these changes to 10-STABLE? It would be really nice to see all of these improvements. > ============================================================================== > --- head/sys/dev/usb/input/ukbd.c Tue Aug 23 19:41:49 2016 (r304698) > +++ head/sys/dev/usb/input/ukbd.c Tue Aug 23 19:50:16 2016 (r304699) > @@ -1887,17 +1887,14 @@ ukbd_ioctl_locked(keyboard_t *kbd, u_lon > if (!KBD_HAS_DEVICE(kbd)) { > return (0); > } > - if (((int *)arg)[1] < 0) { > - return (EINVAL); > - } > - if (((int *)arg)[0] < 0) { > - return (EINVAL); > - } > - if (((int *)arg)[0] < 200) /* fastest possible value */ > - kbd->kb_delay1 = 200; > - else > - kbd->kb_delay1 = ((int *)arg)[0]; > - kbd->kb_delay2 = ((int *)arg)[1]; > + /* > + * Convert negative, zero and tiny args to the same limits > + * as atkbd. We could support delays of 1 msec, but > + * anything much shorter than the shortest atkbd value > + * of 250.34 is almost unusable as well as incompatible. > + */ > + kbd->kb_delay1 = imax(((int *)arg)[0], 250); > + kbd->kb_delay2 = imax(((int *)arg)[1], 34); > return (0); > > #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Aug 23 20:04:24 2016 Return-Path: Delivered-To: svn-src-head@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 DC655BC46DD; Tue, 23 Aug 2016 20:04:24 +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 A46E31FAA; Tue, 23 Aug 2016 20:04:24 +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 u7NK4Nak042715; Tue, 23 Aug 2016 20:04:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NK4NpT042714; Tue, 23 Aug 2016 20:04:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201608232004.u7NK4NpT042714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 23 Aug 2016 20:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304702 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:04:25 -0000 Author: glebius Date: Tue Aug 23 20:04:23 2016 New Revision: 304702 URL: https://svnweb.freebsd.org/changeset/base/304702 Log: The -f check here is used to determine whether we have a single kernel config or a list of them. Put the variable into quotes, to avoid syntax error from [ in case of list. Without this change list is still working, but an error is reported in the build log file. Reviewed by: imp Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Tue Aug 23 19:57:37 2016 (r304701) +++ head/tools/tools/nanobsd/defaults.sh Tue Aug 23 20:04:23 2016 (r304702) @@ -227,7 +227,7 @@ nano_make_install_env ( ) { # Extra environment variables for kernel builds nano_make_kernel_env ( ) { - if [ -f ${NANO_KERNEL} ] ; then + if [ -f "${NANO_KERNEL}" ] ; then KERNCONFDIR="$(realpath $(dirname ${NANO_KERNEL}))" KERNCONF="$(basename ${NANO_KERNEL})" make_export KERNCONFDIR From owner-svn-src-head@freebsd.org Tue Aug 23 20:16:18 2016 Return-Path: Delivered-To: svn-src-head@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 3FD54BC4A15; Tue, 23 Aug 2016 20:16:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 0A285188D; Tue, 23 Aug 2016 20:16:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id DDAB9D659A9; Wed, 24 Aug 2016 06:16:08 +1000 (AEST) Date: Wed, 24 Aug 2016 06:16:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Oliver Pinter cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304699 - head/sys/dev/usb/input In-Reply-To: Message-ID: <20160824061306.N3978@besplex.bde.org> References: <201608231950.u7NJoGD8035436@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=3-pi8vhulkPa6GFvyq0A:9 a=CjuIK1q_8ugA:10 a=HrrXay0zYykA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:16:18 -0000 On Tue, 23 Aug 2016, Oliver Pinter wrote: > On 8/23/16, Bruce Evans wrote: >> ... >> Log: >> Fix key delay and repeat, part 1. >> ... >> Convert 0.0 to the documented 250.34. >> ... > Do you plan to MFC these changes to 10-STABLE? It would be really nice > to see all of these improvements. Maybe when I "finish". There is now also 11-NOTQUITESTABLE. Bruce From owner-svn-src-head@freebsd.org Tue Aug 23 20:33:57 2016 Return-Path: Delivered-To: svn-src-head@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 6248EBC4015; Tue, 23 Aug 2016 20:33:57 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3374E18BB; Tue, 23 Aug 2016 20:33:57 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NKXu8K054094; Tue, 23 Aug 2016 20:33:56 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NKXuZ9054093; Tue, 23 Aug 2016 20:33:56 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608232033.u7NKXuZ9054093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Tue, 23 Aug 2016 20:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304703 - head/include/xlocale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:33:57 -0000 Author: ache Date: Tue Aug 23 20:33:56 2016 New Revision: 304703 URL: https://svnweb.freebsd.org/changeset/base/304703 Log: LC_*_MASK bit shifting order was partially broken from the initial commit time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the right order. The order here should match XLC_* from "xlocale_private.h" which, in turn, match LC_* publicly visible order from which determines how locale components are stored in the structure. LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale() and equivalent shift loop in the newlocale(), so mapped to some wrong components (excluding two mentioned above). Formally the fix is ABI breakage, but old code using those masks never works properly in any case. Only newlocale() and querylocale() are affected. MFC after: 7 days Modified: head/include/xlocale/_locale.h Modified: head/include/xlocale/_locale.h ============================================================================== --- head/include/xlocale/_locale.h Tue Aug 23 20:04:23 2016 (r304702) +++ head/include/xlocale/_locale.h Tue Aug 23 20:33:56 2016 (r304703) @@ -32,12 +32,13 @@ #ifndef _XLOCALE_LOCALE_H #define _XLOCALE_LOCALE_H +/* Bit shifting order of LC_*_MASK should match XLC_* and LC_* order. */ #define LC_COLLATE_MASK (1<<0) #define LC_CTYPE_MASK (1<<1) -#define LC_MESSAGES_MASK (1<<2) -#define LC_MONETARY_MASK (1<<3) -#define LC_NUMERIC_MASK (1<<4) -#define LC_TIME_MASK (1<<5) +#define LC_MONETARY_MASK (1<<2) +#define LC_NUMERIC_MASK (1<<3) +#define LC_TIME_MASK (1<<4) +#define LC_MESSAGES_MASK (1<<5) #define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) #define LC_GLOBAL_LOCALE ((locale_t)-1) From owner-svn-src-head@freebsd.org Tue Aug 23 20:38:37 2016 Return-Path: Delivered-To: svn-src-head@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 BCAD9BC409E; Tue, 23 Aug 2016 20:38:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A11B91AB5; Tue, 23 Aug 2016 20:38:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 9964D1473; Tue, 23 Aug 2016 20:38:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1BDF923A39; Tue, 23 Aug 2016 20:38:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id gGIzdoa8xGF2; Tue, 23 Aug 2016 20:38:33 +0000 (UTC) Subject: Re: svn commit: r304567 - head/sys/dev/usb/input DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com BFA9A23A32 To: Bruce Evans , Hans Petter Selasky References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Tue, 23 Aug 2016 13:38:16 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160822185617.I1897@besplex.bde.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sDW0aInRvdO9shV324iWNbAq79J5moTFn" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:38:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sDW0aInRvdO9shV324iWNbAq79J5moTFn Content-Type: multipart/mixed; boundary="o6v0Tia18Cj0OXTRIj5IrIa56I8fHek37" From: Bryan Drewery To: Bruce Evans , Hans Petter Selasky Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304567 - head/sys/dev/usb/input References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> In-Reply-To: <20160822185617.I1897@besplex.bde.org> --o6v0Tia18Cj0OXTRIj5IrIa56I8fHek37 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/22/2016 1:59 AM, Bruce Evans wrote: > On Sun, 21 Aug 2016, Hans Petter Selasky wrote: >=20 >> On 08/21/16 18:06, Bruce Evans wrote: >>> Author: bde >>> Date: Sun Aug 21 16:06:00 2016 >>> New Revision: 304567 >>> URL: https://svnweb.freebsd.org/changeset/base/304567 >> >> Don't forget to MFC. >=20 > I had forgotten if for this commit. I might do it for combined > commits, but don't have enough svn fu for as many MFCs as I would > like. I want a few things back to FreeBSD-7. >=20 > Bruce >=20 I've written a script to do MFCing with the proper svn merge style for each branch. It's not perfect but it seems good enough. https://people.freebsd.org/~bdrewery/mfc.sh It can take multiple revisions. cd svn/stable/7 mfc.sh r123 r124 r125 It will merge each one at a time, invoke EDITOR for conflicts (SVN does this), then opens EDITOR to edit the commit log and saves that to 'commit'. You can then review and modify the commit as you like and 'svn commit -F commit' when done to use the saved commit log. If you pass -r to it then it will also prepare an email in mutt to send to re@FreeBSD.org for approval to commit. It defaults to merging from head, but in the case of wanting to commit to releng/ you need to pass -b to specify which branch to merge from, such as -b stable/11 for releng/11.0 commits. --=20 Regards, Bryan Drewery --o6v0Tia18Cj0OXTRIj5IrIa56I8fHek37-- --sDW0aInRvdO9shV324iWNbAq79J5moTFn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXvLQ4AAoJEDXXcbtuRpfPFlEH/A80sD9fTJXA6h6m0HQ2mPoa 2X6QxaghFpw1up4aQRZMFjFTGOWriVL+Hs0grwQCbHxV+PXkX1NBJwjbBBfr6psU qjq3+zfxBnfxgg17fqNaBwRSZjk0DzvEpP/l8p0vuBq2GDtih3m6jwQi3tfKr1FE FUcQdYMajh7jH7GSaMhk5/wpEKs5Aj0VuFcBgXhK+Goni3NdfmPnmgpP1OcPcyT2 uz+N2IR4K0RXnIpx1jM40pztjgWYxL/ZLZjwCKMUeFJ+czmcv4lqFr7iyMWJI214 4+BDkVs77/g2TA0TsLbXUmq6bw0MAdr6lznGWSF+jvAhGarO7g+Hnb6IhfiJ/40= =yBwA -----END PGP SIGNATURE----- --sDW0aInRvdO9shV324iWNbAq79J5moTFn-- From owner-svn-src-head@freebsd.org Tue Aug 23 20:49:57 2016 Return-Path: Delivered-To: svn-src-head@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 5CBADBC4394; Tue, 23 Aug 2016 20:49:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27BE912B8; Tue, 23 Aug 2016 20:49:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x244.google.com with SMTP id hh10so10489352pac.1; Tue, 23 Aug 2016 13:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=eaMl4+Y/wzdoI7745B1R+mjH1Pat7vDBeXm3uh7fIPw=; b=SJ/Hm9S417fG6r1Ksx7jadf62UgdayEXJPTtqybmx34IGMCsD9Q2aE2fv9eMlav+PJ WAknEDLz+7+bvYRFlJeixip9VbXdlCLqicDheAYr8cqXgNXGDZ10oTLKIVqTqy2vVGVn 2BCcqy0ZFbphzzFsEzyz07z01d1wsa9tQizPCFkwBiJ8QCu8NCyL2o2slM9R2gt88piC 2jAs5Fb1XPPTvaT7vixTfVilGpte+q3+B79J0GCBN3NDUYayfCG8uIhNRAouetcOWhEQ cvxBAB9U6RuAVVknIe0HokHQT5yFZF5e4G+81LZdwiMIT/9JwLQeeUzSKkGnaiGp9lTU Kw7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=eaMl4+Y/wzdoI7745B1R+mjH1Pat7vDBeXm3uh7fIPw=; b=MInykclDuEiVuexAJXIfrd6HBrH4HC1qVMqsquhnc5wtiFfJHvsUpnAclKnVk4azoy ooFEMPNGj1vBEY9VvW2XOL90GXJOsWVzTN7kNfIixa8c+AIFJapscI1pZZ3H91fBEq5O L5/6ORRyKsUu7rwfZ0VzNNfs0eo08CqTP+//LX+F5JwH4iHoEMJChBsU7VCTxTVHSFGr C25Be902trCsrASyJ1UR9PlPbUMldxwD32m+NyM0UDCctsrAEey2C0edjwfXZC8g2OGs eV1X5ut8Af0ptlVLZ4q2VYb+S2TkPjAaKsmFSTG994BE0bC9c4Ox9tDfPlPx7FYG6+FE kxiQ== X-Gm-Message-State: AEkoouuyG8kONguiXQzavexsXV6u2qSkrjT6HTw+tggfV2sEv8yUBhoWPEW4M8kJVjmHSA== X-Received: by 10.66.131.17 with SMTP id oi17mr57509854pab.88.1471985396764; Tue, 23 Aug 2016 13:49:56 -0700 (PDT) Received: from [192.168.20.17] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 9sm7862064pfo.74.2016.08.23.13.49.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 13:49:55 -0700 (PDT) Subject: Re: svn commit: r304567 - head/sys/dev/usb/input Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_07A3770D-CA8E-4423-934E-2B275ED4DB41"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 23 Aug 2016 13:49:54 -0700 Cc: Bruce Evans , Hans Petter Selasky , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:49:57 -0000 --Apple-Mail=_07A3770D-CA8E-4423-934E-2B275ED4DB41 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Aug 23, 2016, at 13:38, Bryan Drewery wrote: =85 > I've written a script to do MFCing with the proper svn merge style for > each branch. It's not perfect but it seems good enough. >=20 > https://people.freebsd.org/~bdrewery/mfc.sh >=20 > It can take multiple revisions. > cd svn/stable/7 > mfc.sh r123 r124 r125 >=20 > It will merge each one at a time, invoke EDITOR for conflicts (SVN = does > this), then opens EDITOR to edit the commit log and saves that to > 'commit'. You can then review and modify the commit as you like and = 'svn > commit -F commit' when done to use the saved commit log. >=20 > If you pass -r to it then it will also prepare an email in mutt to = send > to re@FreeBSD.org for approval to commit. >=20 > It defaults to merging from head, but in the case of wanting to commit > to releng/ you need to pass -b to specify which branch to merge from, > such as -b stable/11 for releng/11.0 commits. I have one that I noted a while back =97 it=92s a bit less featureful, = but it works pretty well IMHO: = https://github.com/yaneurabeya/scratch/blob/master/common/home/ngie/bin/mf= c = https://github.com/yaneurabeya/scratch/blob/master/common/home/ngie/bin/mf= c_log Example usage: ~/mfc ^/head # Do whatever you need to make sure that the commit is ok. svn ci -F commit The only thing it fubars is some of the spacing with some of the commit = messages (I don=92t remember if it was with my commits being MFCed or = other=92s commits being MFCed). I=92m a bit pedantic about formatting -- = that=92s the only reason why I haven=92t posted it up earlier as an = official solution for others to use. Cheers, -Ngie --Apple-Mail=_07A3770D-CA8E-4423-934E-2B275ED4DB41 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXvLbzAAoJEPWDqSZpMIYVwpMP/3AgNLsHeYKpKr4vGruE9C98 6+codrzWWib1xFe41MEXYCX1VENo20I6f1DrfZzyIuX14zZK3QfBZdV7jkT2jNcE RtEpRlGbEngCdH/MQ9eHCRarInoZviYCRNGHPgBKJyov7Ne9pn+b3aeNpEdcvdek OBflKWPE7eHLlwujX5zEtcIDUHu2WBEvcR6tn4q2Kv1Xg0dTw+t3JjDOsiI0e/xf /86zbxvdefoO5kkIpkyYqNyzc6bUl5WM/FKo34s6iskWUpdsyp72iZgvpACjnif+ DfqmguyMXhUpvwu47t7aqOxLgyK9YCOq/tI21cnByvhnoIltNQ3y+rqg1qLz1vEk 57RRU16trFHUZhap0z/jBV2qPkhgEGflo4vaNQPd+XLMRw5svkoSo6/gNShghDEj zlBuasgowpKV/nZ1xCEiEjEoBEoPMZeTacXM5uWDQQl2j/IADAjhwdvDuiwxTEbu 0NWRHFRAXlqItNIwDPccsqtKZJWd07fKSg1/5Uz+xgHzw6vQvIYGIqkYF8UVEXY6 nc5BzxlvafKi/5tKRg75Ydt5F3StvaX9Cd/ADuFdH97y7il2Z61SDXCbtZC7+HvM jqGx3+qz3cMz0nQr9IBIXGVHKOGAy8L4PUk/L0WxSacsyibCAfdA0mjaahlT5tYm LvCXBDZji/wX/W0ba7VQ =tDi+ -----END PGP SIGNATURE----- --Apple-Mail=_07A3770D-CA8E-4423-934E-2B275ED4DB41-- From owner-svn-src-head@freebsd.org Tue Aug 23 20:53:13 2016 Return-Path: Delivered-To: svn-src-head@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 64F67BC4522; Tue, 23 Aug 2016 20:53:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x241.google.com (mail-pa0-x241.google.com [IPv6:2607:f8b0:400e:c03::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3260A1724; Tue, 23 Aug 2016 20:53:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x241.google.com with SMTP id vy10so10450120pac.0; Tue, 23 Aug 2016 13:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=SXHphuC3ghjZb3YBC6g2Syzr8mi+lmINdSkks6JCAoM=; b=uS1U7HsyUOoINtzF7wsN8M3Nf63HYpHpEvfOt1E1J2zfSM5N6k4aCXqmFK/WR0jvgD cz5VWBkGXm9GZhbsQ8yFZqaUaGpW+sSvQYOeRRa7LeLR9o8fBnIV5aW8Hqs82WYrq876 Tx+luHMkoXRAKwJkWCSEMrE9hrmKZ7ved/WeRqX3+fWYq+Jiu9ieo+gFjZTqNWabQCku fRi4aq/Vy/d/a6/MLk+LlezPRN0O8GkNrqW1pRmLAnPEXP+htDJhcLYPBgSQlQ/LIf+f alWDHLs6166vk24zY/LgTEFKnZ9hwdvZAfLlRCrDyEvBLf5IsYvfqEjBjGWIXjxfiDVi +mIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=SXHphuC3ghjZb3YBC6g2Syzr8mi+lmINdSkks6JCAoM=; b=axt7T5A6XdCn6RXPrDw9y9jt2507ozejSSo81oxISV2di3DNz4YHvPmO+2le+Uynvk ud4vAfrw5MD3jxb2nKaSjvpSQkyG4FBTeg4IqL6jtVF830l/gJnoop+ShzEMX8mT1yzi 1k+NeKMfCvdswgEoe2e3n/ArDuHcjB6AO/Tng8FJvKcAUzJ7LfB8QMqgpoKh7LSrR0KC 774YJPW93hzte2jRZxkAdkcFiArk8jtpPcFsexdirEuzjorXqw02FM7Y+cIzyaaji+yD erRrUaY2mCDwNPmcgBPbykpAPjH6J9PihhptGnW2e9sXlRfhLTyNNM6wnGpqbaWyyPmz lwGg== X-Gm-Message-State: AEkoout6p2McuZ52T+9vaLPO73JaOsJReK5SztF/jxAbDdJ9FlIl5f9njXGpgvV9zL3sIg== X-Received: by 10.66.216.130 with SMTP id oq2mr56688604pac.89.1471985592535; Tue, 23 Aug 2016 13:53:12 -0700 (PDT) Received: from [192.168.20.17] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 72sm7877840pfs.51.2016.08.23.13.53.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 13:53:11 -0700 (PDT) Subject: Re: svn commit: r304703 - head/include/xlocale Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1841782D-4B2F-4847-A4B0-18B39710379A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201608232033.u7NKXuZ9054093@repo.freebsd.org> Date: Tue, 23 Aug 2016 13:53:10 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201608232033.u7NKXuZ9054093@repo.freebsd.org> To: "Andrey A. Chernov" X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:53:13 -0000 --Apple-Mail=_1841782D-4B2F-4847-A4B0-18B39710379A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 23, 2016, at 13:33, Andrey A. Chernov wrote: >=20 > Author: ache > Date: Tue Aug 23 20:33:56 2016 > New Revision: 304703 > URL: https://svnweb.freebsd.org/changeset/base/304703 >=20 > Log: > LC_*_MASK bit shifting order was partially broken from the initial = commit > time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the > right order. >=20 > The order here should match XLC_* from "xlocale_private.h" which, in = turn, > match LC_* publicly visible order from which determines = how > locale components are stored in the structure. > LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the = querylocale() > and equivalent shift loop in the newlocale(), so mapped to some wrong > components (excluding two mentioned above). >=20 > Formally the fix is ABI breakage, but old code using those masks > never works properly in any case. > Only newlocale() and querylocale() are affected. >=20 > MFC after: 7 days >=20 > Modified: > head/include/xlocale/_locale.h Should __FreeBSD_version be bumped? Thanks, -Ngie --Apple-Mail=_1841782D-4B2F-4847-A4B0-18B39710379A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXvLe3AAoJEPWDqSZpMIYVgl0QAJRNqTv9K7PbWcQh/m/4s+TV nbpgZqwkJ9uweecBWuGXth89FA+WEDLm2aluSmiADpTxhEp5hZJ+uAaIded57pXz 96Npmsh4+EzKt8FUyI3BlVPhRRP5A+JsJBkce2JA+4cE9d1iiRWP69qWRxBjJVEz R1/Cy/PlUGxVZ0v+EQ71reeZ8Tk0ko+yafpVjwPlOqBNzgXarHZ5PIpMXF/Q5O19 BPRifcU7w4kZ7avdjrwunph3yp7jad/lUbdjwqgIZcYe2bkciwccgn2azzycFxy/ GEeqgyAQXkGfbBAgpwK9msOgxQvqW8zfYnpEQMhO6MXQywqaIwspELcsaLMzm8/B 2KLgWzk0mFbu6WeS9NbgdMbrWrEAqi41S83HvAgObDeJXjT8XiuoG1t8TdJku66I HAQtJ5b1hGq6RG3ubei/Ya0uA0pevKtSnzKVC9lC9yX5m17cq27jkA9CuooDQ/l/ bnkhuRE08kNpkLkYOXOvwu91Yn5dyUmaQtTWOKlttbG3iPsPT0QNLmX491KsY/4I 6cZCNCgFPYFuZQ1GobQ8m6/omfUE2i6QBCCilcoQ7xUDdwLHoZI+aWhtfbryBl8p oDNOxOV0E/YqCOIE+6ujejEDwF95/M/1x04vn0qEOjWKiI4Ve1uRWuVN5Wo1Hj/w 2ol2OgtGcSBLw3uvvSWb =DfR5 -----END PGP SIGNATURE----- --Apple-Mail=_1841782D-4B2F-4847-A4B0-18B39710379A-- From owner-svn-src-head@freebsd.org Tue Aug 23 20:57:04 2016 Return-Path: Delivered-To: svn-src-head@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 C2405BC4657; Tue, 23 Aug 2016 20:57:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A3BC91A73; Tue, 23 Aug 2016 20:57:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 96A021BBE; Tue, 23 Aug 2016 20:57:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5A88523ACB; Tue, 23 Aug 2016 20:57:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id tyA4cpJM8asO; Tue, 23 Aug 2016 20:57:01 +0000 (UTC) Subject: Re: svn commit: r304567 - head/sys/dev/usb/input DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5EE9723ABC To: "Ngie Cooper (yaneurabeya)" References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> Cc: Bruce Evans , Hans Petter Selasky , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <55444c61-f280-265a-e223-52b128382b71@FreeBSD.org> Date: Tue, 23 Aug 2016 13:57:00 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JNqCEshKG4Iv8McndVb1NW1DgNoT0K4vR" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 20:57:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JNqCEshKG4Iv8McndVb1NW1DgNoT0K4vR Content-Type: multipart/mixed; boundary="6VW66JfcqXA1Vv5T2iT6Fpn785i6fDs6V" From: Bryan Drewery To: "Ngie Cooper (yaneurabeya)" Cc: Bruce Evans , Hans Petter Selasky , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <55444c61-f280-265a-e223-52b128382b71@FreeBSD.org> Subject: Re: svn commit: r304567 - head/sys/dev/usb/input References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> In-Reply-To: --6VW66JfcqXA1Vv5T2iT6Fpn785i6fDs6V Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/23/2016 1:49 PM, Ngie Cooper (yaneurabeya) wrote: >=20 >> On Aug 23, 2016, at 13:38, Bryan Drewery wrote:= >=20 > =85 >=20 >> I've written a script to do MFCing with the proper svn merge style for= >> each branch. It's not perfect but it seems good enough. >> >> https://people.freebsd.org/~bdrewery/mfc.sh >> >> It can take multiple revisions. >> cd svn/stable/7 >> mfc.sh r123 r124 r125 >> >> It will merge each one at a time, invoke EDITOR for conflicts (SVN doe= s >> this), then opens EDITOR to edit the commit log and saves that to >> 'commit'. You can then review and modify the commit as you like and 's= vn >> commit -F commit' when done to use the saved commit log. >> >> If you pass -r to it then it will also prepare an email in mutt to sen= d >> to re@FreeBSD.org for approval to commit. >> >> It defaults to merging from head, but in the case of wanting to commit= >> to releng/ you need to pass -b to specify which branch to merge from, >> such as -b stable/11 for releng/11.0 commits. >=20 > I have one that I noted a while back =97 it=92s a bit less featureful, = but it works pretty well IMHO: >=20 > https://github.com/yaneurabeya/scratch/blob/master/common/home/ngie/bin= /mfc > https://github.com/yaneurabeya/scratch/blob/master/common/home/ngie/bin= /mfc_log >=20 > Example usage: >=20 > ~/mfc ^/head > # Do whatever you need to make sure that the commit is ok. > svn ci -F commit >=20 > The only thing it fubars is some of the spacing with some of the commit= messages (I don=92t remember if it was with my commits being MFCed or ot= her=92s commits being MFCed). I=92m a bit pedantic about formatting -- th= at=92s the only reason why I haven=92t posted it up earlier as an officia= l solution for others to use. >=20 Well yours only supports stable/10+ and not 9- with the older merge style= =2E --=20 Regards, Bryan Drewery --6VW66JfcqXA1Vv5T2iT6Fpn785i6fDs6V-- --JNqCEshKG4Iv8McndVb1NW1DgNoT0K4vR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXvLicAAoJEDXXcbtuRpfPIFMH/isf0u+hTw/gpspT1RcxNSeN uRAbDGMksOeOM63bdccjBFQB/ixRmR9nfqR2YaN9QUU703QVgUnhkuQVAnEveRiP +U95isHsxDd7y6hjtLhW/xTHUa1NFLiNueIsD/QQE/rvQBFX1zR26KkQKGtUhJOm eNyrHTZn5BBBAQthkhUIkQRQSsfgOT7wLZU0qBBLB+WfpHNRfXNBTZHJzKZzqtZ/ iMqZOoWItrNF9d9PxrDv4gDQra0jqu2JiIob1QctvvrWOrRSKy+1UUKQknqMZwEJ z/EvetMZbAu7NbV4EwIErxk/EdBrSdkt+o4m+C18DSTIeRo6O/OjZvbmmXvS8t4= =wBtm -----END PGP SIGNATURE----- --JNqCEshKG4Iv8McndVb1NW1DgNoT0K4vR-- From owner-svn-src-head@freebsd.org Tue Aug 23 21:00:22 2016 Return-Path: Delivered-To: svn-src-head@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 C865FBC482D; Tue, 23 Aug 2016 21:00:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 927631F09; Tue, 23 Aug 2016 21:00:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x242.google.com with SMTP id hh10so10500412pac.1; Tue, 23 Aug 2016 14:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=WuvGNsgvoF5mPrR8/yXToqebwOS0VWIbvhAwZF3hniw=; b=ejS+rmooX+NFhbZtVFeGz9yrmCq7wFVG4H17zqSs5pS+vN9Z8Z6Up775FB2AQKBg0l awBKDawIefTowqNUXYKX/B+Yimy41FZrlrMyJyCRPkIs3ACWa45AbGjAcYuvkRB4CQKZ DpvRYyhVl92KhFJDPy47VmoU/CWDQr7XIIlcPVNnmyzGbQ6NTtBAMIJwwWO/dYPcoY7Y eMGjs5gk8j/WpofBMOxTsDoOQCCMX7d490lTVvr9EE7CIjEu+lxJ1ubrLas6V45vYUx7 D4CYc0hUqwPCdjoPJ0TLZVzXoAxVPWSbxEQhu83uj+UaqKRaz0LRBQuw+XE0FuEeg3vY jFmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=WuvGNsgvoF5mPrR8/yXToqebwOS0VWIbvhAwZF3hniw=; b=a6rY4QHIwl2FG1OQSwSE/BYJHXjrqGl/iqQeZauYly/eTdzMgYMHdxzofM7Tk9c4OK mwnnX0gOGaKuPcw2dVZtCpwnUyQL86vN63A2Zi7XqsxBmZx2cvCVv+r+G43VQPkzte+L KKG6vWs7F1MWQ5hevw7jFdusLt4FfHsJpYBotprn7PrUAlVhLOYBzsT8hHRLKkJuG5bg MCOfw6Sr92mZ448UR3okXsXyxvu9xHkMCpee9sHRwzmstytUxDOc+Dod3uC3jwmSDiub v1GdWHwOrXkrn/kzNoyid6F1vr93Sc3/2TswuplyJBTmY9YM+LoVFB3yzLwmZlXb49A5 5uZA== X-Gm-Message-State: AEkoouuN1sCofiYuMZZPr7R8evvoJLFp8N000Fi4VQomQDbMmQEfkva2RTucMP+ADHoroQ== X-Received: by 10.66.123.105 with SMTP id lz9mr57625560pab.56.1471986022228; Tue, 23 Aug 2016 14:00:22 -0700 (PDT) Received: from [192.168.20.17] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id xx7sm7929758pac.3.2016.08.23.14.00.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 14:00:19 -0700 (PDT) Subject: Re: svn commit: r304567 - head/sys/dev/usb/input Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_8C083773-CC0F-4EB5-886D-F849FA627726"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <55444c61-f280-265a-e223-52b128382b71@FreeBSD.org> Date: Tue, 23 Aug 2016 14:00:12 -0700 Cc: Bruce Evans , Hans Petter Selasky , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <11F43201-868B-48DF-8612-95974A1B15AB@gmail.com> References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> <55444c61-f280-265a-e223-52b128382b71@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 21:00:22 -0000 --Apple-Mail=_8C083773-CC0F-4EB5-886D-F849FA627726 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Aug 23, 2016, at 13:57, Bryan Drewery wrote: ... > Well yours only supports stable/10+ and not 9- with the older merge = style. *shrugs* The older method promoted broken mergeinfo=85 The = method I wrote up works fine with ^/stable/9- =97 just with non-sparse = checkouts (I don=92t recommend sparse checkouts, again because it can = screw up mergeinfo) :). Thanks, -Ngie --Apple-Mail=_8C083773-CC0F-4EB5-886D-F849FA627726 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXvLlcAAoJEPWDqSZpMIYVE6AQAMecIcaHRbgmeT5cDb3A0n8b U6Qye6yKNfAvsXk19xUCyR3ML7DS6uOEa1Ykohk7q9a7PxN242xX5/U2tajkwCDe Sn9s9iyFGL7iD9Ri+oQwDMo0nXLviDyr6KBH+0fMG2p9qu/fKmGk6Vag6Q2zds+E j3ceH8U6IT5T8Vm+ZRCOLI52pFQfHredbUiZEn3TVlErHc8YvPRP/7PsrZha17F+ XuEvL50zF4ViKMvx1JoAw6CbNQDDzj5qXLdlzqy7Y5EYEsE2WTzmw/byBZAYZ/Sy cBxvLGogL5Ej/yW/zcnXeIqGtuzmUzs09L1cYWyYDbAf1pqvzM3rWB2XLJ4l0eRW 0kVBFxchd3xXrUiVVeDQkxewoeDOQwz3b+XHe0aw6QvFMVivcUmKA9pypMkOLug5 y+XyNaOeAHZuV2Q7jSYQ7FzqODU8o5RcqiOijEiyW6H61CQ5MidsPA4aLM/Dca5B Z8hjMprogmXR2TQgaErR1lv+/ccENeEtZHvZ0uIU+IYyXQ/Zwjc0pBnWpd9mBxVS 3B+mJE4H8aJbD6kweg3tjzp0d7YLLFd8FnFeaLPlo0fZaWgfdDb7wPNe3rWD1ziL P8zOOWrdWSEEp3qQtrl/mMTc7B9v3+GKzNBOHt2gMDeKccqlL2OzMt/RxnhiY2PC hoqNA2DBiRjddavF+V4t =YKyO -----END PGP SIGNATURE----- --Apple-Mail=_8C083773-CC0F-4EB5-886D-F849FA627726-- From owner-svn-src-head@freebsd.org Tue Aug 23 21:11:01 2016 Return-Path: Delivered-To: svn-src-head@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 E25C9BC4A21; Tue, 23 Aug 2016 21:11:01 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [IPv6:2a01:4f8:160:918a::25:11]) (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 814601866; Tue, 23 Aug 2016 21:11:01 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail.smeets.xyz [IPv6:2a01:4f8:160:918a::25:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id 8F143135A; Tue, 23 Aug 2016 23:10:49 +0200 (CEST) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id 201A99CC3A; Tue, 23 Aug 2016 23:10:49 +0200 (CEST) Authentication-Results: mail.smeets.xyz; dkim=pass (1024-bit key; unprotected) header.d=smeets.xyz header.i=@smeets.xyz header.b=RgKS2DJX X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:160:918a::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:160:918a::aa:4]) (amavisd-new, port 10025) with ESMTP id xNuVShTY39w2; Tue, 23 Aug 2016 23:10:43 +0200 (CEST) Received: from nibbler-osx.fritz.box (unknown [IPv6:2001:4dd0:fd65:0:4428:517f:a875:f55c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id 158089CC22; Tue, 23 Aug 2016 23:10:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=smeets.xyz; s=default; t=1471986643; bh=9hu6Gg8Uhw144HEMVvcHjHZmj/qyQ1Eo+CgmZPBRyFM=; h=Subject:To:References:From:Date:In-Reply-To; b=RgKS2DJX/UYdBtEFKUWsybdhP4BgQ6gX4NRmTZu5CSvwHtmHDUaXrTLfU5WXIkfSr gF9uybCRAFGElwVW3E0EvIBuXF22NwM6jxke07g75ORdBrFugmT5LFEsBuYVSLbp3a RwUqIChUW8kS5tRud9U+YpziyCNXNxiEq7/7F4+k= Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608180037.u7I0b77A095653@repo.freebsd.org> From: Florian Smeets Message-ID: <23b75971-7fc2-eb3d-fa2a-f0cfd0aa616e@smeets.xyz> Date: Tue, 23 Aug 2016 23:10:32 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:47.0) Gecko/20100101 Thunderbird/47.0 MIME-Version: 1.0 In-Reply-To: <201608180037.u7I0b77A095653@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gvmGU9PRjP8IHuN38fc4rReT29bdQa9f8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 21:11:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gvmGU9PRjP8IHuN38fc4rReT29bdQa9f8 Content-Type: multipart/mixed; boundary="Cn7Oef8OBebtxjw1BmG6CxsROLOWwalT0" From: Florian Smeets To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <23b75971-7fc2-eb3d-fa2a-f0cfd0aa616e@smeets.xyz> Subject: Re: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... References: <201608180037.u7I0b77A095653@repo.freebsd.org> In-Reply-To: <201608180037.u7I0b77A095653@repo.freebsd.org> --Cn7Oef8OBebtxjw1BmG6CxsROLOWwalT0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 18/08/2016 02:37, Toomas Soome wrote: > Author: tsoome > Date: Thu Aug 18 00:37:07 2016 > New Revision: 304321 > URL: https://svnweb.freebsd.org/changeset/base/304321 >=20 > Log: > Add SHA512, skein, large blocks support for loader zfs. > =20 Hi, this commit seems to break booting zroot bhyve VMs. Reverting userboot.so to 304320 on the host system makes it work again. I start bhyve like this /usr/share/examples/bhyve/vmrun.sh -d /dev/zvol/zroot/bhyve/poudriere -t tap8 -c 7 -m 20G poudriere Launching virtual machine "poudriere" ... Consoles: userboot FreeBSD/amd64 User boot, Revision 1.1 (root@fry.smeets.xyz, Tue Aug 23 16:47:12 CEST 2016) - can't load 'kernel' Type '?' for a list of commands, 'help' for more detailed help. OK lsdev -v host devices: host0: Host filesystem disk devices: disk0: Guest drive image disk0p1: FreeBSD boot 512KB disk0p2: FreeBSD swap 2048MB disk0p3: FreeBSD ZFS 67GB zfs devices: OK show LINES=3D24 boot_serial=3D1 console=3Duserboot currdev=3Ddisk0p3: interpret=3DOK loaddev=3Ddisk0p3: prompt=3D${interpret} smbios.bios.vendor=3DBHYVE twiddle_divisor=3D1 OK ls open '/' failed: no such file or directory OK Here the zroot setup in the VM root@poudriere:~ # zpool get -oname,property,value all NAME PROPERTY VALUE zroot size 67.5G zroot capacity 61% zroot altroot - zroot health ONLINE zroot guid 13278473142560840663 zroot version - zroot bootfs zroot/ROOT/default zroot delegation on zroot autoreplace off zroot cachefile - zroot failmode wait zroot listsnapshots off zroot autoexpand off zroot dedupditto 0 zroot dedupratio 1.00x zroot free 25.9G zroot allocated 41.6G zroot readonly off zroot comment - zroot expandsize - zroot freeing 0 zroot fragmentation 67% zroot leaked 0 zroot feature@async_destroy enabled zroot feature@empty_bpobj active zroot feature@lz4_compress active zroot feature@multi_vdev_crash_dump enabled zroot feature@spacemap_histogram active zroot feature@enabled_txg active zroot feature@hole_birth active zroot feature@extensible_dataset enabled zroot feature@embedded_data active zroot feature@bookmarks enabled zroot feature@filesystem_limits enabled zroot feature@large_blocks disabled zroot feature@sha512 disabled zroot feature@skein disabled root@poudriere:~ # zfs get all zroot/ROOT/default NAME PROPERTY VALUE SOURCE zroot/ROOT/default type filesystem - zroot/ROOT/default creation Sun Jul 27 16:32 2014 - zroot/ROOT/default used 7.12G - zroot/ROOT/default available 23.8G - zroot/ROOT/default referenced 7.12G - zroot/ROOT/default compressratio 2.18x - zroot/ROOT/default mounted yes - zroot/ROOT/default quota none default zroot/ROOT/default reservation none default zroot/ROOT/default recordsize 128K default zroot/ROOT/default mountpoint / local zroot/ROOT/default sharenfs off default zroot/ROOT/default checksum on default zroot/ROOT/default compression lz4 inherited from zroot zroot/ROOT/default atime off inherited from zroot zroot/ROOT/default devices on default zroot/ROOT/default exec on default zroot/ROOT/default setuid on default zroot/ROOT/default readonly off default zroot/ROOT/default jailed off default zroot/ROOT/default snapdir hidden default zroot/ROOT/default aclmode discard default zroot/ROOT/default aclinherit restricted default zroot/ROOT/default canmount on default zroot/ROOT/default xattr off temporar= y zroot/ROOT/default copies 1 default zroot/ROOT/default version 5 - zroot/ROOT/default utf8only off - zroot/ROOT/default normalization none - zroot/ROOT/default casesensitivity sensitive - zroot/ROOT/default vscan off default zroot/ROOT/default nbmand off default zroot/ROOT/default sharesmb off default zroot/ROOT/default refquota none default zroot/ROOT/default refreservation none default zroot/ROOT/default primarycache all default zroot/ROOT/default secondarycache all default zroot/ROOT/default usedbysnapshots 0 - zroot/ROOT/default usedbydataset 7.12G - zroot/ROOT/default usedbychildren 0 - zroot/ROOT/default usedbyrefreservation 0 - zroot/ROOT/default logbias latency default zroot/ROOT/default dedup off default zroot/ROOT/default mlslabel - zroot/ROOT/default sync standard default zroot/ROOT/default refcompressratio 2.18x - zroot/ROOT/default written 7.12G - zroot/ROOT/default logicalused 14.3G - zroot/ROOT/default logicalreferenced 14.3G - zroot/ROOT/default volmode default default zroot/ROOT/default filesystem_limit none default zroot/ROOT/default snapshot_limit none default zroot/ROOT/default filesystem_count none default zroot/ROOT/default snapshot_count none default zroot/ROOT/default redundant_metadata all default Let me know if you need anything else. Florian --Cn7Oef8OBebtxjw1BmG6CxsROLOWwalT0-- --gvmGU9PRjP8IHuN38fc4rReT29bdQa9f8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJXvLvSXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNzAxMDMyMDNCQ0FCNDRBOThGRUM4NDRF NzA1M0RGOUZGODZGMDc2AAoJEOcFPfn/hvB2YawQAIbnocohHOo7WsG6Y/fEonIl lhIJvwFFblGpV51IqTmAt1JEVdobpUoRcbPIkVyAyEbuNBX9Q1tQKMFcbntYo/Fk qeauRCpdMofc8+6a7QDsNJRJaiXrTJqmP24YBZVLvzi2YLWkmlm6xTtW+kKA+eT8 N70uC6uXuwyaH+ZdYOjTP3P1oCDKtXvhdgVQjhV0z0zZ9JlFue9qN65VOHeE8Rt0 xwxgB4lAE6FyqUZNJWvAnIWIAeoZL4SwGhoR61/7p0NF6riNL1k0Vg89LbL+d2AR ztIswnin5G+qeKCRZMcCx/zzP1BOPKyB8lQ1bkVwieg6thKnJEhW1cPvoGasZB7Z WxxFqmE1WsQ2pD9I0e6QByl2k6CgGkMn/RDS99RF9xh7ss+SxoGRjngPkQxjIdf2 rFbZEQeE6r8wGPV8vFwc1pEPPV5oiBCDd+CoVJmClw4aQO0griuJt8+QtCsPweGI 0tgt15tE2bLlGU6HP5fZw32Le+jIHLkGX7g23/guwyf9tDkzKOzYOQ8suimb2LI7 03JrPxxgPK71kc3a12BakSdqNKUxF+PEAQqxoVWEk9eG+iXd8WzrXRfeCCh6x5Z4 HRC7QGDT+NTvFFPgidF1KXzrFNnc935BMmFfgIHoCkf2FmirjWJw03kz50Iig5yy oj05r++LSFi2/rkIJWV8 =NJi4 -----END PGP SIGNATURE----- --gvmGU9PRjP8IHuN38fc4rReT29bdQa9f8-- From owner-svn-src-head@freebsd.org Tue Aug 23 21:14:31 2016 Return-Path: Delivered-To: svn-src-head@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 C3E62BC4B72 for ; Tue, 23 Aug 2016 21:14:31 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9791B86 for ; Tue, 23 Aug 2016 21:14:30 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id l89so109817271lfi.1 for ; Tue, 23 Aug 2016 14:14:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=2eI7Nb2lHaDWMUclVX7Vcjg/07CqUq66KNJlZh2XefY=; b=UhzBfAF0Y1GptaIFqLomx8veZ0WbOHwlBb2EruU8Tv9lfTOkcas7225p8b9EKF0rxH eQkDN6houX4Q4R8Q1RRfU2On70hKX6a0U60HE2o/b9s1wLXA4i3xABoiP2tjx+odR0MB 4TXlTFSYmHTbczbwaLxrOm7bPryRyMhIbgREwHE5FEn6UZZqVbnELPShW1GMTuGRtxaK 0Agn4IskEq77TIOm92KHAh/bSu7WxDOf6NbF/w32myrW+YQF5pqPANxnlVNILFSSWAxn eBOVMBvezr8TAe66xCKBRf9jVcl9XNRbu0pDeNw5r+pdfJ8WxKlJdolvT5c49jxfXwTt Ubjw== X-Gm-Message-State: AEkoouv7dmfKUjaWje7wJvFD8dqKnyvePj1/qdsComSmhf855573Njy4xCVZZdEUnaaMLw== X-Received: by 10.46.33.84 with SMTP id h81mr6907549ljh.47.1471986862688; Tue, 23 Aug 2016 14:14:22 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id e79sm1231788lji.42.2016.08.23.14.14.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 14:14:22 -0700 (PDT) Subject: Re: svn commit: r304703 - head/include/xlocale To: "Ngie Cooper (yaneurabeya)" References: <201608232033.u7NKXuZ9054093@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <48795833-b3ec-6cc3-1432-5669cc995b47@freebsd.org> Date: Wed, 24 Aug 2016 00:14:20 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="unTFewBggW3AsdvIf70LEhoQEkkHPSfmT" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 21:14:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --unTFewBggW3AsdvIf70LEhoQEkkHPSfmT Content-Type: multipart/mixed; boundary="CxCUBWbJ5Na6DlBvKS8J3p2PXXnIGAT0Q"; protected-headers="v1" From: Andrey Chernov To: "Ngie Cooper (yaneurabeya)" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <48795833-b3ec-6cc3-1432-5669cc995b47@freebsd.org> Subject: Re: svn commit: r304703 - head/include/xlocale References: <201608232033.u7NKXuZ9054093@repo.freebsd.org> In-Reply-To: --CxCUBWbJ5Na6DlBvKS8J3p2PXXnIGAT0Q Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 23.08.2016 23:53, Ngie Cooper (yaneurabeya) wrote: >=20 >> On Aug 23, 2016, at 13:33, Andrey A. Chernov wrote:= >> >> Author: ache >> Date: Tue Aug 23 20:33:56 2016 >> New Revision: 304703 >> URL: https://svnweb.freebsd.org/changeset/base/304703 >> >> Log: >> LC_*_MASK bit shifting order was partially broken from the initial co= mmit >> time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the >> right order. >> >> The order here should match XLC_* from "xlocale_private.h" which, in = turn, >> match LC_* publicly visible order from which determines ho= w >> locale components are stored in the structure. >> LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylo= cale() >> and equivalent shift loop in the newlocale(), so mapped to some wrong= >> components (excluding two mentioned above). >> >> Formally the fix is ABI breakage, but old code using those masks >> never works properly in any case. >> Only newlocale() and querylocale() are affected. >> >> MFC after: 7 days >> >> Modified: >> head/include/xlocale/_locale.h >=20 > Should __FreeBSD_version be bumped? > Thanks, > -Ngie >=20 Yes, I'll do it later. --CxCUBWbJ5Na6DlBvKS8J3p2PXXnIGAT0Q-- --unTFewBggW3AsdvIf70LEhoQEkkHPSfmT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXvLytAAoJEKUckv0MjfbKmMMIANIgBjua3n8uamBMzK00vhfO PfwQ/J8Ixgq90bPSyQeaR1s8mj506XG1YJG0jGIWq3/7vZaZK8nAoJUU+Imnx/sD h81zyGSU+FNInCD9SJTEws/w5dfMQxLT2E8JOJcThB81S3kURBePLCvyFaS3wVrn KisqitzNA3Oy78h3uQnFkI0PC3CH17kUlOKBX/0HMCEI7+ehiKgEtMwRQs+/tKyR R5sHE/rjj/5Dpj5UVkEqOW3IfuIhMS2yUF6J+LnlAheQjnBPKzjqV+Gmv/illAp1 taOxzBzI4L8n6o469rZzwZbh5E6WBCA1tG1h8ElOfwsv0FN9wy77/pv4PcWoWFA= =rYQ/ -----END PGP SIGNATURE----- --unTFewBggW3AsdvIf70LEhoQEkkHPSfmT-- From owner-svn-src-head@freebsd.org Tue Aug 23 22:26:52 2016 Return-Path: Delivered-To: svn-src-head@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 06E62BC48F1; Tue, 23 Aug 2016 22:26:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8EDC1567; Tue, 23 Aug 2016 22:26:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7NMQoK7096345; Tue, 23 Aug 2016 22:26:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7NMQoZ1096343; Tue, 23 Aug 2016 22:26:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608232226.u7NMQoZ1096343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 23 Aug 2016 22:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304710 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 22:26:52 -0000 Author: manu Date: Tue Aug 23 22:26:50 2016 New Revision: 304710 URL: https://svnweb.freebsd.org/changeset/base/304710 Log: Allwinner: Add thermal sensor driver for A10/A20 The thermal sensor lives in the touch screen controller. Touch screen part isn't done for now. Temperature is read every ~2 seconds and exposed via sysctl. Added: head/sys/arm/allwinner/aw_ts.c (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner Added: head/sys/arm/allwinner/aw_ts.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_ts.c Tue Aug 23 22:26:50 2016 (r304710) @@ -0,0 +1,230 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Allwinner Touch Sreen driver + * Touch screen part is not done, only the thermal sensor part is. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define READ(_sc, _r) bus_read_4((_sc)->res[0], (_r)) +#define WRITE(_sc, _r, _v) bus_write_4((_sc)->res[0], (_r), (_v)) + +/* Control register 0 */ +#define TP_CTRL0 0x00 +#define TP_CTRL0_TACQ(x) ((x & 0xFF) << 0) +#define TP_CTRL0_FS_DIV(x) ((x & 0xF) << 16) +#define TP_CTRL0_CLK_DIV(x) ((x & 0x3) << 20) +#define TP_CTRL0_CLK_SELECT(x) ((x & 0x1) << 22) + +/* Control register 1 */ +#define TP_CTRL1 0x04 +#define TP_CTRL1_MODE_EN (1 << 4) + +/* Control register 2 */ +#define TP_CTRL2 0x08 + +/* Control register 3 */ +#define TP_CTRL3 0x0C + +/* Int/FIFO control register */ +#define TP_FIFOC 0x10 +#define TP_FIFOC_TEMP_IRQ_ENABLE (1 << 18) + +/* Int/FIFO status register */ +#define TP_FIFOS 0x14 +#define TP_FIFOS_TEMP_IRQ_PENDING (1 << 18) + +/* Temperature Period Register */ +#define TP_TPR 0x18 +#define TP_TPR_TEMP_EN (1 << 16) +#define TP_TPR_TEMP_PERIOD(x) (x << 0) + +/* Common data register */ +#define TP_CDAT 0x1C + +/* Temperature data register */ +#define TEMP_DATA 0x20 + +/* TP Data register*/ +#define TP_DATA 0x24 + +/* TP IO config register */ +#define TP_IO_CONFIG 0x28 + +/* TP IO port data register */ +#define TP_IO_DATA 0x2C + +struct aw_ts_softc { + device_t dev; + struct resource * res[2]; + void * intrhand; + int temp_data; + int temp_offset; + int temp_step; +}; + +static struct resource_spec aw_ts_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +#define A10_TS 1 +#define A13_TS 2 + +#define AW_TS_TEMP_SYSCTL 1 + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun4i-a10-ts", A10_TS}, + {"allwinner,sun5i-a13-ts", A13_TS}, + {NULL, 0} +}; + +static void +aw_ts_intr(void *arg) +{ + struct aw_ts_softc *sc; + int val; + + sc= (struct aw_ts_softc *)arg; + + val = READ(sc, TP_FIFOS); + if (val & TP_FIFOS_TEMP_IRQ_PENDING) { + /* Convert the value to millicelsius then millikelvin */ + sc->temp_data = (READ(sc, TEMP_DATA) * sc->temp_step - sc->temp_offset) + + 273150; + } + + WRITE(sc, TP_FIFOS, val); +} + +static int +aw_ts_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner Touch Screen controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_ts_attach(device_t dev) +{ + struct aw_ts_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, aw_ts_spec, sc->res) != 0) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->res[1], + INTR_TYPE_MISC | INTR_MPSAFE, NULL, aw_ts_intr, sc, + &sc->intrhand)) { + bus_release_resources(dev, aw_ts_spec, sc->res); + device_printf(dev, "cannot setup interrupt handler\n"); + return (ENXIO); + } + + /* + * Thoses magic values were taken from linux which take them from + * the allwinner SDK or found them by deduction + */ + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case A10_TS: + sc->temp_offset = 257000; + sc->temp_step = 133; + break; + case A13_TS: + sc->temp_offset = 144700; + sc->temp_step = 100; + break; + } + + /* Enable clock and set divisers */ + WRITE(sc, TP_CTRL0, TP_CTRL0_CLK_SELECT(0) | + TP_CTRL0_CLK_DIV(2) | + TP_CTRL0_FS_DIV(7) | + TP_CTRL0_TACQ(63)); + + /* Enable TS module */ + WRITE(sc, TP_CTRL1, TP_CTRL1_MODE_EN); + + /* Enable Temperature, period is ~2s */ + WRITE(sc, TP_TPR, TP_TPR_TEMP_EN | TP_TPR_TEMP_PERIOD(1953)); + + /* Enable temp irq */ + WRITE(sc, TP_FIFOC, TP_FIFOC_TEMP_IRQ_ENABLE); + + /* Add sysctl */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, + &sc->temp_data, 0, sysctl_handle_int, + "IK3", "CPU Temperature"); + + return (0); +} + +static device_method_t aw_ts_methods[] = { + DEVMETHOD(device_probe, aw_ts_probe), + DEVMETHOD(device_attach, aw_ts_attach), + + DEVMETHOD_END +}; + +static driver_t aw_ts_driver = { + "aw_ts", + aw_ts_methods, + sizeof(struct aw_ts_softc), +}; +static devclass_t aw_ts_devclass; + +DRIVER_MODULE(aw_ts, simplebus, aw_ts_driver, aw_ts_devclass, 0, 0); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Tue Aug 23 22:04:59 2016 (r304709) +++ head/sys/arm/allwinner/files.allwinner Tue Aug 23 22:26:50 2016 (r304710) @@ -14,6 +14,7 @@ arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_rsb.c optional rsb arm/allwinner/aw_rtc.c standard +arm/allwinner/aw_ts.c standard arm/allwinner/aw_wdog.c standard arm/allwinner/aw_machdep.c standard arm/allwinner/aw_mp.c optional smp From owner-svn-src-head@freebsd.org Wed Aug 24 00:00:55 2016 Return-Path: Delivered-To: svn-src-head@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 B0F37B2942E; Wed, 24 Aug 2016 00:00:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 825341E56; Wed, 24 Aug 2016 00:00:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O00s1R029999; Wed, 24 Aug 2016 00:00:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O00sCf029998; Wed, 24 Aug 2016 00:00:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201608240000.u7O00sCf029998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Aug 2016 00:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304711 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 00:00:55 -0000 Author: brooks Date: Wed Aug 24 00:00:54 2016 New Revision: 304711 URL: https://svnweb.freebsd.org/changeset/base/304711 Log: Spell MIPS more traditionally in "bfd_elf32_ntradbigmips_vec". Sponsored by: DAPRA, AFRL Modified: head/contrib/binutils/bfd/config.bfd Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Tue Aug 23 22:26:50 2016 (r304710) +++ head/contrib/binutils/bfd/config.bfd Wed Aug 24 00:00:54 2016 (r304711) @@ -875,11 +875,11 @@ case "${targ}" in ;; mips*el-*-freebsd*) targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" ;; mips*-*-freebsd*) targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" ;; mips*-dec-* | mips*el-*-ecoff*) targ_defvec=ecoff_little_vec From owner-svn-src-head@freebsd.org Wed Aug 24 00:02:21 2016 Return-Path: Delivered-To: svn-src-head@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 BBE9FB294B8; Wed, 24 Aug 2016 00:02:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EFCB1306; Wed, 24 Aug 2016 00:02:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O02KWm033436; Wed, 24 Aug 2016 00:02:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O02Kru033435; Wed, 24 Aug 2016 00:02:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201608240002.u7O02Kru033435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 24 Aug 2016 00:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304712 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 00:02:21 -0000 Author: brooks Date: Wed Aug 24 00:02:20 2016 New Revision: 304712 URL: https://svnweb.freebsd.org/changeset/base/304712 Log: Avoid a redecleartion of __getosreldate(). Sponsored by: DARPA, AFRL Modified: head/lib/libc/gen/__getosreldate.c Modified: head/lib/libc/gen/__getosreldate.c ============================================================================== --- head/lib/libc/gen/__getosreldate.c Wed Aug 24 00:00:54 2016 (r304711) +++ head/lib/libc/gen/__getosreldate.c Wed Aug 24 00:02:20 2016 (r304712) @@ -33,8 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -int __getosreldate(void); - /* * This is private to libc. It is intended for wrapping syscall stubs in order * to avoid having to put SIGSYS signal handlers in place to test for presence From owner-svn-src-head@freebsd.org Wed Aug 24 00:52:31 2016 Return-Path: Delivered-To: svn-src-head@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 9EB84B29D83; Wed, 24 Aug 2016 00:52:31 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 588F91512; Wed, 24 Aug 2016 00:52:31 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O0qUNo052050; Wed, 24 Aug 2016 00:52:30 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O0qUJP052048; Wed, 24 Aug 2016 00:52:30 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608240052.u7O0qUJP052048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Wed, 24 Aug 2016 00:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304713 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 00:52:31 -0000 Author: karels Date: Wed Aug 24 00:52:30 2016 New Revision: 304713 URL: https://svnweb.freebsd.org/changeset/base/304713 Log: Fix L2 caching for UDP over IPv6 ip6_output() was missing cache invalidation code analougous to ip_output.c. r304545 disabled L2 caching for UDP/IPv6 as a workaround. This change adds the missing cache invalidation code and reverts r304545. Reviewed by: gnn Approved by: gnn (mentor) Tested by: peter@, Mike Andrews MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D7591 Modified: head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Aug 24 00:02:20 2016 (r304712) +++ head/sys/netinet6/ip6_output.c Wed Aug 24 00:52:30 2016 (r304713) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -552,6 +553,9 @@ again: rt = ro->ro_rt; ifp = ro->ro_rt->rt_ifp; } else { + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = NULL; if (fwd_tag == NULL) { bzero(&dst_sa, sizeof(dst_sa)); dst_sa.sin6_family = AF_INET6; @@ -821,6 +825,9 @@ again: } else { RO_RTFREE(ro); needfiblookup = 1; /* Redo the routing table lookup. */ + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = NULL; } } /* See if fib was changed by packet filter. */ @@ -829,6 +836,9 @@ again: fibnum = M_GETFIB(m); RO_RTFREE(ro); needfiblookup = 1; + if (ro->ro_lle) + LLE_FREE(ro->ro_lle); /* zeros ro_lle */ + ro->ro_lle = NULL; } if (needfiblookup) goto again; Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Aug 24 00:02:20 2016 (r304712) +++ head/sys/netinet6/udp6_usrreq.c Wed Aug 24 00:52:30 2016 (r304713) @@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, NULL, flags, + error = ip6_output(m, optp, &inp->inp_route6, flags, inp->in6p_moptions, NULL, inp); break; case AF_INET: From owner-svn-src-head@freebsd.org Wed Aug 24 02:41:25 2016 Return-Path: Delivered-To: svn-src-head@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 57FFCBC36B9; Wed, 24 Aug 2016 02:41:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27BB2196D; Wed, 24 Aug 2016 02:41:25 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O2fOfT092606; Wed, 24 Aug 2016 02:41:24 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O2fOe1092605; Wed, 24 Aug 2016 02:41:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608240241.u7O2fOe1092605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 24 Aug 2016 02:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304721 - head/usr.sbin/ntp/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 02:41:25 -0000 Author: cy Date: Wed Aug 24 02:41:24 2016 New Revision: 304721 URL: https://svnweb.freebsd.org/changeset/base/304721 Log: Fixup man page formatting. Submitted by: Steve Kargl Discussed with: bjk@ MFC after: 3 days Modified: head/usr.sbin/ntp/doc/sntp.8 Modified: head/usr.sbin/ntp/doc/sntp.8 ============================================================================== --- head/usr.sbin/ntp/doc/sntp.8 Wed Aug 24 02:32:40 2016 (r304720) +++ head/usr.sbin/ntp/doc/sntp.8 Wed Aug 24 02:41:24 2016 (r304721) @@ -213,7 +213,7 @@ of seconds specified before giving up. more than enough for a unicast response. If \fBsntp\fP is only waiting for a broadcast response a longer timeout is likely needed. -.It Fl \-wait , " Fl \-no\-wait" +.It Fl \-wait , Fl \-no\-wait Wait for pending replies (if not setting the time). The \fIno\-wait\fP form will disable the option. This option is enabled by default. From owner-svn-src-head@freebsd.org Wed Aug 24 03:06:12 2016 Return-Path: Delivered-To: svn-src-head@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 2253FBC3DA7; Wed, 24 Aug 2016 03:06:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id DC3BD1C22; Wed, 24 Aug 2016 03:06:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 689AD1A6B5D; Wed, 24 Aug 2016 13:06:05 +1000 (AEST) Date: Wed, 24 Aug 2016 13:06:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Ngie Cooper (yaneurabeya)" cc: Bryan Drewery , Bruce Evans , Hans Petter Selasky , Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304567 - head/sys/dev/usb/input In-Reply-To: <11F43201-868B-48DF-8612-95974A1B15AB@gmail.com> Message-ID: <20160824125906.S850@besplex.bde.org> References: <201608211606.u7LG60pS063983@repo.freebsd.org> <20160822185617.I1897@besplex.bde.org> <55444c61-f280-265a-e223-52b128382b71@FreeBSD.org> <11F43201-868B-48DF-8612-95974A1B15AB@gmail.com> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=U3Qa8ne3PVn-3QgmXoYA:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:06:12 -0000 On Tue, 23 Aug 2016, Ngie Cooper (yaneurabeya) wrote: >> On Aug 23, 2016, at 13:57, Bryan Drewery wrote: > ... > >> Well yours only supports stable/10+ and not 9- with the older merge styl= e. > > =09*shrugs* The older method promoted broken mergeinfo=85 The method I wr= ote up works fine with ^/stable/9- =97 just with non-sparse checkouts (I do= n=92t recommend sparse checkouts, again because it can screw up mergeinfo) = :). I have to/want to use a very sparse checkout. Currently 19MB. This doesn't seem to have caused any problems so far, except I somehow got =2Esvn databases in the most active subdirs. Bruce From owner-svn-src-head@freebsd.org Wed Aug 24 03:08:14 2016 Return-Path: Delivered-To: svn-src-head@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 90BEEBC3EBF; Wed, 24 Aug 2016 03:08:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5D7321DFB; Wed, 24 Aug 2016 03:08:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O38DJJ001501; Wed, 24 Aug 2016 03:08:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O38DXT001499; Wed, 24 Aug 2016 03:08:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608240308.u7O38DXT001499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Aug 2016 03:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304722 - in head/sys: dev/usb/net net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:08:14 -0000 Author: sephe Date: Wed Aug 24 03:08:13 2016 New Revision: 304722 URL: https://svnweb.freebsd.org/changeset/base/304722 Log: net/rndis: Add canonical RNDIS major/minor version as of today. Reviewed by: hps MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7593 Modified: head/sys/dev/usb/net/if_urndis.c head/sys/net/rndis.h Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Wed Aug 24 02:41:24 2016 (r304721) +++ head/sys/dev/usb/net/if_urndis.c Wed Aug 24 03:08:13 2016 (r304722) @@ -658,7 +658,7 @@ urndis_ctrl_init(struct urndis_softc *sc msg.rm_type = htole32(REMOTE_NDIS_INITIALIZE_MSG); msg.rm_len = htole32(sizeof(msg)); msg.rm_rid = 0; - msg.rm_ver_major = htole32(1); + msg.rm_ver_major = htole32(RNDIS_VERSION_MAJOR); msg.rm_ver_minor = htole32(1); msg.rm_max_xfersz = htole32(RNDIS_RX_MAXLEN); Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Wed Aug 24 02:41:24 2016 (r304721) +++ head/sys/net/rndis.h Wed Aug 24 03:08:13 2016 (r304722) @@ -23,6 +23,10 @@ #ifndef _NET_RNDIS_H_ #define _NET_RNDIS_H_ +/* Canonical major/minor version as of 22th Aug. 2016. */ +#define RNDIS_VERSION_MAJOR 0x00000001 +#define RNDIS_VERSION_MINOR 0x00000000 + #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L #define RNDIS_STATUS_FAILURE 0xC0000001L #define RNDIS_STATUS_INVALID_DATA 0xC0010015L From owner-svn-src-head@freebsd.org Wed Aug 24 03:16:27 2016 Return-Path: Delivered-To: svn-src-head@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 0C1A2BC22A4; Wed, 24 Aug 2016 03:16:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D30CF1661; Wed, 24 Aug 2016 03:16:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O3GQdR005115; Wed, 24 Aug 2016 03:16:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O3GQNk005114; Wed, 24 Aug 2016 03:16:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608240316.u7O3GQNk005114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Aug 2016 03:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304723 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:16:27 -0000 Author: sephe Date: Wed Aug 24 03:16:25 2016 New Revision: 304723 URL: https://svnweb.freebsd.org/changeset/base/304723 Log: net/rndis: Fix RNDIS_STATUS_PENDING definition. While I'm here, sort the RNDIS status in ascending order. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7594 Modified: head/sys/net/rndis.h Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Wed Aug 24 03:08:13 2016 (r304722) +++ head/sys/net/rndis.h Wed Aug 24 03:16:25 2016 (r304723) @@ -27,15 +27,15 @@ #define RNDIS_VERSION_MAJOR 0x00000001 #define RNDIS_VERSION_MINOR 0x00000000 -#define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L -#define RNDIS_STATUS_FAILURE 0xC0000001L -#define RNDIS_STATUS_INVALID_DATA 0xC0010015L +#define RNDIS_STATUS_SUCCESS 0x00000000L +#define RNDIS_STATUS_PENDING 0x00000103L #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L +#define RNDIS_STATUS_FAILURE 0xC0000001L #define RNDIS_STATUS_NOT_SUPPORTED 0xC00000BBL -#define RNDIS_STATUS_PENDING STATUS_PENDING /* XXX */ #define RNDIS_STATUS_RESOURCES 0xC000009AL -#define RNDIS_STATUS_SUCCESS 0x00000000L +#define RNDIS_STATUS_INVALID_DATA 0xC0010015L #define OID_GEN_SUPPORTED_LIST 0x00010101 #define OID_GEN_HARDWARE_STATUS 0x00010102 From owner-svn-src-head@freebsd.org Wed Aug 24 03:28:59 2016 Return-Path: Delivered-To: svn-src-head@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 94E96BC274B; Wed, 24 Aug 2016 03:28:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 65CC8114D; Wed, 24 Aug 2016 03:28:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O3SwDV009396; Wed, 24 Aug 2016 03:28:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O3Swhl009395; Wed, 24 Aug 2016 03:28:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608240328.u7O3Swhl009395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Aug 2016 03:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304724 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:28:59 -0000 Author: sephe Date: Wed Aug 24 03:28:58 2016 New Revision: 304724 URL: https://svnweb.freebsd.org/changeset/base/304724 Log: hyperv/hn: Remove the redundant rid setting for RNDIS HALT. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7595 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 24 03:16:25 2016 (r304723) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 24 03:28:58 2016 (r304724) @@ -928,7 +928,6 @@ static int hv_rf_halt_device(rndis_device *device) { rndis_request *request; - rndis_halt_request *halt; int i, ret; /* Attempt to do a rndis device halt */ @@ -941,12 +940,6 @@ hv_rf_halt_device(rndis_device *device) /* initialize "poor man's semaphore" */ request->halt_complete_flag = 0; - /* Set up the rndis set */ - halt = &request->request_msg.msg.halt_request; - halt->request_id = atomic_fetchadd_int(&device->new_request_id, 1); - /* Increment to get the new value (call above returns old value) */ - halt->request_id += 1; - ret = hv_rf_send_request(device, request, REMOTE_NDIS_HALT_MSG); if (ret != 0) { return (-1); From owner-svn-src-head@freebsd.org Wed Aug 24 03:44:18 2016 Return-Path: Delivered-To: svn-src-head@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 083B9BC2BDF; Wed, 24 Aug 2016 03:44:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CC9D11A1D; Wed, 24 Aug 2016 03:44:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O3iHGk016461; Wed, 24 Aug 2016 03:44:17 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O3iHvx016460; Wed, 24 Aug 2016 03:44:17 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608240344.u7O3iHvx016460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 24 Aug 2016 03:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304725 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:44:18 -0000 Author: kevlo Date: Wed Aug 24 03:44:16 2016 New Revision: 304725 URL: https://svnweb.freebsd.org/changeset/base/304725 Log: Bring datasheet URL up to date. Modified: head/sys/dev/usb/input/uep.c Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Wed Aug 24 03:28:58 2016 (r304724) +++ head/sys/dev/usb/input/uep.c Wed Aug 24 03:44:16 2016 (r304725) @@ -27,7 +27,7 @@ */ /* - * http://home.eeti.com.tw/web20/drivers/Software%20Programming%20Guide_v2.0.pdf + * http://www.eeti.com.tw/pdf/Software%20Programming%20Guide_v2.0.pdf */ #include From owner-svn-src-head@freebsd.org Wed Aug 24 03:51:42 2016 Return-Path: Delivered-To: svn-src-head@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 1AAD8BC2E40; Wed, 24 Aug 2016 03:51:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE7E61EAD; Wed, 24 Aug 2016 03:51:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O3pfHK019479; Wed, 24 Aug 2016 03:51:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O3peXQ019475; Wed, 24 Aug 2016 03:51:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608240351.u7O3peXQ019475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 24 Aug 2016 03:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304727 - in head/sys/powerpc: booke include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:51:42 -0000 Author: jhibbits Date: Wed Aug 24 03:51:40 2016 New Revision: 304727 URL: https://svnweb.freebsd.org/changeset/base/304727 Log: Fix system hang when large FDT is in use Summary: Kernel maps only one page of FDT. When FDT is more than one page in size, data TLB miss occurs on memmove() when FDT is moved to kernel storage (sys/powerpc/booke/booke_machdep.c, booke_init()) This introduces a pmap_early_io_unmap() to complement pmap_early_io_map(), which can be used for any early I/O mapping, but currently is only used when mapping the fdt. Submitted by: Ivan Krivonos Differential Revision: https://reviews.freebsd.org/D7605 Modified: head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Wed Aug 24 03:44:20 2016 (r304726) +++ head/sys/powerpc/booke/booke_machdep.c Wed Aug 24 03:51:40 2016 (r304727) @@ -249,6 +249,7 @@ static int booke_check_for_fdt(uint32_t arg1, vm_offset_t *dtbp) { void *ptr; + int fdt_size; if (arg1 % 8 != 0) return (-1); @@ -257,6 +258,19 @@ booke_check_for_fdt(uint32_t arg1, vm_of if (fdt_check_header(ptr) != 0) return (-1); + /* + * Read FDT total size from the header of FDT. + * This for sure hits within first page which is + * already mapped. + */ + fdt_size = fdt_totalsize((void *)ptr); + + /* + * Ok, arg1 points to FDT, so we need to map it in. + * First, unmap this page and then map FDT again with full size + */ + pmap_early_io_unmap((vm_offset_t)ptr, PAGE_SIZE); + ptr = (void *)pmap_early_io_map(arg1, fdt_size); *dtbp = (vm_offset_t)ptr; return (0); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Aug 24 03:44:20 2016 (r304726) +++ head/sys/powerpc/booke/pmap.c Wed Aug 24 03:51:40 2016 (r304727) @@ -3419,6 +3419,29 @@ tlb1_init() set_mas4_defaults(); } +void +pmap_early_io_unmap(vm_offset_t va, vm_size_t size) +{ + int i; + tlb_entry_t e; + + for (i = 0; i < TLB1_ENTRIES && size > 0; i ++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) + continue; + /* + * FIXME: this code does not work if VA region + * spans multiple TLB entries. This does not cause + * problems right now but shall be fixed in the future + */ + if (va >= e.virt && (va + size) <= (e.virt + e.size)) { + size -= e.size; + e.mas1 &= ~MAS1_VALID; + tlb1_write_entry(&e, i); + } + } +} + vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size) { Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Wed Aug 24 03:44:20 2016 (r304726) +++ head/sys/powerpc/include/pmap.h Wed Aug 24 03:51:40 2016 (r304727) @@ -260,6 +260,7 @@ extern vm_offset_t msgbuf_phys; extern int pmap_bootstrapped; vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size); +void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); #endif From owner-svn-src-head@freebsd.org Wed Aug 24 04:21:16 2016 Return-Path: Delivered-To: svn-src-head@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 E4660BC47E8; Wed, 24 Aug 2016 04:21:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 941A21341; Wed, 24 Aug 2016 04:21:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O4LF5s032029; Wed, 24 Aug 2016 04:21:15 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O4LFWB032028; Wed, 24 Aug 2016 04:21:15 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608240421.u7O4LFWB032028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Aug 2016 04:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304728 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 04:21:17 -0000 Author: sephe Date: Wed Aug 24 04:21:15 2016 New Revision: 304728 URL: https://svnweb.freebsd.org/changeset/base/304728 Log: hyperv/hn: Log a warning for RESET_CMPLT. RESET is not used by the hn(4) at all, and RESET_CMPLT does not even have a rid to match with the pending requests. So, let's put it onto an independent switch branch and log a warning about it. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7602 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 24 03:51:40 2016 (r304727) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 24 04:21:15 2016 (r304728) @@ -324,16 +324,9 @@ hv_rf_receive_response(rndis_device *dev memcpy(&request->response_msg, response, response->msg_len); } else { - if (response->ndis_msg_type == REMOTE_NDIS_RESET_CMPLT) { - /* Does not have a request id field */ - request->response_msg.msg.reset_complete.status = - STATUS_BUFFER_OVERFLOW; - } else { - request->response_msg.msg.init_complete.status = - STATUS_BUFFER_OVERFLOW; - } + request->response_msg.msg.init_complete.status = + STATUS_BUFFER_OVERFLOW; } - sema_post(&request->wait_sema); } } @@ -566,29 +559,40 @@ hv_rf_on_receive(struct hn_softc *sc, st rndis_hdr = data; switch (rndis_hdr->ndis_msg_type) { - /* data message */ case REMOTE_NDIS_PACKET_MSG: hv_rf_receive_data(rxr, data, dlen); break; + /* completion messages */ case REMOTE_NDIS_INITIALIZE_CMPLT: case REMOTE_NDIS_QUERY_CMPLT: case REMOTE_NDIS_SET_CMPLT: - case REMOTE_NDIS_RESET_CMPLT: case REMOTE_NDIS_KEEPALIVE_CMPLT: hv_rf_receive_response(rndis_dev, rndis_hdr); break; + /* notification message */ case REMOTE_NDIS_INDICATE_STATUS_MSG: hv_rf_receive_indicate_status(rndis_dev, rndis_hdr); break; + + case REMOTE_NDIS_RESET_CMPLT: + /* + * Reset completed, no rid. + * + * NOTE: + * RESET is not issued by hn(4), so this message should + * _not_ be observed. + */ + if_printf(sc->hn_ifp, "RESET CMPLT received\n"); + break; + default: - printf("hv_rf_on_receive(): Unknown msg_type 0x%x\n", + if_printf(sc->hn_ifp, "unknown RNDIS message 0x%x\n", rndis_hdr->ndis_msg_type); break; } - return (0); } From owner-svn-src-head@freebsd.org Wed Aug 24 04:36:06 2016 Return-Path: Delivered-To: svn-src-head@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 42FBDBC4ABE; Wed, 24 Aug 2016 04:36:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1AE7A1B38; Wed, 24 Aug 2016 04:36:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O4a5nX035879; Wed, 24 Aug 2016 04:36:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O4a4Pr035873; Wed, 24 Aug 2016 04:36:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608240436.u7O4a4Pr035873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 24 Aug 2016 04:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304730 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 04:36:06 -0000 Author: sephe Date: Wed Aug 24 04:36:04 2016 New Revision: 304730 URL: https://svnweb.freebsd.org/changeset/base/304730 Log: hyperv/ic: Redefine IC version negotiate message. And stringent input IC version negotiate message checks. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7614 Added: head/sys/dev/hyperv/utilities/vmbus_icreg.h (contents, props changed) Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Aug 24 04:33:21 2016 (r304729) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Aug 24 04:36:04 2016 (r304730) @@ -80,7 +80,11 @@ hv_heartbeat_cb(struct vmbus_channel *ch &buf[sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, buf); + int error; + + error = vmbus_ic_negomsg(softc, buf, recvlen); + if (error) + return; } else { heartbeat_msg = (struct hv_vmbus_heartbeat_msg_data *) Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 24 04:33:21 2016 (r304729) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 24 04:36:04 2016 (r304730) @@ -85,7 +85,11 @@ hv_shutdown_cb(struct vmbus_channel *cha &buf[sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, buf); + int error; + + error = vmbus_ic_negomsg(softc, buf, recv_len); + if (error) + return; } else { shutdown_msg = (struct hv_vmbus_shutdown_msg_data *) Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 24 04:33:21 2016 (r304729) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 24 04:36:04 2016 (r304730) @@ -160,7 +160,11 @@ hv_timesync_cb(struct vmbus_channel *cha sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, time_buf); + int error; + + error = vmbus_ic_negomsg(&softc->util_sc, time_buf, recvlen); + if (error) + return; } else { timedatap = (struct hv_ictimesync_data *) &time_buf[ sizeof(struct hv_vmbus_pipe_hdr) + Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Wed Aug 24 04:33:21 2016 (r304729) +++ head/sys/dev/hyperv/utilities/hv_util.c Wed Aug 24 04:36:04 2016 (r304730) @@ -36,44 +36,62 @@ #include #include #include +#include #include -#include #include #include -#include #include +#include #include "vmbus_if.h" #define VMBUS_IC_BRSIZE (4 * PAGE_SIZE) -void -hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) +CTASSERT(sizeof(struct vmbus_icmsg_negotiate) < VMBUS_IC_BRSIZE); + +int +vmbus_ic_negomsg(struct hv_util_sc *sc, void *data, int dlen) { - struct hv_vmbus_icmsg_negotiate *negop; + struct vmbus_icmsg_negotiate *nego; + int cnt, major; - icmsghdrp->icmsgsize = 0x10; + /* + * Preliminary message size verification + */ + if (dlen < sizeof(*nego)) { + device_printf(sc->ic_dev, "truncated ic negotiate, len %d\n", + dlen); + return EINVAL; + } + nego = data; - negop = (struct hv_vmbus_icmsg_negotiate *)&buf[ - sizeof(struct hv_vmbus_pipe_hdr) + - sizeof(struct hv_vmbus_icmsg_hdr)]; - - if (negop->icframe_vercnt >= 2 && - negop->icversion_data[1].major == 3) { - negop->icversion_data[0].major = 3; - negop->icversion_data[0].minor = 0; - negop->icversion_data[1].major = 3; - negop->icversion_data[1].minor = 0; - } else { - negop->icversion_data[0].major = 1; - negop->icversion_data[0].minor = 0; - negop->icversion_data[1].major = 1; - negop->icversion_data[1].minor = 0; + cnt = nego->ic_fwver_cnt + nego->ic_msgver_cnt; + if (dlen < __offsetof(struct vmbus_icmsg_negotiate, ic_ver[cnt])) { + device_printf(sc->ic_dev, "ic negotiate does not contain " + "versions %d\n", dlen); + return EINVAL; } - negop->icframe_vercnt = 1; - negop->icmsg_vercnt = 1; + /* Select major version; XXX looks wrong. */ + if (nego->ic_fwver_cnt >= 2 && VMBUS_ICVER_MAJOR(nego->ic_ver[1]) == 3) + major = 3; + else + major = 1; + + /* One framework version */ + nego->ic_fwver_cnt = 1; + nego->ic_ver[0] = VMBUS_IC_VERSION(major, 0); + + /* One message version */ + nego->ic_msgver_cnt = 1; + nego->ic_ver[1] = VMBUS_IC_VERSION(major, 0); + + /* Data contains two versions */ + nego->ic_hdr.ic_dsize = __offsetof(struct vmbus_icmsg_negotiate, + ic_ver[2]) - sizeof(struct vmbus_icmsg_hdr); + + return 0; } int @@ -101,6 +119,7 @@ hv_util_attach(device_t dev, vmbus_chan_ struct vmbus_channel *chan = vmbus_get_channel(dev); int error; + sc->ic_dev = dev; sc->ic_buflen = VMBUS_IC_BRSIZE; sc->receive_buffer = malloc(VMBUS_IC_BRSIZE, M_DEVBUF, M_WAITOK | M_ZERO); Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Wed Aug 24 04:33:21 2016 (r304729) +++ head/sys/dev/hyperv/utilities/hv_util.h Wed Aug 24 04:36:04 2016 (r304730) @@ -39,6 +39,7 @@ * */ typedef struct hv_util_sc { + device_t ic_dev; uint8_t *receive_buffer; int ic_buflen; } hv_util_sc; @@ -50,10 +51,9 @@ struct vmbus_ic_desc { #define VMBUS_IC_DESC_END { .ic_desc = NULL } -void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf); - int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); int hv_util_detach(device_t dev); int vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]); +int vmbus_ic_negomsg(struct hv_util_sc *, void *data, int dlen); #endif Added: head/sys/dev/hyperv/utilities/vmbus_icreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/utilities/vmbus_icreg.h Wed Aug 24 04:36:04 2016 (r304730) @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VMBUS_ICREG_H_ +#define _VMBUS_ICREG_H_ + +#define VMBUS_ICMSG_TYPE_NEGOTIATE 0 +#define VMBUS_ICMSG_TYPE_HEARTBEAT 1 +#define VMBUS_ICMSG_TYPE_KVP 2 +#define VMBUS_ICMSG_TYPE_SHUTDOWN 3 +#define VMBUS_ICMSG_TYPE_TIMESYNC 4 +#define VMBUS_ICMSG_TYPE_VSS 5 + +#define VMBUS_ICMSG_STATUS_OK 0x00000000 +#define VMBUS_ICMSG_STATUS_FAIL 0x80004005 + +#define VMBUS_IC_VERSION(major, minor) ((major) | (((uint32_t)(minor)) << 16)) +#define VMBUS_ICVER_MAJOR(ver) ((ver) & 0xffff) +#define VMBUS_ICVER_MINOR(ver) (((ver) & 0xffff0000) >> 16) + +struct vmbus_pipe_hdr { + uint32_t ph_flags; + uint32_t ph_msgsz; +} __packed; + +struct vmbus_icmsg_hdr { + struct vmbus_pipe_hdr ic_pipe; + uint32_t ic_fwver; /* framework version */ + uint16_t ic_type; + uint32_t ic_msgver; /* message version */ + uint16_t ic_dsize; /* data size */ + uint32_t ic_status; /* VMBUS_ICMSG_STATUS_ */ + uint8_t ic_xactid; + uint8_t ic_flags; /* VMBUS_ICMSG_FLAG_ */ + uint8_t ic_rsvd[2]; +} __packed; + +#define VMBUS_ICMSG_FLAG_XACT 0x0001 +#define VMBUS_ICMSG_FLAG_REQ 0x0002 +#define VMBUS_ICMSG_FLAG_RESP 0x0004 + +/* VMBUS_ICMSG_TYPE_NEGOTIATE */ +struct vmbus_icmsg_negotiate { + struct vmbus_icmsg_hdr ic_hdr; + uint16_t ic_fwver_cnt; + uint16_t ic_msgver_cnt; + uint32_t ic_rsvd; + /* + * This version array contains two set of supported + * versions: + * - The first set consists of #ic_fwver_cnt supported framework + * versions. + * - The second set consists of #ic_msgver_cnt supported message + * versions. + */ + uint32_t ic_ver[]; +} __packed; + +#endif /* !_VMBUS_ICREG_H_ */ From owner-svn-src-head@freebsd.org Wed Aug 24 05:54:13 2016 Return-Path: Delivered-To: svn-src-head@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 1E328BC4231; Wed, 24 Aug 2016 05:54:13 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D28D1176B; Wed, 24 Aug 2016 05:54:12 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O5sCKG065448; Wed, 24 Aug 2016 05:54:12 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O5sCQf065447; Wed, 24 Aug 2016 05:54:12 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608240554.u7O5sCQf065447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 24 Aug 2016 05:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304735 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 05:54:13 -0000 Author: bde Date: Wed Aug 24 05:54:11 2016 New Revision: 304735 URL: https://svnweb.freebsd.org/changeset/base/304735 Log: Fix key delay and repeat, part 2. Use sbintime_t timeouts with precision control to get very accurate timing. It costs little to always ask for about 1% accuracy, and the not so new event timer implementation usual delivers that, and when it can't it gets much closer than our previous coarse timeouts and buggy simple countdown. The 2 fastest atkbd repeat rates have periods 34 and 38 msec, and ukbd pretended to support rates in between these. This requires sub-microsecond precision and accuracy even to handle the 4 msec difference very well, but ukbd asked the timeout subsystem for timeouts of 25 msec and the buggy simple countdown of this gave a a wide range of precisions and accuracies depending on HZ and other timer configuration (sometimes better than 25 msec but usually more like 50 msec). We now ask for and usually get precision and accuracy of about 1% for each repeat and much better on average. The 1% accuracy is overkill. Rounding of 30 cps to 34 msec instead of 33 already gives an error of +2% instead of -1%, and ut AT keyboards on PS/2 interfaces have similar errors. A timeout is now scheduled for every keypress and release. This allows some simplifications that are not done. It allows removing the timeout scheduling for exiting polled mode where it was unsafe in ddb mode. This is done. Exiting polled mode had some problems with extra repeats. Now exiting polled mode lets an extra timeout fire and the state is fudged so that the timeout handler does very little. The sc->time_ms variable is unsigned to avoid overflow. Differences of it need to be signed. Signed comparisons were emulated by testing an emulated sign bits. This only works easily for '<' comparisonss, but we now need a '<=' comparison. Change the difference variable to signed and use a signed comparison. Using unsigned types here didn't prevent overflow bugs but just reduced them. Overflow occurs with n repeats at the silly repeat period of [U]INT_MAX / n. The old countdown had an off by 1 error, and the simplifications would simply count down 1 to 0 and not need to accumulate possibly-large repeat repeats. Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Wed Aug 24 05:01:20 2016 (r304734) +++ head/sys/dev/usb/input/ukbd.c Wed Aug 24 05:54:11 2016 (r304735) @@ -163,6 +163,8 @@ struct ukbd_softc { struct usb_interface *sc_iface; struct usb_xfer *sc_xfer[UKBD_N_TRANSFER]; + sbintime_t sc_co_basetime; + int sc_delay; uint32_t sc_ntime[UKBD_NKEYCODE]; uint32_t sc_otime[UKBD_NKEYCODE]; uint32_t sc_input[UKBD_IN_BUF_SIZE]; /* input buffer */ @@ -182,7 +184,6 @@ struct ukbd_softc { #define UKBD_FLAG_APPLE_EJECT 0x00000040 #define UKBD_FLAG_APPLE_FN 0x00000080 #define UKBD_FLAG_APPLE_SWAP 0x00000100 -#define UKBD_FLAG_TIMER_RUNNING 0x00000200 #define UKBD_FLAG_CTRL_L 0x00000400 #define UKBD_FLAG_CTRL_R 0x00000800 #define UKBD_FLAG_SHIFT_L 0x00001000 @@ -393,8 +394,14 @@ ukbd_any_key_pressed(struct ukbd_softc * static void ukbd_start_timer(struct ukbd_softc *sc) { - sc->sc_flags |= UKBD_FLAG_TIMER_RUNNING; - usb_callout_reset(&sc->sc_callout, hz / 40, &ukbd_timeout, sc); + sbintime_t delay, prec; + + delay = SBT_1MS * sc->sc_delay; + sc->sc_co_basetime += delay; + /* This is rarely called, so prefer precision to efficiency. */ + prec = qmin(delay >> 7, SBT_1MS * 10); + callout_reset_sbt(&sc->sc_callout.co, sc->sc_co_basetime, prec, + ukbd_timeout, sc, C_ABSOLUTE); } static void @@ -503,10 +510,11 @@ ukbd_get_key(struct ukbd_softc *sc, uint static void ukbd_interrupt(struct ukbd_softc *sc) { + struct timeval ctv; uint32_t n_mod; uint32_t o_mod; uint32_t now = sc->sc_time_ms; - uint32_t dtime; + int32_t dtime; uint8_t key; uint8_t i; uint8_t j; @@ -564,7 +572,7 @@ rfound: ; sc->sc_ntime[i] = sc->sc_otime[j]; dtime = (sc->sc_otime[j] - now); - if (!(dtime & 0x80000000)) { + if (dtime > 0) { /* time has not elapsed */ goto pfound; } @@ -572,6 +580,15 @@ rfound: ; break; } } + if (j < UKBD_NKEYCODE) { + /* Old key repeating. */ + sc->sc_delay = sc->sc_kbd.kb_delay2; + } else { + /* New key. */ + microuptime(&ctv); + sc->sc_co_basetime = tvtosbt(ctv); + sc->sc_delay = sc->sc_kbd.kb_delay1; + } ukbd_put_key(sc, key | KEY_PRESS); /* @@ -626,7 +643,8 @@ ukbd_timeout(void *arg) UKBD_LOCK_ASSERT(); - sc->sc_time_ms += 25; /* milliseconds */ + sc->sc_time_ms += sc->sc_delay; + sc->sc_delay = 0; ukbd_interrupt(sc); @@ -635,8 +653,6 @@ ukbd_timeout(void *arg) if (ukbd_any_key_pressed(sc) || (sc->sc_inputs != 0)) { ukbd_start_timer(sc); - } else { - sc->sc_flags &= ~UKBD_FLAG_TIMER_RUNNING; } } @@ -822,10 +838,8 @@ ukbd_intr_callback(struct usb_xfer *xfer ukbd_interrupt(sc); - if (!(sc->sc_flags & UKBD_FLAG_TIMER_RUNNING)) { - if (ukbd_any_key_pressed(sc)) { - ukbd_start_timer(sc); - } + if (ukbd_any_key_pressed(sc)) { + ukbd_start_timer(sc); } case USB_ST_SETUP: @@ -2016,7 +2030,7 @@ ukbd_poll(keyboard_t *kbd, int on) sc->sc_poll_thread = curthread; } else { sc->sc_flags &= ~UKBD_FLAG_POLLING; - ukbd_start_timer(sc); /* start timer */ + sc->sc_delay = 0; } UKBD_UNLOCK(); From owner-svn-src-head@freebsd.org Wed Aug 24 06:22:54 2016 Return-Path: Delivered-To: svn-src-head@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 8D819BC49B0; Wed, 24 Aug 2016 06:22:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F6D1A7F; Wed, 24 Aug 2016 06:22:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O6Mr3S077448; Wed, 24 Aug 2016 06:22:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O6Mr38077447; Wed, 24 Aug 2016 06:22:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608240622.u7O6Mr38077447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 24 Aug 2016 06:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304736 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 06:22:54 -0000 Author: tuexen Date: Wed Aug 24 06:22:53 2016 New Revision: 304736 URL: https://svnweb.freebsd.org/changeset/base/304736 Log: When aborting an association, send the ABORT before notifying the upper layer. For the kernel this doesn't matter, for the userland stack, it does. While there, silence a clang warning when compiling it in userland. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Aug 24 05:54:11 2016 (r304735) +++ head/sys/netinet/sctputil.c Wed Aug 24 06:22:53 2016 (r304736) @@ -3983,17 +3983,16 @@ sctp_abort_association(struct sctp_inpcb vtag = 0; if (stcb != NULL) { - /* We have a TCB to abort, send notification too */ vtag = stcb->asoc.peer_vtag; - sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); - /* get the assoc vrf id and table id */ vrf_id = stcb->asoc.vrf_id; - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } sctp_send_abort(m, iphlen, src, dst, sh, vtag, op_err, mflowtype, mflowid, inp->fibnum, vrf_id, port); if (stcb != NULL) { + /* We have a TCB to abort, send notification too */ + sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); + stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; /* Ok, now lets free it */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); @@ -4109,10 +4108,6 @@ sctp_abort_an_association(struct sctp_in } else { stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } - /* notify the ulp */ - if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - sctp_abort_notification(stcb, 0, 0, NULL, so_locked); - } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); SCTP_STAT_INCR_COUNTER32(sctps_aborted); @@ -4120,6 +4115,10 @@ sctp_abort_an_association(struct sctp_in (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } + /* notify the ulp */ + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { + sctp_abort_notification(stcb, 0, 0, NULL, so_locked); + } /* now free the asoc */ #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); @@ -6400,6 +6399,7 @@ sctp_connectx_helper_find(struct sctp_in #endif default: *totaddr = i; + incr = 0; /* we are done */ break; } From owner-svn-src-head@freebsd.org Wed Aug 24 07:32:21 2016 Return-Path: Delivered-To: svn-src-head@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 345D0BC48D1; Wed, 24 Aug 2016 07:32:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 0158417D4; Wed, 24 Aug 2016 07:32:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F339D1FE023; Wed, 24 Aug 2016 09:32:18 +0200 (CEST) Subject: Re: svn commit: r304699 - head/sys/dev/usb/input To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608231950.u7NJoGD8035436@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <6e540271-b273-3f0b-0325-956bd0478789@selasky.org> Date: Wed, 24 Aug 2016 09:36:50 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608231950.u7NJoGD8035436@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 07:32:21 -0000 On 08/23/16 21:50, Bruce Evans wrote: > + kbd->kb_delay1 = imax(((int *)arg)[0], 250); > + kbd->kb_delay2 = imax(((int *)arg)[1], 34); Hi, It looks like this will pass negative kb_delay's. How do you handle that? --HPS From owner-svn-src-head@freebsd.org Wed Aug 24 07:38:50 2016 Return-Path: Delivered-To: svn-src-head@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 F18CFBC4A24; Wed, 24 Aug 2016 07:38:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id B30151A6E; Wed, 24 Aug 2016 07:38:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E4E90426E6F; Wed, 24 Aug 2016 17:38:34 +1000 (AEST) Date: Wed, 24 Aug 2016 17:38:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304699 - head/sys/dev/usb/input In-Reply-To: <6e540271-b273-3f0b-0325-956bd0478789@selasky.org> Message-ID: <20160824173513.M1067@besplex.bde.org> References: <201608231950.u7NJoGD8035436@repo.freebsd.org> <6e540271-b273-3f0b-0325-956bd0478789@selasky.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Ol_XVkcfVrUKViacTZIA:9 a=CjuIK1q_8ugA:10 a=zPhqG-KPNAYA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 07:38:50 -0000 On Wed, 24 Aug 2016, Hans Petter Selasky wrote: > On 08/23/16 21:50, Bruce Evans wrote: >> + kbd->kb_delay1 = imax(((int *)arg)[0], 250); >> + kbd->kb_delay2 = imax(((int *)arg)[1], 34); > > It looks like this will pass negative kb_delay's. How do you handle that? imax(negtive, POSITIVE) == POSITIVE. Bruce From owner-svn-src-head@freebsd.org Wed Aug 24 07:52:52 2016 Return-Path: Delivered-To: svn-src-head@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 06311BC209A; Wed, 24 Aug 2016 07:52:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 BDE721949; Wed, 24 Aug 2016 07:52:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 687A21FE023; Wed, 24 Aug 2016 09:52:43 +0200 (CEST) Subject: Re: svn commit: r304699 - head/sys/dev/usb/input To: Bruce Evans References: <201608231950.u7NJoGD8035436@repo.freebsd.org> <6e540271-b273-3f0b-0325-956bd0478789@selasky.org> <20160824173513.M1067@besplex.bde.org> Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <5d19a3ad-630d-f145-1e5e-36d51b4abdbb@selasky.org> Date: Wed, 24 Aug 2016 09:57:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160824173513.M1067@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 07:52:52 -0000 On 08/24/16 09:38, Bruce Evans wrote: > On Wed, 24 Aug 2016, Hans Petter Selasky wrote: > >> On 08/23/16 21:50, Bruce Evans wrote: >>> + kbd->kb_delay1 = imax(((int *)arg)[0], 250); >>> + kbd->kb_delay2 = imax(((int *)arg)[1], 34); >> >> It looks like this will pass negative kb_delay's. How do you handle that? > > imax(negtive, POSITIVE) == POSITIVE. > OK, looks good. --HPS From owner-svn-src-head@freebsd.org Wed Aug 24 09:57:20 2016 Return-Path: Delivered-To: svn-src-head@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 95945BBE21C; Wed, 24 Aug 2016 09:57:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68A821BA3; Wed, 24 Aug 2016 09:57:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7O9vJpQ061889; Wed, 24 Aug 2016 09:57:19 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7O9vJaF061888; Wed, 24 Aug 2016 09:57:19 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608240957.u7O9vJaF061888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Aug 2016 09:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304740 - head/sys/compat/ia32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 09:57:20 -0000 Author: ed Date: Wed Aug 24 09:57:19 2016 New Revision: 304740 URL: https://svnweb.freebsd.org/changeset/base/304740 Log: Add missing header dependency. This header depends on sigaltstack32 being declared. Modified: head/sys/compat/ia32/ia32_signal.h Modified: head/sys/compat/ia32/ia32_signal.h ============================================================================== --- head/sys/compat/ia32/ia32_signal.h Wed Aug 24 09:20:27 2016 (r304739) +++ head/sys/compat/ia32/ia32_signal.h Wed Aug 24 09:57:19 2016 (r304740) @@ -32,6 +32,8 @@ #ifndef _COMPAT_IA32_IA32_SIGNAL_H #define _COMPAT_IA32_IA32_SIGNAL_H +#include + #define _MC_IA32_HASSEGS 0x1 #define _MC_IA32_HASBASES 0x2 #define _MC_IA32_HASFPXSTATE 0x4 From owner-svn-src-head@freebsd.org Wed Aug 24 10:10:28 2016 Return-Path: Delivered-To: svn-src-head@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 3763BBBEB35; Wed, 24 Aug 2016 10:10:28 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 049631611; Wed, 24 Aug 2016 10:10:27 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OAARAC065789; Wed, 24 Aug 2016 10:10:27 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OAARk5065788; Wed, 24 Aug 2016 10:10:27 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201608241010.u7OAARk5065788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Wed, 24 Aug 2016 10:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304741 - head/bin/ls/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 10:10:28 -0000 Author: jmmv Date: Wed Aug 24 10:10:26 2016 New Revision: 304741 URL: https://svnweb.freebsd.org/changeset/base/304741 Log: Skip ls tests that use sparse files if these are not supported. Some of the ls(1) tests create really large sparse files to validate the number formatting features of ls(1). Unfortunately, those tests fail if the underlying test file system does not support sparse files, as is the case when /tmp is mounted on tmpfs. Before running these tests, check if the test file system supports sparse files by using getconf(1) and skip them if not. Note that the support for this query was just added to getconf(1) in r304694. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D7609 Modified: head/bin/ls/tests/ls_tests.sh Modified: head/bin/ls/tests/ls_tests.sh ============================================================================== --- head/bin/ls/tests/ls_tests.sh Wed Aug 24 09:57:19 2016 (r304740) +++ head/bin/ls/tests/ls_tests.sh Wed Aug 24 10:10:26 2016 (r304741) @@ -84,6 +84,14 @@ create_test_inputs2() { create_test_dir + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files probably" \ + "not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi + for filesize in 1 512 $(( 2 * $KB )) $(( 10 * $KB )) $(( 512 * $KB )); \ do atf_check -e ignore -o empty -s exit:0 \ From owner-svn-src-head@freebsd.org Wed Aug 24 10:13:20 2016 Return-Path: Delivered-To: svn-src-head@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 07B45BBED66; Wed, 24 Aug 2016 10:13:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF8A01AAB; Wed, 24 Aug 2016 10:13:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OADIKF069168; Wed, 24 Aug 2016 10:13:18 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OADIJH069165; Wed, 24 Aug 2016 10:13:18 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608241013.u7OADIJH069165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Aug 2016 10:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304742 - in head/sys: amd64/cloudabi64 arm64/cloudabi64 i386/cloudabi32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 10:13:20 -0000 Author: ed Date: Wed Aug 24 10:13:18 2016 New Revision: 304742 URL: https://svnweb.freebsd.org/changeset/base/304742 Log: Convert pointers obtained from the threadattr_t structure with TO_PTR(). In all of these source files, the userspace pointer size corresponds with the kernelspace pointer size, meaning that casting directly works. As I'm planning on making 32-bit execution on 64-bit systems work as well, use TO_PTR() here as well, so that the changes between source files remain minimal. Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/i386/cloudabi32/cloudabi32_sysvec.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:10:26 2016 (r304741) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:13:18 2016 (r304742) @@ -171,9 +171,9 @@ cloudabi64_thread_setregs(struct thread return (error); /* Perform standard register initialization. */ - stack.ss_sp = (void *)attr->stack; + stack.ss_sp = TO_PTR(attr->stack); stack.ss_size = tcbptr - attr->stack; - cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack); + cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* * Pass in the thread ID of the new thread and the argument Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:10:26 2016 (r304741) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Wed Aug 24 10:13:18 2016 (r304742) @@ -139,9 +139,9 @@ cloudabi64_thread_setregs(struct thread stack_t stack; /* Perform standard register initialization. */ - stack.ss_sp = (void *)attr->stack; + stack.ss_sp = TO_PTR(attr->stack); stack.ss_size = attr->stack_size; - cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack); + cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* * Pass in the thread ID of the new thread and the argument Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Wed Aug 24 10:10:26 2016 (r304741) +++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Wed Aug 24 10:13:18 2016 (r304742) @@ -155,9 +155,9 @@ cloudabi32_thread_setregs(struct thread int error; /* Perform standard register initialization. */ - stack.ss_sp = (void *)attr->stack; + stack.ss_sp = TO_PTR(attr->stack); stack.ss_size = attr->stack_size - sizeof(args); - cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack); + cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* * Copy the arguments for the thread entry point onto the stack From owner-svn-src-head@freebsd.org Wed Aug 24 10:36:53 2016 Return-Path: Delivered-To: svn-src-head@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 5F335BC38E4; Wed, 24 Aug 2016 10:36:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 140FE1681; Wed, 24 Aug 2016 10:36:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OAaqXI076947; Wed, 24 Aug 2016 10:36:52 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OAaqT5076946; Wed, 24 Aug 2016 10:36:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608241036.u7OAaqT5076946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Aug 2016 10:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304743 - head/sys/contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 10:36:53 -0000 Author: ed Date: Wed Aug 24 10:36:52 2016 New Revision: 304743 URL: https://svnweb.freebsd.org/changeset/base/304743 Log: Remove an unused header file. The native CloudABI data types header file used to be pulled in by the vDSOs when they were still written in C. Since they are now all rewritten in assembly, this can go away. Deleted: head/sys/contrib/cloudabi/cloudabi_types.h From owner-svn-src-head@freebsd.org Wed Aug 24 10:51:34 2016 Return-Path: Delivered-To: svn-src-head@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 BE281BC3EBD; Wed, 24 Aug 2016 10:51:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B95A126E; Wed, 24 Aug 2016 10:51:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OApX9V081654; Wed, 24 Aug 2016 10:51:33 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OApXGE081650; Wed, 24 Aug 2016 10:51:33 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608241051.u7OApXGE081650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Aug 2016 10:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304744 - in head/sys: amd64/cloudabi32 amd64/conf conf contrib/cloudabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 10:51:34 -0000 Author: ed Date: Wed Aug 24 10:51:33 2016 New Revision: 304744 URL: https://svnweb.freebsd.org/changeset/base/304744 Log: Make execution of 32-bit CloudABI executables work on amd64. A nice thing about requiring a vDSO is that it makes it incredibly easy to provide full support for running 32-bit processes on 64-bit systems. Instead of letting the kernel be responsible for composing/decomposing 64-bit arguments across multiple registers/stack slots, all of this can now be done in the vDSO. This means that there is no need to provide duplicate copies of certain system calls, like the sys_lseek() and freebsd32_lseek() we have for COMPAT_FREEBSD32. This change imports a new vDSO from the CloudABI repository that has automatically generated code in it that copies system call arguments into a buffer, padding them to eight bytes and zero-extending any pointers/size_t arguments. After returning from the kernel, it does the inverse: extracting return values, in the process truncating pointers/size_t values to 32 bits. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/amd64/cloudabi32/ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c - copied, changed from r304742, head/sys/i386/cloudabi32/cloudabi32_sysvec.c head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S (contents, props changed) Modified: head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 Copied and modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c (from r304742, head/sys/i386/cloudabi32/cloudabi32_sysvec.c) ============================================================================== --- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Wed Aug 24 10:13:18 2016 (r304742, copy source) +++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Wed Aug 24 10:51:33 2016 (r304744) @@ -44,9 +44,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + extern const char *cloudabi32_syscallnames[]; extern struct sysent cloudabi32_sysent[]; +extern unsigned long ia32_maxssiz; + static int cloudabi32_fixup_tcb(register_t **stack_base, struct image_params *imgp) { @@ -80,7 +85,7 @@ cloudabi32_proc_setregs(struct thread *t unsigned long stack) { - exec_setregs(td, imgp, stack); + ia32_setregs(td, imgp, stack); (void)cpu_set_user_tls(td, (void *)stack); } @@ -91,21 +96,30 @@ cloudabi32_fetch_syscall_args(struct thr int error; /* Obtain system call number. */ - sa->code = frame->tf_eax; + sa->code = frame->tf_rax; if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi32_sysent[sa->code]; sa->narg = sa->callp->sy_narg; - /* Fetch system call arguments from the stack. */ - error = copyin((void *)(frame->tf_esp + 4), sa->args, + /* + * Fetch system call arguments. + * + * The vDSO has already made sure that the arguments are + * eight-byte aligned. Pointers and size_t parameters are + * zero-extended. This makes it possible to copy in the + * arguments directly. As long as the call doesn't use 32-bit + * data structures, we can just invoke the same system call + * implementation used by 64-bit processes. + */ + error = copyin((void *)frame->tf_rcx, sa->args, sa->narg * sizeof(sa->args[0])); if (error != 0) return (error); /* Default system call return values. */ td->td_retval[0] = 0; - td->td_retval[1] = frame->tf_edx; + td->td_retval[1] = 0; return (0); } @@ -116,21 +130,28 @@ cloudabi32_set_syscall_retval(struct thr switch (error) { case 0: - /* System call succeeded. */ - frame->tf_eax = td->td_retval[0]; - frame->tf_edx = td->td_retval[1]; - frame->tf_eflags &= ~PSL_C; + /* + * System call succeeded. + * + * Simply copy out the 64-bit return values into the + * same buffer provided for system call arguments. The + * vDSO will copy them to the right spot, truncating + * pointers and size_t values to 32 bits. + */ + frame->tf_rax = copyout(td->td_retval, (void *)frame->tf_rcx, + sizeof(td->td_retval)) == 0 ? 0 : CLOUDABI_EFAULT; break; case ERESTART: /* Restart system call. */ - frame->tf_eip -= frame->tf_err; + frame->tf_rip -= frame->tf_err; + frame->tf_r10 = frame->tf_rcx; + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); break; case EJUSTRETURN: break; default: /* System call returned an error. */ - frame->tf_eax = cloudabi_convert_errno(error); - frame->tf_eflags |= PSL_C; + frame->tf_rax = cloudabi_convert_errno(error); break; } } @@ -139,10 +160,14 @@ static void cloudabi32_schedtail(struct thread *td) { struct trapframe *frame = td->td_frame; + register_t retval[2]; - /* Initial register values for processes returning from fork. */ - frame->tf_eax = CLOUDABI_PROCESS_CHILD; - frame->tf_edx = td->td_tid; + /* Return values for processes returning from fork. */ + if ((td->td_pflags & TDP_FORKING) != 0) { + retval[0] = CLOUDABI_PROCESS_CHILD; + retval[1] = td->td_tid; + copyout(retval, (void *)frame->tf_rcx, sizeof(retval)); + } } int @@ -167,7 +192,7 @@ cloudabi32_thread_setregs(struct thread args[0] = tcb; args[1] = td->td_tid; args[2] = attr->argument; - frameptr = (void *)td->td_frame->tf_esp; + frameptr = (void *)td->td_frame->tf_rsp; error = copyout(args, frameptr, sizeof(args)); if (error != 0) return (error); @@ -181,12 +206,14 @@ static struct sysentvec cloudabi32_elf_s .sv_fixup = cloudabi32_fixup_tcb, .sv_name = "CloudABI ELF32", .sv_coredump = elf32_coredump, - .sv_pagesize = PAGE_SIZE, - .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = VM_MAXUSER_ADDRESS, + .sv_pagesize = IA32_PAGE_SIZE, + .sv_minuser = FREEBSD32_MINUSER, + .sv_maxuser = FREEBSD32_MAXUSER, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = cloudabi32_copyout_strings, .sv_setregs = cloudabi32_proc_setregs, + .sv_fixlimit = ia32_fixlimit, + .sv_maxssiz = &ia32_maxssiz, .sv_flags = SV_ABI_CLOUDABI | SV_CAPSICUM | SV_IA32 | SV_ILP32, .sv_set_syscall_retval = cloudabi32_set_syscall_retval, .sv_fetch_syscall_args = cloudabi32_fetch_syscall_args, Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Aug 24 10:36:52 2016 (r304743) +++ head/sys/amd64/conf/NOTES Wed Aug 24 10:51:33 2016 (r304744) @@ -614,6 +614,9 @@ options COMPAT_FREEBSD32 # Emulate spx device for client side of SVR3 local X interface #XXX#options SPX_HACK +# Enable 32-bit runtime support for CloudABI binaries. +options COMPAT_CLOUDABI32 + # Enable 64-bit runtime support for CloudABI binaries. options COMPAT_CLOUDABI64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Aug 24 10:36:52 2016 (r304743) +++ head/sys/conf/files.amd64 Wed Aug 24 10:51:33 2016 (r304744) @@ -8,6 +8,18 @@ # dependency lines other than the first are silently ignored. # # +cloudabi32_vdso.o optional compat_cloudabi32 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S" \ + compile-with "${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi32_vdso.o" +# +cloudabi32_vdso_blob.o optional compat_cloudabi32 \ + dependency "cloudabi32_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd --binary-architecture i386 cloudabi32_vdso.o ${.TARGET}" \ + no-implicit-rule \ + clean "cloudabi32_vdso_blob.o" +# cloudabi64_vdso.o optional compat_cloudabi64 \ dependency "$S/contrib/cloudabi/cloudabi_vdso_x86_64.S" \ compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_x86_64.S -o ${.TARGET}" \ @@ -146,6 +158,7 @@ amd64/amd64/trap.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard +amd64/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 amd64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64 amd64/pci/pci_cfgreg.c optional pci cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}" Added: head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S Wed Aug 24 10:51:33 2016 (r304744) @@ -0,0 +1,1223 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#define ENTRY(name) \ + .text; \ + .p2align 2, 0x90; \ + .global name; \ + .type name, @function; \ +name: + +#define END(name) .size name, . - name + +ENTRY(cloudabi_sys_clock_res_get) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $0, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 12(%ebp), %ecx + mov -16(%ebp), %edx + mov %edx, 0(%ecx) + mov -12(%ebp), %edx + mov %edx, 4(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_clock_res_get) + +ENTRY(cloudabi_sys_clock_time_get) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -8(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -4(%ebp) + mov $1, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 20(%ebp), %ecx + mov -16(%ebp), %edx + mov %edx, 0(%ecx) + mov -12(%ebp), %edx + mov %edx, 4(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_clock_time_get) + +ENTRY(cloudabi_sys_condvar_signal) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $2, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_condvar_signal) + +ENTRY(cloudabi_sys_fd_close) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $3, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_fd_close) + +ENTRY(cloudabi_sys_fd_create1) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $4, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 12(%ebp), %ecx + mov -16(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_create1) + +ENTRY(cloudabi_sys_fd_create2) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $5, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 12(%ebp), %ecx + mov -16(%ebp), %edx + mov %edx, 0(%ecx) + mov 16(%ebp), %ecx + mov -8(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_create2) + +ENTRY(cloudabi_sys_fd_datasync) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $6, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_fd_datasync) + +ENTRY(cloudabi_sys_fd_dup) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $7, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 12(%ebp), %ecx + mov -16(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_dup) + +ENTRY(cloudabi_sys_fd_pread) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -4(%ebp) + mov $8, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 28(%ebp), %ecx + mov -32(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_pread) + +ENTRY(cloudabi_sys_fd_pwrite) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -4(%ebp) + mov $9, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 28(%ebp), %ecx + mov -32(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_pwrite) + +ENTRY(cloudabi_sys_fd_read) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $10, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 20(%ebp), %ecx + mov -24(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_read) + +ENTRY(cloudabi_sys_fd_replace) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $11, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_fd_replace) + +ENTRY(cloudabi_sys_fd_seek) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $12, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 24(%ebp), %ecx + mov -24(%ebp), %edx + mov %edx, 0(%ecx) + mov -20(%ebp), %edx + mov %edx, 4(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_seek) + +ENTRY(cloudabi_sys_fd_stat_get) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $13, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_fd_stat_get) + +ENTRY(cloudabi_sys_fd_stat_put) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $14, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_fd_stat_put) + +ENTRY(cloudabi_sys_fd_sync) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov $15, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_fd_sync) + +ENTRY(cloudabi_sys_fd_write) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $16, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 20(%ebp), %ecx + mov -24(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_fd_write) + +ENTRY(cloudabi_sys_file_advise) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -20(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -12(%ebp) + mov 28(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $17, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_advise) + +ENTRY(cloudabi_sys_file_allocate) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -4(%ebp) + mov $18, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_allocate) + +ENTRY(cloudabi_sys_file_create) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $19, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_create) + +ENTRY(cloudabi_sys_file_link) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -48(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -44(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -40(%ebp) + movl $0, -36(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -32(%ebp) + movl $0, -28(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 28(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 32(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $20, %eax + mov %ebp, %ecx + sub $48, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_link) + +ENTRY(cloudabi_sys_file_open) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -40(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -36(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -32(%ebp) + movl $0, -28(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 28(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $21, %eax + mov %ebp, %ecx + sub $40, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 32(%ebp), %ecx + mov -40(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_file_open) + +ENTRY(cloudabi_sys_file_readdir) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -4(%ebp) + mov $22, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 28(%ebp), %ecx + mov -32(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_file_readdir) + +ENTRY(cloudabi_sys_file_readlink) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -40(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -32(%ebp) + movl $0, -28(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $23, %eax + mov %ebp, %ecx + sub $40, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 28(%ebp), %ecx + mov -40(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_file_readlink) + +ENTRY(cloudabi_sys_file_rename) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -48(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -40(%ebp) + movl $0, -36(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -32(%ebp) + movl $0, -28(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 28(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $24, %eax + mov %ebp, %ecx + sub $48, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_rename) + +ENTRY(cloudabi_sys_file_stat_fget) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $25, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_stat_fget) + +ENTRY(cloudabi_sys_file_stat_fput) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $26, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_stat_fput) + +ENTRY(cloudabi_sys_file_stat_get) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -28(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $27, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_stat_get) + +ENTRY(cloudabi_sys_file_stat_put) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -40(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -36(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -32(%ebp) + movl $0, -28(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 28(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $28, %eax + mov %ebp, %ecx + sub $40, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_stat_put) + +ENTRY(cloudabi_sys_file_symlink) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -40(%ebp) + movl $0, -36(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -32(%ebp) + movl $0, -28(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $29, %eax + mov %ebp, %ecx + sub $40, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_symlink) + +ENTRY(cloudabi_sys_file_unlink) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $30, %eax + mov %ebp, %ecx + sub $32, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_file_unlink) + +ENTRY(cloudabi_sys_lock_unlock) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $31, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_lock_unlock) + +ENTRY(cloudabi_sys_mem_advise) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -24(%ebp) + movl $0, -20(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -8(%ebp) + mov $32, %eax + mov %ebp, %ecx + sub $24, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_mem_advise) + +ENTRY(cloudabi_sys_mem_lock) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -16(%ebp) + movl $0, -12(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -8(%ebp) + movl $0, -4(%ebp) + mov $33, %eax + mov %ebp, %ecx + sub $16, %ecx + int $0x80 + pop %ebp + ret +END(cloudabi_sys_mem_lock) + +ENTRY(cloudabi_sys_mem_map) + push %ebp + mov %esp, %ebp + mov 8(%ebp), %ecx + mov %ecx, -48(%ebp) + movl $0, -44(%ebp) + mov 12(%ebp), %ecx + mov %ecx, -40(%ebp) + movl $0, -36(%ebp) + mov 16(%ebp), %ecx + mov %ecx, -32(%ebp) + mov 20(%ebp), %ecx + mov %ecx, -24(%ebp) + mov 24(%ebp), %ecx + mov %ecx, -16(%ebp) + mov 28(%ebp), %ecx + mov %ecx, -8(%ebp) + mov 32(%ebp), %ecx + mov %ecx, -4(%ebp) + mov $34, %eax + mov %ebp, %ecx + sub $48, %ecx + int $0x80 + test %eax, %eax + jnz 1f + mov 36(%ebp), %ecx + mov -48(%ebp), %edx + mov %edx, 0(%ecx) +1: + pop %ebp + ret +END(cloudabi_sys_mem_map) + +ENTRY(cloudabi_sys_mem_protect) + push %ebp + mov %esp, %ebp *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 24 11:35:51 2016 Return-Path: Delivered-To: svn-src-head@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 032E1BC4D99; Wed, 24 Aug 2016 11:35:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B53A11BBA; Wed, 24 Aug 2016 11:35:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OBZnjl099257; Wed, 24 Aug 2016 11:35:49 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OBZnSv099255; Wed, 24 Aug 2016 11:35:49 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608241135.u7OBZnSv099255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Aug 2016 11:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304745 - in head/sys/modules: . cloudabi32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 11:35:51 -0000 Author: ed Date: Wed Aug 24 11:35:49 2016 New Revision: 304745 URL: https://svnweb.freebsd.org/changeset/base/304745 Log: Add a Makefile for building the cloudabi32 kernel module. Where the cloudabi64 kernel can be used to execute 64-bit CloudABI binaries, this one should be used for 32-bit binaries. Right now it works on i386 and amd64. Added: head/sys/modules/cloudabi32/ - copied from r304742, head/sys/modules/cloudabi64/ Modified: head/sys/modules/Makefile head/sys/modules/cloudabi32/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Aug 24 10:51:33 2016 (r304744) +++ head/sys/modules/Makefile Wed Aug 24 11:35:49 2016 (r304745) @@ -75,6 +75,7 @@ SUBDIR= \ ${_cfi} \ ${_ciss} \ cloudabi \ + ${_cloudabi32} \ ${_cloudabi64} \ ${_cm} \ ${_cmx} \ @@ -765,6 +766,9 @@ _epic= epic _igb= igb .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +_cloudabi32= cloudabi32 +.endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" _cloudabi64= cloudabi64 .endif Modified: head/sys/modules/cloudabi32/Makefile ============================================================================== --- head/sys/modules/cloudabi64/Makefile Wed Aug 24 10:13:18 2016 (r304742) +++ head/sys/modules/cloudabi32/Makefile Wed Aug 24 11:35:49 2016 (r304745) @@ -2,36 +2,36 @@ SYSDIR?=${.CURDIR}/../.. -.PATH: ${SYSDIR}/compat/cloudabi64 -.PATH: ${SYSDIR}/${MACHINE}/cloudabi64 +.PATH: ${SYSDIR}/compat/cloudabi32 +.PATH: ${SYSDIR}/${MACHINE}/cloudabi32 -KMOD= cloudabi64 -SRCS= cloudabi64_fd.c cloudabi64_module.c cloudabi64_poll.c \ - cloudabi64_sock.c cloudabi64_syscalls.c cloudabi64_sysent.c \ - cloudabi64_sysvec.c cloudabi64_thread.c - -OBJS= cloudabi64_vdso_blob.o -CLEANFILES=cloudabi64_vdso.o - -.if ${MACHINE_CPUARCH} == "aarch64" -VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_aarch64.S -OUTPUT_TARGET=elf64-littleaarch64 -BINARY_ARCHITECTURE=aarch64 +KMOD= cloudabi32 +SRCS= cloudabi32_fd.c cloudabi32_module.c cloudabi32_poll.c \ + cloudabi32_sock.c cloudabi32_syscalls.c cloudabi32_sysent.c \ + cloudabi32_sysvec.c cloudabi32_thread.c + +OBJS= cloudabi32_vdso_blob.o +CLEANFILES=cloudabi32_vdso.o + +.if ${MACHINE_CPUARCH} == "i386" +VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686.S +OUTPUT_TARGET=elf32-i386-freebsd +BINARY_ARCHITECTURE=aarch32 .elif ${MACHINE_CPUARCH} == "amd64" -VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_x86_64.S +VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S OUTPUT_TARGET=elf64-x86-64-freebsd BINARY_ARCHITECTURE=i386 .endif -cloudabi64_vdso.o: ${VDSO_SRCS} - ${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib \ +cloudabi32_vdso.o: ${VDSO_SRCS} + ${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib \ -Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \ ${VDSO_SRCS} -o ${.TARGET} -cloudabi64_vdso_blob.o: cloudabi64_vdso.o +cloudabi32_vdso_blob.o: cloudabi32_vdso.o ${OBJCOPY} --input-target binary \ --output-target ${OUTPUT_TARGET} \ --binary-architecture ${BINARY_ARCHITECTURE} \ - cloudabi64_vdso.o ${.TARGET} + cloudabi32_vdso.o ${.TARGET} .include From owner-svn-src-head@freebsd.org Wed Aug 24 12:10:01 2016 Return-Path: Delivered-To: svn-src-head@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 BFE60BC32F1 for ; Wed, 24 Aug 2016 12:10:01 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 756D9170A for ; Wed, 24 Aug 2016 12:10:01 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x22c.google.com with SMTP id z190so12281411qkc.0 for ; Wed, 24 Aug 2016 05:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tJaaxp844uY/Hg77Yavqxxwl37jeBwgSKVGRCparc6Y=; b=yUu5Lp1fo/48rtfAVtxHPqT5vtuinSbKwHrwil6I9si6Zwdj44f/MZ9wTk/PmJ7iZS wdULEu0//UzdFz9518MFbL2bvs5LbPY1G1GHBLBKfCVSI5eVlx0k2x6emgtCPc+i8qmJ 3TSdkrxIH9HrFIgUkHznSDNyHLwg5nQl13QzHsJC7Auhga2GqJYT1gSyxc4GOjcJlpL3 sg/ouA63lJ+w7hUGfK1XaePg8r0xziEMhzGskfVLcs4+ww+QAwpWhlf+kM3HpN67wQA+ fGd6g6WkRcrEFOcQxPfjoN6ESXXfw92HNgA13fQ7zL5MxliU3u95kcoEmgnK8PQLA4c1 HZng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tJaaxp844uY/Hg77Yavqxxwl37jeBwgSKVGRCparc6Y=; b=k0AtbuJ/cMZDa0wqTFTnjI0WVRFS60uM5Y34i/Rhm/a1LBO9NSThsLFVsHCkZo3DLQ J4aPVVmOOEIqHcNFsvRr2yQGAK+37nb20iXT4jaoCa6+tVInf0Jm07LviNe21V/AvkPz W1nNUZX8x/2oz+sE+XoQUQrelWR8M8CBzB9jYP2ZDccLf+GvXcVfoqmk+1LNrX7h1UNK x5qjozx9rHTrlXVW7HPhADsxw6WrYTfFF/orPAtAYmIsPkb4W1Pjq099ULLhxJ5HFJGw VDOPvDBOLIWX6tjoDqmCucGXX4d71EFd4+QWnvYituA0X9VbulQBMGjfH0RK4gEjlBMA dD+A== X-Gm-Message-State: AE9vXwPwcZX8210BzzvZgKlCGjp5MU+OmQtc3KiXCrEfxlegfNxuYRfwb1DAaY9M+Lvjhw7p X-Received: by 10.55.141.199 with SMTP id p190mr2824938qkd.185.1472040600561; Wed, 24 Aug 2016 05:10:00 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id j67sm4435537qkf.41.2016.08.24.05.09.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Aug 2016 05:09:59 -0700 (PDT) Date: Wed, 24 Aug 2016 08:09:57 -0400 From: Shawn Webb To: "Landon J. Fuller" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304692 - head/sys/dev/bhnd/bhndb Message-ID: <20160824120957.GA74786@mutt-hardenedbsd> References: <201608231903.u7NJ3Bjc019151@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <201608231903.u7NJ3Bjc019151@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:10:01 -0000 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 23, 2016 at 07:03:11PM +0000, Landon J. Fuller wrote: > Author: landonf > Date: Tue Aug 23 19:03:11 2016 > New Revision: 304692 > URL: https://svnweb.freebsd.org/changeset/base/304692 >=20 > Log: > bhndb(4): Fix unsigned integer underflow in dynamic register window > handling. This resulted in the window target being left uninitialized > when an underflow occured. Is this remotely exploitable? What are the ramifications of this bug? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXvY6UAAoJEGqEZY9SRW7uZvQQAKJCVI3d4wOnGVlE2eGf60c5 pc5ZTAD48XbtD89u6yL/X70jrislIaHeCafU1cd/R55J9ATpmISDcz8aHjQrzQaI 3qwTba0ZoeaLcUhm0Kkkbai+1au1MdW+409gdJNAMjlgVVofyrkns3/yiXOMsVWJ cUzsFM2RTiUOqh7SYK7fgUnIi+OO+53LJNS4cNEPtUohXa2mCXB9bp7HBcB1sX7G 5df6mGjT/xBkNAiru2R4dNmEX8hcPm0uADfqbjYo78weH3cLN+AP5bh3PLB536j7 A8gqpaB35B8FDPyO4kDOytwd/PTS594jr1Xz8lKckCVObliG3JCCvuB5a3eZoGbG 73rUAUbdh+NHv+tHfBxk2IQkO6ovL5svH7HD74HV0oby/97zPXTEsGqLNEvZvFje 9Jv3off1sBN2fxhavGZVxYxADon+NlEVZkmFGD5d/OMCQ5cz/SKJj5xeGY9kCzws /ERsMk02EGD6gsAsEY/G8/Vfng2hspjFDNnR0khV85/pfGoQsUUrw0LReisiJY6j /RKqJJXyJrDVk05Wva/A8BVyh9qm3UUngeR4k8jYR8v73ZrCyqbiRljXk9gqVuR1 tb7ADuVxoYfOdG0e7OcbZhd+1WbGJ52+HS4J8yX/VZGV0gMJ8Xo4sGX9H7+E9BAs dzjM3zK05QoYFs6zxToJ =IduL -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J-- From owner-svn-src-head@freebsd.org Wed Aug 24 12:24:02 2016 Return-Path: Delivered-To: svn-src-head@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 94F88BC39A3; Wed, 24 Aug 2016 12:24:02 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B06B1F4C; Wed, 24 Aug 2016 12:24:02 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id i5so25125704wmg.0; Wed, 24 Aug 2016 05:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RmjDrqOCDACgxem7L5pN9kjf9urTGKDZYrdZPLpJHdc=; b=wot4ZsAvYVCFqo5ztLnrF23q6HMbyB58aduAjPZ8IrgnGKcx78OsUeuM7y/dbgboRF cpANIeqziZs32JgT9wsQ/8KHAH4E6H1uXCtNM6fuBYWHL6Q4+c30PFujPjEGSAb492Hy aoOgOzHDwtMm279UT/cFLlLgfszIBbl7qQKxZ9NWvDn+iSaVEa3WOJ4orVHFPlKtnyIw XZGZP6fIwMKL8aX4P/xXSFk7cSoUFM7Lb+L/tipWLjjsxmrsY3yS43W3AMdbfxDTwE09 ZTScNgt4XuSYLO9KoJE15guzMrNuKY6JQB5UAK+/oQnvdtnhRH/oJYm8BLax8qyqStY5 Qbeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RmjDrqOCDACgxem7L5pN9kjf9urTGKDZYrdZPLpJHdc=; b=DL+qKjRIu5pYyrkedlMWG3U+hmAIu1WhHG7bwWurdkOYAnVMpu8Nk0nrqnE1lXwUTX 21zhusPBK1nWVL1vPgLsWQDp5cDaN5sFii4XsZY8uD6yCghxQg2w1M+ly32H8LLqcIy6 ZJTlGJtG/vadhPNUO1wOnDhv5dHiD+a8OaijKoFtdXmmdEu6zo8l6+XxmLzfoY+2trWA vinkDUL+I19RXQF+ikgqzWtc6l4+/weHq54TwBuhrhmZFpjnStkgiopvI31eHRlDMksZ uRjdO+CW/kFaA0WZl8N1xfwOAlQO0IpI97A+5h/aF3e7zCh23buerf3BSSeDq+7xY59q BKkA== X-Gm-Message-State: AEkooutByYJDIpYcX+ZUFZ7GdiCru9xcsue9Akkp/ibnf+oPRDavSpVQMOa/6BJdN55sj5haEyXl3Pf+us6bZQ== X-Received: by 10.195.14.11 with SMTP id fc11mr2798489wjd.148.1472041440590; Wed, 24 Aug 2016 05:24:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.7.71 with HTTP; Wed, 24 Aug 2016 05:24:00 -0700 (PDT) In-Reply-To: <20160824120957.GA74786@mutt-hardenedbsd> References: <201608231903.u7NJ3Bjc019151@repo.freebsd.org> <20160824120957.GA74786@mutt-hardenedbsd> From: Michael Zhilin Date: Wed, 24 Aug 2016 15:24:00 +0300 Message-ID: Subject: Re: svn commit: r304692 - head/sys/dev/bhnd/bhndb To: Shawn Webb Cc: "Landon J. Fuller" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:24:02 -0000 Hi, I doubt. bhndb is new bus driver (WIP) and nobody use it now. In future it will be used for BroadCom WiFi card (bwn) attached to PCI bus. Best regards, Michael On Wed, Aug 24, 2016 at 3:09 PM, Shawn Webb wrote: > On Tue, Aug 23, 2016 at 07:03:11PM +0000, Landon J. Fuller wrote: > > Author: landonf > > Date: Tue Aug 23 19:03:11 2016 > > New Revision: 304692 > > URL: https://svnweb.freebsd.org/changeset/base/304692 > > > > Log: > > bhndb(4): Fix unsigned integer underflow in dynamic register window > > handling. This resulted in the window target being left uninitialized > > when an underflow occured. > > Is this remotely exploitable? What are the ramifications of this bug? > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > From owner-svn-src-head@freebsd.org Wed Aug 24 12:32:20 2016 Return-Path: Delivered-To: svn-src-head@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 28752BC3C30; Wed, 24 Aug 2016 12:32:20 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC78D15C7; Wed, 24 Aug 2016 12:32:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OCWJK0020810; Wed, 24 Aug 2016 12:32:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OCWJoQ020808; Wed, 24 Aug 2016 12:32:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608241232.u7OCWJoQ020808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 24 Aug 2016 12:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304746 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:32:20 -0000 Author: andrew Date: Wed Aug 24 12:32:18 2016 New Revision: 304746 URL: https://svnweb.freebsd.org/changeset/base/304746 Log: Teach the parts of the arm64 pmap that need to iterate over pages to also iterate over superpages. We don't yet create these, but soon will. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pmap.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Aug 24 11:35:49 2016 (r304745) +++ head/sys/arm64/arm64/pmap.c Wed Aug 24 12:32:18 2016 (r304746) @@ -106,6 +106,7 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include #include #include @@ -134,6 +135,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -176,6 +178,7 @@ __FBSDID("$FreeBSD$"); #endif #define pmap_l2_pindex(v) ((v) >> L2_SHIFT) +#define pa_to_pvh(pa) (&pv_table[pmap_l2_pindex(pa)]) #define NPV_LIST_LOCKS MAXCPU @@ -218,6 +221,14 @@ vm_offset_t kernel_vm_end = 0; struct msgbuf *msgbufp = NULL; +/* + * Data for the pv entry allocation mechanism. + * Updates to pv_invl_gen are protected by the pv_list_locks[] + * elements, but reads are not. + */ +static struct md_page *pv_table; +static struct md_page pv_dummy; + vm_paddr_t dmap_phys_base; /* The start of the dmap region */ vm_paddr_t dmap_phys_max; /* The limit of the dmap region */ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ @@ -855,7 +866,8 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - int i; + vm_size_t s; + int i, pv_npg; /* * Are large page mappings enabled? @@ -872,6 +884,22 @@ pmap_init(void) */ for (i = 0; i < NPV_LIST_LOCKS; i++) rw_init(&pv_list_locks[i], "pmap pv list"); + + /* + * Calculate the size of the pv head table for superpages. + */ + pv_npg = howmany(vm_phys_segs[vm_phys_nsegs - 1].end, L2_SIZE); + + /* + * Allocate memory for the pv head table for superpages. + */ + s = (vm_size_t)(pv_npg * sizeof(struct md_page)); + s = round_page(s); + pv_table = (struct md_page *)kmem_malloc(kernel_arena, s, + M_WAITOK | M_ZERO); + for (i = 0; i < pv_npg; i++) + TAILQ_INIT(&pv_table[i].pv_list); + TAILQ_INIT(&pv_dummy.pv_list); } static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, @@ -1399,6 +1427,7 @@ pmap_pinit0(pmap_t pmap) PMAP_LOCK_INIT(pmap); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_l0 = kernel_pmap->pm_l0; + pmap->pm_root.rt_root = 0; } int @@ -1420,6 +1449,7 @@ pmap_pinit(pmap_t pmap) if ((l0pt->flags & PG_ZERO) == 0) pagezero(pmap->pm_l0); + pmap->pm_root.rt_root = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); return (1); @@ -1643,6 +1673,8 @@ pmap_release(pmap_t pmap) KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); + KASSERT(vm_radix_is_empty(&pmap->pm_root), + ("pmap_release: pmap has reserved page table page(s)")); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); @@ -1991,6 +2023,7 @@ static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp) { + struct md_page *pvh; pt_entry_t old_l3; vm_page_t m; @@ -2011,6 +2044,12 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t * vm_page_aflag_set(m, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); pmap_pvh_free(&m->md, pmap, va); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); + } } return (pmap_unuse_l3(pmap, va, l2e, free)); } @@ -2147,28 +2186,56 @@ pmap_remove(pmap_t pmap, vm_offset_t sva void pmap_remove_all(vm_page_t m) { + struct md_page *pvh; pv_entry_t pv; pmap_t pmap; struct rwlock *lock; pd_entry_t *pde, tpde; pt_entry_t *pte, tpte; + vm_offset_t va; struct spglist free; - int lvl, md_gen; + int lvl, pvh_gen, md_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); lock = VM_PAGE_TO_PV_LIST_LOCK(m); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); retry: rw_wlock(lock); + while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + rw_wunlock(lock); + PMAP_UNLOCK(pmap); + goto retry; + } + } + va = pv->pv_va; + pte = pmap_pte(pmap, va, &lvl); + KASSERT(pte != NULL, + ("pmap_remove_all: no page table entry found")); + KASSERT(lvl == 2, + ("pmap_remove_all: invalid pte level %d", lvl)); + + pmap_demote_l2_locked(pmap, pte, va, &lock); + PMAP_UNLOCK(pmap); + } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; md_gen = m->md.pv_gen; rw_wunlock(lock); PMAP_LOCK(pmap); rw_wlock(lock); - if (md_gen != m->md.pv_gen) { + if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) { rw_wunlock(lock); PMAP_UNLOCK(pmap); goto retry; @@ -2255,9 +2322,17 @@ pmap_protect(pmap_t pmap, vm_offset_t sv va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL || (pmap_load(l2) & ATTR_DESCR_MASK) != L2_TABLE) + if (pmap_load(l2) == 0) continue; + if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { + l3p = pmap_demote_l2(pmap, l2, sva); + if (l3p == NULL) + continue; + } + KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, + ("pmap_protect: Invalid L2 entry after demotion")); + if (va_next > eva) va_next = eva; @@ -2597,12 +2672,18 @@ validate: vm_page_aflag_set(om, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); pmap_pvh_free(&om->md, pmap, va); + if ((om->aflags & PGA_WRITEABLE) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + vm_page_aflag_clear(om, PGA_WRITEABLE); } } else { pmap_load_store(l3, new_l3); PTE_SYNC(l3); pmap_invalidate_page(pmap, va); - if (pmap_page_dirty(orig_l3) && (orig_l3 & ATTR_SW_MANAGED) != 0) + if (pmap_page_dirty(orig_l3) && + (orig_l3 & ATTR_SW_MANAGED) != 0) vm_page_dirty(m); } } else { @@ -3019,6 +3100,7 @@ pmap_quick_remove_page(vm_offset_t addr) boolean_t pmap_page_exists_quick(pmap_t pmap, vm_page_t m) { + struct md_page *pvh; struct rwlock *lock; pv_entry_t pv; int loops = 0; @@ -3038,6 +3120,18 @@ pmap_page_exists_quick(pmap_t pmap, vm_p if (loops >= 16) break; } + if (!rv && loops < 16 && (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { + if (PV_PMAP(pv) == pmap) { + rv = TRUE; + break; + } + loops++; + if (loops >= 16) + break; + } + } rw_runlock(lock); return (rv); } @@ -3052,10 +3146,11 @@ int pmap_page_wired_mappings(vm_page_t m) { struct rwlock *lock; + struct md_page *pvh; pmap_t pmap; pt_entry_t *pte; pv_entry_t pv; - int count, lvl, md_gen; + int count, lvl, md_gen, pvh_gen; if ((m->oflags & VPO_UNMANAGED) != 0) return (0); @@ -3080,6 +3175,29 @@ restart: count++; PMAP_UNLOCK(pmap); } + if ((m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + pvh_gen = pvh->pv_gen; + rw_runlock(lock); + PMAP_LOCK(pmap); + rw_rlock(lock); + if (md_gen != m->md.pv_gen || + pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + pte = pmap_pte(pmap, pv->pv_va, &lvl); + if (pte != NULL && + (pmap_load(pte) & ATTR_SW_WIRED) != 0) + count++; + PMAP_UNLOCK(pmap); + } + } rw_runlock(lock); return (count); } @@ -3108,6 +3226,7 @@ pmap_remove_pages(pmap_t pmap) struct spglist free; vm_page_t m; pv_entry_t pv; + struct md_page *pvh; struct pv_chunk *pc, *npc; struct rwlock *lock; int64_t bit; @@ -3201,6 +3320,15 @@ pmap_remove_pages(pmap_t pmap) TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; + if ((m->aflags & PGA_WRITEABLE) != 0 && + TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh( + VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(m, + PGA_WRITEABLE); + } break; } pmap_unuse_l3(pmap, pv->pv_va, pmap_load(pde), @@ -3233,9 +3361,10 @@ pmap_page_test_mappings(vm_page_t m, boo { struct rwlock *lock; pv_entry_t pv; + struct md_page *pvh; pt_entry_t *pte, mask, value; pmap_t pmap; - int lvl, md_gen; + int lvl, md_gen, pvh_gen; boolean_t rv; rv = FALSE; @@ -3272,6 +3401,41 @@ restart: if (rv) goto out; } + if ((m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + pvh_gen = pvh->pv_gen; + rw_runlock(lock); + PMAP_LOCK(pmap); + rw_rlock(lock); + if (md_gen != m->md.pv_gen || + pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + goto restart; + } + } + pte = pmap_pte(pmap, pv->pv_va, &lvl); + KASSERT(lvl == 2, + ("pmap_page_test_mappings: Invalid level %d", lvl)); + mask = 0; + value = 0; + if (modified) { + mask |= ATTR_AP_RW_BIT; + value |= ATTR_AP(ATTR_AP_RW); + } + if (accessed) { + mask |= ATTR_AF | ATTR_DESCR_MASK; + value |= ATTR_AF | L2_BLOCK; + } + rv = (pmap_load(pte) & mask) == value; + PMAP_UNLOCK(pmap); + if (rv) + goto out; + } + } out: rw_runlock(lock); return (rv); @@ -3345,11 +3509,13 @@ pmap_is_referenced(vm_page_t m) void pmap_remove_write(vm_page_t m) { + struct md_page *pvh; pmap_t pmap; struct rwlock *lock; - pv_entry_t pv; + pv_entry_t next_pv, pv; pt_entry_t oldpte, *pte; - int lvl, md_gen; + vm_offset_t va; + int lvl, md_gen, pvh_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); @@ -3363,16 +3529,43 @@ pmap_remove_write(vm_page_t m) if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); retry_pv_loop: rw_wlock(lock); + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + rw_wunlock(lock); + goto retry_pv_loop; + } + } + va = pv->pv_va; + pte = pmap_pte(pmap, pv->pv_va, &lvl); + if ((pmap_load(pte) & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) + pmap_demote_l2_locked(pmap, pte, va & ~L2_OFFSET, + &lock); + KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), + ("inconsistent pv lock %p %p for page %p", + lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); + PMAP_UNLOCK(pmap); + } TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; md_gen = m->md.pv_gen; rw_wunlock(lock); PMAP_LOCK(pmap); rw_wlock(lock); - if (md_gen != m->md.pv_gen) { + if (pvh_gen != pvh->pv_gen || + md_gen != m->md.pv_gen) { PMAP_UNLOCK(pmap); rw_wunlock(lock); goto retry_pv_loop; @@ -3419,14 +3612,18 @@ safe_to_clear_referenced(pmap_t pmap, pt int pmap_ts_referenced(vm_page_t m) { + struct md_page *pvh; pv_entry_t pv, pvf; pmap_t pmap; struct rwlock *lock; pd_entry_t *pde, tpde; pt_entry_t *pte, tpte; + pt_entry_t *l3; + vm_offset_t va; vm_paddr_t pa; - int cleared, md_gen, not_cleared, lvl; + int cleared, md_gen, not_cleared, lvl, pvh_gen; struct spglist free; + bool demoted; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); @@ -3434,9 +3631,106 @@ pmap_ts_referenced(vm_page_t m) cleared = 0; pa = VM_PAGE_TO_PHYS(m); lock = PHYS_TO_PV_LIST_LOCK(pa); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(pa); rw_wlock(lock); retry: not_cleared = 0; + if ((pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL) + goto small_mappings; + pv = pvf; + do { + if (pvf == NULL) + pvf = pv; + pmap = PV_PMAP(pv); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + PMAP_UNLOCK(pmap); + goto retry; + } + } + va = pv->pv_va; + pde = pmap_pde(pmap, pv->pv_va, &lvl); + KASSERT(pde != NULL, ("pmap_ts_referenced: no l1 table found")); + KASSERT(lvl == 1, + ("pmap_ts_referenced: invalid pde level %d", lvl)); + tpde = pmap_load(pde); + KASSERT((tpde & ATTR_DESCR_MASK) == L1_TABLE, + ("pmap_ts_referenced: found an invalid l1 table")); + pte = pmap_l1_to_l2(pde, pv->pv_va); + tpte = pmap_load(pte); + if ((tpte & ATTR_AF) != 0) { + /* + * Since this reference bit is shared by 512 4KB + * pages, it should not be cleared every time it is + * tested. Apply a simple "hash" function on the + * physical page number, the virtual superpage number, + * and the pmap address to select one 4KB page out of + * the 512 on which testing the reference bit will + * result in clearing that reference bit. This + * function is designed to avoid the selection of the + * same 4KB page for every 2MB page mapping. + * + * On demotion, a mapping that hasn't been referenced + * is simply destroyed. To avoid the possibility of a + * subsequent page fault on a demoted wired mapping, + * always leave its reference bit set. Moreover, + * since the superpage is wired, the current state of + * its reference bit won't affect page replacement. + */ + if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> L2_SHIFT) ^ + (uintptr_t)pmap) & (Ln_ENTRIES - 1)) == 0 && + (tpte & ATTR_SW_WIRED) == 0) { + if (safe_to_clear_referenced(pmap, tpte)) { + /* + * TODO: We don't handle the access + * flag at all. We need to be able + * to set it in the exception handler. + */ + panic("ARM64TODO: " + "safe_to_clear_referenced\n"); + } else if (pmap_demote_l2_locked(pmap, pte, + pv->pv_va, &lock) != NULL) { + demoted = true; + va += VM_PAGE_TO_PHYS(m) - + (tpte & ~ATTR_MASK); + l3 = pmap_l2_to_l3(pte, va); + pmap_remove_l3(pmap, l3, va, + pmap_load(pte), NULL, &lock); + } else + demoted = true; + + if (demoted) { + /* + * The superpage mapping was removed + * entirely and therefore 'pv' is no + * longer valid. + */ + if (pvf == pv) + pvf = NULL; + pv = NULL; + } + cleared++; + KASSERT(lock == VM_PAGE_TO_PV_LIST_LOCK(m), + ("inconsistent pv lock %p %p for page %p", + lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); + } else + not_cleared++; + } + PMAP_UNLOCK(pmap); + /* Rotate the PV list if it has more than one entry. */ + if (pv != NULL && TAILQ_NEXT(pv, pv_next) != NULL) { + TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + pvh->pv_gen++; + } + if (cleared + not_cleared >= PMAP_TS_REFERENCED_MAX) + goto out; + } while ((pv = TAILQ_FIRST(&pvh->pv_list)) != pvf); +small_mappings: if ((pvf = TAILQ_FIRST(&m->md.pv_list)) == NULL) goto out; pv = pvf; @@ -3445,11 +3739,12 @@ retry: pvf = pv; pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; md_gen = m->md.pv_gen; rw_wunlock(lock); PMAP_LOCK(pmap); rw_wlock(lock); - if (md_gen != m->md.pv_gen) { + if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) { PMAP_UNLOCK(pmap); goto retry; } Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Wed Aug 24 11:35:49 2016 (r304745) +++ head/sys/arm64/include/pmap.h Wed Aug 24 12:32:18 2016 (r304746) @@ -44,6 +44,8 @@ #include #include +#include + #ifdef _KERNEL #define vtophys(va) pmap_kextract((vm_offset_t)(va)) @@ -80,6 +82,7 @@ struct pmap { struct pmap_statistics pm_stats; /* pmap statictics */ pd_entry_t *pm_l0; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ + struct vm_radix pm_root; /* spare page table pages */ }; typedef struct pv_entry { From owner-svn-src-head@freebsd.org Wed Aug 24 12:32:26 2016 Return-Path: Delivered-To: svn-src-head@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 BE7B5BC3C6A; Wed, 24 Aug 2016 12:32:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A9231646; Wed, 24 Aug 2016 12:32:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OCWP6e020857; Wed, 24 Aug 2016 12:32:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OCWPsn020853; Wed, 24 Aug 2016 12:32:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608241232.u7OCWPsn020853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 24 Aug 2016 12:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304747 - in head/contrib/sqlite3: . tea X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:32:27 -0000 Author: cy Date: Wed Aug 24 12:32:24 2016 New Revision: 304747 URL: https://svnweb.freebsd.org/changeset/base/304747 Log: MFV r304732. Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100). This commit addresses the tmpdir selection vulnerability fixed in sqlite3-1.13.0. See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b. Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b Security: CVE-2016-6153 Added: head/contrib/sqlite3/Makefile.msc - copied unchanged from r304734, vendor/sqlite3/dist/Makefile.msc head/contrib/sqlite3/Replace.cs - copied unchanged from r304734, vendor/sqlite3/dist/Replace.cs head/contrib/sqlite3/compile - copied unchanged from r304734, vendor/sqlite3/dist/compile head/contrib/sqlite3/sqlite3.rc - copied unchanged from r304734, vendor/sqlite3/dist/sqlite3.rc head/contrib/sqlite3/tea/ - copied from r304734, vendor/sqlite3/dist/tea/ Modified: head/contrib/sqlite3/Makefile.am head/contrib/sqlite3/Makefile.in head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.am ============================================================================== --- head/contrib/sqlite3/Makefile.am Wed Aug 24 12:32:18 2016 (r304746) +++ head/contrib/sqlite3/Makefile.am Wed Aug 24 12:32:24 2016 (r304747) @@ -1,5 +1,5 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c Modified: head/contrib/sqlite3/Makefile.in ============================================================================== --- head/contrib/sqlite3/Makefile.in Wed Aug 24 12:32:18 2016 (r304746) +++ head/contrib/sqlite3/Makefile.in Wed Aug 24 12:32:24 2016 (r304747) @@ -305,6 +305,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ +SESSION_FLAGS = @SESSION_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -362,7 +363,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 Copied: head/contrib/sqlite3/Makefile.msc (from r304734, vendor/sqlite3/dist/Makefile.msc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/sqlite3/Makefile.msc Wed Aug 24 12:32:24 2016 (r304747, copy of r304734, vendor/sqlite3/dist/Makefile.msc) @@ -0,0 +1,971 @@ +#### DO NOT EDIT #### +# This makefile is automatically generated from the Makefile.msc at +# the root of the canonical SQLite source tree (not the +# amalgamation tarball) using the tool/mkmsvcmin.tcl +# script. +# + +# +# nmake Makefile for SQLite +# +############################################################################### +############################## START OF OPTIONS ############################### +############################################################################### + +# The toplevel directory of the source tree. This is the directory +# that contains this "Makefile.msc". +# +TOP = . + + +# Set this non-0 to enable full warnings (-W4, etc) when compiling. +# +!IFNDEF USE_FULLWARN +USE_FULLWARN = 0 +!ENDIF + +# Set this non-0 to enable full runtime error checks (-RTC1, etc). This +# has no effect if (any) optimizations are enabled. +# +!IFNDEF USE_RUNTIME_CHECKS +USE_RUNTIME_CHECKS = 0 +!ENDIF + +# Set this non-0 to use "stdcall" calling convention for the core library +# and shell executable. +# +!IFNDEF USE_STDCALL +USE_STDCALL = 0 +!ENDIF + +# Set this non-0 to have the shell executable link against the core dynamic +# link library. +# +!IFNDEF DYNAMIC_SHELL +DYNAMIC_SHELL = 0 +!ENDIF + +# Set this non-0 to enable extra code that attempts to detect misuse of the +# SQLite API. +# +!IFNDEF API_ARMOR +API_ARMOR = 0 +!ENDIF + +# If necessary, create a list of harmless compiler warnings to disable when +# compiling the various tools. For the SQLite source code itself, warnings, +# if any, will be disabled from within it. +# +!IFNDEF NO_WARN +!IF $(USE_FULLWARN)!=0 +NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206 +NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706 +!ENDIF +!ENDIF + +# Set this non-0 to use the library paths and other options necessary for +# Windows Phone 8.1. +# +!IFNDEF USE_WP81_OPTS +USE_WP81_OPTS = 0 +!ENDIF + +# Set this non-0 to split the SQLite amalgamation file into chunks to +# be used for debugging with Visual Studio. +# +!IFNDEF SPLIT_AMALGAMATION +SPLIT_AMALGAMATION = 0 +!ENDIF + + +# Set this non-0 to dynamically link to the MSVC runtime library. +# +!IFNDEF USE_CRT_DLL +USE_CRT_DLL = 0 +!ENDIF + +# Set this non-0 to link to the RPCRT4 library. +# +!IFNDEF USE_RPCRT4_LIB +USE_RPCRT4_LIB = 0 +!ENDIF + +# Set this non-0 to generate assembly code listings for the source code +# files. +# +!IFNDEF USE_LISTINGS +USE_LISTINGS = 0 +!ENDIF + +# Set this non-0 to attempt setting the native compiler automatically +# for cross-compiling the command line tools needed during the compilation +# process. +# +!IFNDEF XCOMPILE +XCOMPILE = 0 +!ENDIF + +# Set this non-0 to use the native libraries paths for cross-compiling +# the command line tools needed during the compilation process. +# +!IFNDEF USE_NATIVE_LIBPATHS +USE_NATIVE_LIBPATHS = 0 +!ENDIF + +# Set this 0 to skip the compiling and embedding of version resources. +# +!IFNDEF USE_RC +USE_RC = 1 +!ENDIF + +# Set this non-0 to compile binaries suitable for the WinRT environment. +# This setting does not apply to any binaries that require Tcl to operate +# properly (i.e. the text fixture, etc). +# +!IFNDEF FOR_WINRT +FOR_WINRT = 0 +!ENDIF + +# Set this non-0 to compile binaries suitable for the UWP environment. +# This setting does not apply to any binaries that require Tcl to operate +# properly (i.e. the text fixture, etc). +# +!IFNDEF FOR_UWP +FOR_UWP = 0 +!ENDIF + +# Set this non-0 to compile binaries suitable for the Windows 10 platform. +# +!IFNDEF FOR_WIN10 +FOR_WIN10 = 0 +!ENDIF + + +# Set this to non-0 to create and use PDBs. +# +!IFNDEF SYMBOLS +SYMBOLS = 1 +!ENDIF + +# Set this to non-0 to use the SQLite debugging heap subsystem. +# +!IFNDEF MEMDEBUG +MEMDEBUG = 0 +!ENDIF + +# Set this to non-0 to use the Win32 native heap subsystem. +# +!IFNDEF WIN32HEAP +WIN32HEAP = 0 +!ENDIF + +# Set this to non-0 to enable OSTRACE() macros, which can be useful when +# debugging. +# +!IFNDEF OSTRACE +OSTRACE = 0 +!ENDIF + +# Set this to one of the following values to enable various debugging +# features. Each level includes the debugging options from the previous +# levels. Currently, the recognized values for DEBUG are: +# +# 0 == NDEBUG: Disables assert() and other runtime diagnostics. +# 1 == SQLITE_ENABLE_API_ARMOR: extra attempts to detect misuse of the API. +# 2 == Disables NDEBUG and all optimizations and then enables PDBs. +# 3 == SQLITE_DEBUG: Enables various diagnostics messages and code. +# 4 == SQLITE_WIN32_MALLOC_VALIDATE: Validate the Win32 native heap per call. +# 5 == SQLITE_DEBUG_OS_TRACE: Enables output from the OSTRACE() macros. +# 6 == SQLITE_ENABLE_IOTRACE: Enables output from the IOTRACE() macros. +# +!IFNDEF DEBUG +DEBUG = 0 +!ENDIF + +# Enable use of available compiler optimizations? Normally, this should be +# non-zero. Setting this to zero, thus disabling all compiler optimizations, +# can be useful for testing. +# +!IFNDEF OPTIMIZATIONS +OPTIMIZATIONS = 2 +!ENDIF + +# Set this to non-0 to enable support for the session extension. +# +!IFNDEF SESSION +SESSION = 0 +!ENDIF + +# Set the source code file to be used by executables and libraries when +# they need the amalgamation. +# +!IFNDEF SQLITE3C +!IF $(SPLIT_AMALGAMATION)!=0 +SQLITE3C = sqlite3-all.c +!ELSE +SQLITE3C = sqlite3.c +!ENDIF +!ENDIF + +# Set the include code file to be used by executables and libraries when +# they need SQLite. +# +!IFNDEF SQLITE3H +SQLITE3H = sqlite3.h +!ENDIF + +# This is the name to use for the SQLite dynamic link library (DLL). +# +!IFNDEF SQLITE3DLL +!IF $(FOR_WIN10)!=0 +SQLITE3DLL = winsqlite3.dll +!ELSE +SQLITE3DLL = sqlite3.dll +!ENDIF +!ENDIF + +# This is the name to use for the SQLite import library (LIB). +# +!IFNDEF SQLITE3LIB +!IF $(FOR_WIN10)!=0 +SQLITE3LIB = winsqlite3.lib +!ELSE +SQLITE3LIB = sqlite3.lib +!ENDIF +!ENDIF + +# This is the name to use for the SQLite shell executable (EXE). +# +!IFNDEF SQLITE3EXE +!IF $(FOR_WIN10)!=0 +SQLITE3EXE = winsqlite3shell.exe +!ELSE +SQLITE3EXE = sqlite3.exe +!ENDIF +!ENDIF + +# This is the argument used to set the program database (PDB) file for the +# SQLite shell executable (EXE). +# +!IFNDEF SQLITE3EXEPDB +!IF $(FOR_WIN10)!=0 +SQLITE3EXEPDB = +!ELSE +SQLITE3EXEPDB = /pdb:sqlite3sh.pdb +!ENDIF +!ENDIF + +# These are the "standard" SQLite compilation options used when compiling for +# the Windows platform. +# +!IFNDEF OPT_FEATURE_FLAGS +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 +!ENDIF + +# Should the session extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(SESSION)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 +!ENDIF + +# These are the "extended" SQLite compilation options used when compiling for +# the Windows 10 platform. +# +!IFNDEF EXT_FEATURE_FLAGS +!IF $(FOR_WIN10)!=0 +EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS4=1 +EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_SYSTEM_MALLOC=1 +EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS) -DSQLITE_OMIT_LOCALTIME=1 +!ELSE +EXT_FEATURE_FLAGS = +!ENDIF +!ENDIF + +############################################################################### +############################### END OF OPTIONS ################################ +############################################################################### + +# When compiling for the Windows 10 platform, the PLATFORM macro must be set +# to an appropriate value (e.g. x86, x64, arm, arm64, etc). +# +!IF $(FOR_WIN10)!=0 +!IFNDEF PLATFORM +!ERROR Using the FOR_WIN10 option requires a value for PLATFORM. +!ENDIF +!ENDIF + +# This assumes that MSVC is always installed in 32-bit Program Files directory +# and sets the variable for use in locating other 32-bit installs accordingly. +# +PROGRAMFILES_X86 = $(VCINSTALLDIR)\..\.. +PROGRAMFILES_X86 = $(PROGRAMFILES_X86:\\=\) + +# Check for the predefined command macro CC. This should point to the compiler +# binary for the target platform. If it is not defined, simply define it to +# the legacy default value 'cl.exe'. +# +!IFNDEF CC +CC = cl.exe +!ENDIF + +# Check for the predefined command macro CSC. This should point to a working +# C Sharp compiler binary. If it is not defined, simply define it to the +# legacy default value 'csc.exe'. +# +!IFNDEF CSC +CSC = csc.exe +!ENDIF + +# Check for the command macro LD. This should point to the linker binary for +# the target platform. If it is not defined, simply define it to the legacy +# default value 'link.exe'. +# +!IFNDEF LD +LD = link.exe +!ENDIF + +# Check for the predefined command macro RC. This should point to the resource +# compiler binary for the target platform. If it is not defined, simply define +# it to the legacy default value 'rc.exe'. +# +!IFNDEF RC +RC = rc.exe +!ENDIF + +# Check for the MSVC runtime library path macro. Otherwise, this value will +# default to the 'lib' directory underneath the MSVC installation directory. +# +!IFNDEF CRTLIBPATH +CRTLIBPATH = $(VCINSTALLDIR)\lib +!ENDIF + +CRTLIBPATH = $(CRTLIBPATH:\\=\) + +# Check for the command macro NCC. This should point to the compiler binary +# for the platform the compilation process is taking place on. If it is not +# defined, simply define it to have the same value as the CC macro. When +# cross-compiling, it is suggested that this macro be modified via the command +# line (since nmake itself does not provide a built-in method to guess it). +# For example, to use the x86 compiler when cross-compiling for x64, a command +# line similar to the following could be used (all on one line): +# +# nmake /f Makefile.msc sqlite3.dll +# XCOMPILE=1 USE_NATIVE_LIBPATHS=1 +# +# Alternatively, the full path and file name to the compiler binary for the +# platform the compilation process is taking place may be specified (all on +# one line): +# +# nmake /f Makefile.msc sqlite3.dll +# "NCC=""%VCINSTALLDIR%\bin\cl.exe""" +# USE_NATIVE_LIBPATHS=1 +# +!IFDEF NCC +NCC = $(NCC:\\=\) +!ELSEIF $(XCOMPILE)!=0 +NCC = "$(VCINSTALLDIR)\bin\$(CC)" +NCC = $(NCC:\\=\) +!ELSE +NCC = $(CC) +!ENDIF + +# Check for the MSVC native runtime library path macro. Otherwise, +# this value will default to the 'lib' directory underneath the MSVC +# installation directory. +# +!IFNDEF NCRTLIBPATH +NCRTLIBPATH = $(VCINSTALLDIR)\lib +!ENDIF + +NCRTLIBPATH = $(NCRTLIBPATH:\\=\) + +# Check for the Platform SDK library path macro. Otherwise, this +# value will default to the 'lib' directory underneath the Windows +# SDK installation directory (the environment variable used appears +# to be available when using Visual C++ 2008 or later via the +# command line). +# +!IFNDEF NSDKLIBPATH +NSDKLIBPATH = $(WINDOWSSDKDIR)\lib +!ENDIF + +NSDKLIBPATH = $(NSDKLIBPATH:\\=\) + +# Check for the UCRT library path macro. Otherwise, this value will +# default to the version-specific, platform-specific 'lib' directory +# underneath the Windows SDK installation directory. +# +!IFNDEF UCRTLIBPATH +UCRTLIBPATH = $(WINDOWSSDKDIR)\lib\$(WINDOWSSDKLIBVERSION)\ucrt\$(PLATFORM) +!ENDIF + +UCRTLIBPATH = $(UCRTLIBPATH:\\=\) + +# C compiler and options for use in building executables that +# will run on the platform that is doing the build. +# +!IF $(USE_FULLWARN)!=0 +BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS) +!ELSE +BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS) +!ENDIF + +# Check if assembly code listings should be generated for the source +# code files to be compiled. +# +!IF $(USE_LISTINGS)!=0 +BCC = $(BCC) -FAcs +!ENDIF + +# Check if the native library paths should be used when compiling +# the command line tools used during the compilation process. If +# so, set the necessary macro now. +# +!IF $(USE_NATIVE_LIBPATHS)!=0 +NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)" + +!IFDEF NUCRTLIBPATH +NUCRTLIBPATH = $(NUCRTLIBPATH:\\=\) +NLTLIBPATHS = $(NLTLIBPATHS) "/LIBPATH:$(NUCRTLIBPATH)" +!ENDIF +!ENDIF + +# C compiler and options for use in building executables that +# will run on the target platform. (BCC and TCC are usually the +# same unless your are cross-compiling.) +# +!IF $(USE_FULLWARN)!=0 +TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS) +!ELSE +TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS) +!ENDIF + +TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise +RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS) + +# Check if we want to use the "stdcall" calling convention when compiling. +# This is not supported by the compilers for non-x86 platforms. It should +# also be noted here that building any target with these "stdcall" options +# will most likely fail if the Tcl library is also required. This is due +# to how the Tcl library functions are declared and exported (i.e. without +# an explicit calling convention, which results in "cdecl"). +# +!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0 +!IF "$(PLATFORM)"=="x86" +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +!ELSE +!IFNDEF PLATFORM +CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall +!ELSE +CORE_CCONV_OPTS = +SHELL_CCONV_OPTS = +!ENDIF +!ENDIF +!ELSE +CORE_CCONV_OPTS = +SHELL_CCONV_OPTS = +!ENDIF + +# These are additional compiler options used for the core library. +# +!IFNDEF CORE_COMPILE_OPTS +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport) +!ELSE +CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) +!ENDIF +!ENDIF + +# These are the additional targets that the core library should depend on +# when linking. +# +!IFNDEF CORE_LINK_DEP +!IF $(DYNAMIC_SHELL)!=0 +CORE_LINK_DEP = +!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86" +CORE_LINK_DEP = sqlite3.def +!ELSE +CORE_LINK_DEP = +!ENDIF +!ENDIF + +# These are additional linker options used for the core library. +# +!IFNDEF CORE_LINK_OPTS +!IF $(DYNAMIC_SHELL)!=0 +CORE_LINK_OPTS = +!ELSEIF $(FOR_WIN10)==0 || "$(PLATFORM)"=="x86" +CORE_LINK_OPTS = /DEF:sqlite3.def +!ELSE +CORE_LINK_OPTS = +!ENDIF +!ENDIF + +# These are additional compiler options used for the shell executable. +# +!IFNDEF SHELL_COMPILE_OPTS +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) -DSQLITE_API=__declspec(dllimport) +!ELSE +SHELL_COMPILE_OPTS = $(SHELL_CCONV_OPTS) +!ENDIF +!ENDIF + +# This is the source code that the shell executable should be compiled +# with. +# +!IFNDEF SHELL_CORE_SRC +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_CORE_SRC = +!ELSE +SHELL_CORE_SRC = $(SQLITE3C) +!ENDIF +!ENDIF + +# This is the core library that the shell executable should depend on. +# +!IFNDEF SHELL_CORE_DEP +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_CORE_DEP = $(SQLITE3DLL) +!ELSE +SHELL_CORE_DEP = +!ENDIF +!ENDIF + +# This is the core library that the shell executable should link with. +# +!IFNDEF SHELL_CORE_LIB +!IF $(DYNAMIC_SHELL)!=0 || $(FOR_WIN10)!=0 +SHELL_CORE_LIB = $(SQLITE3LIB) +!ELSE +SHELL_CORE_LIB = +!ENDIF +!ENDIF + +# These are additional linker options used for the shell executable. +# +!IFNDEF SHELL_LINK_OPTS +SHELL_LINK_OPTS = $(SHELL_CORE_LIB) +!ENDIF + +# Check if assembly code listings should be generated for the source +# code files to be compiled. +# +!IF $(USE_LISTINGS)!=0 +TCC = $(TCC) -FAcs +!ENDIF + +# When compiling the library for use in the WinRT environment, +# the following compile-time options must be used as well to +# disable use of Win32 APIs that are not available and to enable +# use of Win32 APIs that are specific to Windows 8 and/or WinRT. +# +!IF $(FOR_WINRT)!=0 +TCC = $(TCC) -DSQLITE_OS_WINRT=1 +RCC = $(RCC) -DSQLITE_OS_WINRT=1 +TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP +RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP +!ENDIF + +# C compiler options for the Windows 10 platform (needs MSVC 2015). +# +!IF $(FOR_WIN10)!=0 +TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE +!ENDIF + +# Also, we need to dynamically link to the correct MSVC runtime +# when compiling for WinRT (e.g. debug or release) OR if the +# USE_CRT_DLL option is set to force dynamically linking to the +# MSVC runtime library. +# +!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0 +!IF $(DEBUG)>1 +TCC = $(TCC) -MDd +BCC = $(BCC) -MDd +!ELSE +TCC = $(TCC) -MD +BCC = $(BCC) -MD +!ENDIF +!ELSE +!IF $(DEBUG)>1 +TCC = $(TCC) -MTd +BCC = $(BCC) -MTd +!ELSE +TCC = $(TCC) -MT +BCC = $(BCC) -MT +!ENDIF +!ENDIF + + +# Define -DNDEBUG to compile without debugging (i.e., for production usage) +# Omitting the define will cause extra debugging code to be inserted and +# includes extra comments when "EXPLAIN stmt" is used. +# +!IF $(DEBUG)==0 +TCC = $(TCC) -DNDEBUG +BCC = $(BCC) -DNDEBUG +RCC = $(RCC) -DNDEBUG +!ENDIF + +!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0 +TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1 +RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1 +!ENDIF + +!IF $(DEBUG)>2 +TCC = $(TCC) -DSQLITE_DEBUG=1 +RCC = $(RCC) -DSQLITE_DEBUG=1 +!ENDIF + +!IF $(DEBUG)>4 || $(OSTRACE)!=0 +TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1 +RCC = $(RCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1 +!ENDIF + +!IF $(DEBUG)>5 +TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE=1 +RCC = $(RCC) -DSQLITE_ENABLE_IOTRACE=1 +!ENDIF + +# Prevent warnings about "insecure" MSVC runtime library functions +# being used. +# +TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS +BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS +RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS + +# Prevent warnings about "deprecated" POSIX functions being used. +# +TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS +BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS +RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS + +# Use the SQLite debugging heap subsystem? +# +!IF $(MEMDEBUG)!=0 +TCC = $(TCC) -DSQLITE_MEMDEBUG=1 +RCC = $(RCC) -DSQLITE_MEMDEBUG=1 + +# Use native Win32 heap subsystem instead of malloc/free? +# +!ELSEIF $(WIN32HEAP)!=0 +TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1 +RCC = $(RCC) -DSQLITE_WIN32_MALLOC=1 + +# Validate the heap on every call into the native Win32 heap subsystem? +# +!IF $(DEBUG)>3 +TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 +RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 +!ENDIF +!ENDIF + + +# Compiler options needed for programs that use the readline() library. +# +!IFNDEF READLINE_FLAGS +READLINE_FLAGS = -DHAVE_READLINE=0 +!ENDIF + +# The library that programs using readline() must link against. +# +!IFNDEF LIBREADLINE +LIBREADLINE = +!ENDIF + +# Should the database engine be compiled threadsafe +# +TCC = $(TCC) -DSQLITE_THREADSAFE=1 +RCC = $(RCC) -DSQLITE_THREADSAFE=1 + +# Do threads override each others locks by default (1), or do we test (-1) +# +TCC = $(TCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 +RCC = $(RCC) -DSQLITE_THREAD_OVERRIDE_LOCK=-1 + +# Any target libraries which libsqlite must be linked against +# +!IFNDEF TLIBS +TLIBS = +!ENDIF + +# Flags controlling use of the in memory btree implementation +# +# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to +# default to file, 2 to default to memory, and 3 to force temporary +# tables to always be in memory. +# +TCC = $(TCC) -DSQLITE_TEMP_STORE=1 +RCC = $(RCC) -DSQLITE_TEMP_STORE=1 + +# Enable/disable loadable extensions, and other optional features +# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). +# The same set of OMIT and ENABLE flags should be passed to the +# LEMON parser generator and the mkkeywordhash tool as well. + +# These are the required SQLite compilation options used when compiling for +# the Windows platform. +# +REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_MAX_TRIGGER_DEPTH=100 + +# If we are linking to the RPCRT4 library, enable features that need it. +# +!IF $(USE_RPCRT4_LIB)!=0 +REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS) -DSQLITE_WIN32_USE_UUID=1 +!ENDIF + +# Add the required and optional SQLite compilation options into the command +# lines used to invoke the MSVC code and resource compilers. +# +TCC = $(TCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) +RCC = $(RCC) $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) + +# Add in any optional parameters specified on the commane line, e.g. +# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1" +# +TCC = $(TCC) $(OPTS) +RCC = $(RCC) $(OPTS) + +# If compiling for debugging, add some defines. +# +!IF $(DEBUG)>1 +TCC = $(TCC) -D_DEBUG +BCC = $(BCC) -D_DEBUG +RCC = $(RCC) -D_DEBUG +!ENDIF + +# If optimizations are enabled or disabled (either implicitly or +# explicitly), add the necessary flags. +# +!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0 +TCC = $(TCC) -Od +BCC = $(BCC) -Od +!IF $(USE_RUNTIME_CHECKS)!=0 +TCC = $(TCC) -RTC1 +BCC = $(BCC) -RTC1 +!ENDIF +!ELSEIF $(OPTIMIZATIONS)>=3 +TCC = $(TCC) -Ox +BCC = $(BCC) -Ox +!ELSEIF $(OPTIMIZATIONS)==2 +TCC = $(TCC) -O2 +BCC = $(BCC) -O2 +!ELSEIF $(OPTIMIZATIONS)==1 +TCC = $(TCC) -O1 +BCC = $(BCC) -O1 +!ENDIF + +# If symbols are enabled (or compiling for debugging), enable PDBs. +# +!IF $(DEBUG)>1 || $(SYMBOLS)!=0 +TCC = $(TCC) -Zi +BCC = $(BCC) -Zi +!ENDIF + + +# Command line prefixes for compiling code, compiling resources, +# linking, etc. +# +LTCOMPILE = $(TCC) -Fo$@ +LTRCOMPILE = $(RCC) -r +LTLIB = lib.exe +LTLINK = $(TCC) -Fe$@ + +# If requested, link to the RPCRT4 library. +# +!IF $(USE_RPCRT4_LIB)!=0 +LTLINK = $(LTLINK) rpcrt4.lib +!ENDIF + +# If a platform was set, force the linker to target that. +# Note that the vcvars*.bat family of batch files typically +# set this for you. Otherwise, the linker will attempt +# to deduce the binary type based on the object files. +!IFDEF PLATFORM +LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM) +LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM) +!ELSE +LTLINKOPTS = /NOLOGO +LTLIBOPTS = /NOLOGO +!ENDIF + +# When compiling for use in the WinRT environment, the following +# linker option must be used to mark the executable as runnable +# only in the context of an application container. +# +!IF $(FOR_WINRT)!=0 +LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER +!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0" +!IFNDEF STORELIBPATH +!IF "$(PLATFORM)"=="x86" +STORELIBPATH = $(CRTLIBPATH)\store +!ELSEIF "$(PLATFORM)"=="x64" +STORELIBPATH = $(CRTLIBPATH)\store\amd64 +!ELSEIF "$(PLATFORM)"=="ARM" +STORELIBPATH = $(CRTLIBPATH)\store\arm +!ELSE +STORELIBPATH = $(CRTLIBPATH)\store +!ENDIF +!ENDIF +STORELIBPATH = $(STORELIBPATH:\\=\) +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)" +!ENDIF +!ENDIF + +# When compiling for Windows Phone 8.1, an extra library path is +# required. +# +!IF $(USE_WP81_OPTS)!=0 +!IFNDEF WP81LIBPATH +!IF "$(PLATFORM)"=="x86" +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86 +!ELSEIF "$(PLATFORM)"=="ARM" +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM +!ELSE +WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86 +!ENDIF +!ENDIF +!ENDIF + +# When compiling for Windows Phone 8.1, some extra linker options +# are also required. +# +!IF $(USE_WP81_OPTS)!=0 +!IFDEF WP81LIBPATH +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)" +!ENDIF +LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE +LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib +!ENDIF + +# When compiling for UWP or the Windows 10 platform, some extra linker +# options are also required. +# +!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0 +LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib +LTLINKOPTS = $(LTLINKOPTS) mincore.lib +!IFDEF PSDKLIBPATH +LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)" +!ENDIF +!ENDIF + +!IF $(FOR_WIN10)!=0 +LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)" +!IF $(DEBUG)>1 +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib +!ELSE +LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib +!ENDIF +!ENDIF + +# If either debugging or symbols are enabled, enable PDBs. +# +!IF $(DEBUG)>1 || $(SYMBOLS)!=0 +LDFLAGS = /DEBUG $(LDOPTS) +!ELSE +LDFLAGS = $(LDOPTS) +!ENDIF + + +# You should not have to change anything below this line +############################################################################### + + +# Object files for the amalgamation. +# +LIBOBJS1 = sqlite3.lo + +# Determine the real value of LIBOBJ based on the 'configure' script +# +LIBOBJ = $(LIBOBJS1) + +# Determine if embedded resource compilation and usage are enabled. +# +!IF $(USE_RC)!=0 +LIBRESOBJS = sqlite3res.lo +!ELSE +LIBRESOBJS = +!ENDIF + + +# Additional compiler options for the shell. These are only effective +# when the shell is not being dynamically linked. +# +!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS +!ENDIF + + +# This is the default Makefile target. The objects listed here +# are what get build when you type just "make" with no arguments. +# +all: dll shell + +# Dynamic link library section. +# +dll: $(SQLITE3DLL) + +# Shell executable. +# +shell: $(SQLITE3EXE) + + +$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP) + $(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) + +Replace.exe: + $(CSC) /target:exe $(TOP)\Replace.cs + +sqlite3.def: Replace.exe $(LIBOBJ) + echo EXPORTS > sqlite3.def + dumpbin /all $(LIBOBJ) \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | sort >> sqlite3.def + +$(SQLITE3EXE): $(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) + $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\shell.c $(SHELL_CORE_SRC) \ + /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) + + +# Rule to build the amalgamation +# +sqlite3.lo: $(SQLITE3C) + $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(SQLITE3C) + + +# Rule to build the Win32 resources object file. +# +!IF $(USE_RC)!=0 +_HASHCHAR=^# +!IF ![echo !IFNDEF VERSION > rcver.vc] && \ + ![for /F "delims=" %V in ('type "$(SQLITE3H)" ^| find "$(_HASHCHAR)define SQLITE_VERSION "') do (echo VERSION = ^^%V >> rcver.vc)] && \ + ![echo !ENDIF >> rcver.vc] +!INCLUDE rcver.vc +!ENDIF + +RESOURCE_VERSION = $(VERSION:^#=) +RESOURCE_VERSION = $(RESOURCE_VERSION:define=) +RESOURCE_VERSION = $(RESOURCE_VERSION:SQLITE_VERSION=) +RESOURCE_VERSION = $(RESOURCE_VERSION:"=) +RESOURCE_VERSION = $(RESOURCE_VERSION:.=,) + +$(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H) + echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h + echo #define SQLITE_RESOURCE_VERSION $(RESOURCE_VERSION) >> sqlite3rc.h + echo #endif >> sqlite3rc.h + $(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc +!ENDIF + + +clean: + del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Aug 24 12:35:58 2016 Return-Path: Delivered-To: svn-src-head@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 B25DABC3E13; Wed, 24 Aug 2016 12:35:58 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6760819DD; Wed, 24 Aug 2016 12:35:57 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id cXPPbs0gYgdalcXPQboXbp; Wed, 24 Aug 2016 06:35:57 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=m_VEgFnaWOhuYqlumwkA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1B90913752; Wed, 24 Aug 2016 05:35:55 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7OCZswp004129; Wed, 24 Aug 2016 05:35:54 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608241235.u7OCZswp004129@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304747 - in head/contrib/sqlite3: . tea In-Reply-To: Message from Cy Schubert of "Wed, 24 Aug 2016 12:32:25 -0000." <201608241232.u7OCWPsn020853@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Aug 2016 05:35:54 -0700 X-CMAE-Envelope: MS4wfJ11AUXYHs6xDhGV+80Kp7yUnqqqSwv8okAd+lNdAD1v0/99RSpIsuLCkApX/FHSHewRVfvz1NV1ogYLgCDYynbV6eYh/jgAkczvKnKhcMsztK8g74wD qz/ioI3hYwS1MB1mkNEBN/Wj9e1x/sa6ttG81DvazJ4BbQo4KLIS6naA9yRNohaXX3PByPNtsLDiXG06CQkpNT7ZtcMIQqL5j9d/8923V/MyYPj9U9SVmkd3 kDn2GfwiAnUDf4iKOJeVrp0/dAqYwaqUk2w+NwcFoySFrX+mTukqZmt8FCiaw1+7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:35:58 -0000 In message <201608241232.u7OCWPsn020853@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Wed Aug 24 12:32:24 2016 > New Revision: 304747 > URL: https://svnweb.freebsd.org/changeset/base/304747 > > Log: > MFV r304732. > > Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100). > > This commit addresses the tmpdir selection vulnerability fixed in > sqlite3-1.13.0. See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b. > > Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b > Security: CVE-2016-6153 This should probably be MFCed in a week unless re@ wants it sooner of course. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Aug 24 12:38:16 2016 Return-Path: Delivered-To: svn-src-head@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 0881DBC3ECB for ; Wed, 24 Aug 2016 12:38:16 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B255E1BD9 for ; Wed, 24 Aug 2016 12:38:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x234.google.com with SMTP id z190so13003530qkc.0 for ; Wed, 24 Aug 2016 05:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6yMGNFFzOoVcWLAItFcF09wQFDoCPhdFdxm6UdZDa/o=; b=UBkPg46mlqVCfkRmPe0lXOGcG8I1PqoCNUB467xpVtAEkeAB5MauNwJJlPmvCUOVlH 3PvA2ebd3jjG8dF0eohCoMbEkFkHr1+J1c7UHOSL4McO9YHPhGY4hxIlfTY/fIyJhtsS l+1wq8SU4P54kCNyVO7KhFVa5uGftS2oeMTsqcZm18Qo1/yP6i6CYEGrbzds1FZxyn6H j+NeNjUZ52Ii4pCszZ+Ku9aLuqyeuTV4+yocuV2OBH77se3l8xVmogED+F2a46kmmDCO NyFZZ+v8+mubKNSjpeptysbTFKEWCF1HT+KqiCbPRrDWH4XnInHYxLQSVyoQrNW7BRyw S1pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6yMGNFFzOoVcWLAItFcF09wQFDoCPhdFdxm6UdZDa/o=; b=AxPx6j7RupgqD+xcklDT6dO1jGsb/6iVtVo3XWBlocDvk+Wq5U8vFInSLbehtDZPu3 wVm1kNVT82JS4znKh5R2vfMil9dNcq1CFxJL2kNGafmdYn9fD15pBkRVl/rZadfu4uqX FS+kDt+JL1Z6/cbNoxKzEg/4LJQhuYb2F6yKENQQNhxqeAk1vjm13GnCi6701C5lqkWZ KgBFo9CB4u1/cPUAu7x8JnTj8ye1ih/ESIXl0Qy9c2U1RJAOb/qiHXbSQNyXUYxh4C6S 0fDQSza0V5Z3fdQdq0+yTbddPown5wa3Lg1XEdUTbvFy2NPH0nfPf/zCMioSbd4bNTWW buOQ== X-Gm-Message-State: AE9vXwMAdlx7px8Bo0biP8/VOwgmXz8TSEjEwS42mTuyR9I1QuJyTliRHjI4shYB3Zs9ozMR X-Received: by 10.233.232.195 with SMTP id a186mr3053777qkg.109.1472042294919; Wed, 24 Aug 2016 05:38:14 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id 55sm4541422qtp.32.2016.08.24.05.38.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Aug 2016 05:38:13 -0700 (PDT) Date: Wed, 24 Aug 2016 08:38:11 -0400 From: Shawn Webb To: Cy Schubert Cc: Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304747 - in head/contrib/sqlite3: . tea Message-ID: <20160824123811.GB74786@mutt-hardenedbsd> References: <201608241232.u7OCWPsn020853@repo.freebsd.org> <201608241235.u7OCZswp004129@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qcHopEYAB45HaUaB" Content-Disposition: inline In-Reply-To: <201608241235.u7OCZswp004129@slippy.cwsent.com> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:38:16 -0000 --qcHopEYAB45HaUaB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 24, 2016 at 05:35:54AM -0700, Cy Schubert wrote: > In message <201608241232.u7OCWPsn020853@repo.freebsd.org>, Cy Schubert=20 > writes: > > Author: cy > > Date: Wed Aug 24 12:32:24 2016 > > New Revision: 304747 > > URL: https://svnweb.freebsd.org/changeset/base/304747 > >=20 > > Log: > > MFV r304732. > > =20 > > Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100). > > =20 > > This commit addresses the tmpdir selection vulnerability fixed in > > sqlite3-1.13.0. See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b. > > =20 > > Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b > > Security: CVE-2016-6153 >=20 > This should probably be MFCed in a week unless re@ wants it sooner of=20 > course. Does this also need a FreeBSD errata notice or security announcement? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --qcHopEYAB45HaUaB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXvZUxAAoJEGqEZY9SRW7uze8QAMceVH+G5kwAqAaR3zUZZd0R CJ/hhyFMVuNl6LOOrQYkwwDvOzVtjXzu7DkErXMbsp0/57sjxYcE6Cztu5PzGTTe MAer3s9Wbwy5Lq43w8TtpLNZDEkK3JOqJdvZw0HHgHUsc5ZOoAJY9M/6utKp8mcb HiAAysGaqj80H4JUxdvNaE3eFyu+OGPVgEqg9jlSWBMnfffwAVAiFl+g8ysejAE6 shW4Kef4mZnVwSZib4OeikbxTOLYzyO/c8So7B0I75rQHXu8+0zX/y+AsOcbogOi cMLM3D7tldyu7PwHnZj0Sf9PJohHJDU5arMqtykcPevgY/c/7DCCgDRHah7JU82Y oUByrQ+VQMjK7lpMs2/uqb/kOiYNN14VdAo5vqQ1Bbud+RfDd7V29e8cdrTJxcj0 KJFM744Cu/gFukwd9yvdYZEe0TdVX5CFD+3wiCnD8BoRYJcKYhSKXh4lSvGswUP4 gE9YkZ645aKgk0Jnghibzzj9l9ridUgn2pvVxaheT3luX1JUKWp1GIpoODCShZVG WGm+zyA31Q5aqUh/RYWFIOfw9UGfQqO1VBAi1kUu5bLqPuOOdIX1Sh0E5R1zAbep 0Jfd/EF45o7J1zEe/KE3hmCiP4v6WRXm2ZvTRIGSfscClr55CfLjNvlPBMwmTKeD Uo4OsSeF1Y+T97inOvBY =5jam -----END PGP SIGNATURE----- --qcHopEYAB45HaUaB-- From owner-svn-src-head@freebsd.org Wed Aug 24 12:53:55 2016 Return-Path: Delivered-To: svn-src-head@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 EF395BC433C; Wed, 24 Aug 2016 12:53:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B07B3164E; Wed, 24 Aug 2016 12:53:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OCrstc030059; Wed, 24 Aug 2016 12:53:54 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OCrsSW030058; Wed, 24 Aug 2016 12:53:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608241253.u7OCrsSW030058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 24 Aug 2016 12:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304748 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:53:56 -0000 Author: ed Date: Wed Aug 24 12:53:54 2016 New Revision: 304748 URL: https://svnweb.freebsd.org/changeset/base/304748 Log: Document the existence of the cloudabi32 kernel module. Modified: head/share/man/man4/cloudabi.4 Modified: head/share/man/man4/cloudabi.4 ============================================================================== --- head/share/man/man4/cloudabi.4 Wed Aug 24 12:32:24 2016 (r304747) +++ head/share/man/man4/cloudabi.4 Wed Aug 24 12:53:54 2016 (r304748) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2015 Nuxi, https://nuxi.nl/ +.\" Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/ .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -22,17 +22,25 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd October 22, 2015 +.Dd August 24, 2016 .Dt CLOUDABI 4 .Os .Sh NAME .Nm cloudabi , +.Nm cloudabi32 , .Nm cloudabi64 .Nd CloudABI support .Sh SYNOPSIS -Support for 64-bit CloudABI executables can be compiled into the kernel +Support for 32-bit CloudABI executables can be compiled into the kernel by adding this line to the kernel configuration file: .Bd -ragged -offset indent +.Cd "options COMPAT_CLOUDABI32" +.Ed +.Pp +Similarly, +support for 64-bit CloudABI executables can be enabled by adding this +line: +.Bd -ragged -offset indent .Cd "options COMPAT_CLOUDABI64" .Ed .Pp @@ -40,6 +48,7 @@ CloudABI support can also be loaded at b .Xr loader.conf 5 : .Bd -literal -offset indent cloudabi_load="YES" +cloudabi32_load="YES" cloudabi64_load="YES" .Ed .Sh DESCRIPTION @@ -52,19 +61,21 @@ and hardened against security exploits. .Pp Support for CloudABI on .Fx -consists of two separate kernel modules. +consists of three separate kernel modules. The .Nm cloudabi kernel module implements all of the system calls that do not depend on -data structures that differ between architectures. +data structures that differ between hardware architectures. .Pp The +.Nm cloudabi32 +and .Nm cloudabi64 -kernel module provides implementations of all of the machine-dependent -system calls. -It assumes that pointers stored in data structures provided as system -call arguments are 64 bits in size. -It also provides the image activator that loads and starts 64-bit ELF +kernel modules provide implementations of all of the machine-dependent +system calls, +assuming that pointers stored in data structures are either 32 bits or +64 bits in size. +These modules also provide the image activators that load and start ELF executables. .Pp Though the @@ -72,8 +83,12 @@ Though the module can be loaded on any architecture supported by .Fx , the +.Nm cloudabi32 +module is only available on i386 and amd64. +The same holds for the .Nm cloudabi64 -module is only available for amd64 and arm64. +module, +which is only available for amd64 and arm64. .Pp A full cross compilation toolchain for CloudABI is available in the .Pa devel/cloudabi-toolchain @@ -93,6 +108,9 @@ restricted set of resources. .Xr linux 4 , .Xr elf 5 .Pp +CloudABI for FreeBSD: +.Pa https://nuxi.nl/cloudabi/freebsd/ . +.Pp cloudlibc on GitHub: .Pa https://github.com/NuxiNL/cloudlibc . .Pp From owner-svn-src-head@freebsd.org Wed Aug 24 12:55:19 2016 Return-Path: Delivered-To: svn-src-head@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 C86A2BC43B4; Wed, 24 Aug 2016 12:55:19 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAC317D6; Wed, 24 Aug 2016 12:55:19 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id cXi8bs581gdalcXiAboa2f; Wed, 24 Aug 2016 06:55:18 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=uJrCp0mhTZ5-IOdZEwUA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id BEA5413752; Wed, 24 Aug 2016 05:55:16 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7OCtGK3019972; Wed, 24 Aug 2016 05:55:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608241255.u7OCtGK3019972@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Shawn Webb cc: Cy Schubert , Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304747 - in head/contrib/sqlite3: . tea In-Reply-To: Message from Shawn Webb of "Wed, 24 Aug 2016 08:38:11 -0400." <20160824123811.GB74786@mutt-hardenedbsd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Aug 2016 05:55:16 -0700 X-CMAE-Envelope: MS4wfLnk9+leNXn7K0HeT6Y9gH88HTSnsncPKSBR7DOT9q6i/smZvUXT8MltXDdaWR+ri0WCcSO+IQUmVyn6GMs1U1UHTSr7kM7o2HC0i622ePgACXtVWiSV 1/AMk8k/GLxudy4ChklQHHGMGEC7eoa0MwdNXMGSDz/AMutCkWgtfdDneElNI06CdGuVOxcRFQGEOKvfA4L9SxzRZiwJmf1GdtJYfH5WaYNt1Xb6hIoU9Q4B 9qLO1v4v8oAaRR73C9UF0wx9Wg7cmh1Nsvjr6F7acuq7QDVjuzjiqDeM7wUnvhRDsJLoXcuLvMY778mN48A35A== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:55:19 -0000 In message <20160824123811.GB74786@mutt-hardenedbsd>, Shawn Webb writes: > > > --qcHopEYAB45HaUaB > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Wed, Aug 24, 2016 at 05:35:54AM -0700, Cy Schubert wrote: > > In message <201608241232.u7OCWPsn020853@repo.freebsd.org>, Cy Schubert=20 > > writes: > > > Author: cy > > > Date: Wed Aug 24 12:32:24 2016 > > > New Revision: 304747 > > > URL: https://svnweb.freebsd.org/changeset/base/304747 > > >=20 > > > Log: > > > MFV r304732. > > > =20 > > > Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100). > > > =20 > > > This commit addresses the tmpdir selection vulnerability fixed in > > > sqlite3-1.13.0. See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b. > > > =20 > > > Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b > > > Security: CVE-2016-6153 > >=20 > > This should probably be MFCed in a week unless re@ wants it sooner of=20 > > course. > > Does this also need a FreeBSD errata notice or security announcement? Not for the upcoming 11.0 release. The 10 branch OTOH appears to have 1.8.14, which is much much older, so I think that we should or at least do a direct commit to simply address the vulnerability. (I haven't looked at whether it would be better to MFC to 10 or direct commit to disturb as little as possible in the 10 brancn.) The 9 branch doesn't include sqlite3. I can prepare an MFC to 11 sooner if wanted. I'll look at the 10 branch at noon my time today. Relnotes for 11 and an errata announcement for 10 would be all that's needed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Aug 24 12:57:41 2016 Return-Path: Delivered-To: svn-src-head@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 22884BC444C; Wed, 24 Aug 2016 12:57:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E88DB19BC; Wed, 24 Aug 2016 12:57:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OCvexQ030240; Wed, 24 Aug 2016 12:57:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OCveDp030239; Wed, 24 Aug 2016 12:57:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608241257.u7OCveDp030239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 24 Aug 2016 12:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304749 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 12:57:41 -0000 Author: andrew Date: Wed Aug 24 12:57:40 2016 New Revision: 304749 URL: https://svnweb.freebsd.org/changeset/base/304749 Log: Add support to promote and demote managed superpages. This is the last part needed before enabling superpages on arm64. This code is based on the amd64 pmap with changes as needed to handle the differences between the two architectures. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Aug 24 12:53:54 2016 (r304748) +++ head/sys/arm64/arm64/pmap.c Wed Aug 24 12:57:40 2016 (r304749) @@ -509,6 +509,17 @@ pmap_l3_valid(pt_entry_t l3) return ((l3 & ATTR_DESCR_MASK) == L3_PAGE); } + +/* Is a level 1 or 2entry a valid block and cacheable */ +CTASSERT(L1_BLOCK == L2_BLOCK); +static __inline int +pmap_pte_valid_cacheable(pt_entry_t pte) +{ + + return (((pte & ATTR_DESCR_MASK) == L1_BLOCK) && + ((pte & ATTR_IDX_MASK) == ATTR_IDX(CACHED_MEMORY))); +} + static __inline int pmap_l3_valid_cacheable(pt_entry_t l3) { @@ -1959,6 +1970,68 @@ retry: } /* + * Ensure that the number of spare PV entries in the specified pmap meets or + * exceeds the given count, "needed". + * + * The given PV list lock may be released. + */ +static void +reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp) +{ + struct pch new_tail; + struct pv_chunk *pc; + int avail, free; + vm_page_t m; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); + + /* + * Newly allocated PV chunks must be stored in a private list until + * the required number of PV chunks have been allocated. Otherwise, + * reclaim_pv_chunk() could recycle one of these chunks. In + * contrast, these chunks must be added to the pmap upon allocation. + */ + TAILQ_INIT(&new_tail); +retry: + avail = 0; + TAILQ_FOREACH(pc, &pmap->pm_pvchunk, pc_list) { + bit_count((bitstr_t *)pc->pc_map, 0, + sizeof(pc->pc_map) * NBBY, &free); + if (free == 0) + break; + avail += free; + if (avail >= needed) + break; + } + for (; avail < needed; avail += _NPCPV) { + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + VM_ALLOC_WIRED); + if (m == NULL) { + m = reclaim_pv_chunk(pmap, lockp); + if (m == NULL) + goto retry; + } + PV_STAT(atomic_add_int(&pc_chunk_count, 1)); + PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); + dump_add_page(m->phys_addr); + pc = (void *)PHYS_TO_DMAP(m->phys_addr); + pc->pc_pmap = pmap; + pc->pc_map[0] = PC_FREE0; + pc->pc_map[1] = PC_FREE1; + pc->pc_map[2] = PC_FREE2; + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV)); + } + if (!TAILQ_EMPTY(&new_tail)) { + mtx_lock(&pv_chunks_mutex); + TAILQ_CONCAT(&pv_chunks, &new_tail, pc_lru); + mtx_unlock(&pv_chunks_mutex); + } +} + +/* * First find and then remove the pv entry for the specified pmap and virtual * address from the specified pv list. Returns the pv entry if found and NULL * otherwise. This operation can be performed on pv lists for either 4KB or @@ -1980,6 +2053,74 @@ pmap_pvh_remove(struct md_page *pvh, pma } /* + * After demotion from a 2MB page mapping to 512 4KB page mappings, + * destroy the pv entry for the 2MB page mapping and reinstantiate the pv + * entries for each of the 4KB page mappings. + */ +static void +pmap_pv_demote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) +{ + struct md_page *pvh; + struct pv_chunk *pc; + pv_entry_t pv; + vm_offset_t va_last; + vm_page_t m; + int bit, field; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT((pa & L2_OFFSET) == 0, + ("pmap_pv_demote_l2: pa is not 2mpage aligned")); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + + /* + * Transfer the 2mpage's pv entry for this mapping to the first + * page's pv list. Once this transfer begins, the pv list lock + * must not be released until the last pv entry is reinstantiated. + */ + pvh = pa_to_pvh(pa); + va = va & ~L2_OFFSET; + pv = pmap_pvh_remove(pvh, pmap, va); + KASSERT(pv != NULL, ("pmap_pv_demote_l2: pv not found")); + m = PHYS_TO_VM_PAGE(pa); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); + m->md.pv_gen++; + /* Instantiate the remaining Ln_ENTRIES - 1 pv entries. */ + PV_STAT(atomic_add_long(&pv_entry_allocs, Ln_ENTRIES - 1)); + va_last = va + L2_SIZE - PAGE_SIZE; + for (;;) { + pc = TAILQ_FIRST(&pmap->pm_pvchunk); + KASSERT(pc->pc_map[0] != 0 || pc->pc_map[1] != 0 || + pc->pc_map[2] != 0, ("pmap_pv_demote_l2: missing spare")); + for (field = 0; field < _NPCM; field++) { + while (pc->pc_map[field]) { + bit = ffsl(pc->pc_map[field]) - 1; + pc->pc_map[field] &= ~(1ul << bit); + pv = &pc->pc_pventry[field * 64 + bit]; + va += PAGE_SIZE; + pv->pv_va = va; + m++; + KASSERT((m->oflags & VPO_UNMANAGED) == 0, + ("pmap_pv_demote_l2: page %p is not managed", m)); + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); + m->md.pv_gen++; + if (va == va_last) + goto out; + } + } + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } +out: + if (pc->pc_map[0] == 0 && pc->pc_map[1] == 0 && pc->pc_map[2] == 0) { + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + } + PV_STAT(atomic_add_long(&pv_entry_count, Ln_ENTRIES - 1)); + PV_STAT(atomic_subtract_int(&pv_entry_spare, Ln_ENTRIES - 1)); +} + +/* * First find and then destroy the pv entry for the specified pmap and virtual * address. This operation can be performed on pv lists for either 4KB or 2MB * page mappings. @@ -2117,8 +2258,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva l3_paddr = pmap_load(l2); if ((l3_paddr & ATTR_DESCR_MASK) == L2_BLOCK) { - KASSERT((l3_paddr & ATTR_SW_MANAGED) == 0, - ("%s: TODO: Demote managed pages", __func__)); + /* TODO: Add pmap_remove_l2 */ if (pmap_demote_l2_locked(pmap, l2, sva & ~L2_OFFSET, &lock) == NULL) continue; @@ -2355,6 +2495,46 @@ pmap_protect(pmap_t pmap, vm_offset_t sv } /* + * Inserts the specified page table page into the specified pmap's collection + * of idle page table pages. Each of a pmap's page table pages is responsible + * for mapping a distinct range of virtual addresses. The pmap's collection is + * ordered by this virtual address range. + */ +static __inline int +pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + return (vm_radix_insert(&pmap->pm_root, mpte)); +} + +/* + * Looks for a page table page mapping the specified virtual address in the + * specified pmap's collection of idle page table pages. Returns NULL if there + * is no page table page corresponding to the specified virtual address. + */ +static __inline vm_page_t +pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + return (vm_radix_lookup(&pmap->pm_root, pmap_l2_pindex(va))); +} + +/* + * Removes the specified page table page from the specified pmap's collection + * of idle page table pages. The specified page table page must be a member of + * the pmap's collection. + */ +static __inline void +pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + vm_radix_remove(&pmap->pm_root, mpte->pindex); +} + +/* * Performs a break-before-make update of a pmap entry. This is needed when * either promoting or demoting pages to ensure the TLB doesn't get into an * inconsistent state. @@ -2389,6 +2569,47 @@ pmap_update_entry(pmap_t pmap, pd_entry_ } /* + * After promotion from 512 4KB page mappings to a single 2MB page mapping, + * replace the many pv entries for the 4KB page mappings by a single pv entry + * for the 2MB page mapping. + */ +static void +pmap_pv_promote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp) +{ + struct md_page *pvh; + pv_entry_t pv; + vm_offset_t va_last; + vm_page_t m; + + KASSERT((pa & L2_OFFSET) == 0, + ("pmap_pv_promote_l2: pa is not 2mpage aligned")); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); + + /* + * Transfer the first page's pv entry for this mapping to the 2mpage's + * pv list. Aside from avoiding the cost of a call to get_pv_entry(), + * a transfer avoids the possibility that get_pv_entry() calls + * reclaim_pv_chunk() and that reclaim_pv_chunk() removes one of the + * mappings that is being promoted. + */ + m = PHYS_TO_VM_PAGE(pa); + va = va & ~L2_OFFSET; + pv = pmap_pvh_remove(&m->md, pmap, va); + KASSERT(pv != NULL, ("pmap_pv_promote_l2: pv not found")); + pvh = pa_to_pvh(pa); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + pvh->pv_gen++; + /* Free the remaining NPTEPG - 1 pv entries. */ + va_last = va + L2_SIZE - PAGE_SIZE; + do { + m++; + va += PAGE_SIZE; + pmap_pvh_free(&m->md, pmap, va); + } while (va < va_last); +} + +/* * Tries to promote the 512, contiguous 4KB page mappings that are within a * single level 2 table entry to a single 2MB page mapping. For promotion * to occur, two conditions must be met: (1) the 4KB page mappings must map @@ -2400,6 +2621,7 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t struct rwlock **lockp) { pt_entry_t *firstl3, *l3, newl2, oldl3, pa; + vm_page_t mpte; vm_offset_t sva; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -2407,9 +2629,6 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t sva = va & ~L2_OFFSET; firstl3 = pmap_l2_to_l3(l2, sva); newl2 = pmap_load(firstl3); - /* Ignore managed pages for now */ - if ((newl2 & ATTR_SW_MANAGED) != 0) - return; /* Check the alingment is valid */ if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) { @@ -2431,12 +2650,36 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t pa -= PAGE_SIZE; } + /* + * Save the page table page in its current state until the L2 + * mapping the superpage is demoted by pmap_demote_l2() or + * destroyed by pmap_remove_l3(). + */ + mpte = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); + KASSERT(mpte >= vm_page_array && + mpte < &vm_page_array[vm_page_array_size], + ("pmap_promote_l2: page table page is out of range")); + KASSERT(mpte->pindex == pmap_l2_pindex(va), + ("pmap_promote_l2: page table page's pindex is wrong")); + if (pmap_insert_pt_page(pmap, mpte)) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, + "pmap_promote_l2: failure for va %#lx in pmap %p", va, + pmap); + return; + } + + if ((newl2 & ATTR_SW_MANAGED) != 0) + pmap_pv_promote_l2(pmap, va, newl2 & ~ATTR_MASK, lockp); + newl2 &= ~ATTR_DESCR_MASK; newl2 |= L2_BLOCK; pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE); atomic_add_long(&pmap_l2_promotions, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: success for va %#lx in pmap %p", va, + pmap); } /* @@ -2946,6 +3189,14 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva if (pmap_load(l2) == 0) continue; + if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) { + l3 = pmap_demote_l2(pmap, l2, sva); + if (l3 == NULL) + continue; + } + KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, + ("pmap_unwire: Invalid l2 entry after demotion")); + if (va_next > eva) va_next = eva; for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, @@ -3224,7 +3475,7 @@ pmap_remove_pages(pmap_t pmap) pd_entry_t *pde; pt_entry_t *pte, tpte; struct spglist free; - vm_page_t m; + vm_page_t m, ml3, mt; pv_entry_t pv; struct md_page *pvh; struct pv_chunk *pc, *npc; @@ -3255,6 +3506,15 @@ pmap_remove_pages(pmap_t pmap) ("Attempting to remove an unmapped page")); switch(lvl) { + case 1: + pte = pmap_l1_to_l2(pde, pv->pv_va); + tpte = pmap_load(pte); + KASSERT((tpte & ATTR_DESCR_MASK) == + L2_BLOCK, + ("Attempting to remove an invalid " + "block: %lx", tpte)); + tpte = pmap_load(pte); + break; case 2: pte = pmap_l2_to_l3(pde, pv->pv_va); tpte = pmap_load(pte); @@ -3290,10 +3550,17 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad pte %#jx", (uintmax_t)tpte)); - /* XXX: assumes tpte is level 3 */ - if (pmap_is_current(pmap) && - pmap_l3_valid_cacheable(tpte)) - cpu_dcache_wb_range(pv->pv_va, L3_SIZE); + if (pmap_is_current(pmap)) { + if (lvl == 2 && + pmap_l3_valid_cacheable(tpte)) { + cpu_dcache_wb_range(pv->pv_va, + L3_SIZE); + } else if (lvl == 1 && + pmap_pte_valid_cacheable(tpte)) { + cpu_dcache_wb_range(pv->pv_va, + L2_SIZE); + } + } pmap_load_clear(pte); PTE_SYNC(pte); pmap_invalidate_page(pmap, pv->pv_va); @@ -3304,6 +3571,10 @@ pmap_remove_pages(pmap_t pmap) if ((tpte & ATTR_AP_RW_BIT) == ATTR_AP(ATTR_AP_RW)) { switch (lvl) { + case 1: + for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) + vm_page_dirty(m); + break; case 2: vm_page_dirty(m); break; @@ -3315,6 +3586,32 @@ pmap_remove_pages(pmap_t pmap) /* Mark free */ pc->pc_map[field] |= bitmask; switch (lvl) { + case 1: + pmap_resident_count_dec(pmap, + L2_SIZE / PAGE_SIZE); + pvh = pa_to_pvh(tpte & ~ATTR_MASK); + TAILQ_REMOVE(&pvh->pv_list, pv,pv_next); + pvh->pv_gen++; + if (TAILQ_EMPTY(&pvh->pv_list)) { + for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) + if ((mt->aflags & PGA_WRITEABLE) != 0 && + TAILQ_EMPTY(&mt->md.pv_list)) + vm_page_aflag_clear(mt, PGA_WRITEABLE); + } + ml3 = pmap_lookup_pt_page(pmap, + pv->pv_va); + if (ml3 != NULL) { + pmap_remove_pt_page(pmap, ml3); + pmap_resident_count_dec(pmap,1); + KASSERT(ml3->wire_count == NL3PG, + ("pmap_remove_pages: l3 page wire count error")); + ml3->wire_count = 0; + pmap_add_delayed_free_list(ml3, + &free, FALSE); + atomic_subtract_int( + &vm_cnt.v_wire_count, 1); + } + break; case 2: pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, @@ -3998,6 +4295,8 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t * ("pmap_demote_l1: Demoting a non-block entry")); KASSERT((va & L1_OFFSET) == 0, ("pmap_demote_l1: Invalid virtual address %#lx", va)); + KASSERT((oldl1 & ATTR_SW_MANAGED) == 0, + ("pmap_demote_l1: Level 1 table shouldn't be managed")); tmpl1 = 0; if (va <= (vm_offset_t)l1 && va + L1_SIZE > (vm_offset_t)l1) { @@ -4027,6 +4326,9 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t * phys += L2_SIZE; } cpu_dcache_wb_range((vm_offset_t)l2, PAGE_SIZE); + KASSERT(l2[0] == ((oldl1 & ~ATTR_DESCR_MASK) | L3_PAGE), + ("Invalid l3 page (%lx != %lx", l2[0], + (oldl1 & ~ATTR_DESCR_MASK) | L3_PAGE)); if (tmpl1 != 0) { pmap_kenter(tmpl1, PAGE_SIZE, @@ -4058,13 +4360,12 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en int i; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + l3 = NULL; oldl2 = pmap_load(l2); KASSERT((oldl2 & ATTR_DESCR_MASK) == L2_BLOCK, ("pmap_demote_l2: Demoting a non-block entry")); KASSERT((va & L2_OFFSET) == 0, ("pmap_demote_l2: Invalid virtual address %#lx", va)); - KASSERT((oldl2 & ATTR_SW_MANAGED) == 0, - ("pmap_demote_l2: TODO: Demote managed pages")); tmpl2 = 0; if (va <= (vm_offset_t)l2 && va + L2_SIZE > (vm_offset_t)l2) { @@ -4073,11 +4374,19 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en return (NULL); } - if ((ml3 = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { - CTR2(KTR_PMAP, "pmap_demote_l2: failure for va %#lx" - " in pmap %p", va, pmap); - return (NULL); + if ((ml3 = pmap_lookup_pt_page(pmap, va)) != NULL) { + pmap_remove_pt_page(pmap, ml3); + } else { + ml3 = vm_page_alloc(NULL, pmap_l2_pindex(va), + (VIRT_IN_DMAP(va) ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (ml3 == NULL) { + CTR2(KTR_PMAP, "pmap_demote_l2: failure for va %#lx" + " in pmap %p", va, pmap); + goto fail; + } + if (va < VM_MAXUSER_ADDRESS) + pmap_resident_count_inc(pmap, 1); } l3phys = VM_PAGE_TO_PHYS(ml3); @@ -4088,25 +4397,53 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en /* The attributed from the old l2 table to be copied */ newl3 = (oldl2 & (ATTR_MASK & ~ATTR_DESCR_MASK)) | L3_PAGE; - /* Create the new entries */ - for (i = 0; i < Ln_ENTRIES; i++) { - l3[i] = newl3 | phys; - phys += L3_SIZE; - } - cpu_dcache_wb_range((vm_offset_t)l3, PAGE_SIZE); + /* + * If the page table page is new, initialize it. + */ + if (ml3->wire_count == 1) { + for (i = 0; i < Ln_ENTRIES; i++) { + l3[i] = newl3 | phys; + phys += L3_SIZE; + } + cpu_dcache_wb_range((vm_offset_t)l3, PAGE_SIZE); + } + KASSERT(l3[0] == ((oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE), + ("Invalid l3 page (%lx != %lx", l3[0], + (oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE)); + /* + * Map the temporary page so we don't lose access to the l2 table. + */ if (tmpl2 != 0) { pmap_kenter(tmpl2, PAGE_SIZE, DMAP_TO_PHYS((vm_offset_t)l2) & ~L3_OFFSET, CACHED_MEMORY); l2 = (pt_entry_t *)(tmpl2 + ((vm_offset_t)l2 & PAGE_MASK)); } + /* + * The spare PV entries must be reserved prior to demoting the + * mapping, that is, prior to changing the PDE. Otherwise, the state + * of the L2 and the PV lists will be inconsistent, which can result + * in reclaim_pv_chunk() attempting to remove a PV entry from the + * wrong PV list and pmap_pv_demote_l2() failing to find the expected + * PV entry for the 2MB page mapping that is being demoted. + */ + if ((oldl2 & ATTR_SW_MANAGED) != 0) + reserve_pv_entries(pmap, Ln_ENTRIES - 1, lockp); + pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE); + /* + * Demote the PV entry. + */ + if ((oldl2 & ATTR_SW_MANAGED) != 0) + pmap_pv_demote_l2(pmap, va, oldl2 & ~ATTR_MASK, lockp); + atomic_add_long(&pmap_l2_demotions, 1); CTR3(KTR_PMAP, "pmap_demote_l2: success for va %#lx" " in pmap %p %lx", va, pmap, l3[0]); +fail: if (tmpl2 != 0) { pmap_kremove(tmpl2); kva_free(tmpl2, PAGE_SIZE); From owner-svn-src-head@freebsd.org Wed Aug 24 13:00:52 2016 Return-Path: Delivered-To: svn-src-head@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 311DBBC4679; Wed, 24 Aug 2016 13:00:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009E21EC0; Wed, 24 Aug 2016 13:00:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OD0pJQ030440; Wed, 24 Aug 2016 13:00:51 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OD0pF2030439; Wed, 24 Aug 2016 13:00:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608241300.u7OD0pF2030439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 24 Aug 2016 13:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304750 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 13:00:52 -0000 Author: andrew Date: Wed Aug 24 13:00:50 2016 New Revision: 304750 URL: https://svnweb.freebsd.org/changeset/base/304750 Log: Allow superpages on arm64 to be enabled. It is disabled for now to allow for more testing across more hardware. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Aug 24 12:57:40 2016 (r304749) +++ head/sys/arm64/arm64/pmap.c Wed Aug 24 13:00:50 2016 (r304750) @@ -242,7 +242,7 @@ extern pt_entry_t pagetable_dmap[]; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -static int superpages_enabled = 1; +static int superpages_enabled = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &superpages_enabled, 0, "Are large page mappings enabled?"); @@ -2939,15 +2939,12 @@ validate: if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) cpu_icache_sync_range(va, PAGE_SIZE); - /* XXX: Not yet, not all demotions are handled */ -#if 0 if ((mpte == NULL || mpte->wire_count == NL3PG) && pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); pmap_promote_l2(pmap, pde, va, &lock); } -#endif if (lock != NULL) rw_wunlock(lock); From owner-svn-src-head@freebsd.org Wed Aug 24 15:13:43 2016 Return-Path: Delivered-To: svn-src-head@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 BA941BC4A64; Wed, 24 Aug 2016 15:13:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B3671F56; Wed, 24 Aug 2016 15:13:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OFDgXw083543; Wed, 24 Aug 2016 15:13:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OFDg8e083542; Wed, 24 Aug 2016 15:13:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608241513.u7OFDg8e083542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 24 Aug 2016 15:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304751 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 15:13:43 -0000 Author: mav Date: Wed Aug 24 15:13:42 2016 New Revision: 304751 URL: https://svnweb.freebsd.org/changeset/base/304751 Log: Fix minor copy/paste bug. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Aug 24 13:00:50 2016 (r304750) +++ head/sbin/camcontrol/camcontrol.c Wed Aug 24 15:13:42 2016 (r304751) @@ -7515,7 +7515,7 @@ smpphycontrol(struct cam_device *device, response = malloc(sizeof(*response)); if (response == NULL) { warn("%s: unable to allocate %zd bytes", __func__, - sizeof(*request)); + sizeof(*response)); retval = 1; goto bailout; } From owner-svn-src-head@freebsd.org Wed Aug 24 15:36:50 2016 Return-Path: Delivered-To: svn-src-head@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 3822BBC43AC; Wed, 24 Aug 2016 15:36:50 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 079B8139C; Wed, 24 Aug 2016 15:36:49 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OFanpj091421; Wed, 24 Aug 2016 15:36:49 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OFaniZ091420; Wed, 24 Aug 2016 15:36:49 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608241536.u7OFaniZ091420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 24 Aug 2016 15:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304752 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 15:36:50 -0000 Author: ache Date: Wed Aug 24 15:36:48 2016 New Revision: 304752 URL: https://svnweb.freebsd.org/changeset/base/304752 Log: Bump __FreeBSD_version for LC_*_MASK fix for newlocale(3) and querylocale(3) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Aug 24 15:13:42 2016 (r304751) +++ head/sys/sys/param.h Wed Aug 24 15:36:48 2016 (r304752) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Aug 24 16:30:16 2016 Return-Path: Delivered-To: svn-src-head@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 F019ABC34B4; Wed, 24 Aug 2016 16:30:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A880213C7; Wed, 24 Aug 2016 16:30:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OGUFBl010106; Wed, 24 Aug 2016 16:30:15 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OGUFTp010105; Wed, 24 Aug 2016 16:30:15 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608241630.u7OGUFTp010105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 24 Aug 2016 16:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304753 - head/sys/cddl/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 16:30:17 -0000 Author: tsoome Date: Wed Aug 24 16:30:15 2016 New Revision: 304753 URL: https://svnweb.freebsd.org/changeset/base/304753 Log: Bug 212114 - loader: zio_checksum_verify() must test spa for NULL pointer The issue was introduced with adding support for salted checksums, and was revealed by bhyve userboot.so. During pool discovery the loader is reading pool label from disks, and at that time the spa structure is not yet set up, so the NULL pointer is passed for spa. This condition must be checked to avoid the corruption of the memory and NULL pointer dereference. PR: 212114 Reported by: tsoome@freebsd.com Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7634 Modified: head/sys/cddl/boot/zfs/zfssubr.c Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Wed Aug 24 15:36:48 2016 (r304752) +++ head/sys/cddl/boot/zfs/zfssubr.c Wed Aug 24 16:30:15 2016 (r304753) @@ -270,6 +270,7 @@ zio_checksum_verify(const spa_t *spa, co uint64_t size; unsigned int checksum; zio_checksum_info_t *ci; + void *ctx = NULL; zio_cksum_t actual_cksum, expected_cksum, verifier; int byteswap; @@ -282,7 +283,11 @@ zio_checksum_verify(const spa_t *spa, co if (ci->ci_func[0] == NULL || ci->ci_func[1] == NULL) return (EINVAL); - zio_checksum_template_init(checksum, (spa_t *) spa); + if (spa != NULL) { + zio_checksum_template_init(checksum, (spa_t *) spa); + ctx = spa->spa_cksum_tmpls[checksum]; + } + if (ci->ci_flags & ZCHECKSUM_FLAG_EMBEDDED) { zio_eck_t *eck; @@ -306,8 +311,7 @@ zio_checksum_verify(const spa_t *spa, co expected_cksum = eck->zec_cksum; eck->zec_cksum = verifier; - ci->ci_func[byteswap](data, size, - spa->spa_cksum_tmpls[checksum], &actual_cksum); + ci->ci_func[byteswap](data, size, ctx, &actual_cksum); eck->zec_cksum = expected_cksum; if (byteswap) @@ -315,8 +319,7 @@ zio_checksum_verify(const spa_t *spa, co sizeof (zio_cksum_t)); } else { expected_cksum = bp->blk_cksum; - ci->ci_func[0](data, size, spa->spa_cksum_tmpls[checksum], - &actual_cksum); + ci->ci_func[0](data, size, ctx, &actual_cksum); } if (!ZIO_CHECKSUM_EQUAL(actual_cksum, expected_cksum)) { From owner-svn-src-head@freebsd.org Wed Aug 24 16:40:31 2016 Return-Path: Delivered-To: svn-src-head@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 20667BC3737; Wed, 24 Aug 2016 16:40:31 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E463C192A; Wed, 24 Aug 2016 16:40:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OGeUxs013750; Wed, 24 Aug 2016 16:40:30 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OGeUNo013749; Wed, 24 Aug 2016 16:40:30 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608241640.u7OGeUNo013749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 24 Aug 2016 16:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304754 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 16:40:31 -0000 Author: tsoome Date: Wed Aug 24 16:40:29 2016 New Revision: 304754 URL: https://svnweb.freebsd.org/changeset/base/304754 Log: Bug 212038 - svn commit: r304321 broken bhyve zvol VM bhyveload hang 100% WCPU As the support for large blocks was enabled in loader zfs code, the heap in userboot was left not changed, resulting with failure of detecting and accessing zfs pools for bhyve virtual machines. This fix does set the heap to use same amount of memory as the zfsloader is using. To make it possible to test and verify loader functions, bhyve is providing very useful option, but it also means, we like to keep feature parity with [zfs]loader as close as possible. PR: 212038 Reported by: dfh0522@gmail.com Reviewed by: allanjude, grehan Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7635 Modified: head/sys/boot/userboot/userboot/main.c Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Wed Aug 24 16:30:15 2016 (r304753) +++ head/sys/boot/userboot/userboot/main.c Wed Aug 24 16:40:29 2016 (r304754) @@ -46,7 +46,7 @@ static int userboot_zfs_found; /* Minimum version required */ #define USERBOOT_VERSION USERBOOT_VERSION_3 -#define MALLOCSZ (10*1024*1024) +#define MALLOCSZ (64*1024*1024) struct loader_callbacks *callbacks; void *callbacks_arg; From owner-svn-src-head@freebsd.org Wed Aug 24 16:44:28 2016 Return-Path: Delivered-To: svn-src-head@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 A9FA5BC397D; Wed, 24 Aug 2016 16:44:28 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7A2551E25; Wed, 24 Aug 2016 16:44:28 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OGiRNP017367; Wed, 24 Aug 2016 16:44:27 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OGiR4r017366; Wed, 24 Aug 2016 16:44:27 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608241644.u7OGiR4r017366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 24 Aug 2016 16:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304755 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 16:44:28 -0000 Author: ache Date: Wed Aug 24 16:44:27 2016 New Revision: 304755 URL: https://svnweb.freebsd.org/changeset/base/304755 Log: Use current locale (f.e. set by thread). It was global locale always previously. MFC after: 7 days Modified: head/lib/libc/nls/msgcat.c Modified: head/lib/libc/nls/msgcat.c ============================================================================== --- head/lib/libc/nls/msgcat.c Wed Aug 24 16:40:29 2016 (r304754) +++ head/lib/libc/nls/msgcat.c Wed Aug 24 16:44:27 2016 (r304755) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -56,7 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -#include "../locale/setlocale.h" /* for ENCODING_LEN */ +#include "../locale/xlocale_private.h" #define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" @@ -115,9 +114,10 @@ catopen(const char *name, int type) { struct stat sbuf; struct catentry *np; - char *base, *cptr, *cptr1, *lang, *nlspath, *pathP, *pcode; - char *plang, *pter, *tmpptr; + char *base, *cptr, *cptr1, *nlspath, *pathP, *pcode; + char *plang, *pter; int saverr, spcleft; + const char *lang, *tmpptr; char path[PATH_MAX]; /* sanity checking */ @@ -129,7 +129,7 @@ catopen(const char *name, int type) lang = NULL; else { if (type == NL_CAT_LOCALE) - lang = setlocale(LC_MESSAGES, NULL); + lang = querylocale(LC_MESSAGES_MASK, __get_locale()); else lang = getenv("LANG"); From owner-svn-src-head@freebsd.org Wed Aug 24 16:49:15 2016 Return-Path: Delivered-To: svn-src-head@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 47741BC3B0B; Wed, 24 Aug 2016 16:49:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11DA61336; Wed, 24 Aug 2016 16:49:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OGnE0e017564; Wed, 24 Aug 2016 16:49:14 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OGnECp017563; Wed, 24 Aug 2016 16:49:14 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201608241649.u7OGnECp017563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 24 Aug 2016 16:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304756 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 16:49:15 -0000 Author: nwhitehorn Date: Wed Aug 24 16:49:14 2016 New Revision: 304756 URL: https://svnweb.freebsd.org/changeset/base/304756 Log: Close a race when making the CPU idle under pHyp. If an interrupt occurs between the beginning of the idle function and actually going idle, the CPU could go to sleep with pending work. MFC after: 1 month Modified: head/sys/powerpc/pseries/platform_chrp.c Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Wed Aug 24 16:44:27 2016 (r304755) +++ head/sys/powerpc/pseries/platform_chrp.c Wed Aug 24 16:49:14 2016 (r304756) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -492,7 +493,18 @@ chrp_reset(platform_t platform) static void phyp_cpu_idle(sbintime_t sbt) { - phyp_hcall(H_CEDE); + register_t msr; + + msr = mfmsr(); + + mtmsr(msr & ~PSL_EE); + if (sched_runnable()) { + mtmsr(msr); + return; + } + + phyp_hcall(H_CEDE); /* Re-enables interrupts internally */ + mtmsr(msr); } static void From owner-svn-src-head@freebsd.org Wed Aug 24 17:15:33 2016 Return-Path: Delivered-To: svn-src-head@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 A7062BC56E1; Wed, 24 Aug 2016 17:15:33 +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 73D541A93; Wed, 24 Aug 2016 17:15:33 +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 u7OHFWn1028635; Wed, 24 Aug 2016 17:15:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OHFWKC028634; Wed, 24 Aug 2016 17:15:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608241715.u7OHFWKC028634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 24 Aug 2016 17:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304757 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 17:15:33 -0000 Author: emaste Date: Wed Aug 24 17:15:32 2016 New Revision: 304757 URL: https://svnweb.freebsd.org/changeset/base/304757 Log: Don't build libdevdctl if MK_CXX is no Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Aug 24 16:49:14 2016 (r304756) +++ head/lib/Makefile Wed Aug 24 17:15:32 2016 (r304757) @@ -43,7 +43,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libcompat \ libcrypt \ libdevctl \ - libdevdctl \ + ${_libdevdctl} \ libdevinfo \ libdevstat \ libdpv \ @@ -187,6 +187,10 @@ _clang= clang _cuse= libcuse .endif +.if ${MK_CXX} != "no" +_libdevdctl= libdevdctl +.endif + .if ${MK_TOOLCHAIN} != "no" _libelftc= libelftc _libpe= libpe From owner-svn-src-head@freebsd.org Wed Aug 24 17:26:12 2016 Return-Path: Delivered-To: svn-src-head@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 31959BC59FC; Wed, 24 Aug 2016 17:26:12 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0F8781383; Wed, 24 Aug 2016 17:26:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OHQB75032273; Wed, 24 Aug 2016 17:26:11 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OHQBCu032272; Wed, 24 Aug 2016 17:26:11 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608241726.u7OHQBCu032272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 24 Aug 2016 17:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304758 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 17:26:12 -0000 Author: bde Date: Wed Aug 24 17:26:11 2016 New Revision: 304758 URL: https://svnweb.freebsd.org/changeset/base/304758 Log: Reorganise a little to prepare for locking fixes: - in sccnopen(), open the keyboard before the screen. The keyboard currently requires Giant (although it must be spinlocked to work correctly as a console), so the previous order would be a LOR if it has any semblance of locking. - add a (currently dummy) state arg to scgetc(). Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Aug 24 17:15:32 2016 (r304757) +++ head/sys/dev/syscons/syscons.c Wed Aug 24 17:26:11 2016 (r304758) @@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$"); #include #include +struct sc_cnstate; /* not used yet */ + #define COLD 0 #define WARM 1 @@ -185,7 +187,7 @@ static void scterm(int unit, int flags); static void scshutdown(void *, int); static void scsuspend(void *); static void scresume(void *); -static u_int scgetc(sc_softc_t *sc, u_int flags); +static u_int scgetc(sc_softc_t *sc, u_int flags, struct sc_cnstate *sp); static void sc_puts(scr_stat *scp, u_char *buf, int len, int kernel); #define SCGETC_CN 1 #define SCGETC_NONBLOCK 2 @@ -750,7 +752,7 @@ sckbdevent(keyboard_t *thiskbd, int even * I don't think this is nessesary, and it doesn't fix * the Xaccel-2.1 keyboard hang, but it can't hurt. XXX */ - while ((c = scgetc(sc, SCGETC_NONBLOCK)) != NOKEY) { + while ((c = scgetc(sc, SCGETC_NONBLOCK, NULL)) != NOKEY) { cur_tty = SC_DEV(sc, sc->cur_scp->index); if (!tty_opened_ns(cur_tty)) @@ -1645,7 +1647,6 @@ sc_cnterm(struct consdev *cp) sc_console = NULL; } -struct sc_cnstate; /* not used yet */ static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp); static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags); @@ -1654,14 +1655,8 @@ sccnopen(sc_softc_t *sc, struct sc_cnsta { int kbd_mode; - if (!cold && - sc->cur_scp->index != sc_console->index && - sc->cur_scp->smode.mode == VT_AUTO && - sc_console->smode.mode == VT_AUTO) - sc_switch_scr(sc, sc_console->index); - if (sc->kbd == NULL) - return; + goto over_keyboard; /* * Make sure the keyboard is accessible even when the kbd device @@ -1673,6 +1668,14 @@ sccnopen(sc_softc_t *sc, struct sc_cnsta kbd_mode = K_XLATE; (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); kbdd_poll(sc->kbd, TRUE); +over_keyboard: ; + + if (!cold && + sc->cur_scp->index != sc_console->index && + sc->cur_scp->smode.mode == VT_AUTO && + sc_console->smode.mode == VT_AUTO) + sc_switch_scr(sc, sc_console->index); + } static void @@ -1787,7 +1790,7 @@ sc_cngetc(struct consdev *cd) return -1; } - c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK); + c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK, NULL); switch (KEYFLAGS(c)) { case 0: /* normal char */ @@ -3383,7 +3386,7 @@ sc_init_emulator(scr_stat *scp, char *na * return NOKEY if there is nothing there. */ static u_int -scgetc(sc_softc_t *sc, u_int flags) +scgetc(sc_softc_t *sc, u_int flags, struct sc_cnstate *sp) { scr_stat *scp; #ifndef SC_NO_HISTORY From owner-svn-src-head@freebsd.org Wed Aug 24 18:06:39 2016 Return-Path: Delivered-To: svn-src-head@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 3C168BC486B; Wed, 24 Aug 2016 18:06:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 23BA1120E; Wed, 24 Aug 2016 18:06:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 179821706; Wed, 24 Aug 2016 18:06:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D76061A6EA; Wed, 24 Aug 2016 18:06:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id KFNKWgHLcJCp; Wed, 24 Aug 2016 18:06:33 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8BB7F1A6E4 To: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jilles@FreeBSD.org References: <201608120703.u7C73whf007189@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 24 Aug 2016 11:06:32 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608120703.u7C73whf007189@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5JJ1vNJMdtrVfE1bWEte5sJbcUmPNgvMx" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:06:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5JJ1vNJMdtrVfE1bWEte5sJbcUmPNgvMx Content-Type: multipart/mixed; boundary="kMGWq1BCq8WCPNaxK2TWuMqn10H8hpRfu" From: Bryan Drewery To: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jilles@FreeBSD.org Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> In-Reply-To: <201608120703.u7C73whf007189@repo.freebsd.org> --kMGWq1BCq8WCPNaxK2TWuMqn10H8hpRfu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/12/16 12:03 AM, Ed Schouten wrote: > Author: ed > Date: Fri Aug 12 07:03:58 2016 > New Revision: 303988 > URL: https://svnweb.freebsd.org/changeset/base/303988 >=20 > Log: > Reimplement dirname(3) to be thread-safe. > =20 > Now that we've updated the prototypes of the basename(3) and dirname(= 3) > functions to conform to POSIX, let's go ahead and reimplement dirname= (3) > in such a way that it's thread-safe, but also guaranteed to succeed. = C > libraries like glibc, musl and the one that's part of Solaris already= > follow such an approach. > =20 > Move the existing implementation to another source file, > freebsd11_dirname.c to keep existing users of the API that pass in a > constant string happy, using symbol versioning. > =20 > Put a new version of the function in dirname.c, obtained from CloudAB= I's > C library. This version scans through the pathname string from left t= o > right, normalizing it, while discarding the last pathname component. > =20 > Reviewed by: emaste, jilles > Differential Revision: https://reviews.freebsd.org/D7355 >=20 > Added: > head/lib/libc/gen/dirname_compat.c > - copied, changed from r303452, head/lib/libc/gen/dirname.c > Modified: > head/lib/libc/gen/Makefile.inc > head/lib/libc/gen/Symbol.map > head/lib/libc/gen/dirname.3 > head/lib/libc/gen/dirname.c >=20 [...] >=20 > Copied and modified: head/lib/libc/gen/dirname_compat.c (from r303452, = head/lib/libc/gen/dirname.c) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/gen/dirname.c Thu Jul 28 16:54:12 2016 (r303452, copy= source) > +++ head/lib/libc/gen/dirname_compat.c Fri Aug 12 07:03:58 2016 (r30398= 8) > @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); > #include > =20 > char * > -dirname(char *path) > +__freebsd11_dirname(char *path) > { > static char *dname =3D NULL; > size_t len; > @@ -75,3 +75,5 @@ dirname(char *path) > dname[len] =3D '\0'; > return (dname); > } > + > +__sym_compat(dirname, __freebsd11_dirname, FBSD_1.0); >=20 This creates an interesting situation [1] that breaks building older sources and installing them into a chroot. The dirname@FBSD_1.0 is _not_ used in this case and isn't expected to be. This is coming up most often lately for nanonbsd and staged installs. Example scenario: Host: Head after this commit Src: stable/9 Building to install on another system over NFS or chroot to tar, whatever. Not trying to downgrade the host (though one report was trying this too). Buildworld builds usr.bin/xinstall in the bootstrap-tools phase *for the host* to run during the build and to use for installation later in installworld. This uses *the host libc* and picks up the new dirname@FBSD_1.5 symbol. The reasoning for this is so we can add new flags into the build that install needs and have a newly boostrapped xinstall to use them. I mimiced this by building a releng/11.0 xinstall from head but the result is the same for building an older stable/9: > # readelf -a /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall | = grep dirname > 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 dirname = + 0 > 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@FBSD= _1.5 (3) > 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@@FBS= D_1.5 Stable/9 too: > ~/svn/stable/9/usr.bin/xinstall # readelf -a $(make whereobj)/xinstall = | grep dirname > 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 dirname = + 0 > 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@FBSD= _1.5 (3) > 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@@FBS= D_1.5 The xinstall being built lacks the fix to expect dirname/basename to modify its arguments (r303450). So later when the *old* xinstall runs with *new host libc* in installworld it gets the wrong result from basename/dirname: > ~/git/freebsd/lib/libcxxrt # INSTALL=3D/usr/obj/root/svn/releng/11.0/us= r.bin/xinstall/xinstall make install DESTDIR=3D/tmp/blah > /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o root -g = wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ > /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o root -g = wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ > /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -s -o root -g = wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ > /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -o root -g whe= el -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/ > /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -l rs /tmp/bla= h/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so > xinstall: symlink ../../lib/libcxxrt.so.1 -> /tmp/blah/usr/lib: File ex= ists > *** Error code 71 So how can we fix? We can't expect older builds to expect basename(3)/dirname(3) to change arguments. We could fix the tips of branches and all relengs/, but not non-tips and I doubt so@ would care to EN something into all relengs/. Nor can we change the xinstall bootstrapping in older builds for the same reasons. We need a fix in head to handle this but I don't have any ideas currently. Interestingly I have an older stable/10 build that has an xinstall before the dirname version was moved and it works fine as it is defaulting to FBSD_1.0: > # readelf -a /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install | g= rep dirname > 112: 00000000006f4160 8 OBJECT LOCAL DEFAULT 15 dirname.dnam= e > 1893: 000000000040d950 268 FUNC GLOBAL DEFAULT 3 dirname > ~/git/freebsd/lib/libcxxrt # INSTALL=3D/usr/obj/root/svn/stable/10/tmp/= legacy/usr/bin/install make install DESTDIR=3D/tmp/blah > /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o root -g w= heel -m 444 libcxxrt.a /tmp/blah/usr/lib/ > /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o root -g w= heel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ > /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -s -o root -g w= heel -m 444 libcxxrt.so.1 /tmp/blah/lib/ > /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -o root -g whee= l -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/ > /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -l rs /tmp/blah= /lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so But as soon as I do another buildworld on that checkout it will break the binary. [1] https://lists.freebsd.org/pipermail/freebsd-current/2016-August/063023.ht= ml --=20 Regards, Bryan Drewery --kMGWq1BCq8WCPNaxK2TWuMqn10H8hpRfu-- --5JJ1vNJMdtrVfE1bWEte5sJbcUmPNgvMx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXveIpAAoJEDXXcbtuRpfPM8AH/0flfVs7ViHCk4GatAANnQUn 0op9GHb0zMhDXcMnly8Lx/IMIBQkLlPZPL7WGJTyCFMgh0VbgZE9KKsD0YHvM0r/ z/NC+9MXnqQK0pzQ4cuKSjuqnjs/Y7x6Rlrey/q75qJwEGB5jBnxV2mubLqpFH5t WcQhy16tdF3cGA7u6mxudxAoMX9uM8PKQJS9STC8wG+Rp1EAs22UqJhRk72YxQZI cJOjeztW5WAdha7XHEXiiIFHaMdO4mCaAr9jOVbk5XLv17WYw1ftbtZSA9joyzyB oP+6LWT59MmyTMnP8Vq7QS7ouMioKYR6EO/KLRudgKWa6fOCAZDTRI5hxjz7tic= =q7KX -----END PGP SIGNATURE----- --5JJ1vNJMdtrVfE1bWEte5sJbcUmPNgvMx-- From owner-svn-src-head@freebsd.org Wed Aug 24 18:15:07 2016 Return-Path: Delivered-To: svn-src-head@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 BF6BFBC4DEC; Wed, 24 Aug 2016 18:15:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A2D931C0B; Wed, 24 Aug 2016 18:15:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 947881C8B; Wed, 24 Aug 2016 18:15:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 479CC1A753; Wed, 24 Aug 2016 18:15:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id i6saX_oUbrby; Wed, 24 Aug 2016 18:14:53 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5D9D41A747 To: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jilles@FreeBSD.org References: <201608120703.u7C73whf007189@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> Date: Wed, 24 Aug 2016 11:14:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UUORrO2PcT4TggUvbSEaPbri6KAKR8DNf" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:15:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UUORrO2PcT4TggUvbSEaPbri6KAKR8DNf Content-Type: multipart/mixed; boundary="03tp5HJPoQK4vGt2F9Mff9hb8JOaMtpH4" From: Bryan Drewery To: Ed Schouten , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jilles@FreeBSD.org Message-ID: <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> In-Reply-To: --03tp5HJPoQK4vGt2F9Mff9hb8JOaMtpH4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/24/16 11:06 AM, Bryan Drewery wrote: > On 8/12/16 12:03 AM, Ed Schouten wrote: >> Author: ed >> Date: Fri Aug 12 07:03:58 2016 >> New Revision: 303988 >> URL: https://svnweb.freebsd.org/changeset/base/303988 >> >> Log: >> Reimplement dirname(3) to be thread-safe. >> =20 >> Now that we've updated the prototypes of the basename(3) and dirname= (3) >> functions to conform to POSIX, let's go ahead and reimplement dirnam= e(3) >> in such a way that it's thread-safe, but also guaranteed to succeed.= C >> libraries like glibc, musl and the one that's part of Solaris alread= y >> follow such an approach. >> =20 >> Move the existing implementation to another source file, >> freebsd11_dirname.c to keep existing users of the API that pass in a= >> constant string happy, using symbol versioning. >> =20 >> Put a new version of the function in dirname.c, obtained from CloudA= BI's >> C library. This version scans through the pathname string from left = to >> right, normalizing it, while discarding the last pathname component.= >> =20 >> Reviewed by: emaste, jilles >> Differential Revision: https://reviews.freebsd.org/D7355 >> >> Added: >> head/lib/libc/gen/dirname_compat.c >> - copied, changed from r303452, head/lib/libc/gen/dirname.c >> Modified: >> head/lib/libc/gen/Makefile.inc >> head/lib/libc/gen/Symbol.map >> head/lib/libc/gen/dirname.3 >> head/lib/libc/gen/dirname.c >> >=20 > [...] >=20 >> >> Copied and modified: head/lib/libc/gen/dirname_compat.c (from r303452,= head/lib/libc/gen/dirname.c) >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/libc/gen/dirname.c Thu Jul 28 16:54:12 2016 (r303452, cop= y source) >> +++ head/lib/libc/gen/dirname_compat.c Fri Aug 12 07:03:58 2016 (r3039= 88) >> @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); >> #include >> =20 >> char * >> -dirname(char *path) >> +__freebsd11_dirname(char *path) >> { >> static char *dname =3D NULL; >> size_t len; >> @@ -75,3 +75,5 @@ dirname(char *path) >> dname[len] =3D '\0'; >> return (dname); >> } >> + >> +__sym_compat(dirname, __freebsd11_dirname, FBSD_1.0); >> >=20 > This creates an interesting situation [1] that breaks building older > sources and installing them into a chroot. The dirname@FBSD_1.0 is > _not_ used in this case and isn't expected to be. This is coming up > most often lately for nanonbsd and staged installs. >=20 > Example scenario: >=20 > Host: Head after this commit > Src: stable/9 > Building to install on another system over NFS or chroot to tar, > whatever. Not trying to downgrade the host (though one report was tryin= g > this too). >=20 > Buildworld builds usr.bin/xinstall in the bootstrap-tools phase *for th= e > host* to run during the build and to use for installation later in > installworld. This uses *the host libc* and picks up the new > dirname@FBSD_1.5 symbol. >=20 > The reasoning for this is so we can add new flags into the build that > install needs and have a newly boostrapped xinstall to use them. >=20 > I mimiced this by building a releng/11.0 xinstall from head but the > result is the same for building an older stable/9: >=20 >> # readelf -a /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall |= grep dirname >> 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 dirname= + 0 >> 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@FBS= D_1.5 (3) >> 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@@FB= SD_1.5 >=20 > Stable/9 too: >> ~/svn/stable/9/usr.bin/xinstall # readelf -a $(make whereobj)/xinstall= | grep dirname >> 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 dirname= + 0 >> 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@FBS= D_1.5 (3) >> 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@@FB= SD_1.5 >=20 >=20 > The xinstall being built lacks the fix to expect dirname/basename to > modify its arguments (r303450). >=20 > So later when the *old* xinstall runs with *new host libc* in > installworld it gets the wrong result from basename/dirname: >=20 >> ~/git/freebsd/lib/libcxxrt # INSTALL=3D/usr/obj/root/svn/releng/11.0/u= sr.bin/xinstall/xinstall make install DESTDIR=3D/tmp/blah >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o root -g= wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o root -g= wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -s -o root -g= wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -o root -g wh= eel -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/ >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -l rs /tmp/bl= ah/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so >> xinstall: symlink ../../lib/libcxxrt.so.1 -> /tmp/blah/usr/lib: File e= xists >> *** Error code 71 >=20 >=20 > So how can we fix? >=20 > We can't expect older builds to expect basename(3)/dirname(3) to change= > arguments. We could fix the tips of branches and all relengs/, but not= > non-tips and I doubt so@ would care to EN something into all relengs/. > Nor can we change the xinstall bootstrapping in older builds for the > same reasons. We need a fix in head to handle this but I don't have an= y > ideas currently. >=20 >=20 > Interestingly I have an older stable/10 build that has an xinstall > before the dirname version was moved and it works fine as it is > defaulting to FBSD_1.0: >=20 >> # readelf -a /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install | = grep dirname >> 112: 00000000006f4160 8 OBJECT LOCAL DEFAULT 15 dirname.dna= me >> 1893: 000000000040d950 268 FUNC GLOBAL DEFAULT 3 dirname >=20 >> ~/git/freebsd/lib/libcxxrt # INSTALL=3D/usr/obj/root/svn/stable/10/tmp= /legacy/usr/bin/install make install DESTDIR=3D/tmp/blah >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o root -g = wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o root -g = wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -s -o root -g = wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -o root -g whe= el -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/ >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -l rs /tmp/bla= h/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so >=20 > But as soon as I do another buildworld on that checkout it will break > the binary. >=20 > [1] > https://lists.freebsd.org/pipermail/freebsd-current/2016-August/063023.= html >=20 I'm drawing blanks, hoping someone else has an idea. Otherwise I think we should revert this until a solution is thought up. Even putting a safe dirname(3)/basename(3) in xinstall won't help for the same reasons as listed. --=20 Regards, Bryan Drewery --03tp5HJPoQK4vGt2F9Mff9hb8JOaMtpH4-- --UUORrO2PcT4TggUvbSEaPbri6KAKR8DNf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXveQdAAoJEDXXcbtuRpfPE8gIAKI1akGr9m3rY7uHDMBlVI7S TpuhlkRz25li4MxITPV+Q7EBp9GIqDuaYrGIc1eP0VyX2NY+G0QS1m3qjv/nJhBL 4flfvIOFsrGNGOkYXgzVifMAyZPTb4debR3y+VhkCC1Eokyapxyb4QPTXyX/vfZb +jOK1Knpm6SJzJprbmc2kFt6Q5obssIfXPZllXCYlBdzea7AwA0XeRabjebVEQBQ +dWG4XcFPI0TITMZTCXA/OpdPb9/NUCVECYVpMtfSp5h+wDT69WvGM4393Q9tEkc lDfQJJ0b0hHWIYRJZCLjPBSPEBPBF/HXT08yj4NCj5OLGmFJelZTyAu4T3VaTB4= =XqLt -----END PGP SIGNATURE----- --UUORrO2PcT4TggUvbSEaPbri6KAKR8DNf-- From owner-svn-src-head@freebsd.org Wed Aug 24 18:27:55 2016 Return-Path: Delivered-To: svn-src-head@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 8ABBABC512B for ; Wed, 24 Aug 2016 18:27:55 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57F191721 for ; Wed, 24 Aug 2016 18:27:55 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x235.google.com with SMTP id u134so15288244ywg.3 for ; Wed, 24 Aug 2016 11:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+zRUxIXDA772R7AmgP6pABjowu76nbQ+u0VlfoVN288=; b=z9/X3i7TPDWT2eSJF75j82/MOkANiXjECK9m+omICE0wbKSop2A6fyE1XJiEaybD6i i75ZCML509tKjEGL1JnKbK1EroM+gPSa7YVkczSyrm31l9TAuFjztpPRKDouPEsFB6It kQkQoX4x7yVzAMeJOmRneH3nHUoA2kbU4b3/jGiD+SE7+5GGyxkleKVD5CkfnWdNkWXg eGL+T5fC8VOV6AKIgLGyW5DfLt67m/a+HwOVWiDX4K4AIIeIjt1dq7kJhjHjXuHdd5gy rW8UEEeBRdejojaquZLjZMLOYaOW3WBUwkM55UK6KB9qpRU1iYww3I7LpC07jxpOp0yX JwLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+zRUxIXDA772R7AmgP6pABjowu76nbQ+u0VlfoVN288=; b=TQB0TIXOGT/skLnxMFDJJct29Wb9ZKLwwqDjn1RIgV2X+zuGVArHHaOcDYCYu5pCy7 bfo4qLWLawHKwZhxpK5nw0hx3IqWe5F16mgvqB3Rmr7i0fmgTRg+ApFpHGq+BbsyAyaI 6qXWYWI7LEsP0gL4lYyryCpJ0tISWigHM3UXDSwFzynEaY6vIKqWeCCOZV1yoAEfjMZY 2xtwVpgAdHGReYkd62VorDTlI+18dMfZwKNmrW3LuV8QakOkbcc4TRzaHtApmzmdLBTe s+viTDnxbMU2iOSh3FSuj3oU/cQmjidua1WUNUUvyhX01KJlR2kUH5r0lZnWky5tRLFd WYCw== X-Gm-Message-State: AE9vXwNDDYEyNsO1PliIMZlnEvToR2VxeRB0PfkXdNd0kvbDQQgAUp+3JPOPqC1Pld7GP16ZIP7OuOu8CHsMng== X-Received: by 10.129.122.7 with SMTP id v7mr3590714ywc.219.1472063274287; Wed, 24 Aug 2016 11:27:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Wed, 24 Aug 2016 11:27:53 -0700 (PDT) Received: by 10.13.201.71 with HTTP; Wed, 24 Aug 2016 11:27:53 -0700 (PDT) In-Reply-To: <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> From: Ed Schouten Date: Wed, 24 Aug 2016 20:27:53 +0200 Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:27:55 -0000 Hi Bryan, We could solve this by simple mfcing the change I made for xinstall, right? Ed On 24 Aug 2016 20:15, "Bryan Drewery" wrote: > On 8/24/16 11:06 AM, Bryan Drewery wrote: > > On 8/12/16 12:03 AM, Ed Schouten wrote: > >> Author: ed > >> Date: Fri Aug 12 07:03:58 2016 > >> New Revision: 303988 > >> URL: https://svnweb.freebsd.org/changeset/base/303988 > >> > >> Log: > >> Reimplement dirname(3) to be thread-safe. > >> > >> Now that we've updated the prototypes of the basename(3) and > dirname(3) > >> functions to conform to POSIX, let's go ahead and reimplement > dirname(3) > >> in such a way that it's thread-safe, but also guaranteed to succeed. C > >> libraries like glibc, musl and the one that's part of Solaris already > >> follow such an approach. > >> > >> Move the existing implementation to another source file, > >> freebsd11_dirname.c to keep existing users of the API that pass in a > >> constant string happy, using symbol versioning. > >> > >> Put a new version of the function in dirname.c, obtained from > CloudABI's > >> C library. This version scans through the pathname string from left to > >> right, normalizing it, while discarding the last pathname component. > >> > >> Reviewed by: emaste, jilles > >> Differential Revision: https://reviews.freebsd.org/D7355 > >> > >> Added: > >> head/lib/libc/gen/dirname_compat.c > >> - copied, changed from r303452, head/lib/libc/gen/dirname.c > >> Modified: > >> head/lib/libc/gen/Makefile.inc > >> head/lib/libc/gen/Symbol.map > >> head/lib/libc/gen/dirname.3 > >> head/lib/libc/gen/dirname.c > >> > > > > [...] > > > >> > >> Copied and modified: head/lib/libc/gen/dirname_compat.c (from r303452, > head/lib/libc/gen/dirname.c) > >> ============================================================ > ================== > >> --- head/lib/libc/gen/dirname.c Thu Jul 28 16:54:12 2016 > (r303452, copy source) > >> +++ head/lib/libc/gen/dirname_compat.c Fri Aug 12 07:03:58 2016 > (r303988) > >> @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> > >> char * > >> -dirname(char *path) > >> +__freebsd11_dirname(char *path) > >> { > >> static char *dname = NULL; > >> size_t len; > >> @@ -75,3 +75,5 @@ dirname(char *path) > >> dname[len] = '\0'; > >> return (dname); > >> } > >> + > >> +__sym_compat(dirname, __freebsd11_dirname, FBSD_1.0); > >> > > > > This creates an interesting situation [1] that breaks building older > > sources and installing them into a chroot. The dirname@FBSD_1.0 is > > _not_ used in this case and isn't expected to be. This is coming up > > most often lately for nanonbsd and staged installs. > > > > Example scenario: > > > > Host: Head after this commit > > Src: stable/9 > > Building to install on another system over NFS or chroot to tar, > > whatever. Not trying to downgrade the host (though one report was trying > > this too). > > > > Buildworld builds usr.bin/xinstall in the bootstrap-tools phase *for the > > host* to run during the build and to use for installation later in > > installworld. This uses *the host libc* and picks up the new > > dirname@FBSD_1.5 symbol. > > > > The reasoning for this is so we can add new flags into the build that > > install needs and have a newly boostrapped xinstall to use them. > > > > I mimiced this by building a releng/11.0 xinstall from head but the > > result is the same for building an older stable/9: > > > >> # readelf -a /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall | > grep dirname > >> 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 dirname > + 0 > >> 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND > dirname@FBSD_1.5 (3) > >> 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@ > @FBSD_1.5 > > > > Stable/9 too: > >> ~/svn/stable/9/usr.bin/xinstall # readelf -a $(make whereobj)/xinstall > | grep dirname > >> 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 dirname > + 0 > >> 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND > dirname@FBSD_1.5 (3) > >> 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND dirname@ > @FBSD_1.5 > > > > > > The xinstall being built lacks the fix to expect dirname/basename to > > modify its arguments (r303450). > > > > So later when the *old* xinstall runs with *new host libc* in > > installworld it gets the wrong result from basename/dirname: > > > >> ~/git/freebsd/lib/libcxxrt # INSTALL=/usr/obj/root/svn/ > releng/11.0/usr.bin/xinstall/xinstall make install DESTDIR=/tmp/blah > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o root -g > wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o root -g > wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -s -o root -g > wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -o root -g > wheel -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -l rs > /tmp/blah/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so > >> xinstall: symlink ../../lib/libcxxrt.so.1 -> /tmp/blah/usr/lib: File > exists > >> *** Error code 71 > > > > > > So how can we fix? > > > > We can't expect older builds to expect basename(3)/dirname(3) to change > > arguments. We could fix the tips of branches and all relengs/, but not > > non-tips and I doubt so@ would care to EN something into all relengs/. > > Nor can we change the xinstall bootstrapping in older builds for the > > same reasons. We need a fix in head to handle this but I don't have any > > ideas currently. > > > > > > Interestingly I have an older stable/10 build that has an xinstall > > before the dirname version was moved and it works fine as it is > > defaulting to FBSD_1.0: > > > >> # readelf -a /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install | > grep dirname > >> 112: 00000000006f4160 8 OBJECT LOCAL DEFAULT 15 dirname.dname > >> 1893: 000000000040d950 268 FUNC GLOBAL DEFAULT 3 dirname > > > >> ~/git/freebsd/lib/libcxxrt # INSTALL=/usr/obj/root/svn/ > stable/10/tmp/legacy/usr/bin/install make install DESTDIR=/tmp/blah > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o root -g > wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o root -g > wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -s -o root -g > wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -o root -g > wheel -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -l rs > /tmp/blah/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so > > > > But as soon as I do another buildworld on that checkout it will break > > the binary. > > > > [1] > > https://lists.freebsd.org/pipermail/freebsd-current/ > 2016-August/063023.html > > > > I'm drawing blanks, hoping someone else has an idea. Otherwise I think > we should revert this until a solution is thought up. Even putting a > safe dirname(3)/basename(3) in xinstall won't help for the same reasons > as listed. > > -- > Regards, > Bryan Drewery > > From owner-svn-src-head@freebsd.org Wed Aug 24 18:30:28 2016 Return-Path: Delivered-To: svn-src-head@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 C727BBC519A; Wed, 24 Aug 2016 18:30:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEB818EB; Wed, 24 Aug 2016 18:30:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8079914A3; Wed, 24 Aug 2016 18:30:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 439F21A820; Wed, 24 Aug 2016 18:30:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ThFOiISFJiuV; Wed, 24 Aug 2016 18:30:18 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 46DAC1A81B To: Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> Date: Wed, 24 Aug 2016 11:30:17 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OEj03W6pEbCEg45irbkftSAeFjmWcDW9X" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:30:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OEj03W6pEbCEg45irbkftSAeFjmWcDW9X Content-Type: multipart/mixed; boundary="PJpGWW3Lf3hN1Wgaxjv3N4Sl3WB4XPuFx" From: Bryan Drewery To: Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Message-ID: <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> In-Reply-To: --PJpGWW3Lf3hN1Wgaxjv3N4Sl3WB4XPuFx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable That would only fix stable/11, stable/10, stable/9, releng/11.0. It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc... without an EN. It won't fix stable/11 - 1, stable/10 - 1, etc. It will never fix releng/8.4 (unsupported releases) since so@ won't EN to those. People do sometimes need to build these older releases still. It creates a line in the sand where we can never build checkouts older than where the fix was at. So I don't think it is the appropriate fix. On 8/24/16 11:27 AM, Ed Schouten wrote: > Hi Bryan, >=20 > We could solve this by simple mfcing the change I made for xinstall, ri= ght? >=20 > Ed >=20 >=20 > On 24 Aug 2016 20:15, "Bryan Drewery" > wrote: >=20 > On 8/24/16 11:06 AM, Bryan Drewery wrote: > > On 8/12/16 12:03 AM, Ed Schouten wrote: > >> Author: ed > >> Date: Fri Aug 12 07:03:58 2016 > >> New Revision: 303988 > >> URL: https://svnweb.freebsd.org/changeset/base/303988 > > >> > >> Log: > >> Reimplement dirname(3) to be thread-safe. > >> > >> Now that we've updated the prototypes of the basename(3) and > dirname(3) > >> functions to conform to POSIX, let's go ahead and reimplement > dirname(3) > >> in such a way that it's thread-safe, but also guaranteed to > succeed. C > >> libraries like glibc, musl and the one that's part of Solaris > already > >> follow such an approach. > >> > >> Move the existing implementation to another source file, > >> freebsd11_dirname.c to keep existing users of the API that pas= s > in a > >> constant string happy, using symbol versioning. > >> > >> Put a new version of the function in dirname.c, obtained from > CloudABI's > >> C library. This version scans through the pathname string from= > left to > >> right, normalizing it, while discarding the last pathname > component. > >> > >> Reviewed by: emaste, jilles > >> Differential Revision: https://reviews.freebsd.org/D7355 > > >> > >> Added: > >> head/lib/libc/gen/dirname_compat.c > >> - copied, changed from r303452, head/lib/libc/gen/dirname.c= > >> Modified: > >> head/lib/libc/gen/Makefile.inc > >> head/lib/libc/gen/Symbol.map > >> head/lib/libc/gen/dirname.3 > >> head/lib/libc/gen/dirname.c > >> > > > > [...] > > > >> > >> Copied and modified: head/lib/libc/gen/dirname_compat.c (from > r303452, head/lib/libc/gen/dirname.c) > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/lib/libc/gen/dirname.c Thu Jul 28 16:54:12 2016 = > (r303452, copy source) > >> +++ head/lib/libc/gen/dirname_compat.c Fri Aug 12 07:03:58= > 2016 (r303988) > >> @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); > >> #include > >> > >> char * > >> -dirname(char *path) > >> +__freebsd11_dirname(char *path) > >> { > >> static char *dname =3D NULL; > >> size_t len; > >> @@ -75,3 +75,5 @@ dirname(char *path) > >> dname[len] =3D '\0'; > >> return (dname); > >> } > >> + > >> +__sym_compat(dirname, __freebsd11_dirname, FBSD_1.0); > >> > > > > This creates an interesting situation [1] that breaks building ol= der > > sources and installing them into a chroot. The dirname@FBSD_1.0 = is > > _not_ used in this case and isn't expected to be. This is coming= up > > most often lately for nanonbsd and staged installs. > > > > Example scenario: > > > > Host: Head after this commit > > Src: stable/9 > > Building to install on another system over NFS or chroot to tar, > > whatever. Not trying to downgrade the host (though one report was= > trying > > this too). > > > > Buildworld builds usr.bin/xinstall in the bootstrap-tools phase > *for the > > host* to run during the build and to use for installation later i= n > > installworld. This uses *the host libc* and picks up the new > > dirname@FBSD_1.5 symbol. > > > > The reasoning for this is so we can add new flags into the build = that > > install needs and have a newly boostrapped xinstall to use them. > > > > I mimiced this by building a releng/11.0 xinstall from head but t= he > > result is the same for building an older stable/9: > > > >> # readelf -a > /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall | grep dirn= ame > >> 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 > dirname + 0 > >> 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND > dirname@FBSD_1.5 (3) > >> 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND > dirname@@FBSD_1.5 > > > > Stable/9 too: > >> ~/svn/stable/9/usr.bin/xinstall # readelf -a $(make > whereobj)/xinstall | grep dirname > >> 000000607200 000300000007 R_X86_64_JUMP_SLOT 0000000000000000 > dirname + 0 > >> 3: 0000000000000000 247 FUNC GLOBAL DEFAULT UND > dirname@FBSD_1.5 (3) > >> 108: 0000000000000000 247 FUNC GLOBAL DEFAULT UND > dirname@@FBSD_1.5 > > > > > > The xinstall being built lacks the fix to expect dirname/basename= to > > modify its arguments (r303450). > > > > So later when the *old* xinstall runs with *new host libc* in > > installworld it gets the wrong result from basename/dirname: > > > >> ~/git/freebsd/lib/libcxxrt # > INSTALL=3D/usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall m= ake > install DESTDIR=3D/tmp/blah > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o > root -g wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -C -o > root -g wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -s -o > root -g wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -o root= > -g wheel -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/= > >> /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/xinstall -l rs=20 > /tmp/blah/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so > >> xinstall: symlink ../../lib/libcxxrt.so.1 -> /tmp/blah/usr/lib: > File exists > >> *** Error code 71 > > > > > > So how can we fix? > > > > We can't expect older builds to expect basename(3)/dirname(3) to > change > > arguments. We could fix the tips of branches and all relengs/, > but not > > non-tips and I doubt so@ would care to EN something into all rele= ngs/. > > Nor can we change the xinstall bootstrapping in older builds for = the > > same reasons. We need a fix in head to handle this but I don't > have any > > ideas currently. > > > > > > Interestingly I have an older stable/10 build that has an xinstal= l > > before the dirname version was moved and it works fine as it is > > defaulting to FBSD_1.0: > > > >> # readelf -a > /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install | grep dirna= me > >> 112: 00000000006f4160 8 OBJECT LOCAL DEFAULT 15 > dirname.dname > >> 1893: 000000000040d950 268 FUNC GLOBAL DEFAULT 3 dirna= me > > > >> ~/git/freebsd/lib/libcxxrt # > INSTALL=3D/usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install ma= ke > install DESTDIR=3D/tmp/blah > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o > root -g wheel -m 444 libcxxrt.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -C -o > root -g wheel -m 444 libcxxrt_p.a /tmp/blah/usr/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -s -o > root -g wheel -m 444 libcxxrt.so.1 /tmp/blah/lib/ > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -o root > -g wheel -m 444 libcxxrt.so.1.debug /tmp/blah/usr/lib/debug/lib/= > >> /usr/obj/root/svn/stable/10/tmp/legacy/usr/bin/install -l rs=20 > /tmp/blah/lib/libcxxrt.so.1 /tmp/blah/usr/lib/libcxxrt.so > > > > But as soon as I do another buildworld on that checkout it will b= reak > > the binary. > > > > [1] > > > https://lists.freebsd.org/pipermail/freebsd-current/2016-August/063= 023.html > > > >=20 > I'm drawing blanks, hoping someone else has an idea. Otherwise I t= hink > we should revert this until a solution is thought up. Even putting= a > safe dirname(3)/basename(3) in xinstall won't help for the same rea= sons > as listed. >=20 > -- > Regards, > Bryan Drewery >=20 --=20 Regards, Bryan Drewery --PJpGWW3Lf3hN1Wgaxjv3N4Sl3WB4XPuFx-- --OEj03W6pEbCEg45irbkftSAeFjmWcDW9X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvee5AAoJEDXXcbtuRpfPfmIH/2muV1ThaC+D4hO+Q2sMTyMF Lh+Mocqlq5l2rq2QJfknoTa0G6gedwCKGG2tg+ZROQcIWQBaYoMr+LAgCoBgXQsq LQ8CkzsrFX1EDjJfolz4vHZsb1pag6hQO71i0xTjZ+cnKsG02a+r/dVDTy5JfKpO VOsvND3Xy5tzfGXvReqlgV/hNarNwj7b6KIPGPosXSkjJ6khb1dQTu/822f9VEKW xNQ7PqCgoxBSjkGKFcYOxtK3OGAUtWmqW/RHETCEzIPAE60ImEtIJRSLTKL0NXux LZ7jT1LwagXIh3QvcYFHTEKzzG8tSODPci2JvJZKiLeWLgAlRnEqP3Seyie5rwY= =vlXm -----END PGP SIGNATURE----- --OEj03W6pEbCEg45irbkftSAeFjmWcDW9X-- From owner-svn-src-head@freebsd.org Wed Aug 24 18:59:25 2016 Return-Path: Delivered-To: svn-src-head@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 7BBCFBC57AF; Wed, 24 Aug 2016 18:59:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 57DDC1D6A; Wed, 24 Aug 2016 18:59:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7OIxO5p067820; Wed, 24 Aug 2016 18:59:24 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7OIxOEj067818; Wed, 24 Aug 2016 18:59:24 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608241859.u7OIxOEj067818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 24 Aug 2016 18:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304773 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 18:59:25 -0000 Author: bde Date: Wed Aug 24 18:59:24 2016 New Revision: 304773 URL: https://svnweb.freebsd.org/changeset/base/304773 Log: Flesh out the state and flags args to sccnopen(). Set state flags to indicate (potentially partial) success of the open. Use these to decide what to close in sccnclose(). Only grab/ungrab use open/close so far. Add a per-sc variable to count successful keyboard opens and use this instead of the grab count to decide if the keyboad state has been switched. Start fixing the locking by using atomic ops for the most important counter -- the grab level one. Other racy counting will eventually be fixed by normal mutex or kdb locking in most cases. Use a 2-entry per-sc stack of states for grabbing. 2 is just enough to debug grabbing, e.g., for gets(). gets() grabs once and might not be able to do a full (or any) state switch. ddb grabs again and has a better chance of doing a full state switch and needs a place to stack the previous state. For more than 3 levels, grabbing just changes the count. Console drivers should try to switch on every i/o in case lower levels of nesting failed to switch but the current level succeeds, but then the switch (back) must be completed on every i/o and this flaps the state unless the switch is null. The main point of grabbing is to make it null quite often. Syscons grabbing also does a carefully chosen screen focus that is not done on every i/o. Add a large comment about grabbing. Restore some small lost comments. Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Aug 24 17:45:11 2016 (r304772) +++ head/sys/dev/syscons/syscons.c Wed Aug 24 18:59:24 2016 (r304773) @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct sc_cnstate; /* not used yet */ - #define COLD 0 #define WARM 1 @@ -1655,7 +1653,13 @@ sccnopen(sc_softc_t *sc, struct sc_cnsta { int kbd_mode; - if (sc->kbd == NULL) + /* assert(sc_console_unit >= 0) */ + + sp->kbd_opened = FALSE; + sp->scr_opened = FALSE; + + /* Opening the keyboard is optional. */ + if (!(flags & 1) || sc->kbd == NULL) goto over_keyboard; /* @@ -1667,48 +1671,79 @@ sccnopen(sc_softc_t *sc, struct sc_cnsta /* Switch the keyboard to console mode (K_XLATE, polled) on all scp's. */ kbd_mode = K_XLATE; (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); + sc->kbd_open_level++; kbdd_poll(sc->kbd, TRUE); + + sp->kbd_opened = TRUE; over_keyboard: ; + /* The screen is opened iff locking it succeeds. */ + sp->scr_opened = TRUE; + + /* The screen switch is optional. */ + if (!(flags & 2)) + return; + + /* try to switch to the kernel console screen */ if (!cold && sc->cur_scp->index != sc_console->index && sc->cur_scp->smode.mode == VT_AUTO && sc_console->smode.mode == VT_AUTO) sc_switch_scr(sc, sc_console->index); - } static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { - if (sc->kbd == NULL) + sp->scr_opened = FALSE; + + if (!sp->kbd_opened) return; /* Restore keyboard mode (for the current, possibly-changed scp). */ kbdd_poll(sc->kbd, FALSE); - (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); + if (--sc->kbd_open_level == 0) + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); kbdd_disable(sc->kbd); + sp->kbd_opened = FALSE; } +/* + * Grabbing switches the screen and keyboard focus to sc_console and the + * keyboard mode to (K_XLATE, polled). Only switching to polled mode is + * essential (for preventing the interrupt handler from eating input + * between polls). Focus is part of the UI, and the other switches are + * work just was well when they are done on every entry and exit. + * + * Screen switches while grabbed are supported, and to maintain focus for + * this ungrabbing and closing only restore the polling state and then + * the keyboard mode if on the original screen. + */ + static void sc_cngrab(struct consdev *cp) { sc_softc_t *sc; + int lev; sc = sc_console->sc; - if (sc->grab_level++ == 0) - sccnopen(sc, NULL, 0); + lev = atomic_fetchadd_int(&sc->grab_level, 1); + if (lev >= 0 || lev < 2) + sccnopen(sc, &sc->grab_state[lev], 1 | 2); } static void sc_cnungrab(struct consdev *cp) { sc_softc_t *sc; + int lev; sc = sc_console->sc; - if (--sc->grab_level == 0) - sccnclose(sc, NULL); + lev = atomic_load_acq_int(&sc->grab_level) - 1; + if (lev >= 0 || lev < 2) + sccnclose(sc, &sc->grab_state[lev]); + atomic_add_int(&sc->grab_level, -1); } static void @@ -2681,7 +2716,7 @@ exchange_scr(sc_softc_t *sc) sc_set_border(scp, scp->border); /* set up the keyboard for the new screen */ - if (sc->grab_level == 0 && sc->old_scp->kbd_mode != scp->kbd_mode) + if (sc->kbd_open_level == 0 && sc->old_scp->kbd_mode != scp->kbd_mode) (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); @@ -3426,7 +3461,7 @@ next_code: if (!(flags & SCGETC_CN)) random_harvest_queue(&c, sizeof(c), 1, RANDOM_KEYBOARD); - if (sc->grab_level == 0 && scp->kbd_mode != K_XLATE) + if (sc->kbd_open_level == 0 && scp->kbd_mode != K_XLATE) return KEYCHAR(c); /* if scroll-lock pressed allow history browsing */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Wed Aug 24 17:45:11 2016 (r304772) +++ head/sys/dev/syscons/syscons.h Wed Aug 24 18:59:24 2016 (r304773) @@ -188,6 +188,11 @@ struct video_adapter; struct scr_stat; struct tty; +struct sc_cnstate { + u_char kbd_opened; + u_char scr_opened; +}; + typedef struct sc_softc { int unit; /* unit # */ int config; /* configuration flags */ @@ -231,6 +236,9 @@ typedef struct sc_softc { char write_in_progress; char blink_in_progress; int grab_level; + /* 2 is just enough for kdb to grab for stepping normal grabbing: */ + struct sc_cnstate grab_state[2]; + int kbd_open_level; struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; From owner-svn-src-head@freebsd.org Wed Aug 24 19:10:34 2016 Return-Path: Delivered-To: svn-src-head@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 A107DBC5AD1; Wed, 24 Aug 2016 19:10:34 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 35FEA158A; Wed, 24 Aug 2016 19:10:33 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id cdZAbuLJtgdalcdZBbqDTi; Wed, 24 Aug 2016 13:10:27 -0600 X-Authority-Analysis: v=2.2 cv=Q++Q2M+a c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=MEJGZkgKfvo3DnF4MrsA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 419E113794; Wed, 24 Aug 2016 12:10:24 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7OJA7dH012503; Wed, 24 Aug 2016 12:10:08 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608241910.u7OJA7dH012503@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Shawn Webb , Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, re@freebsd.org, so@freebsd.org Subject: Re: svn commit: r304747 - in head/contrib/sqlite3: . tea In-Reply-To: Message from Cy Schubert of "Wed, 24 Aug 2016 05:55:16 -0700." <201608241255.u7OCtGK3019972@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Aug 2016 12:10:07 -0700 X-CMAE-Envelope: MS4wfKyRKphVMjM+ZNfb25Clxp/CCNXrOIeCCVgN8n8JCnrB13ABFPAhSoI2W6jFYm4f0UILfNAYKuNZk7SC/vF/6iFZUNg0eI9RhQpAl0lmjplwgjxjQARX uzJOFv/s9Xd+sYUdcUOqYAT+V3lJ0zZS4kDGLCLysOQtNl+nRFniKKnzh/biI8mIXO5FsVE2I7SwQBUbPPRMPQKnpL6ZqY7Qq2IxPK/EG5zF4Lh2+wC2tqAl hAC6n00G8jUBb15bxH2X3gEVjxKY1vUnzuGgLl8lz9b/0yN2VoB22pSX2T6qePcNkwZSukOYJvDqmEijlXnO9A9ghXADaxKqm78N9UUFMzULcU3JvEh0QQjH K7uucFvYaLCs+tRq8v3JRoCVCj97Vw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 19:10:34 -0000 In message <201608241255.u7OCtGK3019972@slippy.cwsent.com>, Cy Schubert writes: > In message <20160824123811.GB74786@mutt-hardenedbsd>, Shawn Webb writes: > > > > > > --qcHopEYAB45HaUaB > > Content-Type: text/plain; charset=us-ascii > > Content-Disposition: inline > > Content-Transfer-Encoding: quoted-printable > > > > On Wed, Aug 24, 2016 at 05:35:54AM -0700, Cy Schubert wrote: > > > In message <201608241232.u7OCWPsn020853@repo.freebsd.org>, Cy Schubert=20 > > > writes: > > > > Author: cy > > > > Date: Wed Aug 24 12:32:24 2016 > > > > New Revision: 304747 > > > > URL: https://svnweb.freebsd.org/changeset/base/304747 > > > >=20 > > > > Log: > > > > MFV r304732. > > > > =20 > > > > Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100). > > > > =20 > > > > This commit addresses the tmpdir selection vulnerability fixed in > > > > sqlite3-1.13.0. See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b > . > > > > =20 > > > > Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b > > > > Security: CVE-2016-6153 > > >=20 > > > This should probably be MFCed in a week unless re@ wants it sooner of=20 > > > course. > > > > Does this also need a FreeBSD errata notice or security announcement? > > Not for the upcoming 11.0 release. The 10 branch OTOH appears to have > 1.8.14, which is much much older, so I think that we should or at least do > a direct commit to simply address the vulnerability. (I haven't looked at > whether it would be better to MFC to 10 or direct commit to disturb as > little as possible in the 10 brancn.) The 9 branch doesn't include sqlite3. > > I can prepare an MFC to 11 sooner if wanted. I'll look at the 10 branch at > noon my time today. Relnotes for 11 and an errata announcement for 10 would > be all that's needed. Reading email from this morning, looks like an errata notification will also need to be made for 11.0 when it is released. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Aug 24 19:19:50 2016 Return-Path: Delivered-To: svn-src-head@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 6306FBC5CED; Wed, 24 Aug 2016 19:19:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 51EC01BCC; Wed, 24 Aug 2016 19:19:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 5A5401579; Wed, 24 Aug 2016 19:19:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Wed, 24 Aug 2016 19:19:48 +0000 From: Glen Barber To: Cy Schubert Cc: Shawn Webb , Cy Schubert , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, re@freebsd.org, so@freebsd.org Subject: Re: svn commit: r304747 - in head/contrib/sqlite3: . tea Message-ID: <20160824191948.GL19112@FreeBSD.org> References: <201608241255.u7OCtGK3019972@slippy.cwsent.com> <201608241910.u7OJA7dH012503@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yaPAUYI/0vT2YKpA" Content-Disposition: inline In-Reply-To: <201608241910.u7OJA7dH012503@slippy.cwsent.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 19:19:50 -0000 --yaPAUYI/0vT2YKpA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 24, 2016 at 12:10:07PM -0700, Cy Schubert wrote: > > I can prepare an MFC to 11 sooner if wanted. I'll look at the 10 branch= at=20 > > noon my time today. Relnotes for 11 and an errata announcement for 10 w= ould=20 > > be all that's needed. >=20 > Reading email from this morning, looks like an errata notification will= =20 > also need to be made for 11.0 when it is released. >=20 SA/EN-related items do not necessarily warrant an additional RC. It would be at the discretion of the Security Officer if this should be merged to releng/11.0 prior to the release. Glen --yaPAUYI/0vT2YKpA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXvfNUAAoJEAMUWKVHj+KTkhMP/izcDly2DRsFTfSzXPFq1ro/ CNvQXgihD3mFSdnH/OQWiXrOPRLGacC1wfRaT1w8tIcptPhyzcScXvnX07Ltt+6S xjhzbeNGEsv1GH4ta2zmumfZgxPfcg7noZPZVZ8XegyZjvk95SF0HBWKR9JDfq8A Q2tE0+G1u+94Un93dc2LjAkvoI66X9D/yhfMQsj5N+rr+Fgol3eblbMia5is/Vjz E8tgWot3gtkfAnBjr8C6SLKCxlcXhd5mip6wb2+XG3rfuT6P56MQWDjYyhJX8AcW L4krJ53pjgTpyX4azLEiZ6G2ZPnPqsE2eXhPC762IRz8PaO5G6Cel1tWMMU/Br10 W3lSz1/h7bikB/9l5yM7WJ+bYjQRjl1ZKyrm6zd5SPnMwy9LpIHPN8FxLz2pXYDh PxkQGv6cDbqwGoHrnIvMmpgd8xfrtsNStd5SPsz1OZ4anCSJ5pwmmgy6qqwbfIKu 1GhhPQbBxY+r1EjajYJ/K+eFy3ydaC1ZeLLPBiVe9hwS07XzngfiFaHmpJrsOyOY n6KKnHoYFDQcZxVbwQSPflVEUbX15WsFM9i+Knk+FUfHjXJUOWCoheeUFY8TdT7s As8vEG4ICEhkecp6J/dP7kCl8BC0G4cW0xOS0uR+brMJRnUk1VGT4XqH2FGcGsNQ NWJK/2tELjRhRxOGPVb0 =P3dm -----END PGP SIGNATURE----- --yaPAUYI/0vT2YKpA-- From owner-svn-src-head@freebsd.org Wed Aug 24 19:49:31 2016 Return-Path: Delivered-To: svn-src-head@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 78C59BC55CD for ; Wed, 24 Aug 2016 19:49:31 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22a.google.com (mail-yw0-x22a.google.com [IPv6:2607:f8b0:4002:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 343531F8C for ; Wed, 24 Aug 2016 19:49:31 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22a.google.com with SMTP id r9so16775395ywg.0 for ; Wed, 24 Aug 2016 12:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AI8t05xJ9BjzkKo0otQFwWiYyr6sGpaQw/G4aACa2y4=; b=xRO/ibND1jHmAC5Neaulz6QPdoAjwCKkc9dDfzwKsWDg2n3XdqXUwdReO1E4SZTwYR WJOpIhkmx7Q3rqezDI/n/S08wHN6sFmpkoKVyN46f5uvFfeiLCxpIHHMihlc6D2i9ToP Ro9/XLGhtpDGt4aJoYvIdu6JR93raDMTquRni+bWKnityZtXh0KlacYebL7WDBQFIRA+ gWbA1aS8ydn7PL9vyMtbU2RyceU6G1UOvs1rSwTtBTbrcsq1qN0T8ZDwRzNyh5EpE6ku Dx7AUVI87D+kMan1bqrqkZN9etiWUVH79FoLKYqR/QawTf9kc7ZfXtG8/aPopwK8M339 hAEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AI8t05xJ9BjzkKo0otQFwWiYyr6sGpaQw/G4aACa2y4=; b=kr6DH3rVVtIcngys1TSqK65ajybg0l2RdMv8iHMQHzc9wX3Mfo0gZFI6AIYqj5k19g 7oChS4NcnuZJ+HobJ0m7tnU/ct0ZtzDHXjc3XU+dUBAXj2OdIZs/JYw2va5cQXsZmAnK x2d5+xhq29BRrPdIYiHegPhIHQkd4Oy3uw2M++0gIR3B4yKZUpgv31IZxQD5BiqBBQxn sO36ZXJRuPt4johczKPB66aSez9NapPr76rWyk3jAjhJ+Oz0AcTs0ZnT7A5LOPoRJ6nG 5y4fEskKzCI74qzGldZ9yCvo7JWX0LVfe/jlTwgepxT7n+n9SUyIuKvrEXNBEXm4xbbt /v6g== X-Gm-Message-State: AE9vXwOZeQ28sj1VSVHXWCmUZW2QcS40zgeJZvsPtJhyX2GSEnyjkI+ZUQjIp1RJqZ7GRY9oSb/25x9Mg9P0vA== X-Received: by 10.13.253.134 with SMTP id n128mr3918534ywf.20.1472068170373; Wed, 24 Aug 2016 12:49:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Wed, 24 Aug 2016 12:49:29 -0700 (PDT) In-Reply-To: <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> From: Ed Schouten Date: Wed, 24 Aug 2016 21:49:29 +0200 Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Content-Type: multipart/mixed; boundary=94eb2c06a37a61b2b6053ad69491 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 19:49:31 -0000 --94eb2c06a37a61b2b6053ad69491 Content-Type: text/plain; charset=UTF-8 2016-08-24 20:30 GMT+02:00 Bryan Drewery : > That would only fix stable/11, stable/10, stable/9, releng/11.0. > > It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc... > without an EN. > > It won't fix stable/11 - 1, stable/10 - 1, etc. > > It will never fix releng/8.4 (unsupported releases) since so@ won't EN > to those. People do sometimes need to build these older releases still. > > It creates a line in the sand where we can never build checkouts older > than where the fix was at. So I don't think it is the appropriate fix. Good point! Just for the record: Bryan and I just discussed this matter in more detail on IRC. We came up with a workaround that should be pretty good. Attached is a patch for that adds some extra logic, so that any calls to basename() and dirname() will expand to calls to __old_basename() and __old_dirname(). Using __sym_compat(), these will cause the compiler to generate calls to basename@FBSD_1.0 and dirname@FBSD_1.0. According to Bryan, this fixes the problems he was experiencing. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 --94eb2c06a37a61b2b6053ad69491 Content-Type: text/plain; charset=US-ASCII; name="dirname-basename-xinstall.diff" Content-Disposition: attachment; filename="dirname-basename-xinstall.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_is9b4puu1 SW5kZXg6IGluY2x1ZGUvbGliZ2VuLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaW5jbHVkZS9saWJnZW4uaAko cmV2aXNpb24gMzA0NzUwKQorKysgaW5jbHVkZS9saWJnZW4uaAkod29ya2luZyBjb3B5KQpAQCAt MzksNCArMzksMjYgQEAKIGNoYXIJKmRpcm5hbWUoY2hhciAqKTsKIF9fRU5EX0RFQ0xTCiAKKy8q CisgKiBJbiBGcmVlQlNEIDEyLCB0aGUgcHJvdG90eXBlIG9mIGJhc2VuYW1lKCkgYW5kIGRpcm5h bWUoKSB3YXMgbW9kaWZpZWQKKyAqIHRvIGNvbXBseSB0byBQT1NJWC4gVGhlc2UgZnVuY3Rpb25z IG1heSBub3cgbW9kaWZ5IHRoZWlyIGlucHV0LgorICogVW5mb3J0dW5hdGVseSwgb3VyIGNvcHkg b2YgeGluc3RhbGwoOCkgc2hpcHBlZCB3aXRoIHByZXZpb3VzIHZlcnNpb25zCisgKiBvZiBGcmVl QlNEIGlzIGJ1aWx0IHVzaW5nIHRoZSBob3N0IGhlYWRlcnMgYW5kIGxpYmMgZHVyaW5nIHRoZQor ICogYm9vdHN0cmFwcGluZyBwaGFzZSBhbmQgZGVwZW5kcyBvbiB0aGUgb2xkIGJlaGF2aW9yLgor ICoKKyAqIEFwcGx5IGEgd29ya2Fyb3VuZCB3aGVyZSB3ZSBleHBsaWNpdGx5IGxpbmsgYWdhaW5z dCBiYXNlbmFtZUBGQlNEXzEuMAorICogYW5kIGRpcm5hbWVARkJTRF8xLjAgaW4gY2FzZSB0aGVz ZSBmdW5jdGlvbnMgYXJlIGNhbGxlZCBvbiBjb25zdGFudAorICogc3RyaW5ncywgaW5zdGVhZCBv ZiBtYWtpbmcgdGhlIGJ1aWxkIGZhaWwuCisgKi8KKyNpZiBkZWZpbmVkKF9fZ2VuZXJpYykgJiYg IWRlZmluZWQoX19jcGx1c3BsdXMpCitfX0JFR0lOX0RFQ0xTCitjaGFyCSpfX29sZF9iYXNlbmFt ZShjb25zdCBjaGFyICopOworY2hhcgkqX19vbGRfZGlybmFtZShjb25zdCBjaGFyICopOworX19F TkRfREVDTFMKK19fc3ltX2NvbXBhdChiYXNlbmFtZSwgX19vbGRfYmFzZW5hbWUsIEZCU0RfMS4w KTsKK19fc3ltX2NvbXBhdChkaXJuYW1lLCBfX29sZF9kaXJuYW1lLCBGQlNEXzEuMCk7CisjZGVm aW5lCWJhc2VuYW1lKHgpCV9fZ2VuZXJpYyh4LCBjb25zdCBjaGFyICosIF9fb2xkX2Jhc2VuYW1l LCBiYXNlbmFtZSkoeCkKKyNkZWZpbmUJZGlybmFtZSh4KQlfX2dlbmVyaWMoeCwgY29uc3QgY2hh ciAqLCBfX29sZF9kaXJuYW1lLCBkaXJuYW1lKSh4KQorI2VuZGlmCisKICNlbmRpZiAvKiAhX0xJ QkdFTl9IXyAqLwpJbmRleDogbGliL2xpYmMvZ2VuL2Jhc2VuYW1lLmMKPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g bGliL2xpYmMvZ2VuL2Jhc2VuYW1lLmMJKHJldmlzaW9uIDMwNDc1MCkKKysrIGxpYi9saWJjL2dl bi9iYXNlbmFtZS5jCSh3b3JraW5nIGNvcHkpCkBAIC02Niw3ICs2Niw3IEBACiB9CiAKIGNoYXIg KgotYmFzZW5hbWUoY2hhciAqcGF0aCkKKyhiYXNlbmFtZSkoY2hhciAqcGF0aCkKIHsKIAlzdGF0 aWMgY2hhciAqYm5hbWUgPSBOVUxMOwogCkluZGV4OiBsaWIvbGliYy9nZW4vZGlybmFtZS5jCj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KLS0tIGxpYi9saWJjL2dlbi9kaXJuYW1lLmMJKHJldmlzaW9uIDMwNDc1MCkKKysr IGxpYi9saWJjL2dlbi9kaXJuYW1lLmMJKHdvcmtpbmcgY29weSkKQEAgLTMxLDcgKzMxLDcgQEAK ICNpbmNsdWRlIDxzdHJpbmcuaD4KIAogY2hhciAqCi1kaXJuYW1lKGNoYXIgKnBhdGgpCisoZGly bmFtZSkoY2hhciAqcGF0aCkKIHsKIAljb25zdCBjaGFyICppbiwgKnByZXYsICpiZWdpbiwgKmVu ZDsKIAljaGFyICpvdXQ7Cg== --94eb2c06a37a61b2b6053ad69491-- From owner-svn-src-head@freebsd.org Wed Aug 24 19:53:40 2016 Return-Path: Delivered-To: svn-src-head@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 2FD5ABC571B; Wed, 24 Aug 2016 19:53:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 10EFB1531; Wed, 24 Aug 2016 19:53:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 040AE1F8A; Wed, 24 Aug 2016 19:53:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id BDD881AA95; Wed, 24 Aug 2016 19:53:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id HbqSTLA0jPhq; Wed, 24 Aug 2016 19:53:31 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7D5A61AA8C To: Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 24 Aug 2016 12:53:27 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tfpodA24dFOTD595EJagi3dgWNqeXgijB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 19:53:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tfpodA24dFOTD595EJagi3dgWNqeXgijB Content-Type: multipart/mixed; boundary="OoWae0Ulc2BB2e7I6axj5I2fw8mQ9HkdA" From: Bryan Drewery To: Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> In-Reply-To: --OoWae0Ulc2BB2e7I6axj5I2fw8mQ9HkdA Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/24/16 12:49 PM, Ed Schouten wrote: > 2016-08-24 20:30 GMT+02:00 Bryan Drewery : >> > That would only fix stable/11, stable/10, stable/9, releng/11.0. >> > >> > It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc.= =2E. >> > without an EN. >> > >> > It won't fix stable/11 - 1, stable/10 - 1, etc. >> > >> > It will never fix releng/8.4 (unsupported releases) since so@ won't = EN >> > to those. People do sometimes need to build these older releases st= ill. >> > >> > It creates a line in the sand where we can never build checkouts old= er >> > than where the fix was at. So I don't think it is the appropriate f= ix. > Good point! >=20 > Just for the record: Bryan and I just discussed this matter in more > detail on IRC. We came up with a workaround that should be pretty > good. >=20 > Attached is a patch for that adds some extra logic, so that > any calls to basename() and dirname() will expand to calls to > __old_basename() and __old_dirname(). Using __sym_compat(), these will > cause the compiler to generate calls to basename@FBSD_1.0 and > dirname@FBSD_1.0. >=20 > According to Bryan, this fixes the problems he was experiencing. >=20 > -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands > KvK-nr.: 62051717 >=20 >=20 > dirname-basename-xinstall.diff >=20 >=20 > Index: include/libgen.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- include/libgen.h (revision 304750) > +++ include/libgen.h (working copy) > @@ -39,4 +39,26 @@ > char *dirname(char *); > __END_DECLS > =20 > +/* > + * In FreeBSD 12, the prototype of basename() and dirname() was modifi= ed > + * to comply to POSIX. These functions may now modify their input. > + * Unfortunately, our copy of xinstall(8) shipped with previous versio= ns > + * of FreeBSD is built using the host headers and libc during the > + * bootstrapping phase and depends on the old behavior. > + * > + * Apply a workaround where we explicitly link against basename@FBSD_1= =2E0 > + * and dirname@FBSD_1.0 in case these functions are called on constant= > + * strings, instead of making the build fail. > + */ > +#if defined(__generic) && !defined(__cplusplus) > +__BEGIN_DECLS > +char *__old_basename(const char *); > +char *__old_dirname(const char *); > +__END_DECLS > +__sym_compat(basename, __old_basename, FBSD_1.0); > +__sym_compat(dirname, __old_dirname, FBSD_1.0); > +#define basename(x) __generic(x, const char *, __old_basename, basenam= e)(x) > +#define dirname(x) __generic(x, const char *, __old_dirname, dirname)(= x) > +#endif Personally I really like this in general as an API-compat pattern. I know Ed wanted to deprecate and remove the old dirname(3)/basename(3), but it was quite painful downstream to convert our checkout to use the new prototypes. It spanned "only" 19 files, but it took 2 days of build-and-fix iterations to fix. We still get the benefit of thread-safe basename(3)/dirname(3) when using the proper prototype. Is it possible to cause the use of these old prototypes to print a warning and note that they are deprecated/unsafe? --=20 Regards, Bryan Drewery --OoWae0Ulc2BB2e7I6axj5I2fw8mQ9HkdA-- --tfpodA24dFOTD595EJagi3dgWNqeXgijB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvfs4AAoJEDXXcbtuRpfPA0MH/Ruegw0YBxd1Z8IXgjrhjEo1 NF0oNkXs1qP6RbXCfe/5R+HTutiIBv2SxkYi1kJM4eti2qrUOKFBLzXOCBNZ4uY0 KJamAYUyAqvmYSkjHMKUhE4x9RhHJxosvDiXUcM+topX/KZJUkJdsc2HfOQgvKh9 WwctbaVPMutgcx1JhkRgONXDACu5zaIptWHxD5Lx0UlrRe1hGhx76IfzT4YeYvl+ 27NtYOBIbilNEvxLo0oDfSMjpGD1mEMjNbuU8ubJ0uV/pclKV5l9D8fhSZdvowJ6 /bLCmL6bQBCiJbCPgtdIk+VGy6yN1/j2M2RIlFqBWnEuOAZ3aZhkSNbbtSDLKSg= =2ici -----END PGP SIGNATURE----- --tfpodA24dFOTD595EJagi3dgWNqeXgijB-- From owner-svn-src-head@freebsd.org Wed Aug 24 20:01:01 2016 Return-Path: Delivered-To: svn-src-head@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 E70B6BC5807 for ; Wed, 24 Aug 2016 20:01:01 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x233.google.com (mail-yb0-x233.google.com [IPv6:2607:f8b0:4002:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3D8B17CC for ; Wed, 24 Aug 2016 20:01:01 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x233.google.com with SMTP id a7so8293016ybi.0 for ; Wed, 24 Aug 2016 13:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=q9OiR6jYW8emZQT5iPUeG5zAdu6OOPWq8AsbGmAFSwM=; b=aLdb1gb4jwnqOcqLR9bC69jxkqaz0GGrdrrw0958LmDWL6tZw57Zv0eAfMhZ2qLlQf Vlw8lxJAEAnZZmg7yw8q5pxW0NxabSfBHSZW6dLVpX1hV/zV0s06tSB0RSIG68D0MnoY xVX0psSNV8SpXG96TFArMCrxjUzJ9GDw+FDzq7n8EzbQSrcglxFsiSH4QfF69E+8WZjf njuT65HokPSkQOGBmCjR3WWdRhQSduXuVE+ht6sS6SjOp2LLFkDltfQ1h3UbZSXNZhxA 0oVMMM21QHj/K0smHI2MZnPNDoVXa7P01MF7OKmPUqx5nYGEd5270/s65yjmPVcEyOmX G/iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=q9OiR6jYW8emZQT5iPUeG5zAdu6OOPWq8AsbGmAFSwM=; b=BHOrw6Q9g9RhxFXMfg6gBk4mWTuph54YeD8cSJwh7cckZAI1tP8WRWFi9CgCz0Vjqq OTJJtWEy6We6JcfUHbGclwr+2rEigVnBzihLr23fEpgA184iWmx/8GoKyr+ng2tdMrFU 2W5nO5E0/a9GndJAEYxJyJ17UNzzNtqz8FlUR4egUAbvGtjX+W16Mms5YH7jIz1Ro4xd rG1ORegVv78BT5IuqZZpdlmhxw99ZjPS7BM4hZWY1HPzmS949LrhdNLPTcJU5aIZ5yRL 8vEvaIeAcnKzwiZyYHikESNbQjOTTZZVrebIVvdI2aq95+v03lh/a0HGl7ZxQdJvKlPg n8pQ== X-Gm-Message-State: AEkooutwgFCVowTj1d+FjRlNtrZLDGE1LrwYD9sUaQN4UMnBQiMnCTWo3GzkoxmPGOoQ4Rk2fD9yZws+ZAVt9Q== X-Received: by 10.37.201.131 with SMTP id z125mr3657422ybf.183.1472068860929; Wed, 24 Aug 2016 13:01:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Wed, 24 Aug 2016 13:01:00 -0700 (PDT) In-Reply-To: References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> From: Ed Schouten Date: Wed, 24 Aug 2016 22:01:00 +0200 Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:01:02 -0000 2016-08-24 21:53 GMT+02:00 Bryan Drewery : > Is it possible to cause the use of these old prototypes to print a > warning and note that they are deprecated/unsafe? That's a good question. In theory, we could annotate these functions with __attribute__((__deprecated__)): https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html But I'm actually too afraid to use it. In the worst case it may cause the compiler to generate a warning even when basename()/dirname() is used correctly, as __old_* will still be part of the compiled expression. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Wed Aug 24 20:11:53 2016 Return-Path: Delivered-To: svn-src-head@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 711E8BC5B98; Wed, 24 Aug 2016 20:11:53 +0000 (UTC) (envelope-from landon@landonf.org) Received: from smtp.office.plausible.coop (static-108-51-93-21.washdc.fios.verizon.net [108.51.93.21]) by mx1.freebsd.org (Postfix) with ESMTP id 53F9612FD; Wed, 24 Aug 2016 20:11:52 +0000 (UTC) (envelope-from landon@landonf.org) Received: from [192.168.10.185] (c-71-196-138-4.hsd1.co.comcast.net [71.196.138.4]) by smtp.office.plausible.coop (Postfix) with ESMTPSA id AA97050801E; Wed, 24 Aug 2016 13:03:18 -0700 (PDT) Date: Wed, 24 Aug 2016 14:05:40 -0600 From: Landon J Fuller Subject: Re: svn commit: r304692 - head/sys/dev/bhnd/bhndb To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <1472069140.8740.0@smtp.office.plausible.coop> In-Reply-To: <20160824120957.GA74786@mutt-hardenedbsd> References: <201608231903.u7NJ3Bjc019151@repo.freebsd.org> <20160824120957.GA74786@mutt-hardenedbsd> X-Mailer: geary/0.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:11:53 -0000 On Wed, Aug 24, 2016 at 6:09 AM, Shawn Webb wrote: > On Tue, Aug 23, 2016 at 07:03:11PM +0000, Landon J. Fuller wrote: >> Author: landonf >> Date: Tue Aug 23 19:03:11 2016 >> New Revision: 304692 >> URL: https://svnweb.freebsd.org/changeset/base/304692 >> >> Log: >> bhndb(4): Fix unsigned integer underflow in dynamic register >> window >> handling. This resulted in the window target being left >> uninitialized >> when an underflow occured. > > Is this remotely exploitable? What are the ramifications of this bug? As Michael noted, the WIP code isn't actively used anywhere, but if it were: The target address of a PCI BAR mapping into SoC address space could be left uninitialized, leading to a bhnd(4) bus driver reading/writing to whatever SoC physical address range the window happened to be pointing to -- most likely unmapped memory. It's very unlikely that full driver attach and network interface bring-up would succeed. -landonf From owner-svn-src-head@freebsd.org Wed Aug 24 20:12:29 2016 Return-Path: Delivered-To: svn-src-head@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 4EDABBC5CB1; Wed, 24 Aug 2016 20:12:29 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 350551614; Wed, 24 Aug 2016 20:12:28 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id E3B9756488; Wed, 24 Aug 2016 15:12:21 -0500 (CDT) Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Ed Schouten , Bryan Drewery References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Eric van Gyzen Message-ID: <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> Date: Wed, 24 Aug 2016 15:12:18 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:12:29 -0000 On 08/24/2016 15:01, Ed Schouten wrote: > 2016-08-24 21:53 GMT+02:00 Bryan Drewery : >> Is it possible to cause the use of these old prototypes to print a >> warning and note that they are deprecated/unsafe? > > That's a good question. In theory, we could annotate these functions > with __attribute__((__deprecated__)): > > https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html > > But I'm actually too afraid to use it. In the worst case it may cause > the compiler to generate a warning even when basename()/dirname() is > used correctly, as __old_* will still be part of the compiled > expression. Could __warn_references() be used, as libc currently does for gets() and others? Eric From owner-svn-src-head@freebsd.org Wed Aug 24 20:16:41 2016 Return-Path: Delivered-To: svn-src-head@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 019B8BC5D72; Wed, 24 Aug 2016 20:16:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D16FF18CF; Wed, 24 Aug 2016 20:16:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C48611AA2; Wed, 24 Aug 2016 20:16:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8F6601AB27; Wed, 24 Aug 2016 20:16:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id kxVZQQ3dIeVP; Wed, 24 Aug 2016 20:16:37 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 62D341AB1F To: Eric van Gyzen , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Wed, 24 Aug 2016 13:16:34 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rsxs83XSIVWCo1inh3cIOc2KxDe14cFWb" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:16:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rsxs83XSIVWCo1inh3cIOc2KxDe14cFWb Content-Type: multipart/mixed; boundary="LBLMdnBaefR9SQIIAmJBrbMPlngg7Heif" From: Bryan Drewery To: Eric van Gyzen , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> In-Reply-To: <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> --LBLMdnBaefR9SQIIAmJBrbMPlngg7Heif Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/24/16 1:12 PM, Eric van Gyzen wrote: > On 08/24/2016 15:01, Ed Schouten wrote: >> 2016-08-24 21:53 GMT+02:00 Bryan Drewery : >>> Is it possible to cause the use of these old prototypes to print a >>> warning and note that they are deprecated/unsafe? >> >> That's a good question. In theory, we could annotate these functions >> with __attribute__((__deprecated__)): >> >> https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html >> >> But I'm actually too afraid to use it. In the worst case it may cause >> the compiler to generate a warning even when basename()/dirname() is >> used correctly, as __old_* will still be part of the compiled >> expression. >=20 > Could __warn_references() be used, as libc currently does for gets() an= d > others? >=20 > Eric >=20 /usr/include/stdio.h:extern char *gets (char *__s) __wur __attribute_deprecated__; /usr/include/x86_64-linux-gnu/sys/cdefs.h:# define __attribute_deprecated__ __attribute__ ((__deprecated__)) __wur being warning about unused result. As for actually using it here, I tried adding it onto the _old_dirname/basename prototypes. It produces an error, fine, in the bootstrap build for xinstall it would not error, great. However, for building xinstall on head where it will not use the __old_dirname and will use the new dirname@FBSD_1.5, it _still_ complains about using the __old_dirname() prototype via __generic and errors in the wrong case. --=20 Regards, Bryan Drewery --LBLMdnBaefR9SQIIAmJBrbMPlngg7Heif-- --rsxs83XSIVWCo1inh3cIOc2KxDe14cFWb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvgCjAAoJEDXXcbtuRpfPB0YH+gI3fhBCQoZnxfwd/DwqI9U4 Q2+uttqgmRndF3zbUresflVjbb3KNprPOWwc/YMgB6L5bpz9E5hctWqYEH/Q7AoL rXiRmtKoGx1A2TNcso8wP2zy5971ZQQJsVHwflDQDnJtFspHnbTAxylLs4U2beAq wVq+ICWWcEG3e8OUPshvulJZCQpJiATt1ytgG1iTmbcyEemakpc3onsDbYoyjlDY FZbhUkEhw0dfNL8esbUc0tBHlLSc4qH9y7AoQdC7ATOKHVpgj64Jufqos3W2HVwe 5zyS5SxbZ1vp4QjM5KwlBAkXbYIVfXGIHwyUSaC/7esaNzfxYyYDG5ikfkfWCHY= =OirR -----END PGP SIGNATURE----- --rsxs83XSIVWCo1inh3cIOc2KxDe14cFWb-- From owner-svn-src-head@freebsd.org Wed Aug 24 20:26:40 2016 Return-Path: Delivered-To: svn-src-head@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 C0187BC524E; Wed, 24 Aug 2016 20:26:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id A5C62132A; Wed, 24 Aug 2016 20:26:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 68FAE56488; Wed, 24 Aug 2016 15:26:39 -0500 (CDT) Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Eric van Gyzen Message-ID: <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> Date: Wed, 24 Aug 2016 15:26:38 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:26:40 -0000 On 08/24/2016 15:16, Bryan Drewery wrote: > On 8/24/16 1:12 PM, Eric van Gyzen wrote: >> On 08/24/2016 15:01, Ed Schouten wrote: >>> 2016-08-24 21:53 GMT+02:00 Bryan Drewery : >>>> Is it possible to cause the use of these old prototypes to print a >>>> warning and note that they are deprecated/unsafe? >>> >>> That's a good question. In theory, we could annotate these functions >>> with __attribute__((__deprecated__)): >>> >>> https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html >>> >>> But I'm actually too afraid to use it. In the worst case it may cause >>> the compiler to generate a warning even when basename()/dirname() is >>> used correctly, as __old_* will still be part of the compiled >>> expression. >> >> Could __warn_references() be used, as libc currently does for gets() and >> others? >> >> Eric >> > > /usr/include/stdio.h:extern char *gets (char *__s) __wur > __attribute_deprecated__; > /usr/include/x86_64-linux-gnu/sys/cdefs.h:# define > __attribute_deprecated__ __attribute__ ((__deprecated__)) > > __wur being warning about unused result. /usr/src/lib/libc/stdio/gets.c:__warn_references(gets, "warning: this program uses gets(), which is unsafe."); > As for actually using it here, I tried adding it onto the > _old_dirname/basename prototypes. It produces an error, fine, in the > bootstrap build for xinstall it would not error, great. However, for > building xinstall on head where it will not use the __old_dirname and > will use the new dirname@FBSD_1.5, it _still_ complains about using the > __old_dirname() prototype via __generic and errors in the wrong case. From owner-svn-src-head@freebsd.org Wed Aug 24 20:30:48 2016 Return-Path: Delivered-To: svn-src-head@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 1EE28BC52B6; Wed, 24 Aug 2016 20:30:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id EF4571569; Wed, 24 Aug 2016 20:30:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DFF4010A3; Wed, 24 Aug 2016 20:30:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9599A1ABC4; Wed, 24 Aug 2016 20:30:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 4829gImDNahM; Wed, 24 Aug 2016 20:30:38 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6BE2D1ABBD To: Eric van Gyzen , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: <7d2b7798-d444-427e-4790-3133977d339c@FreeBSD.org> Date: Wed, 24 Aug 2016 13:30:37 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PFHHruc4sOWS1kGAoJvSJxwO2RxXRV2ha" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:30:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PFHHruc4sOWS1kGAoJvSJxwO2RxXRV2ha Content-Type: multipart/mixed; boundary="GIenxGvqghToVuSqx75NenGlQqTLrGtu7" From: Bryan Drewery To: Eric van Gyzen , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <7d2b7798-d444-427e-4790-3133977d339c@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> In-Reply-To: <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> --GIenxGvqghToVuSqx75NenGlQqTLrGtu7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/24/16 1:26 PM, Eric van Gyzen wrote: > On 08/24/2016 15:16, Bryan Drewery wrote: >> On 8/24/16 1:12 PM, Eric van Gyzen wrote: >>> On 08/24/2016 15:01, Ed Schouten wrote: >>>> 2016-08-24 21:53 GMT+02:00 Bryan Drewery : >>>>> Is it possible to cause the use of these old prototypes to print a >>>>> warning and note that they are deprecated/unsafe? >>>> >>>> That's a good question. In theory, we could annotate these functions= >>>> with __attribute__((__deprecated__)): >>>> >>>> https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html >>>> >>>> But I'm actually too afraid to use it. In the worst case it may caus= e >>>> the compiler to generate a warning even when basename()/dirname() is= >>>> used correctly, as __old_* will still be part of the compiled >>>> expression. >>> >>> Could __warn_references() be used, as libc currently does for gets() = and >>> others? >>> >>> Eric >>> >> >> /usr/include/stdio.h:extern char *gets (char *__s) __wur >> __attribute_deprecated__; >> /usr/include/x86_64-linux-gnu/sys/cdefs.h:# define >> __attribute_deprecated__ __attribute__ ((__deprecated__)) >> >> __wur being warning about unused result. >=20 > /usr/src/lib/libc/stdio/gets.c:__warn_references(gets, "warning: this > program uses gets(), which is unsafe."); Ah! Ours! I misunderstood and thought about the FORTIFY_SOURCE glibc stuf= f. This is a linker warning. It would not be as obvious which line is the problem but would still tell the user they have potentially unsafe code. They also may not care if not using threads. We would need to move old_dirname/basename into their own .c files to use this I think. Playing around with that... >=20 >> As for actually using it here, I tried adding it onto the >> _old_dirname/basename prototypes. It produces an error, fine, in the >> bootstrap build for xinstall it would not error, great. However, for >> building xinstall on head where it will not use the __old_dirname and >> will use the new dirname@FBSD_1.5, it _still_ complains about using th= e >> __old_dirname() prototype via __generic and errors in the wrong case. --=20 Regards, Bryan Drewery --GIenxGvqghToVuSqx75NenGlQqTLrGtu7-- --PFHHruc4sOWS1kGAoJvSJxwO2RxXRV2ha Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvgPuAAoJEDXXcbtuRpfP3z0H/05MD7icwot25ALx+t9zntDA GkVG7CK+yIRYxTAX0ml/NoHi4Y3xbzlj38QVovl7Sp76QOgHyQQWNqwLy20LbuH8 /O6TuNNLReAkr45RputjVND8Bc8F3bxhOxL/wMsO1M53UEwbKUtRYnxcpxXC1zxx LwnTCyJTZu087r6vQDsJZuJeA3v5Fptw49U3B/sIAggndCHAOElQT4urCXqEAJqb w+l/4W5OzzFVSuaHH31RYOjOO2TusIoVrjB5YVYTacDIdFPMFn0MgHX8jVefkdU7 n+ntKjOy1GRVRJQVD+YoaAW1+37IIcu9/cm5VEH9oCd/aMej/6YZXr8hSPgfBR4= =YtwC -----END PGP SIGNATURE----- --PFHHruc4sOWS1kGAoJvSJxwO2RxXRV2ha-- From owner-svn-src-head@freebsd.org Wed Aug 24 20:51:00 2016 Return-Path: Delivered-To: svn-src-head@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 A0118BC5A45; Wed, 24 Aug 2016 20:51:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 746CF1F96; Wed, 24 Aug 2016 20:51:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 67EFF1407; Wed, 24 Aug 2016 20:51:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 297C81AC1B; Wed, 24 Aug 2016 20:51:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 5JYWbrLOL5mH; Wed, 24 Aug 2016 20:50:50 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 649051AC14 To: Eric van Gyzen , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> <7d2b7798-d444-427e-4790-3133977d339c@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: <069cbdf0-ed53-f939-49f6-645e0c557d70@FreeBSD.org> Date: Wed, 24 Aug 2016 13:50:49 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <7d2b7798-d444-427e-4790-3133977d339c@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BRBKPh2WUqT2q60as3HkMkAnnIHROCJh4" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 20:51:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BRBKPh2WUqT2q60as3HkMkAnnIHROCJh4 Content-Type: multipart/mixed; boundary="ghMIj2RWlQmjbe9FJkD2bacGBFlH5ivWR" From: Bryan Drewery To: Eric van Gyzen , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <069cbdf0-ed53-f939-49f6-645e0c557d70@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <62adcb77-490e-0691-0942-9218c1d55b68@FreeBSD.org> <8ef5b79d-5e7e-d5be-db8e-ae5284abdc31@FreeBSD.org> <7d2b7798-d444-427e-4790-3133977d339c@FreeBSD.org> In-Reply-To: <7d2b7798-d444-427e-4790-3133977d339c@FreeBSD.org> --ghMIj2RWlQmjbe9FJkD2bacGBFlH5ivWR Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/24/16 1:30 PM, Bryan Drewery wrote: > On 8/24/16 1:26 PM, Eric van Gyzen wrote: >> On 08/24/2016 15:16, Bryan Drewery wrote: >>> On 8/24/16 1:12 PM, Eric van Gyzen wrote: >>>> On 08/24/2016 15:01, Ed Schouten wrote: >>>>> 2016-08-24 21:53 GMT+02:00 Bryan Drewery : >>>>>> Is it possible to cause the use of these old prototypes to print a= >>>>>> warning and note that they are deprecated/unsafe? >>>>> >>>>> That's a good question. In theory, we could annotate these function= s >>>>> with __attribute__((__deprecated__)): >>>>> >>>>> https://gcc.gnu.org/onlinedocs/gcc-3.3.4/gcc/Type-Attributes.html >>>>> >>>>> But I'm actually too afraid to use it. In the worst case it may cau= se >>>>> the compiler to generate a warning even when basename()/dirname() i= s >>>>> used correctly, as __old_* will still be part of the compiled >>>>> expression. >>>> >>>> Could __warn_references() be used, as libc currently does for gets()= and >>>> others? >>>> >>>> Eric >>>> >>> >>> /usr/include/stdio.h:extern char *gets (char *__s) __wur >>> __attribute_deprecated__; >>> /usr/include/x86_64-linux-gnu/sys/cdefs.h:# define >>> __attribute_deprecated__ __attribute__ ((__deprecated__)) >>> >>> __wur being warning about unused result. >> >> /usr/src/lib/libc/stdio/gets.c:__warn_references(gets, "warning: this >> program uses gets(), which is unsafe."); >=20 > Ah! Ours! I misunderstood and thought about the FORTIFY_SOURCE glibc st= uff. >=20 > This is a linker warning. It would not be as obvious which line is the= > problem but would still tell the user they have potentially unsafe code= =2E > They also may not care if not using threads. Ah no it is specific, great: > xinstall.o: In function `makelink': > /root/svn/releng/11.0/usr.bin/xinstall/xinstall.c:688: warning: warning= : this program uses basename(const char *), which is deprecated and threa= d-unsafe. Not sure what I think about it though. >=20 > We would need to move old_dirname/basename into their own .c files to > use this I think. Playing around with that... >=20 >> >>> As for actually using it here, I tried adding it onto the >>> _old_dirname/basename prototypes. It produces an error, fine, in the= >>> bootstrap build for xinstall it would not error, great. However, for= >>> building xinstall on head where it will not use the __old_dirname and= >>> will use the new dirname@FBSD_1.5, it _still_ complains about using t= he >>> __old_dirname() prototype via __generic and errors in the wrong case.= >=20 >=20 --=20 Regards, Bryan Drewery --ghMIj2RWlQmjbe9FJkD2bacGBFlH5ivWR-- --BRBKPh2WUqT2q60as3HkMkAnnIHROCJh4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvgipAAoJEDXXcbtuRpfPsFIIAM8GOvsK5ugiOExZ/7DpS+FW 1IGwgjLESp1bfWgOkrC1jkPctaqrYf7cptmUPkpXW8tD6tsZDRa2Mhn0EzpZkgFu cpVOVynuvI0qv2N2Nmw+2eDb8wmUhGvgGcMckpVeg/FT0K2VcFvA5VhsHw+g6Y5B z+7tqtCL7gqA0WiR82S67fo9rhnCfrB/k/xwB7mQ5YhgNicfrwXK68TCbTFPCbWB jTSBZHhKI10ukfhPCcRSxebafTcGjwsVBG3hnk0N1PQ2YSVBWMrCj3GMgI6Mg0ns 9eHZJNCBYUzQq3rWpRqXsO/T/geDg6RMG9Wnth6nSKrebJX5W213C01WN6sU+q0= =jjLV -----END PGP SIGNATURE----- --BRBKPh2WUqT2q60as3HkMkAnnIHROCJh4-- From owner-svn-src-head@freebsd.org Wed Aug 24 23:02:21 2016 Return-Path: Delivered-To: svn-src-head@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 6716ABC5ADE; Wed, 24 Aug 2016 23:02:21 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1F8181276; Wed, 24 Aug 2016 23:02:21 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ON2K1v059876; Wed, 24 Aug 2016 23:02:20 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ON2Ks7059875; Wed, 24 Aug 2016 23:02:20 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201608242302.u7ON2Ks7059875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 24 Aug 2016 23:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304778 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 23:02:21 -0000 Author: allanjude Date: Wed Aug 24 23:02:20 2016 New Revision: 304778 URL: https://svnweb.freebsd.org/changeset/base/304778 Log: Increase the default rotation threshold of log files from 100kb to 1000kb Submitted by: Sean Kelly Differential Revision: https://reviews.freebsd.org/D6792 Modified: head/etc/newsyslog.conf Modified: head/etc/newsyslog.conf ============================================================================== --- head/etc/newsyslog.conf Wed Aug 24 22:59:41 2016 (r304777) +++ head/etc/newsyslog.conf Wed Aug 24 23:02:20 2016 (r304778) @@ -18,26 +18,26 @@ # # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/all.log 600 7 * @T00 J -/var/log/amd.log 644 7 100 * J -/var/log/auth.log 600 7 100 @0101T JC -/var/log/console.log 600 5 100 * J -/var/log/cron 600 3 100 * JC +/var/log/amd.log 644 7 1000 * J +/var/log/auth.log 600 7 1000 @0101T JC +/var/log/console.log 600 5 1000 * J +/var/log/cron 600 3 1000 * JC /var/log/daily.log 640 7 * @T00 JN -/var/log/debug.log 600 7 100 * JC -/var/log/init.log 644 3 100 * J -/var/log/kerberos.log 600 7 100 * J -/var/log/lpd-errs 644 7 100 * JC +/var/log/debug.log 600 7 1000 * JC +/var/log/init.log 644 3 1000 * J +/var/log/kerberos.log 600 7 1000 * J +/var/log/lpd-errs 644 7 1000 * JC /var/log/maillog 640 7 * @T00 JC -/var/log/messages 644 5 100 @0101T JC +/var/log/messages 644 5 1000 @0101T JC /var/log/monthly.log 640 12 * $M1D0 JN -/var/log/pflog 600 3 100 * JB /var/run/pflogd.pid -/var/log/ppp.log root:network 640 3 100 * JC -/var/log/devd.log 644 3 100 * JC -/var/log/security 600 10 100 * JC +/var/log/pflog 600 3 1000 * JB /var/run/pflogd.pid +/var/log/ppp.log root:network 640 3 1000 * JC +/var/log/devd.log 644 3 1000 * JC +/var/log/security 600 10 1000 * JC /var/log/sendmail.st 640 10 * 168 BN /var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 * $W6D0 JN -/var/log/xferlog 600 7 100 * JC +/var/log/xferlog 600 7 1000 * JC /etc/newsyslog.conf.d/* /usr/local/etc/newsyslog.conf.d/* From owner-svn-src-head@freebsd.org Thu Aug 25 02:40:15 2016 Return-Path: Delivered-To: svn-src-head@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 7587CBC5E61; Thu, 25 Aug 2016 02:40:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 461711FE3; Thu, 25 Aug 2016 02:40:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P2eESX038842; Thu, 25 Aug 2016 02:40:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P2eEfV038841; Thu, 25 Aug 2016 02:40:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608250240.u7P2eEfV038841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 25 Aug 2016 02:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304779 - head/etc/ntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 02:40:15 -0000 Author: cy Date: Thu Aug 25 02:40:14 2016 New Revision: 304779 URL: https://svnweb.freebsd.org/changeset/base/304779 Log: Revert r298887 (spelling fix) and remove $FreeBSD$ because text changes to leap-seconds invaldidates validation hash at the end of the file. Remove svn:keywords and replace with fbsd:nokeywords=yes to support this change. MFC after: 1 day Modified: head/etc/ntp/leap-seconds (contents, props changed) Modified: head/etc/ntp/leap-seconds ============================================================================== --- head/etc/ntp/leap-seconds Wed Aug 24 23:02:20 2016 (r304778) +++ head/etc/ntp/leap-seconds Thu Aug 25 02:40:14 2016 (r304779) @@ -1,6 +1,4 @@ # -# $FreeBSD$ -# # In the following text, the symbol '#' introduces # a comment, which continues from that symbol until # the end of the line. A plain comment line has a @@ -46,7 +44,7 @@ # by the International Bureau of Weights and Measures # (BIPM). See www.bipm.fr for more information. # -# 3. The current definition of the relationship between UTC +# 3. The current defintion of the relationship between UTC # and TAI dates from 1 January 1972. A number of different # time scales were in use before than epoch, and it can be # quite difficult to compute precise timestamps and time From owner-svn-src-head@freebsd.org Thu Aug 25 02:45:53 2016 Return-Path: Delivered-To: svn-src-head@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 B24FCBC4052; Thu, 25 Aug 2016 02:45:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73BC415A0; Thu, 25 Aug 2016 02:45:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P2jqIQ042291; Thu, 25 Aug 2016 02:45:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P2jq26042290; Thu, 25 Aug 2016 02:45:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608250245.u7P2jq26042290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 25 Aug 2016 02:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304780 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 02:45:53 -0000 Author: cy Date: Thu Aug 25 02:45:52 2016 New Revision: 304780 URL: https://svnweb.freebsd.org/changeset/base/304780 Log: Change the algorithm by which /var/db/leap-seconds is updated. 1. Use the leap-seconds version number (update time) to determine whether to update the file or not. 2. If the version numbers of the files is the same, use the later expiry date to determine which file to use. Suggested by: ian@ MFC after: 1 day Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Aug 25 02:40:14 2016 (r304779) +++ head/etc/rc.d/ntpd Thu Aug 25 02:45:52 2016 (r304780) @@ -67,11 +67,13 @@ current_ntp_ts() { } get_ntp_leapfile_ver() { + # Leapfile update date (version number). expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ '^\([1-9][0-9]*\)$' \| 0 } get_ntp_leapfile_expiry() { + # Leapfile expiry date. expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ '^\([1-9][0-9]*\)$' \| 0 } @@ -88,19 +90,23 @@ ntpd_fetch_leapfile() { ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) + ntp_expiry_src=$(get_ntp_leapfile_expiry $ntp_src_leapfile) ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) + ntp_expiry_db=$(get_ntp_leapfile_expiry $ntp_db_leapfile) $verbose ntp_src_leapfile version is $ntp_ver_no_src $verbose ntp_db_leapfile version is $ntp_ver_no_db - if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" ]; then + if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" -o \ + "$ntp_ver_no_src" -eq "$ntp_ver_no_db" -a \ + "$ntp_expiry_src" -gt "$ntp_expiry_db" ]; then $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile cp -p $ntp_src_leapfile $ntp_db_leapfile ntp_ver_no_db=$ntp_ver_no_src else $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile fi - ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) + ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then $verbose Within ntp leapfile expiry limit, initiating fetch @@ -108,8 +114,11 @@ ntpd_fetch_leapfile() { $verbose fetching $url fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break done + ntp_ver_no_tmp=$(get_ntp_leapfile_ver $ntp_tmp_leapfile) ntp_expiry_tmp=$(get_ntp_leapfile_expiry $ntp_tmp_leapfile) - if [ "$ntp_expiry_tmp" -gt "$ntp_leap_expiry" ]; then + if [ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" -o \ + "$ntp_ver_no_tmp" -eq "$ntp_ver_no_db" -a \ + "$ntp_expiry_tmp" -gt "$ntp_expiry_db" ]; then $verbose using $url as $ntp_db_leapfile mv $ntp_tmp_leapfile $ntp_db_leapfile else From owner-svn-src-head@freebsd.org Thu Aug 25 02:58:42 2016 Return-Path: Delivered-To: svn-src-head@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 5B929BC4320; Thu, 25 Aug 2016 02:58:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7C219BE; Thu, 25 Aug 2016 02:58:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P2wfnK045992; Thu, 25 Aug 2016 02:58:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P2wfLm045991; Thu, 25 Aug 2016 02:58:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608250258.u7P2wfLm045991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 25 Aug 2016 02:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304781 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 02:58:42 -0000 Author: cy Date: Thu Aug 25 02:58:41 2016 New Revision: 304781 URL: https://svnweb.freebsd.org/changeset/base/304781 Log: Add logic to replace the working ntp leap-seconds file in /var/db if it contains a $FreeBSD$ header. The header will cause the file to fail checksum of the hash causing ntpd to ignore the file. MFC after: 1 day Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Aug 25 02:45:52 2016 (r304780) +++ head/etc/rc.d/ntpd Thu Aug 25 02:58:41 2016 (r304781) @@ -87,6 +87,13 @@ ntpd_fetch_leapfile() { verbose=: fi + # Refresh working leapfile with an invalid hash due to + # FreeBSD id header. Ntpd will ignore leapfiles with a + # mismatch hash. The file must be the virgin file from + # the source. + test -f $ntp_db_leapfile && + grep -q '\$FreeBSD.*\$' $ntp_db_leapfile && + cp -p $ntp_src_leapfile $ntp_db_leapfile ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) From owner-svn-src-head@freebsd.org Thu Aug 25 03:09:24 2016 Return-Path: Delivered-To: svn-src-head@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 BC900BC481D; Thu, 25 Aug 2016 03:09:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF541525; Thu, 25 Aug 2016 03:09:24 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P39NfJ050596; Thu, 25 Aug 2016 03:09:23 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P39N3I050595; Thu, 25 Aug 2016 03:09:23 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608250309.u7P39N3I050595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 25 Aug 2016 03:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304782 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 03:09:24 -0000 Author: cy Date: Thu Aug 25 03:09:23 2016 New Revision: 304782 URL: https://svnweb.freebsd.org/changeset/base/304782 Log: Make validation of the leap-seconds file unconditional. MFC after: 1 day Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Aug 25 02:58:41 2016 (r304781) +++ head/etc/rc.d/ntpd Thu Aug 25 03:09:23 2016 (r304782) @@ -29,6 +29,8 @@ ntpd_precmd() rc_flags="-g $rc_flags" fi + ntpd_valid_leapfile + if [ ! -f $ntp_db_leapfile ]; then ntpd_fetch_leapfile fi @@ -78,6 +80,19 @@ get_ntp_leapfile_expiry() { '^\([1-9][0-9]*\)$' \| 0 } +ntpd_valid_leapfile() { + # Refresh working leapfile with an invalid hash due to + # FreeBSD id header. Ntpd will ignore leapfiles with a + # mismatch hash. The file must be the virgin file from + # the source. + if [ -f $ntp_db_leapfile ]; then + grep -q '\$FreeBSD.*\$' $ntp_db_leapfile && + cp -p $ntp_src_leapfile $ntp_db_leapfile + else + cp -p $ntp_src_leapfile $ntp_db_leapfile + fi +} + ntpd_fetch_leapfile() { local ntp_tmp_leapfile rc verbose @@ -87,13 +102,6 @@ ntpd_fetch_leapfile() { verbose=: fi - # Refresh working leapfile with an invalid hash due to - # FreeBSD id header. Ntpd will ignore leapfiles with a - # mismatch hash. The file must be the virgin file from - # the source. - test -f $ntp_db_leapfile && - grep -q '\$FreeBSD.*\$' $ntp_db_leapfile && - cp -p $ntp_src_leapfile $ntp_db_leapfile ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) From owner-svn-src-head@freebsd.org Thu Aug 25 04:40:52 2016 Return-Path: Delivered-To: svn-src-head@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 7FE1DBC316B; Thu, 25 Aug 2016 04:40:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 414AE1EB7; Thu, 25 Aug 2016 04:40:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P4ep5Z086979; Thu, 25 Aug 2016 04:40:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P4epYL086977; Thu, 25 Aug 2016 04:40:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250440.u7P4epYL086977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 04:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304783 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 04:40:52 -0000 Author: sephe Date: Thu Aug 25 04:40:51 2016 New Revision: 304783 URL: https://svnweb.freebsd.org/changeset/base/304783 Log: hyperv/hn: Use definition in net/rndis.h for message type and status code. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7620 Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 25 03:09:23 2016 (r304782) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 25 04:40:51 2016 (r304783) @@ -31,6 +31,7 @@ #ifndef __HV_RNDIS_H__ #define __HV_RNDIS_H__ +#include /* * NDIS protocol version numbers @@ -48,95 +49,6 @@ #define NDIS_VERSION (NDIS_VERSION_5_1) /* - * Status codes - */ - -#define STATUS_SUCCESS (0x00000000L) -#define STATUS_UNSUCCESSFUL (0xC0000001L) -#define STATUS_PENDING (0x00000103L) -#define STATUS_INSUFFICIENT_RESOURCES (0xC000009AL) -#define STATUS_BUFFER_OVERFLOW (0x80000005L) -#define STATUS_NOT_SUPPORTED (0xC00000BBL) - -#define RNDIS_STATUS_SUCCESS (STATUS_SUCCESS) -#define RNDIS_STATUS_PENDING (STATUS_PENDING) -#define RNDIS_STATUS_NOT_RECOGNIZED (0x00010001L) -#define RNDIS_STATUS_NOT_COPIED (0x00010002L) -#define RNDIS_STATUS_NOT_ACCEPTED (0x00010003L) -#define RNDIS_STATUS_CALL_ACTIVE (0x00010007L) - -#define RNDIS_STATUS_ONLINE (0x40010003L) -#define RNDIS_STATUS_RESET_START (0x40010004L) -#define RNDIS_STATUS_RESET_END (0x40010005L) -#define RNDIS_STATUS_RING_STATUS (0x40010006L) -#define RNDIS_STATUS_CLOSED (0x40010007L) -#define RNDIS_STATUS_WAN_LINE_UP (0x40010008L) -#define RNDIS_STATUS_WAN_LINE_DOWN (0x40010009L) -#define RNDIS_STATUS_WAN_FRAGMENT (0x4001000AL) -#define RNDIS_STATUS_MEDIA_CONNECT (0x4001000BL) -#define RNDIS_STATUS_MEDIA_DISCONNECT (0x4001000CL) -#define RNDIS_STATUS_HARDWARE_LINE_UP (0x4001000DL) -#define RNDIS_STATUS_HARDWARE_LINE_DOWN (0x4001000EL) -#define RNDIS_STATUS_INTERFACE_UP (0x4001000FL) -#define RNDIS_STATUS_INTERFACE_DOWN (0x40010010L) -#define RNDIS_STATUS_MEDIA_BUSY (0x40010011L) -#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION (0x40010012L) -#define RNDIS_STATUS_WW_INDICATION RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION -#define RNDIS_STATUS_LINK_SPEED_CHANGE (0x40010013L) - -#define RNDIS_STATUS_NOT_RESETTABLE (0x80010001L) -#define RNDIS_STATUS_SOFT_ERRORS (0x80010003L) -#define RNDIS_STATUS_HARD_ERRORS (0x80010004L) -#define RNDIS_STATUS_BUFFER_OVERFLOW (STATUS_BUFFER_OVERFLOW) - -#define RNDIS_STATUS_FAILURE (STATUS_UNSUCCESSFUL) -#define RNDIS_STATUS_RESOURCES (STATUS_INSUFFICIENT_RESOURCES) -#define RNDIS_STATUS_CLOSING (0xC0010002L) -#define RNDIS_STATUS_BAD_VERSION (0xC0010004L) -#define RNDIS_STATUS_BAD_CHARACTERISTICS (0xC0010005L) -#define RNDIS_STATUS_ADAPTER_NOT_FOUND (0xC0010006L) -#define RNDIS_STATUS_OPEN_FAILED (0xC0010007L) -#define RNDIS_STATUS_DEVICE_FAILED (0xC0010008L) -#define RNDIS_STATUS_MULTICAST_FULL (0xC0010009L) -#define RNDIS_STATUS_MULTICAST_EXISTS (0xC001000AL) -#define RNDIS_STATUS_MULTICAST_NOT_FOUND (0xC001000BL) -#define RNDIS_STATUS_REQUEST_ABORTED (0xC001000CL) -#define RNDIS_STATUS_RESET_IN_PROGRESS (0xC001000DL) -#define RNDIS_STATUS_CLOSING_INDICATING (0xC001000EL) -#define RNDIS_STATUS_NOT_SUPPORTED (STATUS_NOT_SUPPORTED) -#define RNDIS_STATUS_INVALID_PACKET (0xC001000FL) -#define RNDIS_STATUS_OPEN_LIST_FULL (0xC0010010L) -#define RNDIS_STATUS_ADAPTER_NOT_READY (0xC0010011L) -#define RNDIS_STATUS_ADAPTER_NOT_OPEN (0xC0010012L) -#define RNDIS_STATUS_NOT_INDICATING (0xC0010013L) -#define RNDIS_STATUS_INVALID_LENGTH (0xC0010014L) -#define RNDIS_STATUS_INVALID_DATA (0xC0010015L) -#define RNDIS_STATUS_BUFFER_TOO_SHORT (0xC0010016L) -#define RNDIS_STATUS_INVALID_OID (0xC0010017L) -#define RNDIS_STATUS_ADAPTER_REMOVED (0xC0010018L) -#define RNDIS_STATUS_UNSUPPORTED_MEDIA (0xC0010019L) -#define RNDIS_STATUS_GROUP_ADDRESS_IN_USE (0xC001001AL) -#define RNDIS_STATUS_FILE_NOT_FOUND (0xC001001BL) -#define RNDIS_STATUS_ERROR_READING_FILE (0xC001001CL) -#define RNDIS_STATUS_ALREADY_MAPPED (0xC001001DL) -#define RNDIS_STATUS_RESOURCE_CONFLICT (0xC001001EL) -#define RNDIS_STATUS_NO_CABLE (0xC001001FL) - -#define RNDIS_STATUS_INVALID_SAP (0xC0010020L) -#define RNDIS_STATUS_SAP_IN_USE (0xC0010021L) -#define RNDIS_STATUS_INVALID_ADDRESS (0xC0010022L) -#define RNDIS_STATUS_VC_NOT_ACTIVATED (0xC0010023L) -#define RNDIS_STATUS_DEST_OUT_OF_ORDER (0xC0010024L) -#define RNDIS_STATUS_VC_NOT_AVAILABLE (0xC0010025L) -#define RNDIS_STATUS_CELLRATE_NOT_AVAILABLE (0xC0010026L) -#define RNDIS_STATUS_INCOMPATABLE_QOS (0xC0010027L) -#define RNDIS_STATUS_AAL_PARAMS_UNSUPPORTED (0xC0010028L) -#define RNDIS_STATUS_NO_ROUTE_TO_DESTINATION (0xC0010029L) - -#define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR (0xC0011000L) - - -/* * Object Identifiers used by NdisRequest Query/Set Information */ @@ -289,82 +201,6 @@ */ #define OID_RNDISMP_GET_RECEIVE_BUFFERS 0xFFA0C90D // Query only - -/* - * Remote NDIS message types - */ -#define REMOTE_NDIS_PACKET_MSG 0x00000001 -#define REMOTE_NDIS_INITIALIZE_MSG 0x00000002 -#define REMOTE_NDIS_HALT_MSG 0x00000003 -#define REMOTE_NDIS_QUERY_MSG 0x00000004 -#define REMOTE_NDIS_SET_MSG 0x00000005 -#define REMOTE_NDIS_RESET_MSG 0x00000006 -#define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007 -#define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008 - -#define REMOTE_CONDIS_MP_CREATE_VC_MSG 0x00008001 -#define REMOTE_CONDIS_MP_DELETE_VC_MSG 0x00008002 -#define REMOTE_CONDIS_MP_ACTIVATE_VC_MSG 0x00008005 -#define REMOTE_CONDIS_MP_DEACTIVATE_VC_MSG 0x00008006 -#define REMOTE_CONDIS_INDICATE_STATUS_MSG 0x00008007 - -/* - * Remote NDIS message completion types - */ -#define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002 -#define REMOTE_NDIS_QUERY_CMPLT 0x80000004 -#define REMOTE_NDIS_SET_CMPLT 0x80000005 -#define REMOTE_NDIS_RESET_CMPLT 0x80000006 -#define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008 - -#define REMOTE_CONDIS_MP_CREATE_VC_CMPLT 0x80008001 -#define REMOTE_CONDIS_MP_DELETE_VC_CMPLT 0x80008002 -#define REMOTE_CONDIS_MP_ACTIVATE_VC_CMPLT 0x80008005 -#define REMOTE_CONDIS_MP_DEACTIVATE_VC_CMPLT 0x80008006 - -/* - * Reserved message type for private communication between lower-layer - * host driver and remote device, if necessary. - */ -#define REMOTE_NDIS_BUS_MSG 0xff000001 - -/* - * Defines for DeviceFlags in rndis_initialize_complete - */ -#define RNDIS_DF_CONNECTIONLESS 0x00000001 -#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 -#define RNDIS_DF_RAW_DATA 0x00000004 - -/* - * Remote NDIS medium types. - */ -#define RNDIS_MEDIUM_802_3 0x00000000 -#define RNDIS_MEDIUM_802_5 0x00000001 -#define RNDIS_MEDIUM_FDDI 0x00000002 -#define RNDIS_MEDIUM_WAN 0x00000003 -#define RNDIS_MEDIUM_LOCAL_TALK 0x00000004 -#define RNDIS_MEDIUM_ARCNET_RAW 0x00000006 -#define RNDIS_MEDIUM_ARCNET_878_2 0x00000007 -#define RNDIS_MEDIUM_ATM 0x00000008 -#define RNDIS_MEDIUM_WIRELESS_WAN 0x00000009 -#define RNDIS_MEDIUM_IRDA 0x0000000a -#define RNDIS_MEDIUM_CO_WAN 0x0000000b -/* Not a real medium, defined as an upper bound */ -#define RNDIS_MEDIUM_MAX 0x0000000d - -/* - * Remote NDIS medium connection states. - */ -#define RNDIS_MEDIA_STATE_CONNECTED 0x00000000 -#define RNDIS_MEDIA_STATE_DISCONNECTED 0x00000001 - -/* - * Remote NDIS version numbers - */ -#define RNDIS_MAJOR_VERSION 0x00000001 -#define RNDIS_MINOR_VERSION 0x00000000 - - /* * Remote NDIS offload parameters */ Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 25 03:09:23 2016 (r304782) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 25 04:40:51 2016 (r304783) @@ -325,7 +325,7 @@ hv_rf_receive_response(rndis_device *dev response->msg_len); } else { request->response_msg.msg.init_complete.status = - STATUS_BUFFER_OVERFLOW; + RNDIS_STATUS_BUFFER_OVERFLOW; } sema_post(&request->wait_sema); } @@ -389,7 +389,7 @@ hv_rf_send_offload_request(struct hn_sof device_printf(dev, "hv send offload request succeeded\n"); ret = 0; } else { - if (set_complete->status == STATUS_NOT_SUPPORTED) { + if (set_complete->status == RNDIS_STATUS_NOT_SUPPORTED) { device_printf(dev, "HV Not support offload\n"); ret = 0; } else { @@ -886,8 +886,8 @@ hv_rf_init_device(rndis_device *device) /* Set up the rndis set */ init = &request->request_msg.msg.init_request; - init->major_version = RNDIS_MAJOR_VERSION; - init->minor_version = RNDIS_MINOR_VERSION; + init->major_version = RNDIS_VERSION_MAJOR; + init->minor_version = RNDIS_VERSION_MINOR; /* * Per the RNDIS document, this should be set to the max MTU * plus the header size. However, 2048 works fine, so leaving From owner-svn-src-head@freebsd.org Thu Aug 25 04:52:52 2016 Return-Path: Delivered-To: svn-src-head@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 51935BC3465; Thu, 25 Aug 2016 04:52:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 05C30168F; Thu, 25 Aug 2016 04:52:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P4qpGL092223; Thu, 25 Aug 2016 04:52:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P4qpA1092222; Thu, 25 Aug 2016 04:52:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250452.u7P4qpA1092222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 04:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304784 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 04:52:52 -0000 Author: sephe Date: Thu Aug 25 04:52:50 2016 New Revision: 304784 URL: https://svnweb.freebsd.org/changeset/base/304784 Log: hyperv/hn: Add compat code for RNDIS reorganization phase. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7621 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 25 04:40:51 2016 (r304783) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 25 04:52:50 2016 (r304784) @@ -62,6 +62,9 @@ __FBSDID("$FreeBSD$"); HV_RF_RECVINFO_HASHINF | \ HV_RF_RECVINFO_HASHVAL) +#define HN_RNDIS_RID_COMPAT_MASK 0xffff +#define HN_RNDIS_RID_COMPAT_MAX HN_RNDIS_RID_COMPAT_MASK + /* * Forward declarations */ @@ -202,9 +205,8 @@ hv_rndis_request(rndis_device *device, u * as a template. */ set = &rndis_mesg->msg.set_request; - set->request_id = atomic_fetchadd_int(&device->new_request_id, 1); - /* Increment to get the new value (call above returns old value) */ - set->request_id += 1; + set->request_id = atomic_fetchadd_int(&device->new_request_id, 1) & + HN_RNDIS_RID_COMPAT_MASK; /* Add to the request list */ mtx_lock(&device->req_lock); @@ -552,6 +554,7 @@ hv_rf_on_receive(struct hn_softc *sc, st { rndis_device *rndis_dev; const rndis_msg *rndis_hdr; + const struct rndis_comp_hdr *comp; rndis_dev = sc->rndis_dev; if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) @@ -569,7 +572,11 @@ hv_rf_on_receive(struct hn_softc *sc, st case REMOTE_NDIS_QUERY_CMPLT: case REMOTE_NDIS_SET_CMPLT: case REMOTE_NDIS_KEEPALIVE_CMPLT: - hv_rf_receive_response(rndis_dev, rndis_hdr); + comp = data; + if (comp->rm_rid <= HN_RNDIS_RID_COMPAT_MAX) { + /* Transition time compat code */ + hv_rf_receive_response(rndis_dev, rndis_hdr); + } break; /* notification message */ From owner-svn-src-head@freebsd.org Thu Aug 25 05:00:43 2016 Return-Path: Delivered-To: svn-src-head@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 A9032BC3884; Thu, 25 Aug 2016 05:00:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 81DAB1D59; Thu, 25 Aug 2016 05:00:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P50gtv092615; Thu, 25 Aug 2016 05:00:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P50gFa092608; Thu, 25 Aug 2016 05:00:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250500.u7P50gFa092608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 05:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304785 - in head/sys: dev/hyperv/netvsc net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:00:43 -0000 Author: sephe Date: Thu Aug 25 05:00:41 2016 New Revision: 304785 URL: https://svnweb.freebsd.org/changeset/base/304785 Log: hyperv/hn: Use vmbus xact for RNDIS initialize. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7624 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 25 04:52:50 2016 (r304784) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 25 05:00:41 2016 (r304785) @@ -77,7 +77,7 @@ static void hn_nvs_sent_none(struct hn_s static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc, struct vmbus_channel *, const void *, int); -static struct hn_send_ctx hn_send_ctx_none = +struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); uint32_t Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 25 04:52:50 2016 (r304784) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 25 05:00:41 2016 (r304785) @@ -239,6 +239,11 @@ typedef struct { uint8_t link_state; } netvsc_device_info; +#define HN_XACT_REQ_PGCNT 2 +#define HN_XACT_RESP_PGCNT 2 +#define HN_XACT_REQ_SIZE (HN_XACT_REQ_PGCNT * PAGE_SIZE) +#define HN_XACT_RESP_SIZE (HN_XACT_RESP_PGCNT * PAGE_SIZE) + #ifndef HN_USE_TXDESC_BUFRING struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); @@ -375,6 +380,8 @@ typedef struct hn_softc { uint32_t hn_chim_gpadl; struct hyperv_dma hn_chim_dma; + + uint32_t hn_rndis_rid; } hn_softc_t; #define HN_FLAG_RXBUF_CONNECTED 0x0001 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 25 04:52:50 2016 (r304784) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 25 05:00:41 2016 (r304785) @@ -125,9 +125,6 @@ __FBSDID("$FreeBSD$"); /* Short for Hyper-V network interface */ #define NETVSC_DEVNAME "hn" -#define HN_XACT_REQ_SIZE (2 * PAGE_SIZE) -#define HN_XACT_RESP_SIZE (2 * PAGE_SIZE) - /* * It looks like offset 0 of buf is reserved to hold the softc pointer. * The sc pointer evidently not needed, and is not presently populated. Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 25 04:52:50 2016 (r304784) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 25 05:00:41 2016 (r304785) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); #define HN_RNDIS_RID_COMPAT_MASK 0xffff #define HN_RNDIS_RID_COMPAT_MAX HN_RNDIS_RID_COMPAT_MASK +#define HN_RNDIS_XFER_SIZE 2048 + /* * Forward declarations */ @@ -95,6 +97,20 @@ static void hn_rndis_sent_cb(struct hn_s struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); +static __inline uint32_t +hn_rndis_rid(struct hn_softc *sc) +{ + uint32_t rid; + +again: + rid = atomic_fetchadd_int(&sc->hn_rndis_rid, 1); + if (rid == 0) + goto again; + + /* Use upper 16 bits for non-compat RNDIS messages. */ + return ((rid & 0xffff) << 16); +} + /* * Set the Per-Packet-Info with the specified type */ @@ -576,6 +592,8 @@ hv_rf_on_receive(struct hn_softc *sc, st if (comp->rm_rid <= HN_RNDIS_RID_COMPAT_MAX) { /* Transition time compat code */ hv_rf_receive_response(rndis_dev, rndis_hdr); + } else { + vmbus_xact_ctx_wakeup(sc->hn_xact, data, dlen); } break; @@ -872,62 +890,139 @@ exit: return (ret); } -/* - * RNDIS filter init device - */ -static int -hv_rf_init_device(rndis_device *device) +static const void * +hn_rndis_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, uint32_t rid, + size_t reqlen, size_t min_complen, uint32_t comp_type) { - rndis_request *request; - rndis_initialize_request *init; - rndis_initialize_complete *init_complete; - uint32_t status; - int ret; + struct vmbus_gpa gpa[HN_XACT_REQ_PGCNT]; + const struct rndis_comp_hdr *comp; + bus_addr_t paddr; + size_t comp_len; + int gpa_cnt, error; + + KASSERT(rid > HN_RNDIS_RID_COMPAT_MAX, ("invalid rid %u\n", rid)); + KASSERT(reqlen <= HN_XACT_REQ_SIZE && reqlen > 0, + ("invalid request length %zu", reqlen)); + KASSERT(min_complen >= sizeof(*comp), + ("invalid minimum complete len %zu", min_complen)); - request = hv_rndis_request(device, REMOTE_NDIS_INITIALIZE_MSG, - RNDIS_MESSAGE_SIZE(rndis_initialize_request)); - if (!request) { - ret = -1; - goto cleanup; + /* + * Setup the SG list. + */ + paddr = vmbus_xact_req_paddr(xact); + KASSERT((paddr & PAGE_MASK) == 0, + ("vmbus xact request is not page aligned 0x%jx", (uintmax_t)paddr)); + for (gpa_cnt = 0; gpa_cnt < HN_XACT_REQ_PGCNT; ++gpa_cnt) { + int len = PAGE_SIZE; + + if (reqlen == 0) + break; + if (reqlen < len) + len = reqlen; + + gpa[gpa_cnt].gpa_page = atop(paddr) + gpa_cnt; + gpa[gpa_cnt].gpa_len = len; + gpa[gpa_cnt].gpa_ofs = 0; + + reqlen -= len; } + KASSERT(reqlen == 0, ("still have %zu request data left", reqlen)); - /* Set up the rndis set */ - init = &request->request_msg.msg.init_request; - init->major_version = RNDIS_VERSION_MAJOR; - init->minor_version = RNDIS_VERSION_MINOR; /* - * Per the RNDIS document, this should be set to the max MTU - * plus the header size. However, 2048 works fine, so leaving - * it as is. + * Send this RNDIS control message and wait for its completion + * message. */ - init->max_xfer_size = 2048; - - device->state = RNDIS_DEV_INITIALIZING; + vmbus_xact_activate(xact); + error = hv_nv_on_send(sc->hn_prichan, HN_NVS_RNDIS_MTYPE_CTRL, + &hn_send_ctx_none, gpa, gpa_cnt); + if (error) { + vmbus_xact_deactivate(xact); + if_printf(sc->hn_ifp, "RNDIS ctrl send failed: %d\n", error); + return (NULL); + } + comp = vmbus_xact_wait(xact, &comp_len); - ret = hv_rf_send_request(device, request, REMOTE_NDIS_INITIALIZE_MSG); - if (ret != 0) { - device->state = RNDIS_DEV_UNINITIALIZED; - goto cleanup; + /* + * Check this RNDIS complete message. + */ + if (comp_len < min_complen) { + if_printf(sc->hn_ifp, "invalid RNDIS comp len %zu\n", comp_len); + return (NULL); + } + if (comp->rm_len < min_complen) { + if_printf(sc->hn_ifp, "invalid RNDIS comp msglen %u\n", + comp->rm_len); + return (NULL); + } + if (comp->rm_type != comp_type) { + if_printf(sc->hn_ifp, "unexpected RNDIS comp 0x%08x, " + "expect 0x%08x\n", comp->rm_type, comp_type); + return (NULL); + } + if (comp->rm_rid != rid) { + if_printf(sc->hn_ifp, "RNDIS comp rid mismatch %u, " + "expect %u\n", comp->rm_rid, rid); + return (NULL); } + /* All pass! */ + return (comp); +} - sema_wait(&request->wait_sema); +/* + * RNDIS filter init device + */ +static int +hv_rf_init_device(rndis_device *device) +{ + struct hn_softc *sc = device->sc; + struct rndis_init_req *req; + const struct rndis_init_comp *comp; + struct vmbus_xact *xact; + uint32_t rid; + int error; - init_complete = &request->response_msg.msg.init_complete; - status = init_complete->status; - if (status == RNDIS_STATUS_SUCCESS) { - device->state = RNDIS_DEV_INITIALIZED; - ret = 0; - } else { - device->state = RNDIS_DEV_UNINITIALIZED; - ret = -1; - } + /* XXX */ + device->state = RNDIS_DEV_INITIALIZED; -cleanup: - if (request) { - hv_put_rndis_request(device, request); + xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for RNDIS init\n"); + return (ENXIO); + } + rid = hn_rndis_rid(sc); + req = vmbus_xact_req_data(xact); + req->rm_type = REMOTE_NDIS_INITIALIZE_MSG; + req->rm_len = sizeof(*req); + req->rm_rid = rid; + req->rm_ver_major = RNDIS_VERSION_MAJOR; + req->rm_ver_minor = RNDIS_VERSION_MINOR; + req->rm_max_xfersz = HN_RNDIS_XFER_SIZE; + + comp = hn_rndis_xact_execute(sc, xact, rid, sizeof(*req), + RNDIS_INIT_COMP_SIZE_MIN, REMOTE_NDIS_INITIALIZE_CMPLT); + if (comp == NULL) { + if_printf(sc->hn_ifp, "exec RNDIS init failed\n"); + error = EIO; + goto done; + } + + if (comp->rm_status != RNDIS_STATUS_SUCCESS) { + if_printf(sc->hn_ifp, "RNDIS init failed: status 0x%08x\n", + comp->rm_status); + error = EIO; + goto done; + } + if (bootverbose) { + if_printf(sc->hn_ifp, "RNDIS ver %u.%u, pktsz %u, pktcnt %u\n", + comp->rm_ver_major, comp->rm_ver_minor, + comp->rm_pktmaxsz, comp->rm_pktmaxcnt); } + error = 0; - return (ret); +done: + if (xact != NULL) + vmbus_xact_put(xact); + return (error); } #define HALT_COMPLETION_WAIT_COUNT 25 Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 25 04:52:50 2016 (r304784) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 25 05:00:41 2016 (r304785) @@ -115,4 +115,6 @@ const void *hn_nvs_xact_execute(struct h uint32_t hn_chim_alloc(struct hn_softc *sc); void hn_chim_free(struct hn_softc *sc, uint32_t chim_idx); +extern struct hn_send_ctx hn_send_ctx_none; + #endif /* !_IF_HNVAR_H_ */ Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Thu Aug 25 04:52:50 2016 (r304784) +++ head/sys/net/rndis.h Thu Aug 25 05:00:41 2016 (r304785) @@ -146,6 +146,9 @@ struct rndis_init_comp { uint32_t rm_aflistsz; }; +#define RNDIS_INIT_COMP_SIZE_MIN \ + __offsetof(struct rndis_init_comp, rm_aflistsz) + /* Halt the device. No response sent. */ #define REMOTE_NDIS_HALT_MSG 0x00000003 From owner-svn-src-head@freebsd.org Thu Aug 25 05:11:05 2016 Return-Path: Delivered-To: svn-src-head@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 A55DEBC3AF9; Thu, 25 Aug 2016 05:11:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6848C12B7; Thu, 25 Aug 2016 05:11:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P5B490096288; Thu, 25 Aug 2016 05:11:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P5B4sQ096286; Thu, 25 Aug 2016 05:11:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250511.u7P5B4sQ096286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 05:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304786 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:11:05 -0000 Author: sephe Date: Thu Aug 25 05:11:04 2016 New Revision: 304786 URL: https://svnweb.freebsd.org/changeset/base/304786 Log: hyperv/ic: Cleanup heartbeat channel callback. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7626 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/vmbus_icreg.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Aug 25 05:00:41 2016 (r304785) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Aug 25 05:11:04 2016 (r304786) @@ -22,23 +22,22 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include -#include #include -#include +#include #include -#include -#include #include #include #include -#include -#include "hv_util.h" +#include +#include + #include "vmbus_if.h" static const struct vmbus_ic_desc vmbus_heartbeat_descs[] = { @@ -51,55 +50,64 @@ static const struct vmbus_ic_desc vmbus_ VMBUS_IC_DESC_END }; -/** - * Process heartbeat message - */ static void -hv_heartbeat_cb(struct vmbus_channel *channel, void *context) +vmbus_heartbeat_cb(struct vmbus_channel *chan, void *xsc) { - uint8_t* buf; - int recvlen; - uint64_t requestid; - int ret; - - struct hv_vmbus_heartbeat_msg_data* heartbeat_msg; - struct hv_vmbus_icmsg_hdr* icmsghdrp; - hv_util_sc *softc; - - softc = (hv_util_sc*)context; - buf = softc->receive_buffer; - - recvlen = softc->ic_buflen; - ret = vmbus_chan_recv(channel, buf, &recvlen, &requestid); - KASSERT(ret != ENOBUFS, ("hvheartbeat recvbuf is not large enough")); - /* XXX check recvlen to make sure that it contains enough data */ - - if ((ret == 0) && recvlen > 0) { - - icmsghdrp = (struct hv_vmbus_icmsg_hdr *) - &buf[sizeof(struct hv_vmbus_pipe_hdr)]; - - if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - int error; + struct hv_util_sc *sc = xsc; + struct vmbus_icmsg_hdr *hdr; + int dlen, error; + uint64_t xactid; + void *data; + + /* + * Receive request. + */ + data = sc->receive_buffer; + dlen = sc->ic_buflen; + error = vmbus_chan_recv(chan, data, &dlen, &xactid); + KASSERT(error != ENOBUFS, ("icbuf is not large enough")); + if (error) + return; + + if (dlen < sizeof(struct vmbus_icmsg_hdr)) { + device_printf(sc->ic_dev, "invalid data len %d\n", dlen); + return; + } + hdr = data; - error = vmbus_ic_negomsg(softc, buf, recvlen); + /* + * Update request, which will be echoed back as response. + */ + switch (hdr->ic_type) { + case VMBUS_ICMSG_TYPE_NEGOTIATE: + error = vmbus_ic_negomsg(sc, data, dlen); if (error) return; - } else { - heartbeat_msg = - (struct hv_vmbus_heartbeat_msg_data *) - &buf[sizeof(struct hv_vmbus_pipe_hdr) + - sizeof(struct hv_vmbus_icmsg_hdr)]; - - heartbeat_msg->seq_num += 1; - } + break; - icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | - HV_ICMSGHDRFLAG_RESPONSE; - - vmbus_chan_send(channel, VMBUS_CHANPKT_TYPE_INBAND, 0, - buf, recvlen, requestid); + case VMBUS_ICMSG_TYPE_HEARTBEAT: + /* Only ic_seq is a must */ + if (dlen < VMBUS_ICMSG_HEARTBEAT_SIZE_MIN) { + device_printf(sc->ic_dev, "invalid heartbeat len %d\n", + dlen); + return; + } + ((struct vmbus_icmsg_heartbeat *)data)->ic_seq++; + break; + + default: + device_printf(sc->ic_dev, "got 0x%08x icmsg\n", hdr->ic_type); + break; } + + /* + * Send response by echoing the updated request back. + */ + hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP; + error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0, + data, dlen, xactid); + if (error) + device_printf(sc->ic_dev, "resp send failed: %d\n", error); } static int @@ -112,7 +120,8 @@ hv_heartbeat_probe(device_t dev) static int hv_heartbeat_attach(device_t dev) { - return hv_util_attach(dev, hv_heartbeat_cb); + + return (hv_util_attach(dev, vmbus_heartbeat_cb)); } static device_method_t heartbeat_methods[] = { Modified: head/sys/dev/hyperv/utilities/vmbus_icreg.h ============================================================================== --- head/sys/dev/hyperv/utilities/vmbus_icreg.h Thu Aug 25 05:00:41 2016 (r304785) +++ head/sys/dev/hyperv/utilities/vmbus_icreg.h Thu Aug 25 05:11:04 2016 (r304786) @@ -81,4 +81,14 @@ struct vmbus_icmsg_negotiate { uint32_t ic_ver[]; } __packed; +/* VMBUS_ICMSG_TYPE_HEARTBEAT */ +struct vmbus_icmsg_heartbeat { + struct vmbus_icmsg_hdr ic_hdr; + uint64_t ic_seq; + uint32_t ic_rsvd[8]; +} __packed; + +#define VMBUS_ICMSG_HEARTBEAT_SIZE_MIN \ + __offsetof(struct vmbus_icmsg_heartbeat, ic_rsvd[0]) + #endif /* !_VMBUS_ICREG_H_ */ From owner-svn-src-head@freebsd.org Thu Aug 25 05:22:56 2016 Return-Path: Delivered-To: svn-src-head@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 2CB0DBC3E27; Thu, 25 Aug 2016 05:22:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E943E19AF; Thu, 25 Aug 2016 05:22:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P5MtLG003351; Thu, 25 Aug 2016 05:22:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P5MrEL003331; Thu, 25 Aug 2016 05:22:53 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608250522.u7P5MrEL003331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Aug 2016 05:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304787 - in head: sys/cam/ctl sys/dev/cxgbe/cxgbei sys/dev/iscsi sys/dev/iser usr.bin/iscsictl usr.sbin/ctladm usr.sbin/ctld usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:22:56 -0000 Author: np Date: Thu Aug 25 05:22:53 2016 New Revision: 304787 URL: https://svnweb.freebsd.org/changeset/base/304787 Log: Make the iSCSI parameter negotiation more flexible. Decouple the send and receive limits on the amount of data in a single iSCSI PDU. MaxRecvDataSegmentLength is declarative, not negotiated, and is direction-specific so there is no reason for both ends to limit themselves to the same min(initiator, target) value in both directions. Allow iSCSI drivers to report their send, receive, first burst, and max burst limits explicitly instead of using hardcoded values or trying to derive all of them from the receive limit (which was the only limit reported by the drivers prior to this change). Display the send and receive limits separately in the userspace iSCSI utilities. Reviewed by: jpaetzel@ (earlier version), trasz@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7279 Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h head/sys/cam/ctl/ctl_ioctl.h head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi.h head/sys/dev/iscsi/iscsi_ioctl.h head/sys/dev/iser/icl_iser.c head/usr.bin/iscsictl/iscsictl.c head/usr.sbin/ctladm/ctladm.c head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/kernel.c head/usr.sbin/ctld/login.c head/usr.sbin/ctld/pdu.c head/usr.sbin/iscsid/iscsid.c head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/login.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Aug 25 05:22:53 2016 (r304787) @@ -1512,7 +1512,8 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * */ cs->cs_cmdsn = cihp->cmdsn; cs->cs_statsn = cihp->statsn; - cs->cs_max_data_segment_length = cihp->max_recv_data_segment_length; + cs->cs_max_recv_data_segment_length = cihp->max_recv_data_segment_length; + cs->cs_max_send_data_segment_length = cihp->max_send_data_segment_length; cs->cs_max_burst_length = cihp->max_burst_length; cs->cs_first_burst_length = cihp->first_burst_length; cs->cs_immediate_data = !!cihp->immediate_data; @@ -1652,9 +1653,10 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) "%u" "%s" "%s" - "%zd" - "%zd" - "%zd" + "%d" + "%d" + "%d" + "%d" "%d" "%d" "%s" @@ -1665,7 +1667,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) cs->cs_target->ct_tag, cs->cs_conn->ic_header_crc32c ? "CRC32C" : "None", cs->cs_conn->ic_data_crc32c ? "CRC32C" : "None", - cs->cs_max_data_segment_length, + cs->cs_max_recv_data_segment_length, + cs->cs_max_send_data_segment_length, cs->cs_max_burst_length, cs->cs_first_burst_length, cs->cs_immediate_data, @@ -1794,12 +1797,12 @@ static void cfiscsi_ioctl_limits(struct ctl_iscsi *ci) { struct ctl_iscsi_limits_params *cilp; + struct icl_drv_limits idl; int error; cilp = (struct ctl_iscsi_limits_params *)&(ci->data); - error = icl_limits(cilp->offload, false, - &cilp->data_segment_limit); + error = icl_limits(cilp->offload, false, &idl); if (error != 0) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1808,6 +1811,13 @@ cfiscsi_ioctl_limits(struct ctl_iscsi *c return; } + cilp->max_recv_data_segment_length = + idl.idl_max_recv_data_segment_length; + cilp->max_send_data_segment_length = + idl.idl_max_send_data_segment_length; + cilp->max_burst_length = idl.idl_max_burst_length; + cilp->first_burst_length = idl.idl_first_burst_length; + ci->status = CTL_ISCSI_OK; } @@ -2466,12 +2476,12 @@ cfiscsi_datamove_in(union ctl_io *io) /* * Truncate to maximum data segment length. */ - KASSERT(response->ip_data_len < cs->cs_max_data_segment_length, - ("ip_data_len %zd >= max_data_segment_length %zd", - response->ip_data_len, cs->cs_max_data_segment_length)); + KASSERT(response->ip_data_len < cs->cs_max_send_data_segment_length, + ("ip_data_len %zd >= max_send_data_segment_length %d", + response->ip_data_len, cs->cs_max_send_data_segment_length)); if (response->ip_data_len + len > - cs->cs_max_data_segment_length) { - len = cs->cs_max_data_segment_length - + cs->cs_max_send_data_segment_length) { + len = cs->cs_max_send_data_segment_length - response->ip_data_len; KASSERT(len <= sg_len, ("len %zd > sg_len %zd", len, sg_len)); @@ -2529,7 +2539,7 @@ cfiscsi_datamove_in(union ctl_io *io) i++; } - if (response->ip_data_len == cs->cs_max_data_segment_length) { + if (response->ip_data_len == cs->cs_max_send_data_segment_length) { /* * Can't stuff more data into the current PDU; * queue it. Note that's not enough to check Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Thu Aug 25 05:22:53 2016 (r304787) @@ -84,9 +84,10 @@ struct cfiscsi_session { struct cv cs_maintenance_cv; bool cs_terminating; bool cs_tasks_aborted; - size_t cs_max_data_segment_length; - size_t cs_max_burst_length; - size_t cs_first_burst_length; + int cs_max_recv_data_segment_length; + int cs_max_send_data_segment_length; + int cs_max_burst_length; + int cs_first_burst_length; bool cs_immediate_data; char cs_initiator_name[CTL_ISCSI_NAME_LEN]; char cs_initiator_addr[CTL_ISCSI_ADDR_LEN]; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/cam/ctl/ctl_ioctl.h Thu Aug 25 05:22:53 2016 (r304787) @@ -622,7 +622,7 @@ struct ctl_iscsi_handoff_params { char target_name[CTL_ISCSI_NAME_LEN]; int socket; int portal_group_tag; - + /* * Connection parameters negotiated by ctld(8). */ @@ -630,17 +630,17 @@ struct ctl_iscsi_handoff_params { ctl_iscsi_digest data_digest; uint32_t cmdsn; uint32_t statsn; - uint32_t max_recv_data_segment_length; - uint32_t max_burst_length; - uint32_t first_burst_length; + int max_recv_data_segment_length; + int max_burst_length; + int first_burst_length; uint32_t immediate_data; char offload[CTL_ISCSI_OFFLOAD_LEN]; #ifdef ICL_KERNEL_PROXY int connection_id; - int spare[1]; #else - int spare[2]; + int spare; #endif + int max_send_data_segment_length; }; struct ctl_iscsi_list_params { @@ -671,11 +671,15 @@ struct ctl_iscsi_terminate_params { }; struct ctl_iscsi_limits_params { + /* passed to kernel */ char offload[CTL_ISCSI_OFFLOAD_LEN]; - /* passed to kernel */ - size_t data_segment_limit; - /* passed to userland */ - int spare[4]; + + /* passed to userland */ + size_t spare; + int max_recv_data_segment_length; + int max_send_data_segment_length; + int max_burst_length; + int first_burst_length; }; #ifdef ICL_KERNEL_PROXY Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 05:22:53 2016 (r304787) @@ -832,10 +832,13 @@ icl_cxgbei_conn_transfer_done(struct icl } static int -icl_cxgbei_limits(size_t *limitp) +icl_cxgbei_limits(struct icl_drv_limits *idl) { - *limitp = CXGBEI_MAX_DSL; + idl->idl_max_recv_data_segment_length = CXGBEI_MAX_DSL; + idl->idl_max_send_data_segment_length = CXGBEI_MAX_DSL; + idl->idl_max_burst_length = 2 * 1024 * 1024; + idl->idl_first_burst_length = CXGBEI_MAX_DSL; return (0); } Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iscsi/icl.c Thu Aug 25 05:22:53 2016 (r304787) @@ -59,7 +59,7 @@ struct icl_module { char *im_name; bool im_iser; int im_priority; - int (*im_limits)(size_t *limitp); + int (*im_limits)(struct icl_drv_limits *idl); struct icl_conn *(*im_new_conn)(const char *name, struct mtx *lock); }; @@ -182,11 +182,12 @@ icl_new_conn(const char *offload, bool i } int -icl_limits(const char *offload, bool iser, size_t *limitp) +icl_limits(const char *offload, bool iser, struct icl_drv_limits *idl) { struct icl_module *im; int error; + bzero(idl, sizeof(*idl)); sx_slock(&sc->sc_lock); im = icl_find(offload, iser, false); if (im == NULL) { @@ -194,14 +195,42 @@ icl_limits(const char *offload, bool ise return (ENXIO); } - error = im->im_limits(limitp); + error = im->im_limits(idl); sx_sunlock(&sc->sc_lock); + /* + * Validate the limits provided by the driver against values allowed by + * the iSCSI RFC. 0 means iscsid/ctld should pick a reasonable value. + * + * Note that max_send_dsl is an internal implementation detail and not + * part of the RFC. + */ +#define OUT_OF_RANGE(x, lo, hi) ((x) != 0 && ((x) < (lo) || (x) > (hi))) + if (error == 0 && + (OUT_OF_RANGE(idl->idl_max_recv_data_segment_length, 512, 16777215) || + OUT_OF_RANGE(idl->idl_max_send_data_segment_length, 512, 16777215) || + OUT_OF_RANGE(idl->idl_max_burst_length, 512, 16777215) || + OUT_OF_RANGE(idl->idl_first_burst_length, 512, 16777215))) { + error = EINVAL; + } +#undef OUT_OF_RANGE + + /* + * If both first_burst and max_burst are provided then first_burst must + * not exceed max_burst. + */ + if (error == 0 && idl->idl_first_burst_length > 0 && + idl->idl_max_burst_length > 0 && + idl->idl_first_burst_length > idl->idl_max_burst_length) { + error = EINVAL; + } + return (error); } int -icl_register(const char *offload, bool iser, int priority, int (*limits)(size_t *), +icl_register(const char *offload, bool iser, int priority, + int (*limits)(struct icl_drv_limits *), struct icl_conn *(*new_conn)(const char *, struct mtx *)) { struct icl_module *im; Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iscsi/icl.h Thu Aug 25 05:22:53 2016 (r304787) @@ -126,12 +126,20 @@ struct icl_conn { void *ic_prv0; }; +struct icl_drv_limits { + int idl_max_recv_data_segment_length; + int idl_max_send_data_segment_length; + int idl_max_burst_length; + int idl_first_burst_length; + int spare[4]; +}; + struct icl_conn *icl_new_conn(const char *offload, bool iser, const char *name, struct mtx *lock); -int icl_limits(const char *offload, bool iser, size_t *limitp); - +int icl_limits(const char *offload, bool iser, + struct icl_drv_limits *idl); int icl_register(const char *offload, bool iser, int priority, - int (*limits)(size_t *), + int (*limits)(struct icl_drv_limits *), struct icl_conn *(*new_conn)(const char *, struct mtx *)); int icl_unregister(const char *offload, bool rdma); Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iscsi/icl_soft.c Thu Aug 25 05:22:53 2016 (r304787) @@ -1474,10 +1474,10 @@ icl_soft_conn_transfer_done(struct icl_c } static int -icl_soft_limits(size_t *limitp) +icl_soft_limits(struct icl_drv_limits *idl) { - *limitp = 128 * 1024; + idl->idl_max_recv_data_segment_length = 128 * 1024; return (0); } Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iscsi/iscsi.c Thu Aug 25 05:22:53 2016 (r304787) @@ -1204,8 +1204,8 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res for (;;) { len = total_len; - if (len > is->is_max_data_segment_length) - len = is->is_max_data_segment_length; + if (len > is->is_max_send_data_segment_length) + len = is->is_max_send_data_segment_length; if (off + len > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "target requested invalid " @@ -1313,6 +1313,7 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof struct iscsi_daemon_request *request) { struct iscsi_session *is; + struct icl_drv_limits idl; int error; sx_slock(&sc->sc_lock); @@ -1352,10 +1353,9 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof request->idr_tsih = 0; /* New or reinstated session. */ memcpy(&request->idr_conf, &is->is_conf, sizeof(request->idr_conf)); - + error = icl_limits(is->is_conf.isc_offload, - is->is_conf.isc_iser, - &request->idr_limits.isl_max_data_segment_length); + is->is_conf.isc_iser, &idl); if (error != 0) { ISCSI_SESSION_WARN(is, "icl_limits for offload \"%s\" " "failed with error %d", is->is_conf.isc_offload, @@ -1363,6 +1363,14 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof sx_sunlock(&sc->sc_lock); return (error); } + request->idr_limits.isl_max_recv_data_segment_length = + idl.idl_max_recv_data_segment_length; + request->idr_limits.isl_max_send_data_segment_length = + idl.idl_max_recv_data_segment_length; + request->idr_limits.isl_max_burst_length = + idl.idl_max_burst_length; + request->idr_limits.isl_first_burst_length = + idl.idl_first_burst_length; sx_sunlock(&sc->sc_lock); return (0); @@ -1417,12 +1425,10 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ is->is_initial_r2t = handoff->idh_initial_r2t; is->is_immediate_data = handoff->idh_immediate_data; - /* - * Cap MaxRecvDataSegmentLength obtained from the target to the maximum - * size supported by our ICL module. - */ - is->is_max_data_segment_length = min(ic->ic_max_data_segment_length, - handoff->idh_max_data_segment_length); + is->is_max_recv_data_segment_length = + handoff->idh_max_recv_data_segment_length; + is->is_max_send_data_segment_length = + handoff->idh_max_send_data_segment_length; is->is_max_burst_length = handoff->idh_max_burst_length; is->is_first_burst_length = handoff->idh_first_burst_length; @@ -1634,7 +1640,7 @@ iscsi_ioctl_daemon_send(struct iscsi_sof return (EIO); datalen = ids->ids_data_segment_len; - if (datalen > ISCSI_MAX_DATA_SEGMENT_LENGTH) + if (datalen > is->is_max_send_data_segment_length) return (EINVAL); if (datalen > 0) { data = malloc(datalen, M_ISCSI, M_WAITOK); @@ -1933,12 +1939,15 @@ iscsi_ioctl_session_list(struct iscsi_so else iss.iss_data_digest = ISCSI_DIGEST_NONE; - iss.iss_max_data_segment_length = is->is_max_data_segment_length; + iss.iss_max_send_data_segment_length = + is->is_max_send_data_segment_length; + iss.iss_max_recv_data_segment_length = + is->is_max_recv_data_segment_length; iss.iss_max_burst_length = is->is_max_burst_length; iss.iss_first_burst_length = is->is_first_burst_length; iss.iss_immediate_data = is->is_immediate_data; iss.iss_connected = is->is_connected; - + error = copyout(&iss, isl->isl_pstates + i, sizeof(iss)); if (error != 0) { sx_sunlock(&sc->sc_lock); @@ -2259,12 +2268,13 @@ iscsi_action_scsiio(struct iscsi_session len = csio->dxfer_len; //ISCSI_SESSION_DEBUG(is, "adding %zd of immediate data", len); if (len > is->is_first_burst_length) { - ISCSI_SESSION_DEBUG(is, "len %zd -> %zd", len, is->is_first_burst_length); + ISCSI_SESSION_DEBUG(is, "len %zd -> %d", len, is->is_first_burst_length); len = is->is_first_burst_length; } - if (len > is->is_max_data_segment_length) { - ISCSI_SESSION_DEBUG(is, "len %zd -> %zd", len, is->is_max_data_segment_length); - len = is->is_max_data_segment_length; + if (len > is->is_max_send_data_segment_length) { + ISCSI_SESSION_DEBUG(is, "len %zd -> %d", len, + is->is_max_send_data_segment_length); + len = is->is_max_send_data_segment_length; } error = icl_pdu_append_data(request, csio->data_ptr, len, M_NOWAIT); Modified: head/sys/dev/iscsi/iscsi.h ============================================================================== --- head/sys/dev/iscsi/iscsi.h Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iscsi/iscsi.h Thu Aug 25 05:22:53 2016 (r304787) @@ -62,12 +62,13 @@ struct iscsi_session { int is_header_digest; int is_data_digest; int is_initial_r2t; - size_t is_max_burst_length; - size_t is_first_burst_length; + int is_max_burst_length; + int is_first_burst_length; uint8_t is_isid[6]; uint16_t is_tsih; bool is_immediate_data; - size_t is_max_data_segment_length; + int is_max_recv_data_segment_length; + int is_max_send_data_segment_length; char is_target_alias[ISCSI_ALIAS_LEN]; TAILQ_HEAD(, iscsi_outstanding) is_outstanding; Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iscsi/iscsi_ioctl.h Thu Aug 25 05:22:53 2016 (r304787) @@ -76,8 +76,12 @@ struct iscsi_session_conf { * iscsid(8) must obey those when negotiating operational parameters. */ struct iscsi_session_limits { - size_t isl_max_data_segment_length; - int isl_spare[8]; + size_t isl_spare0; + int isl_max_recv_data_segment_length; + int isl_max_send_data_segment_length; + int isl_max_burst_length; + int isl_first_burst_length; + int isl_spare[4]; }; /* @@ -89,14 +93,15 @@ struct iscsi_session_state { char iss_target_alias[ISCSI_ALIAS_LEN]; int iss_header_digest; int iss_data_digest; - int iss_max_data_segment_length; + int iss_max_recv_data_segment_length; int iss_max_burst_length; int iss_first_burst_length; int iss_immediate_data; int iss_connected; char iss_reason[ISCSI_REASON_LEN]; char iss_offload[ISCSI_OFFLOAD_LEN]; - int iss_spare[4]; + int iss_max_send_data_segment_length; + int iss_spare[3]; }; /* @@ -122,12 +127,13 @@ struct iscsi_daemon_handoff { uint32_t idh_statsn; int idh_header_digest; int idh_data_digest; - size_t idh_max_data_segment_length; - size_t idh_max_burst_length; - size_t idh_first_burst_length; + size_t spare[3]; int idh_immediate_data; int idh_initial_r2t; - int idh_spare[4]; + int idh_max_recv_data_segment_length; + int idh_max_send_data_segment_length; + int idh_max_burst_length; + int idh_first_burst_length; }; struct iscsi_daemon_fail { Modified: head/sys/dev/iser/icl_iser.c ============================================================================== --- head/sys/dev/iser/icl_iser.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/sys/dev/iser/icl_iser.c Thu Aug 25 05:22:53 2016 (r304787) @@ -483,9 +483,9 @@ iser_conn_task_done(struct icl_conn *ic, } static int -iser_limits(size_t *limitp) +iser_limits(struct icl_drv_limits *idl) { - *limitp = 128 * 1024; + idl->idl_max_recv_data_segment_length = 128 * 1024; return (0); } Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.bin/iscsictl/iscsictl.c Thu Aug 25 05:22:53 2016 (r304787) @@ -514,70 +514,74 @@ kernel_list(int iscsi_fd, const struct t * Display-only modifier as this information * is also present within the 'session' container */ - xo_emit("{L:/%-18s}{V:sessionId/%u}\n", + xo_emit("{L:/%-25s}{V:sessionId/%u}\n", "Session ID:", state->iss_id); xo_open_container("initiator"); - xo_emit("{L:/%-18s}{V:name/%s}\n", + xo_emit("{L:/%-25s}{V:name/%s}\n", "Initiator name:", conf->isc_initiator); - xo_emit("{L:/%-18s}{V:portal/%s}\n", + xo_emit("{L:/%-25s}{V:portal/%s}\n", "Initiator portal:", conf->isc_initiator_addr); - xo_emit("{L:/%-18s}{V:alias/%s}\n", + xo_emit("{L:/%-25s}{V:alias/%s}\n", "Initiator alias:", conf->isc_initiator_alias); xo_close_container("initiator"); xo_open_container("target"); - xo_emit("{L:/%-18s}{V:name/%s}\n", + xo_emit("{L:/%-25s}{V:name/%s}\n", "Target name:", conf->isc_target); - xo_emit("{L:/%-18s}{V:portal/%s}\n", + xo_emit("{L:/%-25s}{V:portal/%s}\n", "Target portal:", conf->isc_target_addr); - xo_emit("{L:/%-18s}{V:alias/%s}\n", + xo_emit("{L:/%-25s}{V:alias/%s}\n", "Target alias:", state->iss_target_alias); xo_close_container("target"); xo_open_container("auth"); - xo_emit("{L:/%-18s}{V:user/%s}\n", + xo_emit("{L:/%-25s}{V:user/%s}\n", "User:", conf->isc_user); - xo_emit("{L:/%-18s}{V:secret/%s}\n", + xo_emit("{L:/%-25s}{V:secret/%s}\n", "Secret:", conf->isc_secret); - xo_emit("{L:/%-18s}{V:mutualUser/%s}\n", + xo_emit("{L:/%-25s}{V:mutualUser/%s}\n", "Mutual user:", conf->isc_mutual_user); - xo_emit("{L:/%-18s}{V:mutualSecret/%s}\n", + xo_emit("{L:/%-25s}{V:mutualSecret/%s}\n", "Mutual secret:", conf->isc_mutual_secret); xo_close_container("auth"); - xo_emit("{L:/%-18s}{V:type/%s}\n", + xo_emit("{L:/%-25s}{V:type/%s}\n", "Session type:", conf->isc_discovery ? "Discovery" : "Normal"); - xo_emit("{L:/%-18s}{V:enable/%s}\n", + xo_emit("{L:/%-25s}{V:enable/%s}\n", "Enable:", conf->isc_enable ? "Yes" : "No"); - xo_emit("{L:/%-18s}{V:state/%s}\n", + xo_emit("{L:/%-25s}{V:state/%s}\n", "Session state:", state->iss_connected ? "Connected" : "Disconnected"); - xo_emit("{L:/%-18s}{V:failureReason/%s}\n", + xo_emit("{L:/%-25s}{V:failureReason/%s}\n", "Failure reason:", state->iss_reason); - xo_emit("{L:/%-18s}{V:headerDigest/%s}\n", + xo_emit("{L:/%-25s}{V:headerDigest/%s}\n", "Header digest:", state->iss_header_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - xo_emit("{L:/%-18s}{V:dataDigest/%s}\n", + xo_emit("{L:/%-25s}{V:dataDigest/%s}\n", "Data digest:", state->iss_data_digest == ISCSI_DIGEST_CRC32C ? "CRC32C" : "None"); - xo_emit("{L:/%-18s}{V:dataSegmentLen/%d}\n", - "DataSegmentLen:", state->iss_max_data_segment_length); - xo_emit("{L:/%-18s}{V:maxBurstLen/%d}\n", + xo_emit("{L:/%-25s}{V:recvDataSegmentLen/%d}\n", + "MaxRecvDataSegmentLength:", + state->iss_max_recv_data_segment_length); + xo_emit("{L:/%-25s}{V:sendDataSegmentLen/%d}\n", + "MaxSendDataSegmentLength:", + state->iss_max_send_data_segment_length); + xo_emit("{L:/%-25s}{V:maxBurstLen/%d}\n", "MaxBurstLen:", state->iss_max_burst_length); - xo_emit("{L:/%-18s}{V:firstBurstLen/%d}\n", + xo_emit("{L:/%-25s}{V:firstBurstLen/%d}\n", "FirstBurstLen:", state->iss_first_burst_length); - xo_emit("{L:/%-18s}{V:immediateData/%s}\n", + xo_emit("{L:/%-25s}{V:immediateData/%s}\n", "ImmediateData:", state->iss_immediate_data ? "Yes" : "No"); - xo_emit("{L:/%-18s}{V:iSER/%s}\n", + xo_emit("{L:/%-25s}{V:iSER/%s}\n", "iSER (RDMA):", conf->isc_iser ? "Yes" : "No"); - xo_emit("{L:/%-18s}{V:offloadDriver/%s}\n", + xo_emit("{L:/%-25s}{V:offloadDriver/%s}\n", "Offload driver:", state->iss_offload); - xo_emit("{L:/%-18s}", + xo_emit("{L:/%-25s}", "Device nodes:"); print_periphs(state->iss_id); xo_emit("\n\n"); Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/ctladm/ctladm.c Thu Aug 25 05:22:53 2016 (r304787) @@ -2794,7 +2794,8 @@ struct cctl_islist_conn { char *target_alias; char *header_digest; char *data_digest; - char *max_data_segment_length; + char *max_recv_data_segment_length; + char *max_send_data_segment_length; char *max_burst_length; char *first_burst_length; char *offload; @@ -2908,8 +2909,11 @@ cctl_islist_end_element(void *user_data, } else if (strcmp(name, "data_digest") == 0) { cur_conn->data_digest = str; str = NULL; - } else if (strcmp(name, "max_data_segment_length") == 0) { - cur_conn->max_data_segment_length = str; + } else if (strcmp(name, "max_recv_data_segment_length") == 0) { + cur_conn->max_recv_data_segment_length = str; + str = NULL; + } else if (strcmp(name, "max_send_data_segment_length") == 0) { + cur_conn->max_send_data_segment_length = str; str = NULL; } else if (strcmp(name, "max_burst_length") == 0) { cur_conn->max_burst_length = str; @@ -3030,20 +3034,21 @@ retry: if (verbose != 0) { STAILQ_FOREACH(conn, &islist.conn_list, links) { - printf("Session ID: %d\n", conn->connection_id); - printf("Initiator name: %s\n", conn->initiator); - printf("Initiator portal: %s\n", conn->initiator_addr); - printf("Initiator alias: %s\n", conn->initiator_alias); - printf("Target name: %s\n", conn->target); - printf("Target alias: %s\n", conn->target_alias); - printf("Header digest: %s\n", conn->header_digest); - printf("Data digest: %s\n", conn->data_digest); - printf("DataSegmentLen: %s\n", conn->max_data_segment_length); - printf("MaxBurstLen: %s\n", conn->max_burst_length); - printf("FirstBurstLen: %s\n", conn->first_burst_length); - printf("ImmediateData: %s\n", conn->immediate_data ? "Yes" : "No"); - printf("iSER (RDMA): %s\n", conn->iser ? "Yes" : "No"); - printf("Offload driver: %s\n", conn->offload); + printf("%-25s %d\n", "Session ID:", conn->connection_id); + printf("%-25s %s\n", "Initiator name:", conn->initiator); + printf("%-25s %s\n", "Initiator portal:", conn->initiator_addr); + printf("%-25s %s\n", "Initiator alias:", conn->initiator_alias); + printf("%-25s %s\n", "Target name:", conn->target); + printf("%-25s %s\n", "Target alias:", conn->target_alias); + printf("%-25s %s\n", "Header digest:", conn->header_digest); + printf("%-25s %s\n", "Data digest:", conn->data_digest); + printf("%-25s %s\n", "MaxRecvDataSegmentLength:", conn->max_recv_data_segment_length); + printf("%-25s %s\n", "MaxSendDataSegmentLength:", conn->max_send_data_segment_length); + printf("%-25s %s\n", "MaxBurstLen:", conn->max_burst_length); + printf("%-25s %s\n", "FirstBurstLen:", conn->first_burst_length); + printf("%-25s %s\n", "ImmediateData:", conn->immediate_data ? "Yes" : "No"); + printf("%-25s %s\n", "iSER (RDMA):", conn->iser ? "Yes" : "No"); + printf("%-25s %s\n", "Offload driver:", conn->offload); printf("\n"); } } else { Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/ctld/ctld.c Thu Aug 25 05:22:53 2016 (r304787) @@ -1578,8 +1578,9 @@ connection_new(struct portal *portal, in /* * Default values, from RFC 3720, section 12. */ - conn->conn_max_data_segment_length = 8192; + conn->conn_max_recv_data_segment_length = 8192; conn->conn_max_burst_length = 262144; + conn->conn_first_burst_length = 65536; conn->conn_immediate_data = true; return (conn); Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/ctld/ctld.h Thu Aug 25 05:22:53 2016 (r304787) @@ -242,10 +242,10 @@ struct connection { struct sockaddr_storage conn_initiator_sa; uint32_t conn_cmdsn; uint32_t conn_statsn; - size_t conn_data_segment_limit; - size_t conn_max_data_segment_length; - size_t conn_max_burst_length; - size_t conn_first_burst_length; + int conn_max_recv_data_segment_length; + int conn_max_send_data_segment_length; + int conn_max_burst_length; + int conn_first_burst_length; int conn_immediate_data; int conn_header_digest; int conn_data_digest; @@ -404,7 +404,10 @@ int kernel_lun_modify(struct lun *lun) int kernel_lun_remove(struct lun *lun); void kernel_handoff(struct connection *conn); void kernel_limits(const char *offload, - size_t *max_data_segment_length); + int *max_recv_data_segment_length, + int *max_send_data_segment_length, + int *max_burst_length, + int *first_burst_length); int kernel_port_add(struct port *port); int kernel_port_update(struct port *port, struct port *old); int kernel_port_remove(struct port *port); Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/ctld/kernel.c Thu Aug 25 05:22:53 2016 (r304787) @@ -898,7 +898,9 @@ kernel_handoff(struct connection *conn) req.data.handoff.cmdsn = conn->conn_cmdsn; req.data.handoff.statsn = conn->conn_statsn; req.data.handoff.max_recv_data_segment_length = - conn->conn_max_data_segment_length; + conn->conn_max_recv_data_segment_length; + req.data.handoff.max_send_data_segment_length = + conn->conn_max_send_data_segment_length; req.data.handoff.max_burst_length = conn->conn_max_burst_length; req.data.handoff.first_burst_length = conn->conn_first_burst_length; req.data.handoff.immediate_data = conn->conn_immediate_data; @@ -915,16 +917,18 @@ kernel_handoff(struct connection *conn) } void -kernel_limits(const char *offload, size_t *max_data_segment_length) +kernel_limits(const char *offload, int *max_recv_dsl, int *max_send_dsl, + int *max_burst_length, int *first_burst_length) { struct ctl_iscsi req; + struct ctl_iscsi_limits_params *cilp; bzero(&req, sizeof(req)); req.type = CTL_ISCSI_LIMITS; + cilp = (struct ctl_iscsi_limits_params *)&(req.data.limits); if (offload != NULL) { - strlcpy(req.data.limits.offload, offload, - sizeof(req.data.limits.offload)); + strlcpy(cilp->offload, offload, sizeof(cilp->offload)); } if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { @@ -937,13 +941,31 @@ kernel_limits(const char *offload, size_ "%s; dropping connection", req.error_str); } - *max_data_segment_length = req.data.limits.data_segment_limit; + if (cilp->max_recv_data_segment_length != 0) { + *max_recv_dsl = cilp->max_recv_data_segment_length; + *max_send_dsl = cilp->max_recv_data_segment_length; + } + if (cilp->max_send_data_segment_length != 0) + *max_send_dsl = cilp->max_send_data_segment_length; + if (cilp->max_burst_length != 0) + *max_burst_length = cilp->max_burst_length; + if (cilp->first_burst_length != 0) + *first_burst_length = cilp->first_burst_length; + if (*max_burst_length < *first_burst_length) + *first_burst_length = *max_burst_length; + if (offload != NULL) { - log_debugx("MaxRecvDataSegment kernel limit for offload " - "\"%s\" is %zd", offload, *max_data_segment_length); + log_debugx("Kernel limits for offload \"%s\" are " + "MaxRecvDataSegment=%d, max_send_dsl=%d, " + "MaxBurstLength=%d, FirstBurstLength=%d", + offload, *max_recv_dsl, *max_send_dsl, *max_burst_length, + *first_burst_length); } else { - log_debugx("MaxRecvDataSegment kernel limit is %zd", - *max_data_segment_length); + log_debugx("Kernel limits are " + "MaxRecvDataSegment=%d, max_send_dsl=%d, " + "MaxBurstLength=%d, FirstBurstLength=%d", + *max_recv_dsl, *max_send_dsl, *max_burst_length, + *first_burst_length); } } @@ -1217,18 +1239,21 @@ kernel_send(struct pdu *pdu) void kernel_receive(struct pdu *pdu) { + struct connection *conn; struct ctl_iscsi req; - pdu->pdu_data = malloc(MAX_DATA_SEGMENT_LENGTH); + conn = pdu->pdu_connection; + pdu->pdu_data = malloc(conn->conn_max_recv_data_segment_length); if (pdu->pdu_data == NULL) log_err(1, "malloc"); bzero(&req, sizeof(req)); req.type = CTL_ISCSI_RECEIVE; - req.data.receive.connection_id = pdu->pdu_connection->conn_socket; + req.data.receive.connection_id = conn->conn_socket; req.data.receive.bhs = pdu->pdu_bhs; - req.data.receive.data_segment_len = MAX_DATA_SEGMENT_LENGTH; + req.data.receive.data_segment_len = + conn->conn_max_recv_data_segment_length; req.data.receive.data_segment = pdu->pdu_data; if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/ctld/login.c Thu Aug 25 05:22:53 2016 (r304787) @@ -550,23 +550,32 @@ login_negotiate_key(struct pdu *request, log_errx(1, "received invalid " "MaxRecvDataSegmentLength"); } - if (tmp > conn->conn_data_segment_limit) { - log_debugx("capping MaxRecvDataSegmentLength " - "from %zd to %zd", tmp, conn->conn_data_segment_limit); - tmp = conn->conn_data_segment_limit; - } - conn->conn_max_data_segment_length = tmp; - keys_add_int(response_keys, name, conn->conn_data_segment_limit); + + /* + * MaxRecvDataSegmentLength is a direction-specific parameter. + * We'll limit our _send_ to what the initiator can handle but + * our MaxRecvDataSegmentLength is not influenced by the + * initiator in any way. + */ + if ((int)tmp > conn->conn_max_send_data_segment_length) { + log_debugx("capping max_send_data_segment_length " + "from %zd to %d", tmp, + conn->conn_max_send_data_segment_length); + tmp = conn->conn_max_send_data_segment_length; + } + conn->conn_max_send_data_segment_length = tmp; + keys_add_int(response_keys, name, + conn->conn_max_recv_data_segment_length); } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { login_send_error(request, 0x02, 0x00); log_errx(1, "received invalid MaxBurstLength"); } - if (tmp > MAX_BURST_LENGTH) { + if ((int)tmp > conn->conn_max_burst_length) { log_debugx("capping MaxBurstLength from %zd to %d", - tmp, MAX_BURST_LENGTH); - tmp = MAX_BURST_LENGTH; + tmp, conn->conn_max_burst_length); + tmp = conn->conn_max_burst_length; } conn->conn_max_burst_length = tmp; keys_add_int(response_keys, name, tmp); @@ -576,10 +585,10 @@ login_negotiate_key(struct pdu *request, login_send_error(request, 0x02, 0x00); log_errx(1, "received invalid FirstBurstLength"); } - if (tmp > FIRST_BURST_LENGTH) { + if ((int)tmp > conn->conn_first_burst_length) { log_debugx("capping FirstBurstLength from %zd to %d", - tmp, FIRST_BURST_LENGTH); - tmp = FIRST_BURST_LENGTH; + tmp, conn->conn_first_burst_length); + tmp = conn->conn_first_burst_length; } conn->conn_first_burst_length = tmp; keys_add_int(response_keys, name, tmp); @@ -681,14 +690,30 @@ login_negotiate(struct connection *conn, if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) { /* - * Query the kernel for MaxDataSegmentLength it can handle. - * In case of offload, it depends on hardware capabilities. + * Query the kernel for various size limits. In case of + * offload, it depends on hardware capabilities. */ assert(conn->conn_target != NULL); kernel_limits(conn->conn_portal->p_portal_group->pg_offload, - &conn->conn_data_segment_limit); + &conn->conn_max_recv_data_segment_length, + &conn->conn_max_send_data_segment_length, + &conn->conn_max_burst_length, + &conn->conn_first_burst_length); + + /* We expect legal, usable values at this point. */ + assert(conn->conn_max_recv_data_segment_length >= 512); + assert(conn->conn_max_recv_data_segment_length < (1 << 24)); + assert(conn->conn_max_burst_length >= 512); + assert(conn->conn_max_burst_length < (1 << 24)); + assert(conn->conn_first_burst_length >= 512); + assert(conn->conn_first_burst_length < (1 << 24)); + assert(conn->conn_first_burst_length <= + conn->conn_max_burst_length); } else { - conn->conn_data_segment_limit = MAX_DATA_SEGMENT_LENGTH; + conn->conn_max_recv_data_segment_length = + MAX_DATA_SEGMENT_LENGTH; + conn->conn_max_send_data_segment_length = + MAX_DATA_SEGMENT_LENGTH; } if (request == NULL) { @@ -739,6 +764,18 @@ login_negotiate(struct connection *conn, response_keys); } + /* + * We'd started with usable values at our end. But a bad initiator + * could have presented a large FirstBurstLength and then a smaller + * MaxBurstLength (in that order) and because we process the key/value + * pairs in the order they are in the request we might have ended up + * with illegal values here. + */ + if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL && + conn->conn_first_burst_length > conn->conn_max_burst_length) { + log_errx(1, "initiator sent FirstBurstLength > MaxBurstLength"); + } + log_debugx("operational parameter negotiation done; " "transitioning to Full Feature Phase"); Modified: head/usr.sbin/ctld/pdu.c ============================================================================== --- head/usr.sbin/ctld/pdu.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/ctld/pdu.c Thu Aug 25 05:22:53 2016 (r304787) @@ -117,7 +117,7 @@ pdu_receive_proxy(struct pdu *pdu) log_errx(1, "protocol error: non-empty AHS"); len = pdu_data_segment_length(pdu); - assert(len <= MAX_DATA_SEGMENT_LENGTH); + assert(len <= pdu->pdu_connection->conn_max_recv_data_segment_length); pdu->pdu_data_len = len; } @@ -164,6 +164,7 @@ pdu_read(int fd, char *data, size_t len) void pdu_receive(struct pdu *pdu) { + struct connection *conn; size_t len, padding; char dummy[4]; @@ -173,9 +174,10 @@ pdu_receive(struct pdu *pdu) #endif assert(proxy_mode == false); + conn = pdu->pdu_connection; - pdu_read(pdu->pdu_connection->conn_socket, - (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); + pdu_read(conn->conn_socket, (char *)pdu->pdu_bhs, + sizeof(*pdu->pdu_bhs)); len = pdu_ahs_length(pdu); if (len > 0) @@ -183,10 +185,10 @@ pdu_receive(struct pdu *pdu) len = pdu_data_segment_length(pdu); if (len > 0) { - if (len > MAX_DATA_SEGMENT_LENGTH) { + if ((int)len > conn->conn_max_recv_data_segment_length) { log_errx(1, "protocol error: received PDU " "with DataSegmentLength exceeding %d", - MAX_DATA_SEGMENT_LENGTH); + conn->conn_max_recv_data_segment_length); } pdu->pdu_data_len = len; @@ -194,14 +196,13 @@ pdu_receive(struct pdu *pdu) if (pdu->pdu_data == NULL) log_err(1, "malloc"); - pdu_read(pdu->pdu_connection->conn_socket, - (char *)pdu->pdu_data, pdu->pdu_data_len); + pdu_read(conn->conn_socket, (char *)pdu->pdu_data, + pdu->pdu_data_len); padding = pdu_padding(pdu); if (padding != 0) { assert(padding < sizeof(dummy)); - pdu_read(pdu->pdu_connection->conn_socket, - (char *)dummy, padding); + pdu_read(conn->conn_socket, (char *)dummy, padding); } } } Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Thu Aug 25 05:11:04 2016 (r304786) +++ head/usr.sbin/iscsid/iscsid.c Thu Aug 25 05:22:53 2016 (r304787) @@ -153,6 +153,7 @@ static struct connection * connection_new(int iscsi_fd, const struct iscsi_daemon_request *request) { struct connection *conn; + struct iscsi_session_limits *isl; struct addrinfo *from_ai, *to_ai; const char *from_addr, *to_addr; #ifdef ICL_KERNEL_PROXY @@ -171,16 +172,49 @@ connection_new(int iscsi_fd, const struc conn->conn_data_digest = CONN_DIGEST_NONE; conn->conn_initial_r2t = true; conn->conn_immediate_data = true; - conn->conn_max_data_segment_length = 8192; - conn->conn_max_burst_length = 262144; - conn->conn_first_burst_length = 65536; + conn->conn_max_burst_length = MAX_BURST_LENGTH; + conn->conn_first_burst_length = FIRST_BURST_LENGTH; conn->conn_iscsi_fd = iscsi_fd; conn->conn_session_id = request->idr_session_id; memcpy(&conn->conn_conf, &request->idr_conf, sizeof(conn->conn_conf)); memcpy(&conn->conn_isid, &request->idr_isid, sizeof(conn->conn_isid)); conn->conn_tsih = request->idr_tsih; - memcpy(&conn->conn_limits, &request->idr_limits, sizeof(conn->conn_limits)); + + /* + * Read the driver limits and provide reasonable defaults for the ones + * the driver doesn't care about. If a max_snd_dsl is not explicitly + * provided by the driver then we'll make sure both conn->max_snd_dsl + * and isl->max_snd_dsl are set to the rcv_dsl. This preserves historic + * behavior. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 25 05:24:58 2016 Return-Path: Delivered-To: svn-src-head@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 BD4CABC3EE9; Thu, 25 Aug 2016 05:24:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 986CA1BE9; Thu, 25 Aug 2016 05:24:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P5Ovri003468; Thu, 25 Aug 2016 05:24:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P5Ovo2003463; Thu, 25 Aug 2016 05:24:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250524.u7P5Ovo2003463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 05:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304788 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:24:58 -0000 Author: sephe Date: Thu Aug 25 05:24:57 2016 New Revision: 304788 URL: https://svnweb.freebsd.org/changeset/base/304788 Log: hyperv/ic: Update total message size if negotiate message size grows. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7627 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Aug 25 05:22:53 2016 (r304787) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Aug 25 05:24:57 2016 (r304788) @@ -80,7 +80,7 @@ vmbus_heartbeat_cb(struct vmbus_channel */ switch (hdr->ic_type) { case VMBUS_ICMSG_TYPE_NEGOTIATE: - error = vmbus_ic_negomsg(sc, data, dlen); + error = vmbus_ic_negomsg(sc, data, &dlen); if (error) return; break; Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Aug 25 05:22:53 2016 (r304787) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Aug 25 05:24:57 2016 (r304788) @@ -87,7 +87,7 @@ hv_shutdown_cb(struct vmbus_channel *cha if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { int error; - error = vmbus_ic_negomsg(softc, buf, recv_len); + error = vmbus_ic_negomsg(softc, buf, &recv_len); if (error) return; } else { Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Thu Aug 25 05:22:53 2016 (r304787) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Thu Aug 25 05:24:57 2016 (r304788) @@ -162,7 +162,7 @@ hv_timesync_cb(struct vmbus_channel *cha if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { int error; - error = vmbus_ic_negomsg(&softc->util_sc, time_buf, recvlen); + error = vmbus_ic_negomsg(&softc->util_sc, time_buf, &recvlen); if (error) return; } else { Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Thu Aug 25 05:22:53 2016 (r304787) +++ head/sys/dev/hyperv/utilities/hv_util.c Thu Aug 25 05:24:57 2016 (r304788) @@ -48,13 +48,16 @@ #define VMBUS_IC_BRSIZE (4 * PAGE_SIZE) -CTASSERT(sizeof(struct vmbus_icmsg_negotiate) < VMBUS_IC_BRSIZE); +#define VMBUS_IC_VERCNT 2 +#define VMBUS_IC_NEGOSZ \ + __offsetof(struct vmbus_icmsg_negotiate, ic_ver[VMBUS_IC_VERCNT]) +CTASSERT(VMBUS_IC_NEGOSZ < VMBUS_IC_BRSIZE); int -vmbus_ic_negomsg(struct hv_util_sc *sc, void *data, int dlen) +vmbus_ic_negomsg(struct hv_util_sc *sc, void *data, int *dlen0) { struct vmbus_icmsg_negotiate *nego; - int cnt, major; + int cnt, major, dlen = *dlen0; /* * Preliminary message size verification @@ -87,9 +90,13 @@ vmbus_ic_negomsg(struct hv_util_sc *sc, nego->ic_msgver_cnt = 1; nego->ic_ver[1] = VMBUS_IC_VERSION(major, 0); - /* Data contains two versions */ - nego->ic_hdr.ic_dsize = __offsetof(struct vmbus_icmsg_negotiate, - ic_ver[2]) - sizeof(struct vmbus_icmsg_hdr); + /* Update data size */ + nego->ic_hdr.ic_dsize = VMBUS_IC_NEGOSZ - + sizeof(struct vmbus_icmsg_hdr); + + /* Update total size, if necessary */ + if (dlen < VMBUS_IC_NEGOSZ) + *dlen0 = VMBUS_IC_NEGOSZ; return 0; } Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Thu Aug 25 05:22:53 2016 (r304787) +++ head/sys/dev/hyperv/utilities/hv_util.h Thu Aug 25 05:24:57 2016 (r304788) @@ -54,6 +54,6 @@ struct vmbus_ic_desc { int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); int hv_util_detach(device_t dev); int vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]); -int vmbus_ic_negomsg(struct hv_util_sc *, void *data, int dlen); +int vmbus_ic_negomsg(struct hv_util_sc *, void *data, int *dlen); #endif From owner-svn-src-head@freebsd.org Thu Aug 25 05:28:04 2016 Return-Path: Delivered-To: svn-src-head@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 41F2ABC3FEB; Thu, 25 Aug 2016 05:28:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 135091D98; Thu, 25 Aug 2016 05:28:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P5S3cM003627; Thu, 25 Aug 2016 05:28:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P5S3iP003625; Thu, 25 Aug 2016 05:28:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608250528.u7P5S3iP003625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Aug 2016 05:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304789 - in head: . sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:28:04 -0000 Author: np Date: Thu Aug 25 05:28:02 2016 New Revision: 304789 URL: https://svnweb.freebsd.org/changeset/base/304789 Log: Bump __FreeBSD_version for r304787 and add a note about it to UPDATING. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 25 05:24:57 2016 (r304788) +++ head/UPDATING Thu Aug 25 05:28:02 2016 (r304789) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160824: + r304787 changed some ioctl interfaces between the iSCSI userspace + programs and the kernel. ctladm, ctld, iscsictl, and iscsid must be + rebuilt to work with new kernels. __FreeBSD_version has been bumped + to 1200005. + 20160818: The UDP receive code has been updated to only treat incoming UDP packets that were addressed to an L2 broadcast address as L3 Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Aug 25 05:24:57 2016 (r304788) +++ head/sys/sys/param.h Thu Aug 25 05:28:02 2016 (r304789) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200004 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200005 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Aug 25 05:35:52 2016 Return-Path: Delivered-To: svn-src-head@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 B94C8BC5152; Thu, 25 Aug 2016 05:35:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6440912F4; Thu, 25 Aug 2016 05:35:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P5Zpgg007229; Thu, 25 Aug 2016 05:35:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P5ZpYq007226; Thu, 25 Aug 2016 05:35:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250535.u7P5ZpYq007226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 05:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304790 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:35:52 -0000 Author: sephe Date: Thu Aug 25 05:35:51 2016 New Revision: 304790 URL: https://svnweb.freebsd.org/changeset/base/304790 Log: hyperv/vmbus: Add function to calculate max # of elements in a bufring. MFC after: 1 week Sponsored by: Microsoft Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Thu Aug 25 05:28:02 2016 (r304789) +++ head/sys/dev/hyperv/include/vmbus.h Thu Aug 25 05:35:51 2016 (r304790) @@ -161,5 +161,7 @@ uint32_t vmbus_chan_subidx(const struct bool vmbus_chan_is_primary(const struct vmbus_channel *chan); const struct hyperv_guid * vmbus_chan_guid_inst(const struct vmbus_channel *chan); +int vmbus_chan_prplist_nelem(int br_size, int prpcnt_max, + int dlen_max); #endif /* !_VMBUS_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_brvar.h Thu Aug 25 05:28:02 2016 (r304789) +++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Thu Aug 25 05:35:51 2016 (r304790) @@ -74,6 +74,7 @@ struct sysctl_oid; static __inline int vmbus_txbr_maxpktsz(const struct vmbus_txbr *tbr) { + /* * - 64 bits for the trailing start index (- sizeof(uint64_t)). * - The rindex and windex can't be same (- 1). See @@ -82,6 +83,17 @@ vmbus_txbr_maxpktsz(const struct vmbus_t return (tbr->txbr_dsize - sizeof(uint64_t) - 1); } +static __inline int +vmbus_br_nelem(int br_size, int elem_size) +{ + + /* Strip bufring header */ + br_size -= sizeof(struct vmbus_bufring); + /* Add per-element trailing index */ + elem_size += sizeof(uint64_t); + return (br_size / elem_size); +} + void vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, struct sysctl_oid *br_tree, struct vmbus_br *br, const char *name); Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Aug 25 05:28:02 2016 (r304789) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Aug 25 05:35:51 2016 (r304790) @@ -1411,3 +1411,16 @@ vmbus_chan_guid_inst(const struct vmbus_ { return &chan->ch_guid_inst; } + +int +vmbus_chan_prplist_nelem(int br_size, int prpcnt_max, int dlen_max) +{ + int elem_size; + + elem_size = __offsetof(struct vmbus_chanpkt_prplist, + cp_range[0].gpa_page[prpcnt_max]); + elem_size += dlen_max; + elem_size = VMBUS_CHANPKT_TOTLEN(elem_size); + + return (vmbus_br_nelem(br_size, elem_size)); +} From owner-svn-src-head@freebsd.org Thu Aug 25 05:50:20 2016 Return-Path: Delivered-To: svn-src-head@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 9D60BBC5477; Thu, 25 Aug 2016 05:50:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 788AB18EF; Thu, 25 Aug 2016 05:50:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7P5oJI7011053; Thu, 25 Aug 2016 05:50:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7P5oJge011051; Thu, 25 Aug 2016 05:50:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608250550.u7P5oJge011051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 25 Aug 2016 05:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304791 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 05:50:20 -0000 Author: sephe Date: Thu Aug 25 05:50:19 2016 New Revision: 304791 URL: https://svnweb.freebsd.org/changeset/base/304791 Log: hyperv/storvsc: Increase queue depth and rework channel selection. - Increasing queue depth gives ~100% performance improvement for randwrite fio test in Azure. - New channel selection, which takes LUN id and the current cpuid into consideration, gives additional ~20% performance improvement for ranwrite fio test in Azure. Submitted by: Hongzhang Jiang Modified by: sephe MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7622 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Aug 25 05:35:51 2016 (r304790) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Aug 25 05:50:19 2016 (r304791) @@ -75,11 +75,9 @@ __FBSDID("$FreeBSD$"); #include #include - #include "hv_vstorage.h" #include "vmbus_if.h" -#define STORVSC_RINGBUFFER_SIZE (20*PAGE_SIZE) #define STORVSC_MAX_LUNS_PER_TARGET (64) #define STORVSC_MAX_IO_REQUESTS (STORVSC_MAX_LUNS_PER_TARGET * 2) #define BLKVSC_MAX_IDE_DISKS_PER_TARGET (1) @@ -121,8 +119,6 @@ struct hv_sgl_page_pool{ boolean_t is_init; } g_hv_sgl_page_pool; -#define STORVSC_MAX_SG_PAGE_CNT STORVSC_MAX_IO_REQUESTS * STORVSC_DATA_SEGCNT_MAX - enum storvsc_request_type { WRITE_TYPE, READ_TYPE, @@ -130,17 +126,35 @@ enum storvsc_request_type { }; SYSCTL_NODE(_hw, OID_AUTO, storvsc, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, - "Hyper-V storage interface"); + "Hyper-V storage interface"); + +static u_int hv_storvsc_use_win8ext_flags = 1; +SYSCTL_UINT(_hw_storvsc, OID_AUTO, use_win8ext_flags, CTLFLAG_RW, + &hv_storvsc_use_win8ext_flags, 0, + "Use win8 extension flags or not"); static u_int hv_storvsc_use_pim_unmapped = 1; -SYSCTL_INT(_hw_storvsc, OID_AUTO, use_pim_unmapped, CTLFLAG_RDTUN, - &hv_storvsc_use_pim_unmapped, 0, - "Optimize storvsc by using unmapped I/O"); +SYSCTL_UINT(_hw_storvsc, OID_AUTO, use_pim_unmapped, CTLFLAG_RDTUN, + &hv_storvsc_use_pim_unmapped, 0, + "Optimize storvsc by using unmapped I/O"); + +static u_int hv_storvsc_ringbuffer_size = (64 * PAGE_SIZE); +SYSCTL_UINT(_hw_storvsc, OID_AUTO, ringbuffer_size, CTLFLAG_RDTUN, + &hv_storvsc_ringbuffer_size, 0, "Hyper-V storage ringbuffer size"); + +static u_int hv_storvsc_max_io = 512; +SYSCTL_UINT(_hw_storvsc, OID_AUTO, max_io, CTLFLAG_RDTUN, + &hv_storvsc_max_io, 0, "Hyper-V storage max io limit"); + +#define STORVSC_MAX_IO \ + vmbus_chan_prplist_nelem(hv_storvsc_ringbuffer_size, \ + STORVSC_DATA_SEGCNT_MAX, VSTOR_PKT_SIZE) struct hv_storvsc_sysctl { u_long data_bio_cnt; u_long data_vaddr_cnt; u_long data_sg_cnt; + u_long chan_send_cnt[MAXCPU]; }; struct storvsc_gpa_range { @@ -184,10 +198,18 @@ struct storvsc_softc { device_t hs_dev; bus_dma_tag_t storvsc_req_dtag; struct hv_storvsc_sysctl sysctl_data; - - struct vmbus_channel *hs_cpu2chan[MAXCPU]; + uint32_t hs_nchan; + struct vmbus_channel *hs_sel_chan[MAXCPU]; }; +/* + * The size of the vmscsi_request has changed in win8. The + * additional size is for the newly added elements in the + * structure. These elements are valid only when we are talking + * to a win8 host. + * Track the correct size we need to apply. + */ +static int vmscsi_size_delta = sizeof(struct vmscsi_win8_extension); /** * HyperV storvsc timeout testing cases: @@ -211,7 +233,7 @@ struct storvsc_driver_props { char *drv_name; char *drv_desc; uint8_t drv_max_luns_per_target; - uint8_t drv_max_ios_per_target; + uint32_t drv_max_ios_per_target; uint32_t drv_ringbuffer_size; }; @@ -240,10 +262,10 @@ static const struct hyperv_guid gBlkVscD static struct storvsc_driver_props g_drv_props_table[] = { {"blkvsc", "Hyper-V IDE Storage Interface", BLKVSC_MAX_IDE_DISKS_PER_TARGET, BLKVSC_MAX_IO_REQUESTS, - STORVSC_RINGBUFFER_SIZE}, + 20*PAGE_SIZE}, {"storvsc", "Hyper-V SCSI Storage Interface", STORVSC_MAX_LUNS_PER_TARGET, STORVSC_MAX_IO_REQUESTS, - STORVSC_RINGBUFFER_SIZE} + 20*PAGE_SIZE} }; /* @@ -253,14 +275,6 @@ static struct storvsc_driver_props g_drv static int sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; /* - * The size of the vmscsi_request has changed in win8. The - * additional size is for the newly added elements in the - * structure. These elements are valid only when we are talking - * to a win8 host. - * Track the correct size we need to apply. - */ -static int vmscsi_size_delta; -/* * The storage protocol version is determined during the * initial exchange with the host. It will indicate which * storage functionality is available in the host. @@ -413,6 +427,9 @@ storvsc_send_multichannel_request(struct return; } + /* Update channel count */ + sc->hs_nchan = request_channels_cnt + 1; + /* Wait for sub-channels setup to complete. */ subchan = vmbus_subchan_get(sc->hs_chan, request_channels_cnt); @@ -585,7 +602,6 @@ hv_storvsc_channel_init(struct storvsc_s */ if (support_multichannel) storvsc_send_multichannel_request(sc, max_chans); - cleanup: sema_destroy(&request->synch_sema); return (ret); @@ -624,7 +640,6 @@ hv_storvsc_connect_vsp(struct storvsc_so } ret = hv_storvsc_channel_init(sc); - return (ret); } @@ -686,7 +701,7 @@ hv_storvsc_io_request(struct storvsc_sof { struct vstor_packet *vstor_packet = &request->vstor_packet; struct vmbus_channel* outgoing_channel = NULL; - int ret = 0; + int ret = 0, ch_sel; vstor_packet->flags |= REQUEST_COMPLETION_FLAG; @@ -699,7 +714,8 @@ hv_storvsc_io_request(struct storvsc_sof vstor_packet->operation = VSTOR_OPERATION_EXECUTESRB; - outgoing_channel = sc->hs_cpu2chan[curcpu]; + ch_sel = (vstor_packet->u.vm_srb.lun + curcpu) % sc->hs_nchan; + outgoing_channel = sc->hs_sel_chan[ch_sel]; mtx_unlock(&request->softc->hs_lock); if (request->prp_list.gpa_range.gpa_len) { @@ -711,6 +727,10 @@ hv_storvsc_io_request(struct storvsc_sof VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, vstor_packet, VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request); } + /* statistic for successful request sending on each channel */ + if (!ret) { + sc->sysctl_data.chan_send_cnt[ch_sel]++; + } mtx_lock(&request->softc->hs_lock); if (ret != 0) { @@ -906,17 +926,20 @@ storvsc_probe(device_t dev) } static void -storvsc_create_cpu2chan(struct storvsc_softc *sc) +storvsc_create_chan_sel(struct storvsc_softc *sc) { - int cpu; + struct vmbus_channel **subch; + int i, nsubch; - CPU_FOREACH(cpu) { - sc->hs_cpu2chan[cpu] = vmbus_chan_cpu2chan(sc->hs_chan, cpu); - if (bootverbose) { - device_printf(sc->hs_dev, "cpu%d -> chan%u\n", - cpu, vmbus_chan_id(sc->hs_cpu2chan[cpu])); - } - } + sc->hs_sel_chan[0] = sc->hs_chan; + nsubch = sc->hs_nchan - 1; + if (nsubch == 0) + return; + + subch = vmbus_subchan_get(sc->hs_chan, nsubch); + for (i = 0; i < nsubch; i++) + sc->hs_sel_chan[i + 1] = subch[i]; + vmbus_subchan_rel(subch, nsubch); } static int @@ -976,7 +999,10 @@ storvsc_sysctl(device_t dev) { struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; + struct sysctl_oid *ch_tree, *chid_tree; struct storvsc_softc *sc; + char name[16]; + int i; sc = device_get_softc(dev); ctx = device_get_sysctl_ctx(dev); @@ -988,6 +1014,28 @@ storvsc_sysctl(device_t dev) &sc->sysctl_data.data_vaddr_cnt, "# of vaddr data block"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "data_sg_cnt", CTLFLAG_RW, &sc->sysctl_data.data_sg_cnt, "# of sg data block"); + + /* dev.storvsc.UNIT.channel */ + ch_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "channel", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); + if (ch_tree == NULL) + return; + + for (i = 0; i < sc->hs_nchan; i++) { + uint32_t ch_id; + + ch_id = vmbus_chan_id(sc->hs_sel_chan[i]); + snprintf(name, sizeof(name), "%d", ch_id); + /* dev.storvsc.UNIT.channel.CHID */ + chid_tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(ch_tree), + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); + if (chid_tree == NULL) + return; + /* dev.storvsc.UNIT.channel.CHID.send_req */ + SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(chid_tree), OID_AUTO, + "send_req", CTLFLAG_RD, &sc->sysctl_data.chan_send_cnt[i], + "# of request sending from this channel"); + } } /** @@ -1018,6 +1066,7 @@ storvsc_attach(device_t dev) root_mount_token = root_mount_hold("storvsc"); sc = device_get_softc(dev); + sc->hs_nchan = 1; sc->hs_chan = vmbus_get_channel(dev); stor_type = storvsc_get_storage_type(dev); @@ -1029,7 +1078,14 @@ storvsc_attach(device_t dev) /* fill in driver specific properties */ sc->hs_drv_props = &g_drv_props_table[stor_type]; - + sc->hs_drv_props->drv_ringbuffer_size = hv_storvsc_ringbuffer_size; + sc->hs_drv_props->drv_max_ios_per_target = + MIN(STORVSC_MAX_IO, hv_storvsc_max_io); + if (bootverbose) { + printf("storvsc ringbuffer size: %d, max_io: %d\n", + sc->hs_drv_props->drv_ringbuffer_size, + sc->hs_drv_props->drv_max_ios_per_target); + } /* fill in device specific properties */ sc->hs_unit = device_get_unit(dev); sc->hs_dev = dev; @@ -1051,7 +1107,7 @@ storvsc_attach(device_t dev) * STORVSC_DATA_SEGCNT_MAX segments, each * segment has one page buffer */ - for (i = 0; i < STORVSC_MAX_IO_REQUESTS; i++) { + for (i = 0; i < sc->hs_drv_props->drv_max_ios_per_target; i++) { sgl_node = malloc(sizeof(struct hv_sgl_node), M_DEVBUF, M_WAITOK|M_ZERO); @@ -1082,7 +1138,7 @@ storvsc_attach(device_t dev) } /* Construct cpu to channel mapping */ - storvsc_create_cpu2chan(sc); + storvsc_create_chan_sel(sc); /* * Create the device queue. @@ -1839,19 +1895,37 @@ create_storvsc_request(union ccb *ccb, s csio->cdb_len); } + if (hv_storvsc_use_win8ext_flags) { + reqp->vstor_packet.u.vm_srb.win8_extension.time_out_value = 60; + reqp->vstor_packet.u.vm_srb.win8_extension.srb_flags |= + SRB_FLAGS_DISABLE_SYNCH_TRANSFER; + } switch (ccb->ccb_h.flags & CAM_DIR_MASK) { case CAM_DIR_OUT: - reqp->vstor_packet.u.vm_srb.data_in = WRITE_TYPE; + reqp->vstor_packet.u.vm_srb.data_in = WRITE_TYPE; + if (hv_storvsc_use_win8ext_flags) { + reqp->vstor_packet.u.vm_srb.win8_extension.srb_flags |= + SRB_FLAGS_DATA_OUT; + } break; case CAM_DIR_IN: reqp->vstor_packet.u.vm_srb.data_in = READ_TYPE; + if (hv_storvsc_use_win8ext_flags) { + reqp->vstor_packet.u.vm_srb.win8_extension.srb_flags |= + SRB_FLAGS_DATA_IN; + } break; case CAM_DIR_NONE: reqp->vstor_packet.u.vm_srb.data_in = UNKNOWN_TYPE; + if (hv_storvsc_use_win8ext_flags) { + reqp->vstor_packet.u.vm_srb.win8_extension.srb_flags |= + SRB_FLAGS_NO_DATA_TRANSFER; + } break; default: - reqp->vstor_packet.u.vm_srb.data_in = UNKNOWN_TYPE; - break; + printf("Error: unexpected data direction: 0x%x\n", + ccb->ccb_h.flags & CAM_DIR_MASK); + return (EINVAL); } reqp->sense_data = &csio->sense_data; Modified: head/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_vstorage.h Thu Aug 25 05:35:51 2016 (r304790) +++ head/sys/dev/hyperv/storvsc/hv_vstorage.h Thu Aug 25 05:50:19 2016 (r304791) @@ -253,6 +253,22 @@ struct vstor_packet { #define SRB_STATUS_AUTOSENSE_VALID 0x80 #define SRB_STATUS_INVALID_LUN 0X20 +/* + * SRB Flag Bits + */ + +#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002 +#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004 +#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 +#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010 +#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 +#define SRB_FLAGS_DATA_IN 0x00000040 +#define SRB_FLAGS_DATA_OUT 0x00000080 +#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 +#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT) +#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100 +#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200 +#define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400 /** * Packet flags */ From owner-svn-src-head@freebsd.org Thu Aug 25 08:27:13 2016 Return-Path: Delivered-To: svn-src-head@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 029ADBC5AFE; Thu, 25 Aug 2016 08:27:13 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (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 B85AE1F3E; Thu, 25 Aug 2016 08:27:12 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3sKcjT4PzWzZqm; Thu, 25 Aug 2016 10:27:09 +0200 (CEST) Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id 4rLjvVn8yKj3; Thu, 25 Aug 2016 10:27:07 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Thu, 25 Aug 2016 10:27:07 +0200 (CEST) Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Ed Schouten , Bryan Drewery References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Guido Falsi Message-ID: <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> Date: Thu, 25 Aug 2016 10:27:07 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 08:27:13 -0000 On 08/24/16 21:49, Ed Schouten wrote: > 2016-08-24 20:30 GMT+02:00 Bryan Drewery : >> That would only fix stable/11, stable/10, stable/9, releng/11.0. >> >> It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc... >> without an EN. >> >> It won't fix stable/11 - 1, stable/10 - 1, etc. >> >> It will never fix releng/8.4 (unsupported releases) since so@ won't EN >> to those. People do sometimes need to build these older releases still. >> >> It creates a line in the sand where we can never build checkouts older >> than where the fix was at. So I don't think it is the appropriate fix. > > Good point! > > Just for the record: Bryan and I just discussed this matter in more > detail on IRC. We came up with a workaround that should be pretty > good. > > Attached is a patch for that adds some extra logic, so that > any calls to basename() and dirname() will expand to calls to > __old_basename() and __old_dirname(). Using __sym_compat(), these will > cause the compiler to generate calls to basename@FBSD_1.0 and > dirname@FBSD_1.0. > > According to Bryan, this fixes the problems he was experiencing. > I just tried using the attached patch to build a nanobsd image, host is amd64 head at r304773 with this patch applied, target is i386 releng/11.0 at r304729. I've got it failing early during build: --- _bootstrap-tools-usr.bin/xinstall --- xinstall.o: In function `install': /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall/xinstall.c:(.text+0xf55): undefined reference to `basename@FBSD_1.0' cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [xinstall] Error code 1 make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall 1 error make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall *** [_bootstrap-tools-usr.bin/xinstall] Error code 2 Did I miss some needed procedure? Thanks! -- Guido Falsi From owner-svn-src-head@freebsd.org Thu Aug 25 10:14:58 2016 Return-Path: Delivered-To: svn-src-head@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 27438BC52D8; Thu, 25 Aug 2016 10:14:58 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EC5C41AA5; Thu, 25 Aug 2016 10:14:57 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PAEvDr011082; Thu, 25 Aug 2016 10:14:57 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PAEv85011081; Thu, 25 Aug 2016 10:14:57 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608251014.u7PAEv85011081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Aug 2016 10:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304793 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:14:58 -0000 Author: jmcneill Date: Thu Aug 25 10:14:56 2016 New Revision: 304793 URL: https://svnweb.freebsd.org/changeset/base/304793 Log: Remove dependency on allwinner_soc_family() as it is not available on arm64. Reviewed by: andrew, manu Modified: head/sys/arm/allwinner/aw_rtc.c Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Thu Aug 25 09:16:25 2016 (r304792) +++ head/sys/arm/allwinner/aw_rtc.c Thu Aug 25 10:14:56 2016 (r304793) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #define LOSC_MAGIC 0x16aa0000 #define LOSC_BUSY_MASK 0x00000380 -#define IS_SUN7I (allwinner_soc_family() == ALLWINNERSOC_SUN7I) +#define IS_SUN7I (sc->type == A20_RTC) #define YEAR_MIN (IS_SUN7I ? 1970 : 2010) #define YEAR_MAX (IS_SUN7I ? 2100 : 2073) @@ -108,6 +108,7 @@ static struct ofw_compat_data compat_dat struct aw_rtc_softc { struct resource *res; + int type; bus_size_t rtc_date; bus_size_t rtc_time; }; @@ -169,8 +170,9 @@ aw_rtc_attach(device_t dev) device_printf(dev, "could not allocate resources\n"); return (ENXIO); } - - switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + + sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + switch (sc->type) { case A10_RTC: case A20_RTC: sc->rtc_date = A10_RTC_DATE_REG; From owner-svn-src-head@freebsd.org Thu Aug 25 10:20:28 2016 Return-Path: Delivered-To: svn-src-head@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 CDD8ABC53E9; Thu, 25 Aug 2016 10:20:28 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A84BC1CF2; Thu, 25 Aug 2016 10:20:28 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PAKRfD011312; Thu, 25 Aug 2016 10:20:27 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PAKRJj011311; Thu, 25 Aug 2016 10:20:27 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608251020.u7PAKRJj011311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Aug 2016 10:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304794 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:20:28 -0000 Author: jmcneill Date: Thu Aug 25 10:20:27 2016 New Revision: 304794 URL: https://svnweb.freebsd.org/changeset/base/304794 Log: Expose DC1SW as a regulator switch. On Pine64 this is used to control EMAC PHY power. Reviewed by: andrew, manu Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Thu Aug 25 10:14:56 2016 (r304793) +++ head/sys/arm/allwinner/axp81x.c Thu Aug 25 10:20:27 2016 (r304794) @@ -52,10 +52,17 @@ __FBSDID("$FreeBSD$"); #include #include -#include "iicbus_if.h" +#include + #include "gpio_if.h" +#include "iicbus_if.h" +#include "regdev_if.h" + +MALLOC_DEFINE(M_AXP81X_REG, "AXP81x regulator", "AXP81x power regulator"); #define AXP_ICTYPE 0x03 +#define AXP_POWERCTL2 0x12 +#define AXP_POWERCTL2_DC1SW (1 << 7) #define AXP_POWERBAT 0x32 #define AXP_POWERBAT_SHUTDOWN (1 << 7) #define AXP_IRQEN1 0x40 @@ -96,6 +103,37 @@ static struct resource_spec axp81x_spec[ { -1, 0 } }; +struct axp81x_regdef { + intptr_t id; + char *name; + char *supply_name; + uint8_t enable_reg; + uint8_t enable_mask; +}; + +enum axp81x_reg_id { + AXP81X_REG_ID_DC1SW +}; + +static struct axp81x_regdef axp81x_regdefs[] = { + { + .id = AXP81X_REG_ID_DC1SW, + .name = "dc1sw", + .enable_reg = AXP_POWERCTL2, + .enable_mask = AXP_POWERCTL2_DC1SW, + }, +}; + +struct axp81x_softc; + +struct axp81x_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct axp81x_regdef *def; + phandle_t xref; + struct regnode_std_param *param; +}; + struct axp81x_softc { struct resource *res; uint16_t addr; @@ -103,6 +141,10 @@ struct axp81x_softc { device_t gpiodev; struct mtx mtx; int busy; + + /* Regulators */ + struct axp81x_reg_sc **regs; + int nregs; }; #define AXP_LOCK(sc) mtx_lock(&(sc)->mtx) @@ -150,6 +192,56 @@ axp81x_write(device_t dev, uint8_t reg, return (iicbus_transfer(dev, msg, 2)); } +static int +axp81x_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +axp81x_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct axp81x_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + axp81x_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (enable) + val |= sc->def->enable_mask; + else + val &= ~sc->def->enable_mask; + axp81x_write(sc->base_dev, sc->def->enable_reg, val); + + *udelay = 0; + + return (0); +} + +static int +axp81x_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + return (ENXIO); +} + +static int +axp81x_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + return (ENXIO); +} + +static regnode_method_t axp81x_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, axp81x_regnode_init), + REGNODEMETHOD(regnode_enable, axp81x_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, axp81x_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, axp81x_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(axp81x_regnode, axp81x_regnode_class, axp81x_regnode_methods, + sizeof(struct axp81x_reg_sc), regnode_class); + static void axp81x_shutdown(void *devp, int howto) { @@ -417,6 +509,56 @@ axp81x_get_node(device_t dev, device_t b return (ofw_bus_get_node(dev)); } +static struct axp81x_reg_sc * +axp81x_reg_attach(device_t dev, phandle_t node, + struct axp81x_regdef *def) +{ + struct axp81x_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + + memset(&initdef, 0, sizeof(initdef)); + regulator_parse_ofw_stdparam(dev, node, &initdef); + initdef.id = def->id; + initdef.ofw_node = node; + regnode = regnode_create(dev, &axp81x_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->def = def; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + regnode_register(regnode); + + return (reg_sc); +} + +static int +axp81x_regdev_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, + intptr_t *num) +{ + struct axp81x_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->nregs; i++) { + if (sc->regs[i] == NULL) + continue; + if (sc->regs[i]->xref == xref) { + *num = sc->regs[i]->def->id; + return (0); + } + } + + return (ENXIO); +} + static int axp81x_probe(device_t dev) { @@ -435,8 +577,10 @@ static int axp81x_attach(device_t dev) { struct axp81x_softc *sc; + struct axp81x_reg_sc *reg; uint8_t chip_id; - int error; + phandle_t rnode, child; + int error, i; sc = device_get_softc(dev); @@ -454,6 +598,29 @@ axp81x_attach(device_t dev) device_printf(dev, "chip ID 0x%02x\n", chip_id); } + sc->nregs = nitems(axp81x_regdefs); + sc->regs = malloc(sizeof(struct axp81x_reg_sc *) * sc->nregs, + M_AXP81X_REG, M_WAITOK | M_ZERO); + + /* Attach known regulators that exist in the DT */ + rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); + if (rnode > 0) { + for (i = 0; i < sc->nregs; i++) { + child = ofw_bus_find_child(rnode, + axp81x_regdefs[i].name); + if (child == 0) + continue; + reg = axp81x_reg_attach(dev, child, &axp81x_regdefs[i]); + if (reg == NULL) { + device_printf(dev, + "cannot attach regulator %s\n", + axp81x_regdefs[i].name); + return (ENXIO); + } + sc->regs[i] = reg; + } + } + /* Enable IRQ on short power key press */ axp81x_write(dev, AXP_IRQEN1, 0); axp81x_write(dev, AXP_IRQEN2, 0); @@ -495,6 +662,9 @@ static device_method_t axp81x_methods[] DEVMETHOD(gpio_pin_toggle, axp81x_gpio_pin_toggle), DEVMETHOD(gpio_map_gpios, axp81x_gpio_map_gpios), + /* Regdev interface */ + DEVMETHOD(regdev_map, axp81x_regdev_map), + /* OFW bus interface */ DEVMETHOD(ofw_bus_get_node, axp81x_get_node), @@ -511,9 +681,10 @@ static devclass_t axp81x_devclass; extern devclass_t ofwgpiobus_devclass, gpioc_devclass; extern driver_t ofw_gpiobus_driver, gpioc_driver; -DRIVER_MODULE(axp81x, iicbus, axp81x_driver, axp81x_devclass, 0, 0); -DRIVER_MODULE(ofw_gpiobus, axp81x_pmu, ofw_gpiobus_driver, - ofwgpiobus_devclass, 0, 0); +EARLY_DRIVER_MODULE(axp81x, iicbus, axp81x_driver, axp81x_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +EARLY_DRIVER_MODULE(ofw_gpiobus, axp81x_pmu, ofw_gpiobus_driver, + ofwgpiobus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); DRIVER_MODULE(gpioc, axp81x_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp81x, 1); MODULE_DEPEND(axp81x, iicbus, 1, 1, 1); From owner-svn-src-head@freebsd.org Thu Aug 25 10:24:15 2016 Return-Path: Delivered-To: svn-src-head@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 7EBC3BC566C; Thu, 25 Aug 2016 10:24:15 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 59FC11238; Thu, 25 Aug 2016 10:24:15 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PAOEck014711; Thu, 25 Aug 2016 10:24:14 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PAOEMa014710; Thu, 25 Aug 2016 10:24:14 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608251024.u7PAOEMa014710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Aug 2016 10:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304795 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:24:15 -0000 Author: jmcneill Date: Thu Aug 25 10:24:14 2016 New Revision: 304795 URL: https://svnweb.freebsd.org/changeset/base/304795 Log: Add support for Allwinner multi-parent bus gates. Reviewed by: andrew, manu Modified: head/sys/arm/allwinner/clk/aw_gate.c Modified: head/sys/arm/allwinner/clk/aw_gate.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_gate.c Thu Aug 25 10:20:27 2016 (r304794) +++ head/sys/arm/allwinner/clk/aw_gate.c Thu Aug 25 10:24:14 2016 (r304795) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -89,11 +90,14 @@ static struct ofw_compat_data compat_dat (uintptr_t)"Allwinner APB0 Clock Gates" }, { "allwinner,sun8i-h3-bus-gates-clk", - (uintptr_t)"Allwinner Bus Clock Gates"}, + (uintptr_t)"Allwinner Bus Clock Gates" }, { "allwinner,sun9i-a80-apbs-gates-clk", (uintptr_t)"Allwinner APBS Clock Gates" }, + { "allwinner,sunxi-multi-bus-gates-clk", + (uintptr_t)"Allwinner Multi Bus Clock Gates" }, + { NULL, 0 } }; @@ -119,6 +123,43 @@ aw_gate_create(device_t dev, bus_addr_t } static int +aw_gate_add(device_t dev, struct clkdom *clkdom, phandle_t node, + bus_addr_t paddr) +{ + const char **names; + uint32_t *indices; + clk_t clk_parent; + int index, nout, error; + + indices = NULL; + + nout = clk_parse_ofw_out_names(dev, node, &names, &indices); + if (nout == 0) { + device_printf(dev, "no clock outputs found\n"); + return (ENOENT); + } + if (indices == NULL) { + device_printf(dev, "no clock-indices property\n"); + return (ENXIO); + } + + error = clk_get_by_ofw_index(dev, node, 0, &clk_parent); + if (error != 0) { + device_printf(dev, "cannot parse clock parent\n"); + return (ENXIO); + } + + for (index = 0; index < nout; index++) { + error = aw_gate_create(dev, paddr, clkdom, + clk_get_name(clk_parent), names[index], indices[index]); + if (error) + return (error); + } + + return (0); +} + +static int aw_gate_probe(device_t dev) { const char *d; @@ -138,16 +179,11 @@ static int aw_gate_attach(device_t dev) { struct clkdom *clkdom; - const char **names; - int index, nout, error; - uint32_t *indices; - clk_t clk_parent; bus_addr_t paddr; bus_size_t psize; - phandle_t node; + phandle_t node, child; node = ofw_bus_get_node(dev); - indices = NULL; if (ofw_reg_to_paddr(node, 0, &paddr, &psize, NULL) != 0) { device_printf(dev, "cannot parse 'reg' property\n"); @@ -156,44 +192,21 @@ aw_gate_attach(device_t dev) clkdom = clkdom_create(dev); - nout = clk_parse_ofw_out_names(dev, node, &names, &indices); - if (nout == 0) { - device_printf(dev, "no clock outputs found\n"); - error = ENOENT; - goto fail; - } - if (indices == NULL) { - device_printf(dev, "no clock-indices property\n"); - error = ENXIO; - goto fail; - } - - error = clk_get_by_ofw_index(dev, 0, 0, &clk_parent); - if (error != 0) { - device_printf(dev, "cannot parse clock parent\n"); - return (ENXIO); - } - - for (index = 0; index < nout; index++) { - error = aw_gate_create(dev, paddr, clkdom, - clk_get_name(clk_parent), names[index], indices[index]); - if (error) - goto fail; - } + if (ofw_bus_is_compatible(dev, "allwinner,sunxi-multi-bus-gates-clk")) { + for (child = OF_child(node); child > 0; child = OF_peer(child)) + aw_gate_add(dev, clkdom, child, paddr); + } else + aw_gate_add(dev, clkdom, node, paddr); if (clkdom_finit(clkdom) != 0) { device_printf(dev, "cannot finalize clkdom initialization\n"); - error = ENXIO; - goto fail; + return (ENXIO); } if (bootverbose) clkdom_dump(clkdom); return (0); - -fail: - return (error); } static device_method_t aw_gate_methods[] = { From owner-svn-src-head@freebsd.org Thu Aug 25 10:27:24 2016 Return-Path: Delivered-To: svn-src-head@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 07829BC56F5; Thu, 25 Aug 2016 10:27:24 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A26A713E4; Thu, 25 Aug 2016 10:27:23 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PARMBo014864; Thu, 25 Aug 2016 10:27:22 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PARMmi014863; Thu, 25 Aug 2016 10:27:22 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608251027.u7PARMmi014863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Aug 2016 10:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304796 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:27:24 -0000 Author: jmcneill Date: Thu Aug 25 10:27:22 2016 New Revision: 304796 URL: https://svnweb.freebsd.org/changeset/base/304796 Log: Switch parent clock when setting frequency if a new parent is a better candidate for the target rate. Reviewed by: andrew, manu Modified: head/sys/arm/allwinner/clk/aw_modclk.c Modified: head/sys/arm/allwinner/clk/aw_modclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_modclk.c Thu Aug 25 10:24:14 2016 (r304795) +++ head/sys/arm/allwinner/clk/aw_modclk.c Thu Aug 25 10:27:22 2016 (r304796) @@ -160,28 +160,47 @@ aw_modclk_set_freq(struct clknode *clk, int flags, int *stop) { struct aw_modclk_sc *sc; - uint32_t val, m, n, best_m, best_n; + uint32_t val, m, n, src, best_m, best_n, best_src; uint64_t cur_freq; int64_t best_diff, cur_diff; + int error; sc = clknode_get_softc(clk); best_n = best_m = 0; best_diff = (int64_t)*fout; + best_src = 0; - for (n = 0; n <= CLK_RATIO_N_MAX; n++) - for (m = 0; m <= CLK_RATIO_M_MAX; m++) { - cur_freq = fin / (1 << n) / (m + 1); - cur_diff = (int64_t)*fout - cur_freq; - if (cur_diff >= 0 && cur_diff < best_diff) { - best_diff = cur_diff; - best_m = m; - best_n = n; + for (src = 0; src < CLK_SRC_SEL_MAX; src++) { + error = clknode_set_parent_by_idx(clk, src); + if (error != 0) + continue; + error = clknode_get_freq(clknode_get_parent(clk), &fin); + if (error != 0) + continue; + + for (n = 0; n <= CLK_RATIO_N_MAX; n++) + for (m = 0; m <= CLK_RATIO_M_MAX; m++) { + cur_freq = fin / (1 << n) / (m + 1); + cur_diff = (int64_t)*fout - cur_freq; + if (cur_diff >= 0 && cur_diff < best_diff) { + best_src = src; + best_diff = cur_diff; + best_m = m; + best_n = n; + } } - } + } if (best_diff == (int64_t)*fout) return (ERANGE); + error = clknode_set_parent_by_idx(clk, best_src); + if (error != 0) + return (error); + error = clknode_get_freq(clknode_get_parent(clk), &fin); + if (error != 0) + return (error); + DEVICE_LOCK(sc); MODCLK_READ(sc, &val); val &= ~(CLK_RATIO_N | CLK_RATIO_M); From owner-svn-src-head@freebsd.org Thu Aug 25 10:28:48 2016 Return-Path: Delivered-To: svn-src-head@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 CB747BC578A; Thu, 25 Aug 2016 10:28:48 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8CEB615F9; Thu, 25 Aug 2016 10:28:48 +0000 (UTC) (envelope-from jmmv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PASlD0014969; Thu, 25 Aug 2016 10:28:47 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PASlUD014967; Thu, 25 Aug 2016 10:28:47 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201608251028.u7PASlUD014967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Thu, 25 Aug 2016 10:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304797 - head/tests/sys/kqueue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:28:48 -0000 Author: jmmv Date: Thu Aug 25 10:28:47 2016 New Revision: 304797 URL: https://svnweb.freebsd.org/changeset/base/304797 Log: Make use of Kyua's work directories. Change the vnode tests to use the current directory when creating temporary files, which we can assume is a volatile work directory, and then make the kqueue_test.sh driver _not_ abandon the directory created by Kyua. This makes the various kqueue tests independent of each other, and ensures the temporary file is cleaned up on failure. Problem spotted by asomers@ when reviewing D4254. Modified: head/tests/sys/kqueue/kqueue_test.sh head/tests/sys/kqueue/vnode.c Modified: head/tests/sys/kqueue/kqueue_test.sh ============================================================================== --- head/tests/sys/kqueue/kqueue_test.sh Thu Aug 25 10:27:22 2016 (r304796) +++ head/tests/sys/kqueue/kqueue_test.sh Thu Aug 25 10:28:47 2016 (r304797) @@ -1,8 +1,8 @@ #!/bin/sh +# $FreeBSD$ -cd $(dirname $0) i=1 -./kqtest | while read line; do +"$(dirname $0)/kqtest" | while read line; do echo $line | grep -q passed if [ $? -eq 0 ]; then echo "ok - $i $line" Modified: head/tests/sys/kqueue/vnode.c ============================================================================== --- head/tests/sys/kqueue/vnode.c Thu Aug 25 10:27:22 2016 (r304796) +++ head/tests/sys/kqueue/vnode.c Thu Aug 25 10:28:47 2016 (r304797) @@ -25,12 +25,12 @@ void test_kevent_vnode_add(void) { const char *test_id = "kevent(EVFILT_VNODE, EV_ADD)"; - const char *testfile = "/tmp/kqueue-test.tmp"; + const char *testfile = "./kqueue-test.tmp"; struct kevent kev; test_begin(test_id); - system("touch /tmp/kqueue-test.tmp"); + system("touch ./kqueue-test.tmp"); vnode_fd = open(testfile, O_RDONLY); if (vnode_fd < 0) err(1, "open of %s", testfile); @@ -57,7 +57,7 @@ test_kevent_vnode_note_delete(void) if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - if (unlink("/tmp/kqueue-test.tmp") < 0) + if (unlink("./kqueue-test.tmp") < 0) err(1, "unlink"); kevent_cmp(&kev, kevent_get(kqfd)); @@ -77,7 +77,7 @@ test_kevent_vnode_note_write(void) if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - if (system("echo hello >> /tmp/kqueue-test.tmp") < 0) + if (system("echo hello >> ./kqueue-test.tmp") < 0) err(1, "system"); /* BSD kqueue adds NOTE_EXTEND even though it was not requested */ @@ -102,7 +102,7 @@ test_kevent_vnode_note_attrib(void) if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - if (system("touch /tmp/kqueue-test.tmp") < 0) + if (system("touch ./kqueue-test.tmp") < 0) err(1, "system"); nfds = kevent(kqfd, NULL, 0, &kev, 1, NULL); @@ -130,7 +130,7 @@ test_kevent_vnode_note_rename(void) if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - if (system("mv /tmp/kqueue-test.tmp /tmp/kqueue-test2.tmp") < 0) + if (system("mv ./kqueue-test.tmp ./kqueue-test2.tmp") < 0) err(1, "system"); nfds = kevent(kqfd, NULL, 0, &kev, 1, NULL); @@ -142,7 +142,7 @@ test_kevent_vnode_note_rename(void) err(1, "%s - incorrect event (sig=%u; filt=%d; flags=%d)", test_id, (unsigned int)kev.ident, kev.filter, kev.flags); - if (system("mv /tmp/kqueue-test2.tmp /tmp/kqueue-test.tmp") < 0) + if (system("mv ./kqueue-test2.tmp ./kqueue-test.tmp") < 0) err(1, "system"); success(); @@ -183,7 +183,7 @@ test_kevent_vnode_disable_and_enable(voi err(1, "%s", test_id); /* Confirm that the watch is disabled */ - if (system("touch /tmp/kqueue-test.tmp") < 0) + if (system("touch ./kqueue-test.tmp") < 0) err(1, "system"); test_no_kevents(); @@ -191,7 +191,7 @@ test_kevent_vnode_disable_and_enable(voi kev.flags = EV_ENABLE; if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - if (system("touch /tmp/kqueue-test.tmp") < 0) + if (system("touch ./kqueue-test.tmp") < 0) err(1, "system"); nfds = kevent(kqfd, NULL, 0, &kev, 1, NULL); if (nfds < 1) @@ -221,7 +221,7 @@ test_kevent_vnode_dispatch(void) if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) err(1, "%s", test_id); - if (system("touch /tmp/kqueue-test.tmp") < 0) + if (system("touch ./kqueue-test.tmp") < 0) err(1, "system"); nfds = kevent(kqfd, NULL, 0, &kev, 1, NULL); @@ -235,7 +235,7 @@ test_kevent_vnode_dispatch(void) /* Confirm that the watch is disabled automatically */ puts("-- checking that watch is disabled"); - if (system("touch /tmp/kqueue-test.tmp") < 0) + if (system("touch ./kqueue-test.tmp") < 0) err(1, "system"); test_no_kevents(); From owner-svn-src-head@freebsd.org Thu Aug 25 10:29:42 2016 Return-Path: Delivered-To: svn-src-head@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 96746BC57E9; Thu, 25 Aug 2016 10:29:42 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 729C5176B; Thu, 25 Aug 2016 10:29:42 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PATfCA015041; Thu, 25 Aug 2016 10:29:41 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PATfPa015040; Thu, 25 Aug 2016 10:29:41 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608251029.u7PATfPa015040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Aug 2016 10:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304798 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:29:42 -0000 Author: jmcneill Date: Thu Aug 25 10:29:41 2016 New Revision: 304798 URL: https://svnweb.freebsd.org/changeset/base/304798 Log: Add support for Allwinner A64 PLL_PERIPH0/PLL_PERIPH1 and PLL_HSIC clocks. Reviewed by: andrew, manu Modified: head/sys/arm/allwinner/clk/aw_pll.c Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Thu Aug 25 10:28:47 2016 (r304797) +++ head/sys/arm/allwinner/clk/aw_pll.c Thu Aug 25 10:29:41 2016 (r304798) @@ -142,6 +142,15 @@ __FBSDID("$FreeBSD$"); #define A31_PLL6_DEFAULT_K 0x1 #define A31_PLL6_TIMEOUT 10 +#define A64_PLLHSIC_LOCK (1 << 28) +#define A64_PLLHSIC_FRAC_CLK_OUT (1 << 25) +#define A64_PLLHSIC_PLL_MODE_SEL (1 << 24) +#define A64_PLLHSIC_PLL_SDM_EN (1 << 20) +#define A64_PLLHSIC_FACTOR_N (0x7f << 8) +#define A64_PLLHSIC_FACTOR_N_SHIFT 8 +#define A64_PLLHSIC_PRE_DIV_M (0xf << 0) +#define A64_PLLHSIC_PRE_DIV_M_SHIFT 0 + #define A80_PLL4_CLK_OUT_EN (1 << 20) #define A80_PLL4_PLL_DIV2 (1 << 18) #define A80_PLL4_PLL_DIV1 (1 << 16) @@ -172,6 +181,7 @@ enum aw_pll_type { AWPLL_A23_PLL1, AWPLL_A31_PLL1, AWPLL_A31_PLL6, + AWPLL_A64_PLLHSIC, AWPLL_A80_PLL4, }; @@ -601,6 +611,7 @@ a31_pll6_init(device_t dev, bus_addr_t r val &= ~(A31_PLL6_FACTOR_N | A31_PLL6_FACTOR_K | A31_PLL6_BYPASS_EN); val |= (A31_PLL6_DEFAULT_N << A31_PLL6_FACTOR_N_SHIFT); val |= (A31_PLL6_DEFAULT_K << A31_PLL6_FACTOR_K_SHIFT); + val |= AW_PLL_ENABLE; CLKDEV_WRITE_4(dev, reg, val); /* Wait for PLL to become stable */ @@ -613,9 +624,6 @@ a31_pll6_init(device_t dev, bus_addr_t r CLKDEV_DEVICE_UNLOCK(dev); - if (retry == 0) - return (ETIMEDOUT); - return (0); } @@ -663,6 +671,40 @@ a80_pll4_recalc(struct aw_pll_sc *sc, ui return (0); } +static int +a64_pllhsic_recalc(struct aw_pll_sc *sc, uint64_t *freq) +{ + uint32_t val, n, m; + + DEVICE_LOCK(sc); + PLL_READ(sc, &val); + DEVICE_UNLOCK(sc); + + n = ((val & A64_PLLHSIC_FACTOR_N) >> A64_PLLHSIC_FACTOR_N_SHIFT) + 1; + m = ((val & A64_PLLHSIC_PRE_DIV_M) >> A64_PLLHSIC_PRE_DIV_M_SHIFT) + 1; + + *freq = (*freq * n) / m; + + return (0); +} + +static int +a64_pllhsic_init(device_t dev, bus_addr_t reg, struct clknode_init_def *def) +{ + uint32_t val; + + /* + * PLL_HSIC default is 480MHz, just enable it. + */ + CLKDEV_DEVICE_LOCK(dev); + CLKDEV_READ_4(dev, reg, &val); + val |= AW_PLL_ENABLE; + CLKDEV_WRITE_4(dev, reg, val); + CLKDEV_DEVICE_UNLOCK(dev); + + return (0); +} + #define PLL(_type, _recalc, _set_freq, _init) \ [(_type)] = { \ .recalc = (_recalc), \ @@ -681,6 +723,7 @@ static struct aw_pll_funcs aw_pll_func[] PLL(AWPLL_A31_PLL1, a31_pll1_recalc, NULL, NULL), PLL(AWPLL_A31_PLL6, a31_pll6_recalc, NULL, a31_pll6_init), PLL(AWPLL_A80_PLL4, a80_pll4_recalc, NULL, NULL), + PLL(AWPLL_A64_PLLHSIC, a64_pllhsic_recalc, NULL, a64_pllhsic_init), }; static struct ofw_compat_data compat_data[] = { @@ -694,6 +737,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun6i-a31-pll6-clk", AWPLL_A31_PLL6 }, { "allwinner,sun8i-a23-pll1-clk", AWPLL_A23_PLL1 }, { "allwinner,sun9i-a80-pll4-clk", AWPLL_A80_PLL4 }, + { "allwinner,sun50i-a64-pllhsic-clk", AWPLL_A64_PLLHSIC }, { NULL, 0 } }; From owner-svn-src-head@freebsd.org Thu Aug 25 10:53:04 2016 Return-Path: Delivered-To: svn-src-head@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 7DA28BC5E89; Thu, 25 Aug 2016 10:53:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A09616A1; Thu, 25 Aug 2016 10:53:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PAr3Ud026093; Thu, 25 Aug 2016 10:53:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PAr3Ja026092; Thu, 25 Aug 2016 10:53:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608251053.u7PAr3Ja026092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Aug 2016 10:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304799 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 10:53:04 -0000 Author: andrew Date: Thu Aug 25 10:53:03 2016 New Revision: 304799 URL: https://svnweb.freebsd.org/changeset/base/304799 Log: Map coherent memory in a non-coherent dma tag as uncached. This is similar to what the 32-bit arm code does, with the exception that it always assumes the tag is non-coherent. Tested by: jmcneill Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Thu Aug 25 10:29:41 2016 (r304798) +++ head/sys/arm64/arm64/busdma_bounce.c Thu Aug 25 10:53:03 2016 (r304799) @@ -438,6 +438,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm mflags |= M_ZERO; if (flags & BUS_DMA_NOCACHE) attr = VM_MEMATTR_UNCACHEABLE; + else if ((flags & BUS_DMA_COHERENT) != 0 && + (dmat->bounce_flags & BF_COHERENT) == 0) + /* + * If we have a non-coherent tag, and are trying to allocate + * a coherent block of memory it needs to be uncached. + */ + attr = VM_MEMATTR_UNCACHEABLE; else attr = VM_MEMATTR_DEFAULT; From owner-svn-src-head@freebsd.org Thu Aug 25 12:04:59 2016 Return-Path: Delivered-To: svn-src-head@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 18980BC45C8; Thu, 25 Aug 2016 12:04:59 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DC0D71D63; Thu, 25 Aug 2016 12:04:58 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PC4weM052418; Thu, 25 Aug 2016 12:04:58 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PC4wQs052417; Thu, 25 Aug 2016 12:04:58 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608251204.u7PC4wQs052417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 25 Aug 2016 12:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304800 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 12:04:59 -0000 Author: bde Date: Thu Aug 25 12:04:57 2016 New Revision: 304800 URL: https://svnweb.freebsd.org/changeset/base/304800 Log: Fix logic errors in bounds checks in previous commit. The 2-entry stack was overrun for grab levels larger than 2. Reported by: pluknet Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Thu Aug 25 10:53:03 2016 (r304799) +++ head/sys/dev/syscons/syscons.c Thu Aug 25 12:04:57 2016 (r304800) @@ -1729,7 +1729,7 @@ sc_cngrab(struct consdev *cp) sc = sc_console->sc; lev = atomic_fetchadd_int(&sc->grab_level, 1); - if (lev >= 0 || lev < 2) + if (lev >= 0 && lev < 2) sccnopen(sc, &sc->grab_state[lev], 1 | 2); } @@ -1741,7 +1741,7 @@ sc_cnungrab(struct consdev *cp) sc = sc_console->sc; lev = atomic_load_acq_int(&sc->grab_level) - 1; - if (lev >= 0 || lev < 2) + if (lev >= 0 && lev < 2) sccnclose(sc, &sc->grab_state[lev]); atomic_add_int(&sc->grab_level, -1); } From owner-svn-src-head@freebsd.org Thu Aug 25 12:42:42 2016 Return-Path: Delivered-To: svn-src-head@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 8252BBC5324; Thu, 25 Aug 2016 12:42:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FB0A115B; Thu, 25 Aug 2016 12:42:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PCgf1Z067340; Thu, 25 Aug 2016 12:42:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PCgfEL067339; Thu, 25 Aug 2016 12:42:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608251242.u7PCgfEL067339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Aug 2016 12:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304801 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 12:42:42 -0000 Author: andrew Date: Thu Aug 25 12:42:41 2016 New Revision: 304801 URL: https://svnweb.freebsd.org/changeset/base/304801 Log: Don't set *dev in the zfs root case, it may be NULL and will correctly be set later in the function. This fixes a potential NULL pointer dereference found on arm64. Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/loader/devicename.c Modified: head/sys/boot/efi/loader/devicename.c ============================================================================== --- head/sys/boot/efi/loader/devicename.c Thu Aug 25 12:04:57 2016 (r304800) +++ head/sys/boot/efi/loader/devicename.c Thu Aug 25 12:42:41 2016 (r304801) @@ -120,7 +120,6 @@ efi_parsedev(struct devdesc **dev, const free(idev); return (err); } - *dev = idev; cp = strchr(np + 1, ':'); } else #endif From owner-svn-src-head@freebsd.org Thu Aug 25 13:02:11 2016 Return-Path: Delivered-To: svn-src-head@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 5B3A8BC59B8 for ; Thu, 25 Aug 2016 13:02:11 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 076C81F93 for ; Thu, 25 Aug 2016 13:02:10 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id l89so34040100lfi.1 for ; Thu, 25 Aug 2016 06:02:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=JIqEY+1XKj7CMQvi4KgoAtzcwrNKckgcir0SjPiPLXg=; b=UFUJs7fQkExkewj2Hdvj67xW3xE12imCM6Zducplc69DbcAMZoXfCu543lLy6gTOvc qCzAZkRWgDw/Nfe6KNo32T8eW39wxvNoUFuQyncXMXuoKqF3xuDJX5MB0p2phpo8xE4m kMMLnszBRk17V9fBMf8CEbDXPIjIgnhscEFbTLtJkub3KJwX0XlqlzgVUhy668bR27bU tItkTorwppWLW7ywKwLzGdzuxv0Ux/pBFIOygJEU8r7sX58jUOntNDqvhh6jBWN8k3U2 6dtjHtx1tPFWtpXvZKDR/O3510nvrmt2VyKHdQPg5mW5ZYeF9vcWvYushTyD1lveVG0D 0O6A== X-Gm-Message-State: AE9vXwM+Lr1C5VSw3enrCm+tfB4qIXCakO7lnpDo38lsNNpy+qhUNfvb4oIwUrJayTslpg== X-Received: by 10.25.90.198 with SMTP id o189mr2094953lfb.193.1472130123108; Thu, 25 Aug 2016 06:02:03 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id r196sm3028303lfd.41.2016.08.25.06.02.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 06:02:02 -0700 (PDT) Subject: Re: svn commit: r304781 - head/etc/rc.d To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608250258.u7P2wfLm045991@repo.freebsd.org> From: Andrey Chernov Message-ID: <3deee68f-3b30-8305-6985-422797f66fa0@freebsd.org> Date: Thu, 25 Aug 2016 16:02:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608250258.u7P2wfLm045991@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:02:11 -0000 On 25.08.2016 5:58, Cy Schubert wrote: > Author: cy > Date: Thu Aug 25 02:58:41 2016 > New Revision: 304781 > URL: https://svnweb.freebsd.org/changeset/base/304781 > > Log: > Add logic to replace the working ntp leap-seconds file in /var/db > if it contains a $FreeBSD$ header. The header will cause the file > to fail checksum of the hash causing ntpd to ignore the file. You don't need any logic, just remove $FreeBSD$ keyword from it. ntpd can be called manually with this file too. From owner-svn-src-head@freebsd.org Thu Aug 25 13:24:12 2016 Return-Path: Delivered-To: svn-src-head@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 7C987BC5151; Thu, 25 Aug 2016 13:24:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC3511A5; Thu, 25 Aug 2016 13:24:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PDOBCc083222; Thu, 25 Aug 2016 13:24:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PDOBfO083221; Thu, 25 Aug 2016 13:24:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201608251324.u7PDOBfO083221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 25 Aug 2016 13:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304802 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:24:12 -0000 Author: cy Date: Thu Aug 25 13:24:11 2016 New Revision: 304802 URL: https://svnweb.freebsd.org/changeset/base/304802 Log: Remove the gratuitous check for $FreeBSD$ and rename the function to ntpd_init_leapfile, to ensure a copy exists in /var/db if a copy isn't already there. Reported by: ache@ MFC after: 1 day Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Aug 25 12:42:41 2016 (r304801) +++ head/etc/rc.d/ntpd Thu Aug 25 13:24:11 2016 (r304802) @@ -29,7 +29,7 @@ ntpd_precmd() rc_flags="-g $rc_flags" fi - ntpd_valid_leapfile + ntpd_init_leapfile if [ ! -f $ntp_db_leapfile ]; then ntpd_fetch_leapfile @@ -80,15 +80,12 @@ get_ntp_leapfile_expiry() { '^\([1-9][0-9]*\)$' \| 0 } -ntpd_valid_leapfile() { +ntpd_init_leapfile() { # Refresh working leapfile with an invalid hash due to # FreeBSD id header. Ntpd will ignore leapfiles with a # mismatch hash. The file must be the virgin file from # the source. - if [ -f $ntp_db_leapfile ]; then - grep -q '\$FreeBSD.*\$' $ntp_db_leapfile && - cp -p $ntp_src_leapfile $ntp_db_leapfile - else + if [ ! -f $ntp_db_leapfile ]; then cp -p $ntp_src_leapfile $ntp_db_leapfile fi } From owner-svn-src-head@freebsd.org Thu Aug 25 13:24:48 2016 Return-Path: Delivered-To: svn-src-head@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 BDCE0BC51BC; Thu, 25 Aug 2016 13:24:48 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1281328; Thu, 25 Aug 2016 13:24:47 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id cubhbYzCFXHJlcubibV0HI; Thu, 25 Aug 2016 07:22:11 -0600 X-Authority-Analysis: v=2.2 cv=Ffh1/926 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=rKOgsJhGMzdaqX_K7lYA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 9E8D813754; Thu, 25 Aug 2016 06:22:09 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7PDM9bA004245; Thu, 25 Aug 2016 06:22:09 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608251322.u7PDM9bA004245@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andrey Chernov cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304781 - head/etc/rc.d In-Reply-To: Message from Andrey Chernov of "Thu, 25 Aug 2016 16:02:00 +0300." <3deee68f-3b30-8305-6985-422797f66fa0@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 25 Aug 2016 06:22:09 -0700 X-CMAE-Envelope: MS4wfFzv/58WAMJxHJbOL7GsQvLNlPh6t+om7Tax7UpbtFV+piCjPy/mYmS9/RKLZyCAdKUlBkdxBLhmHmDSP/uziuo3qbMQmdhItwPBJQQuNDCUKiQoiLj/ w/Mjxsi+jtqLAawjnX2jn7sl82xZ+jcV837XxhsirFAxthVJVIpdWXad7LNBVvs3lbpHzR6e2aWL9sysZLRlRF7UMehfHItWThJQBb1jb2+ltmuBrSDcwKsr cHo73vaEy5SZdcqE4stNwC6Lw6ceUgzRIvX4lZq+WQzRCJScIwCf4wuZ/t0UQg4iDFtJ3opx68ra6ZtkLJIIUQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:24:48 -0000 In message <3deee68f-3b30-8305-6985-422797f66fa0@freebsd.org>, Andrey Chernov w rites: > On 25.08.2016 5:58, Cy Schubert wrote: > > Author: cy > > Date: Thu Aug 25 02:58:41 2016 > > New Revision: 304781 > > URL: https://svnweb.freebsd.org/changeset/base/304781 > > > > Log: > > Add logic to replace the working ntp leap-seconds file in /var/db > > if it contains a $FreeBSD$ header. The header will cause the file > > to fail checksum of the hash causing ntpd to ignore the file. > > You don't need any logic, just remove $FreeBSD$ keyword from it. ntpd > can be called manually with this file too. Yes, it can be called manually too. The script copies /etc/ntp/leap-seconds to /var/db/ntpd.leap-seconds.list (if /etc/ntp/leap-seconds has a newer #$ [version number] or #@ [expiry] timestamps in it), before any other comparisons. There is potential. Having said that, it is a gratuitous step and could probably be removed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Aug 25 13:33:33 2016 Return-Path: Delivered-To: svn-src-head@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 F2E12BC5657; Thu, 25 Aug 2016 13:33:33 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B334D1A10; Thu, 25 Aug 2016 13:33:33 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PDXWhI086938; Thu, 25 Aug 2016 13:33:32 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PDXW33086932; Thu, 25 Aug 2016 13:33:32 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201608251333.u7PDXW33086932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Thu, 25 Aug 2016 13:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304803 - in head/sys: netinet netinet/cc sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:33:34 -0000 Author: lstewart Date: Thu Aug 25 13:33:32 2016 New Revision: 304803 URL: https://svnweb.freebsd.org/changeset/base/304803 Log: Pass the number of segments coalesced by LRO up the stack by repurposing the tso_segsz pkthdr field during RX processing, and use the information in TCP for more correct accounting and as a congestion control input. This is only a start, and an audit of other uses for the data is left as future work. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D7564 Modified: head/sys/netinet/cc/cc.h head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_var.h head/sys/sys/mbuf.h Modified: head/sys/netinet/cc/cc.h ============================================================================== --- head/sys/netinet/cc/cc.h Thu Aug 25 13:24:11 2016 (r304802) +++ head/sys/netinet/cc/cc.h Thu Aug 25 13:33:32 2016 (r304803) @@ -86,6 +86,7 @@ struct cc_var { struct tcpcb *tcp; struct sctp_nets *sctp; } ccvc; + uint16_t nsegs; /* # segments coalesced into current chain. */ }; /* cc_var flags. */ Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Thu Aug 25 13:24:11 2016 (r304802) +++ head/sys/netinet/cc/cc_newreno.c Thu Aug 25 13:33:32 2016 (r304803) @@ -137,7 +137,8 @@ newreno_ack_received(struct cc_var *ccv, */ if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) incr = min(ccv->bytes_this_ack, - V_tcp_abc_l_var * CCV(ccv, t_maxseg)); + ccv->nsegs * V_tcp_abc_l_var * + CCV(ccv, t_maxseg)); else incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Aug 25 13:24:11 2016 (r304802) +++ head/sys/netinet/tcp_input.c Thu Aug 25 13:33:32 2016 (r304803) @@ -300,10 +300,12 @@ hhook_run_tcp_est_in(struct tcpcb *tp, s * CC wrapper hook functions */ void -cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type) +cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t nsegs, + uint16_t type) { INP_WLOCK_ASSERT(tp->t_inpcb); + tp->ccv->nsegs = nsegs; tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); if (tp->snd_cwnd <= tp->snd_wnd) tp->ccv->flags |= CCF_CWND_LIMITED; @@ -313,7 +315,7 @@ cc_ack_received(struct tcpcb *tp, struct if (type == CC_ACK) { if (tp->snd_cwnd > tp->snd_ssthresh) { tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - V_tcp_abc_l_var * tcp_maxseg(tp)); + nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; @@ -1502,6 +1504,7 @@ tcp_do_segment(struct mbuf *m, struct tc int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; int rstreason, todrop, win; u_long tiwin; + uint16_t nsegs; char *s; struct in_conninfo *inc; struct mbuf *mfree; @@ -1521,6 +1524,7 @@ tcp_do_segment(struct mbuf *m, struct tc inc = &tp->t_inpcb->inp_inc; tp->sackhint.last_sack_ack = 0; sack_changed = 0; + nsegs = max(1, m->m_pkthdr.lro_nsegs); /* * If this is either a state-changing packet or current state isn't @@ -1759,7 +1763,7 @@ tcp_do_segment(struct mbuf *m, struct tc /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ hhook_run_tcp_est_in(tp, th, &to); - TCPSTAT_INC(tcps_rcvackpack); + TCPSTAT_ADD(tcps_rcvackpack, nsegs); TCPSTAT_ADD(tcps_rcvackbyte, acked); sbdrop(&so->so_snd, acked); if (SEQ_GT(tp->snd_una, tp->snd_recover) && @@ -1772,7 +1776,7 @@ tcp_do_segment(struct mbuf *m, struct tc * typically means increasing the congestion * window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); tp->snd_una = th->th_ack; /* @@ -1838,7 +1842,7 @@ tcp_do_segment(struct mbuf *m, struct tc * rcv_nxt. */ tp->rcv_up = tp->rcv_nxt; - TCPSTAT_INC(tcps_rcvpack); + TCPSTAT_ADD(tcps_rcvpack, nsegs); TCPSTAT_ADD(tcps_rcvbyte, tlen); #ifdef TCPDEBUG if (so->so_options & SO_DEBUG) @@ -2570,7 +2574,8 @@ tcp_do_segment(struct mbuf *m, struct tc tp->t_dupacks = 0; else if (++tp->t_dupacks > tcprexmtthresh || IN_FASTRECOVERY(tp->t_flags)) { - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -2620,7 +2625,8 @@ tcp_do_segment(struct mbuf *m, struct tc } /* Congestion signal before ack. */ cc_cong_signal(tp, th, CC_NDUPACK); - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; if (tp->t_flags & TF_SACK_PERMIT) { @@ -2654,7 +2660,8 @@ tcp_do_segment(struct mbuf *m, struct tc * segment. Restore the original * snd_cwnd after packet transmission. */ - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; @@ -2756,7 +2763,7 @@ process_ACK: KASSERT(acked >= 0, ("%s: acked unexepectedly negative " "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, tp->snd_una, th->th_ack, tp, m)); - TCPSTAT_INC(tcps_rcvackpack); + TCPSTAT_ADD(tcps_rcvackpack, nsegs); TCPSTAT_ADD(tcps_rcvackbyte, acked); /* @@ -2821,7 +2828,7 @@ process_ACK: * control related information. This typically means increasing * the congestion window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); SOCKBUF_LOCK(&so->so_snd); if (acked > sbavail(&so->so_snd)) { Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Aug 25 13:24:11 2016 (r304802) +++ head/sys/netinet/tcp_lro.c Thu Aug 25 13:33:32 2016 (r304803) @@ -392,6 +392,7 @@ tcp_lro_flush(struct lro_ctrl *lc, struc #endif } + le->m_head->m_pkthdr.lro_nsegs = le->append_cnt + 1; (*lc->ifp->if_input)(lc->ifp, le->m_head); lc->lro_queued += le->append_cnt + 1; lc->lro_flushed++; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Aug 25 13:24:11 2016 (r304802) +++ head/sys/netinet/tcp_var.h Thu Aug 25 13:33:32 2016 (r304803) @@ -784,7 +784,7 @@ void tcp_pulloutofband(struct socket *, void tcp_xmit_timer(struct tcpcb *, int); void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, - uint16_t type); + uint16_t nsegs, uint16_t type); void cc_conn_init(struct tcpcb *tp); void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Aug 25 13:24:11 2016 (r304802) +++ head/sys/sys/mbuf.h Thu Aug 25 13:33:32 2016 (r304803) @@ -174,6 +174,7 @@ struct pkthdr { #define PH_vt PH_per #define vt_nrecs sixteen[0] #define tso_segsz PH_per.sixteen[1] +#define lro_nsegs tso_segsz #define csum_phsum PH_per.sixteen[2] #define csum_data PH_per.thirtytwo[1] From owner-svn-src-head@freebsd.org Thu Aug 25 13:46:54 2016 Return-Path: Delivered-To: svn-src-head@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 051D0BC5A7D; Thu, 25 Aug 2016 13:46:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D69111207; Thu, 25 Aug 2016 13:46:53 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PDkrpv090703; Thu, 25 Aug 2016 13:46:53 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PDkqAG090700; Thu, 25 Aug 2016 13:46:52 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608251346.u7PDkqAG090700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 25 Aug 2016 13:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304804 - in head/sys: dev/syscons kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:46:54 -0000 Author: bde Date: Thu Aug 25 13:46:52 2016 New Revision: 304804 URL: https://svnweb.freebsd.org/changeset/base/304804 Log: Less-quick fix for locking fixes in r172250. r172250 added a second syscons spinlock for the output routine alone. It is better to extend the coverage of the first syscons spinlock added in r162285. 2 locks might work with complicated juggling, but no juggling was done. What the 2 locks actually did was to cover some of the missing locking in each other and deadlock less often against each other than a single lock with larger coverage would against itself. Races are preferable to deadlocks here, but 2 locks are still worse since they are harder to understand and fix. Prefer deadlocks to races and merge the second lock into the first one. Extend the scope of the spinlocking to all of sc_cnputc() instead of just the sc_puts() part. This further prefers deadlocks to races. Extend the kdb_active hack from sc_puts() internals for the second lock to all spinlocking. This reduces deadlocks much more than the other changes increases them. The s/p,10* test in ddb gets much further now. Hide this detail in the SC_VIDEO_LOCK() macro. Add namespace pollution in 1 nested #include and reduce namespace pollution in other nested #includes to pay for this. Move the first lock higher in the witness order. The second lock was unnaturally low and the first lock was unnaturally high. The second lock had to be above "sleepq chain" and/or "callout" to avoid spurious LORs for visual bells in sc_puts(). Other console driver locks are already even higher (but not adjacent like they should be) except when they are missing from the table. Audio bells also benefit from the syscons lock being high so that audio mutexes have chance of being lower. Otherwise, console drviver locks should be as low as possible. Non-spurious LORs now occur if the bell code calls printf() or is interrupted (perhaps by an NMI) and the interrupt handler calls printf(). Previous commits turned off many bells in console i/o but missed ones done by the teken layer. Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/kern/subr_witness.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Thu Aug 25 13:33:32 2016 (r304803) +++ head/sys/dev/syscons/syscons.c Thu Aug 25 13:46:52 2016 (r304804) @@ -343,7 +343,9 @@ sctty_outwakeup(struct tty *tp) len = ttydisc_getc(tp, buf, sizeof buf); if (len == 0) break; + SC_VIDEO_LOCK(scp->sc); sc_puts(scp, buf, len, 0); + SC_VIDEO_UNLOCK(scp->sc); } } @@ -1760,6 +1762,8 @@ sc_cnputc(struct consdev *cd, int c) /* assert(sc_console != NULL) */ + SC_VIDEO_LOCK(scp->sc); + #ifndef SC_NO_HISTORY if (scp == scp->sc->cur_scp && scp->status & SLKED) { scp->status &= ~SLKED; @@ -1793,6 +1797,7 @@ sc_cnputc(struct consdev *cd, int c) s = spltty(); /* block sckbdevent and scrn_timer */ sccnupdate(scp); splx(s); + SC_VIDEO_UNLOCK(scp->sc); } static int @@ -2726,24 +2731,14 @@ exchange_scr(sc_softc_t *sc) static void sc_puts(scr_stat *scp, u_char *buf, int len, int kernel) { - int need_unlock = 0; - #ifdef DEV_SPLASH /* make screensaver happy */ if (!sticky_splash && scp == scp->sc->cur_scp && !sc_saver_keyb_only) run_scrn_saver = FALSE; #endif - if (scp->tsw) { - if (!kdb_active && !mtx_owned(&scp->sc->scr_lock)) { - need_unlock = 1; - mtx_lock_spin(&scp->sc->scr_lock); - } + if (scp->tsw) (*scp->tsw->te_puts)(scp, buf, len, kernel); - if (need_unlock) - mtx_unlock_spin(&scp->sc->scr_lock); - } - if (scp->sc->delayed_next_scr) sc_switch_scr(scp->sc, scp->sc->delayed_next_scr - 1); } @@ -2906,10 +2901,8 @@ scinit(int unit, int flags) * disappeared... */ sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE); - if ((sc->flags & SC_INIT_DONE) == 0) { - mtx_init(&sc->scr_lock, "scrlock", NULL, MTX_SPIN); + if ((sc->flags & SC_INIT_DONE) == 0) SC_VIDEO_LOCKINIT(sc); - } adp = NULL; if (sc->adapter >= 0) { @@ -3126,7 +3119,6 @@ scterm(int unit, int flags) (*scp->tsw->te_term)(scp, &scp->ts); if (scp->ts != NULL) free(scp->ts, M_DEVBUF); - mtx_destroy(&sc->scr_lock); mtx_destroy(&sc->video_mtx); /* clear the structure */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Thu Aug 25 13:33:32 2016 (r304803) +++ head/sys/dev/syscons/syscons.h Thu Aug 25 13:46:52 2016 (r304804) @@ -34,8 +34,9 @@ #ifndef _DEV_SYSCONS_SYSCONS_H_ #define _DEV_SYSCONS_SYSCONS_H_ -#include -#include +#include /* XXX */ +#include +#include /* machine-dependent part of the header */ @@ -239,7 +240,6 @@ typedef struct sc_softc { /* 2 is just enough for kdb to grab for stepping normal grabbing: */ struct sc_cnstate grab_state[2]; int kbd_open_level; - struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; long scrn_time_stamp; @@ -547,12 +547,12 @@ typedef struct { MTX_SPIN | MTX_RECURSE); #define SC_VIDEO_LOCK(sc) \ do { \ - if (!cold) \ + if (!kdb_active) \ mtx_lock_spin(&(sc)->video_mtx); \ } while(0) #define SC_VIDEO_UNLOCK(sc) \ do { \ - if (!cold) \ + if (!kdb_active) \ mtx_unlock_spin(&(sc)->video_mtx); \ } while(0) Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Thu Aug 25 13:33:32 2016 (r304803) +++ head/sys/kern/subr_witness.c Thu Aug 25 13:46:52 2016 (r304804) @@ -637,7 +637,6 @@ static struct witness_order_list_entry o #endif { "rm.mutex_mtx", &lock_class_mtx_spin }, { "sio", &lock_class_mtx_spin }, - { "scrlock", &lock_class_mtx_spin }, #ifdef __i386__ { "cy", &lock_class_mtx_spin }, #endif @@ -653,6 +652,7 @@ static struct witness_order_list_entry o { "pmc-per-proc", &lock_class_mtx_spin }, #endif { "process slock", &lock_class_mtx_spin }, + { "syscons video lock", &lock_class_mtx_spin }, { "sleepq chain", &lock_class_mtx_spin }, { "rm_spinlock", &lock_class_mtx_spin }, { "turnstile chain", &lock_class_mtx_spin }, @@ -661,7 +661,6 @@ static struct witness_order_list_entry o { "td_contested", &lock_class_mtx_spin }, { "callout", &lock_class_mtx_spin }, { "entropy harvest mutex", &lock_class_mtx_spin }, - { "syscons video lock", &lock_class_mtx_spin }, #ifdef SMP { "smp rendezvous", &lock_class_mtx_spin }, #endif From owner-svn-src-head@freebsd.org Thu Aug 25 13:59:21 2016 Return-Path: Delivered-To: svn-src-head@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 282FFBC5D57; Thu, 25 Aug 2016 13:59:21 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DB2B21807; Thu, 25 Aug 2016 13:59:20 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PDxKQu094389; Thu, 25 Aug 2016 13:59:20 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PDxJcL094387; Thu, 25 Aug 2016 13:59:19 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201608251359.u7PDxJcL094387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Thu, 25 Aug 2016 13:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304805 - in head/sys: arm64/conf conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:59:21 -0000 Author: jmcneill Date: Thu Aug 25 13:59:19 2016 New Revision: 304805 URL: https://svnweb.freebsd.org/changeset/base/304805 Log: Add support for Allwinner A64. Reviewed by: andrew, manu Relnotes: yes Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu Aug 25 13:46:52 2016 (r304804) +++ head/sys/arm64/conf/GENERIC Thu Aug 25 13:59:19 2016 (r304805) @@ -86,6 +86,7 @@ options WITNESS_SKIPSPIN # Don't run wi options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # SoC support +options SOC_ALLWINNER_A64 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 @@ -103,6 +104,7 @@ options PCI_IOV # PCI SR-IOV support # Ethernet NICs device mii device miibus # MII bus support +device awg # Allwinner EMAC Gigabit Ethernet device em # Intel PRO/1000 Gigabit Ethernet Family device igb # Intel PRO/1000 PCIE Server Gigabit Family device ix # Intel 10Gb Ethernet Family @@ -118,6 +120,7 @@ device da device pass # Passthrough device (direct ATA/SCSI access) # MMC/SD/SDIO Card slot support +device aw_mmc # Allwinner SD/MMC controller device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device dwmmc @@ -125,18 +128,45 @@ device dwmmc # Serial (COM) ports device uart # Generic UART driver device uart_ns8250 # ns8250-type UART driver +device uart_snps device pl011 # USB support options USB_DEBUG # enable debug msgs +device aw_ehci # Allwinner EHCI USB interface (USB 2.0) +device aw_usbphy # Allwinner USB PHY device dwcotg # DWC OTG controller -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) +device ohci # OHCI USB interface +device ehci # EHCI USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da +# GPIO +device aw_gpio # Allwinner GPIO controller +device gpio +device fdt_pinctrl + +# I2C +device aw_rsb # Allwinner Reduced Serial Bus +device iicbus + +# Clock and reset controllers +device aw_ccu # Allwinner clock controller + +# Interrupt controllers +device aw_nmi # Allwinner NMI support + +# Real-time clock support +device aw_rtc # Allwinner Real-time Clock + +# Watchdog controllers +device aw_wdog # Allwinner Watchdog + +# Power management controllers +device axp81x # X-Powers AXP81x PMIC + # Pseudo devices. device loop # Network loopback device random # Entropy device @@ -148,6 +178,13 @@ device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module device psci # Support for ARM PSCI +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device hwreset +device regulator + # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Aug 25 13:46:52 2016 (r304804) +++ head/sys/conf/files.arm64 Thu Aug 25 13:59:19 2016 (r304805) @@ -11,6 +11,30 @@ cloudabi64_vdso_blob.o optional compat_ no-implicit-rule \ clean "cloudabi64_vdso_blob.o" # +arm/allwinner/a10_ehci.c optional ehci aw_ehci +arm/allwinner/a10_gpio.c optional gpio aw_gpio +arm/allwinner/a10_mmc.c optional mmc aw_mmc +arm/allwinner/a64/a64_padconf.c optional soc_allwinner_a64 +arm/allwinner/a64/a64_r_padconf.c optional soc_allwinner_a64 +arm/allwinner/aw_ccu.c optional aw_ccu +arm/allwinner/aw_nmi.c optional aw_nmi \ + compile-with "${NORMAL_C} -I$S/gnu/dts/include" +arm/allwinner/aw_reset.c optional aw_ccu +arm/allwinner/aw_rsb.c optional aw_rsb +arm/allwinner/aw_rtc.c optional aw_rtc +arm/allwinner/aw_usbphy.c optional ehci aw_usbphy +arm/allwinner/aw_wdog.c optional aw_wdog +arm/allwinner/axp81x.c optional axp81x +arm/allwinner/clk/aw_ahbclk.c optional aw_ccu +arm/allwinner/clk/aw_apbclk.c optional aw_ccu +arm/allwinner/clk/aw_axiclk.c optional aw_ccu +arm/allwinner/clk/aw_cpuclk.c optional aw_ccu +arm/allwinner/clk/aw_gate.c optional aw_ccu +arm/allwinner/clk/aw_modclk.c optional aw_ccu +arm/allwinner/clk/aw_pll.c optional aw_ccu \ + compile-with "${NORMAL_C} -I$S/gnu/dts/include" +arm/allwinner/clk/aw_usbclk.c optional aw_ccu +arm/allwinner/if_awg.c optional awg arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt From owner-svn-src-head@freebsd.org Thu Aug 25 14:42:30 2016 Return-Path: Delivered-To: svn-src-head@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 56107BC5C3E; Thu, 25 Aug 2016 14:42:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F14175C; Thu, 25 Aug 2016 14:42:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PEgT6A013636; Thu, 25 Aug 2016 14:42:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PEgTDV013635; Thu, 25 Aug 2016 14:42:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608251442.u7PEgTDV013635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 25 Aug 2016 14:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304806 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 14:42:30 -0000 Author: andrew Date: Thu Aug 25 14:42:29 2016 New Revision: 304806 URL: https://svnweb.freebsd.org/changeset/base/304806 Log: Fix an assert, it should check if, when moving from 1 l1 to 512 l2 blocks, the l2 entry is a block type and not an l3 page. While here fix the string to correct the level name and add a missing ')'. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Aug 25 13:59:19 2016 (r304805) +++ head/sys/arm64/arm64/pmap.c Thu Aug 25 14:42:29 2016 (r304806) @@ -4323,9 +4323,9 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t * phys += L2_SIZE; } cpu_dcache_wb_range((vm_offset_t)l2, PAGE_SIZE); - KASSERT(l2[0] == ((oldl1 & ~ATTR_DESCR_MASK) | L3_PAGE), - ("Invalid l3 page (%lx != %lx", l2[0], - (oldl1 & ~ATTR_DESCR_MASK) | L3_PAGE)); + KASSERT(l2[0] == ((oldl1 & ~ATTR_DESCR_MASK) | L2_BLOCK), + ("Invalid l2 page (%lx != %lx)", l2[0], + (oldl1 & ~ATTR_DESCR_MASK) | L2_BLOCK)); if (tmpl1 != 0) { pmap_kenter(tmpl1, PAGE_SIZE, @@ -4405,7 +4405,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_en cpu_dcache_wb_range((vm_offset_t)l3, PAGE_SIZE); } KASSERT(l3[0] == ((oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE), - ("Invalid l3 page (%lx != %lx", l3[0], + ("Invalid l3 page (%lx != %lx)", l3[0], (oldl2 & ~ATTR_DESCR_MASK) | L3_PAGE)); /* From owner-svn-src-head@freebsd.org Thu Aug 25 15:08:34 2016 Return-Path: Delivered-To: svn-src-head@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 C8BBEBC6291; Thu, 25 Aug 2016 15:08:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8DBF515EB; Thu, 25 Aug 2016 15:08:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PF8XSK021580; Thu, 25 Aug 2016 15:08:33 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PF8Xj6021579; Thu, 25 Aug 2016 15:08:33 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201608251508.u7PF8Xj6021579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 25 Aug 2016 15:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304807 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 15:08:34 -0000 Author: allanjude Date: Thu Aug 25 15:08:33 2016 New Revision: 304807 URL: https://svnweb.freebsd.org/changeset/base/304807 Log: Capsicumize bspatch Move all of the fopen() and open() calls to the top of main() Restrict each FD to least privilege (read/seek only, write only, etc) cap_enter(), and make all except the output FD read/seek only. Reviewed by: emaste, ed, oshogbo, delphij Approved by: so MFC after: 3 days Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7358 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Aug 25 14:42:29 2016 (r304806) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Aug 25 15:08:33 2016 (r304807) @@ -27,8 +27,20 @@ #include __FBSDID("$FreeBSD$"); +#if defined(__FreeBSD__) +#include +#if __FreeBSD_version >= 1100014 +#include +#define HAVE_CAPSICUM +#elif __FreeBSD_version >= 1000000 +#include +#define HAVE_CAPSICUM +#endif +#endif + #include #include +#include #include #include #include @@ -80,6 +92,9 @@ int main(int argc, char *argv[]) off_t ctrl[3]; off_t lenread; off_t i; +#ifdef HAVE_CAPSICUM + cap_rights_t rights_ro, rights_wr; +#endif if (argc != 4) usage(); @@ -87,6 +102,43 @@ int main(int argc, char *argv[]) /* Open patch file */ if ((f = fopen(argv[3], "rb")) == NULL) err(1, "fopen(%s)", argv[3]); + /* Open patch file for control block */ + if ((cpf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); + /* open patch file for diff block */ + if ((dpf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); + /* open patch file for extra block */ + if ((epf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); + /* open oldfile */ + if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0) + err(1, "open(%s)", argv[1]); + /* open newfile */ + if ((newfd = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, + 0666)) < 0) + err(1, "open(%s)", argv[2]); + +#ifdef HAVE_CAPSICUM + if (cap_enter() < 0) { + /* Failed to sandbox, fatal if CAPABILITY_MODE enabled */ + if (errno != ENOSYS) + err(1, "failed to enter security sandbox"); + } else { + /* Capsicum Available */ + cap_rights_init(&rights_ro, CAP_READ, CAP_FSTAT, CAP_SEEK); + cap_rights_init(&rights_wr, CAP_WRITE); + + if (cap_rights_limit(fileno(f), &rights_ro) < 0 || + cap_rights_limit(fileno(cpf), &rights_ro) < 0 || + cap_rights_limit(fileno(dpf), &rights_ro) < 0 || + cap_rights_limit(fileno(epf), &rights_ro) < 0 || + cap_rights_limit(oldfd, &rights_ro) < 0 || + cap_rights_limit(newfd, &rights_wr) < 0) + err(1, "cap_rights_limit() failed, could not restrict" + " capabilities"); + } +#endif /* File format: @@ -123,31 +175,22 @@ int main(int argc, char *argv[]) /* Close patch file and re-open it via libbzip2 at the right places */ if (fclose(f)) err(1, "fclose(%s)", argv[3]); - if ((cpf = fopen(argv[3], "rb")) == NULL) - err(1, "fopen(%s)", argv[3]); if (fseeko(cpf, 32, SEEK_SET)) err(1, "fseeko(%s, %lld)", argv[3], (long long)32); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - if ((dpf = fopen(argv[3], "rb")) == NULL) - err(1, "fopen(%s)", argv[3]); if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) err(1, "fseeko(%s, %lld)", argv[3], (long long)(32 + bzctrllen)); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - if ((epf = fopen(argv[3], "rb")) == NULL) - err(1, "fopen(%s)", argv[3]); if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) err(1, "fseeko(%s, %lld)", argv[3], (long long)(32 + bzctrllen + bzdatalen)); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); - oldfd = open(argv[1], O_RDONLY | O_BINARY, 0); - if (oldfd < 0) - err(1, "%s", argv[1]); if ((oldsize = lseek(oldfd, 0, SEEK_END)) == -1 || (old = malloc(oldsize+1)) == NULL || lseek(oldfd, 0, SEEK_SET) != 0 || @@ -215,9 +258,6 @@ int main(int argc, char *argv[]) err(1, "fclose(%s)", argv[3]); /* Write the new file */ - newfd = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666); - if (newfd < 0) - err(1, "%s", argv[2]); if (write(newfd, new, newsize) != newsize || close(newfd) == -1) err(1, "%s", argv[2]); From owner-svn-src-head@freebsd.org Thu Aug 25 16:06:03 2016 Return-Path: Delivered-To: svn-src-head@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 292ABBC6F64; Thu, 25 Aug 2016 16:06:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0996613AB; Thu, 25 Aug 2016 16:06:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id F07591BEB; Thu, 25 Aug 2016 16:06:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B05AF1ADAA; Thu, 25 Aug 2016 16:06:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id b8l1G_5kJpVE; Thu, 25 Aug 2016 16:05:58 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com F2E751ADA3 To: Guido Falsi , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Thu, 25 Aug 2016 09:05:53 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VkJaLfGR42nQgrs2CFagxrWlFRQwTQCQB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 16:06:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VkJaLfGR42nQgrs2CFagxrWlFRQwTQCQB Content-Type: multipart/mixed; boundary="WukO8iuRMc128b7WokiwhAkMgEIEsnkr6" From: Bryan Drewery To: Guido Falsi , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> In-Reply-To: <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> --WukO8iuRMc128b7WokiwhAkMgEIEsnkr6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/25/16 1:27 AM, Guido Falsi wrote: > On 08/24/16 21:49, Ed Schouten wrote: >> 2016-08-24 20:30 GMT+02:00 Bryan Drewery : >>> That would only fix stable/11, stable/10, stable/9, releng/11.0. >>> >>> It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc..= =2E >>> without an EN. >>> >>> It won't fix stable/11 - 1, stable/10 - 1, etc. >>> >>> It will never fix releng/8.4 (unsupported releases) since so@ won't E= N >>> to those. People do sometimes need to build these older releases sti= ll. >>> >>> It creates a line in the sand where we can never build checkouts olde= r >>> than where the fix was at. So I don't think it is the appropriate fi= x. >> >> Good point! >> >> Just for the record: Bryan and I just discussed this matter in more >> detail on IRC. We came up with a workaround that should be pretty >> good. >> >> Attached is a patch for that adds some extra logic, so that= >> any calls to basename() and dirname() will expand to calls to >> __old_basename() and __old_dirname(). Using __sym_compat(), these will= >> cause the compiler to generate calls to basename@FBSD_1.0 and >> dirname@FBSD_1.0. >> >> According to Bryan, this fixes the problems he was experiencing. >> >=20 > I just tried using the attached patch to build a nanobsd image, host is= > amd64 head at r304773 with this patch applied, target is i386 > releng/11.0 at r304729. >=20 What did you apply the patch to? You need to apply to the source tree, then do a buildworld/installworld for the host, then try nanobsd. > I've got it failing early during build: >=20 > --- _bootstrap-tools-usr.bin/xinstall --- > xinstall.o: In function `install': > /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall/xinstall.c:(.text+0xf5= 5): > undefined reference to `basename@FBSD_1.0' > cc: error: linker command failed with exit code 1 (use -v to see invoca= tion) > *** [xinstall] Error code 1 >=20 > make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall > 1 error >=20 > make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall > *** [_bootstrap-tools-usr.bin/xinstall] Error code 2 >=20 > Did I miss some needed procedure? >=20 > Thanks! >=20 --=20 Regards, Bryan Drewery --WukO8iuRMc128b7WokiwhAkMgEIEsnkr6-- --VkJaLfGR42nQgrs2CFagxrWlFRQwTQCQB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvxdhAAoJEDXXcbtuRpfPaLAIAM+EIb288iIk4lkdaP0zHYXS HAa4H+UpjLdvqfUu78t82Cqw4uC10oo8YSoAR1MzdTIDoC9cQCVmhasdaaiL5aVc rAWb3gWqWgeoz3reVyn/zovPQ5+F0FvgYDFnf/RRq8WBIdjQJDtig1NARru7sMvB bsY25F7p2XQaTI/uC4/m80GpjQkY14UniKD0GfAW8U/DT1QPnfA0ec7P9hT5IqHF /+F13fAmqUzpOxHQXWTRmifRfvyxAB2uXBswEF4WsXm+v8LkS8DYtxkrUyzLrq/E DDguInPVPfhVo5GzOmluAZ7QbRlqrc2wx5rO6N4E5r8m9E3AgLetlUKFpvfzN4U= =C/Ig -----END PGP SIGNATURE----- --VkJaLfGR42nQgrs2CFagxrWlFRQwTQCQB-- From owner-svn-src-head@freebsd.org Thu Aug 25 16:18:26 2016 Return-Path: Delivered-To: svn-src-head@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 330BABC524C; Thu, 25 Aug 2016 16:18:26 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (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 C6A44196F; Thu, 25 Aug 2016 16:18:25 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3sKq953bvWzZqm; Thu, 25 Aug 2016 18:18:17 +0200 (CEST) Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id iRhE8wBtdgUD; Thu, 25 Aug 2016 18:18:15 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Thu, 25 Aug 2016 18:18:15 +0200 (CEST) Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Guido Falsi Message-ID: <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> Date: Thu, 25 Aug 2016 18:17:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7MTtqeufihi9d5eSlm4o2DWArJ9KS1R0l" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 16:18:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7MTtqeufihi9d5eSlm4o2DWArJ9KS1R0l Content-Type: multipart/mixed; boundary="P31vmXg7LNa0SeIeKNV3aBQmt8toJtijF" From: Guido Falsi To: Bryan Drewery , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> In-Reply-To: --P31vmXg7LNa0SeIeKNV3aBQmt8toJtijF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/25/16 18:05, Bryan Drewery wrote: > On 8/25/16 1:27 AM, Guido Falsi wrote: >> On 08/24/16 21:49, Ed Schouten wrote: >>> 2016-08-24 20:30 GMT+02:00 Bryan Drewery : >>>> That would only fix stable/11, stable/10, stable/9, releng/11.0. >>>> >>>> It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc.= =2E. >>>> without an EN. >>>> >>>> It won't fix stable/11 - 1, stable/10 - 1, etc. >>>> >>>> It will never fix releng/8.4 (unsupported releases) since so@ won't = EN >>>> to those. People do sometimes need to build these older releases st= ill. >>>> >>>> It creates a line in the sand where we can never build checkouts old= er >>>> than where the fix was at. So I don't think it is the appropriate f= ix. >>> >>> Good point! >>> >>> Just for the record: Bryan and I just discussed this matter in more >>> detail on IRC. We came up with a workaround that should be pretty >>> good. >>> >>> Attached is a patch for that adds some extra logic, so tha= t >>> any calls to basename() and dirname() will expand to calls to >>> __old_basename() and __old_dirname(). Using __sym_compat(), these wil= l >>> cause the compiler to generate calls to basename@FBSD_1.0 and >>> dirname@FBSD_1.0. >>> >>> According to Bryan, this fixes the problems he was experiencing. >>> >> >> I just tried using the attached patch to build a nanobsd image, host i= s >> amd64 head at r304773 with this patch applied, target is i386 >> releng/11.0 at r304729. >> >=20 > What did you apply the patch to? >=20 > You need to apply to the source tree, then do a buildworld/installworld= > for the host, then try nanobsd. I did apply it to the source tree of the host machine, and did not apply it to the nanobsd sources. The error message is very different from the previous one and involves symbol versioning. >=20 >> I've got it failing early during build: >> >> --- _bootstrap-tools-usr.bin/xinstall --- >> xinstall.o: In function `install': >> /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall/xinstall.c:(.text+0xf= 55): >> undefined reference to `basename@FBSD_1.0' >> cc: error: linker command failed with exit code 1 (use -v to see invoc= ation) >> *** [xinstall] Error code 1 >> >> make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall >> 1 error >> >> make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall >> *** [_bootstrap-tools-usr.bin/xinstall] Error code 2 >> >> Did I miss some needed procedure? >> >> Thanks! >> >=20 >=20 --=20 Guido Falsi --P31vmXg7LNa0SeIeKNV3aBQmt8toJtijF-- --7MTtqeufihi9d5eSlm4o2DWArJ9KS1R0l Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEyBAEBCAAcBQJXvxpGFRxtYWRwaWxvdEBmcmVlYnNkLm9yZwAKCRAa5oYOVsvS k3sbCADi8EBsyq1Bt3ynrAWtmDUB2Y/yHTEJx7/qN5KatQOU/EIUZFCGV4VLNS10 IACRvk6+t2nTfKb412u5jzzAmBTjLcu/ZiEkUdC+5gy9llvFInb9yvpsrL5QKzKC gZ1wzsgh/f7XudSbeYl02uQnjGexEM3MbRD5HLyzTvbjcRljFHXRPq9aE6lOBy2E pd6f66umFnsTjt7ycd4mLCAouuldVyC7Mh9Ibuwsl8NoVRleth3FBCRH7tVyr+v6 WNtClj4ivw9Y8t+1SfYoCywArrtnUB46M0tR19cQIhu+qoJknGPoN3yvhhnW41VG yGG3i/dA4euH8yeJ/oYRNRswQMP4 =vp1C -----END PGP SIGNATURE----- --7MTtqeufihi9d5eSlm4o2DWArJ9KS1R0l-- From owner-svn-src-head@freebsd.org Thu Aug 25 16:24:21 2016 Return-Path: Delivered-To: svn-src-head@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 5B0A4BC542D; Thu, 25 Aug 2016 16:24:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 39B6C1DED; Thu, 25 Aug 2016 16:24:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2D95D107D; Thu, 25 Aug 2016 16:24:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D06321AE2D; Thu, 25 Aug 2016 16:24:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id e8jJEACpJZm9; Thu, 25 Aug 2016 16:24:16 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3C37A1AE27 To: Guido Falsi , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Thu, 25 Aug 2016 09:24:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gCKvi3GUwubIU0mG2vMbE0MTjF7K8v79J" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 16:24:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gCKvi3GUwubIU0mG2vMbE0MTjF7K8v79J Content-Type: multipart/mixed; boundary="KGDneuT95b2IHfDE3utxjT7Jf0O5D83nK" From: Bryan Drewery To: Guido Falsi , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> In-Reply-To: <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> --KGDneuT95b2IHfDE3utxjT7Jf0O5D83nK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/25/16 9:17 AM, Guido Falsi wrote: > On 08/25/16 18:05, Bryan Drewery wrote: >> On 8/25/16 1:27 AM, Guido Falsi wrote: >>> On 08/24/16 21:49, Ed Schouten wrote: >>>> 2016-08-24 20:30 GMT+02:00 Bryan Drewery : >>>>> That would only fix stable/11, stable/10, stable/9, releng/11.0. >>>>> >>>>> It won't fix releng/10.3, releng/10.2, releng/10.1, releng/9.3, etc= =2E.. >>>>> without an EN. >>>>> >>>>> It won't fix stable/11 - 1, stable/10 - 1, etc. >>>>> >>>>> It will never fix releng/8.4 (unsupported releases) since so@ won't= EN >>>>> to those. People do sometimes need to build these older releases s= till. >>>>> >>>>> It creates a line in the sand where we can never build checkouts ol= der >>>>> than where the fix was at. So I don't think it is the appropriate = fix. >>>> >>>> Good point! >>>> >>>> Just for the record: Bryan and I just discussed this matter in more >>>> detail on IRC. We came up with a workaround that should be pretty >>>> good. >>>> >>>> Attached is a patch for that adds some extra logic, so th= at >>>> any calls to basename() and dirname() will expand to calls to >>>> __old_basename() and __old_dirname(). Using __sym_compat(), these wi= ll >>>> cause the compiler to generate calls to basename@FBSD_1.0 and >>>> dirname@FBSD_1.0. >>>> >>>> According to Bryan, this fixes the problems he was experiencing. >>>> >>> >>> I just tried using the attached patch to build a nanobsd image, host = is >>> amd64 head at r304773 with this patch applied, target is i386 >>> releng/11.0 at r304729. >>> >> >> What did you apply the patch to? >> >> You need to apply to the source tree, then do a buildworld/installworl= d >> for the host, then try nanobsd. >=20 > I did apply it to the source tree of the host machine, and did not appl= y > it to the nanobsd sources. >=20 > The error message is very different from the previous one and involves > symbol versioning. >=20 >> >>> I've got it failing early during build: >>> >>> --- _bootstrap-tools-usr.bin/xinstall --- >>> xinstall.o: In function `install': >>> /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall/xinstall.c:(.text+0x= f55): >>> undefined reference to `basename@FBSD_1.0' readelf -a /lib/libc.so.7|grep basename ? >>> cc: error: linker command failed with exit code 1 (use -v to see invo= cation) >>> *** [xinstall] Error code 1 >>> >>> make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall >>> 1 error >>> >>> make[3]: stopped in /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall >>> *** [_bootstrap-tools-usr.bin/xinstall] Error code 2 >>> >>> Did I miss some needed procedure? >>> >>> Thanks! >>> >> >> >=20 >=20 --=20 Regards, Bryan Drewery --KGDneuT95b2IHfDE3utxjT7Jf0O5D83nK-- --gCKvi3GUwubIU0mG2vMbE0MTjF7K8v79J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvxuvAAoJEDXXcbtuRpfPU+UIAKpIqBQ4McrxR9uSdN6g0/nE oV+aNF9WobCBcGdTSAkWqJlsDCLnSbfqVbp6dUhFEUZGO6M4Mq0qWmN/aOi/32Gt RLaRQivHUYS4LcPxd9KBAoTsbKw7faOwBMeJ7bvxIWx3BPqA8vErV+GeGy9PxhbT LI3+EYKpE9HMqfBcBpqdAmSWBCR6H3FdelMK2TgHhA1vlRUGrMAw2SLu1gwMVRYL ev0t1mjCHK1AhLAXI9fmDJ9eE95HfZ8iwZof+zc4umF5Ev8/zS2GmKPseUoWsB8X hLXrIK06Vdmiu+7BtobafF+QyMa7ehbaDmB8bYKFcnwfDgWm9h40TKsT4Gx9mOA= =D/1i -----END PGP SIGNATURE----- --gCKvi3GUwubIU0mG2vMbE0MTjF7K8v79J-- From owner-svn-src-head@freebsd.org Thu Aug 25 16:29:34 2016 Return-Path: Delivered-To: svn-src-head@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 2A8FBBC552F; Thu, 25 Aug 2016 16:29:34 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (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 DEA5711CF; Thu, 25 Aug 2016 16:29:33 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3sKqQ35F33zZqm; Thu, 25 Aug 2016 18:29:31 +0200 (CEST) Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id LQGkaPUpSSIt; Thu, 25 Aug 2016 18:29:30 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Thu, 25 Aug 2016 18:29:29 +0200 (CEST) Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Guido Falsi Message-ID: <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> Date: Thu, 25 Aug 2016 18:29:29 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 16:29:34 -0000 On 08/25/16 18:24, Bryan Drewery wrote: >>>> --- _bootstrap-tools-usr.bin/xinstall --- >>>> xinstall.o: In function `install': >>>> /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall/xinstall.c:(.text+0xf55): >>>> undefined reference to `basename@FBSD_1.0' > > readelf -a /lib/libc.so.7|grep basename ? > readelf -a /lib/libc.so.7|grep basename 2149: 0000000000076200 231 FUNC GLOBAL DEFAULT 11 basename@@FBSD_1.0 (2) 2514: 0000000000076140 184 FUNC GLOBAL DEFAULT 11 basename_r@@FBSD_1.2 (4) -- Guido Falsi From owner-svn-src-head@freebsd.org Thu Aug 25 16:35:43 2016 Return-Path: Delivered-To: svn-src-head@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 B7EB8BC583A; Thu, 25 Aug 2016 16:35:43 +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 6D93F1739; Thu, 25 Aug 2016 16:35:43 +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 u7PGZg7q054547; Thu, 25 Aug 2016 16:35:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PGZggN054546; Thu, 25 Aug 2016 16:35:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608251635.u7PGZggN054546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 25 Aug 2016 16:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304808 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 16:35:43 -0000 Author: kib Date: Thu Aug 25 16:35:42 2016 New Revision: 304808 URL: https://svnweb.freebsd.org/changeset/base/304808 Log: Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. If there was some error, e.g. the sleep was interrupted, as in the referenced PR, do_rw_rdlock() did not cleared URWLOCK_READ_WAITERS. Since unlock only wakes up write waiters when there is no read waiters, for URWLOCK_PREFER_READER kind of locks, the result was missed wakeups for writers. In particular, the most visible victims are ld-elf.so locks in processes which loaded libthr, because rtld locks are urwlocks in prefer-reader mode. Normal rwlocks fall into prefer-reader mode only if thread already owns rw lock in read mode, which is not typical and correspondingly less visible. In the PR, unowned rtld bind lock was waited for in the process where only one thread was left alive. Note that do_rw_wrlock() correctly clears URWLOCK_WRITE_WAITERS in case of errors. Reported and tested by: longwitz@incore.de PR: 211947 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Thu Aug 25 15:08:33 2016 (r304807) +++ head/sys/kern/kern_umtx.c Thu Aug 25 16:35:42 2016 (r304808) @@ -2743,9 +2743,12 @@ sleep: suword32(&rwlock->rw_blocked_readers, blocked_readers-1); if (blocked_readers == 1) { rv = fueword32(&rwlock->rw_state, &state); - if (rv == -1) + if (rv == -1) { + umtxq_unbusy_unlocked(&uq->uq_key); error = EFAULT; - while (error == 0) { + break; + } + for (;;) { rv = casueword32(&rwlock->rw_state, state, &oldstate, state & ~URWLOCK_READ_WAITERS); if (rv == -1) { @@ -2756,6 +2759,8 @@ sleep: break; state = oldstate; error = umtxq_check_susp(td); + if (error != 0) + break; } } From owner-svn-src-head@freebsd.org Thu Aug 25 17:07:45 2016 Return-Path: Delivered-To: svn-src-head@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 05CAABC63E9; Thu, 25 Aug 2016 17:07:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CCE831B02; Thu, 25 Aug 2016 17:07:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PH7i2K066380; Thu, 25 Aug 2016 17:07:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PH7i4w066379; Thu, 25 Aug 2016 17:07:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608251707.u7PH7i4w066379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 25 Aug 2016 17:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304809 - head/usr.bin/getconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:07:45 -0000 Author: ngie Date: Thu Aug 25 17:07:43 2016 New Revision: 304809 URL: https://svnweb.freebsd.org/changeset/base/304809 Log: Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs It's not necessarily intuitive that the variables to query contain TRUSTEDBSD in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like "_PC_ACL_NFS4". MFC after: 1 week Relnotes: yes Reviewed by: wollman Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7618 Modified: head/usr.bin/getconf/pathconf.gperf Modified: head/usr.bin/getconf/pathconf.gperf ============================================================================== --- head/usr.bin/getconf/pathconf.gperf Thu Aug 25 16:35:42 2016 (r304808) +++ head/usr.bin/getconf/pathconf.gperf Thu Aug 25 17:07:43 2016 (r304809) @@ -20,8 +20,14 @@ static const struct map *in_word_set(con %} struct map { const char *name; int key; int valid; }; %% +ACL_EXTENDED, _PC_ACL_EXTENDED +ACL_NFS4, _PC_ACL_NFS4 +ACL_PATH_MAX, _PC_ACL_PATH_MAX +CAP_PRESENT, _PC_CAP_PRESENT FILESIZEBITS, _PC_FILESIZEBITS +INF_PRESENT, _PC_INF_PRESENT LINK_MAX, _PC_LINK_MAX +MAC_PRESENT, _PC_MAC_PRESENT MAX_CANON, _PC_MAX_CANON MAX_INPUT, _PC_MAX_INPUT MIN_HOLE_SIZE, _PC_MIN_HOLE_SIZE From owner-svn-src-head@freebsd.org Thu Aug 25 17:13:05 2016 Return-Path: Delivered-To: svn-src-head@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 BA781BC6534; Thu, 25 Aug 2016 17:13:05 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 95E0A1F05; Thu, 25 Aug 2016 17:13:05 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PHD41E069871; Thu, 25 Aug 2016 17:13:04 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PHD4jr069868; Thu, 25 Aug 2016 17:13:04 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608251713.u7PHD4jr069868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 25 Aug 2016 17:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304810 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:13:05 -0000 Author: ache Date: Thu Aug 25 17:13:04 2016 New Revision: 304810 URL: https://svnweb.freebsd.org/changeset/base/304810 Log: Don't check for __SERR which may stick from one of any previous stdio functions. __SERR is for user and the rest of stdio code do not check it for error sensing internally, only set it. In vf(w)printf.c here it is more easy to save __SERR, clear and restore it. Modified: head/lib/libc/stdio/getdelim.c head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c Modified: head/lib/libc/stdio/getdelim.c ============================================================================== --- head/lib/libc/stdio/getdelim.c Thu Aug 25 17:07:43 2016 (r304809) +++ head/lib/libc/stdio/getdelim.c Thu Aug 25 17:13:04 2016 (r304810) @@ -125,7 +125,7 @@ getdelim(char ** __restrict linep, size_ if (fp->_r <= 0 && __srefill(fp)) { /* If fp is at EOF already, we just need space for the NUL. */ - if (__sferror(fp) || expandtofit(linep, 1, linecapp)) + if (!__sfeof(fp) || expandtofit(linep, 1, linecapp)) goto error; FUNLOCKFILE(fp); (*linep)[0] = '\0'; @@ -137,7 +137,7 @@ getdelim(char ** __restrict linep, size_ if (sappend(linep, &linelen, linecapp, fp->_p, fp->_r)) goto error; if (__srefill(fp)) { - if (__sferror(fp)) + if (!__sfeof(fp)) goto error; goto done; /* hit EOF */ } Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Thu Aug 25 17:07:43 2016 (r304809) +++ head/lib/libc/stdio/vfprintf.c Thu Aug 25 17:13:04 2016 (r304810) @@ -364,6 +364,7 @@ __vfprintf(FILE *fp, locale_t locale, co int nextarg; /* 1-based argument index */ va_list orgap; /* original argument pointer */ char *convbuf; /* wide to multibyte conversion result */ + int savserr; static const char xdigs_lower[16] = "0123456789abcdef"; static const char xdigs_upper[16] = "0123456789ABCDEF"; @@ -460,6 +461,9 @@ __vfprintf(FILE *fp, locale_t locale, co return (EOF); } + savserr = fp->_flags & __SERR; + fp->_flags &= ~__SERR; + convbuf = NULL; fmt = (char *)fmt0; argtable = NULL; @@ -1031,6 +1035,8 @@ error: free(convbuf); if (__sferror(fp)) ret = EOF; + else + fp->_flags |= savserr; if ((argtable != NULL) && (argtable != statargtable)) free (argtable); return (ret); Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Thu Aug 25 17:07:43 2016 (r304809) +++ head/lib/libc/stdio/vfwprintf.c Thu Aug 25 17:13:04 2016 (r304810) @@ -444,6 +444,7 @@ __vfwprintf(FILE *fp, locale_t locale, c int nextarg; /* 1-based argument index */ va_list orgap; /* original argument pointer */ wchar_t *convbuf; /* multibyte to wide conversion result */ + int savserr; static const char xdigs_lower[16] = "0123456789abcdef"; static const char xdigs_upper[16] = "0123456789ABCDEF"; @@ -536,6 +537,9 @@ __vfwprintf(FILE *fp, locale_t locale, c return (EOF); } + savserr = fp->_flags & __SERR; + fp->_flags &= ~__SERR; + convbuf = NULL; fmt = (wchar_t *)fmt0; argtable = NULL; @@ -1096,6 +1100,8 @@ error: free(convbuf); if (__sferror(fp)) ret = EOF; + else + fp->_flags |= savserr; if ((argtable != NULL) && (argtable != statargtable)) free (argtable); return (ret); From owner-svn-src-head@freebsd.org Thu Aug 25 17:30:02 2016 Return-Path: Delivered-To: svn-src-head@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 39862BC6791; Thu, 25 Aug 2016 17:30:02 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 07507181F; Thu, 25 Aug 2016 17:30:01 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PHU1ZZ074254; Thu, 25 Aug 2016 17:30:01 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PHU1uQ074253; Thu, 25 Aug 2016 17:30:01 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608251730.u7PHU1uQ074253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 25 Aug 2016 17:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304811 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:30:02 -0000 Author: ache Date: Thu Aug 25 17:30:00 2016 New Revision: 304811 URL: https://svnweb.freebsd.org/changeset/base/304811 Log: Remove "Fast path", it bypass __wcrtomb() and all its error checking. One of affected encoding example: US-ASCII MFC after: 7 days Modified: head/lib/libc/stdio/fputwc.c Modified: head/lib/libc/stdio/fputwc.c ============================================================================== --- head/lib/libc/stdio/fputwc.c Thu Aug 25 17:13:04 2016 (r304810) +++ head/lib/libc/stdio/fputwc.c Thu Aug 25 17:30:00 2016 (r304811) @@ -53,19 +53,9 @@ __fputwc(wchar_t wc, FILE *fp, locale_t size_t i, len; struct xlocale_ctype *l = XLOCALE_CTYPE(locale); - if (MB_CUR_MAX == 1 && wc > 0 && wc <= UCHAR_MAX) { - /* - * Assume single-byte locale with no special encoding. - * A more careful test would be to check - * _CurrentRuneLocale->encoding. - */ - *buf = (unsigned char)wc; - len = 1; - } else { - if ((len = l->__wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) { - fp->_flags |= __SERR; - return (WEOF); - } + if ((len = l->__wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) { + fp->_flags |= __SERR; + return (WEOF); } for (i = 0; i < len; i++) From owner-svn-src-head@freebsd.org Thu Aug 25 17:44:03 2016 Return-Path: Delivered-To: svn-src-head@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 5EEB1BC6B0E; Thu, 25 Aug 2016 17:44:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC06117D; Thu, 25 Aug 2016 17:44:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 359A61729; Thu, 25 Aug 2016 17:44:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id F11261D010; Thu, 25 Aug 2016 17:44:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 93G3j34xmO0J; Thu, 25 Aug 2016 17:43:59 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8E8831D00B To: Guido Falsi , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Organization: FreeBSD Message-ID: <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> Date: Thu, 25 Aug 2016 10:43:55 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lF4fAaRgJDiW5AJe2xu9rdSHRkfjTdpui" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:44:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lF4fAaRgJDiW5AJe2xu9rdSHRkfjTdpui Content-Type: multipart/mixed; boundary="WuflfVc4tKUJcEvtTF1PNvNiOlxns4qqQ" From: Bryan Drewery To: Guido Falsi , Ed Schouten Cc: svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> In-Reply-To: <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> --WuflfVc4tKUJcEvtTF1PNvNiOlxns4qqQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/25/16 9:29 AM, Guido Falsi wrote: > On 08/25/16 18:24, Bryan Drewery wrote: >>>>> --- _bootstrap-tools-usr.bin/xinstall --- >>>>> xinstall.o: In function `install': >>>>> /usr/local/nanobsd/rr-trunk/src/usr.bin/xinstall/xinstall.c:(.text+= 0xf55): >>>>> undefined reference to `basename@FBSD_1.0' >> >> readelf -a /lib/libc.so.7|grep basename ? >=20 >> readelf -a /lib/libc.so.7|grep basename > 2149: 0000000000076200 231 FUNC GLOBAL DEFAULT 11 > basename@@FBSD_1.0 (2) > 2514: 0000000000076140 184 FUNC GLOBAL DEFAULT 11 > basename_r@@FBSD_1.2 (4) >=20 >=20 Hmm, I do run into the same issue with 'buildworld'. It builds fine directly though. Debugging it more here. --=20 Regards, Bryan Drewery --WuflfVc4tKUJcEvtTF1PNvNiOlxns4qqQ-- --lF4fAaRgJDiW5AJe2xu9rdSHRkfjTdpui Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXvy5cAAoJEDXXcbtuRpfPbcUH/1f65/H/nIymw56xjU+6fGLD aehYtsbbWtVBWhwIDI7HIBMkMlUoB7ZLJecVAGRREgcElyhpb/yPGl8Drzmx6JOT YVEmPdLRVvIrKH0WzGwGxcx6PbcSSelVY8bIbJTaHekx99jDjYDzit6A4Tz93Fxn bj1UK8/9mbrQ32PN+tt0jiXv5bMYVw3Zmbc5nWEUfV70Oor9sZF+vaZc73nOVYnM vy1aPIfZfm27G1hm7J3mSG9GotFGD3o3O+mW405dboa7sSljmRXnK/reskFw3vT8 cdQOcUjY78xD08RmAvnCWbqTYJBDDrx44hGDkAS0Pl+jQeduB71pw4lfw67mUrA= =rRIq -----END PGP SIGNATURE----- --lF4fAaRgJDiW5AJe2xu9rdSHRkfjTdpui-- From owner-svn-src-head@freebsd.org Thu Aug 25 17:52:44 2016 Return-Path: Delivered-To: svn-src-head@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 B3370BC6CD5; Thu, 25 Aug 2016 17:52:44 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id A10B316D4; Thu, 25 Aug 2016 17:52:44 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id DB31E17743; Thu, 25 Aug 2016 10:52:37 -0700 (PDT) Date: Thu, 25 Aug 2016 10:52:37 -0700 From: hiren panchasara To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303766 - head/sys/netinet Message-ID: <20160825175237.GC41576@strugglingcoder.info> References: <201608050908.u75980fB078890@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H8ygTp4AXg6deix2" Content-Disposition: inline In-Reply-To: <201608050908.u75980fB078890@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:52:44 -0000 --H8ygTp4AXg6deix2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/05/16 at 09:08P, Sepherosa Ziehau wrote: > Author: sephe > Date: Fri Aug 5 09:08:00 2016 > New Revision: 303766 > URL: https://svnweb.freebsd.org/changeset/base/303766 >=20 > Log: > tcp/lro: If timestamps mismatch or it's a FIN, force flush. > =20 > This keeps the segments/ACK/FIN delivery order. > =20 > Before this patch, it was observed: if A sent FIN immediately after > an ACK, B would deliver FIN first to the TCP stack, then the ACK. > This out-of-order delivery causes one unnecessary ACK sent from B. > =20 > Reviewed by: gallatin, hps > Obtained from: rrs, gallatin > Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe) > Differential Revision: https://reviews.freebsd.org/D7415 Hi Sephe, This looks like a good fix for stable/11. Can you please MFC it? Cheers, Hiren --H8ygTp4AXg6deix2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXvzBiXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lLCAIAIuQcoFdscbPIzBhWRw50SW8 rqLchUb7j5CXmUIMqhDyVsWTtCfHkoftn0Jsiv3YOAM9piGTCGLTV1YTeE67J3AG 3NulSpWwX3intG7CsTtK5EvzmDoX9yxrDEjwpNV5zATHBsbf1gn0OnCPihf1lwvG CeFeZYVUum5FivO1ybHncq4yXlnOOpY+WetSgWHiN+k/oghWGmrJxRmQcPCtL6qB Mgj7uyuvMK4QeChjE/tehvfh7zOoevwk8c5ykDwNAZcOO7PvLcLeNIGx0W9/BGjB pjcWthG6zj1pg1PJpPxPd1ROmT1Bo+IRzBdKDSSjFyzwHP7ggzpy2JufiJvkohA= =3JBZ -----END PGP SIGNATURE----- --H8ygTp4AXg6deix2-- From owner-svn-src-head@freebsd.org Thu Aug 25 17:54:29 2016 Return-Path: Delivered-To: svn-src-head@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 E3C9EBC6DAF; Thu, 25 Aug 2016 17:54:29 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id D5AD11869; Thu, 25 Aug 2016 17:54:29 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 227621774D; Thu, 25 Aug 2016 10:54:29 -0700 (PDT) Date: Thu, 25 Aug 2016 10:54:29 -0700 From: hiren panchasara To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303656 - head/sys/netinet Message-ID: <20160825175429.GD41576@strugglingcoder.info> References: <201608020636.u726alY8000175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n/aVsWSeQ4JHkrmm" Content-Disposition: inline In-Reply-To: <201608020636.u726alY8000175@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:54:30 -0000 --n/aVsWSeQ4JHkrmm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/02/16 at 06:36P, Sepherosa Ziehau wrote: > Author: sephe > Date: Tue Aug 2 06:36:47 2016 > New Revision: 303656 > URL: https://svnweb.freebsd.org/changeset/base/303656 >=20 > Log: > tcp/lro: Implement hash table for LRO entries. > =20 > This significantly improves HTTP workload performance and reduces > HTTP workload latency. > =20 > Reviewed by: rrs, gallatin, hps > Obtained from: rrs, gallatin > Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe) > Differential Revision: https://reviews.freebsd.org/D6689 Hi Sephe, Can you please MFC this to stable/11? Cheers, Hiren --n/aVsWSeQ4JHkrmm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXvzDVXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lOLkH/Av0booQZZGLql5fNgKEVqGn svbW+01/hPasRAO7sof13GSj60CrErv6RXYckz/t72T73Oqhyxb2YxlOlI2LpgAL MLyPZty1Z+qz334bzv7vyrgw4LKDQgsdWIMV1p3/ZXrpuYG3QiHWYdZ+qQ1qIV7+ WFDatekvaZB5JOeOsEJdnf3rQPUScXfYRoLLJsDVAosXrLGyI55in06pX/loyeLi e8Br4hK/ng8Qs3jF1RocTV/GBwflREmtmdei3EYcbGA4WO3u+Uf0/tms7H9zLeS/ VT0kgDMvFoTVZwVmzp3q4vQGSvFvwKghUtiIpUasV+UZODnrt3N86rcb8HJ4XOA= =rbRr -----END PGP SIGNATURE----- --n/aVsWSeQ4JHkrmm-- From owner-svn-src-head@freebsd.org Thu Aug 25 17:55:31 2016 Return-Path: Delivered-To: svn-src-head@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 0D490BC6E4D; Thu, 25 Aug 2016 17:55:31 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id F37D819FF; Thu, 25 Aug 2016 17:55:30 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 3642117755; Thu, 25 Aug 2016 10:55:30 -0700 (PDT) Date: Thu, 25 Aug 2016 10:55:30 -0700 From: hiren panchasara To: Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303626 - in head/sys: netinet netinet6 Message-ID: <20160825175530.GE41576@strugglingcoder.info> References: <201608011702.u71H2L1e095815@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WK3l2KTTmXPVedZ6" Content-Disposition: inline In-Reply-To: <201608011702.u71H2L1e095815@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:55:31 -0000 --WK3l2KTTmXPVedZ6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/01/16 at 05:02P, Andrew Gallatin wrote: > Author: gallatin > Date: Mon Aug 1 17:02:21 2016 > New Revision: 303626 > URL: https://svnweb.freebsd.org/changeset/base/303626 >=20 > Log: > Rework IPV6 TCP path MTU discovery to match IPv4 > =20 > - Re-write tcp_ctlinput6() to closely mimic the IPv4 tcp_ctlinput() > =20 > - Now that tcp_ctlinput6() updates t_maxseg, we can allow ip6_output() > to send TCP packets without looking at the tcp host cache for every > single transmit. > =20 > - Make the icmp6 code mimic the IPv4 code & avoid returning > PRC_HOSTDEAD because it is so expensive. > =20 > Without these changes in place, every TCP6 pmtu discovery or host > unreachable ICMP resulted in a call to in6_pcbnotify() which walks the > tcbinfo table with the write lock held. Because the tcbinfo table is > shared between IPv4 and IPv6, this causes huge scalabilty issues on > servers with lots of (~100K) TCP connections, to the point where even > a small percent of IPv6 traffic had a disproportionate impact on > overall throughput. > =20 > Reviewed by: bz, rrs, ae (all earlier versions), lstewart (in Netflix's= tree) > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D7272 Drew, What do you think about getting this into stable/11? Cheers, Hiren --WK3l2KTTmXPVedZ6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXvzESXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lM7QIAIBoJTM2xYZufinQws2kOWMb IuhNv2YX31Savtyh4xz2CReKsA9g3fnXD8Sd/JP19w6LvU7JQtRZGAwczcwumhVM za37Eqei9NYlptGKfmXfBQfNifzIkbiK5GFFOH/itc55tX1kuXQhZHW5lJishoVG 8LcdimI1pljuBIP72XeUjHQ2zB0le4lBJIU0PdfYwqtyPRXyolz8R+sL+tcqGZl/ Jfp7RdSP+gmq4qOr56pISTNseMayIdFMAdAD+iYUu76Sg8tG+JVsdyQOray9MTL1 o5GR4+lvg4snjcKrX7cFLJsxp3V9Zl0Rt6685PLJE4m/jbzUDQSF7lu9//BcESE= =Siao -----END PGP SIGNATURE----- --WK3l2KTTmXPVedZ6-- From owner-svn-src-head@freebsd.org Thu Aug 25 17:57:13 2016 Return-Path: Delivered-To: svn-src-head@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 D1393BC6EFA; Thu, 25 Aug 2016 17:57:13 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id C2DA61BF9; Thu, 25 Aug 2016 17:57:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 7661917766; Thu, 25 Aug 2016 10:57:12 -0700 (PDT) Date: Thu, 25 Aug 2016 10:57:12 -0700 From: hiren panchasara To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304223 - in head: share/man/man4 share/man/man9 sys/netinet Message-ID: <20160825175712.GF41576@strugglingcoder.info> References: <201608161511.u7GFBkJQ037962@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zi0sgQQBxRFxMTsj" Content-Disposition: inline In-Reply-To: <201608161511.u7GFBkJQ037962@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:57:13 -0000 --Zi0sgQQBxRFxMTsj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/16/16 at 03:11P, Randall Stewart wrote: > Author: rrs > Date: Tue Aug 16 15:11:46 2016 > New Revision: 304223 > URL: https://svnweb.freebsd.org/changeset/base/304223 >=20 > Log: > Here we update the modular tcp to be able to switch to an > alternate TCP stack in other then the closed state (pre-listen/connect). > The idea is that *if* that is supported by the alternate stack, it > is asked if its ok to switch. If it approves the "handoff" then we > allow the switch to happen. Also the fini() function now gets a flag > to tell if you are switching away *or* the tcb is destroyed. The > init() call into the alternate stack is moved to the end so the > tcb is more fully formed before the init transpires. > =20 > Sponsored by: Netflix Inc. > Differential Revision: D6790 >=20 > Modified: > head/share/man/man4/tcp.4 > head/share/man/man9/tcp_functions.9 > head/sys/netinet/tcp_subr.c > head/sys/netinet/tcp_syncache.c > head/sys/netinet/tcp_usrreq.c > head/sys/netinet/tcp_var.h Randall, Is this something we can bring back to stable/11? Cheers, Hiren --Zi0sgQQBxRFxMTsj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXvzF4XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lDv0H/3MNeAbm/2WACf/BI91RtarU +fAi8fepnvcspZjN6J/WR3w7AzYWAV/Zq556MFJJwvkRSHDG8LpSGYbVfeheZIdS zm4+dsmlVgjpHEHDi2EoAmYsf1JTu7ktTrR+Qc4FuIx+JNTXiVwja0uxvPSDc9dE UIzT3maND4WHYCmsCtYsYAoneD9o1jilWIcuHdcjwoZ/+cYLFdNYbbGohPKyiQ42 xu05LWRMTT4FSTM+dNMQPNSvQ6UYtkcVhxdNWd2myBTIVyz28D+7uPii84L34wT9 r34sykKJRO6Buu+XR+VCj1scWXRyPiEJwfHaFPyWg+sVCqjmcB7PxYCzBbdk8G4= =/WnS -----END PGP SIGNATURE----- --Zi0sgQQBxRFxMTsj-- From owner-svn-src-head@freebsd.org Thu Aug 25 18:39:50 2016 Return-Path: Delivered-To: svn-src-head@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 C86B3BC670F; Thu, 25 Aug 2016 18:39:50 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id BA5E312AC; Thu, 25 Aug 2016 18:39:50 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 0354117771; Thu, 25 Aug 2016 11:39:48 -0700 (PDT) Date: Thu, 25 Aug 2016 11:39:48 -0700 From: hiren panchasara To: Lawrence Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304803 - in head/sys: netinet netinet/cc sys Message-ID: <20160825183948.GG41576@strugglingcoder.info> References: <201608251333.u7PDXW33086932@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zrag5V6pnZGjLKiw" Content-Disposition: inline In-Reply-To: <201608251333.u7PDXW33086932@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 18:39:50 -0000 --Zrag5V6pnZGjLKiw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/25/16 at 01:33P, Lawrence Stewart wrote: > Author: lstewart > Date: Thu Aug 25 13:33:32 2016 > New Revision: 304803 > URL: https://svnweb.freebsd.org/changeset/base/304803 >=20 > Log: > Pass the number of segments coalesced by LRO up the stack by repurposin= g the > tso_segsz pkthdr field during RX processing, and use the information in= TCP for > more correct accounting and as a congestion control input. This is only= a start, > and an audit of other uses for the data is left as future work. > =20 > Reviewed by: gallatin, rrs > Sponsored by: Netflix, Inc. > Differential Revision: https://reviews.freebsd.org/D7564 >=20 > Modified: > head/sys/netinet/cc/cc.h > head/sys/netinet/cc/cc_newreno.c > head/sys/netinet/tcp_input.c > head/sys/netinet/tcp_lro.c > head/sys/netinet/tcp_var.h > head/sys/sys/mbuf.h fastpath module is broken now. You may want to update that. Also, can this be brought back to stable/11? Cheers, Hiren --Zrag5V6pnZGjLKiw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXvztuXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lo4AIAKOezMcwoHXSs8rN1Ueof3TP invt06WIHSt141VkvqqYy8gFE34Y8OJvElGq9BadXr6Tb9h6GpD3EKea18NhVEm3 MvMFReSmgwIqgQjZPFWW1Pm26GRrzTOVoGz7D+EyPHVSLAZKbz9qQd82rFHQefS/ QwA52mAecXmxQkaCF5JmHBPyYYKSMkwT3YyNiYlCVuS+aTXSR1/W7LSssqd4jMMN QAFG9wYNtFxhPH4EKf3wRwpV1Nuixx+h9tXKy9ti4AjAclTHyD6GVExG3oBuBHVQ B2WvUNoN637mX4O2bt0xU6KO/6tFHgZ+0tjrLPTJppeNuCT5WUJwxRRUEGJCg+M= =UUT3 -----END PGP SIGNATURE----- --Zrag5V6pnZGjLKiw-- From owner-svn-src-head@freebsd.org Thu Aug 25 19:15:03 2016 Return-Path: Delivered-To: svn-src-head@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 9793DBC6EE9; Thu, 25 Aug 2016 19:15:03 +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 52710178F; Thu, 25 Aug 2016 19:15:03 +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 u7PJF2oO015400; Thu, 25 Aug 2016 19:15:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PJF2s5015399; Thu, 25 Aug 2016 19:15:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608251915.u7PJF2s5015399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 25 Aug 2016 19:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304812 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 19:15:03 -0000 Author: kib Date: Thu Aug 25 19:15:02 2016 New Revision: 304812 URL: https://svnweb.freebsd.org/changeset/base/304812 Log: In both do_rw_wrlock() and do_rw_rdlock() after r304808, do not obliterate possible error from sleep with errors from umtxq_check_susp(), when looping to clear URWLOCK_{READ,WRITE}_WAITERS. Noted and reviewed by: vangyzen Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Thu Aug 25 17:30:00 2016 (r304811) +++ head/sys/kern/kern_umtx.c Thu Aug 25 19:15:02 2016 (r304812) @@ -2609,7 +2609,7 @@ do_rw_rdlock(struct thread *td, struct u uint32_t flags, wrflags; int32_t state, oldstate; int32_t blocked_readers; - int error, rv; + int error, error1, rv; uq = td->td_umtxq; error = fueword32(&rwlock->rw_flags, &flags); @@ -2758,9 +2758,12 @@ sleep: if (oldstate == state) break; state = oldstate; - error = umtxq_check_susp(td); - if (error != 0) + error1 = umtxq_check_susp(td); + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } } @@ -2783,7 +2786,7 @@ do_rw_wrlock(struct thread *td, struct u int32_t state, oldstate; int32_t blocked_writers; int32_t blocked_readers; - int error, rv; + int error, error1, rv; uq = td->td_umtxq; error = fueword32(&rwlock->rw_flags, &flags); @@ -2929,14 +2932,17 @@ sleep: if (oldstate == state) break; state = oldstate; - error = umtxq_check_susp(td); + error1 = umtxq_check_susp(td); /* * We are leaving the URWLOCK_WRITE_WAITERS * behind, but this should not harm the * correctness. */ - if (error != 0) + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } rv = fueword32(&rwlock->rw_blocked_readers, &blocked_readers); From owner-svn-src-head@freebsd.org Thu Aug 25 19:37:00 2016 Return-Path: Delivered-To: svn-src-head@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 06DEDBC64E9; Thu, 25 Aug 2016 19:37:00 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 ABAE5167C; Thu, 25 Aug 2016 19:36:59 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PJawEk022904; Thu, 25 Aug 2016 19:36:58 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PJaw7X022898; Thu, 25 Aug 2016 19:36:58 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201608251936.u7PJaw7X022898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Thu, 25 Aug 2016 19:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304814 - in head: bin/dd sbin/ggate/ggatec sbin/ggate/ggated usr.sbin/cdcontrol usr.sbin/pc-sysinstall/backend X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 19:37:00 -0000 Author: ak (ports committer) Date: Thu Aug 25 19:36:58 2016 New Revision: 304814 URL: https://svnweb.freebsd.org/changeset/base/304814 Log: Remove last remnants of acd(4), mcd(4), and scd(4) drivers. Approved by: jhb Modified: head/bin/dd/dd.1 head/sbin/ggate/ggatec/ggatec.8 head/sbin/ggate/ggated/ggated.8 head/usr.sbin/cdcontrol/cdcontrol.1 head/usr.sbin/cdcontrol/cdcontrol.c head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Thu Aug 25 19:17:16 2016 (r304813) +++ head/bin/dd/dd.1 Thu Aug 25 19:36:58 2016 (r304814) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd February 28, 2016 +.Dd August 25, 2016 .Dt DD 1 .Os .Sh NAME @@ -414,7 +414,7 @@ Check for (even) parity errors on a file To create an image of a Mode-1 CD-ROM, which is a commonly used format for data CD-ROM disks, use a block size of 2048 bytes: .Pp -.Dl "dd if=/dev/acd0 of=filename.iso bs=2048" +.Dl "dd if=/dev/cd0 of=filename.iso bs=2048" .Pp Write a filesystem image to a memory stick, padding the end with zeros, if necessary, to a 1MiB boundary: Modified: head/sbin/ggate/ggatec/ggatec.8 ============================================================================== --- head/sbin/ggate/ggatec/ggatec.8 Thu Aug 25 19:17:16 2016 (r304813) +++ head/sbin/ggate/ggatec/ggatec.8 Thu Aug 25 19:36:58 2016 (r304814) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd August 25, 2016 .Dt GGATEC 8 .Os .Sh NAME @@ -161,10 +161,10 @@ option. Use a CD-ROM device on a remote host. .Bd -literal -offset indent server# cat /etc/gg.exports -client RO /dev/acd0 +client RO /dev/cd0 server# ggated -client# ggatec create -o ro server /dev/acd0 +client# ggatec create -o ro server /dev/cd0 ggate0 client# mount_cd9660 /dev/ggate0 /cdrom .Ed Modified: head/sbin/ggate/ggated/ggated.8 ============================================================================== --- head/sbin/ggate/ggated/ggated.8 Thu Aug 25 19:17:16 2016 (r304813) +++ head/sbin/ggate/ggated/ggated.8 Thu Aug 25 19:36:58 2016 (r304814) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2016 +.Dd August 25, 2016 .Dt GGATED 8 .Os .Sh NAME @@ -87,7 +87,7 @@ An alternate location for the exports fi .Pp The format of an exports file is as follows: .Bd -literal -offset indent -1.2.3.4 RO /dev/acd0 +1.2.3.4 RO /dev/cd0 1.2.3.0/24 RW /tmp/test.img hostname WO /tmp/image .Ed @@ -108,7 +108,7 @@ option. .Sh EXAMPLES Export CD-ROM device and a file: .Bd -literal -offset indent -# echo "1.2.3.0/24 RO /dev/acd0" > /etc/gg.exports +# echo "1.2.3.0/24 RO /dev/cd0" > /etc/gg.exports # echo "client RW /image" >> /etc/gg.exports # ggated .Ed Modified: head/usr.sbin/cdcontrol/cdcontrol.1 ============================================================================== --- head/usr.sbin/cdcontrol/cdcontrol.1 Thu Aug 25 19:17:16 2016 (r304813) +++ head/usr.sbin/cdcontrol/cdcontrol.1 Thu Aug 25 19:36:58 2016 (r304814) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd June 27, 2008 +.Dd August 25, 2016 .Dt CDCONTROL 1 .Os .Sh NAME @@ -17,9 +17,7 @@ The utility is a program to control audio features of a CD drive. The device is a name such as -.Pa cd0 -or -.Pa acd0 . +.Pa cd0 . .Pp If no .Ar command @@ -37,9 +35,7 @@ Verbose mode. Print as much information as possible. .It Fl f Ar device Specify a device, such as -.Pa /dev/cd0 -or -.Pa acd0 . +.Pa /dev/cd0 . Both absolute path and relative to .Pa /dev filename are possible. @@ -56,9 +52,7 @@ option is specified, tries opening first .Pa /dev/cdrom , then -.Pa /dev/cd0 , -and finally -.Pa /dev/acd0 . +.Pa /dev/cd0 . .El .Pp The available commands are listed below. @@ -206,10 +200,8 @@ These variables have been deprecated in .Ev CDROM . .El .Sh FILES -.Bl -tag -width ".Pa /dev/mcd0" -compact +.Bl -tag -width ".Pa /dev/cd0" -compact .It Pa /dev/cd0 -.It Pa /dev/mcd0 -.It Pa /dev/acd0 .El .Sh HISTORY The Modified: head/usr.sbin/cdcontrol/cdcontrol.c ============================================================================== --- head/usr.sbin/cdcontrol/cdcontrol.c Thu Aug 25 19:17:16 2016 (r304813) +++ head/usr.sbin/cdcontrol/cdcontrol.c Thu Aug 25 19:36:58 2016 (r304814) @@ -1292,8 +1292,6 @@ open_cd(void) fd = open(dev = "/dev/cdrom", O_RDONLY); if (fd < 0 && errno == ENOENT) fd = open(dev = "/dev/cd0", O_RDONLY); - if (fd < 0 && errno == ENOENT) - fd = open(dev = "/dev/acd0", O_RDONLY); } if (fd < 0) { Modified: head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh Thu Aug 25 19:17:16 2016 (r304813) +++ head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh Thu Aug 25 19:36:58 2016 (r304814) @@ -82,7 +82,7 @@ opt_mount() do # Loop though and look for an installation disk - for i in `ls -1 /dev/acd* /dev/cd* /dev/scd* /dev/rscd* 2>/dev/null` + for i in `ls -1 /dev/cd* 2>/dev/null` do # Find the CD Device /sbin/mount_cd9660 $i ${CDMNT} From owner-svn-src-head@freebsd.org Thu Aug 25 19:40:27 2016 Return-Path: Delivered-To: svn-src-head@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 59170BC65A7; Thu, 25 Aug 2016 19:40:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F15C5185D; Thu, 25 Aug 2016 19:40:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PJeQaI023094; Thu, 25 Aug 2016 19:40:26 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PJePv3023083; Thu, 25 Aug 2016 19:40:25 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608251940.u7PJePv3023083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 25 Aug 2016 19:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 19:40:27 -0000 Author: kp Date: Thu Aug 25 19:40:25 2016 New Revision: 304815 URL: https://svnweb.freebsd.org/changeset/base/304815 Log: Add libifc, a library implementing core functionality that exists in ifconfig(8) today. libifc (pronounced lib-ifconfig) aims to be a light abstraction layer between programs and the kernel APIs for managing the network configuration. This should hopefully make programs easier to maintain, and reduce code duplication. Work will begin on making ifconfig(8) use this library in the near future. This code is still evolving. The interface should not be considered stable until it is announced as such. Submitted By: Marie Helene Kvello-Aune Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D7529 Added: head/lib/libifc/ head/lib/libifc/Makefile (contents, props changed) head/lib/libifc/libifc.c (contents, props changed) head/lib/libifc/libifc.h (contents, props changed) head/lib/libifc/libifc_internal.c (contents, props changed) head/lib/libifc/libifc_internal.h (contents, props changed) head/share/examples/libifc/ head/share/examples/libifc/Makefile (contents, props changed) head/share/examples/libifc/ifcreate.c (contents, props changed) head/share/examples/libifc/ifdestroy.c (contents, props changed) head/share/examples/libifc/setdescription.c (contents, props changed) head/share/examples/libifc/setmtu.c (contents, props changed) Modified: head/lib/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Aug 25 19:36:58 2016 (r304814) +++ head/lib/Makefile Thu Aug 25 19:40:25 2016 (r304815) @@ -60,6 +60,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ ${_libgssapi} \ ${_librpcsec_gss} \ ${_libiconv_modules} \ + libifc \ libipsec \ libjail \ libkiconv \ Added: head/lib/libifc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libifc/Makefile Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +PACKAGE= lib${LIB} +LIB= ifc +# Don't build shared library, for now. +NO_PIC= + +SHLIBDIR?= /lib +SHLIB_MAJOR= 1 +SRCS= libifc.c libifc_internal.c + +INCSDIR= ${INCLUDEDIR} +INCS= libifc.h + +#MAN= libifco.3 + +CFLAGS+= -I${.CURDIR} +WARNS?=6 + +.include Added: head/lib/libifc/libifc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libifc/libifc.c Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,397 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Copyright (c) 1983, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "libifc.h" +#include "libifc_internal.h" + + +libifc_handle_t * +libifc_open(void) +{ + struct libifc_handle *h; + + h = calloc(1, sizeof(struct libifc_handle)); + + for (int i = 0; i <= AF_MAX; i++) { + h->sockets[i] = -1; + } + + return (h); +} + + +void +libifc_close(libifc_handle_t *h) +{ + for (int i = 0; i <= AF_MAX; i++) { + if (h->sockets[i] != -1) { + (void)close(h->sockets[i]); + } + } + free(h); +} + + +libifc_errtype +libifc_err_errtype(libifc_handle_t *h) +{ + return (h->error.errtype); +} + + +int +libifc_err_errno(libifc_handle_t *h) +{ + return (h->error.errcode); +} + + +unsigned long +libifc_err_ioctlreq(libifc_handle_t *h) +{ + return (h->error.ioctl_request); +} + + +int +libifc_get_description(libifc_handle_t *h, const char *name, char **description) +{ + struct ifreq ifr; + char *descr = NULL; + size_t descrlen = 64; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + for (;;) { + if ((descr = reallocf(descr, descrlen)) == NULL) { + h->error.errtype = OTHER; + h->error.errcode = ENOMEM; + return (-1); + } + + ifr.ifr_buffer.buffer = descr; + ifr.ifr_buffer.length = descrlen; + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFDESCR, + &ifr) != 0) { + return (-1); + } + + if (ifr.ifr_buffer.buffer == descr) { + if (strlen(descr) > 0) { + *description = strdup(descr); + free(descr); + return (0); + } + } else if (ifr.ifr_buffer.length > descrlen) { + descrlen = ifr.ifr_buffer.length; + continue; + } + break; + } + free(descr); + h->error.errtype = OTHER; + h->error.errcode = 0; + return (-1); +} + + +int +libifc_set_description(libifc_handle_t *h, const char *name, + const char *newdescription) +{ + struct ifreq ifr; + int desclen; + + memset(&ifr, 0, sizeof(struct ifreq)); + desclen = strlen(newdescription); + + /* + * Unset description if the new description is 0 characters long. + * TODO: Decide whether this should be an error condition instead. + */ + if (desclen == 0) { + return (libifc_unset_description(h, name)); + } + + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + ifr.ifr_buffer.length = desclen + 1; + ifr.ifr_buffer.buffer = strdup(newdescription); + if (ifr.ifr_buffer.buffer == NULL) { + h->error.errtype = OTHER; + h->error.errcode = ENOMEM; + return (-1); + } + + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) != 0) { + free(ifr.ifr_buffer.buffer); + return (-1); + } + free(ifr.ifr_buffer.buffer); + return (0); +} + + +int libifc_unset_description(libifc_handle_t *h, const char *name) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + ifr.ifr_buffer.length = 0; + ifr.ifr_buffer.buffer = NULL; + + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) < 0) { + return (-1); + } + return (0); +} + + +int libifc_set_name(libifc_handle_t *h, const char *name, const char *newname) +{ + struct ifreq ifr; + char *tmpname; + + memset(&ifr, 0, sizeof(struct ifreq)); + tmpname = strdup(newname); + if (tmpname == NULL) { + h->error.errtype = OTHER; + h->error.errcode = ENOMEM; + return (-1); + } + + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + ifr.ifr_data = tmpname; + + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFNAME, &ifr) != 0) { + free(tmpname); + return (-1); + } + free(tmpname); + return (0); +} + + +int libifc_set_mtu(libifc_handle_t *h, const char *name, const int mtu) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + ifr.ifr_mtu = mtu; + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFMTU, &ifr) < 0) { + return (-1); + } + return (0); +} + + +int libifc_get_mtu(libifc_handle_t *h, const char *name, int *mtu) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFMTU, &ifr) == -1) { + return (-1); + } + *mtu = ifr.ifr_mtu; + return (0); +} + + +int libifc_set_metric(libifc_handle_t *h, const char *name, const int mtu) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + ifr.ifr_mtu = mtu; + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFMETRIC, &ifr) < 0) { + return (-1); + } + return (0); +} + + +int libifc_get_metric(libifc_handle_t *h, const char *name, int *metric) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFMETRIC, &ifr) == -1) { + return (-1); + } + *metric = ifr.ifr_metric; + return (0); +} + + +int libifc_set_capability(libifc_handle_t *h, const char *name, + const int capability) +{ + struct ifreq ifr; + struct libifc_capabilities ifcap; + int flags; + int value; + + memset(&ifr, 0, sizeof(struct ifreq)); + if (libifc_get_capability(h, name, &ifcap) != 0) { + return (-1); + } + + value = capability; + flags = ifcap.curcap; + if (value < 0) { + value = -value; + flags &= ~value; + } else { + flags |= value; + } + flags &= ifcap.reqcap; + + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + /* + * TODO: Verify that it's safe to not have ifr.ifr_curcap + * set for this request. + */ + ifr.ifr_reqcap = flags; + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFCAP, &ifr) < 0) { + return (-1); + } + return (0); +} + + +int libifc_get_capability(libifc_handle_t *h, const char *name, + struct libifc_capabilities *capability) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFCAP, &ifr) < 0) { + return (-1); + } + capability->curcap = ifr.ifr_curcap; + capability->reqcap = ifr.ifr_reqcap; + return (0); +} + + +int libifc_destroy_interface(libifc_handle_t *h, const char *name) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCIFDESTROY, &ifr) < 0) { + return (-1); + } + return (0); +} + + +int libifc_create_interface(libifc_handle_t *h, const char *name, char **ifname) +{ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(struct ifreq)); + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + + /* + * TODO: + * Insert special snowflake handling here. See GitHub issue #12 for details. + * In the meantime, hard-nosupport interfaces that need special handling. + */ + if ((strncmp(name, "wlan", strlen("wlan")) == 0) || + (strncmp(name, "vlan", strlen("vlan")) == 0) || + (strncmp(name, "vxlan", strlen("vxlan")) == 0)) { + h->error.errtype = OTHER; + h->error.errcode = ENOSYS; + return (-1); + } + + /* No special handling for this interface type. */ + + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCIFCREATE2, &ifr) < 0) { + return (-1); + } + *ifname = strdup(ifr.ifr_name); + return (0); +} Added: head/lib/libifc/libifc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libifc/libifc.h Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#pragma once + +typedef enum { + OTHER, IOCTL, SOCKET +} libifc_errtype; + +/* + * Opaque definition so calling application can just pass a + * pointer to it for library use. + */ +struct libifc_handle; +typedef struct libifc_handle libifc_handle_t; + +struct libifc_capabilities { + /** Current capabilities (ifconfig prints this as 'options')*/ + int curcap; + /** Requested capabilities (ifconfig prints this as 'capabilities')*/ + int reqcap; +}; + + +/** Retrieves a new state object for use in other API calls. + * Example usage: + *{@code + * // Create state object + * libifc_handle_t *lifh = libifc_open(); + * + * // Do stuff with it + * + * // Dispose of the state object + * libifc_close(lifh); + * lifh = NULL; + *} + */ +libifc_handle_t *libifc_open(void); + +/** Frees resources held in the provided state object. + * @param h The state object to close. + * @see #libifc_open(void) + */ +void libifc_close(libifc_handle_t *h); + +/** Identifies what kind of error occured. */ +libifc_errtype libifc_err_errtype(libifc_handle_t *h); + +/** Retrieves the errno associated with the error, if any. */ +int libifc_err_errno(libifc_handle_t *h); + +/** If error type was IOCTL, this identifies which request failed. */ +unsigned long libifc_err_ioctlreq(libifc_handle_t *h); + +int libifc_get_description(libifc_handle_t *h, const char *name, + char **description); +int libifc_set_description(libifc_handle_t *h, const char *name, + const char *newdescription); +int libifc_unset_description(libifc_handle_t *h, const char *name); +int libifc_set_name(libifc_handle_t *h, const char *name, const char *newname); +int libifc_set_mtu(libifc_handle_t *h, const char *name, const int mtu); +int libifc_get_mtu(libifc_handle_t *h, const char *name, int *mtu); + +int libifc_set_metric(libifc_handle_t *h, const char *name, const int metric); +int libifc_get_metric(libifc_handle_t *h, const char *name, int *metric); + +int libifc_set_capability(libifc_handle_t *h, const char *name, + const int capability); +int libifc_get_capability(libifc_handle_t *h, const char *name, + struct libifc_capabilities *capability); + +/** Destroy a virtual interface + * @param name Interface to destroy + */ +int libifc_destroy_interface(libifc_handle_t *h, const char *name); + +/** Creates a (virtual) interface + * @param name Name of interface to create. Example: bridge or bridge42 + * @param name ifname Is set to actual name of created interface + */ +int libifc_create_interface(libifc_handle_t *h, const char *name, + char **ifname); Added: head/lib/libifc/libifc_internal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libifc/libifc_internal.c Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include + +#include +#include +#include +#include +#include + + +#include "libifc.h" // Needed for libifc_errstate +#include "libifc_internal.h" + +int +libifc_ioctlwrap_ret(libifc_handle_t *h, unsigned long request, int rcode) +{ + if (rcode != 0) { + h->error.errtype = IOCTL; + h->error.ioctl_request = request; + h->error.errcode = errno; + } + return (rcode); +} + + +int +libifc_ioctlwrap(libifc_handle_t *h, const int addressfamily, + unsigned long request, struct ifreq *ifr) +{ + int s; + + if (libifc_socket(h, addressfamily, &s) != 0) { + return (-1); + } + + int rcode = ioctl(s, request, ifr); + return (libifc_ioctlwrap_ret(h, request, rcode)); +} + + +/* + * Function to get socket for the specified address family. + * If the socket doesn't already exist, attempt to create it. + */ +int libifc_socket(libifc_handle_t *h, const int addressfamily, int *s) +{ + if (addressfamily > AF_MAX) { + h->error.errtype = SOCKET; + h->error.errcode = EINVAL; + return (-1); + } + + if (h->sockets[addressfamily] != -1) { + *s = h->sockets[addressfamily]; + return (0); + } + + /* We don't have a socket of that type available. Create one. */ + h->sockets[addressfamily] = socket(addressfamily, SOCK_DGRAM, 0); + if (h->sockets[addressfamily] == -1) { + h->error.errtype = SOCKET; + h->error.errcode = errno; + return (-1); + } + + *s = h->sockets[addressfamily]; + return (0); +} Added: head/lib/libifc/libifc_internal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libifc/libifc_internal.h Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#pragma once + +#include "libifc.h" + + +struct errstate { + /** + * Type of error. + */ + libifc_errtype errtype; + + /** + * The error occured in this ioctl() request. + * Populated if errtype = IOCTL + */ + unsigned long ioctl_request; + + /** + * The value of the global errno variable when the error occured. + */ + int errcode; +}; + +struct libifc_handle { + struct errstate error; + int sockets[AF_MAX + 1]; +}; + +/** + * Retrieves socket for address family from + * cache, or creates it if it doesn't already exist. + * @param addressfamily The address family of the socket to retrieve + * @param s The retrieved socket. + * @return 0 on success, -1 on failure. + * {@example + * This example shows how to retrieve a socket from the cache. + * {@code + * static void myfunc() \{ + * int s; + * if (libifc_socket(AF_LOCAL, &s) != 0) \{ + * // Handle error state here + * \} + * // user code here + * \} + * } + * } + */ +int libifc_socket(libifc_handle_t *h, const int addressfamily, int *s); + +/** Function used by other wrapper functions to populate _errstate when appropriate.*/ +int libifc_ioctlwrap_ret(libifc_handle_t *h, unsigned long request, int rcode); + +/** Function to wrap ioctl() and automatically populate libifc_errstate when appropriate.*/ +int libifc_ioctlwrap(libifc_handle_t *h, const int addressfamily, + unsigned long request, struct ifreq *ifr); Added: head/share/examples/libifc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libifc/Makefile Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +default: + $(CC) -Wall -fPIC -lifc -g -o example_setdescription setdescription.c + $(CC) -Wall -fPIC -lifc -g -o example_setmtu setmtu.c + $(CC) -Wall -fPIC -lifc -g -o example_ifdestroy ifdestroy.c + $(CC) -Wall -fPIC -lifc -g -o example_ifcreate ifcreate.c +clean: + rm -f example_* Added: head/share/examples/libifc/ifcreate.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libifc/ifcreate.c Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + if (argc != 2) { + errx(EINVAL, "Invalid number of arguments." + " Only one argument is accepted, and it should be the name" + " of the interface to be created."); + } + + char *ifname, *ifactualname; + + /* We have a static number of arguments. Therefore we can do it simple. */ + ifname = strdup(argv[1]); + + printf("Requested interface name: %s\n", ifname); + + libifc_handle_t *lifh = libifc_open(); + if (libifc_create_interface(lifh, ifname, &ifactualname) == 0) { + printf("Successfully created interface '%s'\n", ifactualname); + libifc_close(lifh); + lifh = NULL; + free(ifname); + free(ifactualname); + return (0); + } else { + switch (libifc_err_errtype(lifh)) { + case SOCKET: + warnx("couldn't create socket. This shouldn't happen.\n"); + break; + case IOCTL: + if (libifc_err_ioctlreq(lifh) == SIOCIFCREATE2) { + warnx( + "Failed to create interface (SIOCIFCREATE2)\n"); + } + break; + default: + warnx( + "This is a thorough example accommodating for temporary" + " 'not implemented yet' errors. That's likely what happened" + " now. If not, your guess is as good as mine. ;)" + " Error code: %d\n", libifc_err_errno( + lifh)); + break; + } + + libifc_close(lifh); + lifh = NULL; + free(ifname); + free(ifactualname); + return (-1); + } +} Added: head/share/examples/libifc/ifdestroy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libifc/ifdestroy.c Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + if (argc != 2) { + errx(EINVAL, "Invalid number of arguments." + " Only one argument is accepted, and it should be the name" + " of the interface to be destroyed."); + } + + char *ifname; + + /* We have a static number of arguments. Therefore we can do it simple. */ + ifname = strdup(argv[1]); + + printf("Interface name: %s\n", ifname); + + libifc_handle_t *lifh = libifc_open(); + if (libifc_destroy_interface(lifh, ifname) == 0) { + printf("Successfully destroyed interface '%s'.", ifname); + libifc_close(lifh); + lifh = NULL; + free(ifname); + return (0); + } else { + switch (libifc_err_errtype(lifh)) { + case SOCKET: + warnx("couldn't create socket. This shouldn't happen.\n"); + break; + case IOCTL: + if (libifc_err_ioctlreq(lifh) == SIOCIFDESTROY) { + warnx( + "Failed to destroy interface (SIOCIFDESTROY)\n"); + } + break; + default: + warnx( + "Should basically never end up here in this example.\n"); + break; + } + + libifc_close(lifh); + lifh = NULL; + free(ifname); + return (-1); + } +} Added: head/share/examples/libifc/setdescription.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/libifc/setdescription.c Thu Aug 25 19:40:25 2016 (r304815) @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2016, Marie Helene Kvello-Aune + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * thislist of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + + +int main(int argc, char *argv[]) +{ + if (argc != 3) { + errx(EINVAL, "Invalid number of arguments." + " First argument should be interface name, second argument" + " should be the description to set."); + } + + char *ifname, *ifdescr, *curdescr; + /* We have a static number of arguments. Therefore we can do it simple. */ + ifname = strdup(argv[1]); + ifdescr = strdup(argv[2]); + curdescr = NULL; + + printf("Interface name: %s\n", ifname); + + libifc_handle_t *lifh = libifc_open(); + if (libifc_get_description(lifh, ifname, &curdescr) == 0) { + printf("Old description: %s\n", curdescr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Aug 25 20:14:56 2016 Return-Path: Delivered-To: svn-src-head@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 BE2C5BC4098; Thu, 25 Aug 2016 20:14:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED1F13D0; Thu, 25 Aug 2016 20:14:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6C53FB923; Thu, 25 Aug 2016 16:14:55 -0400 (EDT) From: John Baldwin To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk Date: Thu, 25 Aug 2016 13:14:51 -0700 Message-ID: <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608251940.u7PJePv3023083@repo.freebsd.org> References: <201608251940.u7PJePv3023083@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 25 Aug 2016 16:14:55 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:14:56 -0000 On Thursday, August 25, 2016 07:40:25 PM Kristof Provost wrote: > Author: kp > Date: Thu Aug 25 19:40:25 2016 > New Revision: 304815 > URL: https://svnweb.freebsd.org/changeset/base/304815 > > Log: > Add libifc, a library implementing core functionality that exists in ifconfig(8) today. > > libifc (pronounced lib-ifconfig) aims to be a light abstraction layer between > programs and the kernel APIs for managing the network configuration. > This should hopefully make programs easier to maintain, and reduce code > duplication. > > Work will begin on making ifconfig(8) use this library in the near future. > > This code is still evolving. The interface should not be considered stable until > it is announced as such. I hate even writing this mail, and it looks like the topic wasn't really discussed in the review, but I think libifconfig is probably the "better" name if the goal is to move most of ifconfig into it. Certainly if a developer is looking for a library that provides a programmatic interface to the same operations a user does via ifconfig, libifconfig is the name they will look for first. One thing I did see in the review is that the APIs use 'ifc_*' and that was the reason given for renaming the library. If you really want those to be in sync, I actually think the longer 'ifconfig_*' prefix isn't that terrible. We have other libraries that use similar length names and namespace prefixes already (libarchive, libdevctl, libdevinfo, libpthread). Hmm, it seems you are 'libifc_*'. Most of our libraries do not include 'lib' in the namespace prefix (see above examples that all use the name of the library without 'lib' as the prefix). If nothing else I'd suggest dropping 'lib' to be consistent with most other libraries in the tree. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Aug 25 20:20:27 2016 Return-Path: Delivered-To: svn-src-head@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 C2251BC4313; Thu, 25 Aug 2016 20:20:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2691822; Thu, 25 Aug 2016 20:20:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [192.168.228.1] (ptr-2hj4tbph7h3f9zbx59wy7lior.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:c18a:e29e:ca57:c0db]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id A01B7AC3C; Thu, 25 Aug 2016 22:20:25 +0200 (CEST) From: "Kristof Provost" To: "John Baldwin" , "Marie Helene Kvello-Aune" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk Date: Thu, 25 Aug 2016 22:20:29 +0200 Message-ID: <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> In-Reply-To: <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> References: <201608251940.u7PJePv3023083@repo.freebsd.org> <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (2.0BETAr6052) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:20:27 -0000 On 25 Aug 2016, at 22:14, John Baldwin wrote: > On Thursday, August 25, 2016 07:40:25 PM Kristof Provost wrote: >> Author: kp >> Date: Thu Aug 25 19:40:25 2016 >> New Revision: 304815 >> URL: https://svnweb.freebsd.org/changeset/base/304815 >> >> Log: >> Add libifc, a library implementing core functionality that exists >> in ifconfig(8) today. >> >> libifc (pronounced lib-ifconfig) aims to be a light abstraction >> layer between >> programs and the kernel APIs for managing the network >> configuration. >> This should hopefully make programs easier to maintain, and reduce >> code >> duplication. >> >> Work will begin on making ifconfig(8) use this library in the near >> future. >> >> This code is still evolving. The interface should not be considered >> stable until >> it is announced as such. > > I hate even writing this mail, and it looks like the topic wasn't > really > discussed in the review, but I think libifconfig is probably the > "better" > name if the goal is to move most of ifconfig into it. Certainly if a > developer is looking for a library that provides a programmatic > interface > to the same operations a user does via ifconfig, libifconfig is the > name > they will look for first. > > One thing I did see in the review is that the APIs use 'ifc_*' and > that was > the reason given for renaming the library. If you really want those > to be > in sync, I actually think the longer 'ifconfig_*' prefix isn't that > terrible. > We have other libraries that use similar length names and namespace > prefixes > already (libarchive, libdevctl, libdevinfo, libpthread). > > Hmm, it seems you are 'libifc_*'. Most of our libraries do not > include > 'lib' in the namespace prefix (see above examples that all use the > name of > the library without 'lib' as the prefix). If nothing else I'd suggest > dropping 'lib' to be consistent with most other libraries in the tree. This is the right time to bring this sort of thing up. One of the reasons I pushed to get this in the tree in this very early state was to provoke exactly this sort of response. Right now the work is still in an early state and changing this sort of thing is still possible. The name was in fact discussed privately, and we figured libifconfig was a bit on the long side. I certainly take your point about libifc_. Does anyone else have any views regarding the naming (or other subjects)? Regards, Kristof From owner-svn-src-head@freebsd.org Thu Aug 25 20:27:25 2016 Return-Path: Delivered-To: svn-src-head@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 0A70EBC44C0; Thu, 25 Aug 2016 20:27:25 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DBA21C6D; Thu, 25 Aug 2016 20:27:24 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id i5so89449352wmg.0; Thu, 25 Aug 2016 13:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gL9pBBi+FZAwQotm9iQNnlEDnqx11aEs37DKeW8MWsE=; b=fJg16DWRC7TsQ7iFwKzC2HxsFjAaOG6EUZWwbqFnYY2sTlEO6tgymfpZGN2af9XnD1 sc8CBOMcsryqbZkT6bs7QX4Dp0uhnkaQi6noKdYMecE9OGDqkAwp/ETSV2hV+R3mez7E BC9i7tjAK6oFliUuC30OTuLiRrOK2Hs7u6Wvbj3SStxmMqegZtHsNXs46z1/ELowNH9w GRsRn1waLHbyd80MenJFS2SVlAR8G7UvSj4YKl8tTzIzKQFendd/+glyeS2VfT/OoCrT OCHEymHGqnENZvhbO0EgKTfMn8KbQg+L0dDYwQaK3yBjil5UbskWgS/Jl5ggLHCvWST7 /cNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=gL9pBBi+FZAwQotm9iQNnlEDnqx11aEs37DKeW8MWsE=; b=YmB7TMygVlTbNJFZBJ/pLihCjk6ogi5KJt//m2BWLT/0HvC+FlcTN+Gk3u6RLlwGfU OoNnjFKzfdxJxmPSUZkkB7ShTg9PTgTL7ETdIxLD7F7VRicewF+Jd8vyzqrPHluIVYIp UKLidtnwnO2TumYfsEcXrasSBcN3UVU0WSBrvgq+aHOnV6dbiOhvDutIsbKh/hnn0zBs prf9otQ0Esi2aURr8PmmHYV7Cehwz4DHsGLcLpBFc7Px1eYH6iCtoRvzJsG0IayEXxQJ znspRtiD9z5Sm3fgpsqZ7WDyAaPOI47Kut36Ij3mGPK+aqvFZIU0/UGP2VQHz3mcvWfL GKLA== X-Gm-Message-State: AEkoouvqfd9NFRpbcT9st05twHkdFeRXjHIvNLLKBPQsoJpgXWDhT7U3GTsfwmIKTNsv4aVZAukle4bZHzwZFw== X-Received: by 10.194.107.69 with SMTP id ha5mr8951772wjb.100.1472156842353; Thu, 25 Aug 2016 13:27:22 -0700 (PDT) MIME-Version: 1.0 Sender: oshogbo.vx@gmail.com Received: by 10.28.158.193 with HTTP; Thu, 25 Aug 2016 13:27:21 -0700 (PDT) In-Reply-To: <201608251940.u7PJePv3023083@repo.freebsd.org> References: <201608251940.u7PJePv3023083@repo.freebsd.org> From: Mariusz Zaborski Date: Thu, 25 Aug 2016 22:27:21 +0200 X-Google-Sender-Auth: SRoi5M3K-sibUvGbsPm_jXOe294 Message-ID: Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk To: Kristof Provost Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:27:25 -0000 Some inline comments :) Cheers, Mariusz [...] > +libifc_handle_t * > +libifc_open(void) > +{ > + struct libifc_handle *h; > + > + h = calloc(1, sizeof(struct libifc_handle)); This can fail, and we are using NULL references. > + > + for (int i = 0; i <= AF_MAX; i++) { > + h->sockets[i] = -1; > + } > + > + return (h); > +} > + > + > +void > +libifc_close(libifc_handle_t *h) > +{ Missing blank line. > + for (int i = 0; i <= AF_MAX; i++) { > + if (h->sockets[i] != -1) { > + (void)close(h->sockets[i]); > + } > + } > + free(h); > +} [...] > +int > +libifc_get_description(libifc_handle_t *h, const char *name, char **description) > +{ > + struct ifreq ifr; > + char *descr = NULL; > + size_t descrlen = 64; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + for (;;) { > + if ((descr = reallocf(descr, descrlen)) == NULL) { > + h->error.errtype = OTHER; > + h->error.errcode = ENOMEM; > + return (-1); > + } > + > + ifr.ifr_buffer.buffer = descr; > + ifr.ifr_buffer.length = descrlen; > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFDESCR, > + &ifr) != 0) { > + return (-1); > + } > + > + if (ifr.ifr_buffer.buffer == descr) { > + if (strlen(descr) > 0) { > + *description = strdup(descr); This can fail. > + free(descr); > + return (0); > + } > + } else if (ifr.ifr_buffer.length > descrlen) { > + descrlen = ifr.ifr_buffer.length; > + continue; > + } > + break; > + } > + free(descr); > + h->error.errtype = OTHER; > + h->error.errcode = 0; > + return (-1); > +} > + > + [..] All function bellow has wrong prototypes. > +int libifc_unset_description(libifc_handle_t *h, const char *name) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + ifr.ifr_buffer.length = 0; > + ifr.ifr_buffer.buffer = NULL; > + > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFDESCR, &ifr) < 0) { > + return (-1); > + } > + return (0); > +} > + > + > +int libifc_set_name(libifc_handle_t *h, const char *name, const char *newname) > +{ > + struct ifreq ifr; > + char *tmpname; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + tmpname = strdup(newname); > + if (tmpname == NULL) { > + h->error.errtype = OTHER; > + h->error.errcode = ENOMEM; > + return (-1); > + } > + > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + ifr.ifr_data = tmpname; > + > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFNAME, &ifr) != 0) { > + free(tmpname); > + return (-1); > + } > + free(tmpname); > + return (0); > +} > + > + > +int libifc_set_mtu(libifc_handle_t *h, const char *name, const int mtu) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + ifr.ifr_mtu = mtu; > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFMTU, &ifr) < 0) { > + return (-1); > + } > + return (0); > +} > + > + > +int libifc_get_mtu(libifc_handle_t *h, const char *name, int *mtu) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFMTU, &ifr) == -1) { > + return (-1); > + } > + *mtu = ifr.ifr_mtu; > + return (0); > +} > + > + > +int libifc_set_metric(libifc_handle_t *h, const char *name, const int mtu) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + ifr.ifr_mtu = mtu; > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFMETRIC, &ifr) < 0) { > + return (-1); > + } > + return (0); > +} > + > + > +int libifc_get_metric(libifc_handle_t *h, const char *name, int *metric) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFMETRIC, &ifr) == -1) { > + return (-1); > + } > + *metric = ifr.ifr_metric; > + return (0); > +} > + > + > +int libifc_set_capability(libifc_handle_t *h, const char *name, > + const int capability) > +{ > + struct ifreq ifr; > + struct libifc_capabilities ifcap; > + int flags; > + int value; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + if (libifc_get_capability(h, name, &ifcap) != 0) { > + return (-1); > + } > + > + value = capability; > + flags = ifcap.curcap; > + if (value < 0) { > + value = -value; > + flags &= ~value; > + } else { > + flags |= value; > + } > + flags &= ifcap.reqcap; > + > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + > + /* > + * TODO: Verify that it's safe to not have ifr.ifr_curcap > + * set for this request. > + */ > + ifr.ifr_reqcap = flags; > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCSIFCAP, &ifr) < 0) { > + return (-1); > + } > + return (0); > +} > + > + > +int libifc_get_capability(libifc_handle_t *h, const char *name, > + struct libifc_capabilities *capability) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCGIFCAP, &ifr) < 0) { > + return (-1); > + } > + capability->curcap = ifr.ifr_curcap; > + capability->reqcap = ifr.ifr_reqcap; > + return (0); > +} > + > + > +int libifc_destroy_interface(libifc_handle_t *h, const char *name) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCIFDESTROY, &ifr) < 0) { > + return (-1); > + } > + return (0); > +} > + > + > +int libifc_create_interface(libifc_handle_t *h, const char *name, char **ifname) > +{ > + struct ifreq ifr; > + > + memset(&ifr, 0, sizeof(struct ifreq)); > + (void)strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); > + > + /* > + * TODO: > + * Insert special snowflake handling here. See GitHub issue #12 for details. > + * In the meantime, hard-nosupport interfaces that need special handling. > + */ > + if ((strncmp(name, "wlan", strlen("wlan")) == 0) || > + (strncmp(name, "vlan", strlen("vlan")) == 0) || > + (strncmp(name, "vxlan", strlen("vxlan")) == 0)) { > + h->error.errtype = OTHER; > + h->error.errcode = ENOSYS; > + return (-1); > + } > + > + /* No special handling for this interface type. */ > + > + if (libifc_ioctlwrap(h, AF_LOCAL, SIOCIFCREATE2, &ifr) < 0) { > + return (-1); > + } > + *ifname = strdup(ifr.ifr_name); This can fail as well. > + return (0); > +} > > Added: head/lib/libifc/libifc.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libifc/libifc.h Thu Aug 25 19:40:25 2016 (r304815) > @@ -0,0 +1,111 @@ > +/* > + * Copyright (c) 2016, Marie Helene Kvello-Aune > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without modification, > + * are permitted provided that the following conditions are met: > + * > + * 1. Redistributions of source code must retain the above copyright notice, > + * thislist of conditions and the following disclaimer. > + * > + * 2. Redistributions in binary form must reproduce the above copyright notice, > + * this list of conditions and the following disclaimer in the documentation and/or > + * other materials provided with the distribution. > + * > + * 3. Neither the name of the copyright holder nor the names of its contributors > + * may be used to endorse or promote products derived from this software without > + * specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#pragma once > + > +typedef enum { > + OTHER, IOCTL, SOCKET > +} libifc_errtype; > + > +/* > + * Opaque definition so calling application can just pass a > + * pointer to it for library use. > + */ > +struct libifc_handle; > +typedef struct libifc_handle libifc_handle_t; > + > +struct libifc_capabilities { > + /** Current capabilities (ifconfig prints this as 'options')*/ > + int curcap; > + /** Requested capabilities (ifconfig prints this as 'capabilities')*/ > + int reqcap; > +}; > + > + > +/** Retrieves a new state object for use in other API calls. > + * Example usage: > + *{@code > + * // Create state object > + * libifc_handle_t *lifh = libifc_open(); > + * > + * // Do stuff with it > + * > + * // Dispose of the state object > + * libifc_close(lifh); > + * lifh = NULL; > + *} > + */ This should not be in the man? > > Added: head/lib/libifc/libifc_internal.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libifc/libifc_internal.c Thu Aug 25 19:40:25 2016 (r304815) > @@ -0,0 +1,100 @@ > +/* > + * Copyright (c) 2016, Marie Helene Kvello-Aune > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without modification, > + * are permitted provided that the following conditions are met: > + * > + * 1. Redistributions of source code must retain the above copyright notice, > + * thislist of conditions and the following disclaimer. > + * > + * 2. Redistributions in binary form must reproduce the above copyright notice, > + * this list of conditions and the following disclaimer in the documentation and/or > + * other materials provided with the distribution. > + * > + * 3. Neither the name of the copyright holder nor the names of its contributors > + * may be used to endorse or promote products derived from this software without > + * specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > + > +#include > + > +#include > +#include > +#include > +#include > +#include > + > + > +#include "libifc.h" // Needed for libifc_errstate > +#include "libifc_internal.h" > + > +int > +libifc_ioctlwrap_ret(libifc_handle_t *h, unsigned long request, int rcode) > +{ > + if (rcode != 0) { > + h->error.errtype = IOCTL; > + h->error.ioctl_request = request; > + h->error.errcode = errno; > + } > + return (rcode); > +} > + > + > +int > +libifc_ioctlwrap(libifc_handle_t *h, const int addressfamily, > + unsigned long request, struct ifreq *ifr) > +{ > + int s; > + > + if (libifc_socket(h, addressfamily, &s) != 0) { > + return (-1); > + } > + > + int rcode = ioctl(s, request, ifr); > + return (libifc_ioctlwrap_ret(h, request, rcode)); libifc_ioctlwrap_ret in my opinion should not have last argument. And we just should check if rcore is valid. style(9) says that initialization should be done on beginning of function. > +} > + > + > +/* > + * Function to get socket for the specified address family. > + * If the socket doesn't already exist, attempt to create it. > + */ > +int libifc_socket(libifc_handle_t *h, const int addressfamily, int *s) > +{ style. > + if (addressfamily > AF_MAX) { > + h->error.errtype = SOCKET; > + h->error.errcode = EINVAL; > + return (-1); > + } > + > + if (h->sockets[addressfamily] != -1) { > + *s = h->sockets[addressfamily]; > + return (0); > + } > + > + /* We don't have a socket of that type available. Create one. */ > + h->sockets[addressfamily] = socket(addressfamily, SOCK_DGRAM, 0); > + if (h->sockets[addressfamily] == -1) { > + h->error.errtype = SOCKET; > + h->error.errcode = errno; > + return (-1); > + } > + > + *s = h->sockets[addressfamily]; > + return (0); > +} > [...] ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/examples/libifc/ifcreate.c Thu Aug 25 19:40:25 2016 (r304815) > @@ -0,0 +1,93 @@ > +/* > + * Copyright (c) 2016, Marie Helene Kvello-Aune > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without modification, > + * are permitted provided that the following conditions are met: > + * > + * 1. Redistributions of source code must retain the above copyright notice, > + * thislist of conditions and the following disclaimer. > + * > + * 2. Redistributions in binary form must reproduce the above copyright notice, > + * this list of conditions and the following disclaimer in the documentation and/or > + * other materials provided with the distribution. > + * > + * 3. Neither the name of the copyright holder nor the names of its contributors > + * may be used to endorse or promote products derived from this software without > + * specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +int main(int argc, char *argv[]) style(9) > +{ style(9) > + if (argc != 2) { > + errx(EINVAL, "Invalid number of arguments." > + " Only one argument is accepted, and it should be the name" > + " of the interface to be created."); > + } > + > + char *ifname, *ifactualname; style(9) > + > + /* We have a static number of arguments. Therefore we can do it simple. */ > + ifname = strdup(argv[1]); This can fail. > + > + printf("Requested interface name: %s\n", ifname); > + > + libifc_handle_t *lifh = libifc_open(); This can fail right? > + if (libifc_create_interface(lifh, ifname, &ifactualname) == 0) { > + printf("Successfully created interface '%s'\n", ifactualname); > + libifc_close(lifh); > + lifh = NULL; > + free(ifname); > + free(ifactualname); > + return (0); > + } else { > + switch (libifc_err_errtype(lifh)) { > + case SOCKET: > + warnx("couldn't create socket. This shouldn't happen.\n"); > + break; > + case IOCTL: > + if (libifc_err_ioctlreq(lifh) == SIOCIFCREATE2) { > + warnx( > + "Failed to create interface (SIOCIFCREATE2)\n"); > + } > + break; > + default: > + warnx( > + "This is a thorough example accommodating for temporary" > + " 'not implemented yet' errors. That's likely what happened" > + " now. If not, your guess is as good as mine. ;)" > + " Error code: %d\n", libifc_err_errno( > + lifh)); > + break; > + } > + > + libifc_close(lifh); > + lifh = NULL; > + free(ifname); > + free(ifactualname); > + return (-1); > + } > +} > > Added: head/share/examples/libifc/ifdestroy.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/examples/libifc/ifdestroy.c Thu Aug 25 19:40:25 2016 (r304815) > @@ -0,0 +1,87 @@ > +/* > + * Copyright (c) 2016, Marie Helene Kvello-Aune > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without modification, > + * are permitted provided that the following conditions are met: > + * > + * 1. Redistributions of source code must retain the above copyright notice, > + * thislist of conditions and the following disclaimer. > + * > + * 2. Redistributions in binary form must reproduce the above copyright notice, > + * this list of conditions and the following disclaimer in the documentation and/or > + * other materials provided with the distribution. > + * > + * 3. Neither the name of the copyright holder nor the names of its contributors > + * may be used to endorse or promote products derived from this software without > + * specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +int main(int argc, char *argv[]) > +{ > + if (argc != 2) { > + errx(EINVAL, "Invalid number of arguments." > + " Only one argument is accepted, and it should be the name" > + " of the interface to be destroyed."); > + } > + > + char *ifname; style, mentioned before. > + > + /* We have a static number of arguments. Therefore we can do it simple. */ > + ifname = strdup(argv[1]); can fail. > + > + printf("Interface name: %s\n", ifname); > + > + libifc_handle_t *lifh = libifc_open(); > + if (libifc_destroy_interface(lifh, ifname) == 0) { > + printf("Successfully destroyed interface '%s'.", ifname); > + libifc_close(lifh); > + lifh = NULL; > + free(ifname); > + return (0); > + } else { > + switch (libifc_err_errtype(lifh)) { > + case SOCKET: > + warnx("couldn't create socket. This shouldn't happen.\n"); > + break; > + case IOCTL: > + if (libifc_err_ioctlreq(lifh) == SIOCIFDESTROY) { > + warnx( > + "Failed to destroy interface (SIOCIFDESTROY)\n"); > + } > + break; > + default: > + warnx( > + "Should basically never end up here in this example.\n"); > + break; > + } > + > + libifc_close(lifh); > + lifh = NULL; > + free(ifname); > + return (-1); > + } > +} > > Added: head/share/examples/libifc/setdescription.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/examples/libifc/setdescription.c Thu Aug 25 19:40:25 2016 (r304815) > @@ -0,0 +1,91 @@ > +/* > + * Copyright (c) 2016, Marie Helene Kvello-Aune > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without modification, > + * are permitted provided that the following conditions are met: > + * > + * 1. Redistributions of source code must retain the above copyright notice, > + * thislist of conditions and the following disclaimer. > + * > + * 2. Redistributions in binary form must reproduce the above copyright notice, > + * this list of conditions and the following disclaimer in the documentation and/or > + * other materials provided with the distribution. > + * > + * 3. Neither the name of the copyright holder nor the names of its contributors > + * may be used to endorse or promote products derived from this software without > + * specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER > + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > + > +int main(int argc, char *argv[]) > +{ > + if (argc != 3) { > + errx(EINVAL, "Invalid number of arguments." > + " First argument should be interface name, second argument" > + " should be the description to set."); > + } > + > + char *ifname, *ifdescr, *curdescr; style, mentioned before. > + /* We have a static number of arguments. Therefore we can do it simple. */ > + ifname = strdup(argv[1]); > + ifdescr = strdup(argv[2]); can fail. > + curdescr = NULL; > + > + printf("Interface name: %s\n", ifname); > + > + libifc_handle_t *lifh = libifc_open(); can fail. > + if (libifc_get_description(lifh, ifname, &curdescr) == 0) { > + printf("Old description: %s\n", curdescr); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Thu Aug 25 20:28:58 2016 Return-Path: Delivered-To: svn-src-head@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 C28CDBC45A9; Thu, 25 Aug 2016 20:28:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id AB8181E66; Thu, 25 Aug 2016 20:28:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 0501D56488; Thu, 25 Aug 2016 15:28:57 -0500 (CDT) Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk To: Kristof Provost , John Baldwin , Marie Helene Kvello-Aune References: <201608251940.u7PJePv3023083@repo.freebsd.org> <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: <1dc03c53-145c-ef13-61d3-2533951280a2@FreeBSD.org> Date: Thu, 25 Aug 2016 15:28:57 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:28:58 -0000 On 08/25/2016 15:20, Kristof Provost wrote: > On 25 Aug 2016, at 22:14, John Baldwin wrote: >> On Thursday, August 25, 2016 07:40:25 PM Kristof Provost wrote: >>> Author: kp >>> Date: Thu Aug 25 19:40:25 2016 >>> New Revision: 304815 >>> URL: https://svnweb.freebsd.org/changeset/base/304815 >>> >>> Log: >>> Add libifc, a library implementing core functionality that exists >>> in ifconfig(8) today. >>> >>> libifc (pronounced lib-ifconfig) aims to be a light abstraction >>> layer between >>> programs and the kernel APIs for managing the network configuration. >>> This should hopefully make programs easier to maintain, and reduce >>> code >>> duplication. >>> >>> Work will begin on making ifconfig(8) use this library in the near >>> future. >>> >>> This code is still evolving. The interface should not be considered >>> stable until >>> it is announced as such. >> >> I hate even writing this mail, and it looks like the topic wasn't really >> discussed in the review, but I think libifconfig is probably the "better" >> name if the goal is to move most of ifconfig into it. Certainly if a >> developer is looking for a library that provides a programmatic interface >> to the same operations a user does via ifconfig, libifconfig is the name >> they will look for first. >> >> One thing I did see in the review is that the APIs use 'ifc_*' and >> that was >> the reason given for renaming the library. If you really want those >> to be >> in sync, I actually think the longer 'ifconfig_*' prefix isn't that >> terrible. >> We have other libraries that use similar length names and namespace >> prefixes >> already (libarchive, libdevctl, libdevinfo, libpthread). >> >> Hmm, it seems you are 'libifc_*'. Most of our libraries do not include >> 'lib' in the namespace prefix (see above examples that all use the >> name of >> the library without 'lib' as the prefix). If nothing else I'd suggest >> dropping 'lib' to be consistent with most other libraries in the tree. > > This is the right time to bring this sort of thing up. One of the reasons > I pushed to get this in the tree in this very early state was to provoke > exactly this sort of response. Right now the work is still in an early > state > and changing this sort of thing is still possible. > > The name was in fact discussed privately, and we figured libifconfig was > a bit > on the long side. > > I certainly take your point about libifc_. Does anyone else have any > views regarding > the naming (or other subjects)? I'm on the same page as John about the naming: The library should be libifconfig, and the functions should begin with "ifconfig_". Thanks for this contribution, Marie. I've wanted it many times in the past. Eric From owner-svn-src-head@freebsd.org Thu Aug 25 20:30:15 2016 Return-Path: Delivered-To: svn-src-head@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 0F090BC4615; Thu, 25 Aug 2016 20:30:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 033ED1158; Thu, 25 Aug 2016 20:30:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 022E41D95; Thu, 25 Aug 2016 20:30:15 +0000 (UTC) Date: Thu, 25 Aug 2016 20:30:14 +0000 From: Alexey Dokuchaev To: Kristof Provost Cc: John Baldwin , Marie Helene Kvello-Aune , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk Message-ID: <20160825203014.GB5517@FreeBSD.org> References: <201608251940.u7PJePv3023083@repo.freebsd.org> <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:30:15 -0000 On Thu, Aug 25, 2016 at 10:20:29PM +0200, Kristof Provost wrote: > On 25 Aug 2016, at 22:14, John Baldwin wrote: > > I hate even writing this mail, and it looks like the topic wasn't > > really discussed in the review, but I think libifconfig is probably > > the "better" name if the goal is to move most of ifconfig into it. > > ... > > Hmm, it seems you are 'libifc_*'. Most of our libraries do not > > include 'lib' in the namespace prefix (see above examples that all > > use the name of the library without 'lib' as the prefix). If nothing > > else I'd suggest dropping 'lib' to be consistent with most other > > libraries in the tree. +1. > The name was in fact discussed privately, and we figured libifconfig > was a bit on the long side. Oh come one, we already have `libblocksruntime' and `libbluetooth' (and some others I probably don't remember now). `libifconfig' is just fine. Potential namespace clashes are a lot nastier than a longer name. > I certainly take your point about libifc_. Does anyone else have any > views regarding the naming (or other subjects)? I second John, dropping the `lib' prefix and going with `ifconfig_' looks like a good idea. ./danfe From owner-svn-src-head@freebsd.org Thu Aug 25 20:33:43 2016 Return-Path: Delivered-To: svn-src-head@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 5F9C2BC49AC; Thu, 25 Aug 2016 20:33:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31B701685; Thu, 25 Aug 2016 20:33:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f52.google.com with SMTP id e63so294872376ith.1; Thu, 25 Aug 2016 13:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=FbYH6BdXVrjFhWK5rFs7Pft3uxJnvz7i7CasjaJq1e8=; b=LMOoadhpWSHPMse69zD1qF2MGLevNFWO5j/nnxOGKDKGqkVwecDgfIHcTZA5fohNXw 5VePjQjrXp5Z3FgfXcbUmM6AjykOrUG7ml55a4kijBoiT2rk4HwkPfZBwTvJQA8fY0Jd E7VzbiKMBFml2N/UfLbikHCiUTfwqQW7X7wGcbnrYczC4zxeEOXuBO4Ttd7Xbj3Ntdke /27zMJX5WS93BVxKkGYnsm5CZ9FS3wyxKXk8IaQUrLL1o3GUCbfsp/NtmXqfJ4088ZVg aon70xm3BghnF3X/5f/NdniWxgL7O2Xj0uXBOFlcT5AJzipqB1W5mA5wPlpkeAXMLyQJ qNJQ== X-Gm-Message-State: AEkoous9nx1fqHCXSbRTCHZBr48yFVQy6BfB5m4DFhTU/8S7Bvl+z9yq3u4YPDqc4+qUQQ== X-Received: by 10.107.130.81 with SMTP id e78mr13881952iod.137.1472156773734; Thu, 25 Aug 2016 13:26:13 -0700 (PDT) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id y194sm6204497iod.17.2016.08.25.13.26.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 13:26:12 -0700 (PDT) Received: by mail-it0-f42.google.com with SMTP id x131so294050606ite.0; Thu, 25 Aug 2016 13:26:11 -0700 (PDT) X-Received: by 10.36.227.4 with SMTP id d4mr6962276ith.97.1472156771706; Thu, 25 Aug 2016 13:26:11 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Thu, 25 Aug 2016 13:26:11 -0700 (PDT) In-Reply-To: <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> References: <201608251940.u7PJePv3023083@repo.freebsd.org> <23395083.lPEyYQ7ZbW@ralph.baldwin.cx> <1A050E0F-4B9F-420A-97C6-C203B92A5F3F@FreeBSD.org> From: Conrad Meyer Date: Thu, 25 Aug 2016 13:26:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r304815 - in head: lib lib/libifc share/examples/libifc share/mk To: Kristof Provost Cc: John Baldwin , Marie Helene Kvello-Aune , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:33:43 -0000 On Thu, Aug 25, 2016 at 1:20 PM, Kristof Provost wrote: > On 25 Aug 2016, at 22:14, John Baldwin wrote: >> I hate even writing this mail, and it looks like the topic wasn't really >> discussed in the review, but I think libifconfig is probably the "better" >> name if the goal is to move most of ifconfig into it. Certainly if a >> developer is looking for a library that provides a programmatic interface >> to the same operations a user does via ifconfig, libifconfig is the name >> they will look for first. > > This is the right time to bring this sort of thing up. One of the reasons > I pushed to get this in the tree in this very early state was to provoke > exactly this sort of response. Right now the work is still in an early state > and changing this sort of thing is still possible. > > The name was in fact discussed privately, and we figured libifconfig was a > bit > on the long side. > > I certainly take your point about libifc_. Does anyone else have any views > regarding > the naming (or other subjects)? Hi, I don't have anything to add, other than a "me too." I'd second John's suggestions. 'libifconfig' for the library name is more reasonable than libifc. And just 'ifc_' (or even 'ifconfig_') prefixes for public library routines is sufficient. Thanks, Conrad From owner-svn-src-head@freebsd.org Thu Aug 25 20:56:01 2016 Return-Path: Delivered-To: svn-src-head@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 2DD45BC4EE9 for ; Thu, 25 Aug 2016 20:56:01 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8F351388 for ; Thu, 25 Aug 2016 20:56:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22f.google.com with SMTP id u134so37189347ywg.3 for ; Thu, 25 Aug 2016 13:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O0fFtNY6QEYwjWhb3PDG7g03dS/XwyPjcn2I7VuSeaU=; b=AgMlZzv+0WddN0BSNYhyym6EIVoZNO9UpOg2DYULHKLQboOQCODGchvWDcV8JRTomV DftLZI+cmZwrX2OQ3BYIHmInWd67lMDPHThiAz4fheqEK6+0lG62/WIFCR9D96jlYl5y khZlP0xVgyLQEO/iTWYKFzmrNm+8L7ruaOv6nZAaVj5r9BlZP3dZQNHzQv8SBOI8rLXC wLjK+TBq3XJ38Ec5wAhwYACbn6cGEUXTMOK16jRV2fiub6vib68mEbbp2AqdRqDH474s UzeMIpiEPrQ1yRi06SQBI1XBM5kqxbK9us8C07a8b2IZnhFo/E+tMcLIID+CTIpTKNa9 IbXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O0fFtNY6QEYwjWhb3PDG7g03dS/XwyPjcn2I7VuSeaU=; b=bUuKW7ytzErDcFp0RFF4anRC3Srq6Rzgf6vwoV3wYTOdMcLA5IH2pJsM1c6kUvbA3t I15P5dNsVArMMHzaoebuAd6v77tZJ+l5pAaHUZvWjcp7j6zmqjFt1lT6wzU9LbNrkvKF SYopGuJ5+R4x3uGc5TDqkYWAWd3OMY02w1P+PlQsJWXcaU1HsmEnD3cLC6llZDoYdM69 LK5nfBMRCMgy08ANa7rx4o4oEjwmuJYQH6yP641DEDf379Whzs+b8pzYeJsQsMai7ekL D0OgDugb4wp/FANhonAeFtU0HtyHrvbRdsyVzBWddjOFF1wHWKwKlGuwIBkPchfZEwYF TS/Q== X-Gm-Message-State: AE9vXwM649bRvqiJE1Xxr05TRL3c5ZhNoa9p7AC60uJQZUm+pyzKbn4pO5qua/PCJkb12Pp8klvJReuR3bB1cw== X-Received: by 10.129.98.2 with SMTP id w2mr8975247ywb.313.1472158559918; Thu, 25 Aug 2016 13:55:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 25 Aug 2016 13:55:59 -0700 (PDT) In-Reply-To: <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> From: Ed Schouten Date: Thu, 25 Aug 2016 22:55:59 +0200 Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 20:56:01 -0000 Hi Bryan, 2016-08-25 19:43 GMT+02:00 Bryan Drewery : >>> readelf -a /lib/libc.so.7|grep basename >> 2149: 0000000000076200 231 FUNC GLOBAL DEFAULT 11 >> basename@@FBSD_1.0 (2) >> 2514: 0000000000076140 184 FUNC GLOBAL DEFAULT 11 >> basename_r@@FBSD_1.2 (4) I think the reason for this is that I haven't made any changes to the underlying basename() function (yet); only to dirname(). So there is no basename@FBSD_1.0. Only basename@@FBSD_1.0 (to indicate it's the latest version against we should link). What happens if you s/__sym_compat/__sym_default the basename() line? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Thu Aug 25 21:14:27 2016 Return-Path: Delivered-To: svn-src-head@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 988F9BC6523; Thu, 25 Aug 2016 21:14:27 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4C42513E6; Thu, 25 Aug 2016 21:14:27 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PLEQ1g060481; Thu, 25 Aug 2016 21:14:26 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PLEQSH060479; Thu, 25 Aug 2016 21:14:26 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608252114.u7PLEQSH060479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 25 Aug 2016 21:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304819 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 21:14:27 -0000 Author: ache Date: Thu Aug 25 21:14:26 2016 New Revision: 304819 URL: https://svnweb.freebsd.org/changeset/base/304819 Log: Original fgetln() from 44lite return sucess for line tail errors, i.e. partial line, but set __SERR and errno in the same time, which is inconsistent. Now both OpenBSD and NetBSD return failure, i.e. no line and set error indicators for such case, so make our fgetln() and fgetwln() (as its wide version) compatible with the rest of *BSD. PR: 212033 MFC after: 7 days Modified: head/lib/libc/stdio/fgetln.c head/lib/libc/stdio/fgetwln.c Modified: head/lib/libc/stdio/fgetln.c ============================================================================== --- head/lib/libc/stdio/fgetln.c Thu Aug 25 21:13:16 2016 (r304818) +++ head/lib/libc/stdio/fgetln.c Thu Aug 25 21:14:26 2016 (r304819) @@ -139,8 +139,11 @@ fgetln(FILE *fp, size_t *lenp) (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, len - off); off = len; - if (__srefill(fp)) - break; /* EOF or error: return partial line */ + if (__srefill(fp)) { + if (__sfeof(fp)) + break; + goto error; + } if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) == NULL) continue; Modified: head/lib/libc/stdio/fgetwln.c ============================================================================== --- head/lib/libc/stdio/fgetwln.c Thu Aug 25 21:13:16 2016 (r304818) +++ head/lib/libc/stdio/fgetwln.c Thu Aug 25 21:14:26 2016 (r304819) @@ -53,7 +53,6 @@ fgetwln_l(FILE * __restrict fp, size_t * ORIENT(fp, 1); len = 0; - /* WEOF or error: return partial line, see fgetln(3). */ while ((wc = __fgetwc(fp, locale)) != WEOF) { #define GROW 512 if (len * sizeof(wchar_t) >= fp->_lb._size && @@ -65,7 +64,7 @@ fgetwln_l(FILE * __restrict fp, size_t * if (wc == L'\n') break; } - if (len == 0) + if (len == 0 || (wc == WEOF && !__sfeof(fp))) goto error; FUNLOCKFILE(fp); From owner-svn-src-head@freebsd.org Thu Aug 25 21:33:40 2016 Return-Path: Delivered-To: svn-src-head@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 33BFCBC686E; Thu, 25 Aug 2016 21:33:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0098C1DFF; Thu, 25 Aug 2016 21:33:39 +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 u7PLXdcQ067905; Thu, 25 Aug 2016 21:33:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PLXd5v067904; Thu, 25 Aug 2016 21:33:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608252133.u7PLXd5v067904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 25 Aug 2016 21:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304821 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 21:33:40 -0000 Author: emaste Date: Thu Aug 25 21:33:39 2016 New Revision: 304821 URL: https://svnweb.freebsd.org/changeset/base/304821 Log: bspatch: remove output file in the case of error Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7644 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Aug 25 21:29:16 2016 (r304820) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Aug 25 21:33:39 2016 (r304821) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,6 +52,18 @@ __FBSDID("$FreeBSD$"); #define O_BINARY 0 #endif +static char *newfile; +static int dirfd = -1; + +static void +exit_cleanup(void) +{ + + if (dirfd != -1 && newfile != NULL) + if (unlinkat(dirfd, newfile, 0)) + warn("unlinkat"); +} + static off_t offtin(u_char *buf) { off_t y; @@ -82,6 +95,7 @@ int main(int argc, char *argv[]) { FILE *f, *cpf, *dpf, *epf; BZFILE *cpfbz2, *dpfbz2, *epfbz2; + char *directory, *namebuf; int cbz2err, dbz2err, ebz2err; int newfd, oldfd; ssize_t oldsize, newsize; @@ -93,7 +107,7 @@ int main(int argc, char *argv[]) off_t lenread; off_t i; #ifdef HAVE_CAPSICUM - cap_rights_t rights_ro, rights_wr; + cap_rights_t rights_dir, rights_ro, rights_wr; #endif if (argc != 4) @@ -114,10 +128,19 @@ int main(int argc, char *argv[]) /* open oldfile */ if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0) err(1, "open(%s)", argv[1]); + /* open directory where we'll write newfile */ + if ((namebuf = strdup(argv[2])) == NULL || + (directory = dirname(namebuf)) == NULL || + (dirfd = open(directory, O_DIRECTORY)) < 0) + err(1, "open %s", argv[2]); + free(namebuf); + if ((newfile = basename(argv[2])) == NULL) + err(1, "basename"); /* open newfile */ - if ((newfd = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, - 0666)) < 0) + if ((newfd = openat(dirfd, newfile, + O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0) err(1, "open(%s)", argv[2]); + atexit(exit_cleanup); #ifdef HAVE_CAPSICUM if (cap_enter() < 0) { @@ -128,13 +151,15 @@ int main(int argc, char *argv[]) /* Capsicum Available */ cap_rights_init(&rights_ro, CAP_READ, CAP_FSTAT, CAP_SEEK); cap_rights_init(&rights_wr, CAP_WRITE); - + cap_rights_init(&rights_dir, CAP_UNLINKAT); + if (cap_rights_limit(fileno(f), &rights_ro) < 0 || cap_rights_limit(fileno(cpf), &rights_ro) < 0 || cap_rights_limit(fileno(dpf), &rights_ro) < 0 || cap_rights_limit(fileno(epf), &rights_ro) < 0 || cap_rights_limit(oldfd, &rights_ro) < 0 || - cap_rights_limit(newfd, &rights_wr) < 0) + cap_rights_limit(newfd, &rights_wr) < 0 || + cap_rights_limit(dirfd, &rights_dir) < 0) err(1, "cap_rights_limit() failed, could not restrict" " capabilities"); } @@ -260,6 +285,8 @@ int main(int argc, char *argv[]) /* Write the new file */ if (write(newfd, new, newsize) != newsize || close(newfd) == -1) err(1, "%s", argv[2]); + /* Disable atexit cleanup */ + newfile = NULL; free(new); free(old); From owner-svn-src-head@freebsd.org Thu Aug 25 21:55:18 2016 Return-Path: Delivered-To: svn-src-head@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 C14BCBC6D6C; Thu, 25 Aug 2016 21:55:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F10017DE; Thu, 25 Aug 2016 21:55:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PLtHd4075252; Thu, 25 Aug 2016 21:55:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PLtHQN075249; Thu, 25 Aug 2016 21:55:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608252155.u7PLtHQN075249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Aug 2016 21:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304822 - head/sys/dev/cxgbe/cxgbei X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 21:55:18 -0000 Author: np Date: Thu Aug 25 21:55:17 2016 New Revision: 304822 URL: https://svnweb.freebsd.org/changeset/base/304822 Log: cxgbe/cxgbei: Read the chip's configuration to determine the actual hardware send and receive PDU limits. Report these limits to ICL and take them into account when setting the socket's send and receive buffer sizes. The driver used a single hardcoded limit everywhere prior to this change. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/cxgbei/cxgbei.h head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Aug 25 21:33:39 2016 (r304821) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Aug 25 21:55:17 2016 (r304822) @@ -472,17 +472,47 @@ t4_sk_ddp_tag_release(struct icl_cxgbei_ return (0); } +static void +read_pdu_limits(struct adapter *sc, uint32_t *max_tx_pdu_len, + uint32_t *max_rx_pdu_len) +{ + uint32_t tx_len, rx_len, r, v; + + rx_len = t4_read_reg(sc, A_TP_PMM_RX_PAGE_SIZE); + tx_len = t4_read_reg(sc, A_TP_PMM_TX_PAGE_SIZE); + + r = t4_read_reg(sc, A_TP_PARA_REG2); + rx_len = min(rx_len, G_MAXRXDATA(r)); + tx_len = min(tx_len, G_MAXRXDATA(r)); + + r = t4_read_reg(sc, A_TP_PARA_REG7); + v = min(G_PMMAXXFERLEN0(r), G_PMMAXXFERLEN1(r)); + rx_len = min(rx_len, v); + tx_len = min(tx_len, v); + + /* Remove after FW_FLOWC_MNEM_TXDATAPLEN_MAX fix in firmware. */ + tx_len = min(tx_len, 3 * 4096); + + *max_tx_pdu_len = rounddown2(tx_len, 512); + *max_rx_pdu_len = rounddown2(rx_len, 512); +} + +/* + * Initialize the software state of the iSCSI ULP driver. + * + * ENXIO means firmware didn't set up something that it was supposed to. + */ static int -cxgbei_ddp_init(struct adapter *sc, struct cxgbei_data *ci) +cxgbei_init(struct adapter *sc, struct cxgbei_data *ci) { - int nppods, bits, max_sz, rc; + int nppods, bits, rc; static const u_int pgsz_order[] = {0, 1, 2, 3}; MPASS(sc->vres.iscsi.size > 0); ci->llimit = sc->vres.iscsi.start; ci->ulimit = sc->vres.iscsi.start + sc->vres.iscsi.size - 1; - max_sz = G_MAXRXDATA(t4_read_reg(sc, A_TP_PARA_REG2)); + read_pdu_limits(sc, &ci->max_tx_pdu_len, &ci->max_rx_pdu_len); nppods = sc->vres.iscsi.size >> IPPOD_SIZE_SHIFT; if (nppods <= 1024) @@ -513,7 +543,6 @@ cxgbei_ddp_init(struct adapter *sc, stru } mtx_init(&ci->map_lock, "ddp lock", NULL, MTX_DEF | MTX_DUPOK); - ci->max_txsz = ci->max_rxsz = min(max_sz, ULP2_MAX_PKT_SIZE); ci->nppods = nppods; ci->idx_last = nppods; ci->idx_bits = bits; @@ -811,7 +840,7 @@ cxgbei_activate(struct adapter *sc) if (ci == NULL) return (ENOMEM); - rc = cxgbei_ddp_init(sc, ci); + rc = cxgbei_init(sc, ci); if (rc != 0) { free(ci, M_CXGBE); return (rc); Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.h ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Aug 25 21:33:39 2016 (r304821) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Aug 25 21:55:17 2016 (r304822) @@ -135,8 +135,6 @@ struct cxgbei_ulp2_tag_format { }; struct cxgbei_data { - u_int max_txsz; - u_int max_rxsz; u_int llimit; u_int ulimit; u_int nppods; @@ -144,6 +142,8 @@ struct cxgbei_data { u_char idx_bits; uint32_t idx_mask; uint32_t rsvd_tag_mask; + u_int max_tx_pdu_len; + u_int max_rx_pdu_len; struct mtx map_lock; bus_dma_tag_t ulp_ddp_tag; Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 21:33:39 2016 (r304821) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 21:55:17 2016 (r304822) @@ -137,16 +137,6 @@ static kobj_method_t icl_cxgbei_methods[ DEFINE_CLASS(icl_cxgbei, icl_cxgbei_methods, sizeof(struct icl_cxgbei_conn)); -#if 0 -/* - * Subtract another 256 for AHS from MAX_DSL if AHS could be used. - */ -#define CXGBEI_MAX_PDU 16224 -#define CXGBEI_MAX_DSL (CXGBEI_MAX_PDU - sizeof(struct iscsi_bhs) - 8) -#endif -#define CXGBEI_MAX_DSL 8192 -#define CXGBEI_MAX_PDU (CXGBEI_MAX_DSL + sizeof(struct iscsi_bhs) + 8) - void icl_cxgbei_conn_pdu_free(struct icl_conn *ic, struct icl_pdu *ip) { @@ -339,7 +329,7 @@ icl_cxgbei_conn_pdu_append_data(struct i if (__predict_true(m_append(m, len, addr) != 0)) { ip->ip_data_len += len; - MPASS(ip->ip_data_len <= CXGBEI_MAX_DSL); + MPASS(ip->ip_data_len <= ic->ic_max_data_segment_length); return (0); } else { if (flags & M_WAITOK) { @@ -386,7 +376,6 @@ icl_cxgbei_conn_pdu_queue(struct icl_con m = finalize_pdu(icc, icp); M_ASSERTPKTHDR(m); MPASS((m->m_pkthdr.len & 3) == 0); - MPASS(m->m_pkthdr.len + 8 <= CXGBEI_MAX_PDU); /* * Do not get inp from toep->inp as the toepcb might have detached @@ -427,7 +416,8 @@ icl_cxgbei_new_conn(const char *name, st #ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); #endif - ic->ic_max_data_segment_length = CXGBEI_MAX_DSL; + /* This is a stop-gap value that will be corrected during handoff. */ + ic->ic_max_data_segment_length = 16384; ic->ic_name = name; ic->ic_offload = "cxgbei"; ic->ic_unmapped = false; @@ -454,29 +444,16 @@ icl_cxgbei_conn_free(struct icl_conn *ic } static int -icl_cxgbei_setsockopt(struct icl_conn *ic, struct socket *so) +icl_cxgbei_setsockopt(struct icl_conn *ic, struct socket *so, int sspace, + int rspace) { - size_t minspace; struct sockopt opt; - int error, one = 1; + int error, one = 1, ss, rs; - /* - * For sendspace, this is required because the current code cannot - * send a PDU in pieces; thus, the minimum buffer size is equal - * to the maximum PDU size. "+4" is to account for possible padding. - * - * What we should actually do here is to use autoscaling, but set - * some minimal buffer size to "minspace". I don't know a way to do - * that, though. - */ - minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + - ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; - if (sendspace < minspace) - sendspace = minspace; - if (recvspace < minspace) - recvspace = minspace; + ss = max(sendspace, sspace); + rs = max(recvspace, rspace); - error = soreserve(so, sendspace, recvspace); + error = soreserve(so, ss, rs); if (error != 0) { icl_cxgbei_conn_close(ic); return (error); @@ -611,6 +588,7 @@ int icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) { struct icl_cxgbei_conn *icc = ic_to_icc(ic); + struct cxgbei_data *ci; struct find_ofld_adapter_rr fa; struct file *fp; struct socket *so; @@ -661,10 +639,7 @@ icl_cxgbei_conn_handoff(struct icl_conn if (fa.sc == NULL) return (EINVAL); icc->sc = fa.sc; - - error = icl_cxgbei_setsockopt(ic, so); - if (error) - return (error); + ci = icc->sc->iscsi_ulp_softc; inp = sotoinpcb(so); INP_WLOCK(inp); @@ -682,22 +657,43 @@ icl_cxgbei_conn_handoff(struct icl_conn MPASS(toep->vi->pi->adapter == icc->sc); icc->toep = toep; icc->cwt = cxgbei_select_worker_thread(icc); + + /* + * We maintain the _send_ DSL in this field just to have a + * convenient way to assert that the kernel never sends + * oversized PDUs. This field is otherwise unused in the driver + * or the kernel. + */ + ic->ic_max_data_segment_length = ci->max_tx_pdu_len - + ISCSI_BHS_SIZE; + icc->ulp_submode = 0; - if (ic->ic_header_crc32c) + if (ic->ic_header_crc32c) { icc->ulp_submode |= ULP_CRC_HEADER; - if (ic->ic_data_crc32c) + ic->ic_max_data_segment_length -= + ISCSI_HEADER_DIGEST_SIZE; + } + if (ic->ic_data_crc32c) { icc->ulp_submode |= ULP_CRC_DATA; + ic->ic_max_data_segment_length -= + ISCSI_DATA_DIGEST_SIZE; + } so->so_options |= SO_NO_DDP; toep->ulp_mode = ULP_MODE_ISCSI; toep->ulpcb = icc; - send_iscsi_flowc_wr(icc->sc, toep, CXGBEI_MAX_PDU); + send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); set_ulp_mode_iscsi(icc->sc, toep, ic->ic_header_crc32c, ic->ic_data_crc32c); error = 0; } INP_WUNLOCK(inp); + if (error == 0) { + error = icl_cxgbei_setsockopt(ic, so, ci->max_tx_pdu_len, + ci->max_rx_pdu_len); + } + return (error); } @@ -831,14 +827,52 @@ icl_cxgbei_conn_transfer_done(struct icl uma_zfree(icl_transfer_zone, prv); } +static void +cxgbei_limits(struct adapter *sc, void *arg) +{ + struct icl_drv_limits *idl = arg; + struct cxgbei_data *ci; + int max_dsl; + + if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4lims") != 0) + return; + + if (uld_active(sc, ULD_ISCSI)) { + ci = sc->iscsi_ulp_softc; + MPASS(ci != NULL); + + /* + * AHS is not supported by the kernel so we'll not account for + * it either in our PDU len -> data segment len conversions. + */ + + max_dsl = ci->max_rx_pdu_len - ISCSI_BHS_SIZE - + ISCSI_HEADER_DIGEST_SIZE - ISCSI_DATA_DIGEST_SIZE; + if (idl->idl_max_recv_data_segment_length > max_dsl) + idl->idl_max_recv_data_segment_length = max_dsl; + + max_dsl = ci->max_tx_pdu_len - ISCSI_BHS_SIZE - + ISCSI_HEADER_DIGEST_SIZE - ISCSI_DATA_DIGEST_SIZE; + if (idl->idl_max_send_data_segment_length > max_dsl) + idl->idl_max_send_data_segment_length = max_dsl; + } + + end_synchronized_op(sc, LOCK_HELD); +} + static int icl_cxgbei_limits(struct icl_drv_limits *idl) { - idl->idl_max_recv_data_segment_length = CXGBEI_MAX_DSL; - idl->idl_max_send_data_segment_length = CXGBEI_MAX_DSL; + /* Maximum allowed by the RFC. cxgbei_limits will clip them. */ + idl->idl_max_recv_data_segment_length = (1 << 24) - 1; + idl->idl_max_send_data_segment_length = (1 << 24) - 1; + + /* These are somewhat arbitrary. */ idl->idl_max_burst_length = 2 * 1024 * 1024; - idl->idl_first_burst_length = CXGBEI_MAX_DSL; + idl->idl_first_burst_length = 8192; + + t4_iterate(cxgbei_limits, idl); return (0); } From owner-svn-src-head@freebsd.org Thu Aug 25 22:32:11 2016 Return-Path: Delivered-To: svn-src-head@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 932D1BC549B; Thu, 25 Aug 2016 22:32:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5C37D1892; Thu, 25 Aug 2016 22:32:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PMWAmm089829; Thu, 25 Aug 2016 22:32:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PMWAi3089828; Thu, 25 Aug 2016 22:32:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608252232.u7PMWAi3089828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 25 Aug 2016 22:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304823 - head/libexec/rtld-elf/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 22:32:11 -0000 Author: adrian Date: Thu Aug 25 22:32:10 2016 New Revision: 304823 URL: https://svnweb.freebsd.org/changeset/base/304823 Log: [mips] flip from =v to =r - let the compiler choose a temp register. =v is some ye olde gcc "use this specific register as the temp register" thing that they've deprecated and clang/llvm doesn't implement. Poked again and again by: sbruno Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Thu Aug 25 21:55:17 2016 (r304822) +++ head/libexec/rtld-elf/mips/reloc.c Thu Aug 25 22:32:10 2016 (r304823) @@ -645,7 +645,7 @@ _mips_get_tls(void) ".set\tmips64r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' * @@ -670,7 +670,7 @@ _mips_get_tls(void) ".set\tmips32r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' * From owner-svn-src-head@freebsd.org Thu Aug 25 23:06:13 2016 Return-Path: Delivered-To: svn-src-head@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 92059BC5A49; Thu, 25 Aug 2016 23:06:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52DAB16B3; Thu, 25 Aug 2016 23:06:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PN6C2r001041; Thu, 25 Aug 2016 23:06:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PN6CHE001038; Thu, 25 Aug 2016 23:06:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608252306.u7PN6CHE001038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Aug 2016 23:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304824 - head/sys/dev/cxgbe/cxgbei X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 23:06:13 -0000 Author: np Date: Thu Aug 25 23:06:12 2016 New Revision: 304824 URL: https://svnweb.freebsd.org/changeset/base/304824 Log: cxgbe/cxgbei: Convert the driver-private PDU flags to enums and replace pdu_ prefix with icp_ in struct icl_cxgbei_pdu. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/cxgbei/cxgbei.h head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Aug 25 22:32:10 2016 (r304823) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Aug 25 23:06:12 2016 (r304824) @@ -577,8 +577,8 @@ do_rx_iscsi_hdr(struct sge_iq *iq, const icp = ip_to_icp(ip); bcopy(mtod(m, caddr_t) + sizeof(*cpl), icp->ip.ip_bhs, sizeof(struct iscsi_bhs)); - icp->pdu_seq = ntohl(cpl->seq); - icp->pdu_flags = SBUF_ULP_FLAG_HDR_RCVD; + icp->icp_seq = ntohl(cpl->seq); + icp->icp_flags = ICPF_RX_HDR; /* This is the start of a new PDU. There should be no old state. */ MPASS(toep->ulpcb2 == NULL); @@ -606,13 +606,13 @@ do_rx_iscsi_data(struct sge_iq *iq, cons /* Must already have received the header (but not the data). */ MPASS(icp != NULL); - MPASS(icp->pdu_flags == SBUF_ULP_FLAG_HDR_RCVD); + MPASS(icp->icp_flags == ICPF_RX_HDR); MPASS(icp->ip.ip_data_mbuf == NULL); MPASS(icp->ip.ip_data_len == 0); m_adj(m, sizeof(*cpl)); - icp->pdu_flags |= SBUF_ULP_FLAG_DATA_RCVD; + icp->icp_flags |= ICPF_RX_FLBUF; icp->ip.ip_data_mbuf = m; icp->ip.ip_data_len = m->m_pkthdr.len; @@ -645,19 +645,19 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const /* Must already be assembling a PDU. */ MPASS(icp != NULL); - MPASS(icp->pdu_flags & SBUF_ULP_FLAG_HDR_RCVD); /* Data is optional. */ + MPASS(icp->icp_flags & ICPF_RX_HDR); /* Data is optional. */ ip = &icp->ip; - icp->pdu_flags |= SBUF_ULP_FLAG_STATUS_RCVD; + icp->icp_flags |= ICPF_RX_STATUS; val = ntohl(cpl->ddpvld); if (val & F_DDP_PADDING_ERR) - icp->pdu_flags |= SBUF_ULP_FLAG_PAD_ERROR; + icp->icp_flags |= ICPF_PAD_ERR; if (val & F_DDP_HDRCRC_ERR) - icp->pdu_flags |= SBUF_ULP_FLAG_HCRC_ERROR; + icp->icp_flags |= ICPF_HCRC_ERR; if (val & F_DDP_DATACRC_ERR) - icp->pdu_flags |= SBUF_ULP_FLAG_DCRC_ERROR; + icp->icp_flags |= ICPF_DCRC_ERR; if (ip->ip_data_mbuf == NULL) { /* XXXNP: what should ip->ip_data_len be, and why? */ - icp->pdu_flags |= SBUF_ULP_FLAG_DATA_DDPED; + icp->icp_flags |= ICPF_RX_DDP; } pdu_len = ntohs(cpl->len); /* includes everything. */ @@ -674,7 +674,7 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const } tp = intotcpcb(inp); - MPASS(icp->pdu_seq == tp->rcv_nxt); + MPASS(icp->icp_seq == tp->rcv_nxt); MPASS(tp->rcv_wnd >= pdu_len); tp->rcv_nxt += pdu_len; tp->rcv_wnd -= pdu_len; @@ -737,9 +737,8 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const if (ip0 == NULL) CXGBE_UNIMPLEMENTED("PDU allocation failure"); icp0 = ip_to_icp(ip0); - icp0->pdu_seq = 0; /* XXX */ - icp0->pdu_flags = SBUF_ULP_FLAG_HDR_RCVD | - SBUF_ULP_FLAG_STATUS_RCVD; + icp0->icp_seq = 0; /* XXX */ + icp0->icp_flags = ICPF_RX_HDR | ICPF_RX_STATUS; m_copydata(m, 0, sizeof(struct iscsi_bhs), (void *)ip0->ip_bhs); STAILQ_INSERT_TAIL(&icc->rcvd_pdus, ip0, ip_next); } @@ -748,7 +747,7 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const #if 0 CTR4(KTR_CXGBE, "%s: tid %u, pdu_len %u, pdu_flags 0x%x", - __func__, tid, pdu_len, icp->pdu_flags); + __func__, tid, pdu_len, icp->icp_flags); #endif STAILQ_INSERT_TAIL(&icc->rcvd_pdus, ip, ip_next); Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.h ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Aug 25 22:32:10 2016 (r304823) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Aug 25 23:06:12 2016 (r304824) @@ -76,15 +76,26 @@ ic_to_icc(struct icl_conn *ic) return (__containerof(ic, struct icl_cxgbei_conn, ic)); } -#define CXGBEI_PDU_SIGNATURE 0x12344321 +/* PDU flags and signature. */ +enum { + ICPF_RX_HDR = 1 << 0, /* PDU header received. */ + ICPF_RX_FLBUF = 1 << 1, /* PDU payload received in a freelist. */ + ICPF_RX_DDP = 1 << 2, /* PDU payload DDP'd. */ + ICPF_RX_STATUS = 1 << 3, /* Rx status received. */ + ICPF_HCRC_ERR = 1 << 4, /* Header digest error. */ + ICPF_DCRC_ERR = 1 << 5, /* Data digest error. */ + ICPF_PAD_ERR = 1 << 6, /* Padding error. */ + + CXGBEI_PDU_SIGNATURE = 0x12344321 +}; struct icl_cxgbei_pdu { struct icl_pdu ip; /* cxgbei specific stuff goes here. */ uint32_t icp_signature; - uint32_t pdu_seq; /* For debug only */ - u_int pdu_flags; + uint32_t icp_seq; /* For debug only */ + u_int icp_flags; }; static inline struct icl_cxgbei_pdu * @@ -111,14 +122,6 @@ struct cxgbei_sgl { #define sg_off(_sgel) _sgel->sg_offset #define sg_next(_sgel) _sgel + 1 -#define SBUF_ULP_FLAG_HDR_RCVD 0x1 -#define SBUF_ULP_FLAG_DATA_RCVD 0x2 -#define SBUF_ULP_FLAG_STATUS_RCVD 0x4 -#define SBUF_ULP_FLAG_HCRC_ERROR 0x10 -#define SBUF_ULP_FLAG_DCRC_ERROR 0x20 -#define SBUF_ULP_FLAG_PAD_ERROR 0x40 -#define SBUF_ULP_FLAG_DATA_DDPED 0x80 - /* private data for each scsi task */ struct cxgbei_task_data { struct cxgbei_sgl sgl[256]; Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 22:32:10 2016 (r304823) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 23:06:12 2016 (r304824) @@ -346,7 +346,7 @@ icl_cxgbei_conn_pdu_get_data(struct icl_ { struct icl_cxgbei_pdu *icp = ip_to_icp(ip); - if (icp->pdu_flags & SBUF_ULP_FLAG_DATA_DDPED) + if (icp->icp_flags & ICPF_RX_DDP) return; /* data is DDP'ed, no need to copy */ m_copydata(ip->ip_data_mbuf, off, len, addr); } From owner-svn-src-head@freebsd.org Thu Aug 25 23:24:58 2016 Return-Path: Delivered-To: svn-src-head@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 449F8BC5DC5; Thu, 25 Aug 2016 23:24:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0737E1E7F; Thu, 25 Aug 2016 23:24:57 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PNOvMM008561; Thu, 25 Aug 2016 23:24:57 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PNOvYI008560; Thu, 25 Aug 2016 23:24:57 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201608252324.u7PNOvYI008560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 25 Aug 2016 23:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304825 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 23:24:58 -0000 Author: gnn Date: Thu Aug 25 23:24:57 2016 New Revision: 304825 URL: https://svnweb.freebsd.org/changeset/base/304825 Log: Unlike Solaris, in FreeBSD p_args can be 0 so check for that instead of walking down to ar_args blindly. Reported by: Amanda Strnad Reviewed by: markj, jhb MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/cddl/lib/libdtrace/psinfo.d Modified: head/cddl/lib/libdtrace/psinfo.d ============================================================================== --- head/cddl/lib/libdtrace/psinfo.d Thu Aug 25 23:06:12 2016 (r304824) +++ head/cddl/lib/libdtrace/psinfo.d Thu Aug 25 23:24:57 2016 (r304825) @@ -59,7 +59,7 @@ translator psinfo_t < struct proc *T > { pr_gid = T->p_ucred->cr_rgid; pr_egid = T->p_ucred->cr_groups[0]; pr_addr = 0; - pr_psargs = (T->p_args->ar_args == 0) ? "" : + pr_psargs = (T->p_args == 0) ? "" : memstr(T->p_args->ar_args, ' ', T->p_args->ar_length); pr_arglen = T->p_args->ar_length; pr_jailid = T->p_ucred->cr_prison->pr_id; From owner-svn-src-head@freebsd.org Thu Aug 25 23:52:54 2016 Return-Path: Delivered-To: svn-src-head@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 DB3D7BC6269; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B49D81B05; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A806816C1; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 673F01DD1E; Thu, 25 Aug 2016 23:52:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id fMGBvwkjVP2k; Thu, 25 Aug 2016 23:52:50 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DD90C1DD16 To: Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> Date: Thu, 25 Aug 2016 16:52:44 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 23:52:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07 Content-Type: multipart/mixed; boundary="itIFAicGN9GH2MlTRrtx69i2OwwcFwagB" From: Bryan Drewery To: Ed Schouten Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> In-Reply-To: --itIFAicGN9GH2MlTRrtx69i2OwwcFwagB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/25/2016 1:55 PM, Ed Schouten wrote: > Hi Bryan, >=20 > 2016-08-25 19:43 GMT+02:00 Bryan Drewery : >>>> readelf -a /lib/libc.so.7|grep basename >>> 2149: 0000000000076200 231 FUNC GLOBAL DEFAULT 11 >>> basename@@FBSD_1.0 (2) >>> 2514: 0000000000076140 184 FUNC GLOBAL DEFAULT 11 >>> basename_r@@FBSD_1.2 (4) >=20 > I think the reason for this is that I haven't made any changes to the > underlying basename() function (yet); only to dirname(). So there is > no basename@FBSD_1.0. Only basename@@FBSD_1.0 (to indicate it's the > latest version against we should link). >=20 It only happens with static builds which lack the 1.0 symbol: > # readelf -a /usr/lib/libc.a|grep basename > File: /usr/lib/libc.a(basename.o) > 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS /root/git/fr= eebsd/lib/libc/gen/basename.c > 2: 0000000000000000 8 OBJECT LOCAL DEFAULT 5 basename.bna= me > 6: 00000000000000c0 231 FUNC GLOBAL DEFAULT 2 basename > 7: 0000000000000000 184 FUNC GLOBAL DEFAULT 2 basename_r With dynamic it is fine: > # readelf -a /lib/libc.so.7|grep basename > 2149: 0000000000078280 231 FUNC GLOBAL DEFAULT 11 basename@@FB= SD_1.0 (2) > 2514: 00000000000781c0 184 FUNC GLOBAL DEFAULT 11 basename_r@@= FBSD_1.2 (4) > What happens if you s/__sym_compat/__sym_default the basename() line? >=20 >=20 Libc wouldn't build, it complained quite loudly with a lot of these: > fatal error: error in backend: A @@ version cannot be undefined With this it built: > diff --git lib/libc/gen/basename.c lib/libc/gen/basename.c > index 7e21ca4..5f35613 100644 > --- lib/libc/gen/basename.c > +++ lib/libc/gen/basename.c > @@ -66,7 +66,7 @@ basename_r(const char *path, char *bname) > } >=20 > char * > -basename(char *path) > +(basename_impl)(char *path) > { > static char *bname =3D NULL; >=20 > @@ -77,3 +77,4 @@ basename(char *path) > } > return (basename_r(path, bname)); > } > +__sym_default(basename, basename_impl, FBSD_1.0); Perhaps there is a better way, but it worked... Then I get: > # readelf -a /lib/libc.so.7|grep basename > 2145: 0000000000078280 231 FUNC GLOBAL DEFAULT 11 basename@@FB= SD_1.0 (2) > 2514: 00000000000781c0 184 FUNC GLOBAL DEFAULT 11 basename_r@@= FBSD_1.2 (4) > # readelf -a /usr/lib/libc.a|grep basename > File: /usr/lib/libc.a(basename.o) > 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS /root/git/fr= eebsd/lib/libc/gen/basename.c > 2: 0000000000000000 8 OBJECT LOCAL DEFAULT 5 basename_imp= l.bname > 6: 00000000000000c0 231 FUNC GLOBAL DEFAULT 2 basename@@FB= SD_1.0 > 7: 00000000000000c0 231 FUNC GLOBAL DEFAULT 2 basename_imp= l > 8: 0000000000000000 184 FUNC GLOBAL DEFAULT 2 basename_r And xinstall builds with dynamic and static and runs fine. --=20 Regards, Bryan Drewery --itIFAicGN9GH2MlTRrtx69i2OwwcFwagB-- --pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXv4TPAAoJEDXXcbtuRpfPo9oH/0m/J/ETN+vqXi2gVmo9HRqR xRUxfzBbZjBnCi97roHQrWp/g22Hw4ShHfByWRkWUNpqz+HKIwogNdUvdWne+gin XHg2ygBSkKE3jLYXQGYzm8e+1sXslyyAeStuGSHLZjZxjXtLhILMu064xGnmYAUR ZJozhzcAhqxmZ4B2WXDv3qAsIqBFs+84BDT5vkUPOPL6SBriUcED3TowobUZjHY8 AnUDOCYAXFga0opNjVUtdbe0FPLNH3E5H4LVClm4NnbZK1xRq358EZZk8X3ptS35 kCA96tjCLgAeOwrxvGT5PUNHBmE5M1GV6DzHoBTXDWoDCE1BzHSkgvjDcphRgcM= =3Ct7 -----END PGP SIGNATURE----- --pq7ogkN8hspmAwO1lhjdDPJP6plD8uU07-- From owner-svn-src-head@freebsd.org Thu Aug 25 23:55:57 2016 Return-Path: Delivered-To: svn-src-head@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 8D850BC62EA; Thu, 25 Aug 2016 23:55:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 504851CF9; Thu, 25 Aug 2016 23:55:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PNtufe019723; Thu, 25 Aug 2016 23:55:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PNtuiZ019722; Thu, 25 Aug 2016 23:55:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608252355.u7PNtuiZ019722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 25 Aug 2016 23:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304826 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 23:55:57 -0000 Author: bdrewery Date: Thu Aug 25 23:55:56 2016 New Revision: 304826 URL: https://svnweb.freebsd.org/changeset/base/304826 Log: WITH_META_MODE: Don't let subdir traversals for 'make install' re-enable meta mode. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.sys.env.mk Modified: head/share/mk/src.sys.env.mk ============================================================================== --- head/share/mk/src.sys.env.mk Thu Aug 25 23:24:57 2016 (r304825) +++ head/share/mk/src.sys.env.mk Thu Aug 25 23:55:56 2016 (r304826) @@ -23,6 +23,7 @@ _src_env_conf_included_: .NOTMAIN .if make(*install*) && ${.MAKE.LEVEL} == 0 META_MODE= normal MK_META_MODE= no +.export MK_META_MODE .endif # If we were found via .../share/mk we need to replace that From owner-svn-src-head@freebsd.org Fri Aug 26 01:23:39 2016 Return-Path: Delivered-To: svn-src-head@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 CD01FBC5A1B; Fri, 26 Aug 2016 01:23:39 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x22d.google.com (mail-ua0-x22d.google.com [IPv6:2607:f8b0:400c:c08::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 870171529; Fri, 26 Aug 2016 01:23:39 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x22d.google.com with SMTP id m60so73824479uam.3; Thu, 25 Aug 2016 18:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=kSzqxiFGJ9sAKrA3QxsYKXD8MFVDBeWOD08ZDhCvv0c=; b=axBJIIsDg6dUIam6f4us20tFBtrlK6rHeRTbjQ2eUjpBqpsZLNcEAY32umBdqhyyW/ MhEnTIbQID/VUjteMblT7z+IdnIJrMEH+yR6N5FzG1aVBncr5mkK0N58t977ORI4TOfw UBpHd7urU+sOeNGksytkWk3p5asWtPwqPmQsadGlv7wUYsqO2Q3XWsNczTv2X+Zm6lMy d7MfnyP659qM5YDCkbUQubxCiObNqYE/yxkabgB25Mxhs5CzYY79tLIHnDOrEs70xkHw YimqAywntaqmlg3vEfVeue/WuYQ17HIpcL1ky5YgMcGsX8ceoxQ8I5a0xSJXC82M+FmR uwbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=kSzqxiFGJ9sAKrA3QxsYKXD8MFVDBeWOD08ZDhCvv0c=; b=YoiHmqxzUO97O9ZWRhuvMK5XM8jKH8e76ypyvcTeCMSu2L1O1CHXMNsi9OhoCjHybJ W+EugO2FXuwXES9GgeJyctRs5QZFN3T8NfwOGVWfBvYh2rD2dWl8+e8CqwJ2dqr2Shkg Sj9vcKXoKZSckcAvt9Ceetc4SzYIS+TH8/pWDsYBfZU6W8Xxl/Vsoe9IjUiV82DaLEDE 65/nw27KvUI57AYso/8QaiIuqdMrKa+iaFl1ou1qYE2bn1qM/YsWL/SMZ3eIcTAonhc3 CA3TGXYfG3JkKd7+rvC20g6zRZIybMAxFQkPsLlG+Vt1aljLo6DCiPNTdBbLYdC3VhnC hsyA== X-Gm-Message-State: AE9vXwMcH0hp9flvPvACYz1sgGPHFXyLyT/Q2EnhFeI156XZDE3ReNgx8meq8Bk9VrmIo/J+HPzM2mP/w9rEaA== X-Received: by 10.31.115.131 with SMTP id o125mr348887vkc.0.1472174618688; Thu, 25 Aug 2016 18:23:38 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.1.54 with HTTP; Thu, 25 Aug 2016 18:23:38 -0700 (PDT) In-Reply-To: <20160825175429.GD41576@strugglingcoder.info> References: <201608020636.u726alY8000175@repo.freebsd.org> <20160825175429.GD41576@strugglingcoder.info> From: Sepherosa Ziehau Date: Fri, 26 Aug 2016 09:23:38 +0800 X-Google-Sender-Auth: jIbIE1nLN_eQUz0tVSA5vB0D4KE Message-ID: Subject: Re: svn commit: r303656 - head/sys/netinet To: hiren panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 01:23:39 -0000 On Fri, Aug 26, 2016 at 1:54 AM, hiren panchasara wrote: > On 08/02/16 at 06:36P, Sepherosa Ziehau wrote: >> Author: sephe >> Date: Tue Aug 2 06:36:47 2016 >> New Revision: 303656 >> URL: https://svnweb.freebsd.org/changeset/base/303656 >> >> Log: >> tcp/lro: Implement hash table for LRO entries. >> >> This significantly improves HTTP workload performance and reduces >> HTTP workload latency. >> >> Reviewed by: rrs, gallatin, hps >> Obtained from: rrs, gallatin >> Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe) >> Differential Revision: https://reviews.freebsd.org/D6689 > > Hi Sephe, > > Can you please MFC this to stable/11? I don't think this one can be MFC'ed, since it changes the size of LRO control struct, which is usually embedded in the driver's softc/RX ring struct. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Fri Aug 26 01:24:07 2016 Return-Path: Delivered-To: svn-src-head@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 DB190BC5A85; Fri, 26 Aug 2016 01:24:07 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x22a.google.com (mail-ua0-x22a.google.com [IPv6:2607:f8b0:400c:c08::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95C2D16A8; Fri, 26 Aug 2016 01:24:07 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x22a.google.com with SMTP id n59so113953994uan.2; Thu, 25 Aug 2016 18:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HKRT2SCQ98OSEAkRfsLovYXLXmDjHVAbg64/pbGxLPY=; b=Tuzl4YNDcq8n0rf2DqcpEVG130Quoh71I6oSlsZRZb0k271eRJyJLhwKm/DBlePJy1 wkneEbNM4v8TQP9PO6y6ET9x4SkA74Hz12T4S3osxLOPdUMzH4RxQgcA3sSUZWYnIE3M pMXEjBNbyTFQ5hGfpqPEkyfHwDkYJlmAnuwD4lmGML7pGlg8Asvm7Vdc8Rkz32oDwK4R uu/V0qLDvVW03rkyWoJnLzkBo1o7ZbSa4SkRTApjwnPNz1rcGFglgLXFaSxqxf342oTM p+U6m5sIGIAqympGMcd/SMzdPqLfkjqeCawCQ7+lpN4B05IgG+UqhdDmZcgGdrYSpGRA 0zsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HKRT2SCQ98OSEAkRfsLovYXLXmDjHVAbg64/pbGxLPY=; b=BOmZV0u9dbAZm1XDUnKR8t0INvq6XW+q4P6o2DTbbea/PaBGZk0OW9OprLEn4hjs6U eVEjM0qc8kggKKM+g/aOBEiAQk4SlwmuGxRfM8JqT+d5dlxKg79fXWMgdKi+DNk9DZIz qEv+amflDaitX7zOiVwhTOjMwFQRd1ZKFoNtR0L8fip/9RNji2ZFrPDbbA1929uq8q3G oJh31WXLW5KEgjDToIN6vkQv0gvoid7G/c9mxfzd7mE/7vMVCL669chr1k7E1OMCrN6t p44ZrI5DabQA4OAX9qhsJNfVrKRQ8MS3pJZiH1mbQrBydDYWxexzbQO0cO6XvyOR27k8 Sv4g== X-Gm-Message-State: AE9vXwO7I7mbl6LLG8CK8Fnyyty38a86lSekAspAU/k+VYCuNR0KSrnbcCsOsNK5YL3ft6Rq++KdWPlv3xApdw== X-Received: by 10.31.244.77 with SMTP id s74mr272623vkh.126.1472174646700; Thu, 25 Aug 2016 18:24:06 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.176.1.54 with HTTP; Thu, 25 Aug 2016 18:24:06 -0700 (PDT) In-Reply-To: <20160825175237.GC41576@strugglingcoder.info> References: <201608050908.u75980fB078890@repo.freebsd.org> <20160825175237.GC41576@strugglingcoder.info> From: Sepherosa Ziehau Date: Fri, 26 Aug 2016 09:24:06 +0800 X-Google-Sender-Auth: -z4vli8ODuWPNMCJ2sXUJot-DxI Message-ID: Subject: Re: svn commit: r303766 - head/sys/netinet To: hiren panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 01:24:08 -0000 On Fri, Aug 26, 2016 at 1:52 AM, hiren panchasara wrote: > On 08/05/16 at 09:08P, Sepherosa Ziehau wrote: >> Author: sephe >> Date: Fri Aug 5 09:08:00 2016 >> New Revision: 303766 >> URL: https://svnweb.freebsd.org/changeset/base/303766 >> >> Log: >> tcp/lro: If timestamps mismatch or it's a FIN, force flush. >> >> This keeps the segments/ACK/FIN delivery order. >> >> Before this patch, it was observed: if A sent FIN immediately after >> an ACK, B would deliver FIN first to the TCP stack, then the ACK. >> This out-of-order delivery causes one unnecessary ACK sent from B. >> >> Reviewed by: gallatin, hps >> Obtained from: rrs, gallatin >> Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe) >> Differential Revision: https://reviews.freebsd.org/D7415 > > Hi Sephe, > > This looks like a good fix for stable/11. Can you please MFC it? Yeah, sure. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Fri Aug 26 01:28:32 2016 Return-Path: Delivered-To: svn-src-head@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 E78FCBC5B4D; Fri, 26 Aug 2016 01:28:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8F7F1852; Fri, 26 Aug 2016 01:28:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q1SV72053422; Fri, 26 Aug 2016 01:28:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q1SVGA053419; Fri, 26 Aug 2016 01:28:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608260128.u7Q1SVGA053419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 26 Aug 2016 01:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304827 - head/sys/dev/cxgbe/cxgbei X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 01:28:33 -0000 Author: np Date: Fri Aug 26 01:28:31 2016 New Revision: 304827 URL: https://svnweb.freebsd.org/changeset/base/304827 Log: cxgbe/cxgbei: There is no need for multiple modules in the KLD. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/cxgbei/cxgbei.h head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Aug 25 23:55:56 2016 (r304826) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Fri Aug 26 01:28:31 2016 (r304827) @@ -1117,10 +1117,14 @@ cxgbei_modevent(module_t mod, int cmd, v switch (cmd) { case MOD_LOAD: rc = cxgbei_mod_load(); + if (rc == 0) + rc = icl_cxgbei_mod_load(); break; case MOD_UNLOAD: - rc = cxgbei_mod_unload(); + rc = icl_cxgbei_mod_unload(); + if (rc == 0) + rc = cxgbei_mod_unload(); break; default: Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.h ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.h Thu Aug 25 23:55:56 2016 (r304826) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.h Fri Aug 26 01:28:31 2016 (r304827) @@ -167,4 +167,8 @@ int t4_ddp_set_map(struct cxgbei_data *, struct cxgbei_ulp2_gather_list *, int); void t4_ddp_clear_map(struct cxgbei_data *, struct cxgbei_ulp2_gather_list *, u_int, u_int, u_int, struct icl_cxgbei_conn *); + +/* icl_cxgbei.c */ +int icl_cxgbei_mod_load(void); +int icl_cxgbei_mod_unload(void); #endif Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Thu Aug 25 23:55:56 2016 (r304826) +++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Fri Aug 26 01:28:31 2016 (r304827) @@ -877,10 +877,10 @@ icl_cxgbei_limits(struct icl_drv_limits return (0); } -static int -icl_cxgbei_load(void) +int +icl_cxgbei_mod_load(void) { - int error; + int rc; icl_transfer_zone = uma_zcreate("icl_transfer", 16 * 1024, NULL, NULL, NULL, NULL, @@ -888,15 +888,14 @@ icl_cxgbei_load(void) refcount_init(&icl_cxgbei_ncons, 0); - error = icl_register("cxgbei", false, -100, icl_cxgbei_limits, + rc = icl_register("cxgbei", false, -100, icl_cxgbei_limits, icl_cxgbei_new_conn); - KASSERT(error == 0, ("failed to register")); - return (error); + return (rc); } -static int -icl_cxgbei_unload(void) +int +icl_cxgbei_mod_unload(void) { if (icl_cxgbei_ncons != 0) @@ -908,28 +907,4 @@ icl_cxgbei_unload(void) return (0); } - -static int -icl_cxgbei_modevent(module_t mod, int what, void *arg) -{ - - switch (what) { - case MOD_LOAD: - return (icl_cxgbei_load()); - case MOD_UNLOAD: - return (icl_cxgbei_unload()); - default: - return (EINVAL); - } -} - -moduledata_t icl_cxgbei_data = { - "icl_cxgbei", - icl_cxgbei_modevent, - 0 -}; - -DECLARE_MODULE(icl_cxgbei, icl_cxgbei_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -MODULE_DEPEND(icl_cxgbei, icl, 1, 1, 1); -MODULE_VERSION(icl_cxgbei, 1); #endif From owner-svn-src-head@freebsd.org Fri Aug 26 02:46:48 2016 Return-Path: Delivered-To: svn-src-head@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 94F08BC6AA8; Fri, 26 Aug 2016 02:46:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C44D18C9; Fri, 26 Aug 2016 02:46:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q2klCe083022; Fri, 26 Aug 2016 02:46:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q2klPe083021; Fri, 26 Aug 2016 02:46:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608260246.u7Q2klPe083021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 26 Aug 2016 02:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304828 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 02:46:48 -0000 Author: cem Date: Fri Aug 26 02:46:47 2016 New Revision: 304828 URL: https://svnweb.freebsd.org/changeset/base/304828 Log: ddb: Add 'show active trace' command 'show active trace', or 'acttrace' for short, prints backtraces from running threads only. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D7646 Modified: head/sys/ddb/db_command.c Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Fri Aug 26 01:28:31 2016 (r304827) +++ head/sys/ddb/db_command.c Fri Aug 26 02:46:47 2016 (r304828) @@ -72,6 +72,7 @@ static db_cmdfcn_t db_halt; static db_cmdfcn_t db_kill; static db_cmdfcn_t db_reset; static db_cmdfcn_t db_stack_trace; +static db_cmdfcn_t db_stack_trace_active; static db_cmdfcn_t db_stack_trace_all; static db_cmdfcn_t db_watchdog; @@ -79,6 +80,12 @@ static db_cmdfcn_t db_watchdog; * 'show' commands */ +static struct command db_show_active_cmds[] = { + { "trace", db_stack_trace_active, 0, NULL }, +}; +struct command_table db_show_active_table = + LIST_HEAD_INITIALIZER(db_show_active_table); + static struct command db_show_all_cmds[] = { { "trace", db_stack_trace_all, 0, NULL }, }; @@ -86,6 +93,7 @@ struct command_table db_show_all_table = LIST_HEAD_INITIALIZER(db_show_all_table); static struct command db_show_cmds[] = { + { "active", 0, 0, &db_show_active_table }, { "all", 0, 0, &db_show_all_table }, { "registers", db_show_regs, 0, NULL }, { "breaks", db_listbreak_cmd, 0, NULL }, @@ -120,6 +128,8 @@ static struct command db_cmds[] = { { "match", db_trace_until_matching_cmd,0, NULL }, { "trace", db_stack_trace, CS_OWN, NULL }, { "t", db_stack_trace, CS_OWN, NULL }, + /* XXX alias for active trace */ + { "acttrace", db_stack_trace_active, 0, NULL }, /* XXX alias for all trace */ { "alltrace", db_stack_trace_all, 0, NULL }, { "where", db_stack_trace, CS_OWN, NULL }, @@ -195,6 +205,9 @@ db_command_init(void) db_command_register(&db_cmd_table, &db_cmds[i]); for (i = 0; i < N(db_show_cmds); i++) db_command_register(&db_show_table, &db_show_cmds[i]); + for (i = 0; i < N(db_show_active_cmds); i++) + db_command_register(&db_show_active_table, + &db_show_active_cmds[i]); for (i = 0; i < N(db_show_all_cmds); i++) db_command_register(&db_show_all_table, &db_show_all_cmds[i]); #undef N @@ -799,8 +812,7 @@ db_stack_trace(db_expr_t tid, bool hasti } static void -db_stack_trace_all(db_expr_t dummy, bool dummy2, db_expr_t dummy3, - char *dummy4) +_db_stack_trace_all(bool active_only) { struct proc *p; struct thread *td; @@ -811,8 +823,18 @@ db_stack_trace_all(db_expr_t dummy, bool prev_jb = kdb_jmpbuf(jb); if (setjmp(jb) == 0) { FOREACH_THREAD_IN_PROC(p, td) { - db_printf("\nTracing command %s pid %d tid %ld td %p\n", - p->p_comm, p->p_pid, (long)td->td_tid, td); + if (td->td_state == TDS_RUNNING) + db_printf("\nTracing command %s pid %d" + " tid %ld td %p (CPU %d)\n", + p->p_comm, p->p_pid, + (long)td->td_tid, td, + td->td_oncpu); + else if (active_only) + continue; + else + db_printf("\nTracing command %s pid %d" + " tid %ld td %p\n", p->p_comm, + p->p_pid, (long)td->td_tid, td); db_trace_thread(td, -1); if (db_pager_quit) { kdb_jmpbuf(prev_jb); @@ -824,6 +846,22 @@ db_stack_trace_all(db_expr_t dummy, bool } } +static void +db_stack_trace_active(db_expr_t dummy, bool dummy2, db_expr_t dummy3, + char *dummy4) +{ + + _db_stack_trace_all(true); +} + +static void +db_stack_trace_all(db_expr_t dummy, bool dummy2, db_expr_t dummy3, + char *dummy4) +{ + + _db_stack_trace_all(false); +} + /* * Take the parsed expression value from the command line that was parsed * as a hexadecimal value and convert it as if the expression was parsed From owner-svn-src-head@freebsd.org Fri Aug 26 03:36:38 2016 Return-Path: Delivered-To: svn-src-head@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 A0510BC4700; Fri, 26 Aug 2016 03:36:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7307A1210; Fri, 26 Aug 2016 03:36:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q3abqe002523; Fri, 26 Aug 2016 03:36:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q3abC4002522; Fri, 26 Aug 2016 03:36:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608260336.u7Q3abC4002522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 26 Aug 2016 03:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304829 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 03:36:38 -0000 Author: jhibbits Date: Fri Aug 26 03:36:37 2016 New Revision: 304829 URL: https://svnweb.freebsd.org/changeset/base/304829 Log: Prevent BSS from being cleared twice on BookE Summary: First time BSS is cleared in booke_init(), Second time it's cleared in powerpc_init(). Any variable initialized between two those guys gets wiped out what is wrong. In particular it wipes tlb1_entries initialized by tlb1_init(), which was fine when tlb1_init() was called a second time, but this was removed in r304656. Submitted by: Ivan Krivonos Differential Revision: https://reviews.freebsd.org/D7638 Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Fri Aug 26 02:46:47 2016 (r304828) +++ head/sys/powerpc/powerpc/machdep.c Fri Aug 26 03:36:37 2016 (r304829) @@ -284,8 +284,14 @@ powerpc_init(vm_offset_t fdt, vm_offset_ #endif } } else { +#if !defined(BOOKE) + /* + * On BOOKE the BSS is already cleared and some variables + * initialized. Do not wipe them out. + */ bzero(__sbss_start, __sbss_end - __sbss_start); bzero(__bss_start, _end - __bss_start); +#endif init_static_kenv(NULL, 0); } /* Store boot environment state */ From owner-svn-src-head@freebsd.org Fri Aug 26 05:12:10 2016 Return-Path: Delivered-To: svn-src-head@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 731EBBC582D; Fri, 26 Aug 2016 05:12:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 510851637; Fri, 26 Aug 2016 05:12:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q5C9Xx038616; Fri, 26 Aug 2016 05:12:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q5C98b038614; Fri, 26 Aug 2016 05:12:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608260512.u7Q5C98b038614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Aug 2016 05:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304832 - in head/sys: dev/hyperv/netvsc net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 05:12:10 -0000 Author: sephe Date: Fri Aug 26 05:12:09 2016 New Revision: 304832 URL: https://svnweb.freebsd.org/changeset/base/304832 Log: hyperv/hn: Use vmbus xact for RNDIS query. And switch MAC address query to use new RNDIS query function. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7639 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 26 04:31:19 2016 (r304831) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 26 05:12:09 2016 (r304832) @@ -96,6 +96,8 @@ static void hn_rndis_sent_halt(struct hn static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct hn_softc *sc, struct vmbus_channel *chan, const void *data, int dlen); +static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, + const void *idata, size_t idlen, void *odata, size_t *odlen0); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -695,13 +697,23 @@ cleanup: /* * RNDIS filter query device MAC address */ -static inline int +static int hv_rf_query_device_mac(rndis_device *device) { - uint32_t size = ETHER_ADDR_LEN; + struct hn_softc *sc = device->sc; + size_t hwaddr_len; + int error; - return (hv_rf_query_device(device, - RNDIS_OID_802_3_PERMANENT_ADDRESS, device->hw_mac_addr, &size)); + hwaddr_len = ETHER_ADDR_LEN; + error = hn_rndis_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0, + device->hw_mac_addr, &hwaddr_len); + if (error) + return error; + if (hwaddr_len != ETHER_ADDR_LEN) { + if_printf(sc->hn_ifp, "invalid hwaddr len %zu\n", hwaddr_len); + return EINVAL; + } + return 0; } /* @@ -892,12 +904,12 @@ exit: static const void * hn_rndis_xact_execute(struct hn_softc *sc, struct vmbus_xact *xact, uint32_t rid, - size_t reqlen, size_t min_complen, uint32_t comp_type) + size_t reqlen, size_t *comp_len0, uint32_t comp_type) { struct vmbus_gpa gpa[HN_XACT_REQ_PGCNT]; const struct rndis_comp_hdr *comp; bus_addr_t paddr; - size_t comp_len; + size_t comp_len, min_complen = *comp_len0; int gpa_cnt, error; KASSERT(rid > HN_RNDIS_RID_COMPAT_MAX, ("invalid rid %u\n", rid)); @@ -946,7 +958,14 @@ hn_rndis_xact_execute(struct hn_softc *s * Check this RNDIS complete message. */ if (comp_len < min_complen) { - if_printf(sc->hn_ifp, "invalid RNDIS comp len %zu\n", comp_len); + if (comp_len >= sizeof(*comp)) { + /* rm_status field is valid */ + if_printf(sc->hn_ifp, "invalid RNDIS comp len %zu, " + "status 0x%08x\n", comp_len, comp->rm_status); + } else { + if_printf(sc->hn_ifp, "invalid RNDIS comp len %zu\n", + comp_len); + } return (NULL); } if (comp->rm_len < min_complen) { @@ -965,9 +984,100 @@ hn_rndis_xact_execute(struct hn_softc *s return (NULL); } /* All pass! */ + *comp_len0 = comp_len; return (comp); } +static int +hn_rndis_query(struct hn_softc *sc, uint32_t oid, + const void *idata, size_t idlen, void *odata, size_t *odlen0) +{ + struct rndis_query_req *req; + const struct rndis_query_comp *comp; + struct vmbus_xact *xact; + size_t reqlen, odlen = *odlen0, comp_len; + int error, ofs; + uint32_t rid; + + reqlen = sizeof(*req) + idlen; + xact = vmbus_xact_get(sc->hn_xact, reqlen); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for RNDIS query\n"); + return (ENXIO); + } + rid = hn_rndis_rid(sc); + req = vmbus_xact_req_data(xact); + req->rm_type = REMOTE_NDIS_QUERY_MSG; + req->rm_len = reqlen; + req->rm_rid = rid; + req->rm_oid = oid; + /* + * XXX + * This is _not_ RNDIS Spec conforming: + * "This MUST be set to 0 when there is no input data + * associated with the OID." + * + * If this field was set to 0 according to the RNDIS Spec, + * Hyper-V would set non-SUCCESS status in the query + * completion. + */ + req->rm_infobufoffset = RNDIS_QUERY_REQ_INFOBUFOFFSET; + + if (idlen > 0) { + req->rm_infobuflen = idlen; + /* Input data immediately follows RNDIS query. */ + memcpy(req + 1, idata, idlen); + } + + comp_len = sizeof(*comp) + odlen; + comp = hn_rndis_xact_execute(sc, xact, rid, reqlen, &comp_len, + REMOTE_NDIS_QUERY_CMPLT); + if (comp == NULL) { + if_printf(sc->hn_ifp, "exec RNDIS query 0x%08x failed\n", oid); + error = EIO; + goto done; + } + + if (comp->rm_status != RNDIS_STATUS_SUCCESS) { + if_printf(sc->hn_ifp, "RNDIS query 0x%08x failed: " + "status 0x%08x\n", oid, comp->rm_status); + error = EIO; + goto done; + } + if (comp->rm_infobuflen == 0 || comp->rm_infobufoffset == 0) { + /* No output data! */ + if_printf(sc->hn_ifp, "RNDIS query 0x%08x, no data\n", oid); + *odlen0 = 0; + error = 0; + goto done; + } + + /* + * Check output data length and offset. + */ + /* ofs is the offset from the beginning of comp. */ + ofs = RNDIS_QUERY_COMP_INFOBUFABS(comp->rm_infobufoffset); + if (ofs < sizeof(*comp) || ofs + comp->rm_infobuflen > comp_len) { + if_printf(sc->hn_ifp, "RNDIS query invalid comp ib off/len, " + "%u/%u\n", comp->rm_infobufoffset, comp->rm_infobuflen); + error = EINVAL; + goto done; + } + + /* + * Save output data. + */ + if (comp->rm_infobuflen < odlen) + odlen = comp->rm_infobuflen; + memcpy(odata, ((const uint8_t *)comp) + ofs, odlen); + *odlen0 = odlen; + + error = 0; +done: + vmbus_xact_put(xact); + return (error); +} + /* * RNDIS filter init device */ @@ -978,6 +1088,7 @@ hv_rf_init_device(rndis_device *device) struct rndis_init_req *req; const struct rndis_init_comp *comp; struct vmbus_xact *xact; + size_t comp_len; uint32_t rid; int error; @@ -998,8 +1109,9 @@ hv_rf_init_device(rndis_device *device) req->rm_ver_minor = RNDIS_VERSION_MINOR; req->rm_max_xfersz = HN_RNDIS_XFER_SIZE; - comp = hn_rndis_xact_execute(sc, xact, rid, sizeof(*req), - RNDIS_INIT_COMP_SIZE_MIN, REMOTE_NDIS_INITIALIZE_CMPLT); + comp_len = RNDIS_INIT_COMP_SIZE_MIN; + comp = hn_rndis_xact_execute(sc, xact, rid, sizeof(*req), &comp_len, + REMOTE_NDIS_INITIALIZE_CMPLT); if (comp == NULL) { if_printf(sc->hn_ifp, "exec RNDIS init failed\n"); error = EIO; Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Fri Aug 26 04:31:19 2016 (r304831) +++ head/sys/net/rndis.h Fri Aug 26 05:12:09 2016 (r304832) @@ -172,6 +172,10 @@ struct rndis_query_req { uint32_t rm_devicevchdl; }; +#define RNDIS_QUERY_REQ_INFOBUFOFFSET \ + (sizeof(struct rndis_query_req) - \ + __offsetof(struct rndis_query_req, rm_rid)) + struct rndis_query_comp { uint32_t rm_type; uint32_t rm_len; @@ -181,6 +185,9 @@ struct rndis_query_comp { uint32_t rm_infobufoffset; }; +#define RNDIS_QUERY_COMP_INFOBUFABS(ofs) \ + ((ofs) + __offsetof(struct rndis_query_req, rm_rid)) + /* Send a set object request. */ #define REMOTE_NDIS_SET_MSG 0x00000005 #define REMOTE_NDIS_SET_CMPLT 0x80000005 From owner-svn-src-head@freebsd.org Fri Aug 26 05:15:10 2016 Return-Path: Delivered-To: svn-src-head@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 26CF3BC58B0; Fri, 26 Aug 2016 05:15:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DB01A1806; Fri, 26 Aug 2016 05:15:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q5F9pb038762; Fri, 26 Aug 2016 05:15:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q5F81J038758; Fri, 26 Aug 2016 05:15:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608260515.u7Q5F81J038758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Aug 2016 05:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304833 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 05:15:10 -0000 Author: sephe Date: Fri Aug 26 05:15:08 2016 New Revision: 304833 URL: https://svnweb.freebsd.org/changeset/base/304833 Log: hyperv/hn: Save the adopted NDIS version for RNDIS to use later. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7640 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 26 05:12:09 2016 (r304832) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 26 05:15:08 2016 (r304833) @@ -521,9 +521,15 @@ hv_nv_connect_to_vsp(struct hn_softc *sc for (i = protocol_number - 1; i >= 0; i--) { if (hv_nv_negotiate_nvsp_protocol(sc, protocol_list[i]) == 0) { sc->hn_nvs_ver = protocol_list[i]; + sc->hn_ndis_ver = NDIS_VERSION_6_30; + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) + sc->hn_ndis_ver = NDIS_VERSION_6_1; if (bootverbose) { - device_printf(dev, "NVS version 0x%x\n", - sc->hn_nvs_ver); + if_printf(sc->hn_ifp, "NVS version 0x%x, " + "NDIS version %u.%u\n", + sc->hn_nvs_ver, + NDIS_VERSION_MAJOR(sc->hn_ndis_ver), + NDIS_VERSION_MINOR(sc->hn_ndis_ver)); } break; } @@ -549,11 +555,8 @@ hv_nv_connect_to_vsp(struct hn_softc *sc memset(&ndis, 0, sizeof(ndis)); ndis.nvs_type = HN_NVS_TYPE_NDIS_INIT; - ndis.nvs_ndis_major = NDIS_VERSION_MAJOR_6; - if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) - ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_1; - else - ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; + ndis.nvs_ndis_major = NDIS_VERSION_MAJOR(sc->hn_ndis_ver); + ndis.nvs_ndis_minor = NDIS_VERSION_MINOR(sc->hn_ndis_ver); /* NOTE: No response. */ ret = hn_nvs_req_send(sc, &ndis, sizeof(ndis)); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 26 05:12:09 2016 (r304832) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 26 05:15:08 2016 (r304833) @@ -382,6 +382,7 @@ typedef struct hn_softc { struct hyperv_dma hn_chim_dma; uint32_t hn_rndis_rid; + uint32_t hn_ndis_ver; } hn_softc_t; #define HN_FLAG_RXBUF_CONNECTED 0x0001 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 26 05:12:09 2016 (r304832) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 26 05:15:08 2016 (r304833) @@ -330,6 +330,7 @@ static int hn_rx_stat_ulong_sysctl(SYSCT static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); static int hn_create_tx_ring(struct hn_softc *, int); static void hn_destroy_tx_ring(struct hn_tx_ring *); @@ -427,6 +428,8 @@ netvsc_probe(device_t dev) static int netvsc_attach(device_t dev) { + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; netvsc_device_info device_info; hn_softc_t *sc; int unit = device_get_unit(dev); @@ -608,9 +611,13 @@ netvsc_attach(device_t dev) hn_tx_chimney_size < sc->hn_chim_szmax) hn_set_chim_size(sc, hn_tx_chimney_size); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "nvs_version", CTLFLAG_RD, &sc->hn_nvs_ver, 0, "NVS version"); + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "nvs_version", CTLFLAG_RD, + &sc->hn_nvs_ver, 0, "NVS version"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "ndis_version", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_ndis_version_sysctl, "A", "NDIS version"); return (0); failed: @@ -2094,6 +2101,18 @@ hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARG } static int +hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char verstr[16]; + + snprintf(verstr, sizeof(verstr), "%u.%u", + NDIS_VERSION_MAJOR(sc->hn_ndis_ver), + NDIS_VERSION_MINOR(sc->hn_ndis_ver)); + return sysctl_handle_string(oidp, verstr, sizeof(verstr), req); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Aug 26 05:12:09 2016 (r304832) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Fri Aug 26 05:15:08 2016 (r304833) @@ -42,11 +42,8 @@ #define NDIS_VERSION_6_1 0x00060001 #define NDIS_VERSION_6_30 0x0006001e -#define NDIS_VERSION_MAJOR_6 6 -#define NDIS_VERSION_MINOR_1 1 -#define NDIS_VERSION_MINOR_30 30 - -#define NDIS_VERSION (NDIS_VERSION_5_1) +#define NDIS_VERSION_MAJOR(ver) (((ver) & 0xffff0000) >> 16) +#define NDIS_VERSION_MINOR(ver) ((ver) & 0xffff) /* * Object Identifiers used by NdisRequest Query/Set Information From owner-svn-src-head@freebsd.org Fri Aug 26 05:18:29 2016 Return-Path: Delivered-To: svn-src-head@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 17D86BC5976; Fri, 26 Aug 2016 05:18:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D0F2D1A18; Fri, 26 Aug 2016 05:18:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q5IS3d038903; Fri, 26 Aug 2016 05:18:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q5IRZ6038900; Fri, 26 Aug 2016 05:18:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608260518.u7Q5IRZ6038900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 26 Aug 2016 05:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304834 - in head/sys: dev/hyperv/netvsc net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 05:18:29 -0000 Author: sephe Date: Fri Aug 26 05:18:27 2016 New Revision: 304834 URL: https://svnweb.freebsd.org/changeset/base/304834 Log: hyperv/hn: Use vmbus xact for RNDIS set. And use new RNDIS set to configure NDIS offloading parameters. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7641 Added: head/sys/dev/hyperv/netvsc/ndis.h (contents, props changed) Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/net/rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 26 05:15:08 2016 (r304833) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 26 05:18:27 2016 (r304834) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define HV_RF_RECVINFO_VLAN 0x1 #define HV_RF_RECVINFO_CSUM 0x2 @@ -98,6 +99,9 @@ static void hn_rndis_sent_cb(struct hn_s const void *data, int dlen); static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, const void *idata, size_t idlen, void *odata, size_t *odlen0); +static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, + size_t dlen); +static int hn_rndis_conf_offload(struct hn_softc *sc); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) @@ -1002,7 +1006,7 @@ hn_rndis_query(struct hn_softc *sc, uint reqlen = sizeof(*req) + idlen; xact = vmbus_xact_get(sc->hn_xact, reqlen); if (xact == NULL) { - if_printf(sc->hn_ifp, "no xact for RNDIS query\n"); + if_printf(sc->hn_ifp, "no xact for RNDIS query 0x%08x\n", oid); return (ENXIO); } rid = hn_rndis_rid(sc); @@ -1078,6 +1082,96 @@ done: return (error); } +static int +hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, size_t dlen) +{ + struct rndis_set_req *req; + const struct rndis_set_comp *comp; + struct vmbus_xact *xact; + size_t reqlen, comp_len; + uint32_t rid; + int error; + + KASSERT(dlen > 0, ("invalid dlen %zu", dlen)); + + reqlen = sizeof(*req) + dlen; + xact = vmbus_xact_get(sc->hn_xact, reqlen); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for RNDIS set 0x%08x\n", oid); + return (ENXIO); + } + rid = hn_rndis_rid(sc); + req = vmbus_xact_req_data(xact); + req->rm_type = REMOTE_NDIS_SET_MSG; + req->rm_len = reqlen; + req->rm_rid = rid; + req->rm_oid = oid; + req->rm_infobuflen = dlen; + req->rm_infobufoffset = RNDIS_SET_REQ_INFOBUFOFFSET; + /* Data immediately follows RNDIS set. */ + memcpy(req + 1, data, dlen); + + comp_len = sizeof(*comp); + comp = hn_rndis_xact_execute(sc, xact, rid, reqlen, &comp_len, + REMOTE_NDIS_SET_CMPLT); + if (comp == NULL) { + if_printf(sc->hn_ifp, "exec RNDIS set 0x%08x failed\n", oid); + error = EIO; + goto done; + } + + if (comp->rm_status != RNDIS_STATUS_SUCCESS) { + if_printf(sc->hn_ifp, "RNDIS set 0x%08x failed: " + "status 0x%08x\n", oid, comp->rm_status); + error = EIO; + goto done; + } + error = 0; +done: + vmbus_xact_put(xact); + return (error); +} + +static int +hn_rndis_conf_offload(struct hn_softc *sc) +{ + struct ndis_offload_params params; + size_t paramsz; + int error; + + /* NOTE: 0 means "no change" */ + memset(¶ms, 0, sizeof(params)); + + params.ndis_hdr.ndis_type = NDIS_OBJTYPE_DEFAULT; + if (sc->hn_ndis_ver < NDIS_VERSION_6_30) { + params.ndis_hdr.ndis_rev = NDIS_OFFLOAD_PARAMS_REV_2; + paramsz = NDIS_OFFLOAD_PARAMS_SIZE_6_1; + } else { + params.ndis_hdr.ndis_rev = NDIS_OFFLOAD_PARAMS_REV_3; + paramsz = NDIS_OFFLOAD_PARAMS_SIZE; + } + params.ndis_hdr.ndis_size = paramsz; + + params.ndis_ip4csum = NDIS_OFFLOAD_PARAM_TXRX; + params.ndis_tcp4csum = NDIS_OFFLOAD_PARAM_TXRX; + params.ndis_tcp6csum = NDIS_OFFLOAD_PARAM_TXRX; + if (sc->hn_ndis_ver >= NDIS_VERSION_6_30) { + params.ndis_udp4csum = NDIS_OFFLOAD_PARAM_TXRX; + params.ndis_udp6csum = NDIS_OFFLOAD_PARAM_TXRX; + } + params.ndis_lsov2_ip4 = NDIS_OFFLOAD_LSOV2_ON; + /* XXX ndis_lsov2_ip6 = NDIS_OFFLOAD_LSOV2_ON */ + + error = hn_rndis_set(sc, OID_TCP_OFFLOAD_PARAMETERS, ¶ms, paramsz); + if (error) { + if_printf(sc->hn_ifp, "offload config failed: %d\n", error); + } else { + if (bootverbose) + if_printf(sc->hn_ifp, "offload config done\n"); + } + return (error); +} + /* * RNDIS filter init device */ @@ -1243,7 +1337,6 @@ hv_rf_on_device_add(struct hn_softc *sc, { int ret; rndis_device *rndis_dev; - rndis_offload_params offloads; struct rndis_recv_scale_cap rsscaps; uint32_t rsscaps_size = sizeof(struct rndis_recv_scale_cap); netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; @@ -1293,21 +1386,8 @@ hv_rf_on_device_add(struct hn_softc *sc, /* TODO: shut down rndis device and the channel */ } - /* config csum offload and send request to host */ - memset(&offloads, 0, sizeof(offloads)); - offloads.ipv4_csum = RNDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED; - offloads.tcp_ipv4_csum = RNDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED; - offloads.udp_ipv4_csum = RNDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED; - offloads.tcp_ipv6_csum = RNDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED; - offloads.udp_ipv6_csum = RNDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED; - offloads.lso_v2_ipv4 = RNDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED; - - ret = hv_rf_send_offload_request(sc, &offloads); - if (ret != 0) { - /* TODO: shut down rndis device and the channel */ - device_printf(dev, - "hv_rf_send_offload_request failed, ret=%d\n", ret); - } + /* Configure NDIS offload settings */ + hn_rndis_conf_offload(sc); memcpy(dev_info->mac_addr, rndis_dev->hw_mac_addr, ETHER_ADDR_LEN); Added: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/netvsc/ndis.h Fri Aug 26 05:18:27 2016 (r304834) @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2016 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NET_NDIS_H_ +#define _NET_NDIS_H_ + +#define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C + +#define NDIS_OBJTYPE_DEFAULT 0x80 + +/* common_set */ +#define NDIS_OFFLOAD_SET_NOCHG 0 +#define NDIS_OFFLOAD_SET_ON 1 +#define NDIS_OFFLOAD_SET_OFF 2 + +/* a.k.a GRE MAC */ +#define NDIS_ENCAP_TYPE_NVGRE 0x00000001 + +struct ndis_object_hdr { + uint8_t ndis_type; /* NDIS_OBJTYPE_ */ + uint8_t ndis_rev; /* type specific */ + uint16_t ndis_size; /* incl. this hdr */ +}; + +/* OID_TCP_OFFLOAD_PARAMETERS */ +struct ndis_offload_params { + struct ndis_object_hdr ndis_hdr; + uint8_t ndis_ip4csum; /* param_set */ + uint8_t ndis_tcp4csum; /* param_set */ + uint8_t ndis_udp4csum; /* param_set */ + uint8_t ndis_tcp6csum; /* param_set */ + uint8_t ndis_udp6csum; /* param_set */ + uint8_t ndis_lsov1; /* lsov1_set */ + uint8_t ndis_ipsecv1; /* ipsecv1_set */ + uint8_t ndis_lsov2_ip4; /* lsov2_set */ + uint8_t ndis_lsov2_ip6; /* lsov2_set */ + uint8_t ndis_tcp4conn; /* PARAM_NOCHG */ + uint8_t ndis_tcp6conn; /* PARAM_NOCHG */ + uint32_t ndis_flags; /* 0 */ + /* NDIS >= 6.1 */ + uint8_t ndis_ipsecv2; /* ipsecv2_set */ + uint8_t ndis_ipsecv2_ip4; /* ipsecv2_set */ + /* NDIS >= 6.30 */ + uint8_t ndis_rsc_ip4; /* rsc_set */ + uint8_t ndis_rsc_ip6; /* rsc_set */ + uint8_t ndis_encap; /* common_set */ + uint8_t ndis_encap_types; /* NDIS_ENCAP_TYPE_ */ +}; + +#define NDIS_OFFLOAD_PARAMS_SIZE sizeof(struct ndis_offload_params) +#define NDIS_OFFLOAD_PARAMS_SIZE_6_1 \ + __offsetof(struct ndis_offload_params, ndis_rsc_ip4) + +#define NDIS_OFFLOAD_PARAMS_REV_2 2 /* NDIS 6.1 */ +#define NDIS_OFFLOAD_PARAMS_REV_3 3 /* NDIS 6.30 */ + +/* param_set */ +#define NDIS_OFFLOAD_PARAM_NOCHG 0 /* common to all sets */ +#define NDIS_OFFLOAD_PARAM_OFF 1 +#define NDIS_OFFLOAD_PARAM_TX 2 +#define NDIS_OFFLOAD_PARAM_RX 3 +#define NDIS_OFFLOAD_PARAM_TXRX 4 + +/* lsov1_set */ +/* NDIS_OFFLOAD_PARAM_NOCHG */ +#define NDIS_OFFLOAD_LSOV1_OFF 1 +#define NDIS_OFFLOAD_LSOV1_ON 2 + +/* ipsecv1_set */ +/* NDIS_OFFLOAD_PARAM_NOCHG */ +#define NDIS_OFFLOAD_IPSECV1_OFF 1 +#define NDIS_OFFLOAD_IPSECV1_AH 2 +#define NDIS_OFFLOAD_IPSECV1_ESP 3 +#define NDIS_OFFLOAD_IPSECV1_AH_ESP 4 + +/* lsov2_set */ +/* NDIS_OFFLOAD_PARAM_NOCHG */ +#define NDIS_OFFLOAD_LSOV2_OFF 1 +#define NDIS_OFFLOAD_LSOV2_ON 2 + +/* ipsecv2_set */ +/* NDIS_OFFLOAD_PARAM_NOCHG */ +#define NDIS_OFFLOAD_IPSECV2_OFF 1 +#define NDIS_OFFLOAD_IPSECV2_AH 2 +#define NDIS_OFFLOAD_IPSECV2_ESP 3 +#define NDIS_OFFLOAD_IPSECV2_AH_ESP 4 + +/* rsc_set */ +/* NDIS_OFFLOAD_PARAM_NOCHG */ +#define NDIS_OFFLOAD_RSC_OFF 1 +#define NDIS_OFFLOAD_RSC_ON 2 + +#endif /* !_NET_NDIS_H_ */ Modified: head/sys/net/rndis.h ============================================================================== --- head/sys/net/rndis.h Fri Aug 26 05:15:08 2016 (r304833) +++ head/sys/net/rndis.h Fri Aug 26 05:18:27 2016 (r304834) @@ -202,6 +202,10 @@ struct rndis_set_req { uint32_t rm_devicevchdl; }; +#define RNDIS_SET_REQ_INFOBUFOFFSET \ + (sizeof(struct rndis_set_req) - \ + __offsetof(struct rndis_set_req, rm_rid)) + struct rndis_set_comp { uint32_t rm_type; uint32_t rm_len; From owner-svn-src-head@freebsd.org Fri Aug 26 06:16:56 2016 Return-Path: Delivered-To: svn-src-head@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 CBEA1BC6A05; Fri, 26 Aug 2016 06:16:56 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id BCDC41A43; Fri, 26 Aug 2016 06:16:56 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 92D6317AC8; Thu, 25 Aug 2016 23:16:55 -0700 (PDT) Date: Thu, 25 Aug 2016 23:16:55 -0700 From: hiren panchasara To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303656 - head/sys/netinet Message-ID: <20160826061655.GM41576@strugglingcoder.info> References: <201608020636.u726alY8000175@repo.freebsd.org> <20160825175429.GD41576@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="D9sZ58tf58331Q5M" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 06:16:56 -0000 --D9sZ58tf58331Q5M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/26/16 at 09:23P, Sepherosa Ziehau wrote: > On Fri, Aug 26, 2016 at 1:54 AM, hiren panchasara > wrote: > > On 08/02/16 at 06:36P, Sepherosa Ziehau wrote: > >> Author: sephe > >> Date: Tue Aug 2 06:36:47 2016 > >> New Revision: 303656 > >> URL: https://svnweb.freebsd.org/changeset/base/303656 > >> > >> Log: > >> tcp/lro: Implement hash table for LRO entries. > >> > >> This significantly improves HTTP workload performance and reduces > >> HTTP workload latency. > >> > >> Reviewed by: rrs, gallatin, hps > >> Obtained from: rrs, gallatin > >> Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe) > >> Differential Revision: https://reviews.freebsd.org/D6689 > > > > Hi Sephe, > > > > Can you please MFC this to stable/11? >=20 > I don't think this one can be MFC'ed, since it changes the size of LRO > control struct, which is usually embedded in the driver's softc/RX > ring struct. Ah, okay. Thanks for checking. Cheers, Hiren --D9sZ58tf58331Q5M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXv97UXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lqjkIAJmrYiZYBdZHM+SEIX7btkt8 yuOV7uh2d+MxvwEx9YpWcsXzzVuWTh04ieWAIJgrv0LbDgcYZMSyK0YgaRuWRc+8 KrqrZ3p1Wl0EmESMDs4lXXuGrK5JYrYBUZVkalA+htvd7QNTjs2Zu6nSH9GTo8EC /eIKuTR14YFrhRv3aADCzENVyVdnh7R6ZTQwQJK9ajRygeFB/mBL+qpgqlfjqqU3 Nam+r2Al5NoGvUcl4cmTfpxiF8PmX4tq7VnFQdHO/CyrDcS85XC8Dashx0/pfMvF ZS91paVD8tFEZVNHd+Gg7jRZe2yDfz0nBGyKW0+ecOaPOte2NCCt+Lw9c4kqOVg= =qO2t -----END PGP SIGNATURE----- --D9sZ58tf58331Q5M-- From owner-svn-src-head@freebsd.org Fri Aug 26 07:37:13 2016 Return-Path: Delivered-To: svn-src-head@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 BB71BA937FA for ; Fri, 26 Aug 2016 07:37:13 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x235.google.com (mail-yb0-x235.google.com [IPv6:2607:f8b0:4002:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ADE5D92 for ; Fri, 26 Aug 2016 07:37:12 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x235.google.com with SMTP id h3so3402792ybi.2 for ; Fri, 26 Aug 2016 00:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=p4b5S8aRlgLl3B8VcElxYykp04vJgghGVxm+1/eYQoo=; b=Pk6p/ygLQOmGJHYXk7rLXbwqCL/xn8yl8xDX6usOy+AFwrzigI1FuNKaJDyzsJbuv+ rnLYzFpmHazO0alkQ0Uw/HApGIlxTGxwVtgocIieghT2OFErYP3wimVYtPrVpZT739Zc HliT0qtDubQALqALBGTuPFgoRiDw4C+dgmxaI5uAQFOMYn21ahbXOfJmz1XuS8tMYGkj Zx5xWH9TN4QfVOmyu5eFPCm+sSQtgF5V229ZxCAE+B/ZipYNGobDtpx8KmO86JRMaF1j meuGbRhLxwoVS1VqgD2GoWgOiV5mMGh4VJUtgwdGtZpsRq+DclClbTC2FbSRyMX11aQC i8RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=p4b5S8aRlgLl3B8VcElxYykp04vJgghGVxm+1/eYQoo=; b=j9Xu55+IHUDsaZZqML4dogRUPkdCEkpjWZUqd/c8jJ2A6zh3oiu58a22MoXS4myuYI yMBbE/2niKPKRqwRNxeZUIHCG2tSLlSbmYhDyo0nKIevHfLPs1YTQ2CcLQlU5Z09Hnef Y8R5vvCvMlnMpgmTHW/ZyOqx7+VP4mcKv/QTKqH6zFp2N4cDG5+8uQZWWsgWOyLFm1Q+ RT51/yDKQgExsqWVO3ujwgPnb+a/iKBMQScdgjOHCkMt+ZGA88BuXGF3aGgsVp6qoY+N xnsR0Sj4hw2NhxU41BC9fHxW9DsDK0Xa1zAfIp521eP+Lxwexmb6HsiDJ24cnVFrFjQu Yaiw== X-Gm-Message-State: AE9vXwPKLrun4rpBvRQxr/dlcq/0BbD5jQpwoHeW/qmfQ8fi6UYFXkeajL0cH7QnQ1K8lfX4d772doEVXB+IhA== X-Received: by 10.37.123.195 with SMTP id w186mr1480628ybc.186.1472197031861; Fri, 26 Aug 2016 00:37:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Fri, 26 Aug 2016 00:37:10 -0700 (PDT) In-Reply-To: <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> From: Ed Schouten Date: Fri, 26 Aug 2016 09:37:10 +0200 Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Content-Type: multipart/mixed; boundary=001a114e5b721fea15053af495da X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 07:37:13 -0000 --001a114e5b721fea15053af495da Content-Type: text/plain; charset=UTF-8 Hi, 2016-08-26 1:52 GMT+02:00 Bryan Drewery : > Libc wouldn't build, it complained quite loudly with a lot of these: Got it. Thinking ahead, if it's just basename() giving the problems, maybe it's easier to just go ahead and bump the symver of basename() as well? I'm planning on replacing it anyway to be in sync with the new basename() anyway. Attached is a new patch. Be sure to let me know whether that works for you. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 --001a114e5b721fea15053af495da Content-Type: text/plain; charset=US-ASCII; name="basename-dirname.txt" Content-Disposition: attachment; filename="basename-dirname.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_isbg3kid1 SW5kZXg6IGluY2x1ZGUvbGliZ2VuLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaW5jbHVkZS9saWJnZW4uaAko cmV2aXNpb24gMzA0NzUwKQorKysgaW5jbHVkZS9saWJnZW4uaAkod29ya2luZyBjb3B5KQpAQCAt MzksNCArMzksMjYgQEAKIGNoYXIJKmRpcm5hbWUoY2hhciAqKTsKIF9fRU5EX0RFQ0xTCiAKKy8q CisgKiBJbiBGcmVlQlNEIDEyLCB0aGUgcHJvdG90eXBlIG9mIGJhc2VuYW1lKCkgYW5kIGRpcm5h bWUoKSB3YXMgbW9kaWZpZWQKKyAqIHRvIGNvbXBseSB0byBQT1NJWC4gVGhlc2UgZnVuY3Rpb25z IG1heSBub3cgbW9kaWZ5IHRoZWlyIGlucHV0LgorICogVW5mb3J0dW5hdGVseSwgb3VyIGNvcHkg b2YgeGluc3RhbGwoOCkgc2hpcHBlZCB3aXRoIHByZXZpb3VzIHZlcnNpb25zCisgKiBvZiBGcmVl QlNEIGlzIGJ1aWx0IHVzaW5nIHRoZSBob3N0IGhlYWRlcnMgYW5kIGxpYmMgZHVyaW5nIHRoZQor ICogYm9vdHN0cmFwcGluZyBwaGFzZSBhbmQgZGVwZW5kcyBvbiB0aGUgb2xkIGJlaGF2aW9yLgor ICoKKyAqIEFwcGx5IGEgd29ya2Fyb3VuZCB3aGVyZSB3ZSBleHBsaWNpdGx5IGxpbmsgYWdhaW5z dCBiYXNlbmFtZUBGQlNEXzEuMAorICogYW5kIGRpcm5hbWVARkJTRF8xLjAgaW4gY2FzZSB0aGVz ZSBmdW5jdGlvbnMgYXJlIGNhbGxlZCBvbiBjb25zdGFudAorICogc3RyaW5ncywgaW5zdGVhZCBv ZiBtYWtpbmcgdGhlIGJ1aWxkIGZhaWwuCisgKi8KKyNpZiBkZWZpbmVkKF9fZ2VuZXJpYykgJiYg IWRlZmluZWQoX19jcGx1c3BsdXMpCitfX0JFR0lOX0RFQ0xTCitjaGFyCSpfX29sZF9iYXNlbmFt ZShjb25zdCBjaGFyICopOworY2hhcgkqX19vbGRfZGlybmFtZShjb25zdCBjaGFyICopOworX19F TkRfREVDTFMKK19fc3ltX2NvbXBhdChiYXNlbmFtZSwgX19vbGRfYmFzZW5hbWUsIEZCU0RfMS4w KTsKK19fc3ltX2NvbXBhdChkaXJuYW1lLCBfX29sZF9kaXJuYW1lLCBGQlNEXzEuMCk7CisjZGVm aW5lCWJhc2VuYW1lKHgpCV9fZ2VuZXJpYyh4LCBjb25zdCBjaGFyICosIF9fb2xkX2Jhc2VuYW1l LCBiYXNlbmFtZSkoeCkKKyNkZWZpbmUJZGlybmFtZSh4KQlfX2dlbmVyaWMoeCwgY29uc3QgY2hh ciAqLCBfX29sZF9kaXJuYW1lLCBkaXJuYW1lKSh4KQorI2VuZGlmCisKICNlbmRpZiAvKiAhX0xJ QkdFTl9IXyAqLwpJbmRleDogbGliL2xpYmMvZ2VuL1N5bWJvbC5tYXAKPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g bGliL2xpYmMvZ2VuL1N5bWJvbC5tYXAJKHJldmlzaW9uIDMwNDc1MCkKKysrIGxpYi9saWJjL2dl bi9TeW1ib2wubWFwCSh3b3JraW5nIGNvcHkpCkBAIC02OCw3ICs2OCw2IEBACiAJYXJjNHJhbmRv bV9hZGRyYW5kb207CiAJYXJjNHJhbmRvbV9zdGlyOwogCV9fYXNzZXJ0OwotCWJhc2VuYW1lOwog CWNoZWNrX3V0aWxpdHlfY29tcGF0OwogCWNsb2NrOwogCWNsb3NlZGlyOwpAQCAtNDE4LDYgKzQx Nyw3IEBACiB9OwogCiBGQlNEXzEuNSB7CisJYmFzZW5hbWU7CiAJZGlybmFtZTsKIH07CiAKSW5k ZXg6IGxpYi9saWJjL2dlbi9iYXNlbmFtZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGxpYi9saWJjL2dlbi9i YXNlbmFtZS5jCShyZXZpc2lvbiAzMDQ3NTApCisrKyBsaWIvbGliYy9nZW4vYmFzZW5hbWUuYwko d29ya2luZyBjb3B5KQpAQCAtNjYsNyArNjYsNyBAQAogfQogCiBjaGFyICoKLWJhc2VuYW1lKGNo YXIgKnBhdGgpCitfX2ZyZWVic2QxMV9iYXNlbmFtZShjaGFyICpwYXRoKQogewogCXN0YXRpYyBj aGFyICpibmFtZSA9IE5VTEw7CiAKQEAgLTc3LDMgKzc3LDEzIEBACiAJfQogCXJldHVybiAoYmFz ZW5hbWVfcihwYXRoLCBibmFtZSkpOwogfQorCitfX3N5bV9jb21wYXQoYmFzZW5hbWUsIF9fZnJl ZWJzZDExX2Jhc2VuYW1lLCBGQlNEXzEuMCk7CisKK2NoYXIgKgorKGJhc2VuYW1lKShjaGFyICpw YXRoKQoreworCisJLyogVE9ETyhlZCk6IFJlcGxhY2UgdGhpcyBieSBhIHRocmVhZC1zYWZlIHZl cnNpb24sIGxpa2UgZGlybmFtZSgzKS4gKi8KKwlyZXR1cm4gKF9fZnJlZWJzZDExX2Jhc2VuYW1l KHBhdGgpKTsKK30KSW5kZXg6IGxpYi9saWJjL2dlbi9kaXJuYW1lLmMKPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g bGliL2xpYmMvZ2VuL2Rpcm5hbWUuYwkocmV2aXNpb24gMzA0NzUwKQorKysgbGliL2xpYmMvZ2Vu L2Rpcm5hbWUuYwkod29ya2luZyBjb3B5KQpAQCAtMzEsNyArMzEsNyBAQAogI2luY2x1ZGUgPHN0 cmluZy5oPgogCiBjaGFyICoKLWRpcm5hbWUoY2hhciAqcGF0aCkKKyhkaXJuYW1lKShjaGFyICpw YXRoKQogewogCWNvbnN0IGNoYXIgKmluLCAqcHJldiwgKmJlZ2luLCAqZW5kOwogCWNoYXIgKm91 dDsK --001a114e5b721fea15053af495da-- From owner-svn-src-head@freebsd.org Fri Aug 26 07:49:24 2016 Return-Path: Delivered-To: svn-src-head@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 B4377A93B55; Fri, 26 Aug 2016 07:49:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8481E6CB; Fri, 26 Aug 2016 07:49:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q7nNL1096551; Fri, 26 Aug 2016 07:49:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q7nNPA096550; Fri, 26 Aug 2016 07:49:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608260749.u7Q7nNPA096550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 26 Aug 2016 07:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304837 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 07:49:24 -0000 Author: tuexen Date: Fri Aug 26 07:49:23 2016 New Revision: 304837 URL: https://svnweb.freebsd.org/changeset/base/304837 Log: Fix a bug, where no SACK is sent when receiving a FORWARD-TSN or I-FORWARD-TSN chunk before any DATA or I-DATA chunk. Thanks to Julian Cordes for finding this problem and prividing packetdrill scripts to reporduce the issue. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Aug 26 06:19:12 2016 (r304836) +++ head/sys/netinet/sctp_input.c Fri Aug 26 07:49:23 2016 (r304837) @@ -5515,6 +5515,11 @@ process_control_chunks: *offset = length; return (NULL); } + /* + * For sending a SACK this looks like DATA + * chunks. + */ + stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; sctp_handle_forward_tsn(stcb, (struct sctp_forward_tsn_chunk *)ch, &abort_flag, m, *offset); if (abort_flag) { From owner-svn-src-head@freebsd.org Fri Aug 26 08:25:29 2016 Return-Path: Delivered-To: svn-src-head@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 4DD15A9380D; Fri, 26 Aug 2016 08:25:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFDE7DC; Fri, 26 Aug 2016 08:25:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q8PSgF011441; Fri, 26 Aug 2016 08:25:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q8PSI2011440; Fri, 26 Aug 2016 08:25:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608260825.u7Q8PSI2011440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 26 Aug 2016 08:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304838 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 08:25:29 -0000 Author: np Date: Fri Aug 26 08:25:28 2016 New Revision: 304838 URL: https://svnweb.freebsd.org/changeset/base/304838 Log: Do not free an uninitialized pointer on soaccept failure in the iWARP connection manager. Sponsored by: Chelsio Communications Modified: head/sys/ofed/drivers/infiniband/core/iwcm.c Modified: head/sys/ofed/drivers/infiniband/core/iwcm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/iwcm.c Fri Aug 26 07:49:23 2016 (r304837) +++ head/sys/ofed/drivers/infiniband/core/iwcm.c Fri Aug 26 08:25:28 2016 (r304838) @@ -438,6 +438,7 @@ dequeue_socket(struct socket *head) so->so_state |= SS_NBIO; SOCK_UNLOCK(so); ACCEPT_UNLOCK(); + remote = NULL; soaccept(so, (struct sockaddr **)&remote); free(remote, M_SONAME); From owner-svn-src-head@freebsd.org Fri Aug 26 14:49:36 2016 Return-Path: Delivered-To: svn-src-head@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 8BC41B71DD0; Fri, 26 Aug 2016 14:49:36 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 4A6EE8B; Fri, 26 Aug 2016 14:49:36 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bdIRi-0006mC-4t; Fri, 26 Aug 2016 17:49:26 +0300 Date: Fri, 26 Aug 2016 17:49:26 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160826144926.GE88122@zxy.spb.ru> References: <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160821000400.GY8192@zxy.spb.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 14:49:36 -0000 On Sun, Aug 21, 2016 at 03:04:00AM +0300, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: > > > On 20/08/16 23:05, Slawa Olhovchenkov wrote: > > > I am think this substitution is very bad idea (by design). > > > Also, on transmit side this is must be irrelevant on received L2 > > > header (and this in many cases this is will be L2 unicast packet). For > > > other cases packet will be created on host and don't have any received > > > information. > > > > > > > Whilst I agree with your concerns about multipoint, I support the > > motivation behind Ryan's original change: optimize the common case. > > Oh, common case... > I am have pmc profiling for TCP output and see on this SVG picture and > don't find any simple way. > You want to watch too? At time peak network traffic (more then 25K connections, about 20Gbit total traffic) half of cores fully utilised by network stack. This is flamegraph from one core: http://zxy.spb.ru/cpu10.svg This is same, but stack cut of at ixgbe_rxeof for more unified tcp/ip stack view http://zxy.spb.ru/cpu10u.svg Top 3 used lines is: 7036 0xffffffff804bf02d atomic_cmpset_long /usr/obj/usr/src/sys/VSTREAM/./machine/atomic.h:163 static __inline int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src) { u_char res; __asm __volatile( " " MPLOCKED " " > " cmpxchgq %3,%1 ; " " sete %0 ; " "# atomic_cmpset_long" : "=q" (res), /* 0 */ "+m" (*dst), /* 1 */ "+a" (expect) /* 2 */ : "r" (src) /* 3 */ : "memory", "cc"); return (res); } 6099 0xffffffff81171963 ?? ??:0 0xffffffff81171940 : mov 0x10(%r15),%rax 0xffffffff81171944 : add $0x8,%rax 0xffffffff81171948 : mov -0x4c(%rbp),%ecx 0xffffffff8117194b : test %cx,%cx 0xffffffff8117194e : mov %rax,0x10(%r15) 0xffffffff81171952 : je 0xffffffff8117198d 0xffffffff81171954 : mov 0x10(%rdi),%rcx 0xffffffff81171958 : mov -0x4c(%rbp),%edx 0xffffffff8117195b : nopl 0x0(%rax,%rax,1) 0xffffffff81171960 : mov (%rcx),%rsi 0xffffffff81171963 : mov %rsi,(%rax) 0xffffffff81171966 : mov 0x8(%rcx),%rsi 0xffffffff8117196a : mov %rsi,0x8(%rax) 0xffffffff8117196e : mov 0x10(%rcx),%rsi 0xffffffff81171972 : mov %rsi,0x10(%rax) 0xffffffff81171976 : mov 0x18(%rcx),%rsi 0xffffffff8117197a : mov %rsi,0x18(%rax) 0xffffffff8117197e : add $0xffffffffffffffe0,%edx 0xffffffff81171981 : add $0x20,%rcx 0xffffffff81171985 : add $0x20,%rax 0xffffffff81171989 : test %edx,%edx 5594 0xffffffff8053395a mb_free_ext /usr/src/sys/kern/uipc_mbuf.c:301 if (*(m->m_ext.ref_cnt) == 1 || I am able collect and process more measure for help to improve FreeBSD network stack. Do you have some idea about this? I am don't see evident and simple points of optimisation :( From owner-svn-src-head@freebsd.org Fri Aug 26 14:58:58 2016 Return-Path: Delivered-To: svn-src-head@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 759EBB700C8; Fri, 26 Aug 2016 14:58:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4886FA46; Fri, 26 Aug 2016 14:58:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QEwv06057260; Fri, 26 Aug 2016 14:58:57 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QEwvL6057259; Fri, 26 Aug 2016 14:58:57 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608261458.u7QEwvL6057259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 26 Aug 2016 14:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304850 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 14:58:58 -0000 Author: tsoome Date: Fri Aug 26 14:58:57 2016 New Revision: 304850 URL: https://svnweb.freebsd.org/changeset/base/304850 Log: Unused variables and cstyle fix for loader dosfs Reviewed by: imp, allanjude Approved by: imp (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7659 Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Fri Aug 26 13:59:21 2016 (r304849) +++ head/lib/libstand/dosfs.c Fri Aug 26 14:58:57 2016 (r304850) @@ -439,7 +439,7 @@ dos_readdir(struct open_file *fd, struct u_char fn[261]; DOS_DIR dd; size_t res; - u_int chk, i, x, xdn; + u_int chk, x, xdn; int err; x = chk = 0; @@ -598,7 +598,7 @@ lookup(DOS_FS *fs, u_int clus, const cha u_char lfn[261]; u_char sfn[13]; u_int nsec, lsec, xdn, chk, sec, ent, x; - int err, ok, i; + int err, ok; if (!clus) for (ent = 0; ent < 2; ent++) @@ -774,11 +774,11 @@ fatget(DOS_FS *fs, u_int *c) int err = 0; if (fat.unit != dd->d_unit) { - /* fat cache was changed to another device, dont use it */ + /* fat cache was changed to another device, don't use it */ err = ioread(fs, secbyt(fs->lsnfat) + fatoff(fs->fatsz, *c), buf, fs->fatsz != 32 ? 2 : 4); if (err) - return err; + return (err); } else { offset = fatoff(fs->fatsz, *c); nbyte = fs->fatsz != 32 ? 2 : 4; From owner-svn-src-head@freebsd.org Fri Aug 26 15:08:00 2016 Return-Path: Delivered-To: svn-src-head@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 E8216B7044B; Fri, 26 Aug 2016 15:08:00 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 A9D441E4; Fri, 26 Aug 2016 15:08:00 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E598020658; Fri, 26 Aug 2016 11:01:24 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 26 Aug 2016 11:01:26 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=EScbBIOR5Q4O+jvbs5waVB75F1o=; b=mVBKIx K601n+EBfCdigX9vRfSb859AtfBpllOKPEzNf2WdK7JbaErVa2gwHUKWsagz9IP7 jnrJb1LiwGhh0rKgImvSEXmY4ZMr72fnsZPjYpJm+5A8st/dfT1XFR3YobKIgOR3 xDl7KwfyhcJYe8TBgdg2ZNh3nQU4gBDyoBrug= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=EScbBIOR5Q4O+jv bs5waVB75F1o=; b=nkW05rvEX1aoGdfLG7xbfgyeExHPi1ojsJy12UI2UNxaE+K dWo9QNvPHaZ3bWtThIRi6f2e0Z/v6XuKYvLJpU7kOrCSmxdcILZoZvrIuSxGvdYn JonWnG4vQoem5NmbYnX4/FqpgRKBY4ETedcCcCJ+NsSbdUsalanIwMb9Zl1w= X-Sasl-enc: Ow/aoGNKGWugFkLtbC2N4V+kudrAeF9z0gpjaPJ9ORz0 1472223684 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id BE0A2F29D0; Fri, 26 Aug 2016 11:01:23 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> Date: Fri, 26 Aug 2016 16:01:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160826144926.GE88122@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 15:08:01 -0000 Slawa, I'm afraid this may be a bit of a non-sequitur. Sorry.. I seem to be missing something. As I understand it this thread is about Ryan's change to netinet for broadcast. On 26/08/16 15:49, Slawa Olhovchenkov wrote: > On Sun, Aug 21, 2016 at 03:04:00AM +0300, Slawa Olhovchenkov wrote: >> On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: >>> Whilst I agree with your concerns about multipoint, I support the >>> motivation behind Ryan's original change: optimize the common case. >> >> Oh, common case... >> I am have pmc profiling for TCP output and see on this SVG picture and >> don't find any simple way. >> You want to watch too? > > At time peak network traffic (more then 25K connections, about 20Gbit > total traffic) half of cores fully utilised by network stack. > > This is flamegraph from one core: http://zxy.spb.ru/cpu10.svg > This is same, but stack cut of at ixgbe_rxeof for more unified > tcp/ip stack view http://zxy.spb.ru/cpu10u.svg ... I appreciate that you've taken the time to post a flamegraph (a fashionable visualization) of relative performance in the FreeBSD networking stack. Sadly, I am mostly out of my depth for looking at stack wide performance for the moment; for the things I look at involving FreeBSD at work just at the moment, I would not generally go down there except for specific performance issues (e.g. with IEEE 1588). It sounds as though perhaps you should raise a wider discussion about your results on -net. I would caution you however that the Function Boundary Trace (FBT) provider for DTrace can introduce a fair amount of noise to the raw performance data because of the trap mechanism it uses. This ruled it out for one of my own studies requiring packet-level accuracy. Whilst raw pmc(4) profiles may require more post-processing, they will provide less equivocal data (and a better fix) on the hot path, due also to being sampled effectively on a PMC interrupt (a gather stage- poll core+uncore MSRs), not purely a software timer interrupt. thanks Bruce From owner-svn-src-head@freebsd.org Fri Aug 26 15:13:27 2016 Return-Path: Delivered-To: svn-src-head@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 46452B706F6; Fri, 26 Aug 2016 15:13:27 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 049E1892; Fri, 26 Aug 2016 15:13:27 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bdIou-0007Ni-Jw; Fri, 26 Aug 2016 18:13:24 +0300 Date: Fri, 26 Aug 2016 18:13:24 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160826151324.GF88122@zxy.spb.ru> References: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 15:13:27 -0000 On Fri, Aug 26, 2016 at 04:01:14PM +0100, Bruce Simpson wrote: > Slawa, > > I'm afraid this may be a bit of a non-sequitur. Sorry.. I seem to be > missing something. As I understand it this thread is about Ryan's change > to netinet for broadcast. > > On 26/08/16 15:49, Slawa Olhovchenkov wrote: > > On Sun, Aug 21, 2016 at 03:04:00AM +0300, Slawa Olhovchenkov wrote: > >> On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: > >>> Whilst I agree with your concerns about multipoint, I support the > >>> motivation behind Ryan's original change: optimize the common case. > >> > >> Oh, common case... > >> I am have pmc profiling for TCP output and see on this SVG picture and > >> don't find any simple way. > >> You want to watch too? > > > > At time peak network traffic (more then 25K connections, about 20Gbit > > total traffic) half of cores fully utilised by network stack. > > > > This is flamegraph from one core: http://zxy.spb.ru/cpu10.svg > > This is same, but stack cut of at ixgbe_rxeof for more unified > > tcp/ip stack view http://zxy.spb.ru/cpu10u.svg > ... > > I appreciate that you've taken the time to post a flamegraph (a > fashionable visualization) of relative performance in the FreeBSD > networking stack. > > Sadly, I am mostly out of my depth for looking at stack wide performance > for the moment; for the things I look at involving FreeBSD at work just > at the moment, I would not generally go down there except for specific > performance issues (e.g. with IEEE 1588). > > It sounds as though perhaps you should raise a wider discussion about > your results on -net. I would caution you however that the Function > Boundary Trace (FBT) provider for DTrace can introduce a fair amount of > noise to the raw performance data because of the trap mechanism it uses. > This ruled it out for one of my own studies requiring packet-level accuracy. > > Whilst raw pmc(4) profiles may require more post-processing, they will > provide less equivocal data (and a better fix) on the hot path, due also > to being sampled effectively on a PMC interrupt (a gather stage- poll > core+uncore MSRs), not purely a software timer interrupt. Thanks for answer, I am now try to start discussion on -net. From owner-svn-src-head@freebsd.org Fri Aug 26 16:31:57 2016 Return-Path: Delivered-To: svn-src-head@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 DF657B74CF3; Fri, 26 Aug 2016 16:31:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B263E9E5; Fri, 26 Aug 2016 16:31:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A63E811E3; Fri, 26 Aug 2016 16:31:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6D90E23151; Fri, 26 Aug 2016 16:31:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id QZ9JZfCHsWsC; Fri, 26 Aug 2016 16:31:54 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DB6FB23149 To: Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <05528463-fcc5-4492-acdd-e56e352fb62f@FreeBSD.org> Date: Fri, 26 Aug 2016 09:31:55 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pDnkOlSgV4XlGLHwhRijMiqAn4sUENurD" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 16:31:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pDnkOlSgV4XlGLHwhRijMiqAn4sUENurD Content-Type: multipart/mixed; boundary="GOtKa2kPDtT5bgw330sOTckhICWgcbBVH" From: Bryan Drewery To: Ed Schouten Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <05528463-fcc5-4492-acdd-e56e352fb62f@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> In-Reply-To: --GOtKa2kPDtT5bgw330sOTckhICWgcbBVH Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/26/2016 12:37 AM, Ed Schouten wrote: > Hi, >=20 > 2016-08-26 1:52 GMT+02:00 Bryan Drewery : >> Libc wouldn't build, it complained quite loudly with a lot of these: > Got it. Thinking ahead, if it's just basename() giving the problems, > maybe it's easier to just go ahead and bump the symver of basename() > as well? I'm planning on replacing it anyway to be in sync with the > new basename() anyway. Attached is a new patch. Be sure to let me know > whether that works for you. This passes my tests. --=20 Regards, Bryan Drewery --GOtKa2kPDtT5bgw330sOTckhICWgcbBVH-- --pDnkOlSgV4XlGLHwhRijMiqAn4sUENurD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXwG77AAoJEDXXcbtuRpfP1+AIAOBr1ec0oH5mpngFB4D8oYQQ sHg8etHfFQdxSYiyB0VF1o2kGBSk2S5lYJQndGSQU6LfVoaVdnj+lf8cNfJEk+G7 MBq3gY/LacpDuAZCGwX3f2CU9/XzpIMMu+IwdOPJFZoARv4JFjbPZonxftG+yqx2 jpz5OpvmLnw/PB24J8fTR2OKZmi5UlWk5kfmrYOCsiJPiGUud64S63sOprbuGGgb 6929r9e7WgJ8t52nt/j+DQpoiOQfLZ6qZVa20Cb5e+5RdNovjL4HNVibddzjxGhO cBCaBjqB/DmV7DPg0Jxt5FdvLnoNovJyCv4aNHz8+lkd2qv3T9/Rrrx0kH12XKE= =LSEH -----END PGP SIGNATURE----- --pDnkOlSgV4XlGLHwhRijMiqAn4sUENurD-- From owner-svn-src-head@freebsd.org Fri Aug 26 17:38:14 2016 Return-Path: Delivered-To: svn-src-head@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 A2EE4B75C65; Fri, 26 Aug 2016 17:38:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D591DF5; Fri, 26 Aug 2016 17:38:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QHcDTB017672; Fri, 26 Aug 2016 17:38:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QHcDEG017667; Fri, 26 Aug 2016 17:38:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608261738.u7QHcDEG017667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 26 Aug 2016 17:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304854 - in head: contrib/ofed/libcxgb4/src sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 17:38:14 -0000 Author: np Date: Fri Aug 26 17:38:13 2016 New Revision: 304854 URL: https://svnweb.freebsd.org/changeset/base/304854 Log: cxgbe/iw_cxgbe: Various fixes to the iWARP driver. - Return appropriate error code instead of ENOMEM when sosend() fails in send_mpa_req. - Fix for problematic race during destroy_qp. - Abortive close in the failure of send_mpa_reject() instead of normal close. - Remove the unnecessary doorbell flowcontrol logic. Submitted by: Krishnamraju Eraparaju at Chelsio MFC after: 1 month Sponsored by: Chelsio communications Modified: head/contrib/ofed/libcxgb4/src/qp.c head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/iw_cxgbe/t4.h Modified: head/contrib/ofed/libcxgb4/src/qp.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/qp.c Fri Aug 26 17:32:51 2016 (r304853) +++ head/contrib/ofed/libcxgb4/src/qp.c Fri Aug 26 17:38:13 2016 (r304854) @@ -392,11 +392,9 @@ int c4iw_post_send(struct ibv_qp *ibqp, t4_sq_produce(&qhp->wq, len16); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); } - if (t4_wq_db_enabled(&qhp->wq)) { - t4_ring_sq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), - len16, wqe); - } else - ring_kernel_db(qhp, qhp->wq.sq.qid, idx); + + t4_ring_sq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), + len16, wqe); qhp->wq.sq.queue[qhp->wq.sq.size].status.host_wq_pidx = \ (qhp->wq.sq.wq_pidx); pthread_spin_unlock(&qhp->lock); @@ -458,11 +456,9 @@ int c4iw_post_receive(struct ibv_qp *ibq wr = wr->next; num_wrs--; } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_rq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), - len16, wqe); - else - ring_kernel_db(qhp, qhp->wq.rq.qid, idx); + + t4_ring_rq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), + len16, wqe); qhp->wq.rq.queue[qhp->wq.rq.size].status.host_wq_pidx = \ (qhp->wq.rq.wq_pidx); pthread_spin_unlock(&qhp->lock); Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Aug 26 17:32:51 2016 (r304853) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Aug 26 17:38:13 2016 (r304854) @@ -83,6 +83,8 @@ static void process_req(struct work_stru static void start_ep_timer(struct c4iw_ep *ep); static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); +static void process_timeout(struct c4iw_ep *ep); +static void process_timedout_eps(void); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); @@ -93,7 +95,7 @@ static int find_route(__be32 local_ip, _ static int close_socket(struct c4iw_ep_common *epc, int close); static int shutdown_socket(struct c4iw_ep_common *epc); static void abort_socket(struct c4iw_ep *ep); -static void send_mpa_req(struct c4iw_ep *ep); +static int send_mpa_req(struct c4iw_ep *ep); static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); static void close_complete_upcall(struct c4iw_ep *ep, int status); @@ -176,20 +178,91 @@ static void ref_qp(struct c4iw_ep *ep) c4iw_qp_add_ref(&ep->com.qp->ibqp); } +static void process_timeout(struct c4iw_ep *ep) +{ + struct c4iw_qp_attributes attrs; + int abort = 1; + + mutex_lock(&ep->com.mutex); + CTR4(KTR_IW_CXGBE, "%s ep :%p, tid:%u, state %d", __func__, + ep, ep->hwtid, ep->com.state); + set_bit(TIMEDOUT, &ep->com.history); + switch (ep->com.state) { + case MPA_REQ_SENT: + connect_reply_upcall(ep, -ETIMEDOUT); + break; + case MPA_REQ_WAIT: + case MPA_REQ_RCVD: + case MPA_REP_SENT: + case FPDU_MODE: + break; + case CLOSING: + case MORIBUND: + if (ep->com.cm_id && ep->com.qp) { + attrs.next_state = C4IW_QP_STATE_ERROR; + c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); + } + close_complete_upcall(ep, -ETIMEDOUT); + break; + case ABORTING: + case DEAD: + /* + * These states are expected if the ep timed out at the same + * time as another thread was calling stop_ep_timer(). + * So we silently do nothing for these states. + */ + abort = 0; + break; + default: + CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u\n" + , __func__, ep, ep->hwtid, ep->com.state); + abort = 0; + } + mutex_unlock(&ep->com.mutex); + if (abort) + c4iw_ep_disconnect(ep, 1, GFP_KERNEL); + c4iw_put_ep(&ep->com); + return; +} + +static void process_timedout_eps(void) +{ + struct c4iw_ep *ep; + + spin_lock(&timeout_lock); + while (!list_empty(&timeout_list)) { + struct list_head *tmp; + tmp = timeout_list.next; + list_del(tmp); + tmp->next = tmp->prev = NULL; + spin_unlock(&timeout_lock); + ep = list_entry(tmp, struct c4iw_ep, entry); + process_timeout(ep); + spin_lock(&timeout_lock); + } + spin_unlock(&timeout_lock); + return; +} + static void process_req(struct work_struct *ctx) { struct c4iw_ep_common *epc; + process_timedout_eps(); spin_lock(&req_lock); while (!TAILQ_EMPTY(&req_list)) { epc = TAILQ_FIRST(&req_list); TAILQ_REMOVE(&req_list, epc, entry); epc->entry.tqe_prev = NULL; spin_unlock(&req_lock); + CTR3(KTR_IW_CXGBE, "%s so :%p, ep:%p", __func__, + epc->so, epc); if (epc->so) process_socket_event((struct c4iw_ep *)epc); c4iw_put_ep(epc); + process_timedout_eps(); spin_lock(&req_lock); } spin_unlock(&req_lock); @@ -252,8 +325,17 @@ close_socket(struct c4iw_ep_common *epc, struct socket *so = epc->so; int rc; - CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s", __func__, epc, so, - states[epc->state]); + CTR5(KTR_IW_CXGBE, "%s:csoB so %p, ep %p, state %s, tid %d", __func__, + so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:cso1 so %p, ep %p, state %s, tid %d", + __func__, so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return -EINVAL; + } SOCK_LOCK(so); soupcall_clear(so, SO_RCV); @@ -265,6 +347,7 @@ close_socket(struct c4iw_ep_common *epc, rc = soshutdown(so, SHUT_WR | SHUT_RD); epc->so = NULL; + mutex_unlock(&epc->so_mutex); return (rc); } @@ -272,10 +355,23 @@ static int shutdown_socket(struct c4iw_ep_common *epc) { - CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s", __func__, epc->so, epc, - states[epc->state]); + struct socket *so = epc->so; + int rc; - return (soshutdown(epc->so, SHUT_WR)); + CTR5(KTR_IW_CXGBE, "%s:ssoB so %p, ep %p, state %s, tid %d", __func__, + epc->so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:sso1 so %p, ep %p, state %s, tid %d", + __func__, epc->so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return -EINVAL; + } + rc = soshutdown(so, SHUT_WR); + mutex_unlock(&epc->so_mutex); + return rc; } static void @@ -285,9 +381,9 @@ abort_socket(struct c4iw_ep *ep) int rc; struct linger l; - CTR4(KTR_IW_CXGBE, "%s ep %p so %p state %s", __func__, ep, ep->com.so, - states[ep->com.state]); - + CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, + ep->com.so, states[ep->com.state], ep->hwtid); + mutex_lock(&ep->com.so_mutex); l.l_onoff = 1; l.l_linger = 0; @@ -303,6 +399,7 @@ abort_socket(struct c4iw_ep *ep) log(LOG_ERR, "%s: can't set linger to 0, no RST! err %d\n", __func__, rc); } + mutex_unlock(&ep->com.so_mutex); } static void @@ -431,7 +528,8 @@ process_conn_error(struct c4iw_ep *ep) int ret; int state; - state = state_read(&ep->com); + mutex_lock(&ep->com.mutex); + state = ep->com.state; CTR5(KTR_IW_CXGBE, "%s:pceB ep %p so %p so->so_error %u state %s", __func__, ep, ep->com.so, ep->com.so->so_error, states[ep->com.state]); @@ -488,6 +586,7 @@ process_conn_error(struct c4iw_ep *ep) case DEAD: CTR2(KTR_IW_CXGBE, "%s so_error %d IN DEAD STATE!!!!", __func__, ep->com.so->so_error); + mutex_unlock(&ep->com.mutex); return; default: @@ -496,12 +595,18 @@ process_conn_error(struct c4iw_ep *ep) } if (state != ABORTING) { + if (ep->parent_ep) { + CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); + close_socket(&ep->com, 1); + } else { + CTR2(KTR_IW_CXGBE, "%s:pce2 %p", __func__, ep); + close_socket(&ep->com, 0); + } - CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 0); - state_set(&ep->com, DEAD); + __state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } + mutex_unlock(&ep->com.mutex); CTR2(KTR_IW_CXGBE, "%s:pceE %p", __func__, ep); return; } @@ -563,16 +668,19 @@ process_close_complete(struct c4iw_ep *e break; case DEAD: - default: CTR2(KTR_IW_CXGBE, "%s:pcc6 %p DEAD", __func__, ep); - panic("%s:pcc6 %p DEAD", __func__, ep); + break; + default: + CTR2(KTR_IW_CXGBE, "%s:pcc7 %p unknown ep state", + __func__, ep); + panic("%s:pcc6 %p unknown ep state", __func__, ep); break; } mutex_unlock(&ep->com.mutex); if (release) { - CTR2(KTR_IW_CXGBE, "%s:pcc7 %p", __func__, ep); + CTR2(KTR_IW_CXGBE, "%s:pcc8 %p", __func__, ep); c4iw_put_ep(&ep->com); } CTR2(KTR_IW_CXGBE, "%s:pccE %p", __func__, ep); @@ -587,6 +695,14 @@ init_sock(struct c4iw_ep_common *epc) struct socket *so = epc->so; int on = 1; + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:iso1 so %p, ep %p, state %s, tid %d", + __func__, so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return; + } SOCK_LOCK(so); soupcall_set(so, SO_RCV, c4iw_so_upcall, epc); so->so_state |= SS_NBIO; @@ -602,6 +718,7 @@ init_sock(struct c4iw_ep_common *epc) log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); } + mutex_unlock(&epc->so_mutex); } static void @@ -643,14 +760,20 @@ static void process_connected(struct c4iw_ep *ep) { - if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) - send_mpa_req(ep); + if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) { + if (send_mpa_req(ep)) + goto err; + } else { connect_reply_upcall(ep, -ep->com.so->so_error); - close_socket(&ep->com, 0); - state_set(&ep->com, DEAD); - c4iw_put_ep(&ep->com); + goto err; } + return; +err: + close_socket(&ep->com, 0); + state_set(&ep->com, DEAD); + c4iw_put_ep(&ep->com); + return; } void @@ -660,6 +783,7 @@ process_newconn(struct iw_cm_id *parent_ struct sockaddr_in *local; struct sockaddr_in *remote; struct c4iw_ep *parent_ep = parent_cm_id->provider_data; + int ret = 0; if (!child_so) { CTR4(KTR_IW_CXGBE, @@ -703,7 +827,14 @@ process_newconn(struct iw_cm_id *parent_ START_EP_TIMER(child_ep); /* maybe the request has already been queued up on the socket... */ - process_mpa_request(child_ep); + ret = process_mpa_request(child_ep); + if (ret == 2) + /* ABORT */ + c4iw_ep_disconnect(child_ep, 1, GFP_KERNEL); + else if (ret == 1) + /* CLOSE */ + c4iw_ep_disconnect(child_ep, 0, GFP_KERNEL); + return; } @@ -762,7 +893,12 @@ process_socket_event(struct c4iw_ep *ep) /* peer close */ if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state <= CLOSING) { process_peer_close(ep); - return; + /* + * check whether socket disconnect event is pending before + * returning. Fallthrough if yes. + */ + if (!(so->so_state & SS_ISDISCONNECTED)) + return; } /* close complete */ @@ -777,10 +913,6 @@ process_socket_event(struct c4iw_ep *ep) SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); -int db_delay_usecs = 1; -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RWTUN, &db_delay_usecs, 0, - "Usecs to delay awaiting db fifo to drain"); - static int dack_mode = 0; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RWTUN, &dack_mode, 0, "Delayed ack mode (default = 0)"); @@ -837,10 +969,6 @@ static int snd_win = 128 * 1024; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RWTUN, &snd_win, 0, "TCP send window in bytes (default = 128KB)"); -int db_fc_threshold = 2000; -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_fc_threshold, CTLFLAG_RWTUN, &db_fc_threshold, 0, - "QP count/threshold that triggers automatic"); - static void start_ep_timer(struct c4iw_ep *ep) { @@ -910,6 +1038,7 @@ alloc_ep(int size, gfp_t gfp) kref_init(&epc->kref); mutex_init(&epc->mutex); + mutex_init(&epc->so_mutex); c4iw_init_wr_wait(&epc->wr_wait); return (epc); @@ -947,7 +1076,7 @@ static void release_ep_resources(struct CTR2(KTR_IW_CXGBE, "%s:rerE %p", __func__, ep); } -static void +static int send_mpa_req(struct c4iw_ep *ep) { int mpalen; @@ -955,7 +1084,7 @@ send_mpa_req(struct c4iw_ep *ep) struct mpa_v2_conn_params mpa_v2_params; struct mbuf *m; char mpa_rev_to_use = mpa_rev; - int err; + int err = 0; if (ep->retry_with_mpa_v1) mpa_rev_to_use = 1; @@ -965,9 +1094,10 @@ send_mpa_req(struct c4iw_ep *ep) mpa = malloc(mpalen, M_CXGBE, M_NOWAIT); if (mpa == NULL) { -failed: - connect_reply_upcall(ep, -ENOMEM); - return; + err = -ENOMEM; + CTR3(KTR_IW_CXGBE, "%s:smr1 ep: %p , error: %d", + __func__, ep, err); + goto err; } memset(mpa, 0, mpalen); @@ -1019,20 +1149,32 @@ failed: m = m_getm(NULL, mpalen, M_NOWAIT, MT_DATA); if (m == NULL) { + err = -ENOMEM; + CTR3(KTR_IW_CXGBE, "%s:smr2 ep: %p , error: %d", + __func__, ep, err); free(mpa, M_CXGBE); - goto failed; + goto err; } m_copyback(m, 0, mpalen, (void *)mpa); free(mpa, M_CXGBE); - err = sosend(ep->com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, - ep->com.thread); - if (err) - goto failed; + err = -sosend(ep->com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, + ep->com.thread); + if (err) { + CTR3(KTR_IW_CXGBE, "%s:smr3 ep: %p , error: %d", + __func__, ep, err); + goto err; + } START_EP_TIMER(ep); state_set(&ep->com, MPA_REQ_SENT); ep->mpa_attr.initiator = 1; + CTR3(KTR_IW_CXGBE, "%s:smrE %p, error: %d", __func__, ep, err); + return 0; +err: + connect_reply_upcall(ep, err); + CTR3(KTR_IW_CXGBE, "%s:smrE %p, error: %d", __func__, ep, err); + return err; } static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen) @@ -1283,10 +1425,11 @@ static void connect_reply_upcall(struct { struct iw_cm_event event; - CTR3(KTR_IW_CXGBE, "%s:cruB %p", __func__, ep, status); + CTR3(KTR_IW_CXGBE, "%s:cruB %p, status: %d", __func__, ep, status); memset(&event, 0, sizeof(event)); event.event = IW_CM_EVENT_CONNECT_REPLY; - event.status = (status ==-ECONNABORTED)?-ECONNRESET: status; + event.status = ((status == -ECONNABORTED) || (status == -EPIPE)) ? + -ECONNRESET : status; event.local_addr = ep->com.local_addr; event.remote_addr = ep->com.remote_addr; @@ -1636,6 +1779,7 @@ static int process_mpa_reply(struct c4iw CTR2(KTR_IW_CXGBE, "%s:pmrl %p", __func__, ep); printf("%s set_tcpinfo error\n", __func__); + err = -ECONNRESET; goto err; } @@ -1901,32 +2045,31 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i int err; struct c4iw_ep *ep = to_ep(cm_id); CTR2(KTR_IW_CXGBE, "%s:crcB %p", __func__, ep); - int disconnect = 0; + int abort = 0; - if (state_read(&ep->com) == DEAD) { + if ((state_read(&ep->com) == DEAD) || + (state_read(&ep->com) != MPA_REQ_RCVD)) { CTR2(KTR_IW_CXGBE, "%s:crc1 %p", __func__, ep); c4iw_put_ep(&ep->com); return -ECONNRESET; } set_bit(ULP_REJECT, &ep->com.history); - BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); if (mpa_rev == 0) { CTR2(KTR_IW_CXGBE, "%s:crc2 %p", __func__, ep); - disconnect = 2; + abort = 1; } else { CTR2(KTR_IW_CXGBE, "%s:crc3 %p", __func__, ep); - err = send_mpa_reject(ep, pdata, pdata_len); - err = soshutdown(ep->com.so, 3); + abort = send_mpa_reject(ep, pdata, pdata_len); } + stop_ep_timer(ep); + err = c4iw_ep_disconnect(ep, abort != 0, GFP_KERNEL); c4iw_put_ep(&ep->com); - if (disconnect) - err = c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); - CTR2(KTR_IW_CXGBE, "%s:crc4 %p", __func__, ep); + CTR3(KTR_IW_CXGBE, "%s:crc4 %p, err: %d", __func__, ep, err); return 0; } Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Aug 26 17:32:51 2016 (r304853) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Aug 26 17:38:13 2016 (r304854) @@ -131,10 +131,6 @@ struct c4iw_stats { struct c4iw_stat stag; struct c4iw_stat pbl; struct c4iw_stat rqt; - u64 db_full; - u64 db_empty; - u64 db_drop; - u64 db_state_transitions; }; struct c4iw_rdev { @@ -207,12 +203,6 @@ c4iw_wait_for_reply(struct c4iw_rdev *rd return (wr_waitp->ret); } -enum db_state { - NORMAL = 0, - FLOW_CONTROL = 1, - RECOVERY = 2 -}; - struct c4iw_dev { struct ib_device ibdev; struct c4iw_rdev rdev; @@ -222,8 +212,6 @@ struct c4iw_dev { struct idr mmidr; spinlock_t lock; struct dentry *debugfs_root; - enum db_state db_state; - int qpcnt; }; static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev) @@ -766,6 +754,7 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; + struct mutex so_mutex; }; struct c4iw_listen_ep { Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Aug 26 17:32:51 2016 (r304853) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Aug 26 17:38:13 2016 (r304854) @@ -64,8 +64,6 @@ struct cpl_set_tcb_rpl; #include "iw_cxgbe.h" #include "user.h" -extern int db_delay_usecs; -extern int db_fc_threshold; static void creds(struct toepcb *toep, size_t wrsize); @@ -689,8 +687,8 @@ int c4iw_post_send(struct ib_qp *ibqp, s t4_sq_produce(&qhp->wq, len16); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_sq_db(&qhp->wq, idx); + + t4_ring_sq_db(&qhp->wq, idx); spin_unlock_irqrestore(&qhp->lock, flag); return err; } @@ -751,8 +749,8 @@ int c4iw_post_receive(struct ib_qp *ibqp wr = wr->next; num_wrs--; } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_rq_db(&qhp->wq, idx); + + t4_ring_rq_db(&qhp->wq, idx); spin_unlock_irqrestore(&qhp->lock, flag); return err; } @@ -1392,14 +1390,6 @@ out: return ret; } -static int enable_qp_db(int id, void *p, void *data) -{ - struct c4iw_qp *qp = p; - - t4_enable_wq_db(&qp->wq); - return 0; -} - int c4iw_destroy_qp(struct ib_qp *ib_qp) { struct c4iw_dev *rhp; @@ -1420,13 +1410,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) spin_lock_irq(&rhp->lock); remove_handle_nolock(rhp, &rhp->qpidr, qhp->wq.sq.qid); - rhp->qpcnt--; - BUG_ON(rhp->qpcnt < 0); - if (rhp->qpcnt <= db_fc_threshold && rhp->db_state == FLOW_CONTROL) { - rhp->rdev.stats.db_state_transitions++; - rhp->db_state = NORMAL; - idr_for_each(&rhp->qpidr, enable_qp_db, NULL); - } spin_unlock_irq(&rhp->lock); atomic_dec(&qhp->refcnt); wait_event(qhp->wait, !atomic_read(&qhp->refcnt)); @@ -1442,14 +1425,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) return 0; } -static int disable_qp_db(int id, void *p, void *data) -{ - struct c4iw_qp *qp = p; - - t4_disable_wq_db(&qp->wq); - return 0; -} - struct ib_qp * c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs, struct ib_udata *udata) @@ -1539,13 +1514,6 @@ c4iw_create_qp(struct ib_pd *pd, struct atomic_set(&qhp->refcnt, 1); spin_lock_irq(&rhp->lock); - if (rhp->db_state != NORMAL) - t4_disable_wq_db(&qhp->wq); - if (++rhp->qpcnt > db_fc_threshold && rhp->db_state == NORMAL) { - rhp->rdev.stats.db_state_transitions++; - rhp->db_state = FLOW_CONTROL; - idr_for_each(&rhp->qpidr, disable_qp_db, NULL); - } ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid); spin_unlock_irq(&rhp->lock); if (ret) @@ -1679,15 +1647,6 @@ int c4iw_ib_modify_qp(struct ib_qp *ibqp C4IW_QP_ATTR_ENABLE_RDMA_WRITE | C4IW_QP_ATTR_ENABLE_RDMA_BIND) : 0; - /* - * Use SQ_PSN and RQ_PSN to pass in IDX_INC values for - * ringing the queue db when we're in DB_FULL mode. - */ - attrs.sq_db_inc = attr->sq_psn; - attrs.rq_db_inc = attr->rq_psn; - mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0; - mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0; - return c4iw_modify_qp(rhp, qhp, mask, &attrs, 0); } Modified: head/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Aug 26 17:32:51 2016 (r304853) +++ head/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Aug 26 17:38:13 2016 (r304854) @@ -453,21 +453,6 @@ static inline void t4_set_wq_in_error(st wq->rq.queue[wq->rq.size].status.qp_err = 1; } -static inline void t4_disable_wq_db(struct t4_wq *wq) -{ - wq->rq.queue[wq->rq.size].status.db_off = 1; -} - -static inline void t4_enable_wq_db(struct t4_wq *wq) -{ - wq->rq.queue[wq->rq.size].status.db_off = 0; -} - -static inline int t4_wq_db_enabled(struct t4_wq *wq) -{ - return !wq->rq.queue[wq->rq.size].status.db_off; -} - struct t4_cq { struct t4_cqe *queue; bus_addr_t dma_addr; From owner-svn-src-head@freebsd.org Fri Aug 26 17:48:55 2016 Return-Path: Delivered-To: svn-src-head@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 DFF3BB75EA2; Fri, 26 Aug 2016 17:48:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B2E9F6C5; Fri, 26 Aug 2016 17:48:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QHmsK3021310; Fri, 26 Aug 2016 17:48:54 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QHmsS2021309; Fri, 26 Aug 2016 17:48:54 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201608261748.u7QHmsS2021309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 26 Aug 2016 17:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304855 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 17:48:56 -0000 Author: hiren Date: Fri Aug 26 17:48:54 2016 New Revision: 304855 URL: https://svnweb.freebsd.org/changeset/base/304855 Log: Update TCPS_HAVERCVDFIN() macro to correctly include all states a connection can be in after receiving a FIN. FWIW, NetBSD has this change for quite some time. This has been tested at Netflix and Limelight in production traffic. Reported by: Sam Kumar on transport@ Reviewed by: rrs MFC after: 4 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D7475 Modified: head/sys/netinet/tcp_fsm.h Modified: head/sys/netinet/tcp_fsm.h ============================================================================== --- head/sys/netinet/tcp_fsm.h Fri Aug 26 17:38:13 2016 (r304854) +++ head/sys/netinet/tcp_fsm.h Fri Aug 26 17:48:54 2016 (r304855) @@ -73,7 +73,8 @@ #define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) #define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED) -#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) +#define TCPS_HAVERCVDFIN(s) \ + ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2)) #ifdef TCPOUTFLAGS /* From owner-svn-src-head@freebsd.org Fri Aug 26 18:04:48 2016 Return-Path: Delivered-To: svn-src-head@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 10AA1A94240; Fri, 26 Aug 2016 18:04:48 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (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 7F01A3E2; Fri, 26 Aug 2016 18:04:46 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3sLTTM2S1RzZqm; Fri, 26 Aug 2016 20:04:39 +0200 (CEST) Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id TIWhFIlS3Ac3; Fri, 26 Aug 2016 20:04:37 +0200 (CEST) Received: from tommy.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Fri, 26 Aug 2016 20:04:37 +0200 (CEST) Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> <05528463-fcc5-4492-acdd-e56e352fb62f@FreeBSD.org> Cc: src-committers , svn-src-all@freebsd.org, Ed Schouten , jilles@freebsd.org, svn-src-head@freebsd.org From: Guido Falsi Message-ID: <206b9539-10f1-1480-d2d1-7a5a35d3f848@FreeBSD.org> Date: Fri, 26 Aug 2016 20:04:25 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <05528463-fcc5-4492-acdd-e56e352fb62f@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="okCsXIoMXRe5LiupFng91cUH70dW0FtCs" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 18:04:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --okCsXIoMXRe5LiupFng91cUH70dW0FtCs Content-Type: multipart/mixed; boundary="met4Lf9nLhns7U7nI5bKcghFJCP7wB5iT" From: Guido Falsi To: Bryan Drewery , Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, Ed Schouten , jilles@freebsd.org, svn-src-head@freebsd.org Message-ID: <206b9539-10f1-1480-d2d1-7a5a35d3f848@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <9ae1c2eb-02ad-b8fe-6aff-7e17e955607a@FreeBSD.org> <2632f5f8-d765-3df7-74d7-da878eb4b7a8@FreeBSD.org> <2e308383-bfbb-cccd-cfc2-eba63d275f5e@FreeBSD.org> <9303f35a-7941-3d14-4068-563d6af5b7ee@FreeBSD.org> <27f8937c-024d-821d-14a7-bd90cb848e64@FreeBSD.org> <94bb315d-ac3e-eb45-7105-65467cb327a1@FreeBSD.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> <05528463-fcc5-4492-acdd-e56e352fb62f@FreeBSD.org> In-Reply-To: <05528463-fcc5-4492-acdd-e56e352fb62f@FreeBSD.org> --met4Lf9nLhns7U7nI5bKcghFJCP7wB5iT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/26/16 18:31, Bryan Drewery wrote: > On 8/26/2016 12:37 AM, Ed Schouten wrote: >> Hi, >> >> 2016-08-26 1:52 GMT+02:00 Bryan Drewery : >>> Libc wouldn't build, it complained quite loudly with a lot of these: >> Got it. Thinking ahead, if it's just basename() giving the problems, >> maybe it's easier to just go ahead and bump the symver of basename() >> as well? I'm planning on replacing it anyway to be in sync with the >> new basename() anyway. Attached is a new patch. Be sure to let me know= >> whether that works for you. >=20 > This passes my tests. >=20 Everything works fine here too. Thanks! --=20 Guido Falsi --met4Lf9nLhns7U7nI5bKcghFJCP7wB5iT-- --okCsXIoMXRe5LiupFng91cUH70dW0FtCs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEyBAEBCAAcBQJXwIS0FRxtYWRwaWxvdEBmcmVlYnNkLm9yZwAKCRAa5oYOVsvS k7StB/4rp3m2jWmQSBNCSLi3CBTVukyNwFvAOmnMToEFqW9zlFfDEU/6F5vf/5kX LV5PdR77TzwlCtUkAAvQewnuOcHTMCAfPmO2emvSoPBfFpEkhgNFzRJkXtfXSKPd /pCsh41l9DLK2O+/CNOhBiCmDY2s+cSosn1VEq2Rek2ZbP0t0XnNLttICja8f7ke Iw39xoyVa6HLwlHKgkrhLvObuPcX6aZGbm0htp+pX6k8QJRNRZ3prmb6dM7AnXld sQiq5GDx1+OIie9XL6xTnrfvu817O8wH4Uz7CH2ohUbEqWcikBKIIaHqn46q/Wte exEVLuGdpURe4wDu5V1QtwsBA5zd =X6la -----END PGP SIGNATURE----- --okCsXIoMXRe5LiupFng91cUH70dW0FtCs-- From owner-svn-src-head@freebsd.org Fri Aug 26 19:23:18 2016 Return-Path: Delivered-To: svn-src-head@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 DABF3B76056; Fri, 26 Aug 2016 19:23:18 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AF3647BE; Fri, 26 Aug 2016 19:23:18 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QJNHST058387; Fri, 26 Aug 2016 19:23:17 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QJNHIY058386; Fri, 26 Aug 2016 19:23:17 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201608261923.u7QJNHIY058386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 26 Aug 2016 19:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304857 - head/sys/netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 19:23:19 -0000 Author: hiren Date: Fri Aug 26 19:23:17 2016 New Revision: 304857 URL: https://svnweb.freebsd.org/changeset/base/304857 Log: Adjust TCP module fastpath after r304803's cc_ack_received() changes. Reported by: hiren, bz, np Reviewed by: rrs Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D7664 Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:08:58 2016 (r304856) +++ head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:23:17 2016 (r304857) @@ -172,7 +172,10 @@ tcp_do_fastack(struct mbuf *m, struct tc int ti_locked, u_long tiwin) { int acked; + uint16_t nsegs; int winup_only=0; + + nsegs = max(1, m->m_pkthdr.lro_nsegs); #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -278,7 +281,7 @@ tcp_do_fastack(struct mbuf *m, struct tc * typically means increasing the congestion * window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); tp->snd_una = th->th_ack; /* @@ -502,9 +505,12 @@ tcp_do_slowpath(struct mbuf *m, struct t { int acked, ourfinisacked, needoutput = 0; int rstreason, todrop, win; + uint16_t nsegs; char *s; struct in_conninfo *inc; struct mbuf *mfree = NULL; + + nsegs = max(1, m->m_pkthdr.lro_nsegs); #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -1085,7 +1091,8 @@ tcp_do_slowpath(struct mbuf *m, struct t tp->t_dupacks = 0; else if (++tp->t_dupacks > tcprexmtthresh || IN_FASTRECOVERY(tp->t_flags)) { - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -1135,7 +1142,8 @@ tcp_do_slowpath(struct mbuf *m, struct t } /* Congestion signal before ack. */ cc_cong_signal(tp, th, CC_NDUPACK); - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; if (tp->t_flags & TF_SACK_PERMIT) { @@ -1169,7 +1177,8 @@ tcp_do_slowpath(struct mbuf *m, struct t * segment. Restore the original * snd_cwnd after packet transmission. */ - cc_ack_received(tp, th, CC_DUPACK); + cc_ack_received(tp, th, nsegs, + CC_DUPACK); u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; @@ -1323,7 +1332,7 @@ process_ACK: * control related information. This typically means increasing * the congestion window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); SOCKBUF_LOCK(&so->so_snd); if (acked > sbavail(&so->so_snd)) { @@ -1758,6 +1767,7 @@ tcp_do_segment_fastslow(struct mbuf *m, int thflags; u_long tiwin; char *s; + uint16_t nsegs; int can_enter; struct in_conninfo *inc; struct tcpopt to; @@ -1765,6 +1775,7 @@ tcp_do_segment_fastslow(struct mbuf *m, thflags = th->th_flags; tp->sackhint.last_sack_ack = 0; inc = &tp->t_inpcb->inp_inc; + nsegs = max(1, m->m_pkthdr.lro_nsegs); /* * If this is either a state-changing packet or current state isn't * established, we require a write lock on tcbinfo. Otherwise, we @@ -1983,7 +1994,10 @@ tcp_fastack(struct mbuf *m, struct tcphd int ti_locked, u_long tiwin) { int acked; + uint16_t nsegs; int winup_only=0; + + nsegs = max(1, m->m_pkthdr.lro_nsegs); #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -2128,7 +2142,7 @@ tcp_fastack(struct mbuf *m, struct tcphd * typically means increasing the congestion * window. */ - cc_ack_received(tp, th, CC_ACK); + cc_ack_received(tp, th, nsegs, CC_ACK); tp->snd_una = th->th_ack; tp->t_dupacks = 0; From owner-svn-src-head@freebsd.org Fri Aug 26 19:57:45 2016 Return-Path: Delivered-To: svn-src-head@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 D3C6AB76A49; Fri, 26 Aug 2016 19:57:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1D34DEA; Fri, 26 Aug 2016 19:57:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2D3E6B96C; Fri, 26 Aug 2016 15:57:44 -0400 (EDT) From: John Baldwin To: Ed Schouten Cc: Bryan Drewery , Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Subject: Re: svn commit: r303988 - head/lib/libc/gen Date: Fri, 26 Aug 2016 12:57:41 -0700 Message-ID: <2038784.5k3koFGWFB@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201608120703.u7C73whf007189@repo.freebsd.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 26 Aug 2016 15:57:44 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 19:57:45 -0000 On Friday, August 26, 2016 09:37:10 AM Ed Schouten wrote: > Hi, > > 2016-08-26 1:52 GMT+02:00 Bryan Drewery : > > Libc wouldn't build, it complained quite loudly with a lot of these: > > Got it. Thinking ahead, if it's just basename() giving the problems, > maybe it's easier to just go ahead and bump the symver of basename() > as well? I'm planning on replacing it anyway to be in sync with the > new basename() anyway. Attached is a new patch. Be sure to let me know > whether that works for you. Alternatively, couldn't you just leave basename out of the libgen patch for now and only add it once you do the real symver bump for the different version? (That is, just use __generic() for dirname() for now since that is the only one that has really changed.) -- John Baldwin From owner-svn-src-head@freebsd.org Fri Aug 26 20:04:15 2016 Return-Path: Delivered-To: svn-src-head@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 19C5CB76C4C; Fri, 26 Aug 2016 20:04:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id F0A422688; Fri, 26 Aug 2016 20:04:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id E02E81302; Fri, 26 Aug 2016 20:04:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6CF1F236F4; Fri, 26 Aug 2016 20:04:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 7op064J6FaW6; Fri, 26 Aug 2016 20:04:10 +0000 (UTC) Subject: Re: svn commit: r303988 - head/lib/libc/gen DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8085C236EC To: John Baldwin , Ed Schouten References: <201608120703.u7C73whf007189@repo.freebsd.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> <2038784.5k3koFGWFB@ralph.baldwin.cx> Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <7faebb9e-897a-0a7e-0ec7-c599e8658095@FreeBSD.org> Date: Fri, 26 Aug 2016 13:04:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2038784.5k3koFGWFB@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q65JcBUlgJUhOsgnSILIIgjgHHNVML3uU" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 20:04:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q65JcBUlgJUhOsgnSILIIgjgHHNVML3uU Content-Type: multipart/mixed; boundary="g0n8exE9J4WxKVWXKcF6QmfnFe5FGaAbG" From: Bryan Drewery To: John Baldwin , Ed Schouten Cc: Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Message-ID: <7faebb9e-897a-0a7e-0ec7-c599e8658095@FreeBSD.org> Subject: Re: svn commit: r303988 - head/lib/libc/gen References: <201608120703.u7C73whf007189@repo.freebsd.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> <2038784.5k3koFGWFB@ralph.baldwin.cx> In-Reply-To: <2038784.5k3koFGWFB@ralph.baldwin.cx> --g0n8exE9J4WxKVWXKcF6QmfnFe5FGaAbG Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/26/2016 12:57 PM, John Baldwin wrote: > On Friday, August 26, 2016 09:37:10 AM Ed Schouten wrote: >> Hi, >> >> 2016-08-26 1:52 GMT+02:00 Bryan Drewery : >>> Libc wouldn't build, it complained quite loudly with a lot of these: >> >> Got it. Thinking ahead, if it's just basename() giving the problems, >> maybe it's easier to just go ahead and bump the symver of basename() >> as well? I'm planning on replacing it anyway to be in sync with the >> new basename() anyway. Attached is a new patch. Be sure to let me know= >> whether that works for you. >=20 > Alternatively, couldn't you just leave basename out of the libgen patch= > for now and only add it once you do the real symver bump for the > different version? (That is, just use __generic() for dirname() for > now since that is the only one that has really changed.) >=20 Doing this also works. I think it was done since the prototype did change as well which disallows building the old xinstall directly, but in the bootstrap build it is built with MK_WARNS=3Dno so the error is ignored. > /usr/local/bin/ccache cc -O2 -pipe -I/root/svn/releng/11.0/usr.bin/xi= nstall/../../contrib/mtree -I/root/svn/releng/11.0/usr.bin/xinstall/../..= /lib/libnetbsd -g -std=3Dgnu99 -fstack-protector-strong -Qunused-argument= s -c /root/svn/releng/11.0/usr.bin/xinstall/xinstall.c -o xinstall.o > /root/svn/releng/11.0/usr.bin/xinstall/xinstall.c:696:17: warning: pass= ing 'const char *' to parameter of type 'char *' discards qualifiers [-Wi= ncompatible-pointer-types-discards-qualifiers] > cp =3D basename(to_name); > ^~~~~~~ > /usr/include/libgen.h:37:22: note: passing argument to parameter here > char *basename(char *); > ^ > 1 warning generated. > Building /usr/obj/root/svn/releng/11.0/usr.bin/xinstall/getid.o Let's just not forget to add the _generic in if/when needed too. --=20 Regards, Bryan Drewery --g0n8exE9J4WxKVWXKcF6QmfnFe5FGaAbG-- --q65JcBUlgJUhOsgnSILIIgjgHHNVML3uU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXwKC6AAoJEDXXcbtuRpfP8SoH/1XFpL2oziQCdO7++oArRqVf IfkLtLSuHkwD1m9f8YgJTf9CK3ywi492DFWLFBSoQ+8bxx5Km8KLOIURJ3s0GTDl 4m5n1mRRLWqxU01YK+kfgBjd58koIIVyRQupwhavBfloqwF+6T/QA8j/i7PTJM7+ xKF8vLLAdH8HaDJGCdtHJLkL/RYuZhcWkNqerWLCRF6oq4LmmbCKJAgWEHAkC3Wi W+XFINQRqn9757I90Fqw4uesaG60Ljkce+iO4h7vX6VQs9wnvaWPBNInTGXvCNwN ssHqSttUaWxfHNQst1CkxunxgFGOrkBhSuEqJvmAc5A4Ok4YdiJbNB/YscpiRQU= =nuQs -----END PGP SIGNATURE----- --q65JcBUlgJUhOsgnSILIIgjgHHNVML3uU-- From owner-svn-src-head@freebsd.org Fri Aug 26 20:15:24 2016 Return-Path: Delivered-To: svn-src-head@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 46381B7401B; Fri, 26 Aug 2016 20:15:24 +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 0A6D82CF1; Fri, 26 Aug 2016 20:15:23 +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 u7QKFNQn077412; Fri, 26 Aug 2016 20:15:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QKFNTS077409; Fri, 26 Aug 2016 20:15:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608262015.u7QKFNTS077409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 26 Aug 2016 20:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304858 - in head/sys/amd64/vmm: . io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 20:15:24 -0000 Author: jhb Date: Fri Aug 26 20:15:22 2016 New Revision: 304858 URL: https://svnweb.freebsd.org/changeset/base/304858 Log: Enable I/O MMU when PCI pass through is first used. Rather than enabling the I/O MMU when the vmm module is loaded, defer initialization until the first attempt to pass a PCI device through to a guest. If the I/O MMU fails to initialize or is not present, than fail the attempt to pass a PCI device through to a guest. The hw.vmm.force_iommu tunable has been removed since the I/O MMU is no longer enabled during boot. However, the I/O MMU support can be disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent use of the I/O MMU on any systems where it is buggy. Reviewed by: grehan MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D7448 Modified: head/sys/amd64/vmm/io/iommu.c head/sys/amd64/vmm/io/iommu.h head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/io/iommu.c ============================================================================== --- head/sys/amd64/vmm/io/iommu.c Fri Aug 26 19:23:17 2016 (r304857) +++ head/sys/amd64/vmm/io/iommu.c Fri Aug 26 20:15:22 2016 (r304858) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmm_util.h" @@ -51,6 +52,10 @@ static int iommu_avail; SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail, 0, "bhyve iommu initialized?"); +static int iommu_enable = 1; +SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0, + "Enable use of I/O MMU (required for PCI passthrough)."); + static struct iommu_ops *ops; static void *host_domain; @@ -148,7 +153,7 @@ IOMMU_DISABLE(void) (*ops->disable)(); } -void +static void iommu_init(void) { int error, bus, slot, func; @@ -156,6 +161,9 @@ iommu_init(void) const char *name; device_t dev; + if (!iommu_enable) + return; + if (vmm_is_intel()) ops = &iommu_ops_intel; else if (vmm_is_amd()) @@ -174,8 +182,13 @@ iommu_init(void) */ maxaddr = vmm_mem_maxaddr(); host_domain = IOMMU_CREATE_DOMAIN(maxaddr); - if (host_domain == NULL) - panic("iommu_init: unable to create a host domain"); + if (host_domain == NULL) { + printf("iommu_init: unable to create a host domain"); + IOMMU_CLEANUP(); + ops = NULL; + iommu_avail = 0; + return; + } /* * Create 1:1 mappings from '0' to 'maxaddr' for devices assigned to @@ -216,7 +229,16 @@ iommu_cleanup(void) void * iommu_create_domain(vm_paddr_t maxaddr) { + static volatile int iommu_initted; + if (iommu_initted < 2) { + if (atomic_cmpset_int(&iommu_initted, 0, 1)) { + iommu_init(); + atomic_store_rel_int(&iommu_initted, 2); + } else + while (iommu_initted == 1) + cpu_spinwait(); + } return (IOMMU_CREATE_DOMAIN(maxaddr)); } Modified: head/sys/amd64/vmm/io/iommu.h ============================================================================== --- head/sys/amd64/vmm/io/iommu.h Fri Aug 26 19:23:17 2016 (r304857) +++ head/sys/amd64/vmm/io/iommu.h Fri Aug 26 20:15:22 2016 (r304858) @@ -61,7 +61,6 @@ struct iommu_ops { extern struct iommu_ops iommu_ops_intel; extern struct iommu_ops iommu_ops_amd; -void iommu_init(void); void iommu_cleanup(void); void *iommu_host_domain(void); void *iommu_create_domain(vm_paddr_t maxaddr); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Aug 26 19:23:17 2016 (r304857) +++ head/sys/amd64/vmm/vmm.c Fri Aug 26 20:15:22 2016 (r304858) @@ -224,11 +224,6 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, trace_gues &trace_guest_exceptions, 0, "Trap into hypervisor on all guest exceptions and reflect them back"); -static int vmm_force_iommu = 0; -TUNABLE_INT("hw.vmm.force_iommu", &vmm_force_iommu); -SYSCTL_INT(_hw_vmm, OID_AUTO, force_iommu, CTLFLAG_RDTUN, &vmm_force_iommu, 0, - "Force use of I/O MMU even if no passthrough devices were found."); - static void vm_free_memmap(struct vm *vm, int ident); static bool sysmem_mapping(struct vm *vm, struct mem_map *mm); static void vcpu_notify_event_locked(struct vcpu *vcpu, bool lapic_intr); @@ -358,8 +353,6 @@ vmm_handler(module_t mod, int what, void switch (what) { case MOD_LOAD: vmmdev_init(); - if (vmm_force_iommu || ppt_avail_devices() > 0) - iommu_init(); error = vmm_init(); if (error == 0) vmm_initialized = 1; @@ -396,9 +389,6 @@ static moduledata_t vmm_kmod = { /* * vmm initialization has the following dependencies: * - * - iommu initialization must happen after the pci passthru driver has had - * a chance to attach to any passthru devices (after SI_SUB_CONFIGURE). - * * - VT-x initialization requires smp_rendezvous() and therefore must happen * after SMP is fully functional (after SI_SUB_SMP). */ @@ -893,6 +883,8 @@ vm_assign_pptdev(struct vm *vm, int bus, ("vm_assign_pptdev: iommu must be NULL")); maxaddr = sysmem_maxaddr(vm); vm->iommu = iommu_create_domain(maxaddr); + if (vm->iommu == NULL) + return (ENXIO); vm_iommu_map(vm); } From owner-svn-src-head@freebsd.org Fri Aug 26 20:16:04 2016 Return-Path: Delivered-To: svn-src-head@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 5134CB74087; Fri, 26 Aug 2016 20:16:04 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 194D82E55; Fri, 26 Aug 2016 20:16:04 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QKG3u4077490; Fri, 26 Aug 2016 20:16:03 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QKG23b077481; Fri, 26 Aug 2016 20:16:02 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608262016.u7QKG23b077481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 26 Aug 2016 20:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304859 - in head/sys: dev/bhnd dev/bhnd/bcma dev/bhnd/cores/chipc mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 20:16:04 -0000 Author: landonf Date: Fri Aug 26 20:16:02 2016 New Revision: 304859 URL: https://svnweb.freebsd.org/changeset/base/304859 Log: [mips/broadcom] Generic platform_reset() support. This adds support for performing platform_reset() on all supported devices, using early boot enumeration of chipc capabilities and available cores. - Added Broadcom-specific MIPS CP0 register definitions used by BCM4785-specific reset handling. - Added a bcm_platform structure for tracking chipc/pmu/cfe platform data. - Extended the BCMA EROM API to support early boot lookup of core info (including port/region mappings). - Extended platform_reset() to support PMU, PMU+AOB, and non-PMU devices. Reviewed by: mizhka Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7539 Added: head/sys/mips/broadcom/bcm_bcma.c (contents, props changed) head/sys/mips/broadcom/bcm_machdep.h (contents, props changed) head/sys/mips/broadcom/bcm_mips_exts.h (contents, props changed) head/sys/mips/broadcom/bcm_siba.c (contents, props changed) Modified: head/sys/dev/bhnd/bcma/bcma_erom.c head/sys/dev/bhnd/bcma/bcma_eromvar.h head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/broadcom/bcm_socinfo.c head/sys/mips/broadcom/bcm_socinfo.h head/sys/mips/broadcom/files.broadcom head/sys/mips/broadcom/uart_cpu_chipc.c Modified: head/sys/dev/bhnd/bcma/bcma_erom.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_erom.c Fri Aug 26 20:15:22 2016 (r304858) +++ head/sys/dev/bhnd/bcma/bcma_erom.c Fri Aug 26 20:16:02 2016 (r304859) @@ -65,10 +65,18 @@ static int erom_skip_mport(struct bcma static int erom_skip_sport_region(struct bcma_erom *erom); static int erom_seek_next(struct bcma_erom *erom, uint8_t etype); +static int erom_region_to_port_type(struct bcma_erom *erom, + uint8_t region_type, bhnd_port_type *port_type); -#define EROM_LOG(erom, fmt, ...) \ - device_printf(erom->dev, "erom[0x%llx]: " fmt, \ - (unsigned long long) (erom->offset), ##__VA_ARGS__); +#define EROM_LOG(erom, fmt, ...) do { \ + if (erom->dev != NULL) { \ + device_printf(erom->dev, "erom[0x%llx]: " fmt, \ + (unsigned long long) (erom->offset), ##__VA_ARGS__);\ + } else { \ + printf("erom[0x%llx]: " fmt, \ + (unsigned long long) (erom->offset), ##__VA_ARGS__);\ + } \ +} while(0) /** * Open an EROM table for reading. @@ -82,11 +90,37 @@ static int erom_seek_next(struct bcma_ * @retval non-zero if the erom table could not be opened. */ int -bcma_erom_open(struct bcma_erom *erom, struct resource *r, bus_size_t offset) +bcma_erom_open(struct bcma_erom *erom, struct resource *r, + bus_size_t offset) +{ + return (bhnd_erom_bus_space_open(erom, rman_get_device(r), + rman_get_bustag(r), rman_get_bushandle(r), offset)); + + return (0); +} + +/** + * Open an EROM table for reading using the provided bus space tag and + * handle. + * + * @param[out] erom On success, will be populated with a valid EROM + * read state. + * @param dev The owning device, or NULL if none. + * @param bst EROM table bus space tag. + * @param bsh EROM table bus space handle. + * @param offset Offset of the EROM core from @p resource. + * + * @retval 0 success + * @retval non-zero if the erom table could not be opened. + */ +int +bhnd_erom_bus_space_open(struct bcma_erom *erom, device_t dev, + bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset) { /* Initialize the EROM reader */ - erom->dev = rman_get_device(r); - erom->r = r; + erom->dev = dev; + erom->bst = bst; + erom->bsh = bsh; erom->start = offset + BCMA_EROM_TABLE_START; erom->offset = 0; @@ -145,7 +179,8 @@ bcma_erom_peek32(struct bcma_erom *erom, return (EINVAL); } - *entry = bus_read_4(erom->r, erom->start + erom->offset); + *entry = bus_space_read_4(erom->bst, erom->bsh, + erom->start + erom->offset); return (0); } @@ -300,6 +335,20 @@ bcma_erom_reset(struct bcma_erom *erom) } /** + * Seek to the next core entry. + * + * @param erom EROM read state. + * @retval 0 success + * @retval ENOENT The end of the EROM table was reached. + * @retval non-zero Reading or parsing failed. + */ +int +bcma_erom_seek_next_core(struct bcma_erom *erom) +{ + return (erom_seek_next(erom, BCMA_EROM_ENTRY_TYPE_CORE)); +} + +/** * Seek to the requested core entry. * * @param erom EROM read state. @@ -387,6 +436,153 @@ bcma_erom_parse_core(struct bcma_erom *e } /** + * Seek to a region record associated with @p core_index. + * + * @param erom EROM read state. + * @param core_index The index of the core record to be searched. + * @param port_type The port type to search for. + * @param port_num The port number to search for. + * @param region_num The region number to search for. + * @retval 0 success + * @retval ENOENT The requested region was not found. + * @retval non-zero Reading or parsing failed. + */ +int +bcma_erom_seek_core_sport_region(struct bcma_erom *erom, u_int core_index, + bhnd_port_type port_type, u_int port_num, u_int region_num) +{ + struct bcma_erom_core core; + uint32_t entry; + uint8_t region_port, region_type; + bool found; + int error; + + if ((error = bcma_erom_seek_core_index(erom, core_index))) + return (error); + + if ((error = bcma_erom_parse_core(erom, &core))) + return (error); + + /* Skip master ports */ + for (u_long i = 0; i < core.num_mport; i++) { + if ((error = erom_skip_mport(erom))) + return (error); + } + + /* Seek to the region block for the given port type */ + found = false; + while (1) { + bhnd_port_type p_type; + uint8_t r_type; + + if ((error = bcma_erom_peek32(erom, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + /* Expected region type? */ + r_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + if ((error = erom_region_to_port_type(erom, r_type, &p_type))) + return (error); + + if (p_type == port_type) { + found = true; + break; + } + + /* Skip to next entry */ + if ((error = erom_skip_sport_region(erom))) + return (error); + } + + if (!found) + return (ENOENT); + + /* Found the appropriate port type block; now find the region records + * for the given port number */ + found = false; + for (u_int i = 0; i <= port_num; i++) { + bhnd_port_type p_type; + + if ((error = bcma_erom_peek32(erom, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + /* Fetch the type/port of the first region entry */ + region_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + region_port = BCMA_EROM_GET_ATTR(entry, REGION_PORT); + + /* Have we found the region entries for the desired port? */ + if (i == port_num) { + error = erom_region_to_port_type(erom, region_type, + &p_type); + if (error) + return (error); + + if (p_type == port_type) + found = true; + + break; + } + + /* Otherwise, seek to next block of region records */ + while (1) { + uint8_t next_type, next_port; + + if ((error = erom_skip_sport_region(erom))) + return (error); + + if ((error = bcma_erom_peek32(erom, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + next_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + next_port = BCMA_EROM_GET_ATTR(entry, REGION_PORT); + + if (next_type != region_type || + next_port != region_port) + break; + } + } + + if (!found) + return (ENOENT); + + /* Finally, search for the requested region number */ + for (u_int i = 0; i <= region_num; i++) { + uint8_t next_port, next_type; + + if ((error = bcma_erom_peek32(erom, &entry))) + return (error); + + if (!BCMA_EROM_ENTRY_IS(entry, REGION)) + return (ENOENT); + + /* Check for the end of the region block */ + next_type = BCMA_EROM_GET_ATTR(entry, REGION_TYPE); + next_port = BCMA_EROM_GET_ATTR(entry, REGION_PORT); + + if (next_type != region_type || + next_port != region_port) + break; + + if (i == region_num) + return (0); + + if ((error = erom_skip_sport_region(erom))) + return (error); + } + + /* Not found */ + return (ENOENT); +} + +/** * Read the next master port descriptor from the EROM table. * * @param erom EROM read state. @@ -492,6 +688,25 @@ bcma_erom_parse_sport_region(struct bcma } /** + * Convert a bcma_erom_core record to its bhnd_core_info representation. + * + * @param core EROM core record to convert. + * @param core_idx The core index of @p core. + * @param core_unit The core unit of @p core. + * @param[out] info The populated bhnd_core_info representation. + */ +void +bcma_erom_to_core_info(const struct bcma_erom_core *core, u_int core_idx, + int core_unit, struct bhnd_core_info *info) +{ + info->vendor = core->vendor; + info->device = core->device; + info->hwrev = core->rev; + info->core_idx = core_idx; + info->unit = core_unit; +} + +/** * Parse all cores descriptors from @p erom and return the array * in @p cores and the count in @p num_cores. The current EROM read position * is left unmodified. @@ -545,7 +760,8 @@ bcma_erom_get_core_info(struct bcma_erom /* Parse all core descriptors */ bcma_erom_reset(erom); for (u_int i = 0; i < count; i++) { - struct bcma_erom_core core; + struct bcma_erom_core core; + int unit; /* Parse the core */ error = erom_seek_next(erom, BCMA_EROM_ENTRY_TYPE_CORE); @@ -555,20 +771,17 @@ bcma_erom_get_core_info(struct bcma_erom error = bcma_erom_parse_core(erom, &core); if (error) goto cleanup; - - /* Convert to a bhnd info record */ - buffer[i].vendor = core.vendor; - buffer[i].device = core.device; - buffer[i].hwrev = core.rev; - buffer[i].core_idx = i; - buffer[i].unit = 0; /* Determine the unit number */ + unit = 0; for (u_int j = 0; j < i; j++) { if (buffer[i].vendor == buffer[j].vendor && buffer[i].device == buffer[j].device) - buffer[i].unit++; + unit++; } + + /* Convert to a bhnd info record */ + bcma_erom_to_core_info(&core, i, unit, &buffer[i]); } cleanup: @@ -585,6 +798,33 @@ cleanup: return (error); } +/** + * Map an EROM region type to its corresponding port type. + * + * @param region_type Region type value. + * @param[out] port_type On success, the corresponding port type. + */ +static int +erom_region_to_port_type(struct bcma_erom *erom, uint8_t region_type, + bhnd_port_type *port_type) +{ + switch (region_type) { + case BCMA_EROM_REGION_TYPE_DEVICE: + *port_type = BHND_PORT_DEVICE; + return (0); + case BCMA_EROM_REGION_TYPE_BRIDGE: + *port_type = BHND_PORT_BRIDGE; + return (0); + case BCMA_EROM_REGION_TYPE_MWRAP: + case BCMA_EROM_REGION_TYPE_SWRAP: + *port_type = BHND_PORT_AGENT; + return (0); + default: + EROM_LOG(erom, "unsupported region type %hhx\n", + region_type); + return (EINVAL); + } +} /** * Register all MMIO region descriptors for the given slave port. @@ -608,24 +848,10 @@ erom_corecfg_fill_port_regions(struct bc bhnd_port_type port_type; error = 0; - + /* Determine the port type for this region type. */ - switch (region_type) { - case BCMA_EROM_REGION_TYPE_DEVICE: - port_type = BHND_PORT_DEVICE; - break; - case BCMA_EROM_REGION_TYPE_BRIDGE: - port_type = BHND_PORT_BRIDGE; - break; - case BCMA_EROM_REGION_TYPE_MWRAP: - case BCMA_EROM_REGION_TYPE_SWRAP: - port_type = BHND_PORT_AGENT; - break; - default: - EROM_LOG(erom, "unsupported region type %hhx\n", - region_type); - return (EINVAL); - } + if ((error = erom_region_to_port_type(erom, region_type, &port_type))) + return (error); /* Fetch the list to be populated */ sports = bcma_corecfg_get_port_list(corecfg, port_type); Modified: head/sys/dev/bhnd/bcma/bcma_eromvar.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_eromvar.h Fri Aug 26 20:15:22 2016 (r304858) +++ head/sys/dev/bhnd/bcma/bcma_eromvar.h Fri Aug 26 20:16:02 2016 (r304859) @@ -40,10 +40,11 @@ * EROM read context. */ struct bcma_erom { - device_t dev; /**< EROM parent device */ - struct resource *r; /**< EROM table resource. */ - bus_size_t start; /**< EROM table offset */ - bus_size_t offset; /**< current read offset */ + device_t dev; /**< EROM parent device */ + bus_space_tag_t bst; /**< EROM table bus space */ + bus_space_handle_t bsh; /**< EROM table bus handle */ + bus_size_t start; /**< EROM table offset */ + bus_size_t offset; /**< current read offset */ }; /** EROM core descriptor. */ @@ -78,22 +79,34 @@ struct bcma_erom_sport_region { int bcma_erom_open(struct bcma_erom *erom, struct resource *r, bus_size_t offset); +int bhnd_erom_bus_space_open(struct bcma_erom *erom, device_t owner, + bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset); + int bcma_erom_peek32(struct bcma_erom *erom, uint32_t *entry); bus_size_t bcma_erom_tell(struct bcma_erom *erom); void bcma_erom_seek(struct bcma_erom *erom, bus_size_t offset); void bcma_erom_reset(struct bcma_erom *erom); +int bcma_erom_seek_next_core(struct bcma_erom *erom); int bcma_erom_seek_core_index(struct bcma_erom *erom, u_int core_index); int bcma_erom_parse_core(struct bcma_erom *erom, struct bcma_erom_core *core); +int bcma_erom_seek_core_sport_region(struct bcma_erom *erom, + u_int core_index, bhnd_port_type port_type, u_int port_num, + u_int region_num); + int bcma_erom_parse_mport(struct bcma_erom *erom, struct bcma_erom_mport *mport); int bcma_erom_parse_sport_region(struct bcma_erom *erom, struct bcma_erom_sport_region *region); +void bcma_erom_to_core_info(const struct bcma_erom_core *core, + u_int core_idx, int core_unit, struct bhnd_core_info *info); + int bcma_erom_get_core_info(struct bcma_erom *erom, struct bhnd_core_info **cores, u_int *num_cores); Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Fri Aug 26 20:15:22 2016 (r304858) +++ head/sys/dev/bhnd/bhnd_ids.h Fri Aug 26 20:16:02 2016 (r304859) @@ -535,6 +535,12 @@ #define BHND_CHIPTYPE_UBUS 2 /**< ubus interconnect found in bcm63xx devices */ #define BHND_CHIPTYPE_BCMA_ALT 3 /**< bcma(4) interconnect */ +/** Evaluates to true if @p _type uses a BCMA EROM table */ +#define BHND_CHIPTYPE_HAS_EROM(_type) \ + ((_type) == BHND_CHIPTYPE_BCMA || \ + (_type) == BHND_CHIPTYPE_BCMA_ALT || \ + (_type) == BHND_CHIPTYPE_UBUS) + /* Boardflags */ #define BHND_BFL_BTC2WIRE 0x00000001 /* old 2wire Bluetooth coexistence, OBSOLETE */ #define BHND_BFL_BTCOEX 0x00000001 /* Board supports BTCOEX */ Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Fri Aug 26 20:15:22 2016 (r304858) +++ head/sys/dev/bhnd/bhnd_subr.c Fri Aug 26 20:16:02 2016 (r304859) @@ -834,12 +834,16 @@ bhnd_read_chipid(device_t dev, struct re bus_size_t chipc_offset, struct bhnd_chipid *result) { struct resource *res; + bhnd_addr_t enum_addr; uint32_t reg; + uint8_t chip_type; int error, rid, rtype; - /* Allocate the ChipCommon window resource and fetch the chipid data */ rid = rs->rid; rtype = rs->type; + error = 0; + + /* Allocate the ChipCommon window resource and fetch the chipid data */ res = bus_alloc_resource_any(dev, rtype, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, @@ -849,30 +853,23 @@ bhnd_read_chipid(device_t dev, struct re /* Fetch the basic chip info */ reg = bus_read_4(res, chipc_offset + CHIPC_ID); - *result = bhnd_parse_chipid(reg, 0x0); + chip_type = CHIPC_GET_BITS(reg, CHIPC_ID_BUS); - /* Fetch the enum base address */ - error = 0; - switch (result->chip_type) { - case BHND_CHIPTYPE_SIBA: - result->enum_addr = BHND_DEFAULT_CHIPC_ADDR; - break; - case BHND_CHIPTYPE_BCMA: - case BHND_CHIPTYPE_BCMA_ALT: - result->enum_addr = bus_read_4(res, chipc_offset + - CHIPC_EROMPTR); - break; - case BHND_CHIPTYPE_UBUS: - device_printf(dev, "unsupported ubus/bcm63xx chip type"); - error = ENODEV; - goto cleanup; - default: - device_printf(dev, "unknown chip type %hhu\n", - result->chip_type); + /* Fetch the EROMPTR */ + if (BHND_CHIPTYPE_HAS_EROM(chip_type)) { + enum_addr = bus_read_4(res, chipc_offset + CHIPC_EROMPTR); + } else if (chip_type == BHND_CHIPTYPE_SIBA) { + /* siba(4) uses the ChipCommon base address as the enumeration + * address */ + enum_addr = rman_get_start(res) + chipc_offset; + } else { + device_printf(dev, "unknown chip type %hhu\n", chip_type); error = ENODEV; goto cleanup; } + *result = bhnd_parse_chipid(reg, enum_addr); + cleanup: /* Clean up */ bus_release_resource(dev, rtype, rid, res); Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcreg.h Fri Aug 26 20:15:22 2016 (r304858) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.h Fri Aug 26 20:16:02 2016 (r304859) @@ -35,6 +35,16 @@ * the core count via the chip identification register. */ #define CHIPC_NCORES_MIN_HWREV(hwrev) ((hwrev) == 4 || (hwrev) >= 6) +/** Evaluates to true if the given ChipCommon core revision supports + * the CHIPC_CAPABILITIES_EXT register */ +#define CHIPC_HWREV_HAS_CAP_EXT(hwrev) ((hwrev) >= 35) + +/** Evaluates to true if the chipcommon core (determined from the provided + * @p _chipid (CHIPC_ID) register value) provides a pointer to the enumeration + * table via CHIPC_EROMPTR */ +#define CHIPC_HAS_EROMPTR(_chipid) \ + (CHIPC_GET_BITS((_chipid), CHIPC_ID_BUS) != BHND_CHIPTYPE_SIBA) + #define CHIPC_GET_FLAG(_value, _flag) (((_value) & _flag) != 0) #define CHIPC_GET_BITS(_value, _field) \ ((_value & _field ## _MASK) >> _field ## _SHIFT) Added: head/sys/mips/broadcom/bcm_bcma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_bcma.c Fri Aug 26 20:16:02 2016 (r304859) @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2016 Landon Fuller + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include +#include + +#include "bcm_machdep.h" + +#define BCMFC_ERR(fmt, ...) printf("%s: " fmt, __FUNCTION__, ##__VA_ARGS__) + +int +bcm_find_core_bcma(struct bhnd_chipid *chipid, bhnd_devclass_t devclass, + int unit, struct bhnd_core_info *info, uintptr_t *addr) +{ + struct bcma_erom erom; + struct bcma_erom_core core; + struct bcma_erom_sport_region region; + bhnd_devclass_t core_class; + int error; + + error = bhnd_erom_bus_space_open(&erom, NULL, mips_bus_space_generic, + (bus_space_handle_t) BCM_SOC_ADDR(chipid->enum_addr, 0), 0); + if (error) { + BCMFC_ERR("erom open failed: %d\n", error); + return (error); + } + + for (u_long core_index = 0; core_index < ULONG_MAX; core_index++) { + /* Fetch next core record */ + if ((error = bcma_erom_seek_next_core(&erom))) + return (error); + + if ((error = bcma_erom_parse_core(&erom, &core))) { + BCMFC_ERR("core parse failed: %d\n", error); + return (error); + } + + /* Check for match */ + core_class = bhnd_find_core_class(core.vendor, + core.device); + if (core_class != devclass) + continue; + + /* Provide the basic core info */ + if (info != NULL) + bcma_erom_to_core_info(&core, core_index, 0, info); + + /* Provide the core's device0.0 port address */ + error = bcma_erom_seek_core_sport_region(&erom, core_index, + BHND_PORT_DEVICE, 0, 0); + if (error) { + BCMFC_ERR("sport not found: %d\n", error); + return (error); + } + + if ((error = bcma_erom_parse_sport_region(&erom, ®ion))) { + BCMFC_ERR("sport parse failed: %d\n", error); + return (error); + } + + if (addr != NULL) + *addr = region.base_addr; + + return (0); + } + + /* Not found */ + return (ENOENT); +} Modified: head/sys/mips/broadcom/bcm_machdep.c ============================================================================== --- head/sys/mips/broadcom/bcm_machdep.c Fri Aug 26 20:15:22 2016 (r304858) +++ head/sys/mips/broadcom/bcm_machdep.c Fri Aug 26 20:16:02 2016 (r304859) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2007 Bruce M. Simpson. * Copyright (c) 2016 Michael Zhilin + * Copyright (c) 2016 Landon Fuller * * All rights reserved. * @@ -71,6 +72,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +#include + +#include +#include + +#include + +#include "bcm_machdep.h" +#include "bcm_mips_exts.h" #include "bcm_socinfo.h" #ifdef CFE @@ -83,8 +96,150 @@ __FBSDID("$FreeBSD$"); #define BCM_TRACE(_fmt, ...) #endif -extern int *edata; -extern int *end; +static int bcm_find_core(struct bhnd_chipid *chipid, + bhnd_devclass_t devclass, int unit, + struct bhnd_core_info *info, uintptr_t *addr); +static int bcm_init_platform_data(struct bcm_platform *pdata); + +/* Allow bus-specific implementations to override bcm_find_core_(bcma|siba) + * symbols, if included in the kernel build */ +__weak_reference(bcm_find_core_default, bcm_find_core_bcma); +__weak_reference(bcm_find_core_default, bcm_find_core_siba); + +extern int *edata; +extern int *end; + +static struct bcm_platform bcm_platform_data; +static bool bcm_platform_data_avail = false; + +struct bcm_platform * +bcm_get_platform(void) +{ + if (!bcm_platform_data_avail) + panic("platform data not available"); + + return (&bcm_platform_data); +} + +/* Default (no-op) bcm_find_core() implementation. */ +int +bcm_find_core_default(struct bhnd_chipid *chipid, bhnd_devclass_t devclass, + int unit, struct bhnd_core_info *info, uintptr_t *addr) +{ + return (ENODEV); +} + +/** + * Search @p chipid's enumeration table for a core with @p devclass and + * @p unit. + * + * @param chipid Chip identification data, including the address + * of the enumeration table to be searched. + * @param devclass Search for a core matching this device class. + * @param unit The core's required unit number. + * @param[out] info On success, will be populated with the core + * info. + */ +static int +bcm_find_core(struct bhnd_chipid *chipid, bhnd_devclass_t devclass, int unit, + struct bhnd_core_info *info, uintptr_t *addr) +{ + switch (chipid->chip_type) { + case BHND_CHIPTYPE_SIBA: + return (bcm_find_core_siba(chipid, devclass, unit, info, addr)); + break; + default: + if (!BHND_CHIPTYPE_HAS_EROM(chipid->chip_type)) { + printf("%s: unsupported chip type: %d\n", __FUNCTION__, + chipid->chip_type); + return (ENXIO); + } + return (bcm_find_core_bcma(chipid, devclass, unit, info, addr)); + } +} + +/** + * Populate platform configuration data. + */ +static int +bcm_init_platform_data(struct bcm_platform *pdata) +{ + uint32_t reg; + bhnd_addr_t enum_addr; + long maddr; + uint8_t chip_type; + bool aob, pmu; + int error; + + /* Fetch CFE console handle (if any). Must be initialized before + * any calls to printf/early_putc. */ +#ifdef CFE + if ((pdata->cfe_console = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE)) < 0) + pdata->cfe_console = -1; +#endif + + /* Fetch bhnd/chipc address */ + if (resource_long_value("bhnd", 0, "maddr", &maddr) == 0) + pdata->cc_addr = (u_long)maddr; + else + pdata->cc_addr = BHND_DEFAULT_CHIPC_ADDR; + + /* Read chip identifier from ChipCommon */ + reg = BCM_SOC_READ_4(pdata->cc_addr, CHIPC_ID); + chip_type = CHIPC_GET_BITS(reg, CHIPC_ID_BUS); + + if (BHND_CHIPTYPE_HAS_EROM(chip_type)) + enum_addr = BCM_SOC_READ_4(pdata->cc_addr, CHIPC_EROMPTR); + else + enum_addr = pdata->cc_addr; + + pdata->id = bhnd_parse_chipid(reg, enum_addr); + + /* Fetch chipc core info and capabilities */ + pdata->cc_caps = BCM_SOC_READ_4(pdata->cc_addr, CHIPC_CAPABILITIES); + + error = bcm_find_core(&pdata->id, BHND_DEVCLASS_CC, 0, &pdata->cc_id, + NULL); + if (error) { + printf("%s: error locating chipc core: %d", __FUNCTION__, + error); + return (error); + } + + if (CHIPC_HWREV_HAS_CAP_EXT(pdata->cc_id.hwrev)) { + pdata->cc_caps_ext = BCM_SOC_READ_4(pdata->cc_addr, + CHIPC_CAPABILITIES_EXT); + } else { + pdata->cc_caps_ext = 0x0; + } + + /* Fetch PMU info */ + pmu = CHIPC_GET_FLAG(pdata->cc_caps, CHIPC_CAP_PMU); + aob = CHIPC_GET_FLAG(pdata->cc_caps_ext, CHIPC_CAP2_AOB); + + if (pmu && aob) { + /* PMU block mapped to a PMU core on the Always-on-Bus (aob) */ + error = bcm_find_core(&pdata->id, BHND_DEVCLASS_PMU, 0, + &pdata->pmu_id, &pdata->pmu_addr); + + if (error) { + printf("%s: error locating pmu core: %d", __FUNCTION__, + error); + return (error); + } + } else if (pmu) { + /* PMU block mapped to chipc */ + pdata->pmu_addr = pdata->cc_addr; + pdata->pmu_id = pdata->cc_id; + } else { + /* No PMU */ + pdata->pmu_addr = 0x0; + memset(&pdata->pmu_id, 0, sizeof(pdata->pmu_id)); + } + + bcm_platform_data_avail = true; + return (0); +} void platform_cpu_init() @@ -162,23 +317,42 @@ mips_init(void) void platform_reset(void) { + bool bcm4785war; + printf("bcm::platform_reset()\n"); intr_disable(); -#if defined(CFE) - cfe_exit(0, 0); -#else - /* PMU watchdog reset */ - BCM_WRITE_REG32(BCM_REG_CHIPC_PMUWD_OFFS, 2); /* PMU watchdog */ +#ifdef CFE + /* Fall back on CFE if reset requested during platform + * data initialization */ + if (!bcm_platform_data_avail) { + cfe_exit(0, 0); + while (1); + } #endif -#if 0 - /* Non-PMU reset - * XXX: Need chipc capability flags */ - *((volatile uint8_t *)MIPS_PHYS_TO_KSEG1(SENTRY5_EXTIFADR)) = 0x80; -#endif - - for (;;); + /* Handle BCM4785-specific behavior */ + bcm4785war = false; + if (bcm_get_platform()->id.chip_id == BHND_CHIPID_BCM4785) { + bcm4785war = true; + + /* Switch to async mode */ + bcm_mips_wr_pllcfg3(MIPS_BCMCFG_PLLCFG3_SM); + } + + /* Set watchdog (PMU or ChipCommon) */ + if (bcm_get_platform()->pmu_addr != 0x0) { + BCM_CHIPC_WRITE_4(CHIPC_PMU_WATCHDOG, 1); + } else + BCM_CHIPC_WRITE_4(CHIPC_WATCHDOG, 1); + + /* BCM4785 */ + if (bcm4785war) { + mips_sync(); + __asm __volatile("wait"); + } + + while (1); } void @@ -188,6 +362,7 @@ platform_start(__register_t a0, __regist vm_offset_t kernend; uint64_t platform_counter_freq; struct bcm_socinfo *socinfo; + int error; /* clear the BSS and SBSS segments */ kernend = (vm_offset_t)&end; @@ -213,36 +388,9 @@ platform_start(__register_t a0, __regist cfe_init(a0, a2); #endif -#if 0 - /* - * Probe the Broadcom on-chip PLL clock registers - * and discover the CPU pipeline clock and bus clock - * multipliers from this. - * XXX: Wrong place. You have to ask the ChipCommon - * or External Interface cores on the SiBa. - */ - uint32_t busmult, cpumult, refclock, clkcfg1; -#define S5_CLKCFG1_REFCLOCK_MASK 0x0000001F -#define S5_CLKCFG1_BUSMULT_MASK 0x000003E0 -#define S5_CLKCFG1_BUSMULT_SHIFT 5 -#define S5_CLKCFG1_CPUMULT_MASK 0xFFFFFC00 -#define S5_CLKCFG1_CPUMULT_SHIFT 10 - - counter_freq = 100000000; /* XXX */ - - clkcfg1 = s5_rd_clkcfg1(); - printf("clkcfg1 = 0x%08x\n", clkcfg1); - - refclock = clkcfg1 & 0x1F; - busmult = ((clkcfg1 & 0x000003E0) >> 5) + 1; - cpumult = ((clkcfg1 & 0xFFFFFC00) >> 10) + 1; - - printf("refclock = %u\n", refclock); - printf("busmult = %u\n", busmult); - printf("cpumult = %u\n", cpumult); - - counter_freq = cpumult * refclock; -#endif + /* Init BCM platform data */ + if ((error = bcm_init_platform_data(&bcm_platform_data))) + panic("bcm_init_platform_data() failed: %d", error); socinfo = bcm_get_socinfo(); platform_counter_freq = socinfo->cpurate * 1000 * 1000; /* BCM4718 is 480MHz */ @@ -267,20 +415,20 @@ platform_start(__register_t a0, __regist static void bcm_cfe_eputc(int c) { - static int fd = -1; unsigned char ch; + int handle; ch = (unsigned char) c; - if (fd == -1) { - if ((fd = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE)) < 0) - return; - } + /* bcm_get_platform() cannot be used here, as we may be called + * from bcm_init_platform_data(). */ + if ((handle = bcm_platform_data.cfe_console) < 0) + return; if (ch == '\n') early_putc('\r'); - while ((cfe_write(fd, &ch, 1)) == 0) + while ((cfe_write(handle, &ch, 1)) == 0) continue; } Added: head/sys/mips/broadcom/bcm_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/broadcom/bcm_machdep.h Fri Aug 26 20:16:02 2016 (r304859) @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2016 Landon Fuller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef _MIPS_BROADCOM_BCM_MACHDEP_H_ +#define _MIPS_BROADCOM_BCM_MACHDEP_H_ + +#include +#include + +#include + +struct bcm_platform { + struct bhnd_chipid id; /**< chip id */ + struct bhnd_core_info cc_id; /**< chipc core info */ + uintptr_t cc_addr; /**< chipc core phys address */ + uint32_t cc_caps; /**< chipc capabilities */ + uint32_t cc_caps_ext; /**< chipc extended capabilies */ + + /* On non-AOB devices, the PMU register block is mapped to chipc; + * the pmu_id and pmu_addr values will be copied from cc_id + * and cc_addr. */ + struct bhnd_core_info pmu_id; /**< PMU core info */ + uintptr_t pmu_addr; /**< PMU core phys address. */ + +#ifdef CFE + int cfe_console; /**< Console handle, or -1 */ +#endif +}; + + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 26 20:20:10 2016 Return-Path: Delivered-To: svn-src-head@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 08439B742FB for ; Fri, 26 Aug 2016 20:20:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9C60319 for ; Fri, 26 Aug 2016 20:20:09 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22b.google.com with SMTP id u134so55228430ywg.3 for ; Fri, 26 Aug 2016 13:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+xKuO1slArU/fL/5CW3Acgp4mFy1t5F2/AbvvRxrYoQ=; b=nrYMfDZ3/cmMrymKMIqzB9pfiCrYFIJ/Sq/6sELF45/CpDKg4qGJj3u2wh8ugenqsu +cR6F3venfDQX9Dr/xtfXV7KuWic4AnEHlQxmmjRHKMjS0pmVurwHtRTVvaMCibMLaCs La9TNqudCrorgDpXS/GCmeGy5ZLdm5BVYuaS2D4OJbMSv3B7sR8yk4d08M26+B1RaYhc tMWWp9ykpLBqx3W59yWk3+ancNCPbiPcH4kzUJQK8pRhhfj7gkH20QcjBRxaA5uRFWr+ XM5N1bjwHNb5H74KAOrA4N2H6rMycc1NQIbl0rqwoR0PS9lf53tO4yXT3rVAeu2mIxBt rnng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+xKuO1slArU/fL/5CW3Acgp4mFy1t5F2/AbvvRxrYoQ=; b=Z2Zt2jDXH/b/G4fjiyl+OVCdO9EWExCkBS129zPv7TwHkaoR5rHp1nOqzCbWilzlDA n36FFaqZJbEGVzFD1F8tBEtWs2hHJJoWYxpBvXr2vPGIRkh4dr2/CkjxGSp5QFubxexa +VKMm7CQy80hYyjAUQH6YiU8BIGt5xosplIeoaN62xIMzoKriCcT7UhPHsWsbkhRRTr/ JTL86tkzo6mzWNfwNQz2mVNL1vuUjp2SQCskKxmX8nTsT2utXEeWdzwuuUliEYbxGAwL NKMwbIrkK7746/6/vjB41PV5Om5+VBAYiObppMqXqgqdHqo3VXFvu5oTo8uqXZ8ytBNi sARA== X-Gm-Message-State: AE9vXwO+n/PhWlapYJsZ9efJqUESvscBtYz2aY5+Y6j9b4sTNyGvB6yNMbz/66eq5EgfECMdAIHXJa/ZTdwllw== X-Received: by 10.129.122.7 with SMTP id v7mr4797920ywc.219.1472242808932; Fri, 26 Aug 2016 13:20:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Fri, 26 Aug 2016 13:20:08 -0700 (PDT) In-Reply-To: <7faebb9e-897a-0a7e-0ec7-c599e8658095@FreeBSD.org> References: <201608120703.u7C73whf007189@repo.freebsd.org> <1ce79adf-94cc-e5d3-7b8b-0914f2b07512@FreeBSD.org> <2038784.5k3koFGWFB@ralph.baldwin.cx> <7faebb9e-897a-0a7e-0ec7-c599e8658095@FreeBSD.org> From: Ed Schouten Date: Fri, 26 Aug 2016 22:20:08 +0200 Message-ID: Subject: Re: svn commit: r303988 - head/lib/libc/gen To: Bryan Drewery Cc: John Baldwin , Guido Falsi , svn-src-head@freebsd.org, jilles@freebsd.org, svn-src-all@freebsd.org, src-committers , Ed Schouten Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 20:20:10 -0000 Hey, 2016-08-26 22:04 GMT+02:00 Bryan Drewery : > On 8/26/2016 12:57 PM, John Baldwin wrote: >> Alternatively, couldn't you just leave basename out of the libgen patch >> for now and only add it once you do the real symver bump for the >> different version? (That is, just use __generic() for dirname() for >> now since that is the only one that has really changed.) > > Doing this also works. > > I think it was done since the prototype did change as well which > disallows building the old xinstall directly, but in the bootstrap build > it is built with MK_WARNS=no so the error is ignored. That's good to know. I'll land this change in a couple of minutes from now, reverting any of the changes related to basename(). Guido, Bryan, thanks for testing! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Fri Aug 26 20:23:11 2016 Return-Path: Delivered-To: svn-src-head@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 6EDAEB744CC; Fri, 26 Aug 2016 20:23:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27B0895D; Fri, 26 Aug 2016 20:23:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QKNA36081273; Fri, 26 Aug 2016 20:23:10 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QKNAAE081271; Fri, 26 Aug 2016 20:23:10 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608262023.u7QKNAAE081271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 26 Aug 2016 20:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304860 - in head: include lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 20:23:11 -0000 Author: ed Date: Fri Aug 26 20:23:10 2016 New Revision: 304860 URL: https://svnweb.freebsd.org/changeset/base/304860 Log: Improve compatibility of calls to dirname() on constant strings. As the xinstall(8) utility had to be patched up to work with the POSIXly correct basename()/dirname() prototypes, we make it pretty hard to build previous versions of FreeBSD on HEAD. xinstall(8) is part of the bootstrap tools. Add some logic to to automatically detect bad calls to dirname() based on the type of the argument. If the argument is of type 'const char *', we simply fall back to calling into dirname@FBSD_1.0 directly. I'll also give basename() similar treatment when importing the thread-safe version of that function. Tested by: bdrewery, madpilot (thanks!) Modified: head/include/libgen.h head/lib/libc/gen/dirname.c Modified: head/include/libgen.h ============================================================================== --- head/include/libgen.h Fri Aug 26 20:16:02 2016 (r304859) +++ head/include/libgen.h Fri Aug 26 20:23:10 2016 (r304860) @@ -39,4 +39,23 @@ char *basename_r(const char *, char *); char *dirname(char *); __END_DECLS +/* + * In FreeBSD 12, the prototype of dirname() was modified to comply to + * POSIX. This function may now modify its input. Unfortunately, our + * copy of xinstall(8) shipped with previous versions of FreeBSD is + * built using the host headers and libc during the bootstrapping phase + * and depends on the old behavior. + * + * Apply a workaround where we explicitly link against dirname@FBSD_1.0 + * in case this function is called on constant strings, instead of + * making the build fail. + */ +#if defined(__generic) && !defined(__cplusplus) +__BEGIN_DECLS +char *__old_dirname(const char *); +__END_DECLS +__sym_compat(dirname, __old_dirname, FBSD_1.0); +#define dirname(x) __generic(x, const char *, __old_dirname, dirname)(x) +#endif + #endif /* !_LIBGEN_H_ */ Modified: head/lib/libc/gen/dirname.c ============================================================================== --- head/lib/libc/gen/dirname.c Fri Aug 26 20:16:02 2016 (r304859) +++ head/lib/libc/gen/dirname.c Fri Aug 26 20:23:10 2016 (r304860) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include char * -dirname(char *path) +(dirname)(char *path) { const char *in, *prev, *begin, *end; char *out; From owner-svn-src-head@freebsd.org Fri Aug 26 21:32:02 2016 Return-Path: Delivered-To: svn-src-head@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 91378B767CA; Fri, 26 Aug 2016 21:32:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 568F817B; Fri, 26 Aug 2016 21:32:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22b.google.com with SMTP id x131so13865435ite.0; Fri, 26 Aug 2016 14:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wJeldIF8xsXC1rpixm5hNF7vdLJLc3cCqQ8wCeyIdjU=; b=V7nbByHgApSSY7xh8KAXPZSCrDORg/CpstGeCxmgAoJkbfhzGAFNPZ5UU+00vlfeVG lssWilYowg/YrwrvKnvQNlaxM42iPtejPBngnME3MuTvYLAPDJvpMGbkXz3mp7ZLyU1a 30SALThoXfJk18D696GfgnrUh1OHOtxCZ6rq5n3fO88b4ArI6PBH3QKJ4/m8Ssm/nKw8 BXOF/0XN35qUYe8+SJBIKr2Wgwkj/9FCdeIJSwZ47s0eAzfdKpg6NpMXL7VBidAzNP3R CExQ9izCrx7+m9zHtgCt15HgANTLodJgj5HrgGaccFujZsjXgXqNZLXqeGxRsV1vbFAA 99dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wJeldIF8xsXC1rpixm5hNF7vdLJLc3cCqQ8wCeyIdjU=; b=VmDmQufBrxiz4LYYVbfXcWhxJrp+Mte6gWuK3RJwHREDsZiV6x34lkwls/Y6ufe5GM ciWx2q3nS+Qht9YM9AAipESTRw7AlXgs6fkJdn4KqZNTPUamOK0V5Y7lYSXzYoOK3ONc 6hJLsyjoOxoTOlVDImeSnhecL+ThBionXCqJOsxCs3sglg2A70t8Lxbz8h1yj2T6s8D0 /GEqv2LK9FHnaAsmo+km1i0h3YJDA7TPfbO8GnJ7qMz4QItI57tbWEe4nIxTolEISBzp lvb3XdGacbE7GhHHtmrqETqzR0gua5Q99EsYtHXgBf8Hwmtv5gWAkfpaB96Xjkw7PvIO 1R3g== X-Gm-Message-State: AE9vXwPc9DaajLN/sQpSaKJwoJ71Ns9zLrPL6qlyB5kh2CGHO0pFJZIwZBOdAZ6D1aNypzvqoYuLdQk3EA1HZg== X-Received: by 10.36.212.6 with SMTP id x6mr1087732itg.71.1472247121770; Fri, 26 Aug 2016 14:32:01 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Fri, 26 Aug 2016 14:32:00 -0700 (PDT) In-Reply-To: <20160826151324.GF88122@zxy.spb.ru> References: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> From: Adrian Chadd Date: Fri, 26 Aug 2016 14:32:00 -0700 X-Google-Sender-Auth: w5OTdB4XYgVIJjEbbPh2Lf3SwBg Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 21:32:02 -0000 Hi, It's pcb lock contention. -adrian On 26 August 2016 at 08:13, Slawa Olhovchenkov wrote: > On Fri, Aug 26, 2016 at 04:01:14PM +0100, Bruce Simpson wrote: > >> Slawa, >> >> I'm afraid this may be a bit of a non-sequitur. Sorry.. I seem to be >> missing something. As I understand it this thread is about Ryan's change >> to netinet for broadcast. >> >> On 26/08/16 15:49, Slawa Olhovchenkov wrote: >> > On Sun, Aug 21, 2016 at 03:04:00AM +0300, Slawa Olhovchenkov wrote: >> >> On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: >> >>> Whilst I agree with your concerns about multipoint, I support the >> >>> motivation behind Ryan's original change: optimize the common case. >> >> >> >> Oh, common case... >> >> I am have pmc profiling for TCP output and see on this SVG picture and >> >> don't find any simple way. >> >> You want to watch too? >> > >> > At time peak network traffic (more then 25K connections, about 20Gbit >> > total traffic) half of cores fully utilised by network stack. >> > >> > This is flamegraph from one core: http://zxy.spb.ru/cpu10.svg >> > This is same, but stack cut of at ixgbe_rxeof for more unified >> > tcp/ip stack view http://zxy.spb.ru/cpu10u.svg >> ... >> >> I appreciate that you've taken the time to post a flamegraph (a >> fashionable visualization) of relative performance in the FreeBSD >> networking stack. >> >> Sadly, I am mostly out of my depth for looking at stack wide performance >> for the moment; for the things I look at involving FreeBSD at work just >> at the moment, I would not generally go down there except for specific >> performance issues (e.g. with IEEE 1588). >> >> It sounds as though perhaps you should raise a wider discussion about >> your results on -net. I would caution you however that the Function >> Boundary Trace (FBT) provider for DTrace can introduce a fair amount of >> noise to the raw performance data because of the trap mechanism it uses. >> This ruled it out for one of my own studies requiring packet-level accuracy. >> >> Whilst raw pmc(4) profiles may require more post-processing, they will >> provide less equivocal data (and a better fix) on the hot path, due also >> to being sampled effectively on a PMC interrupt (a gather stage- poll >> core+uncore MSRs), not purely a software timer interrupt. > > Thanks for answer, I am now try to start discussion on -net. From owner-svn-src-head@freebsd.org Fri Aug 26 21:36:16 2016 Return-Path: Delivered-To: svn-src-head@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 E5706B76863; Fri, 26 Aug 2016 21:36:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 A4CDF790; Fri, 26 Aug 2016 21:36:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bdOnN-000GrF-FX; Sat, 27 Aug 2016 00:36:13 +0300 Date: Sat, 27 Aug 2016 00:36:13 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160826213613.GH88122@zxy.spb.ru> References: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 21:36:17 -0000 On Fri, Aug 26, 2016 at 02:32:00PM -0700, Adrian Chadd wrote: > Hi, > > It's pcb lock contention. Not sure: only 5% of all time. And same 5% for tcbhashsize = 65K and 256K. Or you talk about some more thin effect? > > On 26 August 2016 at 08:13, Slawa Olhovchenkov wrote: > > On Fri, Aug 26, 2016 at 04:01:14PM +0100, Bruce Simpson wrote: > > > >> Slawa, > >> > >> I'm afraid this may be a bit of a non-sequitur. Sorry.. I seem to be > >> missing something. As I understand it this thread is about Ryan's change > >> to netinet for broadcast. > >> > >> On 26/08/16 15:49, Slawa Olhovchenkov wrote: > >> > On Sun, Aug 21, 2016 at 03:04:00AM +0300, Slawa Olhovchenkov wrote: > >> >> On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: > >> >>> Whilst I agree with your concerns about multipoint, I support the > >> >>> motivation behind Ryan's original change: optimize the common case. > >> >> > >> >> Oh, common case... > >> >> I am have pmc profiling for TCP output and see on this SVG picture and > >> >> don't find any simple way. > >> >> You want to watch too? > >> > > >> > At time peak network traffic (more then 25K connections, about 20Gbit > >> > total traffic) half of cores fully utilised by network stack. > >> > > >> > This is flamegraph from one core: http://zxy.spb.ru/cpu10.svg > >> > This is same, but stack cut of at ixgbe_rxeof for more unified > >> > tcp/ip stack view http://zxy.spb.ru/cpu10u.svg > >> ... > >> > >> I appreciate that you've taken the time to post a flamegraph (a > >> fashionable visualization) of relative performance in the FreeBSD > >> networking stack. > >> > >> Sadly, I am mostly out of my depth for looking at stack wide performance > >> for the moment; for the things I look at involving FreeBSD at work just > >> at the moment, I would not generally go down there except for specific > >> performance issues (e.g. with IEEE 1588). > >> > >> It sounds as though perhaps you should raise a wider discussion about > >> your results on -net. I would caution you however that the Function > >> Boundary Trace (FBT) provider for DTrace can introduce a fair amount of > >> noise to the raw performance data because of the trap mechanism it uses. > >> This ruled it out for one of my own studies requiring packet-level accuracy. > >> > >> Whilst raw pmc(4) profiles may require more post-processing, they will > >> provide less equivocal data (and a better fix) on the hot path, due also > >> to being sampled effectively on a PMC interrupt (a gather stage- poll > >> core+uncore MSRs), not purely a software timer interrupt. > > > > Thanks for answer, I am now try to start discussion on -net. From owner-svn-src-head@freebsd.org Fri Aug 26 21:42:29 2016 Return-Path: Delivered-To: svn-src-head@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 5BA98B76A44; Fri, 26 Aug 2016 21:42:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18F64DE3; Fri, 26 Aug 2016 21:42:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x232.google.com with SMTP id g62so13574753ith.1; Fri, 26 Aug 2016 14:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=UZEs+/nkExghu/GnwI3muBgOshHjMbyqlyXbomvnpvU=; b=qH1Ot8FvZRD2dEUF72Q5I66TT14WE46BrJzsEnuYJINEfjYjuP/QlDohLhVj6iwxb6 QBEW55XWpyEoshahIEYboKG5lGVAQc3KmIUX8hQQMcWtpv7OiyrLIlwV46jgmfQUNQMw 0J6DRfJqLtTafxhIbwEthDwKq115SbH6j4bErgnkPp/AcjHf4E52xKVoi6F87wZHG0zg x3n0F/nqN5of5tLBX+ymx0XC7UjMkvIUJVIn/3rAwPwEGc6hYxbEHydVrszUi0Sk7L2V toHWD4LKaewY0folu9HqaDYQhOut/zCH/sMyz4GptRVMG0H2yLWOVCvlXgF5QAjF25IV nkYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=UZEs+/nkExghu/GnwI3muBgOshHjMbyqlyXbomvnpvU=; b=K42h63YTslchm3mOdHkoVj+jZ/ZCgRdbBvKg8BXHqvpntHj6+jSEqAksp2VpmptuLT Wif15RH2pFPMp9L9pAeI1Aau9AwIBM0KJFIhUgaWI/vQqJGof3Gyg+1LE7QY+BkcV4AN 7hCYCrgYgOhJFoq27LE5I0dfUMaGlj2jG4tX2VTPDYBPE5m7uCCZUue4/o6BP6pnC94c GS5d3k5jwPdhK8eUsmO+ZxoQSKkLfNDQ7tY/XDWVshcbKjwkz6+67U8MuC0J8cFyAYF3 B/nRtzVaZ6S5JERS6xjgjBNZwFuHk8atcjTkwoxRAsJNVn9PP0Nwozx0uGvGDz/g7l16 Srag== X-Gm-Message-State: AE9vXwMGXSEoCP9BIG+cJWIe+y2tGyw2W4/MgNMXkTHW9FW4CZOPhFdSZ8fVsiSY/ot0XidM3DpFLS4YDVsEOg== X-Received: by 10.107.15.229 with SMTP id 98mr6449397iop.123.1472247748515; Fri, 26 Aug 2016 14:42:28 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Fri, 26 Aug 2016 14:42:27 -0700 (PDT) In-Reply-To: <20160826213613.GH88122@zxy.spb.ru> References: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> From: Adrian Chadd Date: Fri, 26 Aug 2016 14:42:27 -0700 X-Google-Sender-Auth: glQGm2oRtk38f40WrA2sVTme230 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 21:42:29 -0000 On 26 August 2016 at 14:36, Slawa Olhovchenkov wrote: > On Fri, Aug 26, 2016 at 02:32:00PM -0700, Adrian Chadd wrote: > >> Hi, >> >> It's pcb lock contention. > > Not sure: only 5% of all time. > And same 5% for tcbhashsize = 65K and 256K. > Or you talk about some more thin effect? You're in the inpcb lock from multiple places. the tcbhashsize doesnt influence the pcb lock contention - it just affects how long you take doing lookups. iF your hash table is too small then you end up doing lots of O(n) walks of a hash bucket to find a pcb entry. :) -adrian >> >> On 26 August 2016 at 08:13, Slawa Olhovchenkov wrote: >> > On Fri, Aug 26, 2016 at 04:01:14PM +0100, Bruce Simpson wrote: >> > >> >> Slawa, >> >> >> >> I'm afraid this may be a bit of a non-sequitur. Sorry.. I seem to be >> >> missing something. As I understand it this thread is about Ryan's change >> >> to netinet for broadcast. >> >> >> >> On 26/08/16 15:49, Slawa Olhovchenkov wrote: >> >> > On Sun, Aug 21, 2016 at 03:04:00AM +0300, Slawa Olhovchenkov wrote: >> >> >> On Sun, Aug 21, 2016 at 12:25:46AM +0100, Bruce Simpson wrote: >> >> >>> Whilst I agree with your concerns about multipoint, I support the >> >> >>> motivation behind Ryan's original change: optimize the common case. >> >> >> >> >> >> Oh, common case... >> >> >> I am have pmc profiling for TCP output and see on this SVG picture and >> >> >> don't find any simple way. >> >> >> You want to watch too? >> >> > >> >> > At time peak network traffic (more then 25K connections, about 20Gbit >> >> > total traffic) half of cores fully utilised by network stack. >> >> > >> >> > This is flamegraph from one core: http://zxy.spb.ru/cpu10.svg >> >> > This is same, but stack cut of at ixgbe_rxeof for more unified >> >> > tcp/ip stack view http://zxy.spb.ru/cpu10u.svg >> >> ... >> >> >> >> I appreciate that you've taken the time to post a flamegraph (a >> >> fashionable visualization) of relative performance in the FreeBSD >> >> networking stack. >> >> >> >> Sadly, I am mostly out of my depth for looking at stack wide performance >> >> for the moment; for the things I look at involving FreeBSD at work just >> >> at the moment, I would not generally go down there except for specific >> >> performance issues (e.g. with IEEE 1588). >> >> >> >> It sounds as though perhaps you should raise a wider discussion about >> >> your results on -net. I would caution you however that the Function >> >> Boundary Trace (FBT) provider for DTrace can introduce a fair amount of >> >> noise to the raw performance data because of the trap mechanism it uses. >> >> This ruled it out for one of my own studies requiring packet-level accuracy. >> >> >> >> Whilst raw pmc(4) profiles may require more post-processing, they will >> >> provide less equivocal data (and a better fix) on the hot path, due also >> >> to being sampled effectively on a PMC interrupt (a gather stage- poll >> >> core+uncore MSRs), not purely a software timer interrupt. >> > >> > Thanks for answer, I am now try to start discussion on -net. From owner-svn-src-head@freebsd.org Fri Aug 26 22:02:57 2016 Return-Path: Delivered-To: svn-src-head@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 E6979B76D68; Fri, 26 Aug 2016 22:02:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 A5D712E2; Fri, 26 Aug 2016 22:02:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bdPDD-000HRb-M8; Sat, 27 Aug 2016 01:02:55 +0300 Date: Sat, 27 Aug 2016 01:02:55 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160826220255.GI88122@zxy.spb.ru> References: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 22:02:58 -0000 On Fri, Aug 26, 2016 at 02:42:27PM -0700, Adrian Chadd wrote: > On 26 August 2016 at 14:36, Slawa Olhovchenkov wrote: > > On Fri, Aug 26, 2016 at 02:32:00PM -0700, Adrian Chadd wrote: > > > >> Hi, > >> > >> It's pcb lock contention. > > > > Not sure: only 5% of all time. > > And same 5% for tcbhashsize = 65K and 256K. > > Or you talk about some more thin effect? > > You're in the inpcb lock from multiple places. For tcp case I am found only 3 places: in_pcbdrop in_pcbremlists in_pcblookup_hash > the tcbhashsize doesnt influence the pcb lock contention - it just > affects how long you take doing lookups. iF your hash table is too > small then you end up doing lots of O(n) walks of a hash bucket to > find a pcb entry. :) Hmm. I am not clearly understund you. How originate pcb lock contention? How I can see this (in pmc profile, in dtarce probese)? From owner-svn-src-head@freebsd.org Fri Aug 26 23:14:14 2016 Return-Path: Delivered-To: svn-src-head@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 F3A98B76A99; Fri, 26 Aug 2016 23:14:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DD8A9DF1; Fri, 26 Aug 2016 23:14:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u7QNEC0F076083 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 26 Aug 2016 16:14:13 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7QNEC5Z076082; Fri, 26 Aug 2016 16:14:12 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 26 Aug 2016 16:14:12 -0700 From: Gleb Smirnoff To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304244 - head/sys/kern Message-ID: <20160826231412.GP1069@FreeBSD.org> References: <201608162155.u7GLtYp4091232@repo.freebsd.org> <529d7219-4dc9-eb06-2a5d-682c725855f6@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <529d7219-4dc9-eb06-2a5d-682c725855f6@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 23:14:14 -0000 On Sat, Aug 20, 2016 at 10:18:14AM -0700, Bryan Drewery wrote: B> On 8/16/2016 2:55 PM, Gleb Smirnoff wrote: B> > Author: glebius B> > Date: Tue Aug 16 21:55:34 2016 B> > New Revision: 304244 B> > URL: https://svnweb.freebsd.org/changeset/base/304244 B> > B> > Log: B> > We should not be allowing a timeout to reset when a drain is in progress on B> > it (either async or sync drain). B> > B> > At this moment the only user of drain is TCP, but TCP wouldn't reschedule a B> > callout after it has drained it, since it drains only when a tcpcb is closed. B> > This for now the problem isn't observed. B> > B> > Submitted by: rrs B> B> Should this be MFC'd into 11.0? I'm bit on fence on this. As said this is commit for a problem not observed. I prefer not to touch stable branches for no good reason. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Aug 26 23:18:20 2016 Return-Path: Delivered-To: svn-src-head@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 42FDBB76B3E; Fri, 26 Aug 2016 23:18:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2478BFA3; Fri, 26 Aug 2016 23:18:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11868B953; Fri, 26 Aug 2016 19:18:19 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304858 - in head/sys/amd64/vmm: . io Date: Fri, 26 Aug 2016 13:18:43 -0700 Message-ID: <1696735.VsWPYRr5di@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608262015.u7QKFNTS077409@repo.freebsd.org> References: <201608262015.u7QKFNTS077409@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 26 Aug 2016 19:18:19 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 23:18:20 -0000 On Friday, August 26, 2016 08:15:23 PM John Baldwin wrote: > Author: jhb > Date: Fri Aug 26 20:15:22 2016 > New Revision: 304858 > URL: https://svnweb.freebsd.org/changeset/base/304858 > > Log: > Enable I/O MMU when PCI pass through is first used. > > Rather than enabling the I/O MMU when the vmm module is loaded, > defer initialization until the first attempt to pass a PCI device > through to a guest. If the I/O MMU fails to initialize or is not > present, than fail the attempt to pass a PCI device through to a > guest. > > The hw.vmm.force_iommu tunable has been removed since the I/O MMU is > no longer enabled during boot. However, the I/O MMU support can be > disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent > use of the I/O MMU on any systems where it is buggy. > > Reviewed by: grehan > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D7448 Forgot 'Sponsored by: Chelsio Communications' Previously if you did the following: # kldload vmm # devctl set driver ppt And then started a virtual machine that used ppt0 as a PCI pass through device, the I/O MMU was never enabled. The result was that DMA requests for the PCI device weren't translated. This would cause the driver to not work in the guest and possibly trash memory in either the guest or host. Now the I/O MMU is always enabled before passing a device to a guest, and if the I/O MMU doesn't work for some reason, bhyve will fail to start the guest. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Aug 26 23:50:45 2016 Return-Path: Delivered-To: svn-src-head@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 6025FB761EF; Fri, 26 Aug 2016 23:50:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F39CB9C6; Fri, 26 Aug 2016 23:50:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QNoi5T055731; Fri, 26 Aug 2016 23:50:44 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QNoi6p055729; Fri, 26 Aug 2016 23:50:44 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201608262350.u7QNoi6p055729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 26 Aug 2016 23:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304869 - in head/contrib/libarchive: libarchive tar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 23:50:45 -0000 Author: mm Date: Fri Aug 26 23:50:44 2016 New Revision: 304869 URL: https://svnweb.freebsd.org/changeset/base/304869 Log: MFV r304866: Sync libarchive with vendor including security fixes Vendor issues fixed: Issue #731: Reject tar entries >= INT64_MAX Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames Issue #748: Zip decompression failure with highly-compressed data Issue #767: Buffer overflow printing a filename Issue #770: Zip read: be more careful about extra_length MFC after: 3 days Modified: head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/tar/util.c Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Fri Aug 26 22:56:23 2016 (r304868) +++ head/contrib/libarchive/libarchive/archive_acl.c Fri Aug 26 23:50:44 2016 (r304869) @@ -57,21 +57,27 @@ static int archive_acl_add_entry_len_l(s size_t len, struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); +static int parse_nfs4_flags_w(const wchar_t *start, const wchar_t *end, + int *result); +static int parse_nfs4_perms_w(const wchar_t *start, const wchar_t *end, + int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, const wchar_t **end, wchar_t *sep); static int prefix_w(const wchar_t *start, const wchar_t *end, const wchar_t *test); -static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id); +static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, const wchar_t *wname, int perm, int id); static void append_id_w(wchar_t **wp, int id); static int isint(const char *start, const char *end, int *result); static int ismode(const char *start, const char *end, int *result); +static int parse_nfs4_flags(const char *start, const char *end, int *result); +static int parse_nfs4_perms(const char *start, const char *end, int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); static int prefix_c(const char *start, const char *end, const char *test); -static void append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id); +static void append_entry(char **p, const char *prefix, int type, + int tag, const char *name, int perm, int id); static void append_id(char **p, int id); void @@ -447,6 +453,16 @@ archive_acl_text_w(struct archive *a, st int id, r; wchar_t *wp; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) && + (flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT))) { + /* cannot convert NFSv4 ACLs and POSIX1e ACLs at the same time */ + return (NULL); + } + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) && (flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) { + /* cannot have access and default at the same time */ + return (NULL); + } + if (acl->acl_text_w != NULL) { free (acl->acl_text_w); acl->acl_text_w = NULL; @@ -462,17 +478,57 @@ archive_acl_text_w(struct archive *a, st if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) length += 8; /* "default:" */ - length += 5; /* tag name */ + switch (ap->tag) { + case ARCHIVE_ENTRY_ACL_USER_OBJ: + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + length += 6; /* "owner@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_USER: + length += 4; /* "user" */ + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + length += 6; /* "group@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_GROUP: + case ARCHIVE_ENTRY_ACL_OTHER: + length += 5; /* "group", "other" */ + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + length += 9; /* "everyone@" */ + break; + } length += 1; /* colon */ - r = archive_mstring_get_wcs(a, &ap->name, &wname); - if (r == 0 && wname != NULL) - length += wcslen(wname); - else if (r < 0 && errno == ENOMEM) - return (NULL); + if (((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) || + ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0 && wname != NULL) + length += wcslen(wname); + else if (r < 0 && errno == ENOMEM) + return (NULL); + else + length += sizeof(uid_t) * 3 + 1; + length += 1; /* colon */ + } + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) + length += 14; /* rwxpdDaARWcCos */ else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ - length += 3; /* rwx */ + length += 3; /* rwx */ + length += 1; /* colon */ + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + length += 7; /* fdinSFI */ + length += 1; /* colon */ + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DENY) != 0) + length += 4; /* deny */ + else + length += 5; /* allow, alarm, audit */ + length += 1; /* colon */ + } length += 1; /* colon */ length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; length ++; /* newline */ @@ -480,34 +536,39 @@ archive_acl_text_w(struct archive *a, st ap = ap->next; } - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { + if (count == 0) + return (NULL); + + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { length += 10; /* "user::rwx\n" */ length += 11; /* "group::rwx\n" */ length += 11; /* "other::rwx\n" */ } - if (count == 0) - return (NULL); - /* Now, allocate the string and actually populate it. */ wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t)); if (wp == NULL) return (NULL); count = 0; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, - acl->mode & 0700, -1); + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, acl->mode & 0700, -1); *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, - acl->mode & 0070, -1); + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, acl->mode & 0070, -1); *wp++ = ','; - append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, - acl->mode & 0007, -1); + append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, NULL, acl->mode & 0007, -1); count += 3; + } + if ((flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | + ARCHIVE_ENTRY_ACL_TYPE_NFS4)) != 0) { ap = acl->acl_head; while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + if ((ap->type & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | + ARCHIVE_ENTRY_ACL_TYPE_NFS4)) != 0) { r = archive_mstring_get_wcs(a, &ap->name, &wname); if (r == 0) { *wp++ = separator; @@ -515,8 +576,8 @@ archive_acl_text_w(struct archive *a, st id = ap->id; else id = -1; - append_entry_w(&wp, NULL, ap->tag, wname, - ap->permset, id); + append_entry_w(&wp, NULL, ap->type, ap->tag, + wname, ap->permset, id); count++; } else if (r < 0 && errno == ENOMEM) return (NULL); @@ -525,7 +586,6 @@ archive_acl_text_w(struct archive *a, st } } - if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) { if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) prefix = L"default:"; @@ -543,8 +603,8 @@ archive_acl_text_w(struct archive *a, st id = ap->id; else id = -1; - append_entry_w(&wp, prefix, ap->tag, - wname, ap->permset, id); + append_entry_w(&wp, prefix, ap->type, + ap->tag, wname, ap->permset, id); count ++; } else if (r < 0 && errno == ENOMEM) return (NULL); @@ -568,8 +628,8 @@ append_id_w(wchar_t **wp, int id) } static void -append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, - const wchar_t *wname, int perm, int id) +append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, + int tag, const wchar_t *wname, int perm, int id) { if (prefix != NULL) { wcscpy(*wp, prefix); @@ -579,6 +639,11 @@ append_entry_w(wchar_t **wp, const wchar case ARCHIVE_ENTRY_ACL_USER_OBJ: wname = NULL; id = -1; + if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + wcscpy(*wp, L"owner@"); + break; + } + /* FALLTHROUGH */ /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: wcscpy(*wp, L"user"); @@ -603,18 +668,57 @@ append_entry_w(wchar_t **wp, const wchar } *wp += wcslen(*wp); *(*wp)++ = L':'; - if (wname != NULL) { - wcscpy(*wp, wname); + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0 || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (wname != NULL) { + wcscpy(*wp, wname); + *wp += wcslen(*wp); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id_w(wp, id); + id = -1; + } + *(*wp)++ = L':'; + } + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_READ | + ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? L'r' : L'-'; + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE | + ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? L'w' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? L'x' : L'-'; + if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? L'p' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? L'd' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? L'D' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? L'a' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? L'A' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? L'R' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? L'W' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? L'c' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? L'C' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? L'o' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? L's' : L'-'; + *(*wp)++ = L':'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? L'f' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? L'd' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? L'i' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? L'n' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? L'S' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? L'F' : L'-'; + *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? L'I' : L'-'; + *(*wp)++ = L':'; + if (type & ARCHIVE_ENTRY_ACL_TYPE_ALLOW) + wcscpy(*wp, L"allow"); + else if (type & ARCHIVE_ENTRY_ACL_TYPE_DENY) + wcscpy(*wp, L"deny"); + else if (type & ARCHIVE_ENTRY_ACL_TYPE_AUDIT) + wcscpy(*wp, L"audit"); + else if (type & ARCHIVE_ENTRY_ACL_TYPE_ALARM) + wcscpy(*wp, L"alarm"); *wp += wcslen(*wp); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id_w(wp, id); - id = -1; } - *(*wp)++ = L':'; - *(*wp)++ = (perm & 0444) ? L'r' : L'-'; - *(*wp)++ = (perm & 0222) ? L'w' : L'-'; - *(*wp)++ = (perm & 0111) ? L'x' : L'-'; if (id != -1) { *(*wp)++ = L':'; append_id_w(wp, id); @@ -637,6 +741,16 @@ archive_acl_text_l(struct archive_acl *a int id, r; char *p; + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) && + (flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT))) { + /* cannot convert NFSv4 ACLs and POSIX1e ACLs at the same time */ + return (-1); + } + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) && (flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) { + /* cannot have access and default at the same time */ + return (-1); + } + if (acl->acl_text != NULL) { free (acl->acl_text); acl->acl_text = NULL; @@ -655,63 +769,109 @@ archive_acl_text_l(struct archive_acl *a if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)) length += 8; /* "default:" */ - length += 5; /* tag name */ + switch (ap->tag) { + case ARCHIVE_ENTRY_ACL_USER_OBJ: + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + length += 6; /* "owner@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_USER: + length += 4; /* "user" */ + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + length += 6; /* "group@" */ + break; + } + /* FALLTHROUGH */ + case ARCHIVE_ENTRY_ACL_GROUP: + case ARCHIVE_ENTRY_ACL_OTHER: + length += 5; /* "group", "other" */ + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + length += 9; /* "everyone@" */ + break; + } + length += 1; /* colon */ - r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); - if (r != 0) - return (-1); - if (len > 0 && name != NULL) - length += len; + if (((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) || + ap->tag == ARCHIVE_ENTRY_ACL_USER || + ap->tag == ARCHIVE_ENTRY_ACL_GROUP) { + r = archive_mstring_get_mbs_l( + &ap->name, &name, &len, sc); + if (r != 0) + return (-1); + if (len > 0 && name != NULL) + length += len; + else + length += sizeof(uid_t) * 3 + 1; + length += 1; /* colon */ + } + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) + length += 14; /* rwxpdDaARWcCos */ else - length += sizeof(uid_t) * 3 + 1; - length ++; /* colon */ - length += 3; /* rwx */ + length += 3; /* rwx */ length += 1; /* colon */ + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { + length += 7; /* fdinSFI */ + length += 1; /* colon */ + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DENY) != 0) + length += 4; /* deny */ + else + length += 5; /* allow, alarm, audit */ + length += 1; /* colon */ + } + length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1; length ++; /* newline */ } ap = ap->next; } - if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) { + if (count == 0) + return (0); + + if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { length += 10; /* "user::rwx\n" */ length += 11; /* "group::rwx\n" */ length += 11; /* "other::rwx\n" */ } - if (count == 0) - return (0); - /* Now, allocate the string and actually populate it. */ p = acl->acl_text = (char *)malloc(length); if (p == NULL) return (-1); count = 0; if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, - acl->mode & 0700, -1); + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, acl->mode & 0700, -1); *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, - acl->mode & 0070, -1); + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL, acl->mode & 0070, -1); *p++ = ','; - append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL, - acl->mode & 0007, -1); + append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_OTHER, NULL, acl->mode & 0007, -1); count += 3; + } + if ((flags & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | + ARCHIVE_ENTRY_ACL_TYPE_NFS4)) != 0) { for (ap = acl->acl_head; ap != NULL; ap = ap->next) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) == 0) + if ((ap->type & (ARCHIVE_ENTRY_ACL_TYPE_ACCESS | + ARCHIVE_ENTRY_ACL_TYPE_NFS4)) == 0) continue; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); if (r != 0) return (-1); - *p++ = separator; + if (count > 0) + *p++ = separator; if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) id = ap->id; else id = -1; - append_entry(&p, NULL, ap->tag, name, + append_entry(&p, NULL, ap->type, ap->tag, name, ap->permset, id); count++; } @@ -737,7 +897,7 @@ archive_acl_text_l(struct archive_acl *a id = ap->id; else id = -1; - append_entry(&p, prefix, ap->tag, + append_entry(&p, prefix, ap->type, ap->tag, name, ap->permset, id); count ++; } @@ -760,8 +920,8 @@ append_id(char **p, int id) } static void -append_entry(char **p, const char *prefix, int tag, - const char *name, int perm, int id) +append_entry(char **p, const char *prefix, int type, + int tag, const char *name, int perm, int id) { if (prefix != NULL) { strcpy(*p, prefix); @@ -771,6 +931,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_USER_OBJ: name = NULL; id = -1; + if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + strcpy(*p, "owner@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_USER: strcpy(*p, "user"); @@ -778,6 +942,10 @@ append_entry(char **p, const char *prefi case ARCHIVE_ENTRY_ACL_GROUP_OBJ: name = NULL; id = -1; + if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + strcpy(*p, "group@"); + break; + } /* FALLTHROUGH */ case ARCHIVE_ENTRY_ACL_GROUP: strcpy(*p, "group"); @@ -792,21 +960,65 @@ append_entry(char **p, const char *prefi name = NULL; id = -1; break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + strcpy(*p, "everyone@"); + name = NULL; + id = -1; + break; } *p += strlen(*p); *(*p)++ = ':'; - if (name != NULL) { - strcpy(*p, name); + if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0 || + tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + if (name != NULL) { + strcpy(*p, name); + *p += strlen(*p); + } else if (tag == ARCHIVE_ENTRY_ACL_USER + || tag == ARCHIVE_ENTRY_ACL_GROUP) { + append_id(p, id); + id = -1; + } + *(*p)++ = ':'; + } + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_READ | + ARCHIVE_ENTRY_ACL_READ_DATA | + ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? 'r' : '-'; + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE | + ARCHIVE_ENTRY_ACL_WRITE_DATA | + ARCHIVE_ENTRY_ACL_ADD_FILE)) ? 'w' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? 'x' : '-'; + if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? 'p' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? 'd' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? 'D' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? 'a' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? 'A' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? 'R' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? 'W' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? 'c' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? 'C' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? 'o' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? 's' : '-'; + *(*p)++ = ':'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? 'f' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? 'd' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? 'i' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? 'n' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? 'S' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? 'F' : '-'; + *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? 'I' : '-'; + *(*p)++ = ':'; + if (type & ARCHIVE_ENTRY_ACL_TYPE_ALLOW) + strcpy(*p, "allow"); + else if (type & ARCHIVE_ENTRY_ACL_TYPE_DENY) + strcpy(*p, "deny"); + else if (type & ARCHIVE_ENTRY_ACL_TYPE_AUDIT) + strcpy(*p, "audit"); + else if (type & ARCHIVE_ENTRY_ACL_TYPE_ALARM) + strcpy(*p, "alarm"); *p += strlen(*p); - } else if (tag == ARCHIVE_ENTRY_ACL_USER - || tag == ARCHIVE_ENTRY_ACL_GROUP) { - append_id(p, id); - id = -1; } - *(*p)++ = ':'; - *(*p)++ = (perm & 0444) ? 'r' : '-'; - *(*p)++ = (perm & 0222) ? 'w' : '-'; - *(*p)++ = (perm & 0111) ? 'x' : '-'; if (id != -1) { *(*p)++ = ':'; append_id(p, id); @@ -827,12 +1039,19 @@ archive_acl_parse_w(struct archive_acl * struct { const wchar_t *start; const wchar_t *end; - } field[4], name; + } field[6], name; - int fields, n; + int numfields, fields, n; int type, tag, permset, id; + int offset; wchar_t sep; + if (default_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) + numfields = 6; + else + numfields = 4; + + while (text != NULL && *text != L'\0') { /* * Parse the fields out of the next entry, @@ -842,7 +1061,7 @@ archive_acl_parse_w(struct archive_acl * do { const wchar_t *start, *end; next_field_w(&text, &start, &end, &sep); - if (fields < 4) { + if (fields < numfields) { field[fields].start = start; field[fields].end = end; } @@ -850,72 +1069,148 @@ archive_acl_parse_w(struct archive_acl * } while (sep == L':'); /* Set remaining fields to blank. */ - for (n = fields; n < 4; ++n) + for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - /* Check for a numeric ID in field 1 or 3. */ - id = -1; - isint_w(field[1].start, field[1].end, &id); - /* Field 3 is optional. */ - if (id == -1 && fields > 3) - isint_w(field[3].start, field[3].end, &id); + if (default_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* POSIX.1e ACLs */ + /* Check for a numeric ID in field 1 or 3. */ + id = -1; + isint_w(field[1].start, field[1].end, &id); + /* Field 3 is optional. */ + if (id == -1 && fields > 3) + isint_w(field[3].start, field[3].end, &id); + + /* + * Solaris extension: "defaultuser::rwx" is the + * default ACL corresponding to "user::rwx", etc. + */ + if (field[0].end - field[0].start > 7 + && wmemcmp(field[0].start, L"default", 7) == 0) { + type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + field[0].start += 7; + } else + type = default_type; - /* - * Solaris extension: "defaultuser::rwx" is the - * default ACL corresponding to "user::rwx", etc. - */ - if (field[0].end - field[0].start > 7 - && wmemcmp(field[0].start, L"default", 7) == 0) { - type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; - field[0].start += 7; - } else - type = default_type; - - name.start = name.end = NULL; - if (prefix_w(field[0].start, field[0].end, L"user")) { - if (!ismode_w(field[2].start, field[2].end, &permset)) + name.start = name.end = NULL; + if (prefix_w(field[0].start, field[0].end, L"user")) { + if (!ismode_w(field[2].start, field[2].end, + &permset)) return (ARCHIVE_WARN); - if (id != -1 || field[1].start < field[1].end) { - tag = ARCHIVE_ENTRY_ACL_USER; - name = field[1]; + if (id != -1 || field[1].start < field[1].end) { + tag = ARCHIVE_ENTRY_ACL_USER; + name = field[1]; + } else + tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + } else if (prefix_w(field[0].start, field[0].end, + L"group")) { + if (!ismode_w(field[2].start, field[2].end, + &permset)) + return (ARCHIVE_WARN); + if (id != -1 || field[1].start < field[1].end) { + tag = ARCHIVE_ENTRY_ACL_GROUP; + name = field[1]; + } else + tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + } else if (prefix_w(field[0].start, field[0].end, + L"other")) { + if (fields == 2 + && field[1].start < field[1].end + && ismode_w(field[1].start, field[1].end, + &permset)) { + /* This is Solaris-style "other:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode_w(field[2].start, field[2].end, + &permset)) { + /* This is FreeBSD-style "other::rwx" */ + } else + return (ARCHIVE_WARN); + tag = ARCHIVE_ENTRY_ACL_OTHER; + } else if (prefix_w(field[0].start, field[0].end, + L"mask")) { + if (fields == 2 + && field[1].start < field[1].end + && ismode_w(field[1].start, field[1].end, + &permset)) { + /* This is Solaris-style "mask:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode_w(field[2].start, field[2].end, + &permset)) { + /* This is FreeBSD-style "mask::rwx" */ + } else + return (ARCHIVE_WARN); + tag = ARCHIVE_ENTRY_ACL_MASK; } else - tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - } else if (prefix_w(field[0].start, field[0].end, L"group")) { - if (!ismode_w(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); - if (id != -1 || field[1].start < field[1].end) { + } else { + /* NFSv4 ACLs */ + if (wcsncmp(field[0].start, L"user", + field[0].end - field[0].start) == 0) + tag = ARCHIVE_ENTRY_ACL_USER; + else if (wcsncmp(field[0].start, L"group", + field[0].end - field[0].start) == 0) tag = ARCHIVE_ENTRY_ACL_GROUP; - name = field[1]; - } else + else if (wcsncmp(field[0].start, L"owner@", + field[0].end - field[0].start) == 0) + tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + else if (wcsncmp(field[0].start, L"group@", + field[0].end - field[0].start) == 0) tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - } else if (prefix_w(field[0].start, field[0].end, L"other")) { - if (fields == 2 - && field[1].start < field[1].end - && ismode_w(field[1].start, field[1].end, &permset)) { - /* This is Solaris-style "other:rwx" */ - } else if (fields == 3 - && field[1].start == field[1].end - && field[2].start < field[2].end - && ismode_w(field[2].start, field[2].end, &permset)) { - /* This is FreeBSD-style "other::rwx" */ - } else + else if (wcsncmp(field[0].start, L"everyone@", + field[0].end - field[0].start) == 0) + tag = ARCHIVE_ENTRY_ACL_EVERYONE; + else { + /* Unknown entry */ return (ARCHIVE_WARN); - tag = ARCHIVE_ENTRY_ACL_OTHER; - } else if (prefix_w(field[0].start, field[0].end, L"mask")) { - if (fields == 2 - && field[1].start < field[1].end - && ismode_w(field[1].start, field[1].end, &permset)) { - /* This is Solaris-style "mask:rwx" */ - } else if (fields == 3 - && field[1].start == field[1].end - && field[2].start < field[2].end - && ismode_w(field[2].start, field[2].end, &permset)) { - /* This is FreeBSD-style "mask::rwx" */ + } + + permset = 0; + name.start = name.end = NULL; + + if (tag == ARCHIVE_ENTRY_ACL_USER || + tag == ARCHIVE_ENTRY_ACL_GROUP) { + offset = 1; + name = field[1]; } else + offset = 0; + + if (parse_nfs4_perms_w(field[1 + offset].start, + field[1 + offset].end, &permset) != 0) { + /* NFS4 perms are invalid */ + return (ARCHIVE_WARN); + } + if (parse_nfs4_flags_w(field[2 + offset].start, + field[2 + offset].end, &permset) != 0) { + /* NFS4 flags are invalid */ + return (ARCHIVE_WARN); + } + if (wcsncmp(field[3 + offset].start, L"allow", + field[3 + offset].end - field[3 + offset].start) + == 0) + type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; + else if (wcsncmp(field[3 + offset].start, L"deny", + field[3 + offset].end - field[3 + offset].start) + == 0) + type = ARCHIVE_ENTRY_ACL_TYPE_DENY; + else if (wcsncmp(field[3 + offset].start, L"audit", + field[3 + offset].end - field[3 + offset].start) + == 0) + type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT; + else if (wcsncmp(field[3 + offset].start, L"alarm", + field[3 + offset].end - field[3 + offset].start) + == 0) + type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; + else { + /* Unknown type */ return (ARCHIVE_WARN); - tag = ARCHIVE_ENTRY_ACL_MASK; - } else - return (ARCHIVE_WARN); + } + isint_w(field[4 + offset].start, field[4 + offset].end, + &id); + } /* Add entry to the internal list. */ archive_acl_add_entry_w_len(acl, type, permset, @@ -985,6 +1280,78 @@ ismode_w(const wchar_t *start, const wch return (1); } +/* Parse a wstring as a strict NFSv4 ACL permission field. */ +static int +parse_nfs4_perms_w(const wchar_t *start, const wchar_t *end, int *permset) +{ + const wchar_t *p; + int pos; + const wchar_t *letter = L"rwxpdDaARWcCos"; + const int perms[14] = { + ARCHIVE_ENTRY_ACL_READ_DATA, + ARCHIVE_ENTRY_ACL_WRITE_DATA, + ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_APPEND_DATA, + ARCHIVE_ENTRY_ACL_DELETE, + ARCHIVE_ENTRY_ACL_DELETE_CHILD, + ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, + ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, + ARCHIVE_ENTRY_ACL_READ_ACL, + ARCHIVE_ENTRY_ACL_WRITE_ACL, + ARCHIVE_ENTRY_ACL_WRITE_OWNER, + ARCHIVE_ENTRY_ACL_SYNCHRONIZE + }; + + if (start >= end) + return (0); + p = start; + pos = 0; + while (p < end && pos < 14) { + if (*p == letter[pos]) + *permset |= perms[pos]; + else if (*p != '-') + return (-1); + p = p + sizeof(wchar_t); + pos++; + } + return (0); +} + +/* Parse a string as a strict NFSv4 ACL flags field. */ +static int +parse_nfs4_flags_w(const wchar_t *start, const wchar_t *end, int *permset) +{ + const wchar_t *p; + int pos; + const wchar_t *letter = L"fdinSFI"; + const int perms[7] = { + ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, + ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, + ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, + ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, + ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, + ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, + ARCHIVE_ENTRY_ACL_ENTRY_INHERITED + }; + + if (start >= end) + return (0); + p = start; + pos = 0; + while (p < end && pos < 7) { + if (*p == letter[pos]) + *permset |= perms[pos]; + else if (*p != '-') + return (-1); + p = p + sizeof(wchar_t); + pos++; + } + return (0); +} + + /* * Match "[:whitespace:]*(.*)[:whitespace:]*[:,\n]". *wp is updated * to point to just after the separator. *start points to the first @@ -1057,12 +1424,18 @@ archive_acl_parse_l(struct archive_acl * struct { const char *start; const char *end; - } field[4], name; + } field[6], name; - int fields, n, r, ret = ARCHIVE_OK; + int numfields, fields, n, r, ret = ARCHIVE_OK; int type, tag, permset, id; + int offset; char sep; + if (default_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) + numfields = 6; + else + numfields = 4; + while (text != NULL && *text != '\0') { /* * Parse the fields out of the next entry, @@ -1072,7 +1445,7 @@ archive_acl_parse_l(struct archive_acl * do { const char *start, *end; next_field(&text, &start, &end, &sep); - if (fields < 4) { + if (fields < numfields) { field[fields].start = start; field[fields].end = end; } @@ -1080,72 +1453,148 @@ archive_acl_parse_l(struct archive_acl * } while (sep == ':'); /* Set remaining fields to blank. */ - for (n = fields; n < 4; ++n) + for (n = fields; n < numfields; ++n) field[n].start = field[n].end = NULL; - /* Check for a numeric ID in field 1 or 3. */ - id = -1; - isint(field[1].start, field[1].end, &id); - /* Field 3 is optional. */ - if (id == -1 && fields > 3) - isint(field[3].start, field[3].end, &id); + if (default_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* POSIX.1e ACLs */ + /* Check for a numeric ID in field 1 or 3. */ + id = -1; + isint(field[1].start, field[1].end, &id); + /* Field 3 is optional. */ + if (id == -1 && fields > 3) + isint(field[3].start, field[3].end, &id); + + /* + * Solaris extension: "defaultuser::rwx" is the + * default ACL corresponding to "user::rwx", etc. + */ + if (field[0].end - field[0].start > 7 + && memcmp(field[0].start, "default", 7) == 0) { + type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; + field[0].start += 7; + } else + type = default_type; - /* - * Solaris extension: "defaultuser::rwx" is the - * default ACL corresponding to "user::rwx", etc. - */ - if (field[0].end - field[0].start > 7 - && memcmp(field[0].start, "default", 7) == 0) { - type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT; - field[0].start += 7; - } else - type = default_type; - - name.start = name.end = NULL; - if (prefix_c(field[0].start, field[0].end, "user")) { - if (!ismode(field[2].start, field[2].end, &permset)) + name.start = name.end = NULL; + if (prefix_c(field[0].start, field[0].end, "user")) { + if (!ismode(field[2].start, field[2].end, + &permset)) + return (ARCHIVE_WARN); + if (id != -1 || field[1].start < field[1].end) { + tag = ARCHIVE_ENTRY_ACL_USER; + name = field[1]; + } else + tag = ARCHIVE_ENTRY_ACL_USER_OBJ; + } else if (prefix_c(field[0].start, field[0].end, + "group")) { + if (!ismode(field[2].start, field[2].end, + &permset)) + return (ARCHIVE_WARN); + if (id != -1 || field[1].start < field[1].end) { + tag = ARCHIVE_ENTRY_ACL_GROUP; + name = field[1]; + } else + tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; + } else if (prefix_c(field[0].start, field[0].end, + "other")) { + if (fields == 2 + && field[1].start < field[1].end + && ismode(field[1].start, field[1].end, + &permset)) { + /* This is Solaris-style "other:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode(field[2].start, field[2].end, + &permset)) { + /* This is FreeBSD-style "other::rwx" */ + } else + return (ARCHIVE_WARN); + tag = ARCHIVE_ENTRY_ACL_OTHER; + } else if (prefix_c(field[0].start, field[0].end, + "mask")) { + if (fields == 2 + && field[1].start < field[1].end + && ismode(field[1].start, field[1].end, + &permset)) { + /* This is Solaris-style "mask:rwx" */ + } else if (fields == 3 + && field[1].start == field[1].end + && field[2].start < field[2].end + && ismode(field[2].start, field[2].end, + &permset)) { + /* This is FreeBSD-style "mask::rwx" */ + } else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Aug 26 23:55:36 2016 Return-Path: Delivered-To: svn-src-head@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 E75DBB7636B; Fri, 26 Aug 2016 23:55:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC4C2E39; Fri, 26 Aug 2016 23:55:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x236.google.com with SMTP id g62so17530344ith.1; Fri, 26 Aug 2016 16:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XxYbKAPY7QiBSWUKu1YCuPF/o14OCbgy9NyNF7PgPCI=; b=EqmSecYOJPX9Zz9UnK3PVBvZf88Vqky9nqWf5H2zq9UdGL6+Ff+HPNJTxNl9d4Y3oT 6iiHH562Belcwcwx6s8i1bsqwOzy0hqomCAuJDqh+41s6MCeYKTcu9LplWH1q84GPdDB FooxcKk1v4HfFvkWyLpnUoLWXfag4kUP0F1IvqGGrJYfVJqnpub6CLrKlX6T+wI1AWFX xlJalQIgHcqnqVJBAs58WEqGjk5Uqb6v1uimtwQx/YnQlUC9HLQWzk25R7gAXJA+MP60 LpU0RGikz7LaPdB0w0Ksmbrv7nBymSa87J5dMwETazGW8ItnL6xHbVC4ezgr5c7VJL7S lsAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XxYbKAPY7QiBSWUKu1YCuPF/o14OCbgy9NyNF7PgPCI=; b=itEYCqciCk/2djFu0Dh3HOs42QE4vlfVf3miQJtDNVjzsFFIMCjkLwnlOzqviX9oXF 0GFzYvUqgSFUVAHgtEDvnIIf+tzzr5LpdHLkpMYYU0X4xQZYSB4gjCCWIcBcQpMaxBGX 6BTc7v2OD9YeVlivGCal7SwaQN29oCUYkXSGZqNSbaAtOm5mmRCBE75w4dLUaSrWuhah Qs0oqhVoSIv84GQhkILpmJxjx+vm/cCmVZO5aXArmZs8fo2qcKzOGhw/Iie89W0BKobK ViJGz+KKQ8G4Ygsy6LvjxutNmUmvjvDiwhQf7htbiZmhMxyyK6Mnf+vBHQxL0gq6e/xN sieA== X-Gm-Message-State: AE9vXwNTRXyOObJg3uUl0lCVinJ5wq6kg4BX25XIQ9VimTV7dBua4HlQ78bYAj9GXRiTS0ZqvOTwX1mR0qIR4Q== X-Received: by 10.36.124.141 with SMTP id a135mr1651557itd.25.1472255736213; Fri, 26 Aug 2016 16:55:36 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Fri, 26 Aug 2016 16:55:34 -0700 (PDT) In-Reply-To: <20160826220255.GI88122@zxy.spb.ru> References: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> From: Adrian Chadd Date: Fri, 26 Aug 2016 16:55:34 -0700 X-Google-Sender-Auth: TvJPhIXvUtfuS7l7_K13F2-s91Q Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 23:55:37 -0000 Hi, I use the kernel lock profiling debugging, but you can use dtrace to get an idea: dtrace -n 'lockstat:::adaptive-block { @[stack()] = sum(arg1); }' (https://wiki.freebsd.org/DTrace/One-Liners) -adrian From owner-svn-src-head@freebsd.org Sat Aug 27 00:03:04 2016 Return-Path: Delivered-To: svn-src-head@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 912F6B767B3; Sat, 27 Aug 2016 00:03:04 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2F90B697; Sat, 27 Aug 2016 00:03:04 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R033N3063005; Sat, 27 Aug 2016 00:03:03 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R032kN062998; Sat, 27 Aug 2016 00:03:02 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608270003.u7R032kN062998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 27 Aug 2016 00:03:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304870 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/chipc/pwrctl dev/bhnd/cores/pmu dev/bhnd/nvram dev/bhnd/pmu dev/bhnd/siba mips/broa... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:03:04 -0000 Author: landonf Date: Sat Aug 27 00:03:02 2016 New Revision: 304870 URL: https://svnweb.freebsd.org/changeset/base/304870 Log: bhnd(4): Initial PMU/PWRCTL power and clock management support. - Added bhnd_pmu driver implementations for PMU and PWRCTL chipsets, derived from Broadcom's ISC-licensed HND code. - Added bhnd bus-level support for routing per-core clock and resource power requests to the PMU device. - Lift ChipCommon support out into the bhnd module, dropping bhnd_chipc. Reviewed by: mizhka Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7492 Added: head/sys/dev/bhnd/cores/chipc/bhnd_pmu_chipc.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/pwrctl/ head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_private.h (contents, props changed) head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctlvar.h (contents, props changed) head/sys/dev/bhnd/cores/pmu/ head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmu.h (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmu_if.m (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmu_private.h (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h (contents, props changed) head/sys/dev/bhnd/pmu/ Deleted: head/sys/modules/bhnd/cores/bhnd_chipc/ Modified: head/sys/conf/files head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma_dmp.h head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_core.h head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bhnd/bhndb/bhnd_bhndb.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndvar.h head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc.h head/sys/dev/bhnd/cores/chipc/chipc_subr.c head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/chipcvar.h head/sys/dev/bhnd/nvram/nvram_map head/sys/dev/bhnd/siba/siba.c head/sys/mips/broadcom/bcm_machdep.c head/sys/modules/bhnd/Makefile head/sys/modules/bhnd/cores/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 26 23:50:44 2016 (r304869) +++ head/sys/conf/files Sat Aug 27 00:03:02 2016 (r304870) @@ -1157,19 +1157,26 @@ dev/bhnd/bcma/bcma_bhndb.c optional bcm dev/bhnd/bcma/bcma_erom.c optional bcma bhnd dev/bhnd/bcma/bcma_nexus.c optional bcma_nexus bcma bhnd dev/bhnd/bcma/bcma_subr.c optional bcma bhnd +dev/bhnd/cores/chipc/bhnd_chipc_if.m optional bhnd +dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhnd +dev/bhnd/cores/chipc/bhnd_pmu_chipc.c optional bhnd dev/bhnd/cores/chipc/chipc.c optional bhnd dev/bhnd/cores/chipc/chipc_cfi.c optional bhnd cfi dev/bhnd/cores/chipc/chipc_slicer.c optional bhnd cfi | bhnd spibus dev/bhnd/cores/chipc/chipc_spi.c optional bhnd spibus dev/bhnd/cores/chipc/chipc_subr.c optional bhnd -dev/bhnd/cores/chipc/bhnd_chipc_if.m optional bhnd -dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhnd +dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c optional bhnd +dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c optional bhnd dev/bhnd/cores/pci/bhnd_pci.c optional bhnd pci dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndb bhnd pci dev/bhnd/cores/pci/bhnd_pcib.c optional bhnd_pcib bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2.c optional bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c optional bhndb bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2b.c optional bhnd_pcie2b bhnd pci +dev/bhnd/cores/pmu/bhnd_pmu.c optional bhnd +dev/bhnd/cores/pmu/bhnd_pmu_core.c optional bhnd +dev/bhnd/cores/pmu/bhnd_pmu_if.m optional bhnd +dev/bhnd/cores/pmu/bhnd_pmu_subr.c optional bhnd dev/bhnd/nvram/bhnd_nvram.c optional bhnd dev/bhnd/nvram/bhnd_nvram_common.c optional bhnd dev/bhnd/nvram/bhnd_nvram_cfe.c optional bhnd siba_nexus cfe | \ Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Fri Aug 26 23:50:44 2016 (r304869) +++ head/sys/dev/bhnd/bcma/bcma.c Sat Aug 27 00:03:02 2016 (r304870) @@ -259,6 +259,78 @@ bcma_suspend_core(device_t dev, device_t return (ENXIO); } +static uint32_t +bcma_read_config(device_t dev, device_t child, bus_size_t offset, u_int width) +{ + struct bcma_devinfo *dinfo; + struct bhnd_resource *r; + + /* Must be a directly attached child core */ + if (device_get_parent(child) != dev) + return (UINT32_MAX); + + /* Fetch the agent registers */ + dinfo = device_get_ivars(child); + if ((r = dinfo->res_agent) == NULL) + return (UINT32_MAX); + + /* Verify bounds */ + if (offset > rman_get_size(r->res)) + return (UINT32_MAX); + + if (rman_get_size(r->res) - offset < width) + return (UINT32_MAX); + + switch (width) { + case 1: + return (bhnd_bus_read_1(r, offset)); + case 2: + return (bhnd_bus_read_2(r, offset)); + case 4: + return (bhnd_bus_read_4(r, offset)); + default: + return (UINT32_MAX); + } +} + +static void +bcma_write_config(device_t dev, device_t child, bus_size_t offset, uint32_t val, + u_int width) +{ + struct bcma_devinfo *dinfo; + struct bhnd_resource *r; + + /* Must be a directly attached child core */ + if (device_get_parent(child) != dev) + return; + + /* Fetch the agent registers */ + dinfo = device_get_ivars(child); + if ((r = dinfo->res_agent) == NULL) + return; + + /* Verify bounds */ + if (offset > rman_get_size(r->res)) + return; + + if (rman_get_size(r->res) - offset < width) + return; + + switch (width) { + case 1: + bhnd_bus_write_1(r, offset, val); + break; + case 2: + bhnd_bus_write_2(r, offset, val); + break; + case 4: + bhnd_bus_write_4(r, offset, val); + break; + default: + break; + } +} + static u_int bcma_get_port_count(device_t dev, device_t child, bhnd_port_type type) { @@ -473,6 +545,9 @@ bcma_add_children(device_t bus, struct r * unpopulated, the device shouldn't be used. */ if (bhnd_is_hw_disabled(child)) device_disable(child); + + /* Issue bus callback for fully initialized child. */ + BHND_BUS_CHILD_ADDED(bus, child); } /* Hit EOF parsing cores? */ @@ -504,6 +579,8 @@ static device_method_t bcma_methods[] = DEVMETHOD(bhnd_bus_free_devinfo, bcma_free_bhnd_dinfo), DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), + DEVMETHOD(bhnd_bus_read_config, bcma_read_config), + DEVMETHOD(bhnd_bus_write_config, bcma_write_config), DEVMETHOD(bhnd_bus_get_port_count, bcma_get_port_count), DEVMETHOD(bhnd_bus_get_region_count, bcma_get_region_count), DEVMETHOD(bhnd_bus_get_port_rid, bcma_get_port_rid), Modified: head/sys/dev/bhnd/bcma/bcma_dmp.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_dmp.h Fri Aug 26 23:50:44 2016 (r304869) +++ head/sys/dev/bhnd/bcma/bcma_dmp.h Sat Aug 27 00:03:02 2016 (r304870) @@ -109,6 +109,19 @@ #define BCMA_DMP_OOBDINWIDTH 0x364 #define BCMA_DMP_OOBDOUTWIDTH 0x368 +/* The exact interpretation of these bits is unverified; these + * are our best guesses as to their use */ +#define BCMA_DMP_OOBSEL_MASK 0xFF /**< OOBSEL config mask */ +#define BCMA_DMP_OOBSEL_0_MASK BCMA_DMP_OOBSEL_MASK +#define BCMA_DMP_OOBSEL_1_MASK BCMA_DMP_OOBSEL_MASK +#define BCMA_DMP_OOBSEL_2_MASK BCMA_DMP_OOBSEL_MASK +#define BCMA_DMP_OOBSEL_3_MASK BCMA_DMP_OOBSEL_MASK +#define BCMA_DMP_OOBSEL_0_SHIFT 0 /**< first OOBSEL config */ +#define BCMA_DMP_OOBSEL_1_SHIFT 8 /**< second OOBSEL config */ +#define BCMA_DMP_OOBSEL_2_SHIFT 16 /**< third OOBSEL config */ +#define BCMA_DMP_OOBSEL_3_SHIFT 24 /**< fouth OOBSEL config */ +#define BCMA_DMP_OOBSEL_EN (1 << 7) /**< enable bit */ + // This was inherited from Broadcom's aidmp.h header // Is it required for any of our use-cases? #if 0 /* defined(IL_BIGENDIAN) && defined(BCMHND74K) */ Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Fri Aug 26 23:50:44 2016 (r304869) +++ head/sys/dev/bhnd/bhnd.c Sat Aug 27 00:03:02 2016 (r304870) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2015-2016 Landon Fuller * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$"); #include +#include +#include + #include "bhnd_chipc_if.h" #include "bhnd_nvram_if.h" @@ -342,7 +345,7 @@ bhnd_finish_attach(struct bhnd_softc *sc { struct chipc_caps *ccaps; - GIANT_REQUIRED; /* newbus */ + GIANT_REQUIRED; /* for newbus */ KASSERT(bus_current_pass >= BHND_FINISH_ATTACH_PASS, ("bhnd_finish_attach() called in pass %d", bus_current_pass)); @@ -367,10 +370,11 @@ bhnd_finish_attach(struct bhnd_softc *sc } /* Look for a PMU */ - if (ccaps->pmu) { + if (ccaps->pmu || ccaps->pwr_ctrl) { if ((sc->pmu_dev = bhnd_find_pmu(sc)) == NULL) { device_printf(sc->dev, - "warning: PMU device not found\n"); + "attach failed: supported PMU not found\n"); + return (ENXIO); } } @@ -478,8 +482,6 @@ found: static device_t bhnd_find_pmu(struct bhnd_softc *sc) { - struct chipc_caps *ccaps; - /* Make sure we're holding Giant for newbus */ GIANT_REQUIRED; @@ -494,11 +496,6 @@ bhnd_find_pmu(struct bhnd_softc *sc) return (sc->pmu_dev); } - if ((ccaps = bhnd_find_chipc_caps(sc)) == NULL) - return (NULL); - - if (!ccaps->pmu) - return (NULL); return (bhnd_find_platform_dev(sc, "bhnd_pmu")); } @@ -626,6 +623,244 @@ bhnd_generic_get_probe_order(device_t de } /** + * Default bhnd(4) bus driver implementation of BHND_BUS_ALLOC_PMU(). + */ +int +bhnd_generic_alloc_pmu(device_t dev, device_t child) +{ + struct bhnd_softc *sc; + struct bhnd_resource *br; + struct chipc_caps *ccaps; + struct bhnd_devinfo *dinfo; + struct bhnd_core_pmu_info *pm; + struct resource_list *rl; + struct resource_list_entry *rle; + device_t pmu_dev; + bhnd_addr_t r_addr; + bhnd_size_t r_size; + bus_size_t pmu_regs; + int error; + + GIANT_REQUIRED; /* for newbus */ + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + pmu_regs = BHND_CLK_CTL_ST; + + if ((ccaps = bhnd_find_chipc_caps(sc)) == NULL) { + device_printf(sc->dev, "alloc_pmu failed: chipc " + "capabilities unavailable\n"); + return (ENXIO); + } + + if ((pmu_dev = bhnd_find_pmu(sc)) == NULL) { + device_printf(sc->dev, + "pmu unavailable; cannot allocate request state\n"); + return (ENXIO); + } + + /* already allocated? */ + if (dinfo->pmu_info != NULL) { + panic("duplicate PMU allocation for %s", + device_get_nameunit(child)); + } + + /* Determine address+size of the core's PMU register block */ + error = bhnd_get_region_addr(child, BHND_PORT_DEVICE, 0, 0, &r_addr, + &r_size); + if (error) { + device_printf(sc->dev, "error fetching register block info for " + "%s: %d\n", device_get_nameunit(child), error); + return (error); + } + + if (r_size < (pmu_regs + sizeof(uint32_t))) { + device_printf(sc->dev, "pmu offset %#jx would overrun %s " + "register block\n", (uintmax_t)pmu_regs, + device_get_nameunit(child)); + return (ENODEV); + } + + /* Locate actual resource containing the core's register block */ + if ((rl = BUS_GET_RESOURCE_LIST(dev, child)) == NULL) { + device_printf(dev, "NULL resource list returned for %s\n", + device_get_nameunit(child)); + return (ENXIO); + } + + if ((rle = resource_list_find(rl, SYS_RES_MEMORY, 0)) == NULL) { + device_printf(dev, "cannot locate core register resource " + "for %s\n", device_get_nameunit(child)); + return (ENXIO); + } + + if (rle->res == NULL) { + device_printf(dev, "core register resource unallocated for " + "%s\n", device_get_nameunit(child)); + return (ENXIO); + } + + if (r_addr+pmu_regs < rman_get_start(rle->res) || + r_addr+pmu_regs >= rman_get_end(rle->res)) + { + device_printf(dev, "core register resource does not map PMU " + "registers at %#jx\n for %s\n", r_addr+pmu_regs, + device_get_nameunit(child)); + return (ENXIO); + } + + /* Adjust PMU register offset relative to the actual start address + * of the core's register block allocation. + * + * XXX: The saved offset will be invalid if bus_adjust_resource is + * used to modify the resource's start address. + */ + if (rman_get_start(rle->res) > r_addr) + pmu_regs -= rman_get_start(rle->res) - r_addr; + else + pmu_regs -= r_addr - rman_get_start(rle->res); + + /* Allocate and initialize PMU info */ + br = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT); + if (br == NULL) + return (ENOMEM); + + br->res = rle->res; + br->direct = ((rman_get_flags(rle->res) & RF_ACTIVE) != 0); + + pm = malloc(sizeof(*dinfo->pmu_info), M_BHND, M_NOWAIT); + if (pm == NULL) { + free(br, M_BHND); + return (ENOMEM); + } + pm->pm_dev = child; + pm->pm_pmu = pmu_dev; + pm->pm_res = br; + pm->pm_regs = pmu_regs; + + dinfo->pmu_info = pm; + return (0); +} + +/** + * Default bhnd(4) bus driver implementation of BHND_BUS_RELEASE_PMU(). + */ +int +bhnd_generic_release_pmu(device_t dev, device_t child) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + device_t pmu; + int error; + + GIANT_REQUIRED; /* for newbus */ + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + if ((pmu = bhnd_find_pmu(sc)) == NULL) { + device_printf(sc->dev, + "pmu unavailable; cannot release request state\n"); + return (ENXIO); + } + + /* dispatch release request */ + if (dinfo->pmu_info == NULL) + panic("pmu over-release for %s", device_get_nameunit(child)); + + if ((error = BHND_PMU_CORE_RELEASE(pmu, dinfo->pmu_info))) + return (error); + + /* free PMU info */ + free(dinfo->pmu_info->pm_res, M_BHND); + free(dinfo->pmu_info, M_BHND); + dinfo->pmu_info = NULL; + + return (0); +} + +/** + * Default bhnd(4) bus driver implementation of BHND_BUS_REQUEST_CLOCK(). + */ +int +bhnd_generic_request_clock(device_t dev, device_t child, bhnd_clock clock) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + struct bhnd_core_pmu_info *pm; + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + if ((pm = dinfo->pmu_info) == NULL) + panic("no active PMU request state"); + + /* dispatch request to PMU */ + return (BHND_PMU_CORE_REQ_CLOCK(pm->pm_pmu, pm, clock)); +} + +/** + * Default bhnd(4) bus driver implementation of BHND_BUS_ENABLE_CLOCKS(). + */ +int +bhnd_generic_enable_clocks(device_t dev, device_t child, uint32_t clocks) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + struct bhnd_core_pmu_info *pm; + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + if ((pm = dinfo->pmu_info) == NULL) + panic("no active PMU request state"); + + /* dispatch request to PMU */ + return (BHND_PMU_CORE_EN_CLOCKS(pm->pm_pmu, pm, clocks)); +} + +/** + * Default bhnd(4) bus driver implementation of BHND_BUS_REQUEST_EXT_RSRC(). + */ +int +bhnd_generic_request_ext_rsrc(device_t dev, device_t child, u_int rsrc) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + struct bhnd_core_pmu_info *pm; + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + if ((pm = dinfo->pmu_info) == NULL) + panic("no active PMU request state"); + + /* dispatch request to PMU */ + return (BHND_PMU_CORE_REQ_EXT_RSRC(pm->pm_pmu, pm, rsrc)); +} + +/** + * Default bhnd(4) bus driver implementation of BHND_BUS_RELEASE_EXT_RSRC(). + */ +int +bhnd_generic_release_ext_rsrc(device_t dev, device_t child, u_int rsrc) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + struct bhnd_core_pmu_info *pm; + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + if ((pm = dinfo->pmu_info) == NULL) + panic("no active PMU request state"); + + /* dispatch request to PMU */ + return (BHND_PMU_CORE_RELEASE_EXT_RSRC(pm->pm_pmu, pm, rsrc)); +} + + +/** * Default bhnd(4) bus driver implementation of BHND_BUS_IS_REGION_VALID(). * * This implementation assumes that port and region numbers are 0-indexed and @@ -815,13 +1050,21 @@ bhnd_generic_add_child(device_t dev, u_i device_set_ivars(child, dinfo); - /* Inform concrete bus driver. */ - BHND_BUS_CHILD_ADDED(dev, child); - return (child); } /** + * Default bhnd(4) bus driver implementation of BHND_BUS_CHILD_ADDED(). + * + * This implementation manages internal bhnd(4) state, and must be called + * by subclassing drivers. + */ +void +bhnd_generic_child_added(device_t dev, device_t child) +{ +} + +/** * Default bhnd(4) bus driver implementation of BUS_CHILD_DELETED(). * * This implementation manages internal bhnd(4) state, and must be called @@ -836,8 +1079,17 @@ bhnd_generic_child_deleted(device_t dev, sc = device_get_softc(dev); /* Free device info */ - if ((dinfo = device_get_ivars(child)) != NULL) + if ((dinfo = device_get_ivars(child)) != NULL) { + if (dinfo->pmu_info != NULL) { + /* Releasing PMU requests automatically would be nice, + * but we can't reference per-core PMU register + * resource after driver detach */ + panic("%s leaked device pmu state\n", + device_get_nameunit(child)); + } + BHND_BUS_FREE_DEVINFO(dev, dinfo); + } /* Clean up platform device references */ if (sc->chipc_dev == child) { @@ -998,9 +1250,20 @@ static device_method_t bhnd_methods[] = /* BHND interface */ DEVMETHOD(bhnd_bus_get_chipid, bhnd_bus_generic_get_chipid), + DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), + DEVMETHOD(bhnd_bus_read_board_info, bhnd_bus_generic_read_board_info), + DEVMETHOD(bhnd_bus_get_probe_order, bhnd_generic_get_probe_order), + + DEVMETHOD(bhnd_bus_alloc_pmu, bhnd_generic_alloc_pmu), + DEVMETHOD(bhnd_bus_release_pmu, bhnd_generic_release_pmu), + DEVMETHOD(bhnd_bus_request_clock, bhnd_generic_request_clock), + DEVMETHOD(bhnd_bus_enable_clocks, bhnd_generic_enable_clocks), + DEVMETHOD(bhnd_bus_request_ext_rsrc, bhnd_generic_request_ext_rsrc), + DEVMETHOD(bhnd_bus_release_ext_rsrc, bhnd_generic_release_ext_rsrc), + + DEVMETHOD(bhnd_bus_child_added, bhnd_generic_child_added), DEVMETHOD(bhnd_bus_is_region_valid, bhnd_generic_is_region_valid), - DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), DEVMETHOD(bhnd_bus_get_nvram_var, bhnd_generic_get_nvram_var), /* BHND interface (bus I/O) */ Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Fri Aug 26 23:50:44 2016 (r304869) +++ head/sys/dev/bhnd/bhnd.h Sat Aug 27 00:03:02 2016 (r304870) @@ -417,6 +417,67 @@ bhnd_get_chipid(device_t dev) { }; /** + * If supported by the chipset, return the clock source for the given clock. + * + * This function is only supported on early PWRCTL-equipped chipsets + * that expose clock management via their host bridge interface. Currently, + * this includes PCI (not PCIe) devices, with ChipCommon core revisions 0-9. + * + * @param dev A bhnd bus child device. + * @param clock The clock for which a clock source will be returned. + * + * @retval bhnd_clksrc The clock source for @p clock. + * @retval BHND_CLKSRC_UNKNOWN If @p clock is unsupported, or its + * clock source is not known to the bus. + */ +static inline bhnd_clksrc +bhnd_pwrctl_get_clksrc(device_t dev, bhnd_clock clock) +{ + return (BHND_BUS_PWRCTL_GET_CLKSRC(device_get_parent(dev), dev, clock)); +} + +/** + * If supported by the chipset, gate @p clock + * + * This function is only supported on early PWRCTL-equipped chipsets + * that expose clock management via their host bridge interface. Currently, + * this includes PCI (not PCIe) devices, with ChipCommon core revisions 0-9. + * + * @param dev A bhnd bus child device. + * @param clock The clock to be disabled. + * + * @retval 0 success + * @retval ENODEV If bus-level clock source management is not supported. + * @retval ENXIO If bus-level management of @p clock is not supported. + */ +static inline int +bhnd_pwrctl_gate_clock(device_t dev, bhnd_clock clock) +{ + return (BHND_BUS_PWRCTL_GATE_CLOCK(device_get_parent(dev), dev, clock)); +} + +/** + * If supported by the chipset, ungate @p clock + * + * This function is only supported on early PWRCTL-equipped chipsets + * that expose clock management via their host bridge interface. Currently, + * this includes PCI (not PCIe) devices, with ChipCommon core revisions 0-9. + * + * @param dev A bhnd bus child device. + * @param clock The clock to be enabled. + * + * @retval 0 success + * @retval ENODEV If bus-level clock source management is not supported. + * @retval ENXIO If bus-level management of @p clock is not supported. + */ +static inline int +bhnd_pwrctl_ungate_clock(device_t dev, bhnd_clock clock) +{ + return (BHND_BUS_PWRCTL_UNGATE_CLOCK(device_get_parent(dev), dev, + clock)); +} + +/** * Return the BHND attachment type of the parent bhnd bus. * * @param dev A bhnd bus child device. @@ -454,6 +515,171 @@ bhnd_read_board_info(device_t dev, struc } /** + * Allocate and enable per-core PMU request handling for @p child. + * + * The region containing the core's PMU register block (if any) must be + * allocated via bus_alloc_resource(9) (or bhnd_alloc_resource) before + * calling bhnd_alloc_pmu(), and must not be released until after + * calling bhnd_release_pmu(). + * + * @param dev The parent of @p child. + * @param child The requesting bhnd device. + * + * @retval 0 success + * @retval non-zero If allocating PMU request state otherwise fails, a + * regular unix error code will be returned. + */ +static inline int +bhnd_alloc_pmu(device_t dev) +{ + return (BHND_BUS_ALLOC_PMU(device_get_parent(dev), dev)); +} + +/** + * Release any per-core PMU resources allocated for @p child. Any outstanding + * PMU requests are are discarded. + * + * @param dev The parent of @p child. + * @param child The requesting bhnd device. + * + * @retval 0 success + * @retval non-zero If releasing PMU request state otherwise fails, a + * regular unix error code will be returned, and + * the core state will be left unmodified. + */ +static inline int +bhnd_release_pmu(device_t dev) +{ + return (BHND_BUS_RELEASE_PMU(device_get_parent(dev), dev)); +} + +/** + * Request that @p clock (or faster) be routed to @p dev. + * + * A driver must ask the bhnd bus to allocate clock request state + * via bhnd_alloc_pmu() before it can request clock resources. + * + * Request multiplexing is managed by the bus. + * + * @param dev The bhnd(4) device to which @p clock should be routed. + * @param clock The requested clock source. + * + * @retval 0 success + * @retval ENODEV If an unsupported clock was requested. + * @retval ENXIO If the PMU has not been initialized or is otherwise unvailable. + */ +static inline int +bhnd_request_clock(device_t dev, bhnd_clock clock) +{ + return (BHND_BUS_REQUEST_CLOCK(device_get_parent(dev), dev, clock)); +} + +/** + * Request that @p clocks be powered on behalf of @p dev. + * + * This will power any clock sources (e.g. XTAL, PLL, etc) required for + * @p clocks and wait until they are ready, discarding any previous + * requests by @p dev. + * + * Request multiplexing is managed by the bus. + * + * A driver must ask the bhnd bus to allocate clock request state + * via bhnd_alloc_pmu() before it can request clock resources. + * + * @param dev The requesting bhnd(4) device. + * @param clocks The clock(s) to be enabled. + * + * @retval 0 success + * @retval ENODEV If an unsupported clock was requested. + * @retval ENXIO If the PMU has not been initialized or is otherwise unvailable. + */ +static inline int +bhnd_enable_clocks(device_t dev, uint32_t clocks) +{ + return (BHND_BUS_ENABLE_CLOCKS(device_get_parent(dev), dev, clocks)); +} + +/** + * Power up an external PMU-managed resource assigned to @p dev. + * + * A driver must ask the bhnd bus to allocate PMU request state + * via bhnd_alloc_pmu() before it can request PMU resources. + * + * @param dev The requesting bhnd(4) device. + * @param rsrc The core-specific external resource identifier. + * + * @retval 0 success + * @retval ENODEV If the PMU does not support @p rsrc. + * @retval ENXIO If the PMU has not been initialized or is otherwise unvailable. + */ +static inline int +bhnd_request_ext_rsrc(device_t dev, u_int rsrc) +{ + return (BHND_BUS_REQUEST_EXT_RSRC(device_get_parent(dev), dev, rsrc)); +} + +/** + * Power down an external PMU-managed resource assigned to @p dev. + * + * A driver must ask the bhnd bus to allocate PMU request state + * via bhnd_alloc_pmu() before it can request PMU resources. + * + * @param dev The requesting bhnd(4) device. + * @param rsrc The core-specific external resource identifier. + * + * @retval 0 success + * @retval ENODEV If the PMU does not support @p rsrc. + * @retval ENXIO If the PMU has not been initialized or is otherwise unvailable. + */ +static inline int +bhnd_release_ext_rsrc(device_t dev, u_int rsrc) +{ + return (BHND_BUS_RELEASE_EXT_RSRC(device_get_parent(dev), dev, rsrc)); +} + + +/** + * Read @p width bytes at @p offset from the bus-specific agent/config + * space of @p dev. + * + * @param dev The bhnd device for which @p offset should be read. + * @param offset The offset to be read. + * @param width The size of the access. Must be 1, 2 or 4 bytes. + * + * The exact behavior of this method is bus-specific. In the case of + * bcma(4), this method provides access to the first agent port of @p child. + * + * @note Device drivers should only use this API for functionality + * that is not available via another bhnd(4) function. + */ +static inline uint32_t +bhnd_read_config(device_t dev, bus_size_t offset, u_int width) +{ + return (BHND_BUS_READ_CONFIG(device_get_parent(dev), dev, offset, + width)); +} + +/** + * Read @p width bytes at @p offset from the bus-specific agent/config + * space of @p dev. + * + * @param dev The bhnd device for which @p offset should be read. + * @param offset The offset to be written. + * @param width The size of the access. Must be 1, 2 or 4 bytes. + * + * The exact behavior of this method is bus-specific. In the case of + * bcma(4), this method provides access to the first agent port of @p child. + * + * @note Device drivers should only use this API for functionality + * that is not available via another bhnd(4) function. + */ +static inline void +bhnd_write_config(device_t dev, bus_size_t offset, uint32_t val, u_int width) +{ + BHND_BUS_WRITE_CONFIG(device_get_parent(dev), dev, offset, val, width); +} + +/** * Read an NVRAM variable, coerced to the requested @p type. * * @param dev A bhnd bus child device. Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Fri Aug 26 23:50:44 2016 (r304869) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sat Aug 27 00:03:02 2016 (r304870) @@ -61,6 +61,27 @@ CODE { { panic("bhnd_bus_get_attach_type unimplemented"); } + + static bhnd_clksrc + bhnd_bus_null_pwrctl_get_clksrc(device_t dev, device_t child, + bhnd_clock clock) + { + return (BHND_CLKSRC_UNKNOWN); + } + + static int + bhnd_bus_null_pwrctl_gate_clock(device_t dev, device_t child, + bhnd_clock clock) + { + return (ENODEV); + } + + static int + bhnd_bus_null_pwrctl_ungate_clock(device_t dev, device_t child, + bhnd_clock clock) + { + return (ENODEV); + } static int bhnd_bus_null_read_board_info(device_t dev, device_t child, @@ -74,6 +95,60 @@ CODE { { } + static int + bhnd_bus_null_alloc_pmu(device_t dev, device_t child) + { + panic("bhnd_bus_alloc_pmu unimplemented"); + } + + static int + bhnd_bus_null_release_pmu(device_t dev, device_t child) + { + panic("bhnd_bus_release_pmu unimplemented"); + } + + static int + bhnd_bus_null_request_clock(device_t dev, device_t child, + bhnd_clock clock) + { + panic("bhnd_bus_request_clock unimplemented"); + } + + static int + bhnd_bus_null_enable_clocks(device_t dev, device_t child, + uint32_t clocks) + { + panic("bhnd_bus_enable_clocks unimplemented"); + } + + static int + bhnd_bus_null_request_ext_rsrc(device_t dev, device_t child, + u_int rsrc) + { + panic("bhnd_bus_request_ext_rsrc unimplemented"); + } + + static int + bhnd_bus_null_release_ext_rsrc(device_t dev, device_t child, + u_int rsrc) + { + panic("bhnd_bus_release_ext_rsrc unimplemented"); + } + + static uint32_t + bhnd_bus_null_read_config(device_t dev, device_t child, + bus_size_t offset, u_int width) + { + panic("bhnd_bus_null_read_config unimplemented"); + } + + static void + bhnd_bus_null_write_config(device_t dev, device_t child, + bus_size_t offset, uint32_t val, u_int width) + { + panic("bhnd_bus_null_write_config unimplemented"); + } + static device_t bhnd_bus_null_find_hostb_device(device_t dev) { @@ -261,9 +336,8 @@ METHOD void free_devinfo { /** * Notify a bhnd bus that a child was added. * - * Called at the end of BUS_ADD_CHILD() to allow the concrete bhnd(4) - * driver instance to initialize any additional driver-specific state for the - * child. + * This method must be called by concrete bhnd(4) driver impementations + * after @p child's bus state is fully initialized. * * @param dev The bhnd bus whose child is being added. * @param child The child added to @p dev. @@ -304,6 +378,230 @@ METHOD int suspend_core { } /** + * If supported by the chipset, return the clock source for the given clock. + * + * This function is only supported on early PWRCTL-equipped chipsets + * that expose clock management via their host bridge interface. Currently, + * this includes PCI (not PCIe) devices, with ChipCommon core revisions 0-9. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting a clock source. + * @param clock The clock for which a clock source will be returned. + * + * @retval bhnd_clksrc The clock source for @p clock. + * @retval BHND_CLKSRC_UNKNOWN If @p clock is unsupported, or its + * clock source is not known to the bus. + */ +METHOD bhnd_clksrc pwrctl_get_clksrc { + device_t dev; + device_t child; + bhnd_clock clock; +} DEFAULT bhnd_bus_null_pwrctl_get_clksrc; + +/** + * If supported by the chipset, gate the clock source for @p clock + * + * This function is only supported on early PWRCTL-equipped chipsets + * that expose clock management via their host bridge interface. Currently, + * this includes PCI (not PCIe) devices, with ChipCommon core revisions 0-9. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting clock gating. + * @param clock The clock to be disabled. + * + * @retval 0 success + * @retval ENODEV If bus-level clock source management is not supported. + * @retval ENXIO If bus-level management of @p clock is not supported. + */ +METHOD int pwrctl_gate_clock { + device_t dev; + device_t child; + bhnd_clock clock; +} DEFAULT bhnd_bus_null_pwrctl_gate_clock; + +/** + * If supported by the chipset, ungate the clock source for @p clock + * + * This function is only supported on early PWRCTL-equipped chipsets + * that expose clock management via their host bridge interface. Currently, + * this includes PCI (not PCIe) devices, with ChipCommon core revisions 0-9. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting clock gating. + * @param clock The clock to be enabled. + * + * @retval 0 success + * @retval ENODEV If bus-level clock source management is not supported. + * @retval ENXIO If bus-level management of @p clock is not supported. + */ +METHOD int pwrctl_ungate_clock { + device_t dev; + device_t child; + bhnd_clock clock; +} DEFAULT bhnd_bus_null_pwrctl_ungate_clock; + +/** + * Allocate and enable per-core PMU request handling for @p child. + * + * The region containing the core's PMU register block (if any) must be + * allocated via bus_alloc_resource(9) (or bhnd_alloc_resource) before + * calling BHND_BUS_ALLOC_PMU(), and must not be released until after + * calling BHND_BUS_RELEASE_PMU(). + * + * @param dev The parent of @p child. + * @param child The requesting bhnd device. + */ +METHOD int alloc_pmu { + device_t dev; + device_t child; +} DEFAULT bhnd_bus_null_alloc_pmu; + +/** + * Release per-core PMU resources allocated for @p child. Any + * outstanding PMU requests are discarded. + * + * @param dev The parent of @p child. + * @param child The requesting bhnd device. + */ +METHOD int release_pmu { + device_t dev; + device_t child; +} DEFAULT bhnd_bus_null_release_pmu; + +/** + * Request that @p clock (or faster) be routed to @p child. + * + * A driver must ask the bhnd bus to allocate PMU request state + * via BHND_BUS_ALLOC_PMU() before it can request clock resources. + * + * Request multiplexing is managed by the bus. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting @p clock. + * @param clock The requested clock source. + * + * @retval 0 success + * @retval ENODEV If an unsupported clock was requested. + * @retval ENXIO If the PMU has not been initialized or is otherwise unvailable. + */ +METHOD int request_clock { + device_t dev; + device_t child; + bhnd_clock clock; +} DEFAULT bhnd_bus_null_request_clock; + +/** + * Request that @p clocks be powered on behalf of @p child. + * + * This will power on clock sources (e.g. XTAL, PLL, etc) required for + * @p clocks and wait until they are ready, discarding any previous + * requests by @p child. + * + * Request multiplexing is managed by the bus. + * + * A driver must ask the bhnd bus to allocate PMU request state + * via BHND_BUS_ALLOC_PMU() before it can request clock resources. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 27 00:06:23 2016 Return-Path: Delivered-To: svn-src-head@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 DC51EB768DD; Sat, 27 Aug 2016 00:06:22 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 74FCD8C7; Sat, 27 Aug 2016 00:06:22 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R06LfN063166; Sat, 27 Aug 2016 00:06:21 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R06LDp063158; Sat, 27 Aug 2016 00:06:21 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608270006.u7R06LDp063158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 27 Aug 2016 00:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304871 - in head/sys: dev/bhnd/cores/chipc dev/bhnd/cores/chipc/pwrctl dev/bhnd/cores/pmu mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:06:23 -0000 Author: landonf Date: Sat Aug 27 00:06:20 2016 New Revision: 304871 URL: https://svnweb.freebsd.org/changeset/base/304871 Log: [mips/broadcom]: Replace static frequency table with generic PMU clock handling. - Extended PWRCTL/PMU APIs to support querying clock frequency during very early boot, prior to bus attach. - Implement generic PMU-based calculation of UART rclk values. - Replaced use of static frequency tables (bcm_socinfo) with runtime-determined values. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7552 Added: head/sys/mips/broadcom/bcm_pmu.c (contents, props changed) Deleted: head/sys/mips/broadcom/bcm_socinfo.c head/sys/mips/broadcom/bcm_socinfo.h Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctlvar.h head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c head/sys/dev/bhnd/cores/pmu/bhnd_pmu_private.h head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c head/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/broadcom/bcm_machdep.h head/sys/mips/broadcom/files.broadcom head/sys/mips/broadcom/uart_bus_chipc.c head/sys/mips/broadcom/uart_cpu_chipc.c Modified: head/sys/dev/bhnd/cores/chipc/chipcreg.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipcreg.h Sat Aug 27 00:03:02 2016 (r304870) +++ head/sys/dev/bhnd/cores/chipc/chipcreg.h Sat Aug 27 00:06:20 2016 (r304871) @@ -31,6 +31,10 @@ required during bus enumeration */ +/** Evaluates to true if the given ChipCommon core revision supports + * the CHIPC_CORECTRL register */ +#define CHIPC_HWREV_HAS_CORECTRL(hwrev) ((hwrev) >= 1) + /** Evaluates to true if the given ChipCommon core revision provides * the core count via the chip identification register. */ #define CHIPC_NCORES_MIN_HWREV(hwrev) ((hwrev) == 4 || (hwrev) >= 6) @@ -278,14 +282,14 @@ enum { #define CHIPC_CST_SPROM_OTP_SEL_R23_SHIFT 6 /* PLL type */ -#define CHIPC_PLL_NONE 0x00 -#define CHIPC_PLL_TYPE1 0x10 /* 48MHz base, 3 dividers */ -#define CHIPC_PLL_TYPE2 0x20 /* 48MHz, 4 dividers */ -#define CHIPC_PLL_TYPE3 0x30 /* 25MHz, 2 dividers */ -#define CHIPC_PLL_TYPE4 0x08 /* 48MHz, 4 dividers */ -#define CHIPC_PLL_TYPE5 0x18 /* 25MHz, 4 dividers */ -#define CHIPC_PLL_TYPE6 0x28 /* 100/200 or 120/240 only */ -#define CHIPC_PLL_TYPE7 0x38 /* 25MHz, 4 dividers */ +#define CHIPC_PLL_NONE 0x0 +#define CHIPC_PLL_TYPE1 0x2 /* 48MHz base, 3 dividers */ +#define CHIPC_PLL_TYPE2 0x4 /* 48MHz, 4 dividers */ +#define CHIPC_PLL_TYPE3 0x6 /* 25MHz, 2 dividers */ +#define CHIPC_PLL_TYPE4 0x8 /* 48MHz, 4 dividers */ +#define CHIPC_PLL_TYPE5 0x3 /* 25MHz, 4 dividers */ +#define CHIPC_PLL_TYPE6 0x5 /* 100/200 or 120/240 only */ +#define CHIPC_PLL_TYPE7 0x7 /* 25MHz, 4 dividers */ /* dynamic clock control defines */ #define CHIPC_LPOMINFREQ 25000 /* low power oscillator min */ Modified: head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c Sat Aug 27 00:03:02 2016 (r304870) +++ head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c Sat Aug 27 00:06:20 2016 (r304871) @@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$"); #include "bhnd_pwrctl_private.h" static uint32_t bhnd_pwrctl_factor6(uint32_t x); -static uint32_t bhnd_pwrctl_clock_rate(uint32_t pll_type, uint32_t n, - uint32_t m); /** * Return the factor value corresponding to a given N3M clock control magic @@ -75,14 +73,122 @@ bhnd_pwrctl_factor6(uint32_t x) } /** + * Return the backplane clock's chipc 'M' register offset for a given PLL type, + * or 0 if a fixed clock speed should be used. + * + * @param cid Chip identification. + * @param pll_type PLL type (CHIPC_PLL_TYPE*) + * @param[out] fixed_hz If 0 is returned, will be set to the fixed clock + * speed for this device. + */ +bus_size_t +bhnd_pwrctl_si_clkreg_m(const struct bhnd_chipid *cid, + uint8_t pll_type, uint32_t *fixed_hz) +{ + switch (pll_type) { + case CHIPC_PLL_TYPE6: + return (CHIPC_CLKC_M3); + case CHIPC_PLL_TYPE3: + return (CHIPC_CLKC_M2); + default: + return (CHIPC_CLKC_SB); + } +} + +/** + * Calculate the backplane clock speed (in Hz) for a given a set of clock + * control values. + * + * @param cid Chip identification. + * @param pll_type PLL type (CHIPC_PLL_TYPE*) + * @param n clock control N register value. + * @param m clock control M register value. + */ +uint32_t +bhnd_pwrctl_si_clock_rate(const struct bhnd_chipid *cid, + uint32_t pll_type, uint32_t n, uint32_t m) +{ + uint32_t rate; + + KASSERT(bhnd_pwrctl_si_clkreg_m(cid, pll_type, NULL) != 0, + ("can't compute clock rate on fixed clock")); + + rate = bhnd_pwrctl_clock_rate(pll_type, n, m); + if (pll_type == CHIPC_PLL_TYPE3) + rate /= 2; + + return (rate); +} + +/** + * Return the CPU clock's chipc 'M' register offset for a given PLL type, + * or 0 if a fixed clock speed should be used. + * + * @param cid Chip identification. + * @param pll_type PLL type (CHIPC_PLL_TYPE*) + * @param[out] fixed_hz If 0 is returned, will be set to the fixed clock + * speed for this device. + */ +bus_size_t +bhnd_pwrctl_cpu_clkreg_m(const struct bhnd_chipid *cid, + uint8_t pll_type, uint32_t *fixed_hz) +{ + switch (pll_type) { + case CHIPC_PLL_TYPE2: + case CHIPC_PLL_TYPE4: + case CHIPC_PLL_TYPE6: + case CHIPC_PLL_TYPE7: + return (CHIPC_CLKC_M3); + + case CHIPC_PLL_TYPE5: + /* fixed 200MHz */ + if (fixed_hz != NULL) + *fixed_hz = 200 * 1000 * 1000; + return (0); + + case CHIPC_PLL_TYPE3: + if (cid->chip_id == BHND_CHIPID_BCM5365) { + /* fixed 200MHz */ + if (fixed_hz != NULL) + *fixed_hz = 200 * 1000 * 1000; + return (0); + } + + return (CHIPC_CLKC_M2); + + default: + return (CHIPC_CLKC_SB); + } +} + +/** + * Calculate the CPU clock speed (in Hz) for a given a set of clock control + * values. + * + * @param cid Chip identification. + * @param pll_type PLL type (CHIPC_PLL_TYPE*) + * @param n clock control N register value. + * @param m clock control M register value. + */ +uint32_t +bhnd_pwrctl_cpu_clock_rate(const struct bhnd_chipid *cid, + uint32_t pll_type, uint32_t n, uint32_t m) +{ + KASSERT(bhnd_pwrctl_cpu_clkreg_m(cid, pll_type, NULL) != 0, + ("can't compute clock rate on fixed clock")); + + return (bhnd_pwrctl_clock_rate(pll_type, n, m)); +} + +/** * Calculate the clock speed (in Hz) for a given a set of clockcontrol * values. * * @param pll_type PLL type (CHIPC_PLL_TYPE*) * @param n clock control N register value. - * @param m clock control N register value. + * @param m clock control M register value. */ -static uint32_t +uint32_t bhnd_pwrctl_clock_rate(uint32_t pll_type, uint32_t n, uint32_t m) { uint32_t clk_base; @@ -195,38 +301,27 @@ bhnd_pwrctl_clock_rate(uint32_t pll_type uint32_t bhnd_pwrctl_getclk_speed(struct bhnd_pwrctl_softc *sc) { - struct chipc_caps *ccaps; - bus_size_t creg; - uint32_t n, m; - uint32_t rate; + const struct bhnd_chipid *cid; + struct chipc_caps *ccaps; + bus_size_t creg; + uint32_t n, m; + uint32_t rate; PWRCTL_LOCK_ASSERT(sc, MA_OWNED); + cid = bhnd_get_chipid(sc->chipc_dev); ccaps = BHND_CHIPC_GET_CAPS(sc->chipc_dev); n = bhnd_bus_read_4(sc->res, CHIPC_CLKC_N); - switch (ccaps->pll_type) { - case CHIPC_PLL_TYPE6: - creg = CHIPC_CLKC_M3; /* non-extif regster */ - break; - case CHIPC_PLL_TYPE3: - creg = CHIPC_CLKC_M2; - break; - default: - creg = CHIPC_CLKC_SB; - break; - } - - m = bhnd_bus_read_4(sc->res, creg); + /* Get M register offset */ + creg = bhnd_pwrctl_si_clkreg_m(cid, ccaps->pll_type, &rate); + if (creg == 0) /* fixed rate */ + return (rate); /* calculate rate */ - rate = bhnd_pwrctl_clock_rate(ccaps->pll_type, n, m); - - if (ccaps->pll_type == CHIPC_PLL_TYPE3) - rate /= 2; - - return (rate); + m = bhnd_bus_read_4(sc->res, creg); + return (bhnd_pwrctl_si_clock_rate(cid, ccaps->pll_type, n, m)); } /* return the slow clock source */ Modified: head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctlvar.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctlvar.h Sat Aug 27 00:03:02 2016 (r304870) +++ head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctlvar.h Sat Aug 27 00:06:20 2016 (r304871) @@ -36,6 +36,21 @@ #include #include +#include + +uint32_t bhnd_pwrctl_clock_rate(uint32_t pll_type, uint32_t n, + uint32_t m); + +bus_size_t bhnd_pwrctl_si_clkreg_m(const struct bhnd_chipid *cid, + uint8_t pll_type, uint32_t *fixed_hz); +uint32_t bhnd_pwrctl_si_clock_rate(const struct bhnd_chipid *cid, + uint32_t pll_type, uint32_t n, uint32_t m); + +bus_size_t bhnd_pwrctl_cpu_clkreg_m(const struct bhnd_chipid *cid, + uint8_t pll_type, uint32_t *fixed_hz); +uint32_t bhnd_pwrctl_cpu_clock_rate(const struct bhnd_chipid *cid, + uint32_t pll_type, uint32_t n, uint32_t m); + /** * bhnd pwrctl device quirks. */ Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c ============================================================================== --- head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c Sat Aug 27 00:03:02 2016 (r304870) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c Sat Aug 27 00:06:20 2016 (r304871) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "bhnd_nvram_map.h" @@ -69,6 +70,16 @@ static int bhnd_pmu_sysctl_bus_freq(SYSC static int bhnd_pmu_sysctl_cpu_freq(SYSCTL_HANDLER_ARGS); static int bhnd_pmu_sysctl_mem_freq(SYSCTL_HANDLER_ARGS); +static uint32_t bhnd_pmu_read_4(bus_size_t reg, void *ctx); +static void bhnd_pmu_write_4(bus_size_t reg, uint32_t val, void *ctx); +static uint32_t bhnd_pmu_read_chipst(void *ctx); + +static const struct bhnd_pmu_io bhnd_pmu_res_io = { + .rd4 = bhnd_pmu_read_4, + .wr4 = bhnd_pmu_write_4, + .rd_chipst = bhnd_pmu_read_chipst +}; + #define BPMU_CLKCTL_READ_4(_pinfo) \ bhnd_bus_read_4((_pinfo)->pm_res, (_pinfo)->pm_regs) @@ -144,6 +155,14 @@ bhnd_pmu_attach(device_t dev, struct bhn return (ENXIO); } + /* Initialize query state */ + error = bhnd_pmu_query_init(&sc->query, dev, sc->cid, &bhnd_pmu_res_io, + sc); + if (error) + return (error); + sc->io = sc->query.io; + sc->io_ctx = sc->query.io_ctx; + BPMU_LOCK_INIT(sc); /* Set quirk flags */ @@ -183,6 +202,7 @@ bhnd_pmu_attach(device_t dev, struct bhn failed: BPMU_LOCK_DESTROY(sc); + bhnd_pmu_query_fini(&sc->query); return (error); } @@ -197,6 +217,7 @@ bhnd_pmu_detach(device_t dev) sc = device_get_softc(dev); BPMU_LOCK_DESTROY(sc); + bhnd_pmu_query_fini(&sc->query); return (0); } @@ -239,7 +260,7 @@ bhnd_pmu_sysctl_bus_freq(SYSCTL_HANDLER_ sc = arg1; BPMU_LOCK(sc); - freq = bhnd_pmu_si_clock(sc); + freq = bhnd_pmu_si_clock(&sc->query); BPMU_UNLOCK(sc); return (sysctl_handle_32(oidp, NULL, freq, req)); @@ -254,7 +275,7 @@ bhnd_pmu_sysctl_cpu_freq(SYSCTL_HANDLER_ sc = arg1; BPMU_LOCK(sc); - freq = bhnd_pmu_cpu_clock(sc); + freq = bhnd_pmu_cpu_clock(&sc->query); BPMU_UNLOCK(sc); return (sysctl_handle_32(oidp, NULL, freq, req)); @@ -269,7 +290,7 @@ bhnd_pmu_sysctl_mem_freq(SYSCTL_HANDLER_ sc = arg1; BPMU_LOCK(sc); - freq = bhnd_pmu_mem_clock(sc); + freq = bhnd_pmu_mem_clock(&sc->query); BPMU_UNLOCK(sc); return (sysctl_handle_32(oidp, NULL, freq, req)); @@ -445,6 +466,27 @@ bhnd_pmu_core_release(device_t dev, stru return (0); } +static uint32_t +bhnd_pmu_read_4(bus_size_t reg, void *ctx) +{ + struct bhnd_pmu_softc *sc = ctx; + return (bhnd_bus_read_4(sc->res, reg)); +} + +static void +bhnd_pmu_write_4(bus_size_t reg, uint32_t val, void *ctx) +{ + struct bhnd_pmu_softc *sc = ctx; + return (bhnd_bus_write_4(sc->res, reg, val)); +} + +static uint32_t +bhnd_pmu_read_chipst(void *ctx) +{ + struct bhnd_pmu_softc *sc = ctx; + return (BHND_CHIPC_READ_CHIPST(sc->chipc_dev)); +} + static device_method_t bhnd_pmu_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bhnd_pmu_probe), Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_private.h ============================================================================== --- head/sys/dev/bhnd/cores/pmu/bhnd_pmu_private.h Sat Aug 27 00:03:02 2016 (r304870) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu_private.h Sat Aug 27 00:06:20 2016 (r304871) @@ -30,15 +30,9 @@ #include "bhnd_pmuvar.h" /* Register I/O */ -#define BHND_PMU_READ_1(_sc, _reg) bhnd_bus_read_1((_sc)->res, (_reg)) -#define BHND_PMU_READ_2(_sc, _reg) bhnd_bus_read_2((_sc)->res, (_reg)) -#define BHND_PMU_READ_4(_sc, _reg) bhnd_bus_read_4((_sc)->res, (_reg)) -#define BHND_PMU_WRITE_1(_sc, _reg, _val) \ - bhnd_bus_write_1((_sc)->res, (_reg), (_val)) -#define BHND_PMU_WRITE_2(_sc, _reg, _val) \ - bhnd_bus_write_2((_sc)->res, (_reg), (_val)) +#define BHND_PMU_READ_4(_sc, _reg) (_sc)->io->rd4((_reg), (_sc)->io_ctx) #define BHND_PMU_WRITE_4(_sc, _reg, _val) \ - bhnd_bus_write_4((_sc)->res, (_reg), (_val)) + (_sc)->io->wr4((_reg), (_val), (_sc)->io_ctx) #define BHND_PMU_AND_4(_sc, _reg, _val) \ BHND_PMU_WRITE_4((_sc), (_reg), \ @@ -49,10 +43,11 @@ /* Indirect register support */ #define BHND_PMU_IND_READ(_sc, _src, _reg) \ - bhnd_pmu_ind_read((_sc), BHND_PMU_ ## _src ## _ADDR, \ - BHND_PMU_ ## _src ## _DATA, (_reg)) + bhnd_pmu_ind_read((_sc)->io, (_sc)->io_ctx, \ + BHND_PMU_ ## _src ## _ADDR, BHND_PMU_ ## _src ## _DATA, (_reg)) #define BHND_PMU_IND_WRITE(_sc, _src, _reg, _val, _mask) \ - bhnd_pmu_ind_write(sc, BHND_PMU_ ## _src ## _ADDR, \ + bhnd_pmu_ind_write((_sc)->io, (_sc)->io_ctx, \ + BHND_PMU_ ## _src ## _ADDR, \ BHND_PMU_ ## _src ## _DATA, (_reg), (_val), (_mask)) /* Chip Control indirect registers */ @@ -96,10 +91,12 @@ enum { SET_LDO_VOLTAGE_LNLDO2_SEL = 10, }; -uint32_t bhnd_pmu_ind_read(struct bhnd_pmu_softc *sc, bus_size_t addr, - bus_size_t data, uint32_t reg); -void bhnd_pmu_ind_write(struct bhnd_pmu_softc *sc, bus_size_t addr, - bus_size_t data, uint32_t reg, uint32_t val, uint32_t mask); + +uint32_t bhnd_pmu_ind_read(const struct bhnd_pmu_io *io, void *io_ctx, + bus_size_t addr, bus_size_t data, uint32_t reg); +void bhnd_pmu_ind_write(const struct bhnd_pmu_io *io, void *io_ctx, + bus_size_t addr, bus_size_t data, uint32_t reg, + uint32_t val, uint32_t mask); bool bhnd_pmu_wait_clkst(struct bhnd_pmu_softc *sc, device_t dev, struct bhnd_resource *r, bus_size_t clkst_reg, @@ -112,12 +109,6 @@ void bhnd_pmu_swreg_init(struct bhnd_pm uint32_t bhnd_pmu_force_ilp(struct bhnd_pmu_softc *sc, bool force); -uint32_t bhnd_pmu_si_clock(struct bhnd_pmu_softc *sc); -uint32_t bhnd_pmu_cpu_clock(struct bhnd_pmu_softc *sc); -uint32_t bhnd_pmu_mem_clock(struct bhnd_pmu_softc *sc); -uint32_t bhnd_pmu_alp_clock(struct bhnd_pmu_softc *sc); -uint32_t bhnd_pmu_ilp_clock(struct bhnd_pmu_softc *sc); - void bhnd_pmu_set_switcher_voltage(struct bhnd_pmu_softc *sc, uint8_t bb_voltage, uint8_t rf_voltage); void bhnd_pmu_set_ldo_voltage(struct bhnd_pmu_softc *sc, Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c ============================================================================== --- head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Sat Aug 27 00:03:02 2016 (r304870) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Sat Aug 27 00:06:20 2016 (r304871) @@ -38,33 +38,36 @@ __FBSDID("$FreeBSD$"); #include "bhnd_pmu_private.h" -#ifdef BCMDBG -#define PMU_MSG(args) printf args -#define PMU_ERROR(args) do { \ - panic args; \ +#define PMU_LOG(_sc, _fmt, ...) do { \ + if (_sc->dev != NULL) \ + device_printf(_sc->dev, _fmt, ##__VA_ARGS__); \ + else \ + printf(_fmt, ##__VA_ARGS__); \ } while (0) + +#ifdef BCMDBG +#define PMU_DEBUG(_sc, _fmt, ...) PMU_LOG(_sc, _fmt, ##__VA_ARGS__) #else -#define PMU_MSG(args) -#define PMU_ERROR(args) printf args +#define PMU_DEBUG(_sc, _fmt, ...) #endif typedef struct pmu0_xtaltab0 pmu0_xtaltab0_t; typedef struct pmu1_xtaltab0 pmu1_xtaltab0_t; /* PLL controls/clocks */ -static const pmu1_xtaltab0_t *bhnd_pmu1_xtaltab0(struct bhnd_pmu_softc *sc); -static const pmu1_xtaltab0_t *bhnd_pmu1_xtaldef0(struct bhnd_pmu_softc *sc); +static const pmu1_xtaltab0_t *bhnd_pmu1_xtaltab0(struct bhnd_pmu_query *sc); +static const pmu1_xtaltab0_t *bhnd_pmu1_xtaldef0(struct bhnd_pmu_query *sc); static void bhnd_pmu0_pllinit0(struct bhnd_pmu_softc *sc, uint32_t xtal); -static uint32_t bhnd_pmu0_cpuclk0(struct bhnd_pmu_softc *sc); -static uint32_t bhnd_pmu0_alpclk0(struct bhnd_pmu_softc *sc); +static uint32_t bhnd_pmu0_cpuclk0(struct bhnd_pmu_query *sc); +static uint32_t bhnd_pmu0_alpclk0(struct bhnd_pmu_query *sc); static void bhnd_pmu1_pllinit0(struct bhnd_pmu_softc *sc, uint32_t xtal); -static uint32_t bhnd_pmu1_pllfvco0(struct bhnd_pmu_softc *sc); -static uint32_t bhnd_pmu1_cpuclk0(struct bhnd_pmu_softc *sc); -static uint32_t bhnd_pmu1_alpclk0(struct bhnd_pmu_softc *sc); +static uint32_t bhnd_pmu1_pllfvco0(struct bhnd_pmu_query *sc); +static uint32_t bhnd_pmu1_cpuclk0(struct bhnd_pmu_query *sc); +static uint32_t bhnd_pmu1_alpclk0(struct bhnd_pmu_query *sc); -static uint32_t bhnd_pmu5_clock(struct bhnd_pmu_softc *sc, u_int pll0, u_int m); +static uint32_t bhnd_pmu5_clock(struct bhnd_pmu_query *sc, u_int pll0, u_int m); /* PMU resources */ static bool bhnd_pmu_res_depfltr_bb(struct bhnd_pmu_softc *sc); @@ -93,7 +96,45 @@ static void bhnd_pmu_set_4330_plldivs(st (1 << (BHND_PMU_ ## _bit)) #define PMU_CST4330_SDIOD_CHIPMODE(_sc) \ - CHIPC_CST4330_CHIPMODE_SDIOD(BHND_CHIPC_READ_CHIPST((_sc)->chipc_dev)) + CHIPC_CST4330_CHIPMODE_SDIOD((_sc)->io->rd_chipst((_sc)->io_ctx)) + +/** + * Initialize @p query state. + * + * @param[out] query On success, will be populated with a valid query instance + * state. + * @param dev The device owning @p query, or NULL. + * @param id The bhnd chip identification. + * @param io I/O callback functions. + * @param ctx I/O callback context. + * + * @retval 0 success + * @retval non-zero if the query state could not be initialized. + */ +int +bhnd_pmu_query_init(struct bhnd_pmu_query *query, device_t dev, + struct bhnd_chipid id, const struct bhnd_pmu_io *io, void *ctx) +{ + query->dev = dev; + query->io = io; + query->io_ctx = ctx; + query->cid = id; + query->caps = BHND_PMU_READ_4(query, BHND_PMU_CAP); + + return (0); +} + +/** + * Release any resources held by @p query. + * + * @param query A query instance previously initialized via + * bhnd_pmu_query_init(). + */ +void +bhnd_pmu_query_fini(struct bhnd_pmu_query *query) +{ + /* nothing to do */ +} /** * Perform an indirect register read. @@ -103,11 +144,11 @@ static void bhnd_pmu_set_4330_plldivs(st * @param reg Indirect register to be read. */ uint32_t -bhnd_pmu_ind_read(struct bhnd_pmu_softc *sc, bus_size_t addr, bus_size_t data, - uint32_t reg) +bhnd_pmu_ind_read(const struct bhnd_pmu_io *io, void *io_ctx, bus_size_t addr, + bus_size_t data, uint32_t reg) { - BHND_PMU_WRITE_4(sc, addr, reg); - return (BHND_PMU_READ_4(sc, data)); + io->wr4(addr, reg, io_ctx); + return (io->rd4(data, io_ctx)); } /** @@ -120,21 +161,21 @@ bhnd_pmu_ind_read(struct bhnd_pmu_softc * @param mask Only the bits defined by @p mask will be updated from @p val. */ void -bhnd_pmu_ind_write(struct bhnd_pmu_softc *sc, bus_size_t addr, +bhnd_pmu_ind_write(const struct bhnd_pmu_io *io, void *io_ctx, bus_size_t addr, bus_size_t data, uint32_t reg, uint32_t val, uint32_t mask) { uint32_t rval; - BHND_PMU_WRITE_4(sc, addr, reg); + io->wr4(addr, reg, io_ctx); if (mask != UINT32_MAX) { - rval = BHND_PMU_READ_4(sc, data); + rval = io->rd4(data, io_ctx); rval &= ~mask | (val & mask); } else { rval = val; } - BHND_PMU_WRITE_4(sc, data, rval); + io->wr4(data, rval, io_ctx); } /** @@ -375,7 +416,7 @@ bhnd_pmu_fast_pwrup_delay(struct bhnd_pm if (error) return (error); - ilp = bhnd_pmu_ilp_clock(sc); + ilp = bhnd_pmu_ilp_clock(&sc->query); delay = (uptime + D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp - 1) / ilp); delay = (11 * delay) / 10; @@ -387,7 +428,7 @@ bhnd_pmu_fast_pwrup_delay(struct bhnd_pm if (error) return (error); - ilp = bhnd_pmu_ilp_clock(sc); + ilp = bhnd_pmu_ilp_clock(&sc->query); delay = (uptime + D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp - 1) / ilp); delay = (11 * delay) / 10; @@ -403,7 +444,7 @@ bhnd_pmu_fast_pwrup_delay(struct bhnd_pm if (error) return (error); - ilp = bhnd_pmu_ilp_clock(sc); + ilp = bhnd_pmu_ilp_clock(&sc->query); delay = (uptime + D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp - 1) / ilp); delay = (11 * delay) / 10; @@ -415,7 +456,7 @@ bhnd_pmu_fast_pwrup_delay(struct bhnd_pm if (error) return (error); - ilp = bhnd_pmu_ilp_clock(sc); + ilp = bhnd_pmu_ilp_clock(&sc->query); delay = (uptime + D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp - 1) / ilp); delay = (11 * delay) / 10; @@ -882,22 +923,22 @@ bhnd_pmu_res_masks(struct bhnd_pmu_softc /* Apply nvram override to min mask */ error = bhnd_nvram_getvar_uint32(sc->chipc_dev, BHND_NVAR_RMIN, &nval); if (error && error != ENOENT) { - device_printf(sc->dev, "NVRAM error reading %s: %d\n", + PMU_LOG(sc, "NVRAM error reading %s: %d\n", BHND_NVAR_RMIN, error); return (error); } else if (!error) { - PMU_MSG(("Applying rmin=%#x to min_mask\n", nval)); + PMU_DEBUG(sc, "Applying rmin=%#x to min_mask\n", nval); min_mask = nval; } /* Apply nvram override to max mask */ error = bhnd_nvram_getvar_uint32(sc->chipc_dev, BHND_NVAR_RMAX, &nval); if (error && error != ENOENT) { - device_printf(sc->dev, "NVRAM error reading %s: %d\n", + PMU_LOG(sc, "NVRAM error reading %s: %d\n", BHND_NVAR_RMAX, error); return (error); } else if (!error) { - PMU_MSG(("Applying rmax=%#x to max_mask\n", nval)); + PMU_DEBUG(sc, "Applying rmax=%#x to max_mask\n", nval); min_mask = nval; } @@ -1013,8 +1054,8 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc updt = &pmu_res_updown_table[pmu_res_updown_table_sz - i - 1]; - PMU_MSG(("Changing rsrc %d res_updn_timer to %#x\n", - updt->resnum, updt->updown)); + PMU_DEBUG(sc, "Changing rsrc %d res_updn_timer to %#x\n", + updt->resnum, updt->updown); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, updt->resnum); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_UPDN_TIMER, updt->updown); @@ -1031,13 +1072,13 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc if (error == ENOENT) { continue; } else if (error) { - device_printf(sc->dev, "NVRAM error reading %s: %d\n", + PMU_LOG(sc, "NVRAM error reading %s: %d\n", name, error); return (error); } - PMU_MSG(("Applying %s=%s to rsrc %d res_updn_timer\n", name, - val, i)); + PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_updn_timer\n", + name, val, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_UPDN_TIMER, val); @@ -1066,21 +1107,21 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc BHND_PMU_RES_DEP_MASK); switch (rdep->action) { case RES_DEPEND_SET: - PMU_MSG(("Changing rsrc %hhu res_dep_mask to " - "%#x\n", i, table->depend_mask)); + PMU_DEBUG(sc, "Changing rsrc %hhu res_dep_mask to " + "%#x\n", i, table->depend_mask); depend_mask = rdep->depend_mask; break; case RES_DEPEND_ADD: - PMU_MSG(("Adding %#x to rsrc %hhu " - "res_dep_mask\n", table->depend_mask, i)); + PMU_DEBUG(sc, "Adding %#x to rsrc %hhu " + "res_dep_mask\n", table->depend_mask, i); depend_mask |= rdep->depend_mask; break; case RES_DEPEND_REMOVE: - PMU_MSG(("Removing %#x from rsrc %hhu " - "res_dep_mask\n", table->depend_mask, i)); + PMU_DEBUG(sc, "Removing %#x from rsrc %hhu " + "res_dep_mask\n", table->depend_mask, i); depend_mask &= ~(rdep->depend_mask); break; @@ -1106,13 +1147,13 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc if (error == ENOENT) { continue; } else if (error) { - device_printf(sc->dev, "NVRAM error reading %s: %d\n", - name, error); + PMU_LOG(sc, "NVRAM error reading %s: %d\n", name, + error); return (error); } - PMU_MSG(("Applying %s=%s to rsrc %d res_dep_mask\n", name, val, - i)); + PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_dep_mask\n", name, + val, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_DEP_MASK, val); @@ -1126,14 +1167,14 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc /* Program max resource mask */ if (max_mask != 0) { - PMU_MSG(("Changing max_res_mask to 0x%x\n", max_mask)); + PMU_DEBUG(sc, "Changing max_res_mask to 0x%x\n", max_mask); BHND_PMU_WRITE_4(sc, BHND_PMU_MAX_RES_MASK, max_mask); } /* Program min resource mask */ if (min_mask != 0) { - PMU_MSG(("Changing min_res_mask to 0x%x\n", min_mask)); + PMU_DEBUG(sc, "Changing min_res_mask to 0x%x\n", min_mask); BHND_PMU_WRITE_4(sc, BHND_PMU_MIN_RES_MASK, min_mask); } @@ -1367,7 +1408,7 @@ static const pmu1_xtaltab0_t pmu1_xtalta /* select xtal table for each chip */ static const pmu1_xtaltab0_t * -bhnd_pmu1_xtaltab0(struct bhnd_pmu_softc *sc) +bhnd_pmu1_xtaltab0(struct bhnd_pmu_query *sc) { switch (sc->cid.chip_id) { case BHND_CHIPID_BCM4315: @@ -1386,15 +1427,15 @@ bhnd_pmu1_xtaltab0(struct bhnd_pmu_softc else return (pmu1_xtaltab0_1440); default: - PMU_MSG(("bhnd_pmu1_xtaltab0: Unknown chipid %#hx\n", - sc->cid.chip_id)); + PMU_DEBUG(sc, "bhnd_pmu1_xtaltab0: Unknown chipid %#hx\n", + sc->cid.chip_id); return (NULL); } } /* select default xtal frequency for each chip */ static const pmu1_xtaltab0_t * -bhnd_pmu1_xtaldef0(struct bhnd_pmu_softc *sc) +bhnd_pmu1_xtaldef0(struct bhnd_pmu_query *sc) { switch (sc->cid.chip_id) { case BHND_CHIPID_BCM4315: @@ -1419,15 +1460,15 @@ bhnd_pmu1_xtaldef0(struct bhnd_pmu_softc else return (&pmu1_xtaltab0_1440[PMU1_XTALTAB0_1440_37400K]); default: - PMU_MSG(("bhnd_pmu1_xtaldef0: Unknown chipid %#hx\n", - sc->cid.chip_id)); + PMU_DEBUG(sc, "bhnd_pmu1_xtaldef0: Unknown chipid %#hx\n", + sc->cid.chip_id); return (NULL); } } /* select default pll fvco for each chip */ static uint32_t -bhnd_pmu1_pllfvco0(struct bhnd_pmu_softc *sc) +bhnd_pmu1_pllfvco0(struct bhnd_pmu_query *sc) { switch (sc->cid.chip_id) { case BHND_CHIPID_BCM4329: @@ -1442,15 +1483,15 @@ bhnd_pmu1_pllfvco0(struct bhnd_pmu_softc else return (FVCO_1440); default: - PMU_MSG(("bhnd_pmu1_pllfvco0: Unknown chipid %#hx\n", - sc->cid.chip_id)); + PMU_DEBUG(sc, "bhnd_pmu1_pllfvco0: Unknown chipid %#hx\n", + sc->cid.chip_id); return (0); } } /* query alp/xtal clock frequency */ static uint32_t -bhnd_pmu1_alpclk0(struct bhnd_pmu_softc *sc) +bhnd_pmu1_alpclk0(struct bhnd_pmu_query *sc) { const pmu1_xtaltab0_t *xt; uint32_t xf; @@ -1469,8 +1510,7 @@ bhnd_pmu1_alpclk0(struct bhnd_pmu_softc xt = bhnd_pmu1_xtaldef0(sc); if (xt == NULL || xt->fref == 0) { - device_printf(sc->dev, - "no matching ALP/XTAL frequency found\n"); + PMU_LOG(sc, "no matching ALP/XTAL frequency found\n"); return (0); } @@ -1489,8 +1529,8 @@ bhnd_pmu0_pllinit0(struct bhnd_pmu_softc /* Use h/w default PLL config */ if (xtal == 0) { - PMU_MSG(("Unspecified xtal frequency, skipping PLL " - "configuration\n")); + PMU_DEBUG(sc, "Unspecified xtal frequency, skipping PLL " + "configuration\n"); return; } @@ -1503,7 +1543,8 @@ bhnd_pmu0_pllinit0(struct bhnd_pmu_softc if (xt->freq == 0) xt = &pmu0_xtaltab0[PMU0_XTAL0_DEFAULT]; - PMU_MSG(("XTAL %d.%d MHz (%d)\n", xtal / 1000, xtal % 1000, xt->xf)); + PMU_DEBUG(sc, "XTAL %d.%d MHz (%d)\n", xtal / 1000, xtal % 1000, + xt->xf); /* Check current PLL state */ pmu_ctrl = BHND_PMU_READ_4(sc, BHND_PMU_CTRL); @@ -1517,19 +1558,20 @@ bhnd_pmu0_pllinit0(struct bhnd_pmu_softc } #endif /* BCMUSBDEV */ - PMU_MSG(("PLL already programmed for %d.%d MHz\n", - xt->freq / 1000, xt->freq % 1000)); + PMU_DEBUG(sc, "PLL already programmed for %d.%d MHz\n", + xt->freq / 1000, xt->freq % 1000); return; } if (xf != 0) { - PMU_MSG(("Reprogramming PLL for %d.%d MHz (was %d.%dMHz)\n", + PMU_DEBUG(sc, + "Reprogramming PLL for %d.%d MHz (was %d.%dMHz)\n", xt->freq / 1000, xt->freq % 1000, pmu0_xtaltab0[tmp-1].freq / 1000, - pmu0_xtaltab0[tmp-1].freq % 1000)); + pmu0_xtaltab0[tmp-1].freq % 1000); } else { - PMU_MSG(("Programming PLL for %d.%d MHz\n", - xt->freq / 1000, xt->freq % 1000)); + PMU_DEBUG(sc, "Programming PLL for %d.%d MHz\n", + xt->freq / 1000, xt->freq % 1000); } /* Make sure the PLL is off */ @@ -1549,7 +1591,7 @@ bhnd_pmu0_pllinit0(struct bhnd_pmu_softc /* Wait for HT clock to shutdown. */ PMU_WAIT_CLKST(sc, 0, BHND_CCS_HTAVAIL); - PMU_MSG(("Done masking\n")); + PMU_DEBUG(sc, "Done masking\n"); /* Write PDIV in pllcontrol[0] */ if (xt->freq >= BHND_PMU0_PLL0_PC0_PDIV_FREQ) { @@ -1582,7 +1624,7 @@ bhnd_pmu0_pllinit0(struct bhnd_pmu_softc pll_mask = BHND_PMU0_PLL0_PC2_WILD_INT_MASK; BHND_PMU_PLL_WRITE(sc, BHND_PMU0_PLL0_PLLCTL2, pll_data, pll_mask); - PMU_MSG(("Done pll\n")); + PMU_DEBUG(sc, "Done pll\n"); /* Write XtalFreq. Set the divisor also. */ pmu_ctrl = BHND_PMU_READ_4(sc, BHND_PMU_CTRL); @@ -1597,7 +1639,7 @@ bhnd_pmu0_pllinit0(struct bhnd_pmu_softc /* query alp/xtal clock frequency */ static uint32_t -bhnd_pmu0_alpclk0(struct bhnd_pmu_softc *sc) +bhnd_pmu0_alpclk0(struct bhnd_pmu_query *sc) { const pmu0_xtaltab0_t *xt; uint32_t xf; @@ -1618,7 +1660,7 @@ bhnd_pmu0_alpclk0(struct bhnd_pmu_softc /* query CPU clock frequency */ static uint32_t -bhnd_pmu0_cpuclk0(struct bhnd_pmu_softc *sc) +bhnd_pmu0_cpuclk0(struct bhnd_pmu_query *sc) { uint32_t tmp, divarm; uint32_t FVCO; @@ -1654,8 +1696,8 @@ bhnd_pmu0_cpuclk0(struct bhnd_pmu_softc fvco /= 1000; fvco *= 1000; - PMU_MSG(("bhnd_pmu0_cpuclk0: wbint %u wbfrac %u fvco %u\n", - wbint, wbfrac, fvco)); + PMU_DEBUG(sc, "bhnd_pmu0_cpuclk0: wbint %u wbfrac %u fvco %u\n", + wbint, wbfrac, fvco); FVCO = fvco; #endif /* BCMDBG */ @@ -1677,19 +1719,21 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc uint32_t FVCO; uint8_t ndiv_mode; - FVCO = bhnd_pmu1_pllfvco0(sc) / 1000; + FVCO = bhnd_pmu1_pllfvco0(&sc->query) / 1000; buf_strength = 0; ndiv_mode = 1; /* Use h/w default PLL config */ if (xtal == 0) { - PMU_MSG(("Unspecified xtal frequency, skipping PLL " - "configuration\n")); + PMU_DEBUG(sc, "Unspecified xtal frequency, skipping PLL " + "configuration\n"); return; } /* Find the frequency in the table */ - for (xt = bhnd_pmu1_xtaltab0(sc); xt != NULL && xt->fref != 0; xt++) { + for (xt = bhnd_pmu1_xtaltab0(&sc->query); xt != NULL && xt->fref != 0; + xt++) + { if (xt->fref == xtal) break; } @@ -1698,8 +1742,8 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc * we don't know how to program it. */ if (xt == NULL || xt->fref == 0) { - device_printf(sc->dev, "Unsupported XTAL frequency %d.%dMHz, " - "skipping PLL configuration\n", xtal / 1000, xtal % 1000); + PMU_LOG(sc, "Unsupported XTAL frequency %d.%dMHz, skipping PLL " + "configuration\n", xtal / 1000, xtal % 1000); return; } @@ -1710,14 +1754,14 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc sc->cid.chip_id != BHND_CHIPID_BCM4319 && sc->cid.chip_id != BHND_CHIPID_BCM4330) { - PMU_MSG(("PLL already programmed for %d.%dMHz\n", - xt->fref / 1000, xt->fref % 1000)); + PMU_DEBUG(sc, "PLL already programmed for %d.%dMHz\n", + xt->fref / 1000, xt->fref % 1000); return; } - PMU_MSG(("XTAL %d.%dMHz (%d)\n", xtal / 1000, xtal % 1000, xt->xf)); - PMU_MSG(("Programming PLL for %d.%dMHz\n", xt->fref / 1000, - xt->fref % 1000)); + PMU_DEBUG(sc, "XTAL %d.%dMHz (%d)\n", xtal / 1000, xtal % 1000, xt->xf); + PMU_DEBUG(sc, "Programming PLL for %d.%dMHz\n", xt->fref / 1000, + xt->fref % 1000); switch (sc->cid.chip_id) { case BHND_CHIPID_BCM4325: @@ -1840,7 +1884,7 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc panic("unsupported chipid %#hx\n", sc->cid.chip_id); } - PMU_MSG(("Done masking\n")); + PMU_DEBUG(sc, "Done masking\n"); /* Write p1div and p2div to pllcontrol[0] */ plldata = @@ -1916,8 +1960,8 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc /* Write clock driving strength to pllcontrol[5] */ if (buf_strength) { - PMU_MSG(("Adjusting PLL buffer drive strength: %x\n", - buf_strength)); + PMU_DEBUG(sc, "Adjusting PLL buffer drive strength: %x\n", + buf_strength); plldata = BHND_PMU_SET_BITS(buf_strength, BHND_PMU1_PLL0_PC5_CLK_DRV); @@ -1946,7 +1990,7 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc pllmask); } - PMU_MSG(("Done pll\n")); + PMU_DEBUG(sc, "Done pll\n"); /* to operate the 4319 usb in 24MHz/48MHz; chipcontrol[2][84:83] needs * to be updated. @@ -1995,7 +2039,7 @@ bhnd_pmu1_pllinit0(struct bhnd_pmu_softc /* query the CPU clock frequency */ static uint32_t -bhnd_pmu1_cpuclk0(struct bhnd_pmu_softc *sc) +bhnd_pmu1_cpuclk0(struct bhnd_pmu_query *sc) { uint32_t tmp, m1div; #ifdef BCMDBG @@ -2032,8 +2076,8 @@ bhnd_pmu1_cpuclk0(struct bhnd_pmu_softc fvco /= 1000; fvco *= 1000; - PMU_MSG(("bhnd_pmu1_cpuclk0: ndiv_int %u ndiv_frac %u p2div %u " - "p1div %u fvco %u\n", ndiv_int, ndiv_frac, p2div, p1div, fvco)); + PMU_DEBUG(sc, "bhnd_pmu1_cpuclk0: ndiv_int %u ndiv_frac %u p2div %u " + "p1div %u fvco %u\n", ndiv_int, ndiv_frac, p2div, p1div, fvco); FVCO = fvco; #endif /* BCMDBG */ @@ -2134,15 +2178,19 @@ bhnd_pmu_pll_init(struct bhnd_pmu_softc bhnd_pmu1_pllinit0(sc, xtalfreq); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 27 00:07:50 2016 Return-Path: Delivered-To: svn-src-head@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 616E6B7698B; Sat, 27 Aug 2016 00:07:50 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 39938A40; Sat, 27 Aug 2016 00:07:50 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R07nGe063297; Sat, 27 Aug 2016 00:07:49 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R07mbT063291; Sat, 27 Aug 2016 00:07:48 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608270007.u7R07mbT063291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 27 Aug 2016 00:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304872 - in head/sys/dev/bhnd: . bcma siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:07:50 -0000 Author: landonf Date: Sat Aug 27 00:07:48 2016 New Revision: 304872 URL: https://svnweb.freebsd.org/changeset/base/304872 Log: bhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device descriptions. Reviewed by: mizhka Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7570 Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/dev/bhnd/siba/siba_nexus.c Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_bhndb.c Sat Aug 27 00:06:20 2016 (r304871) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Sat Aug 27 00:07:48 2016 (r304872) @@ -51,15 +51,22 @@ __FBSDID("$FreeBSD$"); static int bcma_bhndb_probe(device_t dev) { - const struct bhnd_chipid *cid; + const struct bhnd_chipid *cid; + int error; + + /* Defer to default probe implementation */ + if ((error = bcma_probe(dev)) > 0) + return (error); /* Check bus type */ cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); if (cid->chip_type != BHND_CHIPTYPE_BCMA) return (ENXIO); - /* Delegate to default probe implementation */ - return (bcma_probe(dev)); + /* Set device description */ + bhnd_set_default_bus_desc(dev, cid); + + return (error); } static int Modified: head/sys/dev/bhnd/bcma/bcma_nexus.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_nexus.c Sat Aug 27 00:06:20 2016 (r304871) +++ head/sys/dev/bhnd/bcma/bcma_nexus.c Sat Aug 27 00:07:48 2016 (r304872) @@ -82,6 +82,9 @@ bcma_nexus_probe(device_t dev) return (error); } + /* Set device description */ + bhnd_set_default_bus_desc(dev, &sc->bcma_cid); + return (0); } Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sat Aug 27 00:06:20 2016 (r304871) +++ head/sys/dev/bhnd/bhnd.h Sat Aug 27 00:07:48 2016 (r304872) @@ -49,6 +49,9 @@ extern devclass_t bhnd_devclass; extern devclass_t bhnd_hostb_devclass; extern devclass_t bhnd_nvram_devclass; +#define BHND_CHIPID_MAX_NAMELEN 32 /**< maximum buffer required for a + bhnd_format_chip_id() */ + /** * bhnd child instance variables */ @@ -254,6 +257,8 @@ bhnd_devclass_t bhnd_find_core_class( const char *bhnd_core_name(const struct bhnd_core_info *ci); bhnd_devclass_t bhnd_core_class(const struct bhnd_core_info *ci); +int bhnd_format_chip_id(char *buffer, size_t size, + uint16_t chip_id); device_t bhnd_match_child(device_t dev, const struct bhnd_core_match *desc); @@ -321,6 +326,9 @@ void bhnd_set_custom_core_desc(devic const char *name); void bhnd_set_default_core_desc(device_t dev); +void bhnd_set_default_bus_desc(device_t dev, + const struct bhnd_chipid *chip_id); + int bhnd_nvram_getvar_str(device_t dev, const char *name, char *buf, size_t len, size_t *rlen); Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Sat Aug 27 00:06:20 2016 (r304871) +++ head/sys/dev/bhnd/bhnd_subr.c Sat Aug 27 00:07:48 2016 (r304872) @@ -288,6 +288,30 @@ bhnd_core_class(const struct bhnd_core_i } /** + * Write a human readable name representation of the given + * BHND_CHIPID_* constant to @p buffer. + * + * @param buffer Output buffer, or NULL to compute the required size. + * @param size Capacity of @p buffer, in bytes. + * @param chip_id Chip ID to be formatted. + * + * @return Returns the required number of bytes on success, or a negative + * integer on failure. No more than @p size-1 characters be written, with + * the @p size'th set to '\0'. + * + * @sa BHND_CHIPID_MAX_NAMELEN + */ +int +bhnd_format_chip_id(char *buffer, size_t size, uint16_t chip_id) +{ + /* All hex formatted IDs are within the range of 0x4000-0x9C3F (40000-1) */ + if (chip_id >= 0x4000 && chip_id <= 0x9C3F) + return (snprintf(buffer, size, "BCM%hX", chip_id)); + else + return (snprintf(buffer, size, "BCM%hu", chip_id)); +} + +/** * Initialize a core info record with data from from a bhnd-attached @p dev. * * @param dev A bhnd device. @@ -1232,6 +1256,52 @@ bhnd_set_default_core_desc(device_t dev) bhnd_set_custom_core_desc(dev, bhnd_get_device_name(dev)); } + +/** + * Using the bhnd @p chip_id, populate the bhnd(4) bus @p dev's device + * description. + * + * @param dev A bhnd-bus attached device. + */ +void +bhnd_set_default_bus_desc(device_t dev, const struct bhnd_chipid *chip_id) +{ + const char *bus_name; + char *desc; + char chip_name[BHND_CHIPID_MAX_NAMELEN]; + + /* Determine chip type's bus name */ + switch (chip_id->chip_type) { + case BHND_CHIPTYPE_SIBA: + bus_name = "SIBA bus"; + break; + case BHND_CHIPTYPE_BCMA: + case BHND_CHIPTYPE_BCMA_ALT: + bus_name = "BCMA bus"; + break; + case BHND_CHIPTYPE_UBUS: + bus_name = "UBUS bus"; + break; + default: + bus_name = "Unknown Type"; + break; + } + + /* Format chip name */ + bhnd_format_chip_id(chip_name, sizeof(chip_name), + chip_id->chip_id); + + /* Format and set device description */ + asprintf(&desc, M_BHND, "%s %s", chip_name, bus_name); + if (desc != NULL) { + device_set_desc_copy(dev, desc); + free(desc, M_BHND); + } else { + device_set_desc(dev, bus_name); + } + +} + /** * Helper function for implementing BHND_BUS_IS_HW_DISABLED(). * Modified: head/sys/dev/bhnd/siba/siba_bhndb.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_bhndb.c Sat Aug 27 00:06:20 2016 (r304871) +++ head/sys/dev/bhnd/siba/siba_bhndb.c Sat Aug 27 00:07:48 2016 (r304872) @@ -80,15 +80,22 @@ static struct bhnd_device bridge_devs[] static int siba_bhndb_probe(device_t dev) { - const struct bhnd_chipid *cid; + const struct bhnd_chipid *cid; + int error; + + /* Defer to default probe implementation */ + if ((error = siba_probe(dev)) > 0) + return (error); /* Check bus type */ cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); if (cid->chip_type != BHND_CHIPTYPE_SIBA) return (ENXIO); - /* Delegate to default probe implementation */ - return (siba_probe(dev)); + /* Set device description */ + bhnd_set_default_bus_desc(dev, cid); + + return (error); } static int Modified: head/sys/dev/bhnd/siba/siba_nexus.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_nexus.c Sat Aug 27 00:06:20 2016 (r304871) +++ head/sys/dev/bhnd/siba/siba_nexus.c Sat Aug 27 00:07:48 2016 (r304872) @@ -75,6 +75,9 @@ siba_nexus_probe(device_t dev) return (error); } + /* Set device description */ + bhnd_set_default_bus_desc(dev, &sc->siba_cid); + return (0); } From owner-svn-src-head@freebsd.org Sat Aug 27 00:13:43 2016 Return-Path: Delivered-To: svn-src-head@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 169B8B76B75; Sat, 27 Aug 2016 00:13:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0970F1C; Sat, 27 Aug 2016 00:13:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R0Dfkg066950; Sat, 27 Aug 2016 00:13:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R0Df2r066945; Sat, 27 Aug 2016 00:13:41 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608270013.u7R0Df2r066945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 27 Aug 2016 00:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304873 - in head/sys/dev/cxgbe: . common firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:13:43 -0000 Author: np Date: Sat Aug 27 00:13:41 2016 New Revision: 304873 URL: https://svnweb.freebsd.org/changeset/base/304873 Log: cxgbe(4): Provide more details about the card in the sysctl MIB. dev.t5nex.0.%desc: Chelsio T580-CR dev.t5nex.0.hw_revision: 1 dev.t5nex.0.sn: PT13140042 dev.t5nex.0.pn: 110117150A0 dev.t5nex.0.ec: 0000000000000000 dev.t5nex.0.na: 0007432AF490 dev.t5nex.0.vpd_version: 3 dev.t5nex.0.scfg_version: 53255 dev.t5nex.0.bs_version: 1.1.0.0 dev.t5nex.0.er_version: 1.0.0.68 dev.t5nex.0.tp_version: 0.1.4.9 dev.t5nex.0.firmware_version: 1.16.2.0 Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Aug 27 00:07:48 2016 (r304872) +++ head/sys/dev/cxgbe/adapter.h Sat Aug 27 00:13:41 2016 (r304873) @@ -821,7 +821,8 @@ struct adapter { char fw_version[16]; char tp_version[16]; - char exprom_version[16]; + char er_version[16]; + char bs_version[16]; char cfg_file[32]; u_int cfcsum; struct adapter_params params; Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sat Aug 27 00:07:48 2016 (r304872) +++ head/sys/dev/cxgbe/common/common.h Sat Aug 27 00:13:41 2016 (r304873) @@ -330,9 +330,12 @@ struct adapter_params { unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ - unsigned int fw_vers; - unsigned int tp_vers; - unsigned int exprom_vers; + unsigned int fw_vers; /* firmware version */ + unsigned int bs_vers; /* bootstrap version */ + unsigned int tp_vers; /* TP microcode version */ + unsigned int er_vers; /* expansion ROM version */ + unsigned int scfg_vers; /* Serial Configuration version */ + unsigned int vpd_vers; /* VPD version */ unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; @@ -548,8 +551,12 @@ int t4_flash_erase_sectors(struct adapte int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); +int t4_get_bs_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); int t4_get_exprom_version(struct adapter *adapter, u32 *vers); +int t4_get_scfg_version(struct adapter *adapter, u32 *vers); +int t4_get_vpd_version(struct adapter *adapter, u32 *vers); +int t4_get_version_info(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); int t4_prep_adapter(struct adapter *adapter, u8 *buf); int t4_shutdown_adapter(struct adapter *adapter); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Aug 27 00:07:48 2016 (r304872) +++ head/sys/dev/cxgbe/common/t4_hw.c Sat Aug 27 00:13:41 2016 (r304873) @@ -3234,6 +3234,20 @@ int t4_get_fw_version(struct adapter *ad } /** + * t4_get_bs_version - read the firmware bootstrap version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the FW Bootstrap version from flash. + */ +int t4_get_bs_version(struct adapter *adapter, u32 *vers) +{ + return t4_read_flash(adapter, FLASH_FWBOOTSTRAP_START + + offsetof(struct fw_hdr, fw_ver), 1, + vers, 0); +} + +/** * t4_get_tp_version - read the TP microcode version * @adapter: the adapter * @vers: where to place the version @@ -3285,6 +3299,110 @@ int t4_get_exprom_version(struct adapter } /** + * t4_get_scfg_version - return the Serial Configuration version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the Serial Configuration Version via the Firmware interface + * (thus this can only be called once we're ready to issue Firmware + * commands). The format of the Serial Configuration version is + * adapter specific. Returns 0 on success, an error on failure. + * + * Note that early versions of the Firmware didn't include the ability + * to retrieve the Serial Configuration version, so we zero-out the + * return-value parameter in that case to avoid leaving it with + * garbage in it. + * + * Also note that the Firmware will return its cached copy of the Serial + * Initialization Revision ID, not the actual Revision ID as written in + * the Serial EEPROM. This is only an issue if a new VPD has been written + * and the Firmware/Chip haven't yet gone through a RESET sequence. So + * it's best to defer calling this routine till after a FW_RESET_CMD has + * been issued if the Host Driver will be performing a full adapter + * initialization. + */ +int t4_get_scfg_version(struct adapter *adapter, u32 *vers) +{ + u32 scfgrev_param; + int ret; + + scfgrev_param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_SCFGREV)); + ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, + 1, &scfgrev_param, vers); + if (ret) + *vers = 0; + return ret; +} + +/** + * t4_get_vpd_version - return the VPD version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the VPD via the Firmware interface (thus this can only be called + * once we're ready to issue Firmware commands). The format of the + * VPD version is adapter specific. Returns 0 on success, an error on + * failure. + * + * Note that early versions of the Firmware didn't include the ability + * to retrieve the VPD version, so we zero-out the return-value parameter + * in that case to avoid leaving it with garbage in it. + * + * Also note that the Firmware will return its cached copy of the VPD + * Revision ID, not the actual Revision ID as written in the Serial + * EEPROM. This is only an issue if a new VPD has been written and the + * Firmware/Chip haven't yet gone through a RESET sequence. So it's best + * to defer calling this routine till after a FW_RESET_CMD has been issued + * if the Host Driver will be performing a full adapter initialization. + */ +int t4_get_vpd_version(struct adapter *adapter, u32 *vers) +{ + u32 vpdrev_param; + int ret; + + vpdrev_param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_VPDREV)); + ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, + 1, &vpdrev_param, vers); + if (ret) + *vers = 0; + return ret; +} + +/** + * t4_get_version_info - extract various chip/firmware version information + * @adapter: the adapter + * + * Reads various chip/firmware version numbers and stores them into the + * adapter Adapter Parameters structure. If any of the efforts fails + * the first failure will be returned, but all of the version numbers + * will be read. + */ +int t4_get_version_info(struct adapter *adapter) +{ + int ret = 0; + + #define FIRST_RET(__getvinfo) \ + do { \ + int __ret = __getvinfo; \ + if (__ret && !ret) \ + ret = __ret; \ + } while (0) + + FIRST_RET(t4_get_fw_version(adapter, &adapter->params.fw_vers)); + FIRST_RET(t4_get_bs_version(adapter, &adapter->params.bs_vers)); + FIRST_RET(t4_get_tp_version(adapter, &adapter->params.tp_vers)); + FIRST_RET(t4_get_exprom_version(adapter, &adapter->params.er_vers)); + FIRST_RET(t4_get_scfg_version(adapter, &adapter->params.scfg_vers)); + FIRST_RET(t4_get_vpd_version(adapter, &adapter->params.vpd_vers)); + + #undef FIRST_RET + + return ret; +} + +/** * t4_flash_erase_sectors - erase a range of flash sectors * @adapter: the adapter * @start: the first sector to erase Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Sat Aug 27 00:07:48 2016 (r304872) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Sat Aug 27 00:13:41 2016 (r304873) @@ -4206,6 +4206,8 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17, FW_PARAMS_PARAM_DEV_FWCACHE = 0x18, FW_PARAMS_PARAM_DEV_RSSINFO = 0x19, + FW_PARAMS_PARAM_DEV_SCFGREV = 0x1A, + FW_PARAMS_PARAM_DEV_VPDREV = 0x1B, }; /* Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Aug 27 00:07:48 2016 (r304872) +++ head/sys/dev/cxgbe/t4_main.c Sat Aug 27 00:13:41 2016 (r304873) @@ -2882,32 +2882,6 @@ prep_firmware(struct adapter *sc) goto done; } - /* We're using whatever's on the card and it's known to be good. */ - sc->params.fw_vers = ntohl(card_fw->fw_ver); - snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); - - t4_get_tp_version(sc, &sc->params.tp_vers); - snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); - - if (t4_get_exprom_version(sc, &sc->params.exprom_vers) != 0) - sc->params.exprom_vers = 0; - else { - snprintf(sc->exprom_version, sizeof(sc->exprom_version), - "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.exprom_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.exprom_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.exprom_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.exprom_vers)); - } - /* Reset device */ if (need_fw_reset && (rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST)) != 0) { @@ -3152,6 +3126,32 @@ get_params__pre_init(struct adapter *sc) int rc; uint32_t param[2], val[2]; + t4_get_version_info(sc); + + snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); + + snprintf(sc->bs_version, sizeof(sc->bs_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.bs_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.bs_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.bs_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.bs_vers)); + + snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); + + snprintf(sc->er_version, sizeof(sc->er_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.er_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.er_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.er_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.er_vers)); + param[0] = FW_PARAM_DEV(PORTVEC); param[1] = FW_PARAM_DEV(CCLK); rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); @@ -3365,9 +3365,7 @@ t4_set_desc(struct adapter *sc) char buf[128]; struct adapter_params *p = &sc->params; - snprintf(buf, sizeof(buf), "Chelsio %s %sNIC (rev %d), S/N:%s, " - "P/N:%s, E/C:%s", p->vpd.id, is_offload(sc) ? "R" : "", - chip_rev(sc), p->vpd.sn, p->vpd.pn, p->vpd.ec); + snprintf(buf, sizeof(buf), "Chelsio %s", p->vpd.id); device_set_desc_copy(sc->dev, buf); } @@ -4621,17 +4619,36 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD, NULL, chip_rev(sc), "chip hardware revision"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "sn", + CTLFLAG_RD, sc->params.vpd.sn, 0, "serial number"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pn", + CTLFLAG_RD, sc->params.vpd.pn, 0, "part number"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "ec", + CTLFLAG_RD, sc->params.vpd.ec, 0, "engineering change"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "na", + CTLFLAG_RD, sc->params.vpd.na, 0, "network address"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version", CTLFLAG_RD, sc->tp_version, 0, "TP microcode version"); - if (sc->params.exprom_vers != 0) { - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "exprom_version", - CTLFLAG_RD, sc->exprom_version, 0, "expansion ROM version"); - } + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "er_version", CTLFLAG_RD, + sc->er_version, 0, "expansion ROM version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", CTLFLAG_RD, sc->fw_version, 0, "firmware version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bs_version", CTLFLAG_RD, + sc->bs_version, 0, "bootstrap firmware version"); + + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "scfg_version", CTLFLAG_RD, + NULL, sc->params.scfg_vers, "serial config version"); + + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "vpd_version", CTLFLAG_RD, + NULL, sc->params.vpd_vers, "VPD version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf", CTLFLAG_RD, sc->cfg_file, 0, "configuration file"); @@ -4641,7 +4658,7 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ - sysctl_bitfield, "A", "available " text "capabilities") + sysctl_bitfield, "A", "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); From owner-svn-src-head@freebsd.org Sat Aug 27 00:46:22 2016 Return-Path: Delivered-To: svn-src-head@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 3E5D3A94244; Sat, 27 Aug 2016 00:46:22 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 F2C8692D; Sat, 27 Aug 2016 00:46:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bdRlJ-000KxR-Sc; Sat, 27 Aug 2016 03:46:17 +0300 Date: Sat, 27 Aug 2016 03:46:17 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Bruce Simpson , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160827004617.GJ88122@zxy.spb.ru> References: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <20160821000400.GY8192@zxy.spb.ru> <20160826144926.GE88122@zxy.spb.ru> <3dba1b70-54cc-0bb1-5cc8-8c56cd750bec@fastmail.net> <20160826151324.GF88122@zxy.spb.ru> <20160826213613.GH88122@zxy.spb.ru> <20160826220255.GI88122@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:46:22 -0000 On Fri, Aug 26, 2016 at 04:55:34PM -0700, Adrian Chadd wrote: > Hi, > > I use the kernel lock profiling debugging, I am already have 100% utilise all CPU cores, I think this is drop performance? > but you can use dtrace to > get an idea: > > dtrace -n 'lockstat:::adaptive-block { @[stack()] = sum(arg1); }' How to interpret results (how to distinct lock contention from lock cost/overhead (LOCK CMPXCGQ is very expensive))? > (https://wiki.freebsd.org/DTrace/One-Liners) > > > > -adrian From owner-svn-src-head@freebsd.org Sat Aug 27 00:47:48 2016 Return-Path: Delivered-To: svn-src-head@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 DB816A942C0; Sat, 27 Aug 2016 00:47:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AE63DA8F; Sat, 27 Aug 2016 00:47:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R0llHK078110; Sat, 27 Aug 2016 00:47:47 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R0llQ8078109; Sat, 27 Aug 2016 00:47:47 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201608270047.u7R0llQ8078109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 27 Aug 2016 00:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304874 - head/lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:47:49 -0000 Author: mm Date: Sat Aug 27 00:47:47 2016 New Revision: 304874 URL: https://svnweb.freebsd.org/changeset/base/304874 Log: Temporarily disable two libarchive tests that have not yet been fixed by vendor. Tests will be re-enabled after a fix has been merged. MFC after: 3 days Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Sat Aug 27 00:13:41 2016 (r304873) +++ head/lib/libarchive/tests/Makefile Sat Aug 27 00:47:47 2016 (r304874) @@ -211,8 +211,6 @@ TESTS_SRCS= \ test_write_disk_perms.c \ test_write_disk_secure.c \ test_write_disk_secure744.c \ - test_write_disk_secure745.c \ - test_write_disk_secure746.c \ test_write_disk_sparse.c \ test_write_disk_symlink.c \ test_write_disk_times.c \ From owner-svn-src-head@freebsd.org Sat Aug 27 00:56:38 2016 Return-Path: Delivered-To: svn-src-head@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 BC377A9445B; Sat, 27 Aug 2016 00:56:38 +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 8D3AEE7E; Sat, 27 Aug 2016 00:56:38 +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 u7R0ubtN081713; Sat, 27 Aug 2016 00:56:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R0ubGm081712; Sat, 27 Aug 2016 00:56:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201608270056.u7R0ubGm081712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 27 Aug 2016 00:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304875 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:56:38 -0000 Author: delphij Date: Sat Aug 27 00:56:37 2016 New Revision: 304875 URL: https://svnweb.freebsd.org/changeset/base/304875 Log: Use printable ASCII instead of octal representation. MFC after: 2 weeks Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Sat Aug 27 00:47:47 2016 (r304874) +++ head/usr.bin/gzip/gzip.c Sat Aug 27 00:56:37 2016 (r304875) @@ -88,7 +88,7 @@ enum filetype { #include #define BZ2_SUFFIX ".bz2" -#define BZIP2_MAGIC "\102\132\150" +#define BZIP2_MAGIC "BZh" #endif #ifndef NO_COMPRESS_SUPPORT From owner-svn-src-head@freebsd.org Sat Aug 27 00:58:23 2016 Return-Path: Delivered-To: svn-src-head@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 444B3A944BD; Sat, 27 Aug 2016 00:58:23 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 06B97FF9; Sat, 27 Aug 2016 00:58:22 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R0wMdL081818; Sat, 27 Aug 2016 00:58:22 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R0wMw7081816; Sat, 27 Aug 2016 00:58:22 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608270058.u7R0wMw7081816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 27 Aug 2016 00:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304876 - in head/sys/dev/bhnd: . siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:58:23 -0000 Author: landonf Date: Sat Aug 27 00:58:21 2016 New Revision: 304876 URL: https://svnweb.freebsd.org/changeset/base/304876 Log: Implement siba(4) support for bhnd_(read|write)_config. This provides access to the siba(4) bus-mapped per-core cfg0 register block. Approved by: adrian (mentor, implicit) Modified: head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/siba/siba.c Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sat Aug 27 00:56:37 2016 (r304875) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sat Aug 27 00:58:21 2016 (r304876) @@ -565,8 +565,9 @@ METHOD int release_ext_rsrc { * @param offset The offset to be read. * @param width The size of the access. Must be 1, 2 or 4 bytes. * - * The exact behavior of this method is bus-specific. In the case of - * bcma(4), this method provides access to the first agent port of @p child. + * The exact behavior of this method is bus-specific. On a bcma(4) bus, this + * method provides access to the first agent port of @p child; on a siba(4) bus, + * this method provides access to the core's CFG0 register block. * * @note Device drivers should only use this API for functionality * that is not available via another bhnd(4) function. Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sat Aug 27 00:56:37 2016 (r304875) +++ head/sys/dev/bhnd/siba/siba.c Sat Aug 27 00:58:21 2016 (r304876) @@ -263,6 +263,32 @@ siba_suspend_core(device_t dev, device_t static uint32_t siba_read_config(device_t dev, device_t child, bus_size_t offset, u_int width) { + struct siba_devinfo *dinfo; + rman_res_t r_size; + + /* Must be directly attached */ + if (device_get_parent(child) != dev) + return (UINT32_MAX); + + /* CFG0 registers must be available */ + dinfo = device_get_ivars(child); + if (dinfo->cfg[0] == NULL) + return (UINT32_MAX); + + /* Offset must fall within CFG0 */ + r_size = rman_get_size(dinfo->cfg[0]->res); + if (r_size < offset || r_size - offset < width) + return (UINT32_MAX); + + switch (width) { + case 1: + return (bhnd_bus_read_1(dinfo->cfg[0], offset)); + case 2: + return (bhnd_bus_read_2(dinfo->cfg[0], offset)); + case 4: + return (bhnd_bus_read_4(dinfo->cfg[0], offset)); + } + /* Unsuported */ return (UINT32_MAX); } @@ -271,8 +297,31 @@ static void siba_write_config(device_t dev, device_t child, bus_size_t offset, uint32_t val, u_int width) { - /* Unsuported */ - return; + struct siba_devinfo *dinfo; + rman_res_t r_size; + + /* Must be directly attached */ + if (device_get_parent(child) != dev) + return; + + /* CFG0 registers must be available */ + dinfo = device_get_ivars(child); + if (dinfo->cfg[0] == NULL) + return; + + /* Offset must fall within CFG0 */ + r_size = rman_get_size(dinfo->cfg[0]->res); + if (r_size < offset || r_size - offset < width) + return; + + switch (width) { + case 1: + bhnd_bus_write_1(dinfo->cfg[0], offset, val); + case 2: + bhnd_bus_write_2(dinfo->cfg[0], offset, val); + case 4: + bhnd_bus_write_4(dinfo->cfg[0], offset, val); + } } static u_int From owner-svn-src-head@freebsd.org Sat Aug 27 01:28:01 2016 Return-Path: Delivered-To: svn-src-head@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 CF921A94A32; Sat, 27 Aug 2016 01:28:01 +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 9FF8923C; Sat, 27 Aug 2016 01:28:01 +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 u7R1S0e7092981; Sat, 27 Aug 2016 01:28:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R1S0oe092980; Sat, 27 Aug 2016 01:28:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608270128.u7R1S0oe092980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 27 Aug 2016 01:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304877 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 01:28:01 -0000 Author: bapt Date: Sat Aug 27 01:28:00 2016 New Revision: 304877 URL: https://svnweb.freebsd.org/changeset/base/304877 Log: Remove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat Aug 27 00:58:21 2016 (r304876) +++ head/share/mk/bsd.sys.mk Sat Aug 27 01:28:00 2016 (r304877) @@ -128,6 +128,11 @@ CWARNFLAGS+= -Wno-error=address \ -Wno-error=unused-value .endif +# GCC 5.3.0 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50300 +CWARNFLAGS+= -Wno-error=strict-overflow +.endif + # GCC 6.1.0 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 CWARNFLAGS+= -Wno-error=misleading-indentation \ From owner-svn-src-head@freebsd.org Sat Aug 27 03:47:16 2016 Return-Path: Delivered-To: svn-src-head@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 3774EA948C0; Sat, 27 Aug 2016 03:47:16 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8F3E55; Sat, 27 Aug 2016 03:47:15 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 13B9B7E88D; Sat, 27 Aug 2016 13:47:11 +1000 (EST) From: Lawrence Stewart Subject: Re: svn commit: r304857 - head/sys/netinet/tcp_stacks To: Hiren Panchasara , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608261923.u7QJNHIY058386@repo.freebsd.org> Message-ID: <9f1c8561-d3cc-5871-5b7a-cfe1b016f4d7@freebsd.org> Date: Sat, 27 Aug 2016 13:47:10 +1000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608261923.u7QJNHIY058386@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 03:47:16 -0000 Pointy hat to: lstewart@ Apologies all for the breakage, thanks Hiren for fixing and apologies also for missing your email. For some reason your reply to my commit did not make it to my inbox and was filtered straight to my mailing list folder which is annoying - I must have introduced a bug in my .procmailrc at some point. I don't understand why my buildkernel prior to commit succeeded though. Is fastpath not build by default? Cheers, Lawrence On 08/27/16 05:23, Hiren Panchasara wrote: > Author: hiren > Date: Fri Aug 26 19:23:17 2016 > New Revision: 304857 > URL: https://svnweb.freebsd.org/changeset/base/304857 > > Log: > Adjust TCP module fastpath after r304803's cc_ack_received() changes. > > Reported by: hiren, bz, np > Reviewed by: rrs > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D7664 > > Modified: > head/sys/netinet/tcp_stacks/fastpath.c > > Modified: head/sys/netinet/tcp_stacks/fastpath.c > ============================================================================== > --- head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:08:58 2016 (r304856) > +++ head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:23:17 2016 (r304857) > @@ -172,7 +172,10 @@ tcp_do_fastack(struct mbuf *m, struct tc > int ti_locked, u_long tiwin) > { > int acked; > + uint16_t nsegs; > int winup_only=0; > + > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > #ifdef TCPDEBUG > /* > * The size of tcp_saveipgen must be the size of the max ip header, > @@ -278,7 +281,7 @@ tcp_do_fastack(struct mbuf *m, struct tc > * typically means increasing the congestion > * window. > */ > - cc_ack_received(tp, th, CC_ACK); > + cc_ack_received(tp, th, nsegs, CC_ACK); > > tp->snd_una = th->th_ack; > /* > @@ -502,9 +505,12 @@ tcp_do_slowpath(struct mbuf *m, struct t > { > int acked, ourfinisacked, needoutput = 0; > int rstreason, todrop, win; > + uint16_t nsegs; > char *s; > struct in_conninfo *inc; > struct mbuf *mfree = NULL; > + > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > #ifdef TCPDEBUG > /* > * The size of tcp_saveipgen must be the size of the max ip header, > @@ -1085,7 +1091,8 @@ tcp_do_slowpath(struct mbuf *m, struct t > tp->t_dupacks = 0; > else if (++tp->t_dupacks > tcprexmtthresh || > IN_FASTRECOVERY(tp->t_flags)) { > - cc_ack_received(tp, th, CC_DUPACK); > + cc_ack_received(tp, th, nsegs, > + CC_DUPACK); > if ((tp->t_flags & TF_SACK_PERMIT) && > IN_FASTRECOVERY(tp->t_flags)) { > int awnd; > @@ -1135,7 +1142,8 @@ tcp_do_slowpath(struct mbuf *m, struct t > } > /* Congestion signal before ack. */ > cc_cong_signal(tp, th, CC_NDUPACK); > - cc_ack_received(tp, th, CC_DUPACK); > + cc_ack_received(tp, th, nsegs, > + CC_DUPACK); > tcp_timer_activate(tp, TT_REXMT, 0); > tp->t_rtttime = 0; > if (tp->t_flags & TF_SACK_PERMIT) { > @@ -1169,7 +1177,8 @@ tcp_do_slowpath(struct mbuf *m, struct t > * segment. Restore the original > * snd_cwnd after packet transmission. > */ > - cc_ack_received(tp, th, CC_DUPACK); > + cc_ack_received(tp, th, nsegs, > + CC_DUPACK); > u_long oldcwnd = tp->snd_cwnd; > tcp_seq oldsndmax = tp->snd_max; > u_int sent; > @@ -1323,7 +1332,7 @@ process_ACK: > * control related information. This typically means increasing > * the congestion window. > */ > - cc_ack_received(tp, th, CC_ACK); > + cc_ack_received(tp, th, nsegs, CC_ACK); > > SOCKBUF_LOCK(&so->so_snd); > if (acked > sbavail(&so->so_snd)) { > @@ -1758,6 +1767,7 @@ tcp_do_segment_fastslow(struct mbuf *m, > int thflags; > u_long tiwin; > char *s; > + uint16_t nsegs; > int can_enter; > struct in_conninfo *inc; > struct tcpopt to; > @@ -1765,6 +1775,7 @@ tcp_do_segment_fastslow(struct mbuf *m, > thflags = th->th_flags; > tp->sackhint.last_sack_ack = 0; > inc = &tp->t_inpcb->inp_inc; > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > /* > * If this is either a state-changing packet or current state isn't > * established, we require a write lock on tcbinfo. Otherwise, we > @@ -1983,7 +1994,10 @@ tcp_fastack(struct mbuf *m, struct tcphd > int ti_locked, u_long tiwin) > { > int acked; > + uint16_t nsegs; > int winup_only=0; > + > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > #ifdef TCPDEBUG > /* > * The size of tcp_saveipgen must be the size of the max ip header, > @@ -2128,7 +2142,7 @@ tcp_fastack(struct mbuf *m, struct tcphd > * typically means increasing the congestion > * window. > */ > - cc_ack_received(tp, th, CC_ACK); > + cc_ack_received(tp, th, nsegs, CC_ACK); > > tp->snd_una = th->th_ack; > tp->t_dupacks = 0; > From owner-svn-src-head@freebsd.org Sat Aug 27 03:54:43 2016 Return-Path: Delivered-To: svn-src-head@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 17967A94ADF; Sat, 27 Aug 2016 03:54:43 +0000 (UTC) (envelope-from lstewart@room52.net) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7463C3BA; Sat, 27 Aug 2016 03:54:42 +0000 (UTC) (envelope-from lstewart@room52.net) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 857417E81E; Sat, 27 Aug 2016 13:44:41 +1000 (EST) Subject: Re: svn commit: r304857 - head/sys/netinet/tcp_stacks To: Hiren Panchasara , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608261923.u7QJNHIY058386@repo.freebsd.org> From: Lawrence Stewart Message-ID: Date: Sat, 27 Aug 2016 13:44:41 +1000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608261923.u7QJNHIY058386@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 03:54:43 -0000 Pointy hat to: lstewart@ Apologies all for the breakage, thanks Hiren for fixing and apologies also for missing your email. For some reason your reply to my commit did not make it to my inbox and was filtered straight to my mailing list folder which is annoying - I must have introduced a bug in my .procmailrc at some point. I don't understand why my buildkernel prior to commit succeeded though. Is fastpath not build by default? Cheers, Lawrence On 08/27/16 05:23, Hiren Panchasara wrote: > Author: hiren > Date: Fri Aug 26 19:23:17 2016 > New Revision: 304857 > URL: https://svnweb.freebsd.org/changeset/base/304857 > > Log: > Adjust TCP module fastpath after r304803's cc_ack_received() changes. > > Reported by: hiren, bz, np > Reviewed by: rrs > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D7664 > > Modified: > head/sys/netinet/tcp_stacks/fastpath.c > > Modified: head/sys/netinet/tcp_stacks/fastpath.c > ============================================================================== > --- head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:08:58 2016 (r304856) > +++ head/sys/netinet/tcp_stacks/fastpath.c Fri Aug 26 19:23:17 2016 (r304857) > @@ -172,7 +172,10 @@ tcp_do_fastack(struct mbuf *m, struct tc > int ti_locked, u_long tiwin) > { > int acked; > + uint16_t nsegs; > int winup_only=0; > + > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > #ifdef TCPDEBUG > /* > * The size of tcp_saveipgen must be the size of the max ip header, > @@ -278,7 +281,7 @@ tcp_do_fastack(struct mbuf *m, struct tc > * typically means increasing the congestion > * window. > */ > - cc_ack_received(tp, th, CC_ACK); > + cc_ack_received(tp, th, nsegs, CC_ACK); > > tp->snd_una = th->th_ack; > /* > @@ -502,9 +505,12 @@ tcp_do_slowpath(struct mbuf *m, struct t > { > int acked, ourfinisacked, needoutput = 0; > int rstreason, todrop, win; > + uint16_t nsegs; > char *s; > struct in_conninfo *inc; > struct mbuf *mfree = NULL; > + > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > #ifdef TCPDEBUG > /* > * The size of tcp_saveipgen must be the size of the max ip header, > @@ -1085,7 +1091,8 @@ tcp_do_slowpath(struct mbuf *m, struct t > tp->t_dupacks = 0; > else if (++tp->t_dupacks > tcprexmtthresh || > IN_FASTRECOVERY(tp->t_flags)) { > - cc_ack_received(tp, th, CC_DUPACK); > + cc_ack_received(tp, th, nsegs, > + CC_DUPACK); > if ((tp->t_flags & TF_SACK_PERMIT) && > IN_FASTRECOVERY(tp->t_flags)) { > int awnd; > @@ -1135,7 +1142,8 @@ tcp_do_slowpath(struct mbuf *m, struct t > } > /* Congestion signal before ack. */ > cc_cong_signal(tp, th, CC_NDUPACK); > - cc_ack_received(tp, th, CC_DUPACK); > + cc_ack_received(tp, th, nsegs, > + CC_DUPACK); > tcp_timer_activate(tp, TT_REXMT, 0); > tp->t_rtttime = 0; > if (tp->t_flags & TF_SACK_PERMIT) { > @@ -1169,7 +1177,8 @@ tcp_do_slowpath(struct mbuf *m, struct t > * segment. Restore the original > * snd_cwnd after packet transmission. > */ > - cc_ack_received(tp, th, CC_DUPACK); > + cc_ack_received(tp, th, nsegs, > + CC_DUPACK); > u_long oldcwnd = tp->snd_cwnd; > tcp_seq oldsndmax = tp->snd_max; > u_int sent; > @@ -1323,7 +1332,7 @@ process_ACK: > * control related information. This typically means increasing > * the congestion window. > */ > - cc_ack_received(tp, th, CC_ACK); > + cc_ack_received(tp, th, nsegs, CC_ACK); > > SOCKBUF_LOCK(&so->so_snd); > if (acked > sbavail(&so->so_snd)) { > @@ -1758,6 +1767,7 @@ tcp_do_segment_fastslow(struct mbuf *m, > int thflags; > u_long tiwin; > char *s; > + uint16_t nsegs; > int can_enter; > struct in_conninfo *inc; > struct tcpopt to; > @@ -1765,6 +1775,7 @@ tcp_do_segment_fastslow(struct mbuf *m, > thflags = th->th_flags; > tp->sackhint.last_sack_ack = 0; > inc = &tp->t_inpcb->inp_inc; > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > /* > * If this is either a state-changing packet or current state isn't > * established, we require a write lock on tcbinfo. Otherwise, we > @@ -1983,7 +1994,10 @@ tcp_fastack(struct mbuf *m, struct tcphd > int ti_locked, u_long tiwin) > { > int acked; > + uint16_t nsegs; > int winup_only=0; > + > + nsegs = max(1, m->m_pkthdr.lro_nsegs); > #ifdef TCPDEBUG > /* > * The size of tcp_saveipgen must be the size of the max ip header, > @@ -2128,7 +2142,7 @@ tcp_fastack(struct mbuf *m, struct tcphd > * typically means increasing the congestion > * window. > */ > - cc_ack_received(tp, th, CC_ACK); > + cc_ack_received(tp, th, nsegs, CC_ACK); > > tp->snd_una = th->th_ack; > tp->t_dupacks = 0; > From owner-svn-src-head@freebsd.org Sat Aug 27 03:58:22 2016 Return-Path: Delivered-To: svn-src-head@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 58329A94C01; Sat, 27 Aug 2016 03:58:22 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB257FD; Sat, 27 Aug 2016 03:58:21 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 57D5F7E81E; Sat, 27 Aug 2016 13:58:19 +1000 (EST) Subject: Re: svn commit: r304803 - in head/sys: netinet netinet/cc sys To: hiren panchasara References: <201608251333.u7PDXW33086932@repo.freebsd.org> <20160825183948.GG41576@strugglingcoder.info> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Lawrence Stewart Message-ID: <8b61bfbc-635a-89fd-b436-3a0270507675@freebsd.org> Date: Sat, 27 Aug 2016 13:58:18 +1000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160825183948.GG41576@strugglingcoder.info> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 03:58:22 -0000 On 08/26/16 04:39, hiren panchasara wrote: > On 08/25/16 at 01:33P, Lawrence Stewart wrote: >> Author: lstewart >> Date: Thu Aug 25 13:33:32 2016 >> New Revision: 304803 >> URL: https://svnweb.freebsd.org/changeset/base/304803 >> >> Log: >> Pass the number of segments coalesced by LRO up the stack by repurposing the >> tso_segsz pkthdr field during RX processing, and use the information in TCP for >> more correct accounting and as a congestion control input. This is only a start, >> and an audit of other uses for the data is left as future work. >> >> Reviewed by: gallatin, rrs >> Sponsored by: Netflix, Inc. >> Differential Revision: https://reviews.freebsd.org/D7564 [snip] > Also, can this be brought back to stable/11? I believe so, but need to make a sanity check pass to convince myself it's ok. Cheers, Lawrence From owner-svn-src-head@freebsd.org Sat Aug 27 08:34:21 2016 Return-Path: Delivered-To: svn-src-head@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 C2A47B76B19; Sat, 27 Aug 2016 08:34:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 83109A79; Sat, 27 Aug 2016 08:34:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R8YKd6051996; Sat, 27 Aug 2016 08:34:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R8YK8E051995; Sat, 27 Aug 2016 08:34:20 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201608270834.u7R8YK8E051995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 27 Aug 2016 08:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304880 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 08:34:21 -0000 Author: avos Date: Sat Aug 27 08:34:20 2016 New Revision: 304880 URL: https://svnweb.freebsd.org/changeset/base/304880 Log: iwm: add 'command accepted' debug notification (copied from wpi(4)). Now it should be easier to find out which command causes firmware panics when few commands are sent in a short period of time. Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sat Aug 27 02:53:21 2016 (r304879) +++ head/sys/dev/iwm/if_iwm.c Sat Aug 27 08:34:20 2016 (r304880) @@ -3120,6 +3120,11 @@ iwm_cmd_done(struct iwm_softc *sc, struc return; /* Not a command ack. */ } + /* XXX wide commands? */ + IWM_DPRINTF(sc, IWM_DEBUG_CMD, + "cmd notification type 0x%x qid %d idx %d\n", + pkt->hdr.code, pkt->hdr.qid, pkt->hdr.idx); + data = &ring->data[pkt->hdr.idx]; /* If the command was mapped in an mbuf, free it. */ From owner-svn-src-head@freebsd.org Sat Aug 27 09:50:12 2016 Return-Path: Delivered-To: svn-src-head@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 4C286A9300C; Sat, 27 Aug 2016 09:50:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E16B7A5; Sat, 27 Aug 2016 09:50:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7R9oB7M078813; Sat, 27 Aug 2016 09:50:11 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7R9oBSD078811; Sat, 27 Aug 2016 09:50:11 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608270950.u7R9oBSD078811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 27 Aug 2016 09:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304886 - in head/sys/modules: cloudabi32 cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 09:50:12 -0000 Author: ed Date: Sat Aug 27 09:50:11 2016 New Revision: 304886 URL: https://svnweb.freebsd.org/changeset/base/304886 Log: Properly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c. The build of the cloudabi32 kernel module currently fails for PC98. In the case of PC98, we just want to use the code for i386. Reported by: np Modified: head/sys/modules/cloudabi32/Makefile head/sys/modules/cloudabi64/Makefile Modified: head/sys/modules/cloudabi32/Makefile ============================================================================== --- head/sys/modules/cloudabi32/Makefile Sat Aug 27 09:40:29 2016 (r304885) +++ head/sys/modules/cloudabi32/Makefile Sat Aug 27 09:50:11 2016 (r304886) @@ -3,7 +3,7 @@ SYSDIR?=${.CURDIR}/../.. .PATH: ${SYSDIR}/compat/cloudabi32 -.PATH: ${SYSDIR}/${MACHINE}/cloudabi32 +.PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi32 KMOD= cloudabi32 SRCS= cloudabi32_fd.c cloudabi32_module.c cloudabi32_poll.c \ Modified: head/sys/modules/cloudabi64/Makefile ============================================================================== --- head/sys/modules/cloudabi64/Makefile Sat Aug 27 09:40:29 2016 (r304885) +++ head/sys/modules/cloudabi64/Makefile Sat Aug 27 09:50:11 2016 (r304886) @@ -3,7 +3,7 @@ SYSDIR?=${.CURDIR}/../.. .PATH: ${SYSDIR}/compat/cloudabi64 -.PATH: ${SYSDIR}/${MACHINE}/cloudabi64 +.PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi64 KMOD= cloudabi64 SRCS= cloudabi64_fd.c cloudabi64_module.c cloudabi64_poll.c \ From owner-svn-src-head@freebsd.org Sat Aug 27 10:04:49 2016 Return-Path: Delivered-To: svn-src-head@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 A502AA93550; Sat, 27 Aug 2016 10:04:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6FB056A7; Sat, 27 Aug 2016 10:04:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RA4mx9086498; Sat, 27 Aug 2016 10:04:48 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RA4mLq086497; Sat, 27 Aug 2016 10:04:48 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201608271004.u7RA4mLq086497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 27 Aug 2016 10:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304891 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 10:04:49 -0000 Author: avos Date: Sat Aug 27 10:04:48 2016 New Revision: 304891 URL: https://svnweb.freebsd.org/changeset/base/304891 Log: iwm: fix few comment typos. Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Sat Aug 27 10:00:36 2016 (r304890) +++ head/sys/dev/iwm/if_iwmreg.h Sat Aug 27 10:04:48 2016 (r304891) @@ -3219,7 +3219,7 @@ enum iwm_sf_scenario { #define IWM_SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ #define IWM_SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ -#define IWM_SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */ +#define IWM_SF_MCAST_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ #define IWM_SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */ @@ -3244,7 +3244,7 @@ enum iwm_sf_scenario { /** * Smart Fifo configuration command. - * @state: smart fifo state, types listed in iwm_sf_sate. + * @state: smart fifo state, types listed in iwm_sf_state. * @watermark: Minimum allowed available free space in RXF for transient state. * @long_delay_timeouts: aging and idle timer values for each scenario * in long delay state. From owner-svn-src-head@freebsd.org Sat Aug 27 10:30:21 2016 Return-Path: Delivered-To: svn-src-head@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 48C00A939EB; Sat, 27 Aug 2016 10:30:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AC1AE10; Sat, 27 Aug 2016 10:30:21 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RAUKkm094046; Sat, 27 Aug 2016 10:30:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RAUKNT094045; Sat, 27 Aug 2016 10:30:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608271030.u7RAUKNT094045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 27 Aug 2016 10:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304892 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 10:30:21 -0000 Author: andrew Date: Sat Aug 27 10:30:20 2016 New Revision: 304892 URL: https://svnweb.freebsd.org/changeset/base/304892 Log: Print both the kernel read and write translation in DDB when asking for a virtual to physical translation. These may be different, e.g. when a page is mapped as read-only. MFC after: 1 month Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sat Aug 27 10:04:48 2016 (r304891) +++ head/sys/arm64/arm64/machdep.c Sat Aug 27 10:30:20 2016 (r304892) @@ -1089,7 +1089,9 @@ DB_SHOW_COMMAND(vtop, db_show_vtop) if (have_addr) { phys = arm64_address_translate_s1e1r(addr); - db_printf("Physical address reg: 0x%016lx\n", phys); + db_printf("Physical address reg (read): 0x%016lx\n", phys); + phys = arm64_address_translate_s1e1w(addr); + db_printf("Physical address reg (write): 0x%016lx\n", phys); } else db_printf("show vtop \n"); } From owner-svn-src-head@freebsd.org Sat Aug 27 11:06:07 2016 Return-Path: Delivered-To: svn-src-head@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 86C2CB7691C; Sat, 27 Aug 2016 11:06:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 566DC978; Sat, 27 Aug 2016 11:06:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RB66uk009116; Sat, 27 Aug 2016 11:06:06 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RB669G009115; Sat, 27 Aug 2016 11:06:06 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608271106.u7RB669G009115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sat, 27 Aug 2016 11:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304895 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 11:06:07 -0000 Author: bde Date: Sat Aug 27 11:06:06 2016 New Revision: 304895 URL: https://svnweb.freebsd.org/changeset/base/304895 Log: Fix build without INET6 and with gcc. A function definition was ifdefed for INET6, but its protototype was not, and gcc detects the error. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sat Aug 27 10:56:04 2016 (r304894) +++ head/usr.bin/netstat/route.c Sat Aug 27 11:06:06 2016 (r304895) @@ -104,7 +104,9 @@ static int ifmap_size; static struct timespec uptime; static const char *netname4(in_addr_t, in_addr_t); +#ifdef INET6 static const char *netname6(struct sockaddr_in6 *, struct sockaddr_in6 *); +#endif static void p_rtable_sysctl(int, int); static void p_rtentry_sysctl(const char *name, struct rt_msghdr *); static int p_sockaddr(const char *name, struct sockaddr *, struct sockaddr *, From owner-svn-src-head@freebsd.org Sat Aug 27 12:41:16 2016 Return-Path: Delivered-To: svn-src-head@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 31DD9A948E2; Sat, 27 Aug 2016 12:41:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 04E78AE0; Sat, 27 Aug 2016 12:41:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RCfF5J046056; Sat, 27 Aug 2016 12:41:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RCfFUq046055; Sat, 27 Aug 2016 12:41:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608271241.u7RCfFUq046055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 27 Aug 2016 12:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304907 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 12:41:16 -0000 Author: bz Date: Sat Aug 27 12:41:15 2016 New Revision: 304907 URL: https://svnweb.freebsd.org/changeset/base/304907 Log: Do not try to build cloudabi32 for pc98. Should unbreak tinderbox. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Aug 27 11:51:08 2016 (r304906) +++ head/sys/modules/Makefile Sat Aug 27 12:41:15 2016 (r304907) @@ -766,7 +766,7 @@ _epic= epic _igb= igb .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE} == "i386" _cloudabi32= cloudabi32 .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@freebsd.org Sat Aug 27 13:37:32 2016 Return-Path: Delivered-To: svn-src-head@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 32CA4B769B0; Sat, 27 Aug 2016 13:37:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0043190C; Sat, 27 Aug 2016 13:37:31 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RDbVQ1065629; Sat, 27 Aug 2016 13:37:31 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RDbVOg065624; Sat, 27 Aug 2016 13:37:31 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608271337.u7RDbVOg065624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 27 Aug 2016 13:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304908 - in head: lib/libnv lib/libnv/tests sys/conf sys/contrib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 13:37:32 -0000 Author: oshogbo Date: Sat Aug 27 13:37:30 2016 New Revision: 304908 URL: https://svnweb.freebsd.org/changeset/base/304908 Log: Add cnv API. cnv API is a set of functions for managing name/value pairs by cookie. The cookie can be obtained by nvlist_next(), nvlist_get_parent() or nvlist_get_pararr() function. This patch also includes unit tests. Submitted by: Adam Starak Added: head/lib/libnv/tests/cnv_tests.cc (contents, props changed) head/sys/contrib/libnv/cnvlist.c (contents, props changed) Modified: head/lib/libnv/Makefile head/lib/libnv/tests/Makefile head/sys/conf/files head/sys/contrib/libnv/nvlist.c head/sys/contrib/libnv/nvlist_impl.h Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Sat Aug 27 12:41:15 2016 (r304907) +++ head/lib/libnv/Makefile Sat Aug 27 13:37:30 2016 (r304908) @@ -11,7 +11,8 @@ SHLIB_MAJOR= 0 .PATH: ${.CURDIR}/../../sys/contrib/libnv ${.CURDIR}/../../sys/sys CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR} -SRCS= dnvlist.c +SRCS= cnvlist.c +SRCS+= dnvlist.c SRCS+= msgio.c SRCS+= nvlist.c SRCS+= nvpair.c Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Sat Aug 27 12:41:15 2016 (r304907) +++ head/lib/libnv/tests/Makefile Sat Aug 27 13:37:30 2016 (r304908) @@ -1,6 +1,7 @@ # $FreeBSD$ ATF_TESTS_CXX= \ + cnv_tests\ dnv_tests \ nv_array_tests \ nv_tests \ Added: head/lib/libnv/tests/cnv_tests.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/cnv_tests.cc Sat Aug 27 13:37:30 2016 (r304908) @@ -0,0 +1,1509 @@ +/*- + * Copyright (c) 2016 Adam Starak + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include + +#define fd_is_valid(fd) (fcntl((fd), F_GETFL) != -1 || errno != EBADF) + +/* ATF cnvlist_get tests. */ + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_bool); +ATF_TEST_CASE_BODY(cnvlist_get_bool) +{ + nvlist_t *nvl; + const char *key; + bool value; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + value = true; + + nvlist_add_bool(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_bool(nvl, key)); + + ATF_REQUIRE_EQ(cnvlist_get_bool(cookie), value); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_number); +ATF_TEST_CASE_BODY(cnvlist_get_number) +{ + nvlist_t *nvl; + const char *key; + uint64_t value; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + value = 420; + + nvlist_add_number(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_number(nvl, key)); + + ATF_REQUIRE_EQ(cnvlist_get_number(cookie), value); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_string); +ATF_TEST_CASE_BODY(cnvlist_get_string) +{ + nvlist_t *nvl; + const char *key; + const char *value; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + value = "text"; + + nvlist_add_string(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_string(nvl, key)); + + ATF_REQUIRE_EQ(strcmp(cnvlist_get_string(cookie), value), 0); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_nvlist); +ATF_TEST_CASE_BODY(cnvlist_get_nvlist) +{ + nvlist_t *nvl, *value; + const nvlist_t *result; + const char *key, *subkey; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + value = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + key = "name"; + subkey = "subname"; + cookie = NULL; + + /* Add null to 'value' nvlist. */ + nvlist_add_null(value, subkey); + ATF_REQUIRE_EQ(strcmp(subkey, nvlist_next(value, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(value), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE(!nvlist_empty(value)); + ATF_REQUIRE(nvlist_exists(value, subkey)); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &cookie), + static_cast(NULL)); + + /* Add 'value' nvlist. */ + cookie = NULL; + nvlist_add_nvlist(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); + + /* Assuming nvlist_get_nvlist() is correct check if cnvlist returns the + * same pointer. + */ + result = cnvlist_get_nvlist(cookie); + ATF_REQUIRE_EQ(result, nvlist_get_nvlist(nvl, key)); + ATF_REQUIRE(result != value); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + /* Validate data inside nvlist. */ + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(subkey, nvlist_next(result, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(result), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE(!nvlist_empty(result)); + ATF_REQUIRE(nvlist_exists(result, subkey)); + ATF_REQUIRE(nvlist_exists_null(result, subkey)); + ATF_REQUIRE_EQ(nvlist_next(result, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); + nvlist_destroy(value); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_descriptor); +ATF_TEST_CASE_BODY(cnvlist_get_descriptor) +{ + nvlist_t *nvl; + const char *key; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_descriptor(nvl, key, STDERR_FILENO); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_DESCRIPTOR); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_descriptor(nvl, key)); + + ATF_REQUIRE_EQ(fd_is_valid(cnvlist_get_descriptor(cookie)), 1); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_binary); +ATF_TEST_CASE_BODY(cnvlist_get_binary) +{ + nvlist_t *nvl; + const char *key; + void *in_binary; + const void *out_binary; + void *cookie; + int type; + size_t in_size, out_size; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + in_size = 13; + + in_binary = malloc(in_size); + ATF_REQUIRE(in_binary != NULL); + memset(in_binary, 0xa5, in_size); + + nvlist_add_binary(nvl, key, in_binary, in_size); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_binary(nvl, key)); + + out_binary = cnvlist_get_binary(cookie, &out_size); + ATF_REQUIRE_EQ(out_size, in_size); + ATF_REQUIRE_EQ(memcmp(in_binary, out_binary, out_size), 0); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +/* ATF cnvlist_get array tests. */ + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_bool_array); +ATF_TEST_CASE_BODY(cnvlist_get_bool_array) +{ + nvlist_t *nvl; + bool in_array[16]; + const bool *out_array; + const char *key; + void *cookie; + int type, i; + size_t nitems; + + for (i = 0; i < 16; i++) + in_array[i] = (i % 2 == 0); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_bool_array(nvl, key, in_array, 16); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); + + out_array = cnvlist_get_bool_array(cookie, &nitems); + ATF_REQUIRE_EQ(nitems, 16); + ATF_REQUIRE(out_array != NULL); + for (i = 0; i < 16; i++) + ATF_REQUIRE_EQ(out_array[i], in_array[i]); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_number_array); +ATF_TEST_CASE_BODY(cnvlist_get_number_array) +{ + nvlist_t *nvl; + uint64_t in_array[16]; + const uint64_t *out_array; + const char *key; + void *cookie; + int type, i; + size_t nitems; + + for (i = 0; i < 16; i++) + in_array[i] = i; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_number_array(nvl, key, in_array, 16); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); + + out_array = cnvlist_get_number_array(cookie, &nitems); + ATF_REQUIRE(out_array != NULL); + ATF_REQUIRE_EQ(nitems, 16); + for (i = 0; i < 16; i++) + ATF_REQUIRE_EQ(out_array[i], in_array[i]); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_string_array); +ATF_TEST_CASE_BODY(cnvlist_get_string_array) +{ + nvlist_t *nvl; + const char *in_array[4] = {"inequality", "sucks", ".", ""}; + const char * const *out_array; + const char *key; + void *cookie; + int type, i; + size_t nitems; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_string_array(nvl, key, in_array, 4); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); + + out_array = cnvlist_get_string_array(cookie, &nitems); + ATF_REQUIRE_EQ(nitems, 4); + ATF_REQUIRE(out_array != NULL); + for (i = 0; i < 4; i++) { + ATF_REQUIRE(out_array[i] != NULL); + ATF_REQUIRE_EQ(strcmp(out_array[i], in_array[i]), 0); + } + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_nvlist_array); +ATF_TEST_CASE_BODY(cnvlist_get_nvlist_array) +{ + nvlist_t *nvl; + nvlist_t *in_array[6]; + const nvlist_t * const *out_array; + const nvlist_t * const *out_result; + void *cookie; + const char *key; + const char *subkeys; + int type, i; + size_t nitems; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + subkeys = "123456"; + for (i = 0; i < 6; i++) { + in_array[i] = nvlist_create(0); + ATF_REQUIRE(in_array[i] != NULL); + ATF_REQUIRE_EQ(nvlist_error(in_array[i]), 0); + ATF_REQUIRE(nvlist_empty(in_array[i])); + + cookie = NULL; + + nvlist_add_null(in_array[i], subkeys+i); + ATF_REQUIRE_EQ(strcmp(subkeys+i, nvlist_next(in_array[i], + &type, &cookie)),0); + ATF_REQUIRE_EQ(nvlist_error(in_array[i]), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE(!nvlist_empty(in_array[i])); + ATF_REQUIRE(nvlist_exists(in_array[i], subkeys+i)); + ATF_REQUIRE(nvlist_exists_null(in_array[i], subkeys+i)); + ATF_REQUIRE_EQ(nvlist_next(in_array[i], &type, &cookie), + static_cast(NULL)); + } + + cookie = NULL; + key = "name"; + + nvlist_add_nvlist_array(nvl, key, in_array, 6); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key)); + + /* Get nvlist array by cnvlist function. */ + out_array = cnvlist_get_nvlist_array(cookie, &nitems); + ATF_REQUIRE(out_array != NULL); + ATF_REQUIRE_EQ(nitems, 6); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + /* Get nvlist array by nvlist function. */ + out_result = nvlist_get_nvlist_array(nvl, key, &nitems); + ATF_REQUIRE(out_result != NULL); + ATF_REQUIRE_EQ(nitems, 6); + + /* Validate assuming that nvlist returned a proper pointer */ + for (i = 0; i < 6; i++) { + ATF_REQUIRE_EQ(out_result[i], out_array[i]); + ATF_REQUIRE(out_array[i] != in_array[i]); + + /* Validate data inside nvlist. */ + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(subkeys+i, nvlist_next(out_array[i], + &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(out_array[i]), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE(!nvlist_empty(out_array[i])); + ATF_REQUIRE(nvlist_exists(out_array[i], subkeys+i)); + ATF_REQUIRE(nvlist_exists_null(out_array[i], subkeys+i)); + ATF_REQUIRE_EQ(nvlist_next(out_array[i], &type, &cookie), + static_cast(NULL)); + } + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_descriptor_array); +ATF_TEST_CASE_BODY(cnvlist_get_descriptor_array) +{ + + nvlist_t *nvl; + size_t count, i, nitems; + const int *out_array; + int *in_array, type; + const char *key; + void *cookie; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + count = 50; + + in_array = static_cast(malloc(sizeof(*in_array)*count)); + ATF_REQUIRE(in_array != NULL); + for (i = 0; i < count; i++) { + in_array[i] = dup(STDERR_FILENO); + ATF_REQUIRE(fd_is_valid(in_array[i])); + } + + nvlist_add_descriptor_array(nvl, key, in_array, count); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_DESCRIPTOR_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_descriptor_array(nvl, key)); + + out_array = cnvlist_get_descriptor_array(cookie, &nitems); + ATF_REQUIRE_EQ(nitems, count); + ATF_REQUIRE(out_array != NULL); + for (i = 0; i < count; i++) + ATF_REQUIRE_EQ(fd_is_valid(out_array[i]), 1); + + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +/* ATF cnvlist_take tests. */ + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_bool); +ATF_TEST_CASE_BODY(cnvlist_take_bool) +{ + nvlist_t *nvl; + const char *key; + bool value; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + value = true; + + nvlist_add_bool(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_bool(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(cnvlist_take_bool(nvl, cookie), value); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + ATF_REQUIRE(!nvlist_exists_bool(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_number); +ATF_TEST_CASE_BODY(cnvlist_take_number) +{ + nvlist_t *nvl; + const char *key; + uint64_t value; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + value = 69; + + nvlist_add_number(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_number(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(cnvlist_take_number(nvl, cookie), value); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + ATF_REQUIRE(!nvlist_exists_number(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_string); +ATF_TEST_CASE_BODY(cnvlist_take_string) +{ + nvlist_t *nvl; + const char *key; + const char *value; + char *out_string; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + value = "text"; + + nvlist_add_string(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_string(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + out_string = cnvlist_take_string(nvl, cookie); + ATF_REQUIRE(out_string != NULL); + ATF_REQUIRE_EQ(strcmp(out_string, value), 0); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + ATF_REQUIRE(!nvlist_exists_string(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + free(out_string); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_nvlist); +ATF_TEST_CASE_BODY(cnvlist_take_nvlist) +{ + nvlist_t *nvl, *value, *result; + const char *key, *subkey; + void *cookie; + int type; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + value = nvlist_create(0); + ATF_REQUIRE(value != NULL); + ATF_REQUIRE_EQ(nvlist_error(value), 0); + ATF_REQUIRE(nvlist_empty(value)); + + key = "name"; + subkey = "subname"; + cookie = NULL; + + /* Add null to 'value' nvlist. */ + nvlist_add_null(value, subkey); + ATF_REQUIRE_EQ(strcmp(subkey, nvlist_next(value, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(value), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE(!nvlist_empty(value)); + ATF_REQUIRE(nvlist_exists(value, subkey)); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &cookie), + static_cast(NULL)); + + /* Add 'value' nvlist. */ + cookie = NULL; + nvlist_move_nvlist(nvl, key, value); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + result = cnvlist_take_nvlist(nvl, cookie); + ATF_REQUIRE(!nvlist_exists_nvlist(nvl, key)); + ATF_REQUIRE(result == value); + + /* Validate data inside nvlist. */ + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(subkey, nvlist_next(result, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(value), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NULL); + ATF_REQUIRE(!nvlist_empty(value)); + ATF_REQUIRE(nvlist_exists(value, subkey)); + ATF_REQUIRE(nvlist_exists_null(value, subkey)); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); + nvlist_destroy(value); +} + +/* ATF cnvlist_take array tests */ + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_bool_array); +ATF_TEST_CASE_BODY(cnvlist_take_bool_array) +{ + nvlist_t *nvl; + bool in_array[16]; + const bool *out_array; + const char *key; + void *cookie; + int type, i; + size_t nitems; + + for (i = 0; i < 16; i++) + in_array[i] = (i % 2 == 0); + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_bool_array(nvl, key, in_array, 16); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_BOOL_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + out_array = cnvlist_take_bool_array(nvl, cookie, &nitems); + ATF_REQUIRE_EQ(nitems, 16); + ATF_REQUIRE(out_array != NULL); + for (i = 0; i < 16; i++) + ATF_REQUIRE_EQ(out_array[i], in_array[i]); + + cookie = NULL; + ATF_REQUIRE(!nvlist_exists_bool_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_number_array); +ATF_TEST_CASE_BODY(cnvlist_take_number_array) +{ + nvlist_t *nvl; + uint64_t in_array[16]; + const uint64_t *out_array; + const char *key; + void *cookie; + int type, i; + size_t nitems; + + for (i = 0; i < 16; i++) + in_array[i] = i; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_number_array(nvl, key, in_array, 16); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_number_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + out_array = cnvlist_take_number_array(nvl, cookie, &nitems); + + ATF_REQUIRE(out_array != NULL); + ATF_REQUIRE_EQ(nitems, 16); + for (i = 0; i < 16; i++) + ATF_REQUIRE_EQ(out_array[i], in_array[i]); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + ATF_REQUIRE(!nvlist_exists_number_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_string_array); +ATF_TEST_CASE_BODY(cnvlist_take_string_array) +{ + nvlist_t *nvl; + const char *in_array[4] = {"inequality", "sks", ".", ""}; + char **out_array; + const char *key; + void *cookie; + int type, i; + size_t nitems; + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + key = "name"; + + nvlist_add_string_array(nvl, key, in_array, 4); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_string_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + out_array = cnvlist_take_string_array(nvl, cookie, &nitems); + ATF_REQUIRE_EQ(nitems, 4); + for (i = 0; i < 4; i++) { + ATF_REQUIRE(out_array[i] != NULL); + ATF_REQUIRE_EQ(strcmp(out_array[i], in_array[i]), 0); + } + ATF_REQUIRE(nvlist_empty(nvl)); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE(!nvlist_exists(nvl, key)); + ATF_REQUIRE(!nvlist_exists_number_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + free(out_array); + nvlist_destroy(nvl); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_take_nvlist_array); +ATF_TEST_CASE_BODY(cnvlist_take_nvlist_array) +{ + nvlist_t *testnvl[8]; + nvlist_t **result; + nvlist_t *nvl; + void *cookie; + size_t num_items; + unsigned int i; + int type; + const char *somestr[8] = { "a", "b", "c", "d", "e", "f", "g", "h" }; + const char *key; + + for (i = 0; i < 8; i++) { + testnvl[i] = nvlist_create(0); + ATF_REQUIRE(testnvl[i] != NULL); + ATF_REQUIRE_EQ(nvlist_error(testnvl[i]), 0); + ATF_REQUIRE(nvlist_empty(testnvl[i])); + nvlist_add_string(testnvl[i], "nvl/string", somestr[i]); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp("nvl/string", nvlist_next(testnvl[i], + &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(testnvl[i]), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_STRING); + ATF_REQUIRE(!nvlist_empty(testnvl[i])); + ATF_REQUIRE(nvlist_exists(testnvl[i], "nvl/string")); + ATF_REQUIRE(nvlist_exists_string(testnvl[i], "nvl/string")); + ATF_REQUIRE_EQ(nvlist_next(testnvl[i], &type, &cookie), + static_cast(NULL)); + } + + nvl = nvlist_create(0); + ATF_REQUIRE(nvl != NULL); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE(nvlist_empty(nvl)); + + key = "nvl/nvlist"; + cookie = NULL; + + nvlist_add_nvlist_array(nvl, key, (const nvlist_t * const *)testnvl, 8); + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST_ARRAY); + ATF_REQUIRE(!nvlist_empty(nvl)); + ATF_REQUIRE(nvlist_exists(nvl, key)); + ATF_REQUIRE(nvlist_exists_nvlist_array(nvl, key)); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &cookie), + static_cast(NULL)); + + cookie = NULL; + ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); + result = cnvlist_take_nvlist_array(nvl, cookie, &num_items); + + ATF_REQUIRE(result != NULL); + ATF_REQUIRE_EQ(num_items, 8); + for (i = 0; i < num_items; i++) { + ATF_REQUIRE_EQ(nvlist_error(result[i]), 0); + ATF_REQUIRE(nvlist_get_array_next(result[i]) == NULL); + } + + ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); + ATF_REQUIRE(nvlist_empty(nvl)); + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); + + cookie = NULL; + ATF_REQUIRE_EQ(nvlist_error(nvl), 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Aug 27 13:40:29 2016 Return-Path: Delivered-To: svn-src-head@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 0CC99B76B4D; Sat, 27 Aug 2016 13:40:29 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DECB9BD1; Sat, 27 Aug 2016 13:40:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RDeSwZ065785; Sat, 27 Aug 2016 13:40:28 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RDeRJ5065782; Sat, 27 Aug 2016 13:40:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608271340.u7RDeRJ5065782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 27 Aug 2016 13:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304909 - in head: lib/libnv/tests sys/contrib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 13:40:29 -0000 Author: oshogbo Date: Sat Aug 27 13:40:27 2016 New Revision: 304909 URL: https://svnweb.freebsd.org/changeset/base/304909 Log: Fix style issue in the cnv API. Remove unused arguments in a macro. Remove unused typedef. Modified: head/lib/libnv/tests/Makefile head/lib/libnv/tests/cnv_tests.cc head/sys/contrib/libnv/cnvlist.c Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Sat Aug 27 13:37:30 2016 (r304908) +++ head/lib/libnv/tests/Makefile Sat Aug 27 13:40:27 2016 (r304909) @@ -1,7 +1,7 @@ # $FreeBSD$ ATF_TESTS_CXX= \ - cnv_tests\ + cnv_tests \ dnv_tests \ nv_array_tests \ nv_tests \ Modified: head/lib/libnv/tests/cnv_tests.cc ============================================================================== --- head/lib/libnv/tests/cnv_tests.cc Sat Aug 27 13:37:30 2016 (r304908) +++ head/lib/libnv/tests/cnv_tests.cc Sat Aug 27 13:40:27 2016 (r304909) @@ -188,8 +188,9 @@ ATF_TEST_CASE_BODY(cnvlist_get_nvlist) ATF_REQUIRE(nvlist_exists(nvl, key)); ATF_REQUIRE(nvlist_exists_nvlist(nvl, key)); - /* Assuming nvlist_get_nvlist() is correct check if cnvlist returns the - * same pointer. + /* + * Assuming nvlist_get_nvlist() is correct check if cnvlist returns + * the same pointer. */ result = cnvlist_get_nvlist(cookie); ATF_REQUIRE_EQ(result, nvlist_get_nvlist(nvl, key)); @@ -499,7 +500,6 @@ ATF_TEST_CASE_BODY(cnvlist_get_nvlist_ar ATF_TEST_CASE_WITHOUT_HEAD(cnvlist_get_descriptor_array); ATF_TEST_CASE_BODY(cnvlist_get_descriptor_array) { - nvlist_t *nvl; size_t count, i, nitems; const int *out_array; @@ -730,7 +730,6 @@ ATF_TEST_CASE_BODY(cnvlist_take_nvlist) ATF_REQUIRE(result == value); /* Validate data inside nvlist. */ - cookie = NULL; ATF_REQUIRE_EQ(strcmp(subkey, nvlist_next(result, &type, &cookie)), 0); ATF_REQUIRE_EQ(nvlist_error(value), 0); Modified: head/sys/contrib/libnv/cnvlist.c ============================================================================== --- head/sys/contrib/libnv/cnvlist.c Sat Aug 27 13:37:30 2016 (r304908) +++ head/sys/contrib/libnv/cnvlist.c Sat Aug 27 13:40:27 2016 (r304909) @@ -53,14 +53,15 @@ __FBSDID("$FreeBSD$"); #include "nvlist_impl.h" #include "nvpair_impl.h" -#define CNVLIST_GET(ftype, type, nvtype) \ +#define CNVLIST_GET(ftype, type, NVTYPE) \ ftype \ cnvlist_get_##type(void *cookiep) \ { \ \ - if (nvpair_type(cookiep) != NV_TYPE_##nvtype) \ - nvlist_report_missing(NV_TYPE_##nvtype, \ + if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + nvlist_report_missing(NV_TYPE_##NVTYPE, \ nvpair_name(cookiep)); \ + } \ return (nvpair_get_##type(cookiep)); \ } @@ -72,17 +73,18 @@ CNVLIST_GET(const nvlist_t *, nvlist, NV CNVLIST_GET(int, descriptor, DESCRIPTOR) #endif -#undef CNVLIST_GET +#undef CNVLIST_GET -#define CNVLIST_GET_ARRAY(ftype, type, nvtype) \ +#define CNVLIST_GET_ARRAY(ftype, type, NVTYPE) \ ftype \ cnvlist_get_##type(void *cookiep, size_t *nitemsp) \ { \ \ - if (nvpair_type(cookiep) != NV_TYPE_##nvtype) \ - nvlist_report_missing(NV_TYPE_##nvtype, \ + if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + nvlist_report_missing(NV_TYPE_##NVTYPE, \ nvpair_name(cookiep)); \ - return (nvpair_get_##type(cookiep, nitemsp)); \ + } \ + return (nvpair_get_##type(cookiep, nitemsp)); \ } CNVLIST_GET_ARRAY(const bool *, bool_array, BOOL_ARRAY) @@ -93,26 +95,27 @@ CNVLIST_GET_ARRAY(const nvlist_t * const CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCRIPTOR_ARRAY) #endif -#undef CNVLIST_GET_ARRAY +#undef CNVLIST_GET_ARRAY const void * cnvlist_get_binary(void *cookiep, size_t *sizep) { - if (nvpair_type(cookiep) != NV_TYPE_BINARY) + if (nvpair_type(cookiep) != NV_TYPE_BINARY) nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookiep)); - return (nvpair_get_binary(cookiep, sizep)); + return (nvpair_get_binary(cookiep, sizep)); } -#define CNVLIST_TAKE(ftype, type, nvtype) \ +#define CNVLIST_TAKE(ftype, type, NVTYPE) \ ftype \ cnvlist_take_##type(nvlist_t *nvl, void *cookiep) \ { \ ftype value; \ \ - if (nvpair_type(cookiep) != NV_TYPE_##nvtype) \ - nvlist_report_missing(NV_TYPE_##nvtype, \ + if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + nvlist_report_missing(NV_TYPE_##NVTYPE, \ nvpair_name(cookiep)); \ + } \ value = (ftype)(intptr_t)nvpair_get_##type(cookiep); \ nvlist_remove_nvpair(nvl, cookiep); \ nvpair_free_structure(cookiep); \ @@ -127,17 +130,18 @@ CNVLIST_TAKE(nvlist_t *, nvlist, NVLIST) CNVLIST_TAKE(int, descriptor, DESCRIPTOR) #endif -#undef CNVLIST_TAKE +#undef CNVLIST_TAKE -#define CNVLIST_TAKE_ARRAY(ftype, type, nvtype) \ +#define CNVLIST_TAKE_ARRAY(ftype, type, NVTYPE) \ ftype \ cnvlist_take_##type(nvlist_t *nvl, void *cookiep, size_t *nitemsp) \ { \ ftype value; \ \ - if (nvpair_type(cookiep) != NV_TYPE_##nvtype) \ - nvlist_report_missing(NV_TYPE_##nvtype, \ + if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + nvlist_report_missing(NV_TYPE_##NVTYPE, \ nvpair_name(cookiep)); \ + } \ value = (ftype)(intptr_t)nvpair_get_##type(cookiep, nitemsp); \ nvlist_remove_nvpair(nvl, cookiep); \ nvpair_free_structure(cookiep); \ @@ -152,14 +156,14 @@ CNVLIST_TAKE_ARRAY(nvlist_t **, nvlist_a CNVLIST_TAKE_ARRAY(int *, descriptor_array, DESCRIPTOR_ARRAY); #endif -#undef CNVLIST_TAKE_ARRAY +#undef CNVLIST_TAKE_ARRAY void * cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep) { - void * value; + void *value; - if (nvpair_type(cookiep) != NV_TYPE_BINARY) + if (nvpair_type(cookiep) != NV_TYPE_BINARY) nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookiep)); value = (void *)(intptr_t)nvpair_get_binary(cookiep, sizep); nvlist_remove_nvpair(nvl, cookiep); @@ -168,7 +172,7 @@ cnvlist_take_binary(nvlist_t *nvl, void } -#define CNVLIST_FREE(type, nvtype) \ +#define CNVLIST_FREE(type) \ void \ cnvlist_free_##type(nvlist_t *nvl, void *cookiep) \ { \ @@ -176,18 +180,18 @@ cnvlist_free_##type(nvlist_t *nvl, void nvlist_free_nvpair(nvl, cookiep); \ } -CNVLIST_FREE(bool, BOOL) -CNVLIST_FREE(number, NUMBER) -CNVLIST_FREE(string, STRING) -CNVLIST_FREE(nvlist, NVLIST) -CNVLIST_FREE(binary, BINARY); -CNVLIST_FREE(bool_array, BOOL_ARRAY) -CNVLIST_FREE(number_array, NUMBER_ARRAY) -CNVLIST_FREE(string_array, STRING_ARRAY) -CNVLIST_FREE(nvlist_array, NVLIST_ARRAY) +CNVLIST_FREE(bool) +CNVLIST_FREE(number) +CNVLIST_FREE(string) +CNVLIST_FREE(nvlist) +CNVLIST_FREE(binary); +CNVLIST_FREE(bool_array) +CNVLIST_FREE(number_array) +CNVLIST_FREE(string_array) +CNVLIST_FREE(nvlist_array) #ifndef _KERNEL -CNVLIST_FREE(descriptor, DESCRIPTOR) -CNVLIST_FREE(descriptor_array, DESCRIPTOR_ARRAY) +CNVLIST_FREE(descriptor) +CNVLIST_FREE(descriptor_array) #endif -#undef CNVLIST_FREE +#undef CNVLIST_FREE From owner-svn-src-head@freebsd.org Sat Aug 27 13:47:53 2016 Return-Path: Delivered-To: svn-src-head@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 7A0D7B76F04; Sat, 27 Aug 2016 13:47:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52C511F0; Sat, 27 Aug 2016 13:47:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RDlqkr069427; Sat, 27 Aug 2016 13:47:52 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RDlqIu069425; Sat, 27 Aug 2016 13:47:52 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608271347.u7RDlqIu069425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 27 Aug 2016 13:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304910 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 13:47:53 -0000 Author: oshogbo Date: Sat Aug 27 13:47:52 2016 New Revision: 304910 URL: https://svnweb.freebsd.org/changeset/base/304910 Log: Introduce cnv man page. Submitted by: Adam Starak Reviewed by: cem@, wblock@ Differential Revision: https://reviews.freebsd.org/D7249 Added: head/share/man/man9/cnv.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Aug 27 13:40:27 2016 (r304909) +++ head/share/man/man9/Makefile Sat Aug 27 13:47:52 2016 (r304910) @@ -57,6 +57,7 @@ MAN= accept_filter.9 \ byteorder.9 \ casuword.9 \ cd.9 \ + cnv.9 \ condvar.9 \ config_intrhook.9 \ contigmalloc.9 \ @@ -617,6 +618,41 @@ MLINKS+=byteorder.9 be16dec.9 \ byteorder.9 le64dec.9 \ byteorder.9 le64enc.9 \ byteorder.9 le64toh.9 +MLINKS+=cnv.9 cnvlist.9 \ + cnv.9 cnvlist_free_binary.9 \ + cnv.9 cnvlist_free_bool.9 \ + cnv.9 cnvlist_free_bool_array.9 \ + cnv.9 cnvlist_free_descriptor.9 \ + cnv.9 cnvlist_free_descriptor_array.9 \ + cnv.9 cnvlist_free_null.9 \ + cnv.9 cnvlist_free_number.9 \ + cnv.9 cnvlist_free_number_array.9 \ + cnv.9 cnvlist_free_nvlist.9 \ + cnv.9 cnvlist_free_nvlist_array.9 \ + cnv.9 cnvlist_free_string.9 \ + cnv.9 cnvlist_free_string_array.9 \ + cnv.9 cnvlist_get_binary.9 \ + cnv.9 cnvlist_get_bool.9 \ + cnv.9 cnvlist_get_bool_array.9 \ + cnv.9 cnvlist_get_descriptor.9 \ + cnv.9 cnvlist_get_descriptor_array.9 \ + cnv.9 cnvlist_get_number.9 \ + cnv.9 cnvlist_get_number_array.9 \ + cnv.9 cnvlist_get_nvlist.9 \ + cnv.9 cnvlist_get_nvlist_array.9 \ + cnv.9 cnvlist_get_string.9 \ + cnv.9 cnvlist_get_string_array.9 \ + cnv.9 cnvlist_take_binary.9 \ + cnv.9 cnvlist_take_bool.9 \ + cnv.9 cnvlist_take_bool_array.9 \ + cnv.9 cnvlist_take_descriptor.9 \ + cnv.9 cnvlist_take_descriptor_array.9 \ + cnv.9 cnvlist_take_number.9 \ + cnv.9 cnvlist_take_number_array.9 \ + cnv.9 cnvlist_take_nvlist.9 \ + cnv.9 cnvlist_take_nvlist_array.9 \ + cnv.9 cnvlist_take_string.9 \ + cnv.9 cnvlist_take_string_array.9 MLINKS+=condvar.9 cv_broadcast.9 \ condvar.9 cv_broadcastpri.9 \ condvar.9 cv_destroy.9 \ Added: head/share/man/man9/cnv.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/cnv.9 Sat Aug 27 13:47:52 2016 (r304910) @@ -0,0 +1,199 @@ +.\" +.\" Copyright (c) 2016 Adam Starak +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 26, 2016 +.Dt CNV 9 +.Os +.Sh NAME +.Nm cnvlist_get, +.Nm cnvlist_take, +.Nm cnvlist_free, +.Nd "API for managing name/value pairs by cookie." +.Sh LIBRARY +.Lb libnv +.Sh SYNOPSIS +.In sys/cnv.h +.Ft bool +.Fn cnvlist_get_bool "void *cookiep" +.Ft uint64_t +.Fn cnvlist_get_number "void *cookiep" +.Ft "const char *" +.Fn cnvlist_get_string "void *cookiep" +.Ft "const nvlist_t *" +.Fn cnvlist_get_nvlist "void *cookiep" +.Ft "const void *" +.Fn cnvlist_get_binary "void *cookiep" "size_t *sizep" +.Ft "const bool *" +.Fn cnvlist_get_bool_array "void *cookiep" "size_t *nitemsp" +.Ft "const uint64_t *" +.Fn cnvlist_get_number_array "void *cookiep" "size_t *nitemsp" +.Ft "const char * const *" +.Fn cnvlist_get_string_array "void *cookiep" "size_t *nitemsp" +.Ft "const nvlist_t * const *" +.Fn cnvlist_get_nvlist_array "void *cookiep" "size_t *nitemsp" +.Ft int +.Fn cnvlist_get_descriptor "void *cookiep" +.Ft "const int *" +.Fn cnvlist_get_descriptor_array "void *cookiep" "size_t *nitemsp" +.\" +.Ft bool +.Fn cnvlist_take_bool "void *cookiep" +.Ft uint64_t +.Fn cnvlist_take_number "void *cookiep" +.Ft "const char *" +.Fn cnvlist_take_string "void *cookiep" +.Ft "const nvlist_t *" +.Fn cnvlist_take_nvlist "void *cookiep" +.Ft "const void *" +.Fn cnvlist_take_binary "void *cookiep" "size_t *sizep" +.Ft "const bool *" +.Fn cnvlist_take_bool_array "void *cookiep" "size_t *nitemsp" +.Ft "const uint64_t *" +.Fn cnvlist_take_number_array "void *cookiep" "size_t *nitemsp" +.Ft "const char * const *" +.Fn cnvlist_take_string_array "void *cookiep" "size_t *nitemsp" +.Ft "const nvlist_t * const *" +.Fn cnvlist_take_nvlist_array "void *cookiep" "size_t *nitemsp" +.Ft int +.Fn cnvlist_take_descriptor "void *cookiep" +.Ft "const int *' +.Fn cnvlist_take_descriptor_array "void *cookiep" "size_t *nitemsp" +.\" +.Ft void +.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_bool_array "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_number_array "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_string_array "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_nvlist_array "nvlist_t *nvl" "void *cookiep" +.Ft void +.Fn cnvlist_free_descriptor_array "nvlist_t *nvl" "void *cookiep" +.Sh DESCRIPTION +The +.Nm libnv +library permits easy management of name/value pairs and can send and receive +them over sockets. +For more information, also see +.Xr nv 9 . +.Pp +The concept of cookies is explained in +.Fn nvlist_next , +.Fn nvlist_get_parent , +and +.Fn nvlist_get_pararr +from +.Xr nv 9 . +.Pp +The +.Nm cnvlist_get +family of functions obtains the value associated with the given cookie. +Returned strings, nvlists, descriptors, binaries, or arrays must not be modified +by the user, since they still belong to the nvlist. +The nvlist must not be in an error state. +.Pp +The +.Nm cnvlist_take +family of functions returns the value associated with the given cookie and +removes the element from the nvlist. +When the value is a string, binary, or array value, the caller is responsible +for freeing the returned memory with +.Fn free 3 . +When the value is an nvlist, the caller is responsible for destroying the +returned nvlist with +.Fn nvlist_destroy . +When the value is a descriptor, the caller is responsible for closing the +returned descriptor with the +.Fn close 2 . +.Pp +The +.Nm cnvlist_free +family of functions removes an element of the supplied cookie and frees all +resources. +If an element of the given cookie has the wrong type or does not exist, the +program +is aborted. +.Sh EXAMPLE +The following example demonstrates how to deal with cnvlist API. +.Bd -literal +int type; +void *cookie, *scookie, *bcookie; +nvlist_t *nvl; +char *name; + +nvl = nvlist_create(0); +nvlist_add_bool(nvl, "test", 1 == 2); +nvlist_add_string(nvl, "test2", "cnvlist"); +cookie = NULL; + +while (nvlist_next(nvl, &type, &cookie) != NULL) { + switch (type) { + case NV_TYPE_BOOL: + printf("test: %d\\n", cnvlist_get_bool(cookie)); + bcookie = cookie; + break; + case NV_TYPE_STRING: + printf("test2: %s\\n", cnvlist_get_string(cookie)); + scookie = cookie; + break; + } +} + +name = cnvlist_take_string(nvl, scookie); +cnvlist_free_bool(nvl, bcookie); + +printf("test2: %s\\n", name); +free(name); + +printf("nvlist_empty = %d\\n", nvlist_empty(nvl)); +nvlist_destroy(nvl); + +return (0); +.Ed +.Sh SEE ALSO +.Xr nv 9 , +.Xr close 2 , +.Xr free 3 +.Sh AUTHORS +.An -nosplit +The +.Nm cnv +API was created during the Google Summer Of Code 2016 by From owner-svn-src-head@freebsd.org Sat Aug 27 14:43:14 2016 Return-Path: Delivered-To: svn-src-head@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 BF60FB773E8; Sat, 27 Aug 2016 14:43:14 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 731E6321; Sat, 27 Aug 2016 14:43:14 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7REhDnO091585; Sat, 27 Aug 2016 14:43:13 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7REhDdb091584; Sat, 27 Aug 2016 14:43:13 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608271443.u7REhDdb091584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sat, 27 Aug 2016 14:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304911 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 14:43:14 -0000 Author: ache Date: Sat Aug 27 14:43:13 2016 New Revision: 304911 URL: https://svnweb.freebsd.org/changeset/base/304911 Log: The formal behavior of qsort is unstable with regard to objects that are equal. Unfortunately, RFC 3484 requires that otherwise equal objects remain in the order supplied by the DNS server. The present code attempts to deal with this by returning -1 for objects that are equal (i.e., returns that the first parameter is less then the second parameter). Unfortunately, the qsort API does not state that the first parameter passed in is in any particular position in the list. PR: 212122 Submitted by: Herbie.Robinson@stratus.com MFC after: 3 days Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sat Aug 27 13:47:52 2016 (r304910) +++ head/lib/libc/net/getaddrinfo.c Sat Aug 27 14:43:13 2016 (r304911) @@ -224,6 +224,7 @@ struct ai_order { struct policyqueue *aio_dstpolicy; struct addrinfo *aio_ai; int aio_matchlen; + int aio_initial_sequence; }; static const ns_src default_dns_files[] = { @@ -708,6 +709,7 @@ reorder(struct addrinfo *sentinel) aio[i].aio_dstpolicy = match_addrselectpolicy(ai->ai_addr, &policyhead); set_source(&aio[i], &policyhead); + aio[i].aio_initial_sequence = i; } /* perform sorting. */ @@ -1066,6 +1068,23 @@ comp_dst(const void *arg1, const void *a } /* Rule 10: Otherwise, leave the order unchanged. */ + + /* + * Note that qsort is unstable; so, we can't return zero and + * expect the order to be unchanged. + * That also means we can't depend on the current position of + * dst2 being after dst1. We must enforce the initial order + * with an explicit compare on the original position. + * The qsort specification requires that "When the same objects + * (consisting of width bytes, irrespective of their current + * positions in the array) are passed more than once to the + * comparison function, the results shall be consistent with one + * another." + * In other words, If A < B, then we must also return B > A. + */ + if (dst2->aio_initial_sequence < dst1->aio_initial_sequence) + return(1); + return(-1); } From owner-svn-src-head@freebsd.org Sat Aug 27 15:22:56 2016 Return-Path: Delivered-To: svn-src-head@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 41359B77CBE; Sat, 27 Aug 2016 15:22:56 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014687A3; Sat, 27 Aug 2016 15:22:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RFMttC006583; Sat, 27 Aug 2016 15:22:55 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RFMtBY006582; Sat, 27 Aug 2016 15:22:55 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608271522.u7RFMtBY006582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 27 Aug 2016 15:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304912 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 15:22:56 -0000 Author: oshogbo Date: Sat Aug 27 15:22:55 2016 New Revision: 304912 URL: https://svnweb.freebsd.org/changeset/base/304912 Log: Add missed header file for cnv.h . Submitted by: Adam Starak Reported by: ache@ Added: head/sys/sys/cnv.h (contents, props changed) Added: head/sys/sys/cnv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/cnv.h Sat Aug 27 15:22:55 2016 (r304912) @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2016 Adam Starak + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CNV_H_ +#define _CNV_H_ + +#include + +#ifndef _KERNEL +#include +#include +#include +#include +#endif + +#ifndef _NVLIST_T_DECLARED +#define _NVLIST_T_DECLARED +struct nvlist; + +typedef struct nvlist nvlist_t; +#endif + +__BEGIN_DECLS + +/* + * The cnvlist_get functions returns value associated with the given cookie. + * If it returns a pointer, the pointer represents internal buffer and should + * not be freed by the caller. + */ + +bool cnvlist_get_bool(void *cookiep); +uint64_t cnvlist_get_number(void *cookiep); +const char *cnvlist_get_string(void *cookiep); +const nvlist_t *cnvlist_get_nvlist(void *cookiep); +const void *cnvlist_get_binary(void *cookiep, size_t *sizep); +const bool *cnvlist_get_bool_array(void *cookiep, size_t *nitemsp); +const uint64_t *cnvlist_get_number_array(void *cookiep, size_t *nitemsp); +const char * const *cnvlist_get_string_array(void *cookiep, size_t *nitemsp); +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t *nitemsp); +#ifndef _KERNEL +int cnvlist_get_descriptor(void *cookiep); +const int *cnvlist_get_descriptor_array(void *cookiep, size_t *nitemsp); +#endif + + +/* + * The cnvlist_take functions returns value associated with the given cookie and + * remove the given entry from the nvlist. + * The caller is responsible for freeing received data. + */ + +bool cnvlist_take_bool(nvlist_t *nvl, void *cookiep); +uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookiep); +char *cnvlist_take_string(nvlist_t *nvl, void *cookiep); +nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookiep); +void *cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep); +bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +char **cnvlist_take_string_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +#ifndef _KERNEL +int cnvlist_take_descriptor(nvlist_t *nvl, void *cookiep); +int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +#endif + +/* + * The cnvlist_free functions removes the given name/value pair from the nvlist based on cookie + * and frees memory associated with it. + */ + +void cnvlist_free_bool(nvlist_t *nvl, void *cookiep); +void cnvlist_free_number(nvlist_t *nvl, void *cookiep); +void cnvlist_free_string(nvlist_t *nvl, void *cookiep); +void cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep); +void cnvlist_free_binary(nvlist_t *nvl, void *cookiep); +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); +void cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep); +void cnvlist_free_number_array(nvlist_t *nvl, void *cookiep); +void cnvlist_free_string_array(nvlist_t *nvl, void *cookiep); +void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookiep); +#ifndef _KERNEL +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); +void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookiep); +#endif + +__END_DECLS + +#endif /* !_CNV_H_ */ From owner-svn-src-head@freebsd.org Sat Aug 27 16:34:52 2016 Return-Path: Delivered-To: svn-src-head@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 36FE8B773A6; Sat, 27 Aug 2016 16:34:52 +0000 (UTC) (envelope-from hiren@freebsd.org) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 28B81CC; Sat, 27 Aug 2016 16:34:51 +0000 (UTC) (envelope-from hiren@freebsd.org) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id C05A917476; Sat, 27 Aug 2016 09:34:50 -0700 (PDT) Date: Sat, 27 Aug 2016 09:34:50 -0700 From: Hiren Panchasara To: Lawrence Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304857 - head/sys/netinet/tcp_stacks Message-ID: <20160827163450.GS41576@strugglingcoder.info> References: <201608261923.u7QJNHIY058386@repo.freebsd.org> <9f1c8561-d3cc-5871-5b7a-cfe1b016f4d7@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TVVcQco/7vcH19KK" Content-Disposition: inline In-Reply-To: <9f1c8561-d3cc-5871-5b7a-cfe1b016f4d7@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 16:34:52 -0000 --TVVcQco/7vcH19KK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08/27/16 at 01:47P, Lawrence Stewart wrote: > Pointy hat to: lstewart@ >=20 > Apologies all for the breakage, thanks Hiren for fixing and apologies > also for missing your email. For some reason your reply to my commit did > not make it to my inbox and was filtered straight to my mailing list > folder which is annoying - I must have introduced a bug in my > .procmailrc at some point. No worries. :-) >=20 > I don't understand why my buildkernel prior to commit succeeded though. > Is fastpath not build by default? Yeah, it's not since r301814. Cheers, Hiren --TVVcQco/7vcH19KK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXwcEnXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lbZsH/RPO9XPCbc3+XJUXP/xvwE1h jmDxbVq6s0jA/NmWviQG8LgcOLRTBK6fdB0ftLzFWd8L6whsPyMbSLndIsts5dcF xBovG3K+pz/077k6Xa6EOpJdMJxrzRpHqMDsONEGwokWxlBMA3ZYmVnMT1KKuGzZ DSGdBQ3v24K55KQ3OgeDZYCGxQlOoDBoGYThkDpuvG7jxMYNZY3gZ2+aKEFrj6wg qyubnKxlOXuZ9OBOzgOBSKjitzziCna3ncEILfs10Grc9XL3rZ3ke7oWQvY0Zcwt IhCWKpdydL4VfFhygjNTJIDfzjSSfte3tCZGEs+cI+Q+j1d+Mj10YtdLzzyHkG0= =8ICt -----END PGP SIGNATURE----- --TVVcQco/7vcH19KK-- From owner-svn-src-head@freebsd.org Sat Aug 27 17:37:03 2016 Return-Path: Delivered-To: svn-src-head@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 DA110B7774B; Sat, 27 Aug 2016 17:37:03 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2066A6C; Sat, 27 Aug 2016 17:37:03 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 4D4A95A9F27; Sat, 27 Aug 2016 17:37:02 +0000 (UTC) Date: Sat, 27 Aug 2016 17:37:02 +0000 From: Brooks Davis To: "Andrey A. Chernov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304911 - head/lib/libc/net Message-ID: <20160827173702.GE43412@spindle.one-eyed-alien.net> References: <201608271443.u7REhDdb091584@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rJwd6BRFiFCcLxzm" Content-Disposition: inline In-Reply-To: <201608271443.u7REhDdb091584@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 17:37:04 -0000 --rJwd6BRFiFCcLxzm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 27, 2016 at 02:43:13PM +0000, Andrey A. Chernov wrote: > Author: ache > Date: Sat Aug 27 14:43:13 2016 > New Revision: 304911 > URL: https://svnweb.freebsd.org/changeset/base/304911 >=20 > Log: > The formal behavior of qsort is unstable with regard to objects that > are equal. Unfortunately, RFC 3484 requires that otherwise equal objects > remain in the order supplied by the DNS server. The present code attemp= ts > to deal with this by returning -1 for objects that are equal (i.e., > returns that the first parameter is less then the second parameter). > Unfortunately, the qsort API does not state that the first parameter > passed in is in any particular position in the list. Why not switch to mergesort which is stable by design? -- Brooks --rJwd6BRFiFCcLxzm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJXwc+9AAoJEKzQXbSebgfAWB8H+QGusX8irZOAISdsJf8EQ7Sl 1at5VaY3W5xWeMjZer/sGU/X0U/E9U8ByoYDFlndRNL1s36bFA3RAtQLdCwxKHCr Yr3V1oTB1JrLyUh8QjyUalyYWPom9vqM7zrVP4HXDBOmlMXdag4a4Lq74mpLkQVQ Rj6CDaiY8UeXjNq7qUtUs36hy8zwNJlQgs/rGt5vtxvhAwICgRzBNH35+gjp3hIt C5qlUfDePH58SWrjgpa0Aupy7SlBH6LRklXOCBYCfSyIXAkOeh4QkyGfr7Byo4Cl FJvPzYmoVsXVKZlzW2Pbm3sc7u9+O25Xz+AsKDtAuaKfdUeX0R/ZIL9mNO9IA2c= =R3lu -----END PGP SIGNATURE----- --rJwd6BRFiFCcLxzm-- From owner-svn-src-head@freebsd.org Sat Aug 27 18:08:27 2016 Return-Path: Delivered-To: svn-src-head@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 0958AB770D7; Sat, 27 Aug 2016 18:08:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE547B18; Sat, 27 Aug 2016 18:08:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RI8QAG066718; Sat, 27 Aug 2016 18:08:26 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RI8QXD066717; Sat, 27 Aug 2016 18:08:26 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201608271808.u7RI8QXD066717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 27 Aug 2016 18:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304915 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 18:08:27 -0000 Author: oshogbo Date: Sat Aug 27 18:08:25 2016 New Revision: 304915 URL: https://svnweb.freebsd.org/changeset/base/304915 Log: Bump date in the man page. Modified: head/share/man/man9/cnv.9 Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Sat Aug 27 16:01:10 2016 (r304914) +++ head/share/man/man9/cnv.9 Sat Aug 27 18:08:25 2016 (r304915) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2016 +.Dd August 27, 2016 .Dt CNV 9 .Os .Sh NAME From owner-svn-src-head@freebsd.org Sat Aug 27 18:12:43 2016 Return-Path: Delivered-To: svn-src-head@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 ECF00B772BA; Sat, 27 Aug 2016 18:12:43 +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 A5D1BFC7; Sat, 27 Aug 2016 18:12:43 +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 u7RICgD0070344; Sat, 27 Aug 2016 18:12:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RICg7Z070343; Sat, 27 Aug 2016 18:12:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608271812.u7RICg7Z070343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 27 Aug 2016 18:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304916 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 18:12:44 -0000 Author: kib Date: Sat Aug 27 18:12:42 2016 New Revision: 304916 URL: https://svnweb.freebsd.org/changeset/base/304916 Log: Consistently delimit each vnode description block with two blank lines. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/vnode_if.src Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sat Aug 27 18:08:25 2016 (r304915) +++ head/sys/kern/vnode_if.src Sat Aug 27 18:12:42 2016 (r304916) @@ -59,6 +59,7 @@ vop_islocked { IN struct vnode *vp; }; + %% lookup dvp L L L %% lookup vpp - L - @@ -72,6 +73,7 @@ vop_lookup { IN struct componentname *cnp; }; + %% cachedlookup dvp L L L %% cachedlookup vpp - L - @@ -83,6 +85,7 @@ vop_cachedlookup { IN struct componentname *cnp; }; + %% create dvp E E E %% create vpp - L - %! create post vop_create_post @@ -177,12 +180,14 @@ vop_setattr { IN struct ucred *cred; }; + %% markatime vp L L L vop_markatime { IN struct vnode *vp; }; + %% read vp L L L %! read post vop_read_post @@ -642,6 +647,7 @@ vop_allocate { INOUT off_t *len; }; + %% advise vp U U U vop_advise { @@ -651,6 +657,7 @@ vop_advise { IN int advice; }; + %% unp_bind vp E E E vop_unp_bind { @@ -658,6 +665,7 @@ vop_unp_bind { IN struct socket *socket; }; + %% unp_connect vp L L L vop_unp_connect { @@ -665,30 +673,35 @@ vop_unp_connect { OUT struct socket **socket; }; + %% unp_detach vp = = = vop_unp_detach { IN struct vnode *vp; }; + %% is_text vp L L L vop_is_text { IN struct vnode *vp; }; + %% set_text vp E E E vop_set_text { IN struct vnode *vp; }; + %% vop_unset_text vp E E E vop_unset_text { IN struct vnode *vp; }; + %% get_writecount vp L L L vop_get_writecount { @@ -696,6 +709,7 @@ vop_get_writecount { OUT int *writecount; }; + %% add_writecount vp E E E vop_add_writecount { @@ -703,6 +717,7 @@ vop_add_writecount { IN int inc; }; + %% fdatasync vp L L L vop_fdatasync { From owner-svn-src-head@freebsd.org Sat Aug 27 19:08:50 2016 Return-Path: Delivered-To: svn-src-head@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 8A21FB7706D for ; Sat, 27 Aug 2016 19:08:50 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13B34AD8 for ; Sat, 27 Aug 2016 19:08:49 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f45.google.com with SMTP id b199so77009600lfe.0 for ; Sat, 27 Aug 2016 12:08:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=hin2OtSg6wUM3L+uQUYuSBX/OBjWNjuUQkLKeDhkAjM=; b=W2HE3ACmun851WYRLCZor8/CRm935e+OuJL4YKiprjzjkZIhutJpa+oVI3wKWIVffE V8TQkDcU+NrBOGtNb1wp0iilLB7WrW9IzXj67fcBZ/fxjPmE2hcQJi7gjaWIQ6gc39oB i2Fi36Je44boU//B08FVdk1lER5xmO3P/NXHWiWCMhRFa3m/IFkJaOfRW+kj3NzE2vKM Qqe+vsCz8pdCZz6EjAeD4qjBKHZOy40PvaZU4HU7tSOccmOLuq9sSfjYvkz4pCAhHwGW 4oWm2mSL663ETICJOtQXiMMaDgBKFYtX1OHslWLRiD2jnZ3d8FuUz67DQ/bVmbB+9soV V7+g== X-Gm-Message-State: AE9vXwPXciUj5PW6NHqw5Od1D/ZfneOOKKt0/Y3p7t0VYFVw32eIv5TuyGP9YJ9JzMj+8w== X-Received: by 10.46.9.71 with SMTP id 68mr3132092ljj.0.1472324921482; Sat, 27 Aug 2016 12:08:41 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id m17sm5062111lfg.1.2016.08.27.12.08.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Aug 2016 12:08:40 -0700 (PDT) Subject: Re: svn commit: r304911 - head/lib/libc/net To: Brooks Davis References: <201608271443.u7REhDdb091584@repo.freebsd.org> <20160827173702.GE43412@spindle.one-eyed-alien.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Sat, 27 Aug 2016 22:08:39 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160827173702.GE43412@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Tt4LPMD0prpXP3CBlblqb02DpQxjaTkmg" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 19:08:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Tt4LPMD0prpXP3CBlblqb02DpQxjaTkmg Content-Type: multipart/mixed; boundary="rtqCrIqh2CBwu13skxqrEm91pq4kO9KaC"; protected-headers="v1" From: Andrey Chernov To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304911 - head/lib/libc/net References: <201608271443.u7REhDdb091584@repo.freebsd.org> <20160827173702.GE43412@spindle.one-eyed-alien.net> In-Reply-To: <20160827173702.GE43412@spindle.one-eyed-alien.net> --rtqCrIqh2CBwu13skxqrEm91pq4kO9KaC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 27.08.2016 20:37, Brooks Davis wrote: > On Sat, Aug 27, 2016 at 02:43:13PM +0000, Andrey A. Chernov wrote: >> Author: ache >> Date: Sat Aug 27 14:43:13 2016 >> New Revision: 304911 >> URL: https://svnweb.freebsd.org/changeset/base/304911 >> >> Log: >> The formal behavior of qsort is unstable with regard to objects that= >> are equal. Unfortunately, RFC 3484 requires that otherwise equal obj= ects >> remain in the order supplied by the DNS server. The present code att= empts >> to deal with this by returning -1 for objects that are equal (i.e., >> returns that the first parameter is less then the second parameter).= >> Unfortunately, the qsort API does not state that the first parameter= >> passed in is in any particular position in the list. >=20 > Why not switch to mergesort which is stable by design? megresort() is 1) slower 2) requires additional memory allocated. --rtqCrIqh2CBwu13skxqrEm91pq4kO9KaC-- --Tt4LPMD0prpXP3CBlblqb02DpQxjaTkmg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXweU3AAoJEKUckv0MjfbKrfMH/0N12/NVs6hd1Yem46IF1Chm OwefrLI6il0H0wZDts7lb0GLzQKwRgCF1gguzmhw+HL/lVqSlmLAbizxTKSjD+VO LWuOGZVRuSuse19RAeGLj3/ydG3mjc+IW/PqCoxc5433i+auxAN6dNVbDxSXOSHU fZ6/j4Wfyu7q1Ho32koHVLOqbi3Jb5EebsiN+Ueju6o1EMWHlHdiJX76i+jRQomR M2U+NKVkXB0NeW+Bp2CVP7QgfZi+pURaA8Uj9ZjmxNOKBO8yud82jCJufmoDv97a KWiC4tNOmL++lj+hdBSMYi+ciOMIf30NDAKagbbBxhbvuhfwRdLJZNAF7WYgZ+I= =qwN8 -----END PGP SIGNATURE----- --Tt4LPMD0prpXP3CBlblqb02DpQxjaTkmg-- From owner-svn-src-head@freebsd.org Sat Aug 27 19:51:38 2016 Return-Path: Delivered-To: svn-src-head@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 88EC8B77E13; Sat, 27 Aug 2016 19:51:38 +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 377D9670; Sat, 27 Aug 2016 19:51:38 +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 u7RJpbNn005217; Sat, 27 Aug 2016 19:51:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RJpb0T005189; Sat, 27 Aug 2016 19:51:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608271951.u7RJpb0T005189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Aug 2016 19:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304918 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 19:51:38 -0000 Author: mav Date: Sat Aug 27 19:51:37 2016 New Revision: 304918 URL: https://svnweb.freebsd.org/changeset/base/304918 Log: Decode some new ATA commands found in ACS-3. MFC after: 1 week Modified: head/sys/cam/ata/ata_all.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Sat Aug 27 18:51:04 2016 (r304917) +++ head/sys/cam/ata/ata_all.c Sat Aug 27 19:51:37 2016 (r304918) @@ -88,6 +88,7 @@ ata_op_string(struct ata_cmd *cmd) } return "DSM"; case 0x08: return ("DEVICE_RESET"); + case 0x0b: return ("REQUEST_SENSE_DATA_EXT"); case 0x20: return ("READ"); case 0x24: return ("READ48"); case 0x25: return ("READ_DMA48"); @@ -120,6 +121,12 @@ ata_op_string(struct ata_cmd *cmd) case 0x47: return ("READ_LOG_DMA_EXT"); case 0x4a: return ("ZAC_MANAGEMENT_IN"); case 0x51: return ("CONFIGURE_STREAM"); + case 0x57: return ("WRITE_LOG_DMA_EXT"); + case 0x5b: return ("TRUSTED_NON_DATA"); + case 0x5c: return ("TRUSTED_RECEIVE"); + case 0x5d: return ("TRUSTED_RECEIVE_DMA"); + case 0x5e: return ("TRUSTED_SEND"); + case 0x5f: return ("TRUSTED_SEND_DMA"); case 0x60: return ("READ_FPDMA_QUEUED"); case 0x61: return ("WRITE_FPDMA_QUEUED"); case 0x63: @@ -160,9 +167,12 @@ ata_op_string(struct ata_cmd *cmd) } return ("SEP_ATTN"); case 0x70: return ("SEEK"); + case 0x77: return ("SET_DATE_TIME_EXT"); + case 0x78: return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); case 0x92: return ("DOWNLOAD_MICROCODE"); + case 0x93: return ("DOWNLOAD_MICROCODE_DMA"); case 0x9a: return ("ZAC_MANAGEMENT_OUT"); case 0xa0: return ("PACKET"); case 0xa1: return ("ATAPI_IDENTIFY"); @@ -180,6 +190,7 @@ ata_op_string(struct ata_cmd *cmd) } return ("SMART"); case 0xb1: return ("DEVICE CONFIGURATION"); + case 0xb4: return ("SANITIZE_DEVICE"); case 0xc0: return ("CFA_ERASE"); case 0xc4: return ("READ_MUL"); case 0xc5: return ("WRITE_MUL"); From owner-svn-src-head@freebsd.org Sat Aug 27 20:33:21 2016 Return-Path: Delivered-To: svn-src-head@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 3377CB77963; Sat, 27 Aug 2016 20:33:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03B7EBB3; Sat, 27 Aug 2016 20:33:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RKXKv7022375; Sat, 27 Aug 2016 20:33:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RKXKHu022374; Sat, 27 Aug 2016 20:33:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608272033.u7RKXKHu022374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 27 Aug 2016 20:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304920 - head/contrib/ncurses/ncurses/tinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 20:33:21 -0000 Author: dim Date: Sat Aug 27 20:33:19 2016 New Revision: 304920 URL: https://svnweb.freebsd.org/changeset/base/304920 Log: In ncurses baudrate definitions, avoid warnings about implicit conversions from int to short changing the values. This applies to B38400 and higher, since their values do not fit into a short. However, since the wrapped values are still unique, and they only serve as keys, there is no problem in adding a cast to silence the warnings. This also avoids changing the ABI, which would happen if we changed NCURSES_OSPEED to int. Discussed with: Thomas Dickey MFC after: 1 week Modified: head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c Modified: head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c ============================================================================== --- head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c Sat Aug 27 20:08:34 2016 (r304919) +++ head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c Sat Aug 27 20:33:19 2016 (r304920) @@ -94,7 +94,7 @@ struct speed { int sp; /* the actual speed */ }; -#define DATA(number) { B##number, number } +#define DATA(number) { (NCURSES_OSPEED)B##number, number } static struct speed const speeds[] = { From owner-svn-src-head@freebsd.org Sat Aug 27 22:43:42 2016 Return-Path: Delivered-To: svn-src-head@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 A605BB77C98; Sat, 27 Aug 2016 22:43:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7918F2F3; Sat, 27 Aug 2016 22:43:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7RMhfnX071143; Sat, 27 Aug 2016 22:43:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RMhfKH071142; Sat, 27 Aug 2016 22:43:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201608272243.u7RMhfKH071142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 27 Aug 2016 22:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304927 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 22:43:42 -0000 Author: mjg Date: Sat Aug 27 22:43:41 2016 New Revision: 304927 URL: https://svnweb.freebsd.org/changeset/base/304927 Log: vfs: provide a common exit point in namei for error cases This shortens the function, adds the SDT_PROBE use for error cases and consistenly unrefs rootdir last. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Aug 27 22:23:10 2016 (r304926) +++ head/sys/kern/vfs_lookup.c Sat Aug 27 22:43:41 2016 (r304927) @@ -295,21 +295,15 @@ namei(struct nameidata *ndp) if (error != 0) { if (dp != NULL) vrele(dp); - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); - return (error); + goto out; } SDT_PROBE3(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf, cnp->cn_flags); for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) { - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); - SDT_PROBE2(vfs, namei, lookup, return, error, NULL); - return (error); - } + if (error != 0) + goto out; /* * If not a symbolic link, we're done. */ @@ -383,18 +377,16 @@ namei(struct nameidata *ndp) if (*(cnp->cn_nameptr) == '/') { vrele(dp); error = namei_handle_root(ndp, &dp); - if (error != 0) { - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); - return (error); - } + if (error != 0) + goto out; } } - vrele(ndp->ni_rootdir); - namei_cleanup_cnp(cnp); vput(ndp->ni_vp); ndp->ni_vp = NULL; vrele(ndp->ni_dvp); +out: + vrele(ndp->ni_rootdir); + namei_cleanup_cnp(cnp); SDT_PROBE2(vfs, namei, lookup, return, error, NULL); return (error); } From owner-svn-src-head@freebsd.org Sat Aug 27 23:03:24 2016 Return-Path: Delivered-To: svn-src-head@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 DA14FB771AC; Sat, 27 Aug 2016 23:03:24 +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 9E327FD0; Sat, 27 Aug 2016 23:03:24 +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 u7RN3NKT078508; Sat, 27 Aug 2016 23:03:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7RN3N0D078505; Sat, 27 Aug 2016 23:03:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608272303.u7RN3N0D078505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 27 Aug 2016 23:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 23:03:25 -0000 Author: kib Date: Sat Aug 27 23:03:23 2016 New Revision: 304928 URL: https://svnweb.freebsd.org/changeset/base/304928 Log: Do not obliterate errno value in the main thread during ptrace(2) call on x86. Since ptrace(2) syscall can return -1 for non-error situations, libc wrappers set errno to 0 before performing the syscall, as the service to the caller. On both i386 and amd64, the errno symbol was directly referenced, which only works correctly in single-threaded process. Change assembler wrappers for ptrace(2) to get current thread errno location by calling __error(). Allow __error interposing, as currently allowed in cerror(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/amd64/sys/ptrace.S head/lib/libc/i386/sys/ptrace.S head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/amd64/sys/ptrace.S ============================================================================== --- head/lib/libc/amd64/sys/ptrace.S Sat Aug 27 22:43:41 2016 (r304927) +++ head/lib/libc/amd64/sys/ptrace.S Sat Aug 27 23:03:23 2016 (r304928) @@ -38,14 +38,16 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" + .globl CNAME(__error) + .type CNAME(__error),@function + ENTRY(ptrace) - xorl %eax,%eax #ifdef PIC - movq PIC_GOT(CNAME(errno)),%r8 - movl %eax,(%r8) + callq PIC_PLT(CNAME(__error)) #else - movl %eax,CNAME(errno)(%rip) + callq CNAME(__error) #endif + movl $0,(%rax) mov $SYS_ptrace,%eax KERNCALL jb HIDENAME(cerror) Modified: head/lib/libc/i386/sys/ptrace.S ============================================================================== --- head/lib/libc/i386/sys/ptrace.S Sat Aug 27 22:43:41 2016 (r304927) +++ head/lib/libc/i386/sys/ptrace.S Sat Aug 27 23:03:23 2016 (r304928) @@ -38,16 +38,18 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" + .globl CNAME(__error) + .type CNAME(__error),@function + ENTRY(ptrace) - xorl %eax,%eax #ifdef PIC - PIC_PROLOGUE - movl PIC_GOT(CNAME(errno)),%edx - movl %eax,(%edx) - PIC_EPILOGUE + PIC_PROLOGUE + call PIC_PLT(CNAME(__error)) + PIC_EPILOGUE #else - movl %eax,CNAME(errno) + call CNAME(__error) #endif + movl $0,(%eax) mov $SYS_ptrace,%eax KERNCALL jb HIDENAME(cerror) Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Sat Aug 27 22:43:41 2016 (r304927) +++ head/lib/libc/sys/ptrace.2 Sat Aug 27 23:03:23 2016 (r304928) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 28, 2016 +.Dd August 28, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -906,7 +906,13 @@ to return \-1 as a non-error value; to disambiguate, .Va errno -can be set to 0 before the call and checked afterwards. +is set to 0 in the libc wrapper for the +.Fn ptrace +system call and +.Fn ptrace +callers can reliably check +.Va errno +for non-zero value afterwards. .Sh ERRORS The .Fn ptrace