Re: svn commit: r221972 - head/sys/geom/part
On 23.05.2011 6:29, Warner Losh wrote: Looking at one of my flash drives that shows the problem: da0: 15423MB (31588351 512 byte sectors: 255H 63S/T 1966C) GEOM_PART: partition 1 has end offset beyond last LBA: 31588350 31588325 So why does gpart think the last LBA is 25 less than it really is. Well, let's do some sanity checks first. fdisk -s da0 tells us: I'm pretty sure this problem is due to a bug in g_part_mbr.c: basetable-gpt_last = msize - (msize % basetable-gpt_sectors) - 1; This is wrong, or at least it is a widely disregarded part of what makes up an MBR. When I correct the size, the geom code is fine. There's no requirement in MBR that a partition end of any particular boundary, although sometimes you'll find mistaken documentation that suggests this is the case. Reading between the lines at http://www.boot-us.com/gloss03.htm suggests that this restriction was only for disks 8GB in size (from the fact it said that all the partitions can be described with the CHS fields). This is one of the things I learned when I tried to make fdisk enforce that: this isn't a requirement of MBR as it is implemented in the wild today. There is another opinion: http://www.boot-us.com/gloss02.htm There is the convention that partitions should always start and end on *cylinder boundaries*. but Linux and Windows NT/2000/XP/2003/Vista/2008/7 seem to have no problems when partitions do not start or end on cylinder boundaries. However other operating systems (e.g. DOS) expect that this convention is obeyed. What way will we choose? I prefer to: leave the choice to the user how partition should be aligned, and remove automatic alignment to track boundaries from MBR (and probably from all other schemes). -- WBR, Andrey V. Elsukov -- WBR, Andrey V. Elsukov signature.asc Description: OpenPGP digital signature
Re: svn commit: r221972 - head/sys/geom/part
In message 4dd9f0a3@freebsd.org, Andrey V. Elsukov writes: There is another opinion: http://www.boot-us.com/gloss02.htm There is the convention that partitions should always start and end on *= cylinder boundaries*. It is actually more weird than that: The rule is that the starting or ending head of one of the four slices represent the number of heads used to access the drive, and ditto for sectors. This requirement dates back to smart BIOS'es and ST-506 drives which couldn't ask the drive for its geometry. It has been revived a couple of times, when people got creative around the various silly sizes, most notably the 524MB limit. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r222094 - head/share/misc
On Sun, 22.05.2011 at 20:16:47 +1000, Edwin Groothuis wrote: On 22/05/2011, at 7:29 PM, Ulrich Spörlein wrote: On Thu, 19.05.2011 at 13:09:39 +, Edwin Groothuis wrote: Author: edwin Date: Thu May 19 13:09:39 2011 New Revision: 222094 URL: http://svn.freebsd.org/changeset/base/222094 Log: Put AN back after finding out that tzsetup(1) will complain that it doesn't exist. It will be removed again once the tzdata distribution files have been updated with the replacements for AN. Wouldn't it be better to have tzsetup use iso3166.tab from the tzdata distribution, which is mostly guaranteed to be in sync with zone.tab? Which opens a different can of worms. Duplicate file, with semi-similar contents. Whenever there are changes in the distribution of the tzdata iso3166.tab equivalent file, I check if they are in the /usr/share/misc equivalent file. A warning to that file should be added that tzsetup uses it and that they always should check tzsetup functionality before commiting it. This seems way too brittle, as can be seen by random people going in and updating our iso3166 file. I'd rather take a tiny duplication of files than manual fixups needed to unbreak installing. AFAICS only tzsetup and sysinstall depend on /usr/share/misc/iso3166, if we change tzsetup to use the iso list from tzdata and since sysinstall is on the chopping block we could then simply remove our iso3166 list. And as for duplicated files, have you looked at regdomain.xml and ieee80211_regdomain.h? Just saying ... Uli ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221743 - in head/sys: amd64/conf i386/conf
on 10/05/2011 19:44 Jung-uk Kim said the following: Author: jkim Date: Tue May 10 16:44:16 2011 New Revision: 221743 URL: http://svn.freebsd.org/changeset/base/221743 Log: Add SC_PIXEL_MODE to GENERIC for amd64 and i386. Requested by: many What about options VESA ? Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222210 - head/usr.bin/gzip
Author: delphij Date: Mon May 23 09:02:44 2011 New Revision: 10 URL: http://svn.freebsd.org/changeset/base/10 Log: Diff reduction against NetBSD. The most notable change is to zdiff(1) to handle more file formats including bzip2 and xz. MFC after:2 weeks Modified: head/usr.bin/gzip/Makefile head/usr.bin/gzip/gzip.c head/usr.bin/gzip/zdiff head/usr.bin/gzip/zdiff.1 head/usr.bin/gzip/zuncompress.c Modified: head/usr.bin/gzip/Makefile == --- head/usr.bin/gzip/Makefile Mon May 23 01:17:30 2011(r09) +++ head/usr.bin/gzip/Makefile Mon May 23 09:02:44 2011(r10) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2006/05/12 02:01:15 mrg Exp $ +# $NetBSD: Makefile,v 1.13 2009/04/14 22:15:20 lukem Exp $ # $FreeBSD$ .include bsd.own.mk Modified: head/usr.bin/gzip/gzip.c == --- head/usr.bin/gzip/gzip.cMon May 23 01:17:30 2011(r09) +++ head/usr.bin/gzip/gzip.cMon May 23 09:02:44 2011(r10) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $*/ +/* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $*/ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -31,7 +31,7 @@ #ifndef lint __COPYRIGHT(@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\ Matthew R. Green. All rights reserved.); -__RCSID($FreeBSD$); +__FBSDID($FreeBSD$); #endif /* not lint */ /* @@ -146,7 +146,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = FreeBSD gzip 20100407; +static const char gzip_version[] = FreeBSD gzip 20110523; #ifndef SMALL static const char gzip_copyright[] = \ @@ -314,7 +314,7 @@ main(int argc, char **argv) dflag = cflag = 1; #ifdef SMALL -#define OPT_LIST 123456789cdhltV +#define OPT_LIST 123456789cdhlV #else #define OPT_LIST 123456789acdfhklLNnqrS:tVv #endif @@ -918,6 +918,7 @@ gz_uncompress(int in, int out, char *pre case Z_BUF_ERROR: if (z.avail_out 0 !done_reading) continue; + case Z_STREAM_END: case Z_OK: break; Modified: head/usr.bin/gzip/zdiff == --- head/usr.bin/gzip/zdiff Mon May 23 01:17:30 2011(r09) +++ head/usr.bin/gzip/zdiff Mon May 23 09:02:44 2011(r10) @@ -1,10 +1,12 @@ #!/bin/sh - # -# $NetBSD: zdiff,v 1.3 2004/03/29 10:01:00 wiz Exp $ +# $NetBSD: zdiff,v 1.5 2010/04/14 20:30:28 joerg Exp $ +# # $OpenBSD: zdiff,v 1.2 2003/07/29 07:42:44 otto Exp $ # #- # Copyright (c) 2003 Todd C. Miller todd.mil...@courtesan.com +# Copyright (c) 2010 Joerg Sonnenberger jo...@netbsd.org # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -31,7 +33,57 @@ case $0 in *) prog=diff ;; esac -USAGE=usage: z$prog [options] file1 [file2] +USAGE=usage: $0 [options] file1 [file2] + +check_suffix() { + case $1 in + *[._-][Zz]) + setvar $2 ${1%??} + setvar $3 gzip -cdqf + ;; + *[._-]bz) + setvar $2 ${1%???} + setvar $3 bzip2 -cdqf + ;; + *[._-]gz) + setvar $2 ${1%???} + setvar $3 gzip -cdqf + ;; + *[._-]xz) + setvar $2 ${1%???} + setvar $3 xz -cdqf + ;; + *[._-]bz2) + setvar $2 ${1%} + setvar $3 bzip2 -cdqf + ;; + *[._-]lzma) + setvar $2 ${1%?} + setvar $3 xz -cdqf + ;; + *.t[ag]z) + setvar $2 ${1%??}ar + setvar $3 gzip -cdqf + ;; + *.tbz) + setvar $2 ${1%??}ar + setvar $3 bzip2 -cdqf + ;; + *.tbz2) + setvar $2 ${1%???}ar + setvar $3 bzip2 -cdqf + ;; + *.t[lx]z) + setvar $2 ${1%??}ar + setvar $3 xz -cdqf + ;; + *) + setvar $2 $1 + setvar $3 + ;; + esac +} + # Pull out any command line flags so we can pass them to diff/cmp # XXX - assumes there is no optarg @@ -42,6 +94,9 @@ while test $# -ne 0; do shift break ;; + -) + break + ;; -*) flags=$flags $1
svn commit: r222211 - head/usr.bin/gzip
Author: delphij Date: Mon May 23 09:40:21 2011 New Revision: 11 URL: http://svn.freebsd.org/changeset/base/11 Log: Match symbolic link handling behavior with GNU gzip, bzip2 and xz: When we are operating on a symbolic link pointing to an existing file, bail out by default, but go ahead if -f is specified. Submitted by: arundel MFC after:2 weeks Modified: head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.1 == --- head/usr.bin/gzip/gzip.1Mon May 23 09:02:44 2011(r10) +++ head/usr.bin/gzip/gzip.1Mon May 23 09:40:21 2011(r11) @@ -25,7 +25,7 @@ .\ SUCH DAMAGE. .\ .\ $FreeBSD$ -.Dd April 27, 2010 +.Dd May 23, 2011 .Dt GZIP 1 .Os .Sh NAME @@ -127,9 +127,9 @@ stream, leaving files intact. This option selects decompression rather than compression. .It Fl f , -force This option turns on force mode. -This allows files with multiple links, overwriting of pre-existing -files, reading from or writing to a terminal, and when combined -with the +This allows files with multiple links, symbolic links to regular files, +overwriting of pre-existing files, reading from or writing to a terminal, +and when combined with the .Fl c option, allowing non-compressed data to pass through unchanged. .It Fl h , -help Modified: head/usr.bin/gzip/gzip.c == --- head/usr.bin/gzip/gzip.cMon May 23 09:02:44 2011(r10) +++ head/usr.bin/gzip/gzip.cMon May 23 09:40:21 2011(r11) @@ -1782,7 +1782,7 @@ handle_pathname(char *path) } retry: - if (stat(path, sb) != 0) { + if (stat(path, sb) != 0 || (fflag == 0 lstat(path, sb) != 0)) { /* lets try path.gz if we're decompressing */ if (dflag s == NULL errno == ENOENT) { len = strlen(path); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r222094 - head/share/misc
On 23/05/2011, at 6:00 PM, Ulrich Spörlein wrote: On Sun, 22.05.2011 at 20:16:47 +1000, Edwin Groothuis wrote: On 22/05/2011, at 7:29 PM, Ulrich Spörlein wrote: On Thu, 19.05.2011 at 13:09:39 +, Edwin Groothuis wrote: Author: edwin Date: Thu May 19 13:09:39 2011 New Revision: 222094 URL: http://svn.freebsd.org/changeset/base/222094 Log: Put AN back after finding out that tzsetup(1) will complain that it doesn't exist. It will be removed again once the tzdata distribution files have been updated with the replacements for AN. Wouldn't it be better to have tzsetup use iso3166.tab from the tzdata distribution, which is mostly guaranteed to be in sync with zone.tab? Which opens a different can of worms. Duplicate file, with semi-similar contents. Whenever there are changes in the distribution of the tzdata iso3166.tab equivalent file, I check if they are in the /usr/share/misc equivalent file. A warning to that file should be added that tzsetup uses it and that they always should check tzsetup functionality before commiting it. This seems way too brittle, as can be seen by random people going in and updating our iso3166 file. I'd rather take a tiny duplication of files than manual fixups needed to unbreak installing. AFAICS only tzsetup and sysinstall depend on /usr/share/misc/iso3166, That are only the tools in the base system that you know about. It has been part of the base system long enough that people think they can rely on it. Some of my tools do, for sure. Edwin___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r222183 - head/lib/clang
On May 22, 2011, at 10:01 PM, Warner Losh wrote: On May 22, 2011, at 3:30 PM, Mark Linimon wrote: On Sun, May 22, 2011 at 10:22:56PM +0200, Roman Divacky wrote: The problem here is deeper in my opinion. What FreeBSD calls amd64 the rest of the world (ie. linux) calls x86_64, I think that instead of this we should teach llvm/clang about amd64. Maybe as a FreeBSD-only diff. If we move away from amd64, we are going to need a _substantial_ amount of work on ports. Yea. That's why I think, although I'd like to move away from it, we're stuck with amd64 for both MACHINE and MACHINE_ARCH for quite some time. In that case, we'll just have to configure clang the same way we configure gcc with the x86_64 monicker. Is there an authoritative source for these names? I am not quite sure what led to the confusion in first place but I guess it's the oh Intel is doing EMT64 let's not call this amd kind of thing. I seem to remember that apart from the linux kernel and OSX most others incl. windows, java and sun used to call it amd64 as well when it came to technical things. So I am not exactly sure why this regularly comes up but I'd assume it's because of what linux calls it must be right? I admit that it's confusing to got to x86-64.org and see it called the amd64 architecture. I am sure Peter and David know a lot more about this. Despite remembering Dragonfly having done the change I cannot see FreeBSD doing the same in a short timeframe, and yet I have no idea why we wanted to? /bz The color shall be red. -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r222183 - head/lib/clang
Mark Linimon ha scritto: If we move away from amd64, we are going to need a _substantial_ amount of work on ports. Yup, as we constantly need to patch ports to correctly support amd64. It was during my fighting with gmp (and mozilla) configure that I discovered the existence of the Templates/config.[guess|sub] hack. It's a no-win choice :-( -- Alex Dupre ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221743 - in head/sys: amd64/conf i386/conf
Andriy Gapon a...@freebsd.org writes: on 10/05/2011 19:44 Jung-uk Kim said the following: Author: jkim Date: Tue May 10 16:44:16 2011 New Revision: 221743 URL: http://svn.freebsd.org/changeset/base/221743 Log: Add SC_PIXEL_MODE to GENERIC for amd64 and i386. Requested by: many What about options VESA ? Doesn't vesa.ko module work for you? It should be enough for graphic modes, VGL(3) and sysutils/jfbterm to use with GENERIC kernel. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221743 - in head/sys: amd64/conf i386/conf
on 23/05/2011 16:11 Pan Tsu said the following: Andriy Gapon a...@freebsd.org writes: on 10/05/2011 19:44 Jung-uk Kim said the following: Author: jkim Date: Tue May 10 16:44:16 2011 New Revision: 221743 URL: http://svn.freebsd.org/changeset/base/221743 Log: Add SC_PIXEL_MODE to GENERIC for amd64 and i386. Requested by: many What about options VESA ? Doesn't vesa.ko module work for you? It should be enough for graphic modes, VGL(3) and sysutils/jfbterm to use with GENERIC kernel. Right you are! Sorry for the noise. -- Andriy Gapon ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222213 - head/sys/netinet
Author: rwatson Date: Mon May 23 13:51:57 2011 New Revision: 13 URL: http://svn.freebsd.org/changeset/base/13 Log: A number of quite incremental refinements to struct inpcbinfo's definition: (1) Add a locking guide for inpcbinfo. (2) Annotate inpcbinfo fields with synchronisation information; not all annotations are 100% satisfactory. (3) Reorder inpcbinfo fields so that the lock is at the head of the structure, and close to fields it protects. (4) Sort fields that will eventually be hashlock/pcbgroup-related together even though they remain locked by ipi_lock for now. Reviewed by: bz Sponsored by: Juniper Networks X-MFC after: KBI analysis required Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h == --- head/sys/netinet/in_pcb.h Mon May 23 13:02:04 2011(r12) +++ head/sys/netinet/in_pcb.h Mon May 23 13:51:57 2011(r13) @@ -1,8 +1,12 @@ /*- * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. + * Copyright (c) 2010-2011 Juniper Networks, Inc. * All rights reserved. * + * Portions of this software were developed by Robert N. M. Watson under + * contract to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -260,53 +264,70 @@ struct inpcbport { u_short phd_port; }; -/* +/*- * Global data structure for each high-level protocol (UDP, TCP, ...) in both * IPv4 and IPv6. Holds inpcb lists and information for managing them. + * + * Each pcbinfo is protected by ipi_lock, covering mutable global fields (such + * as the global pcb list) and hashed lookup tables. The lock order is: + * + *ipi_lock (before) inpcb locks + * + * Locking key: + * + * (c) Constant or nearly constant after initialisation + * (g) Locked by ipi_lock + * (h) Read using either ipi_lock or inpcb lock; write requires both. + * (x) Synchronisation properties poorly defined */ struct inpcbinfo { /* -* Global list of inpcbs on the protocol. +* Global lock protecting global inpcb list, inpcb count, hash tables, +* etc. */ - struct inpcbhead*ipi_listhead; - u_intipi_count; + struct rwlockipi_lock; /* -* Global hash of inpcbs, hashed by local and foreign addresses and -* port numbers. +* Global list of inpcbs on the protocol. */ - struct inpcbhead*ipi_hashbase; - u_long ipi_hashmask; + struct inpcbhead*ipi_listhead; /* (g) */ + u_intipi_count; /* (g) */ /* -* Global hash of inpcbs, hashed by only local port number. +* Generation count -- incremented each time a connection is allocated +* or freed. */ - struct inpcbporthead*ipi_porthashbase; - u_long ipi_porthashmask; + u_quad_t ipi_gencnt;/* (g) */ /* * Fields associated with port lookup and allocation. */ - u_short ipi_lastport; - u_short ipi_lastlow; - u_short ipi_lasthi; + u_short ipi_lastport; /* (x) */ + u_short ipi_lastlow; /* (x) */ + u_short ipi_lasthi;/* (x) */ /* * UMA zone from which inpcbs are allocated for this protocol. */ - struct uma_zone*ipi_zone; + struct uma_zone*ipi_zone; /* (c) */ /* -* Generation count--incremented each time a connection is allocated -* or freed. +* Global hash of inpcbs, hashed by local and foreign addresses and +* port numbers. */ - u_quad_t ipi_gencnt; - struct rwlockipi_lock; + struct inpcbhead*ipi_hashbase; /* (g) */ + u_long ipi_hashmask; /* (g) */ + + /* +* Global hash of inpcbs, hashed by only local port number. +*/ + struct inpcbporthead*ipi_porthashbase; /* (g) */ + u_long ipi_porthashmask; /* (g) */ /* * Pointer to network stack instance */ - struct vnet *ipi_vnet; + struct vnet *ipi_vnet; /* (c) */ /* * general use 2 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221972 - head/sys/geom/part
On May 22, 2011, at 11:29 PM, Andrey V. Elsukov wrote: On 23.05.2011 6:29, Warner Losh wrote: Looking at one of my flash drives that shows the problem: da0: 15423MB (31588351 512 byte sectors: 255H 63S/T 1966C) GEOM_PART: partition 1 has end offset beyond last LBA: 31588350 31588325 So why does gpart think the last LBA is 25 less than it really is. Well, let's do some sanity checks first. fdisk -s da0 tells us: I'm pretty sure this problem is due to a bug in g_part_mbr.c: basetable-gpt_last = msize - (msize % basetable-gpt_sectors) - 1; This is wrong, or at least it is a widely disregarded part of what makes up an MBR. When I correct the size, the geom code is fine. There's no requirement in MBR that a partition end of any particular boundary, although sometimes you'll find mistaken documentation that suggests this is the case. Reading between the lines at http://www.boot-us.com/gloss03.htm suggests that this restriction was only for disks 8GB in size (from the fact it said that all the partitions can be described with the CHS fields). This is one of the things I learned when I tried to make fdisk enforce that: this isn't a requirement of MBR as it is implemented in the wild today. There is another opinion: http://www.boot-us.com/gloss02.htm There is the convention that partitions should always start and end on *cylinder boundaries*. The current code doesn't do that. The current code just ends on a track boundary... but Linux and Windows NT/2000/XP/2003/Vista/2008/7 seem to have no problems when partitions do not start or end on cylinder boundaries. However other operating systems (e.g. DOS) expect that this convention is obeyed. What way will we choose? We choose the way that works and not bother with alignment. It is an artifact of the 8GB disks and hasn't really been necessary for about 15 years now. I prefer to: leave the choice to the user how partition should be aligned, and remove automatic alignment to track boundaries from MBR (and probably from all other schemes). I think we agree. Allow, but do not force, alignment. Warner -- WBR, Andrey V. Elsukov -- WBR, Andrey V. Elsukov ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r222183 - head/lib/clang
On Monday, May 23, 2011 8:05:12 am Bjoern A. Zeeb wrote: On May 22, 2011, at 10:01 PM, Warner Losh wrote: On May 22, 2011, at 3:30 PM, Mark Linimon wrote: On Sun, May 22, 2011 at 10:22:56PM +0200, Roman Divacky wrote: The problem here is deeper in my opinion. What FreeBSD calls amd64 the rest of the world (ie. linux) calls x86_64, I think that instead of this we should teach llvm/clang about amd64. Maybe as a FreeBSD-only diff. If we move away from amd64, we are going to need a _substantial_ amount of work on ports. Yea. That's why I think, although I'd like to move away from it, we're stuck with amd64 for both MACHINE and MACHINE_ARCH for quite some time. In that case, we'll just have to configure clang the same way we configure gcc with the x86_64 monicker. Is there an authoritative source for these names? I am not quite sure what led to the confusion in first place but I guess it's the oh Intel is doing EMT64 let's not call this amd kind of thing. I seem to remember that apart from the linux kernel and OSX most others incl. windows, java and sun used to call it amd64 as well when it came to technical things. So I am not exactly sure why this regularly comes up but I'd assume it's because of what linux calls it must be right? I admit that it's confusing to got to x86-64.org and see it called the amd64 architecture. I am sure Peter and David know a lot more about this. Despite remembering Dragonfly having done the change I cannot see FreeBSD doing the same in a short timeframe, and yet I have no idea why we wanted to? AMD changed the name. It used to be 'amd64' and we used that name as result. Later they changed it to x86-64, possibly because Linux and the GNU folks had adopted that instead of 'amd64'. Renaming it now would be a PITA. -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222215 - in head/sys: netinet netinet6
Author: rwatson Date: Mon May 23 15:23:18 2011 New Revision: 15 URL: http://svn.freebsd.org/changeset/base/15 Log: Move from passing a wildcard boolean to a general set up lookup flags into in_pcb_lport(), in_pcblookup_local(), and in_pcblookup_hash(), and similarly for IPv6 functions. In the future, we would like to support other flags relating to locking strategy. This change doesn't appear to modify the KBI in practice, as callers already passed in INPLOOKUP_WILDCARD rather than a simple boolean. MFC after: 3 weeks Reviewed by:bz Sponsored by: Juniper Networks, Inc. Modified: head/sys/netinet/in_pcb.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Mon May 23 14:16:45 2011(r14) +++ head/sys/netinet/in_pcb.c Mon May 23 15:23:18 2011(r15) @@ -329,7 +329,7 @@ in_pcbbind(struct inpcb *inp, struct soc #if defined(INET) || defined(INET6) int in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, -struct ucred *cred, int wild) +struct ucred *cred, int lookupflags) { struct inpcbinfo *pcbinfo; struct inpcb *tmpinp; @@ -424,14 +424,14 @@ in_pcb_lport(struct inpcb *inp, struct i #ifdef INET6 if ((inp-inp_vflag INP_IPV6) != 0) tmpinp = in6_pcblookup_local(pcbinfo, - inp-in6p_laddr, lport, wild, cred); + inp-in6p_laddr, lport, lookupflags, cred); #endif #if defined(INET) defined(INET6) else #endif #ifdef INET tmpinp = in_pcblookup_local(pcbinfo, laddr, - lport, wild, cred); + lport, lookupflags, cred); #endif } while (tmpinp != NULL); @@ -464,7 +464,7 @@ in_pcbbind_setup(struct inpcb *inp, stru struct inpcbinfo *pcbinfo = inp-inp_pcbinfo; struct in_addr laddr; u_short lport = 0; - int wild = 0, reuseport = (so-so_options SO_REUSEPORT); + int lookupflags = 0, reuseport = (so-so_options SO_REUSEPORT); int error; /* @@ -480,7 +480,7 @@ in_pcbbind_setup(struct inpcb *inp, stru if (nam != NULL laddr.s_addr != INADDR_ANY) return (EINVAL); if ((so-so_options (SO_REUSEADDR|SO_REUSEPORT)) == 0) - wild = INPLOOKUP_WILDCARD; + lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip4(cred, laddr)) != 0) return (error); @@ -561,7 +561,7 @@ in_pcbbind_setup(struct inpcb *inp, stru return (EADDRINUSE); } t = in_pcblookup_local(pcbinfo, sin-sin_addr, - lport, wild, cred); + lport, lookupflags, cred); if (t (t-inp_flags INP_TIMEWAIT)) { /* * XXXRW: If an incpb has had its timewait @@ -590,7 +590,7 @@ in_pcbbind_setup(struct inpcb *inp, stru if (*lportp != 0) lport = *lportp; if (lport == 0) { - error = in_pcb_lport(inp, laddr, lport, cred, wild); + error = in_pcb_lport(inp, laddr, lport, cred, lookupflags); if (error != 0) return (error); @@ -1307,7 +1307,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo #define INP_LOOKUP_MAPPED_PCB_COST 3 struct inpcb * in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, -u_short lport, int wild_okay, struct ucred *cred) +u_short lport, int lookupflags, struct ucred *cred) { struct inpcb *inp; #ifdef INET6 @@ -1317,9 +1317,12 @@ in_pcblookup_local(struct inpcbinfo *pcb #endif int wildcard; + KASSERT((lookupflags ~(INPLOOKUP_WILDCARD)) == 0, + (%s: invalid lookup flags %d, __func__, lookupflags)); + INP_INFO_LOCK_ASSERT(pcbinfo); - if (!wild_okay) { + if ((lookupflags INPLOOKUP_WILDCARD) == 0) { struct inpcbhead *head; /* * Look for an unconnected (wildcard foreign addr) PCB that @@ -1425,13 +1428,16 @@ in_pcblookup_local(struct inpcbinfo *pcb */ struct inpcb * in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, -u_int fport_arg, struct in_addr laddr, u_int lport_arg, int wildcard, +u_int fport_arg, struct in_addr laddr, u_int lport_arg, int lookupflags, struct ifnet *ifp) { struct inpcbhead *head; struct inpcb *inp, *tmpinp; u_short fport = fport_arg, lport = lport_arg; + KASSERT((lookupflags ~(INPLOOKUP_WILDCARD)) == 0, + (%s: invalid lookup flags %d, __func__, lookupflags)); +
svn commit: r222216 - head/sys/kern
Author: jh Date: Mon May 23 16:40:44 2011 New Revision: 16 URL: http://svn.freebsd.org/changeset/base/16 Log: In init_dynamic_kenv(), ignore environment strings exceeding the KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer overflow in getenv(). Currenly loader(8) doesn't limit the length of environment strings. PR: kern/132104 MFC after:1 month Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c == --- head/sys/kern/kern_environment.cMon May 23 15:23:18 2011 (r15) +++ head/sys/kern/kern_environment.cMon May 23 16:40:44 2011 (r16) @@ -225,13 +225,19 @@ static void init_dynamic_kenv(void *data __unused) { char *cp; - int len, i; + size_t len; + int i; kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; + if (len KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + printf(WARNING: too long kenv string, ignoring %s\n, + cp); + continue; + } if (i KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221972 - head/sys/geom/part
I don't know enough about the topic to know what's best, however what I would like to add to the conversation is that it would be nice if we did it the same way that windows and linux do it, because otherwise you end up with messages like these: GEOM: ad0s2: geometry does not match label (255h,63s != 16h,63s). GEOM: ad0s3: geometry does not match label (255h,63s != 16h,63s). when you use a windows or linux tool to partition your disk before installing FreeBSD. I have tried various combinations of tools and methods of slicing the disk and never found a way to avoid error messages one way or another, so I just ignore them now. If there is truly no reason to do it one way or the other, can we please just do it the way that everyone else does it? Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222217 - head/sys/netinet
Author: rwatson Date: Mon May 23 19:32:02 2011 New Revision: 17 URL: http://svn.freebsd.org/changeset/base/17 Log: Continue to refine inpcb reference counting and locking, in preparation for reworking of inpcbinfo locking: (1) Convert inpcb reference counting from manually manipulated integers to the refcount(9) KPI. This allows the refcount to be managed atomically with an inpcb read lock rather than write lock, or even with no inpcb lock at all. As a result, in_pcbref() also no longer requires an inpcb lock, so can be performed solely using the lock used to look up an inpcb. (2) Shift more inpcb freeing activity from the in_pcbrele() context (via in_pcbfree_internal) to the explicit in_pcbfree() context. This means that the inpcb refcount is increasingly used only to maintain memory stability, not actually defer the clean up of inpcb protocol parts. This is desirable as many of those protocol parts required the pcbinfo lock, which we'd like not to acquire in in_pcbrele() contexts. Document this in comments better. (3) Introduce new read-locked and write-locked in_pcbrele() variations, in_pcbrele_rlocked() and in_pcbrele_wlocked(), which allow the inpcb to be properly unlocked as needed. in_pcbrele() is a wrapper around the latter, and should probably go away at some point. This makes it easier to use this weak reference model when holding only a read lock, as will happen in the future. This may well be safe to MFC, but some more KBI analysis is required. Reviewed by:bz MFC after: 3 weeks Sponsored by: Juniper Networks, Inc. Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Mon May 23 16:40:44 2011(r16) +++ head/sys/netinet/in_pcb.c Mon May 23 19:32:02 2011(r17) @@ -2,8 +2,12 @@ * Copyright (c) 1982, 1986, 1991, 1993, 1995 * The Regents of the University of California. * Copyright (c) 2007-2009 Robert N. M. Watson + * Copyright (c) 2010-2011 Juniper Networks, Inc. * All rights reserved. * + * Portions of this software were developed by Robert N. M. Watson under + * contract to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -50,6 +54,7 @@ __FBSDID($FreeBSD$); #include sys/socketvar.h #include sys/priv.h #include sys/proc.h +#include sys/refcount.h #include sys/jail.h #include sys/kernel.h #include sys/sysctl.h @@ -287,7 +292,7 @@ in_pcballoc(struct socket *so, struct in #endif INP_WLOCK(inp); inp-inp_gencnt = ++pcbinfo-ipi_gencnt; - inp-inp_refcount = 1; /* Reference from the inpcbinfo */ + refcount_init(inp-inp_refcount, 1); /* Reference from inpcbinfo */ #if defined(IPSEC) || defined(MAC) out: if (error != 0) { @@ -1028,56 +1033,18 @@ in_pcbdetach(struct inpcb *inp) } /* - * in_pcbfree_internal() frees an inpcb that has been detached from its - * socket, and whose reference count has reached 0. It will also remove the - * inpcb from any global lists it might remain on. - */ -static void -in_pcbfree_internal(struct inpcb *inp) -{ - struct inpcbinfo *ipi = inp-inp_pcbinfo; - - KASSERT(inp-inp_socket == NULL, (%s: inp_socket != NULL, __func__)); - KASSERT(inp-inp_refcount == 0, (%s: refcount !0, __func__)); - - INP_INFO_WLOCK_ASSERT(ipi); - INP_WLOCK_ASSERT(inp); - -#ifdef IPSEC - if (inp-inp_sp != NULL) - ipsec_delete_pcbpolicy(inp); -#endif /* IPSEC */ - inp-inp_gencnt = ++ipi-ipi_gencnt; - in_pcbremlists(inp); -#ifdef INET6 - if (inp-inp_vflag INP_IPV6PROTO) { - ip6_freepcbopts(inp-in6p_outputopts); - if (inp-in6p_moptions != NULL) - ip6_freemoptions(inp-in6p_moptions); - } -#endif - if (inp-inp_options) - (void)m_free(inp-inp_options); -#ifdef INET - if (inp-inp_moptions != NULL) - inp_freemoptions(inp-inp_moptions); -#endif - inp-inp_vflag = 0; - crfree(inp-inp_cred); - -#ifdef MAC - mac_inpcb_destroy(inp); -#endif - INP_WUNLOCK(inp); - uma_zfree(ipi-ipi_zone, inp); -} - -/* * in_pcbref() bumps the reference count on an inpcb in order to maintain * stability of an inpcb pointer despite the inpcb lock being released. This * is used in TCP when the inpcbinfo lock needs to be acquired or upgraded, * but where the inpcb lock is already held. * + * in_pcbref() should be used only to provide brief memory stability, and + * must always be followed by a call to INP_WLOCK() and in_pcbrele() to + * garbage collect the inpcb if it has been in_pcbfree()'d from another +
Re: svn commit: r222183 - head/lib/clang
On 2011-05-23 14:05, Bjoern A. Zeeb wrote: Is there an authoritative source for these names? With regard to the 'triple' or 'quad' strings, e.g. arch-vendor-os or arch-vendor-os-abi, the canonical source is really GNU config.guess, which is used in autoconf, gettext, and most other GNU tools. If you look at the head revision here: http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess you can see that it consistently replaces any 'amd64' arch with 'x86_64'. (Of course the hyphen in 'x86-64' had to be transformed to an underscore, otherwise it would be mistaken for a separator.) I am not quite sure what led to the confusion in first place but I guess it's the oh Intel is doing EMT64 let's not call this amd kind of thing. AMD originally announced their 64 bit technology under the name x86-64, in 1999 (nice typo in the title, btw): http://www.amd.com/us/press-releases/Pages/Press_Release_751.aspx Later, in 2003, their marketing department apparently decided to rename it to AMD64, and deprecate the x86-64 terminology: http://www.x86-64.org/pipermail/discuss/2003-April/003315.html Most likely, GNU and Linux had already picked up the x86-64 name, and did not see much reason to rename it afterwards. Since amd64 support got added to FreeBSD in November 2003, it looks like we only picked this up when it was already renamed. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r222183 - head/lib/clang
On 2011-05-22 23:30, Mark Linimon wrote: On Sun, May 22, 2011 at 10:22:56PM +0200, Roman Divacky wrote: The problem here is deeper in my opinion. What FreeBSD calls amd64 the rest of the world (ie. linux) calls x86_64, I think that instead of this we should teach llvm/clang about amd64. Maybe as a FreeBSD-only diff. If we move away from amd64, we are going to need a _substantial_ amount of work on ports. Note, this commit was *only* to set clang's compiled-in default arch on amd64, to make sure clang selects the correct target CPU when it generates code. This should not influence too many configure scripts, unless they foolishly grep around in $CC -v output... ;) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222218 - head/sys/conf
Author: ru Date: Mon May 23 19:57:12 2011 New Revision: 18 URL: http://svn.freebsd.org/changeset/base/18 Log: expr - sh arithmetic expansion Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shMon May 23 19:32:02 2011(r17) +++ head/sys/conf/newvers.shMon May 23 19:57:12 2011(r18) @@ -139,4 +139,4 @@ int osreldate = ${RELDATE}; char kern_ident[] = ${i}; EOF -echo `expr ${v} + 1` version +echo $((v + 1)) version ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222219 - head/sys/dev/msk
Author: yongari Date: Mon May 23 19:58:08 2011 New Revision: 19 URL: http://svn.freebsd.org/changeset/base/19 Log: Do not blindly clear entire GPHY control register. It seems some bits of the register is used for other purposes such that clearing these bits resulted in unexpected results such as corrupted RX frames or missing LE status updates. For old controllers like Yukon EC it had no effect but it caused all kind of troubles on Yukon Supreme. This change shall improve stability of controllers like Yukon Ultra, Ultra2, Extreme, Optima and Supreme. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Mon May 23 19:57:12 2011(r18) +++ head/sys/dev/msk/if_msk.c Mon May 23 19:58:08 2011(r19) @@ -1362,8 +1362,8 @@ mskc_reset(struct msk_softc *sc) /* Reset GPHY/GMAC Control */ for (i = 0; i sc-msk_num_port; i++) { /* GPHY Control reset. */ - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); /* GMAC Control reset. */ CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222220 - head/sys/kern
Author: ru Date: Mon May 23 19:59:01 2011 New Revision: 20 URL: http://svn.freebsd.org/changeset/base/20 Log: BKVASIZE was bumped to 16k more than a decade ago. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Mon May 23 19:58:08 2011(r19) +++ head/sys/kern/vfs_bio.c Mon May 23 19:59:01 2011(r20) @@ -654,7 +654,7 @@ bufinit(void) * To support extreme low-memory systems, make sure hidirtybuffers cannot * eat up all available buffer space. This occurs when our minimum cannot * be met. We try to size hidirtybuffers to 3/4 our buffer space assuming - * BKVASIZE'd (8K) buffers. + * BKVASIZE'd buffers. */ while ((long)hidirtybuffers * BKVASIZE 3 * hibufspace / 4) { hidirtybuffers = 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222221 - head/sys/dev/msk
Author: yongari Date: Mon May 23 20:09:32 2011 New Revision: 21 URL: http://svn.freebsd.org/changeset/base/21 Log: Rework store and forward configuration of TX MAC FIFO. Basically it enables store and forward mode except for jumbo frame on Yukon Ultra. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Mon May 23 19:59:01 2011(r20) +++ head/sys/dev/msk/if_msk.c Mon May 23 20:09:32 2011(r21) @@ -3654,37 +3654,24 @@ msk_set_tx_stfwd(struct msk_if_softc *sc ifp = sc_if-msk_ifp; sc = sc_if-msk_softc; - switch (sc-msk_hw_id) { - case CHIP_ID_YUKON_EX: - if (sc-msk_hw_rev == CHIP_REV_YU_EX_A0) - goto yukon_ex_workaround; - if (ifp-if_mtu ETHERMTU) - CSR_WRITE_4(sc, - MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_ENA); - else - CSR_WRITE_4(sc, - MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - break; - default: -yukon_ex_workaround: + if ((sc-msk_hw_id == CHIP_ID_YUKON_EX + sc-msk_hw_rev != CHIP_REV_YU_EX_A0) || + sc-msk_hw_id = CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); + } else { if (ifp-if_mtu ETHERMTU) { /* Set Tx GMAC FIFO Almost Empty Threshold. */ CSR_WRITE_4(sc, MR_ADDR(sc_if-msk_port, TX_GMF_AE_THR), MSK_ECU_JUMBO_WM 16 | MSK_ECU_AE_THR); /* Disable Store Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); + CSR_WRITE_4(sc, MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), + TX_STFW_DIS); } else { - /* Enable Store Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); + CSR_WRITE_4(sc, MR_ADDR(sc_if-msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); } - break; } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222222 - head/sys/dev/acpica
Author: jkim Date: Mon May 23 20:12:36 2011 New Revision: 22 URL: http://svn.freebsd.org/changeset/base/22 Log: Decrease ACPI-fast timecounter quality to 900 and increase HPET timecounter quality to 950. HPET on modern platforms usually have better resolution and lower latency than ACPI timer. Effectively this changes default timecounter hardware from ACPI-fast to HPET by default when both are available. Discussed with: avg Modified: head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_timer.c Modified: head/sys/dev/acpica/acpi_hpet.c == --- head/sys/dev/acpica/acpi_hpet.c Mon May 23 20:09:32 2011 (r21) +++ head/sys/dev/acpica/acpi_hpet.c Mon May 23 20:12:36 2011 (r22) @@ -476,7 +476,7 @@ hpet_attach(device_t dev) sc-tc.tc_get_timecount = hpet_get_timecount, sc-tc.tc_counter_mask = ~0u, sc-tc.tc_name = HPET, - sc-tc.tc_quality = 900, + sc-tc.tc_quality = 950, sc-tc.tc_frequency = sc-freq; sc-tc.tc_priv = sc; tc_init(sc-tc); Modified: head/sys/dev/acpica/acpi_timer.c == --- head/sys/dev/acpica/acpi_timer.cMon May 23 20:09:32 2011 (r21) +++ head/sys/dev/acpica/acpi_timer.cMon May 23 20:12:36 2011 (r22) @@ -203,7 +203,7 @@ acpi_timer_probe(device_t dev) if (j == 10) { acpi_timer_timecounter.tc_name = ACPI-fast; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; - acpi_timer_timecounter.tc_quality = 1000; + acpi_timer_timecounter.tc_quality = 900; } else { acpi_timer_timecounter.tc_name = ACPI-safe; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221972 - head/sys/geom/part
On May 23, 2011, at 12:44 PM, Doug Barton wrote: I don't know enough about the topic to know what's best, however what I would like to add to the conversation is that it would be nice if we did it the same way that windows and linux do it, because otherwise you end up with messages like these: GEOM: ad0s2: geometry does not match label (255h,63s != 16h,63s). GEOM: ad0s3: geometry does not match label (255h,63s != 16h,63s). when you use a windows or linux tool to partition your disk before installing FreeBSD. I have tried various combinations of tools and methods of slicing the disk and never found a way to avoid error messages one way or another, so I just ignore them now. If there is truly no reason to do it one way or the other, can we please just do it the way that everyone else does it? These messages can simply be deleted. They serve no purpose at all. The firmware is reporting a different bogus geometry than the label is encoded. Alternatively, we could likely supress the warning for the 'it is bigger than this' encoding of 1023/255/63, since that's the more-or-less official way of having the MBR report 'saturated'. Warner___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222223 - head/sys/dev/msk
Author: yongari Date: Mon May 23 20:18:09 2011 New Revision: 23 URL: http://svn.freebsd.org/changeset/base/23 Log: Do not configure RAM registers for controllers that do not have them. These registers are defined only for Yukon XL, Yukon EC and Yukon FE. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Mon May 23 20:12:36 2011(r22) +++ head/sys/dev/msk/if_msk.c Mon May 23 20:18:09 2011(r23) @@ -1300,7 +1300,7 @@ mskc_reset(struct msk_softc *sc) bus_addr_t addr; uint16_t status; uint32_t val; - int i; + int i, initram; CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); @@ -1396,8 +1396,14 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_STOP); CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); + initram = 0; + if (sc-msk_hw_id == CHIP_ID_YUKON_XL || + sc-msk_hw_id == CHIP_ID_YUKON_EC || + sc-msk_hw_id == CHIP_ID_YUKON_FE) + initram++; + /* Configure timeout values. */ - for (i = 0; i sc-msk_num_port; i++) { + for (i = 0; initram 0 i sc-msk_num_port; i++) { CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_SET); CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_CLR); CSR_WRITE_1(sc, SELECT_RAM_BUFFER(i, B3_RI_WTO_R1), ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222224 - head/sbin/hastd
Author: pjd Date: Mon May 23 20:59:50 2011 New Revision: 24 URL: http://svn.freebsd.org/changeset/base/24 Log: To handle BIO_FLUSH and BIO_DELETE requests in secondary worker we need to use ioctl(2). This is why we can't use capsicum for now to sandbox secondary. Capsicum is still used to sandbox hastctl. MFC after:1 week Modified: head/sbin/hastd/subr.c Modified: head/sbin/hastd/subr.c == --- head/sbin/hastd/subr.c Mon May 23 20:18:09 2011(r23) +++ head/sbin/hastd/subr.c Mon May 23 20:59:50 2011(r24) @@ -224,7 +224,13 @@ drop_privs(struct hast_resource *res) return (-1); } - if (res == NULL || res-hr_role != HAST_ROLE_PRIMARY) + /* +* Until capsicum doesn't allow ioctl(2) we cannot use it to sandbox +* primary and secondary worker processes, as primary uses GGATE +* ioctls and secondary uses ioctls to handle BIO_DELETE and BIO_FLUSH. +* For now capsicum is only used to sandbox hastctl. +*/ + if (res == NULL) capsicum = (cap_enter() == 0); else capsicum = false; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222225 - head/sys/geom/gate
Author: pjd Date: Mon May 23 21:00:37 2011 New Revision: 25 URL: http://svn.freebsd.org/changeset/base/25 Log: Recognize BIO_FLUSH requests and pass them to userland. MFC after:1 week Modified: head/sys/geom/gate/g_gate.c Modified: head/sys/geom/gate/g_gate.c == --- head/sys/geom/gate/g_gate.c Mon May 23 20:59:50 2011(r24) +++ head/sys/geom/gate/g_gate.c Mon May 23 21:00:37 2011(r25) @@ -180,6 +180,7 @@ g_gate_start(struct bio *bp) break; case BIO_DELETE: case BIO_WRITE: + case BIO_FLUSH: /* XXX: Hack to allow read-only mounts. */ if ((sc-sc_flags G_GATE_FLAG_READONLY) != 0) { g_io_deliver(bp, EPERM); @@ -580,6 +581,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm switch (bp-bio_cmd) { case BIO_READ: case BIO_DELETE: + case BIO_FLUSH: break; case BIO_WRITE: error = copyout(bp-bio_data, ggio-gctl_data, @@ -643,6 +645,7 @@ start_end: break; case BIO_DELETE: case BIO_WRITE: + case BIO_FLUSH: break; } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222226 - head/sys/dev/msk
Author: yongari Date: Mon May 23 21:00:56 2011 New Revision: 26 URL: http://svn.freebsd.org/changeset/base/26 Log: Make sure to enable all clocks before accessing registers. Releasing PHY from power down/COMA is done after enabling all clocks. While I'm here remove unnecessary controller reset. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Mon May 23 21:00:37 2011(r25) +++ head/sys/dev/msk/if_msk.c Mon May 23 21:00:56 2011(r26) @@ -1212,37 +1212,30 @@ msk_phy_power(struct msk_softc *sc, int */ CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val); - val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); - val = ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); + our = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); + our = ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); if (sc-msk_hw_id == CHIP_ID_YUKON_XL) { if (sc-msk_hw_rev CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ - val |= PCI_Y2_PHY1_COMA; + our |= PCI_Y2_PHY1_COMA; if (sc-msk_num_port 1) - val |= PCI_Y2_PHY2_COMA; + our |= PCI_Y2_PHY2_COMA; } } - /* Release PHY from PowerDown/COMA mode. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val); - switch (sc-msk_hw_id) { - case CHIP_ID_YUKON_EC_U: - case CHIP_ID_YUKON_EX: - case CHIP_ID_YUKON_FE_P: - case CHIP_ID_YUKON_UL_2: - case CHIP_ID_YUKON_OPT: - CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); - - /* Enable all clocks. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); - our = (PCI_FORCE_ASPM_REQUEST|PCI_ASPM_GPHY_LINK_DOWN| - PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); + if (sc-msk_hw_id == CHIP_ID_YUKON_EC_U || + sc-msk_hw_id == CHIP_ID_YUKON_EX || + sc-msk_hw_id = CHIP_ID_YUKON_FE_P) { + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); + val = (PCI_FORCE_ASPM_REQUEST | + PCI_ASPM_GPHY_LINK_DOWN | PCI_ASPM_INT_FIFO_EMPTY | + PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, our); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); - our = PCI_CTL_TIM_VMAIN_AV_MSK; - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, our); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, val); + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); + val = PCI_CTL_TIM_VMAIN_AV_MSK; + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, val); CSR_PCI_WRITE_4(sc, PCI_CFG_REG_1, 0); + CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_ON); /* * Disable status race, workaround for * Yukon EC Ultra Yukon EX. @@ -1251,10 +1244,10 @@ msk_phy_power(struct msk_softc *sc, int val |= GLB_GPIO_STAT_RACE_DIS; CSR_WRITE_4(sc, B2_GP_IO, val); CSR_READ_4(sc, B2_GP_IO); - break; - default: - break; } + /* Release PHY from PowerDown/COMA mode. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, our); + for (i = 0; i sc-msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1302,8 +1295,6 @@ mskc_reset(struct msk_softc *sc) uint32_t val; int i, initram; - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); - /* Disable ASF. */ if (sc-msk_hw_id == CHIP_ID_YUKON_EX) { status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); @@ -1712,6 +1703,9 @@ mskc_attach(device_t dev) } } + /* Enable all clocks before accessing any registers. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc-msk_hw_id = CSR_READ_1(sc, B2_CHIP_ID); sc-msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) 4) 0x0f; @@ -1752,9 +1746,6 @@ mskc_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), int_holdoff, sc-msk_int_holdoff); - /* Soft reset.
svn commit: r222227 - head/sys/dev/msk
Author: yongari Date: Mon May 23 21:11:46 2011 New Revision: 27 URL: http://svn.freebsd.org/changeset/base/27 Log: Do not touch ASF related register for controllers that do not have these registers. Also disable Watchdog of ASF microcontroller. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Mon May 23 21:00:56 2011(r26) +++ head/sys/dev/msk/if_msk.c Mon May 23 21:11:46 2011(r27) @@ -1296,23 +1296,30 @@ mskc_reset(struct msk_softc *sc) int i, initram; /* Disable ASF. */ - if (sc-msk_hw_id == CHIP_ID_YUKON_EX) { - status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); - /* Clear AHB bridge microcontroller reset. */ - status = ~(Y2_ASF_HCU_CCSR_AHB_RST | - Y2_ASF_HCU_CCSR_CPU_RST_MODE); - /* Clear ASF microcontroller state. */ - status = ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; - CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); - } else - CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - - /* -* Since we disabled ASF, S/W reset is required for Power Management. -*/ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + if (sc-msk_hw_id = CHIP_ID_YUKON_XL + sc-msk_hw_id = CHIP_ID_YUKON_SUPR) { + if (sc-msk_hw_id == CHIP_ID_YUKON_EX || + sc-msk_hw_id == CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge microcontroller reset. */ + status = ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status = ~Y2_ASF_HCU_CCSR_UC_STATE_MSK; + status = ~Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* +* Since we disabled ASF, S/W reset is required for +* Power Management. +*/ + CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + } /* Clear all error bits in the PCI status register. */ status = pci_read_config(sc-msk_dev, PCIR_STATUS, 2); Modified: head/sys/dev/msk/if_mskreg.h == --- head/sys/dev/msk/if_mskreg.hMon May 23 21:00:56 2011 (r26) +++ head/sys/dev/msk/if_mskreg.hMon May 23 21:11:46 2011 (r27) @@ -677,6 +677,7 @@ /* ASF Subsystem Registers (Yukon-2 only) */ #define B28_Y2_SMB_CONFIG 0x0e40 /* 32 bit ASF SMBus Config Register */ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ +#define B28_Y2_CPU_WDOG0x0e48 /* 32 bit Watchdog Register */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD0x0e68 /* 32 bit ASF Status and Command Reg */ #define B28_Y2_ASF_HCU_CCSR0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222228 - in head/sbin: hastctl hastd
Author: pjd Date: Mon May 23 21:15:19 2011 New Revision: 28 URL: http://svn.freebsd.org/changeset/base/28 Log: Keep statistics on number of BIO_READ, BIO_WRITE, BIO_DELETE and BIO_FLUSH requests as well as number of activemap updates. Number of BIO_WRITEs and activemap updates are especially interesting, because if those two are too close to each other, it means that your workload needs bigger number of dirty extents. Activemap should be updated as rarely as possible. MFC after:1 week Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/control.c head/sbin/hastd/hast.h head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastctl/hastctl.c == --- head/sbin/hastctl/hastctl.c Mon May 23 21:11:46 2011(r27) +++ head/sbin/hastctl/hastctl.c Mon May 23 21:15:19 2011(r28) @@ -341,6 +341,17 @@ control_status(struct nv *nv) printf( dirty: %ju (%NB)\n, (uintmax_t)nv_get_uint64(nv, dirty%u, ii), (intmax_t)nv_get_uint64(nv, dirty%u, ii)); + printf( statistics:\n); + printf(reads: %ju\n, + (uint64_t)nv_get_uint64(nv, stat_read%u, ii)); + printf(writes: %ju\n, + (uint64_t)nv_get_uint64(nv, stat_write%u, ii)); + printf(deletes: %ju\n, + (uint64_t)nv_get_uint64(nv, stat_delete%u, ii)); + printf(flushes: %ju\n, + (uint64_t)nv_get_uint64(nv, stat_flush%u, ii)); + printf(activemap updates: %ju\n, + (uint64_t)nv_get_uint64(nv, stat_activemap_update%u, ii)); } return (ret); } Modified: head/sbin/hastd/control.c == --- head/sbin/hastd/control.c Mon May 23 21:11:46 2011(r27) +++ head/sbin/hastd/control.c Mon May 23 21:15:19 2011(r28) @@ -199,6 +199,16 @@ control_status_worker(struct hast_resour extentsize%u, no); nv_add_uint32(nvout, nv_get_uint32(cnvin, keepdirty), keepdirty%u, no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, stat_read), + stat_read%u, no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, stat_write), + stat_write%u, no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, stat_delete), + stat_delete%u, no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, stat_flush), + stat_flush%u, no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, stat_activemap_update), + stat_activemap_update%u, no); end: if (cnvin != NULL) nv_free(cnvin); @@ -446,6 +456,13 @@ ctrl_thread(void *arg) nv_add_uint32(nvout, (uint32_t)0, keepdirty); nv_add_uint64(nvout, (uint64_t)0, dirty); } + nv_add_uint64(nvout, res-hr_stat_read, stat_read); + nv_add_uint64(nvout, res-hr_stat_write, stat_write); + nv_add_uint64(nvout, res-hr_stat_delete, + stat_delete); + nv_add_uint64(nvout, res-hr_stat_flush, stat_flush); + nv_add_uint64(nvout, res-hr_stat_activemap_update, + stat_activemap_update); nv_add_int16(nvout, 0, error); break; case CONTROL_RELOAD: Modified: head/sbin/hastd/hast.h == --- head/sbin/hastd/hast.h Mon May 23 21:11:46 2011(r27) +++ head/sbin/hastd/hast.h Mon May 23 21:15:19 2011(r28) @@ -218,6 +218,17 @@ struct hast_resource { /* Locked used to synchronize access to hr_amp. */ pthread_mutex_t hr_amp_lock; + /* Number of BIO_READ requests. */ + uint64_thr_stat_read; + /* Number of BIO_WRITE requests. */ + uint64_thr_stat_write; + /* Number of BIO_DELETE requests. */ + uint64_thr_stat_delete; + /* Number of BIO_FLUSH requests. */ + uint64_thr_stat_flush; + /* Number of activemap updates. */ + uint64_thr_stat_activemap_update; + /* Next resource. */ TAILQ_ENTRY(hast_resource) hr_next; }; Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Mon May 23 21:11:46 2011(r27) +++ head/sbin/hastd/primary.c Mon May 23 21:15:19 2011(r28) @@ -1117,6 +1117,7 @@ ggate_recv_thread(void *arg) */ switch (ggio-gctl_cmd) { case BIO_READ: + res-hr_stat_read++;
Re: svn commit: r221972 - head/sys/geom/part
Quoting Poul-Henning Kamp, who wrote on Mon, May 23, 2011 at 06:56:30AM + .. In message 4dd9f0a3@freebsd.org, Andrey V. Elsukov writes: There is another opinion: http://www.boot-us.com/gloss02.htm There is the convention that partitions should always start and end on *= cylinder boundaries*. It is actually more weird than that: The rule is that the starting or ending head of one of the four slices represent the number of heads used to access the drive, and ditto for sectors. This requirement dates back to smart BIOS'es and ST-506 drives which couldn't ask the drive for its geometry. WD1003 anyone? Wilko ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r221972 - head/sys/geom/part
In message 20110523210915.ga3...@freebie.xs4all.nl, Wilko Bulte writes: Quoting Poul-Henning Kamp, who wrote on Mon, May 23, 2011 at 06:56:30AM + .. This requirement dates back to smart BIOS'es and ST-506 drives which couldn't ask the drive for its geometry. WD1003 anyone? Hehe, I just finished unsoldering the flat CMOS RAM chip so I could reboot this computer: http://phk.freebsd.dk/misc/dsc_8927.jpg But that is a WD1007 and an ESDI disk... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 p...@freebsd.org | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222231 - head/sys/dev/msk
Author: yongari Date: Mon May 23 21:56:04 2011 New Revision: 31 URL: http://svn.freebsd.org/changeset/base/31 Log: When MTU is changed, check whether driver should be reinitialized or not. If reinitialized is required, clear driver running flag. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Mon May 23 21:51:47 2011(r30) +++ head/sys/dev/msk/if_msk.c Mon May 23 21:56:04 2011(r31) @@ -1034,7 +1034,10 @@ msk_ioctl(struct ifnet *ifp, u_long comm } } ifp-if_mtu = ifr-ifr_mtu; - msk_init_locked(sc_if); + if ((ifp-if_drv_flags IFF_DRV_RUNNING) != 0) { + ifp-if_drv_flags = ~IFF_DRV_RUNNING; + msk_init_locked(sc_if); + } } MSK_IF_UNLOCK(sc_if); break; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222232 - head/share/man/man4
Author: yongari Date: Mon May 23 22:02:15 2011 New Revision: 32 URL: http://svn.freebsd.org/changeset/base/32 Log: Add 88E8075 Yukon Supreme to the list of supported hardware list. Modified: head/share/man/man4/msk.4 Modified: head/share/man/man4/msk.4 == --- head/share/man/man4/msk.4 Mon May 23 21:56:04 2011(r31) +++ head/share/man/man4/msk.4 Mon May 23 22:02:15 2011(r32) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 23, 2010 +.Dd May 23, 2011 .Dt MSK 4 .Os .Sh NAME @@ -195,6 +195,8 @@ Marvell Yukon 88E8071 Gigabit Ethernet .It Marvell Yukon 88E8072 Gigabit Ethernet .It +Marvell Yukon 88E8075 Gigabit Ethernet +.It SysKonnect SK-9Sxx Gigabit Ethernet .It SysKonnect SK-9Exx Gigabit Ethernet ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222233 - head/sys/fs/nfsclient
Author: rmacklem Date: Mon May 23 22:31:42 2011 New Revision: 33 URL: http://svn.freebsd.org/changeset/base/33 Log: Set the MNT_NFS4ACLS flag for an NFSv4 client mount if the NFSv4 server supports it. Requested by trasz. MFC after:2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c == --- head/sys/fs/nfsclient/nfs_clvfsops.cMon May 23 22:02:15 2011 (r32) +++ head/sys/fs/nfsclient/nfs_clvfsops.cMon May 23 22:31:42 2011 (r33) @@ -79,6 +79,7 @@ FEATURE(nfscl, NFSv4 client); extern int nfscl_ticks; extern struct timeval nfsboottime; extern struct nfsstats newnfsstats; +extern int nfsrv_useacl; MALLOC_DEFINE(M_NEWNFSREQ, newnfsclient_req, New NFS request header); MALLOC_DEFINE(M_NEWNFSMNT, newnfsmnt, New NFS mount struct); @@ -1331,6 +1332,15 @@ mountnfs(struct nfs_args *argp, struct m if (argp-flags NFSMNT_NFSV3) ncl_fsinfo(nmp, *vpp, cred, td); + /* Mark if the mount point supports NFSv4 ACLs. */ + if ((argp-flags NFSMNT_NFSV4) != 0 nfsrv_useacl != 0 + ret == 0 + NFSISSET_ATTRBIT(nfsva.na_suppattr, NFSATTRBIT_ACL)) { + MNT_ILOCK(mp); + mp-mnt_flag |= MNT_NFS4ACLS; + MNT_IUNLOCK(mp); + } + /* * Lose the lock but keep the ref. */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222234 - head/sys/mips/include
Author: attilio Date: Mon May 23 23:35:50 2011 New Revision: 34 URL: http://svn.freebsd.org/changeset/base/34 Log: Merge r221846 from largeSMP project branch: Fix arguments passing to _long() version of atomic function for mips. The native implementation is bogus in that regard and offers the same problem solved for powerpc as r222198, but mips' guys just wanted a small and self-contained patch for mips rather than rewriting the whole support. Reviewed by: art, imp Tested by:gonzo MFC after:2 weeks Modified: head/sys/mips/include/atomic.h Modified: head/sys/mips/include/atomic.h == --- head/sys/mips/include/atomic.h Mon May 23 22:31:42 2011 (r33) +++ head/sys/mips/include/atomic.h Mon May 23 23:35:50 2011 (r34) @@ -581,32 +581,47 @@ atomic_fetchadd_64(__volatile uint64_t * #else /* !__mips_n64 */ /* Operations on longs. */ -#defineatomic_set_long atomic_set_32 -#defineatomic_set_acq_long atomic_set_acq_32 -#defineatomic_set_rel_long atomic_set_rel_32 -#defineatomic_clear_long atomic_clear_32 -#defineatomic_clear_acq_long atomic_clear_acq_32 -#defineatomic_clear_rel_long atomic_clear_rel_32 -#defineatomic_add_long(p, v) \ +#defineatomic_set_long(p, v) \ + atomic_set_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_set_acq_long(p, v) \ + atomic_set_acq_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_set_rel_long(p, v) \ + atomic_set_rel_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_clear_long(p, v) \ + atomic_clear_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_clear_acq_long(p, v) \ + atomic_clear_acq_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_clear_rel_long(p, v) \ + atomic_clear_rel_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_add_long(p, v) \ atomic_add_32((volatile u_int *)(p), (u_int)(v)) -#defineatomic_add_acq_long atomic_add_acq_32 -#defineatomic_add_rel_long atomic_add_rel_32 -#defineatomic_subtract_long(p, v) \ +#defineatomic_add_acq_long(p, v) \ + atomic_add_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_add_rel_long(p, v) \ + atomic_add_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_subtract_long(p, v) \ atomic_subtract_32((volatile u_int *)(p), (u_int)(v)) -#defineatomic_subtract_acq_longatomic_subtract_acq_32 -#defineatomic_subtract_rel_longatomic_subtract_rel_32 -#defineatomic_cmpset_long atomic_cmpset_32 -#defineatomic_cmpset_acq_long(p, cmpval, newval) \ - atomic_cmpset_acq_32((volatile u_int *)(p), \ - (u_int)(cmpval), (u_int)(newval)) -#defineatomic_cmpset_rel_long(p, cmpval, newval) \ - atomic_cmpset_rel_32((volatile u_int *)(p), \ - (u_int)(cmpval), (u_int)(newval)) -#defineatomic_load_acq_longatomic_load_acq_32 -#defineatomic_store_rel_long atomic_store_rel_32 -#defineatomic_fetchadd_long(p, v) \ +#defineatomic_subtract_acq_long(p, v) \ + atomic_subtract_acq_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_subtract_rel_long(p, v) \ + atomic_subtract_rel_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_cmpset_long(p, cmpval, newval) \ + atomic_cmpset_32((volatile u_int *)(p), (u_int)(cmpval),\ + (u_int)(newval)) +#defineatomic_cmpset_acq_long(p, cmpval, newval) \ + atomic_cmpset_acq_32((volatile u_int *)(p), (u_int)(cmpval),\ + (u_int)(newval)) +#defineatomic_cmpset_rel_long(p, cmpval, newval) \ + atomic_cmpset_rel_32((volatile u_int *)(p), (u_int)(cmpval),\ + (u_int)(newval)) +#defineatomic_load_acq_long(p) \ + (u_long)atomic_load_acq_32((volatile u_int *)(p)) +#defineatomic_store_rel_long(p, v) \ + atomic_store_rel_32((volatile u_int *)(p), (u_int)(v)) +#defineatomic_fetchadd_long(p, v) \ atomic_fetchadd_32((volatile u_int *)(p), (u_int)(v)) -#defineatomic_readandclear_long
svn commit: r222240 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Tue May 24 05:34:45 2011 New Revision: 40 URL: http://svn.freebsd.org/changeset/base/40 Log: Add in descriptions for TX descriptor fields ctl8-11 - these fields control the antenna control bits for the four TX series and the TPC settings for TX series 1, 2, 3. The specifics: * The TPC setting for TX series 0 is handled in ctl0. * TPC is currently disabled, so the per-packet TX power is set via the global per-rate TX power register, not per packet. * The antenna control bits don't matter for AR5416 and later so they should stay 0 (which they currently do); they may be set for Kite but as there's no TX diversity supported at the moment (it requires the NIC to be built with an external antenna switch, matching how antenna diversity is done on legacy NICs), so again keep them 0. This is in preparation for supporting per-rate TPC on the AR5416 and later. The Kite (and soon to come Kiwi) code sets ctl8-11 to 0x0, which doesn't have any effect at the moment. When TPC is enabled it would result in the second, third and fourth TX series attmpts to be done with a TX power of 0. This commit doesn't change that; it'll be followed up with some commits to properly set the TPC registers appropriately. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h == --- head/sys/dev/ath/ath_hal/ar5416/ar5416desc.hTue May 24 02:19:45 2011(r39) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416desc.hTue May 24 05:34:45 2011(r40) @@ -205,6 +205,29 @@ struct ar5416_desc { #defineAR_STBC20x4000 #defineAR_STBC30x8000 +/* ds_ctl8 */ +#defineAR_AntCtl0 0x00ff +#defineAR_AntCtl0_S0 +/* Xmit 0 TPC is AR_XmitPower in ctl0 */ + +/* ds_ctl9 */ +#defineAR_AntCtl1 0x00ff +#defineAR_AntCtl1_S0 +#defineAR_XmitPower1 0xff00 +#defineAR_XmitPower1_S 24 + +/* ds_ctl10 */ +#defineAR_AntCtl2 0x00ff +#defineAR_AntCtl2_S0 +#defineAR_XmitPower2 0xff00 +#defineAR_XmitPower2_S 24 + +/* ds_ctl11 */ +#defineAR_AntCtl3 0x00ff +#defineAR_AntCtl3_S0 +#defineAR_XmitPower3 0xff00 +#defineAR_XmitPower3_S 24 + /* * TX Status * */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r222241 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Tue May 24 05:49:02 2011 New Revision: 41 URL: http://svn.freebsd.org/changeset/base/41 Log: Use the new per-series antenna and TPC definitions when setting ctl8-11. This should hopefully make it clearer to developers what is going on and when TPC is being hacked on, make it obvious why it isn't working for series 1, 2, 3. I won't flip on setting TX power for TX series 1, 2, 3 until I've done some further testing with Kite to ensure it doesn't break anything. (Before people ask - yes, TPC is only needed for 5ghz regdomains and yes, Kite is a 2.4ghz only chip, but there are potential use cases for 2ghz TPC. I just need to sit down and ensure it's supported and functional.) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue May 24 05:34:45 2011(r40) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue May 24 05:49:02 2011(r41) @@ -208,10 +208,11 @@ ar5416SetupTxDesc(struct ath_hal *ah, st | SM(ahp-ah_tx_chainmask, AR_ChainSel2) | SM(ahp-ah_tx_chainmask, AR_ChainSel3) ; - ads-ds_ctl8 = 0; - ads-ds_ctl9 = (txPower 24); /* XXX? */ - ads-ds_ctl10 = (txPower 24);/* XXX? */ - ads-ds_ctl11 = (txPower 24);/* XXX? */ + ads-ds_ctl8 = SM(0, AR_AntCtl0); + ads-ds_ctl9 = SM(0, AR_AntCtl1) | SM(txPower, AR_XmitPower1); + ads-ds_ctl10 = SM(0, AR_AntCtl2) | SM(txPower, AR_XmitPower2); + ads-ds_ctl11 = SM(0, AR_AntCtl3) | SM(txPower, AR_XmitPower3); + if (keyIx != HAL_TXKEYIX_INVALID) { /* XXX validate key index */ ads-ds_ctl1 |= SM(keyIx, AR_DestIdx); @@ -232,11 +233,16 @@ ar5416SetupTxDesc(struct ath_hal *ah, st ads-ds_ctl7 |= (rtsctsRate AR_RTSCTSRate_S); } + /* +* Set the TX antenna to 0 for Kite +* To preserve existing behaviour, also set the TPC bits to 0; +* when TPC is enabled these should be filled in appropriately. +*/ if (AR_SREV_KITE(ah)) { - ads-ds_ctl8 = 0; - ads-ds_ctl9 = 0; - ads-ds_ctl10 = 0; - ads-ds_ctl11 = 0; + ads-ds_ctl8 = SM(0, AR_AntCtl0); + ads-ds_ctl9 = SM(0, AR_AntCtl1) | SM(0, AR_XmitPower1); + ads-ds_ctl10 = SM(0, AR_AntCtl2) | SM(0, AR_XmitPower2); + ads-ds_ctl11 = SM(0, AR_AntCtl3) | SM(0, AR_XmitPower3); } return AH_TRUE; #undef RTSCTS @@ -410,10 +416,10 @@ ar5416SetupFirstTxDesc(struct ath_hal *a | SM(AH5416(ah)-ah_tx_chainmask, AR_ChainSel3); /* NB: no V1 WAR */ - ads-ds_ctl8 = 0; - ads-ds_ctl9 = (txPower 24); - ads-ds_ctl10 = (txPower 24); - ads-ds_ctl11 = (txPower 24); + ads-ds_ctl8 = SM(0, AR_AntCtl0); + ads-ds_ctl9 = SM(0, AR_AntCtl1) | SM(txPower, AR_XmitPower1); + ads-ds_ctl10 = SM(0, AR_AntCtl2) | SM(txPower, AR_XmitPower2); + ads-ds_ctl11 = SM(0, AR_AntCtl3) | SM(txPower, AR_XmitPower3); ads-ds_ctl6 = ~(0x); ads-ds_ctl6 |= SM(aggrLen, AR_AggrLen); @@ -424,11 +430,16 @@ ar5416SetupFirstTxDesc(struct ath_hal *a | (flags HAL_TXDESC_RTSENA ? AR_RTSEnable : 0); } + /* +* Set the TX antenna to 0 for Kite +* To preserve existing behaviour, also set the TPC bits to 0; +* when TPC is enabled these should be filled in appropriately. +*/ if (AR_SREV_KITE(ah)) { - ads-ds_ctl8 = 0; - ads-ds_ctl9 = 0; - ads-ds_ctl10 = 0; - ads-ds_ctl11 = 0; + ads-ds_ctl8 = SM(0, AR_AntCtl0); + ads-ds_ctl9 = SM(0, AR_AntCtl1) | SM(0, AR_XmitPower1); + ads-ds_ctl10 = SM(0, AR_AntCtl2) | SM(0, AR_XmitPower2); + ads-ds_ctl11 = SM(0, AR_AntCtl3) | SM(0, AR_XmitPower3); } return AH_TRUE; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org