svn commit: r223408 - head/etc/rc.d

2011-06-22 Thread Doug Barton
Author: dougb
Date: Wed Jun 22 06:27:32 2011
New Revision: 223408
URL: http://svn.freebsd.org/changeset/base/223408

Log:
  I knew there was something funny about this line

Modified:
  head/etc/rc.d/netwait

Modified: head/etc/rc.d/netwait
==
--- head/etc/rc.d/netwait   Wed Jun 22 04:11:27 2011(r223407)
+++ head/etc/rc.d/netwait   Wed Jun 22 06:27:32 2011(r223408)
@@ -14,7 +14,8 @@
 . /etc/rc.subr
 
 name=netwait
-rc_var=`set_rcvar`
+rcvar=`set_rcvar`
+
 start_cmd=${name}_start
 stop_cmd=:
 
___
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: r223372 - head/bin/realpath

2011-06-22 Thread Ruslan Ermilov
On Tue, Jun 21, 2011 at 10:28:03PM +0200, Jilles Tjoelker wrote:
 On Tue, Jun 21, 2011 at 07:34:57PM +, Ruslan Ermilov wrote:
  Author: ru
  Date: Tue Jun 21 19:34:57 2011
  New Revision: 223372
  URL: http://svn.freebsd.org/changeset/base/223372
 
  Log:
Make ``realpath'' behave like ``realpath .''.
 
 Is this being added for compatibility with something?
 
 If not, why do we need this non-standard extension if the shorter and
 standard pwd -P already fulfills this function?

I treat it as a convenient addition to a non-standard utility.

realpath(1) was first added in FreeBSD in year 2000 by phk@,
as a convenience utility.  In r90523 the ability to call
realpath without arguments (with a similar behavior but
different implementation) was added by mike@.  Ten months
later, this syntax was removed by johan@ in r108034.

I'm not aware of any standard and/or another non-FreeBSD based
OS that also have this utility (only saw a mention of a patch
that adds an utility of the same name into GNU shell-utils,
but it seems to have never happened).  We could emphasize this:

Index: realpath.1
===
--- realpath.1  (revision 223372)
+++ realpath.1  (working copy)
@@ -69,6 +69,10 @@
 fails.
 .Sh EXIT STATUS
 .Ex -std
+.Sh COMPATIBILITY
+The
+.Nm
+utility is non-standard and should not be used in portable scripts.
 .Sh SEE ALSO
 .Xr realpath 3
 .Sh HISTORY


Cheers,
-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
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: r223416 - head/sbin/ipfw

2011-06-22 Thread Gleb Smirnoff
Author: glebius
Date: Wed Jun 22 08:20:01 2011
New Revision: 223416
URL: http://svn.freebsd.org/changeset/base/223416

Log:
  One more braino from me.
  
  Pointy hat to:glebius
  Submitted by: Alexander V. Chernikov melifaro ipfw.ru

Modified:
  head/sbin/ipfw/nat.c

Modified: head/sbin/ipfw/nat.c
==
--- head/sbin/ipfw/nat.cWed Jun 22 08:09:50 2011(r223415)
+++ head/sbin/ipfw/nat.cWed Jun 22 08:20:01 2011(r223416)
@@ -785,8 +785,9 @@ ipfw_config_nat(int ac, char **av)
len += estimate_redir_port(ac1, av1);
av1 += 2; ac1 -= 2;
/* Skip optional remoteIP/port */
-   if (ac1 != 0  isdigit(**av1))
+   if (ac1 != 0  isdigit(**av1)) {
av1++; ac1--;
+   }
break;
case TOK_REDIR_PROTO:
if (ac1  2)
@@ -795,10 +796,12 @@ ipfw_config_nat(int ac, char **av)
len += sizeof(struct cfg_redir);
av1 += 2; ac1 -= 2;
/* Skip optional remoteIP/port */
-   if (ac1 != 0  isdigit(**av1))
+   if (ac1 != 0  isdigit(**av1)) {
av1++; ac1--;
-   if (ac1 != 0  isdigit(**av1))
+   }
+   if (ac1 != 0  isdigit(**av1)) {
av1++; ac1--;
+   }
break;
default:
errx(EX_DATAERR, unrecognised option ``%s'', av1[-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


Re: svn commit: r223307 - head/sys/vm

2011-06-22 Thread Attilio Rao
2011/6/22 Warner Losh i...@bsdimp.com:

 On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:

 On 06/21/2011 16:09, Attilio Rao wrote:

 2011/6/21 Bruce Evansb...@optusnet.com.au:

 On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:

 On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

 Hi Alan,

 Author: alc

 Date: Sun Jun 19 19:13:24 2011

 New Revision: 223307

 URL: http://svn.freebsd.org/changeset/base/223307

 Log:

  Precisely document the synchronization rules for the page's dirty field.

  (Saying that the lock on the object that the page belongs to must be

 held

  only represents one aspect of the rules.)

  Eliminate the use of the page queues lock for atomically performing

 read-

  modify-write operations on the dirty field when the underlying

 architecture

  supports atomic operations on char and short types.

  Document the fact that 32KB pages aren't really supported.

 contrary to the tinderbox I'd like to point out that all mips kernels

 built by universe are broken with a SVN HEAD from earlier today.  Could you

 please check and see if you can fix it?  The errors I get are:

 vm_page.o: In function `vm_page_clear_dirty':

 /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'

 /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26

 against `atomic_clear_8'

 vm_page.o: In function `vm_page_set_validclean':

 /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'

 /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26

 against `atomic_clear_8'

 Atomic types shorter than int cannot be used in MI code, since they might

 not exist.  Apparently they don't exist on mips.  jake@ fixed all their

 old uses for sparc4 in ~Y2K.

 I'm sure they do, they exist in support.S though and may not have the

 _8 form (they may just have the _char version). I may look at the code

 again to be sure.


 It appears that while mips/include/atomic.h declares the existence of
 atomic_clear_8, mips/mips/support.S doesn't implement it.  In other words,
 only support for int's and short's is currently implemented, not char's:

 # grep atomic_clear mips/mips/support.S
 * atomic_clear_32(u_int32_t *a, u_int32_t b)
 LEAF(atomic_clear_32)
 END(atomic_clear_32)
 * atomic_clear_16(u_int16_t *a, u_int16_t b)
 LEAF(atomic_clear_16)
 END(atomic_clear_16)

 The current crop of atomic*16 and atomic*8 functions have the restriction
 that the address must be 32-bit aligned (and it forces this by aligning to
 32-bits silently and then operates on the low 8 or 16 bits in that word!)
 I'm guessing that this is likely just wrong.  Comments?
 Warner

That is wrong, of course, and my personal opinion is that one should
not implement atomic operations if they cannot be done efficiently
(example: if you need to disable interrupts or similar expensive
operation just to assure atomicity of operation, just don't support
it) as long as not having _8/_char is perfectly fine.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
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: r223421 - head/sys/netinet/libalias

2011-06-22 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 22 09:55:28 2011
New Revision: 223421
URL: http://svn.freebsd.org/changeset/base/223421

Log:
  Document PKT_ALIAS_SKIP_GLOBAL option.
  
  Submitted by: Alexander V. Chernikov

Modified:
  head/sys/netinet/libalias/libalias.3

Modified: head/sys/netinet/libalias/libalias.3
==
--- head/sys/netinet/libalias/libalias.3Wed Jun 22 09:16:32 2011
(r223420)
+++ head/sys/netinet/libalias/libalias.3Wed Jun 22 09:55:28 2011
(r223421)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 1, 2006
+.Dd June 22, 2011
 .Dt LIBALIAS 3
 .Os
 .Sh NAME
@@ -257,6 +257,16 @@ Normal packet aliasing is not performed.
 See
 .Fn LibAliasProxyRule
 below for details.
+.It Dv PKT_ALIAS_SKIP_GLOBAL
+This option is used by
+.Pa ipfw_nat
+only. Specifying it as a flag to
+.Fn LibAliasSetMode
+has no effect. See section
+.Sx NETWORK ADDRESS TRANSLATION
+in
+.Xr ipfw 8
+for more details.
 .El
 .Ed
 .Pp
___
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: r222950 - in head: cddl/compat/opensolaris/include sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2011-06-22 Thread Andriy Gapon
on 10/06/2011 23:10 Justin T. Gibbs said the following:
 Author: gibbs
 Date: Fri Jun 10 20:10:30 2011
 New Revision: 222950
 URL: http://svn.freebsd.org/changeset/base/222950
 
 Log:
   Remove C constructs that are incompatible with C++ from various
   OpenSolaris and ZFS header files.  These changes are sufficient
   to allow a C++ program to use the libzfs library.

Is this going to affect any possible (but improbable?) merges from upstream?
And/or from other ZFS/OpenSolaris forks (which should be more likely)?

   Note: The majority of these files already included 'extern C'
 declarations, so the intention of providing C++ compatibility
 already existed even if it wasn't provided.
   
   cddl/compat/opensolaris/include/assert.h:
   Wrap our compatibility assert implementation in
   'extern C'.  Since this is a compatibility header
   I matched the Solaris style of doing this explicitly
   rather than rely on FreeBSD's __BEGIN/END_DECLS macro.
   
   sys/cddl/compat/opensolaris/sys/kstat.h:
   sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:
   sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h:
   sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h:
   sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h:
   sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h:
   Rename parameters in function declarations that conflict
   with C++ keywords.  This was the solution preferred by
   members of the Illumos community.
   
   sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h:
   In C, nested structures are visible in the global namespace,
   but in C++, they take on the namespace of the structure in
   which they are contained.  Flatten nested structure
   definitions within struct zfs_cmd so these structures are
   visible in the global namespace when compiled in both
   languages.
   
   Sponsored by:Spectra Logic Corporation
 
 Modified:
   head/cddl/compat/opensolaris/include/assert.h
   head/sys/cddl/compat/opensolaris/sys/kstat.h
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h

-- 
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


Re: svn commit: r223307 - head/sys/vm

2011-06-22 Thread John Baldwin
On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote:
 On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:
 
  On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
 
  Hi Alan,
 
  Author: alc
  Date: Sun Jun 19 19:13:24 2011
  New Revision: 223307
  URL: http://svn.freebsd.org/changeset/base/223307
 
  Log:
   Precisely document the synchronization rules for the page's dirty field.
   (Saying that the lock on the object that the page belongs to must be held
   only represents one aspect of the rules.)
 
   Eliminate the use of the page queues lock for atomically performing read-
   modify-write operations on the dirty field when the underlying 
  architecture
   supports atomic operations on char and short types.
 
   Document the fact that 32KB pages aren't really supported.
 
  contrary to the tinderbox I'd like to point out that all mips kernels built 
  by universe are broken with a SVN HEAD from earlier today.  Could 
you please check and see if you can fix it?  The errors I get are:
 
  vm_page.o: In function `vm_page_clear_dirty':
  /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
  /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 
  against `atomic_clear_8'
  vm_page.o: In function `vm_page_set_validclean':
  /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
  /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 
  against `atomic_clear_8'
 
 Atomic types shorter than int cannot be used in MI code, since they might
 not exist.  Apparently they don't exist on mips.  jake@ fixed all their
 old uses for sparc4 in ~Y2K.

I agree.  Is there any harm in having the 'dirty' and 'valid' fields in
vm_page always be at least of size 'int'?

In the case of amd64, vm_page would change from a size of 120 bytes to 128.

On i386 I think you'd end up changing the size from 68 to 76.

(Using an int results in alignment padding after 'busy'.)

Hmm, that's around 120k of extra vm_page_t space for a machine with 64M of
RAM, so around 0.18% of RAM would be used on both platforms (presumably the
usage would be similar on other platforms as well).  At 24 GB of RAM, the
extra space is just under 0.20% of RAM (48M).

-- 
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


Re: svn commit: r223307 - head/sys/vm

2011-06-22 Thread Warner Losh

On Jun 22, 2011, at 3:26 AM, Attilio Rao wrote:

 2011/6/22 Warner Losh i...@bsdimp.com:
 
 On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:
 
 On 06/21/2011 16:09, Attilio Rao wrote:
 
 2011/6/21 Bruce Evansb...@optusnet.com.au:
 
 On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:
 
 On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:
 
 Hi Alan,
 
 Author: alc
 
 Date: Sun Jun 19 19:13:24 2011
 
 New Revision: 223307
 
 URL: http://svn.freebsd.org/changeset/base/223307
 
 Log:
 
  Precisely document the synchronization rules for the page's dirty field.
 
  (Saying that the lock on the object that the page belongs to must be
 
 held
 
  only represents one aspect of the rules.)
 
  Eliminate the use of the page queues lock for atomically performing
 
 read-
 
  modify-write operations on the dirty field when the underlying
 
 architecture
 
  supports atomic operations on char and short types.
 
  Document the fact that 32KB pages aren't really supported.
 
 contrary to the tinderbox I'd like to point out that all mips kernels
 
 built by universe are broken with a SVN HEAD from earlier today.  Could you
 
 please check and see if you can fix it?  The errors I get are:
 
 vm_page.o: In function `vm_page_clear_dirty':
 
 /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
 
 /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26
 
 against `atomic_clear_8'
 
 vm_page.o: In function `vm_page_set_validclean':
 
 /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
 
 /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26
 
 against `atomic_clear_8'
 
 Atomic types shorter than int cannot be used in MI code, since they might
 
 not exist.  Apparently they don't exist on mips.  jake@ fixed all their
 
 old uses for sparc4 in ~Y2K.
 
 I'm sure they do, they exist in support.S though and may not have the
 
 _8 form (they may just have the _char version). I may look at the code
 
 again to be sure.
 
 
 It appears that while mips/include/atomic.h declares the existence of
 atomic_clear_8, mips/mips/support.S doesn't implement it.  In other words,
 only support for int's and short's is currently implemented, not char's:
 
 # grep atomic_clear mips/mips/support.S
 * atomic_clear_32(u_int32_t *a, u_int32_t b)
 LEAF(atomic_clear_32)
 END(atomic_clear_32)
 * atomic_clear_16(u_int16_t *a, u_int16_t b)
 LEAF(atomic_clear_16)
 END(atomic_clear_16)
 
 The current crop of atomic*16 and atomic*8 functions have the restriction
 that the address must be 32-bit aligned (and it forces this by aligning to
 32-bits silently and then operates on the low 8 or 16 bits in that word!)
 I'm guessing that this is likely just wrong.  Comments?
 Warner
 
 That is wrong, of course, and my personal opinion is that one should
 not implement atomic operations if they cannot be done efficiently
 (example: if you need to disable interrupts or similar expensive
 operation just to assure atomicity of operation, just don't support
 it) as long as not having _8/_char is perfectly fine.

I think it can be efficient, for some reasonable definition of efficient.  The 
masking and shifting operations aren't that onerous to write and the 
instructions cycles would be dwarfed by the ll/sc pair, which are required to 
implement atomic.

The issue is that the code today is clearly wrong and needs to be fixed.

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: r223424 - in head/sys: amd64/pci dev/acpica i386/pci

2011-06-22 Thread John Baldwin
Author: jhb
Date: Wed Jun 22 16:15:15 2011
New Revision: 223424
URL: http://svn.freebsd.org/changeset/base/223424

Log:
  Add a helper routine to conditionally modify the start address of a
  resource allocation from an x86 Host-PCI bridge driver so that it can be
  reused by the ACPI Host-PCI bridge driver (and eventually the MPTable
  Host-PCI bridge driver) instead of duplicating the same logic.  Note that
  this means that hw.acpi.host_mem_start is now replaced with the
  hw.pci.host_mem_start tunable that was already used in the non-ACPI case.
  This also removes hw.acpi.host_mem_start on ia64 where it was not
  applicable (the implementation was very x86-specific).
  
  While here, adjust the logic to apply the new start address on any
  wildcard allocation even if that allocation comes from a subset of
  the allowable address range.
  
  Reviewed by:  imp (1)

Modified:
  head/sys/amd64/pci/pci_bus.c
  head/sys/dev/acpica/acpi_pcib_acpi.c
  head/sys/i386/pci/pci_bus.c

Modified: head/sys/amd64/pci/pci_bus.c
==
--- head/sys/amd64/pci/pci_bus.cWed Jun 22 14:33:16 2011
(r223423)
+++ head/sys/amd64/pci/pci_bus.cWed Jun 22 16:15:15 2011
(r223424)
@@ -302,35 +302,45 @@ legacy_pcib_write_ivar(device_t dev, dev
return ENOENT;
 }
 
+/*
+ * Helper routine for x86 Host-PCI bridge driver resource allocation.
+ * This is used to adjust the start address of wildcard allocation
+ * requests to avoid low addresses that are known to be problematic.
+ *
+ * If no memory preference is given, use upper 32MB slot most BIOSes
+ * use for their memory window.  This is typically only used on older
+ * laptops that don't have PCI busses behind a PCI bridge, so assuming
+ *  32MB is likely OK.
+ * 
+ * However, this can cause problems for other chipsets, so we make
+ * this tunable by hw.pci.host_mem_start.
+ */
 SYSCTL_DECL(_hw_pci);
 
-static unsigned long legacy_host_mem_start = 0x8000;
-TUNABLE_ULONG(hw.pci.host_mem_start, legacy_host_mem_start);
-SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN,
-legacy_host_mem_start, 0x8000,
-Limit the host bridge memory to being above this address.  Must be\n\
-set at boot via a tunable.);
+static unsigned long host_mem_start = 0x8000;
+TUNABLE_ULONG(hw.pci.host_mem_start, host_mem_start);
+SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, host_mem_start,
+0, Limit the host bridge memory to being above this address.);
+
+u_long
+hostb_alloc_start(int type, u_long start, u_long end, u_long count)
+{
+
+   if (start + count - 1 != end) {
+   if (type == SYS_RES_MEMORY  start  host_mem_start)
+   start = host_mem_start;
+   if (type == SYS_RES_IOPORT  start  0x1000)
+   start = 0x1000;
+   }
+   return (start);
+}
 
 struct resource *
 legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
 u_long start, u_long end, u_long count, u_int flags)
 {
-/*
- * If no memory preference is given, use upper 32MB slot most
- * bioses use for their memory window.  Typically other bridges
- * before us get in the way to assert their preferences on memory.
- * Hardcoding like this sucks, so a more MD/MI way needs to be
- * found to do it.  This is typically only used on older laptops
- * that don't have pci busses behind pci bridge, so assuming  32MB
- * is liekly OK.
- *
- * However, this can cause problems for other chipsets, so we make
- * this tunable by hw.pci.host_mem_start.
- */
-if (type == SYS_RES_MEMORY  start == 0UL  end == ~0UL)
-   start = legacy_host_mem_start;
-if (type == SYS_RES_IOPORT  start == 0UL  end == ~0UL)
-   start = 0x1000;
+
+start = hostb_alloc_start(type, start, end, count);
 return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
count, flags));
 }

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==
--- head/sys/dev/acpica/acpi_pcib_acpi.cWed Jun 22 14:33:16 2011
(r223423)
+++ head/sys/dev/acpica/acpi_pcib_acpi.cWed Jun 22 16:15:15 2011
(r223424)
@@ -357,32 +357,14 @@ acpi_pcib_map_msi(device_t pcib, device_
return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
 }
 
-static u_long acpi_host_mem_start = 0x8000;
-TUNABLE_ULONG(hw.acpi.host_mem_start, acpi_host_mem_start);
-
 struct resource *
 acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
 u_long start, u_long end, u_long count, u_int flags)
 {
-/*
- * If no memory preference is given, use upper 32MB slot most
- * bioses use for their memory window.  Typically other bridges
- * before us get in the way to assert their preferences on memory.
- * Hardcoding like this sucks, so 

svn commit: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Jung-uk Kim
Author: jkim
Date: Wed Jun 22 16:40:45 2011
New Revision: 223426
URL: http://svn.freebsd.org/changeset/base/223426

Log:
  Set negative quality to TSC timecounter when C3 state is enabled for Intel
  processors unless the invariant TSC bit of CPUID is set.  Intel processors
  may stop incrementing TSC when DPSLP# pin is asserted, according to Intel
  processor manuals, i. e., TSC timecounter is useless if the processor can
  enter deep sleep state (C3/C4).  This problem was accidentally uncovered by
  r222869, which increased timecounter quality of P-state invariant TSC, e.g.,
  for Core2 Duo T5870 (Family 6, Model f) and Atom N270 (Family 6, Model 1c).
  
  Reported by:  Fabian Keil (freebsd-listen at fabiankeil dot de)
Ian FREISLICH (ianf at clue dot co dot za)
  Tested by:Fabian Keil (freebsd-listen at fabiankeil dot de)
- Core2 Duo T5870 (C3 state available/enabled)
jkim - Xeon X5150 (C3 state unavailable)

Modified:
  head/sys/dev/acpica/acpi_cpu.c
  head/sys/kern/kern_clocksource.c
  head/sys/sys/systm.h
  head/sys/x86/x86/tsc.c

Modified: head/sys/dev/acpica/acpi_cpu.c
==
--- head/sys/dev/acpica/acpi_cpu.c  Wed Jun 22 16:26:21 2011
(r223425)
+++ head/sys/dev/acpica/acpi_cpu.c  Wed Jun 22 16:40:45 2011
(r223426)
@@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc *
sbuf_printf(sb, C%d/%d , i + 1, sc-cpu_cx_states[i].trans_lat);
if (sc-cpu_cx_states[i].type  ACPI_STATE_C3)
sc-cpu_non_c3 = i;
+   else
+   cpu_can_deep_sleep = 1;
 }
 sbuf_trim(sb);
 sbuf_finish(sb);

Modified: head/sys/kern/kern_clocksource.c
==
--- head/sys/kern/kern_clocksource.cWed Jun 22 16:26:21 2011
(r223425)
+++ head/sys/kern/kern_clocksource.cWed Jun 22 16:40:45 2011
(r223426)
@@ -59,6 +59,7 @@ __FBSDID($FreeBSD$);
 cyclic_clock_func_tcyclic_clock_func = NULL;
 #endif
 
+intcpu_can_deep_sleep = 0; /* C3 state is available. */
 intcpu_disable_deep_sleep = 0; /* Timer dies in C3. */
 
 static voidsetuptimer(void);

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hWed Jun 22 16:26:21 2011(r223425)
+++ head/sys/sys/systm.hWed Jun 22 16:40:45 2011(r223426)
@@ -253,6 +253,7 @@ voidcpu_startprofclock(void);
 void   cpu_stopprofclock(void);
 void   cpu_idleclock(void);
 void   cpu_activeclock(void);
+extern int cpu_can_deep_sleep;
 extern int cpu_disable_deep_sleep;
 
 intcr_cansee(struct ucred *u1, struct ucred *u2);

Modified: head/sys/x86/x86/tsc.c
==
--- head/sys/x86/x86/tsc.c  Wed Jun 22 16:26:21 2011(r223425)
+++ head/sys/x86/x86/tsc.c  Wed Jun 22 16:40:45 2011(r223426)
@@ -444,6 +444,19 @@ init_TSC_tc(void)
goto init;
}
 
+   /*
+* We cannot use the TSC if it stops incrementing in deep sleep.
+* Currently only Intel CPUs are known for this problem unless
+* the invariant TSC bit is set.
+*/
+   if (cpu_can_deep_sleep  cpu_vendor_id == CPU_VENDOR_INTEL 
+   (amd_pminfo  AMDPM_TSC_INVARIANT) == 0) {
+   tsc_timecounter.tc_quality = -1000;
+   if (bootverbose)
+   printf(TSC timecounter disabled: C3 enabled.\n);
+   goto init;
+   }
+
 #ifdef SMP
/*
 * We can not use the TSC in SMP mode unless the TSCs on all CPUs are
___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Jung-uk Kim
On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote:
 on 22/06/2011 19:40 Jung-uk Kim said the following:
  Author: jkim
  Date: Wed Jun 22 16:40:45 2011
  New Revision: 223426
  URL: http://svn.freebsd.org/changeset/base/223426
 
  Log:
Set negative quality to TSC timecounter when C3 state is
  enabled for Intel processors unless the invariant TSC bit of
  CPUID is set.  Intel processors may stop incrementing TSC when
  DPSLP# pin is asserted, according to Intel processor manuals, i.
  e., TSC timecounter is useless if the processor can enter deep
  sleep state (C3/C4).  This problem was accidentally uncovered by
  r222869, which increased timecounter quality of P-state invariant
  TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270
  (Family 6, Model 1c).
 
Reported by:  Fabian Keil (freebsd-listen at fabiankeil dot de)
  Ian FREISLICH (ianf at clue dot co dot za)
Tested by:Fabian Keil (freebsd-listen at fabiankeil dot de)
  - Core2 Duo T5870 (C3 state available/enabled)
  jkim - Xeon X5150 (C3 state unavailable)

 I think that this change should have a counterpart similar to what
 was done for event timers.  That is, if a user forces use of TSC as
 a timecounter vis sysctl and it is known that TSC stops in the deep
 C-state, then the deep C-states should not be entered.  This is
 what cpu_disable_deep_sleep does for LAPIC timers.

Yes.  We have to teach tc_windup() to increase/decrease 
cpu_disable_deep_sleep.  Currently, the user must disable C3 and 
force TSC timecounter manually if power consumption is not important, 
e.g.,

/etc/rc.conf:
economy_cx_lowest=C2

/etc/sysctl.conf:
kern.timecounter.hardware=TSC

Jung-uk Kim
___
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: r223428 - in head/sys: amd64/pci i386/pci

2011-06-22 Thread John Baldwin
Author: jhb
Date: Wed Jun 22 17:55:16 2011
New Revision: 223428
URL: http://svn.freebsd.org/changeset/base/223428

Log:
  Use uintXX_t instead of u_intXX_t.

Modified:
  head/sys/amd64/pci/pci_bus.c
  head/sys/i386/pci/pci_bus.c

Modified: head/sys/amd64/pci/pci_bus.c
==
--- head/sys/amd64/pci/pci_bus.cWed Jun 22 17:31:50 2011
(r223427)
+++ head/sys/amd64/pci/pci_bus.cWed Jun 22 17:55:16 2011
(r223428)
@@ -135,7 +135,7 @@ static void
 legacy_pcib_identify(driver_t *driver, device_t parent)
 {
int bus, slot, func;
-   u_int8_t  hdrtype;
+   uint8_t  hdrtype;
int found = 0;
int pcifunchigh;
int found824xx = 0;
@@ -178,8 +178,8 @@ legacy_pcib_identify(driver_t *driver, d
/*
 * Read the IDs and class from the device.
 */
-   u_int32_t id;
-   u_int8_t class, subclass, busnum;
+   uint32_t id;
+   uint8_t class, subclass, busnum;
const char *s;
device_t *devs;
int ndevs, i;

Modified: head/sys/i386/pci/pci_bus.c
==
--- head/sys/i386/pci/pci_bus.c Wed Jun 22 17:31:50 2011(r223427)
+++ head/sys/i386/pci/pci_bus.c Wed Jun 22 17:55:16 2011(r223428)
@@ -62,7 +62,7 @@ legacy_pcib_maxslots(device_t dev)
 
 /* read configuration space register */
 
-u_int32_t
+uint32_t
 legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func,
u_int reg, int bytes)
 {
@@ -73,7 +73,7 @@ legacy_pcib_read_config(device_t dev, u_
 
 void
 legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func,
-u_int reg, u_int32_t data, int bytes)
+u_int reg, uint32_t data, int bytes)
 {
pci_cfgregwrite(bus, slot, func, reg, data, bytes);
 }
@@ -342,7 +342,7 @@ static void
 legacy_pcib_identify(driver_t *driver, device_t parent)
 {
int bus, slot, func;
-   u_int8_t  hdrtype;
+   uint8_t  hdrtype;
int found = 0;
int pcifunchigh;
int found824xx = 0;
@@ -385,8 +385,8 @@ legacy_pcib_identify(driver_t *driver, d
/*
 * Read the IDs and class from the device.
 */
-   u_int32_t id;
-   u_int8_t class, subclass, busnum;
+   uint32_t id;
+   uint8_t class, subclass, busnum;
const char *s;
device_t *devs;
int ndevs, i;
___
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: r223429 - head/sbin/growfs

2011-06-22 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 22 17:59:53 2011
New Revision: 223429
URL: http://svn.freebsd.org/changeset/base/223429

Log:
  Cosmetic fixes; mostly s/file system/filesystem/g and removing weird indent
  from messages.

Modified:
  head/sbin/growfs/growfs.8
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.8
==
--- head/sbin/growfs/growfs.8   Wed Jun 22 17:55:16 2011(r223428)
+++ head/sbin/growfs/growfs.8   Wed Jun 22 17:59:53 2011(r223429)
@@ -37,12 +37,12 @@
 .\ $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
 .\ $FreeBSD$
 .\
-.Dd May 8, 2011
+.Dd June 22, 2011
 .Dt GROWFS 8
 .Os
 .Sh NAME
 .Nm growfs
-.Nd grow size of an existing UFS file system
+.Nd expand an existing UFS filesystem
 .Sh SYNOPSIS
 .Nm
 .Op Fl Ny
@@ -58,26 +58,26 @@ Before starting
 .Nm
 the disk must be labeled to a bigger size using
 .Xr bsdlabel 8 .
-If you wish to grow a file system beyond the boundary of
-the slice it resides in, you must re-size the slice using
-.Xr fdisk 8
+If you wish to grow a filesystem beyond the boundary of
+the slice it resides in, you must resize the slice using
+.Xr gpart 8
 before running
 .Nm .
 If you are using volumes you must enlarge them by using
-.Xr vinum 8 .
+.Xr gvinum 8 .
 The
 .Nm
-utility extends the size of the file system on the specified special file.
+utility extends the size of the filesystem on the specified special file.
 Currently
 .Nm
-can only enlarge unmounted file systems.
-Do not try enlarging a mounted file system, your system may panic and you will
-not be able to use the file system any longer.
+can only enlarge unmounted filesystems.
+Do not try enlarging a mounted filesystem, your system may panic and you will
+not be able to use the filesystem any longer.
 Most of the
 .Xr newfs 8
 options cannot be changed by
 .Nm .
-In fact, you can only increase the size of the file system.
+In fact, you can only increase the size of the filesystem.
 Use
 .Xr tunefs 8
 for other changes.
@@ -86,8 +86,8 @@ The following options are available:
 .Bl -tag -width indent
 .It Fl N
 .Dq Test mode .
-Causes the new file system parameters to be printed out without actually
-enlarging the file system.
+Causes the new filesystem parameters to be printed out without actually
+enlarging the filesystem.
 .It Fl y
 .Dq Expert mode .
 Usually
@@ -102,12 +102,12 @@ So use this option with great care!
 .It Fl s Ar size
 Determines the
 .Ar size
-of the file system after enlarging in sectors.
+of the filesystem after enlarging in sectors.
 This value defaults to the size of the raw partition specified in
 .Ar special
 (in other words,
 .Nm
-will enlarge the file system to the size of the entire partition).
+will enlarge the filesystem to the size of the entire partition).
 .El
 .Sh EXAMPLES
 .Dl growfs -s 4194304 /dev/vinum/testvol
@@ -119,12 +119,12 @@ up to 2GB if there is enough space in
 .Sh SEE ALSO
 .Xr bsdlabel 8 ,
 .Xr dumpfs 8 ,
-.Xr fdisk 8 ,
 .Xr ffsinfo 8 ,
 .Xr fsck 8 ,
+.Xr gpart 8 ,
 .Xr newfs 8 ,
 .Xr tunefs 8 ,
-.Xr vinum 8
+.Xr gvinum 8
 .Sh HISTORY
 The
 .Nm
@@ -144,12 +144,12 @@ There may be cases on
 .Fx
 3.x only, when
 .Nm
-does not recognize properly whether or not the file system is mounted and
+does not recognize properly whether or not the filesystem is mounted and
 exits with an error message.
 Then please use
 .Nm
 .Fl y
-if you are sure that the file system is not mounted.
+if you are sure that the filesystem is not mounted.
 It is also recommended to always use
 .Xr fsck 8
 after enlarging (just to be on the safe side).
@@ -183,8 +183,8 @@ on the first cylinder group to verify th
 in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP
 .Em cgr0
 has enough blocks.
-As a rule of thumb for default file system parameters one block is needed for
-every 2 GB of total file system size.
+As a rule of thumb for default filesystem parameters one block is needed for
+every 2 GB of total filesystem size.
 .Pp
 Normally
 .Nm

Modified: head/sbin/growfs/growfs.c
==
--- head/sbin/growfs/growfs.c   Wed Jun 22 17:55:16 2011(r223428)
+++ head/sbin/growfs/growfs.c   Wed Jun 22 17:59:53 2011(r223429)
@@ -160,7 +160,7 @@ static void get_dev_size(int, int *);
 
 /*  growfs * */
 /*
- * Here we actually start growing the file system. We basically read the
+ * Here we actually start growing the filesystem. We basically read the
  * cylinder summary from the first cylinder group as we want to update
  * this on the fly during our various operations. First we handle the
  * changes in the former last cylinder group. Afterwards we create all new
@@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf
updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag);
 
/*
-* Dump out summary 

svn commit: r223430 - in head/sbin: newfs tunefs

2011-06-22 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 22 18:02:28 2011
New Revision: 223430
URL: http://svn.freebsd.org/changeset/base/223430

Log:
  Advertise growfs(8) a little better.

Modified:
  head/sbin/newfs/newfs.8
  head/sbin/tunefs/tunefs.8

Modified: head/sbin/newfs/newfs.8
==
--- head/sbin/newfs/newfs.8 Wed Jun 22 17:59:53 2011(r223429)
+++ head/sbin/newfs/newfs.8 Wed Jun 22 18:02:28 2011(r223430)
@@ -28,7 +28,7 @@
 .\ @(#)newfs.88.6 (Berkeley) 5/3/95
 .\ $FreeBSD$
 .\
-.Dd May 25, 2011
+.Dd June 22, 2011
 .Dt NEWFS 8
 .Os
 .Sh NAME
@@ -297,6 +297,7 @@ on file systems that contain many small 
 .Xr dumpfs 8 ,
 .Xr fsck 8 ,
 .Xr gjournal 8 ,
+.Xr growfs 8 ,
 .Xr makefs 8 ,
 .Xr mount 8 ,
 .Xr tunefs 8 ,

Modified: head/sbin/tunefs/tunefs.8
==
--- head/sbin/tunefs/tunefs.8   Wed Jun 22 17:59:53 2011(r223429)
+++ head/sbin/tunefs/tunefs.8   Wed Jun 22 18:02:28 2011(r223430)
@@ -28,7 +28,7 @@
 .\ @(#)tunefs.8   8.2 (Berkeley) 12/11/93
 .\ $FreeBSD$
 .\
-.Dd May 8, 2011
+.Dd June 22, 2011
 .Dt TUNEFS 8
 .Os
 .Sh NAME
@@ -165,6 +165,7 @@ specified mount point.
 .Xr fs 5 ,
 .Xr dumpfs 8 ,
 .Xr gjournal 8 ,
+.Xr growfs 8 ,
 .Xr newfs 8
 .Rs
 .%A M. McKusick
___
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: r223433 - in head/sys: amd64/include i386/include

2011-06-22 Thread John Baldwin
Author: jhb
Date: Wed Jun 22 18:48:07 2011
New Revision: 223433
URL: http://svn.freebsd.org/changeset/base/223433

Log:
  Oops, missed these in 223424.
  
  Reported by:  jkim

Modified:
  head/sys/amd64/include/pci_cfgreg.h
  head/sys/i386/include/pci_cfgreg.h

Modified: head/sys/amd64/include/pci_cfgreg.h
==
--- head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 18:22:53 2011
(r223432)
+++ head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011
(r223433)
@@ -37,6 +37,7 @@
 #define CONF1_ENABLE_MSK1  0x8001ul
 #define CONF1_ENABLE_RES1  0x8000ul
 
+u_long hostb_alloc_start(int type, u_long start, u_long end, u_long 
count);
 intpcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
 intpci_cfgregopen(void);
 u_int32_t  pci_cfgregread(int bus, int slot, int func, int reg, int bytes);

Modified: head/sys/i386/include/pci_cfgreg.h
==
--- head/sys/i386/include/pci_cfgreg.h  Wed Jun 22 18:22:53 2011
(r223432)
+++ head/sys/i386/include/pci_cfgreg.h  Wed Jun 22 18:48:07 2011
(r223433)
@@ -43,6 +43,7 @@
 #define CONF2_ENABLE_CHK   0x0e
 #define CONF2_ENABLE_RES   0x0e
 
+u_long hostb_alloc_start(int type, u_long start, u_long end, u_long 
count);
 intpcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
 intpci_cfgregopen(void);
 u_int32_t  pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Jung-uk Kim
On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote:
 on 22/06/2011 19:40 Jung-uk Kim said the following:
  Author: jkim
  Date: Wed Jun 22 16:40:45 2011
  New Revision: 223426
  URL: http://svn.freebsd.org/changeset/base/223426
 
  Log:
Set negative quality to TSC timecounter when C3 state is
  enabled for Intel processors unless the invariant TSC bit of
  CPUID is set.  Intel processors may stop incrementing TSC when
  DPSLP# pin is asserted, according to Intel processor manuals, i.
  e., TSC timecounter is useless if the processor can enter deep
  sleep state (C3/C4).  This problem was accidentally uncovered by
  r222869, which increased timecounter quality of P-state invariant
  TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270
  (Family 6, Model 1c).
 
Reported by:  Fabian Keil (freebsd-listen at fabiankeil dot de)
  Ian FREISLICH (ianf at clue dot co dot za)
Tested by:Fabian Keil (freebsd-listen at fabiankeil dot de)
  - Core2 Duo T5870 (C3 state available/enabled)
  jkim - Xeon X5150 (C3 state unavailable)

 I think that this change should have a counterpart similar to what
 was done for event timers.  That is, if a user forces use of TSC as
 a timecounter vis sysctl and it is known that TSC stops in the deep
 C-state, then the deep C-states should not be entered.  This is
 what cpu_disable_deep_sleep does for LAPIC timers.

Can you please review/test the attached patch?  Also available from 
here:

http://people.freebsd.org/~jkim/tc_c3stop.diff

Thanks!

Jung-uk Kim
Index: sys/kern/kern_tc.c
===
--- sys/kern/kern_tc.c  (revision 223426)
+++ sys/kern/kern_tc.c  (working copy)
@@ -492,6 +492,10 @@ tc_windup(void)
 
/* Now is a good time to change timecounters. */
if (th-th_counter != timecounter) {
+   if ((timecounter-tc_flags  TC_FLAGS_C3STOP) != 0)
+   cpu_disable_deep_sleep++;
+   if ((th-th_counter-tc_flags  TC_FLAGS_C3STOP) != 0)
+   cpu_disable_deep_sleep--;
th-th_counter = timecounter;
th-th_offset_count = ncount;
tc_min_ticktock_freq = max(1, timecounter-tc_frequency /
Index: sys/sparc64/sparc64/counter.c
===
--- sys/sparc64/sparc64/counter.c   (revision 223426)
+++ sys/sparc64/sparc64/counter.c   (working copy)
@@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t
tc-tc_name = strdup(name, M_DEVBUF);
tc-tc_priv = sc;
tc-tc_quality = COUNTER_QUALITY;
+   tc-tc_flags = 0;
tc_init(tc);
 }
 
Index: sys/sys/timetc.h
===
--- sys/sys/timetc.h(revision 223426)
+++ sys/sys/timetc.h(working copy)
@@ -57,6 +57,8 @@ struct timecounter {
 * another timecounter higher means better.  Negative
 * means only use at explicit request.
 */
+   u_int   tc_flags;
+#defineTC_FLAGS_C3STOP 1   /* Timer dies in C3. */
 
void*tc_priv;
/* Pointer to the timecounter's private parts. */
Index: sys/x86/x86/tsc.c
===
--- sys/x86/x86/tsc.c   (revision 223426)
+++ sys/x86/x86/tsc.c   (working copy)
@@ -451,6 +451,7 @@ init_TSC_tc(void)
 */
if (cpu_can_deep_sleep  cpu_vendor_id == CPU_VENDOR_INTEL 
(amd_pminfo  AMDPM_TSC_INVARIANT) == 0) {
+   tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP;
tsc_timecounter.tc_quality = -1000;
if (bootverbose)
printf(TSC timecounter disabled: C3 enabled.\n);
___
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: r223307 - head/sys/vm

2011-06-22 Thread Bruce Evans

On Wed, 22 Jun 2011, John Baldwin wrote:


On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote:

On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:

...
vm_page.o: In function `vm_page_clear_dirty':
/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 
against `atomic_clear_8'
vm_page.o: In function `vm_page_set_validclean':
/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'
/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 
against `atomic_clear_8'


Atomic types shorter than int cannot be used in MI code, since they might
not exist.  Apparently they don't exist on mips.  jake@ fixed all their
old uses for sparc4 in ~Y2K.


I agree.  Is there any harm in having the 'dirty' and 'valid' fields in
vm_page always be at least of size 'int'?

In the case of amd64, vm_page would change from a size of 120 bytes to 128.

On i386 I think you'd end up changing the size from 68 to 76.

(Using an int results in alignment padding after 'busy'.)


That is quite a bit.  Perhaps the struct should be packed better so that
each char - int expansion takes = 3 bytes instead of = 4.  The
expansion might even be negative.  It is only moderately well packed now.


Hmm, that's around 120k of extra vm_page_t space for a machine with 64M of
RAM, so around 0.18% of RAM would be used on both platforms (presumably the
usage would be similar on other platforms as well).  At 24 GB of RAM, the
extra space is just under 0.20% of RAM (48M).


Bruce
___
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: r223307 - head/sys/vm

2011-06-22 Thread Bruce Evans

On Wed, 22 Jun 2011, Warner Losh wrote:


On Jun 22, 2011, at 3:26 AM, Attilio Rao wrote:


2011/6/22 Warner Losh i...@bsdimp.com:


On Jun 21, 2011, at 5:27 PM, Alan Cox wrote:

On 06/21/2011 16:09, Attilio Rao wrote:

2011/6/21 Bruce Evansb...@optusnet.com.au:

On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote:

On Jun 19, 2011, at 7:13 PM, Alan Cox wrote:

Hi Alan,

Author: alc

Date: Sun Jun 19 19:13:24 2011

New Revision: 223307

URL: http://svn.freebsd.org/changeset/base/223307

Log:

 Precisely document the synchronization rules for the page's dirty field.

 (Saying that the lock on the object that the page belongs to must be

held

 only represents one aspect of the rules.)

 Eliminate the use of the page queues lock for atomically performing

read-

 modify-write operations on the dirty field when the underlying

architecture

 supports atomic operations on char and short types.

 Document the fact that 32KB pages aren't really supported.

contrary to the tinderbox I'd like to point out that all mips kernels

built by universe are broken with a SVN HEAD from earlier today.  Could you

please check and see if you can fix it?  The errors I get are:

vm_page.o: In function `vm_page_clear_dirty':

/sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8'

/sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26

against `atomic_clear_8'

vm_page.o: In function `vm_page_set_validclean':

/sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8'

/sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26

against `atomic_clear_8'

Atomic types shorter than int cannot be used in MI code, since they might

not exist.  Apparently they don't exist on mips.  jake@ fixed all their

old uses for sparc4 in ~Y2K.

I'm sure they do, they exist in support.S though and may not have the

_8 form (they may just have the _char version). I may look at the code

again to be sure.


It appears that while mips/include/atomic.h declares the existence of
atomic_clear_8, mips/mips/support.S doesn't implement it.  In other words,
only support for int's and short's is currently implemented, not char's:

# grep atomic_clear mips/mips/support.S
* atomic_clear_32(u_int32_t *a, u_int32_t b)
LEAF(atomic_clear_32)
END(atomic_clear_32)
* atomic_clear_16(u_int16_t *a, u_int16_t b)
LEAF(atomic_clear_16)
END(atomic_clear_16)

The current crop of atomic*16 and atomic*8 functions have the restriction
that the address must be 32-bit aligned (and it forces this by aligning to
32-bits silently and then operates on the low 8 or 16 bits in that word!)
I'm guessing that this is likely just wrong.  Comments?
Warner


That is wrong, of course, and my personal opinion is that one should
not implement atomic operations if they cannot be done efficiently
(example: if you need to disable interrupts or similar expensive
operation just to assure atomicity of operation, just don't support
it) as long as not having _8/_char is perfectly fine.


I think it can be efficient, for some reasonable definition of efficient.  The 
masking and shifting operations aren't that onerous to write and the 
instructions cycles would be dwarfed by the ll/sc pair, which are required to 
implement atomic.

The issue is that the code today is clearly wrong and needs to be fixed.


I think it is still good to discourage use of non-bus-width atomic ops
by not supporting at the MI level them for any arch.

Suppose only bus-width accesses are atomic, as seems to be the case
on mips.  Then you can still do atomic accesses on bytes by doing an
atomic op on the neigbouring 3 or 7 bytes.  But this may increase
memory contention by a factor of 3 or 7.  The contention can be
reduced either by putting only rarely-accessed bytes near the bytes
that need the atomic ops, or by putting unused padding there, or
by not using byte-sized objects to begin with (this gives the same
effect and even the same memory accesses as unused padding bytes --
there are unused bits in the objects instead of external unused bytes).
The former can be arranged easily enough in the vm_page struct.  But
MI code shouldn't know about this.

Suppose byte accesses are atomic at the instruction level.  Then the
hardware probably still needs to expand to the bus width.  Depending
on how well it virtualizes this, there may be the same factor of 3, 7
or more in memory contention.  The relevant bus width may be the cache
line size which on modern CPUs is much more than 4 bytes and probably
more like 32.  So the CPU must already being doing good virtualization
to make 4-byte atomic accesses not too slow (non-atomic accesses are
already virtualized by the caches).  For efficiency, we really should
pay more attention to packing related int variables into cache lines
(either the same line to increase cache hits or separate lines, to
reduce contention), but the best way to do this is very MD and unclear.

Bruce
___

svn commit: r223436 - head/sys/fs/nfs

2011-06-22 Thread Rick Macklem
Author: rmacklem
Date: Wed Jun 22 19:47:45 2011
New Revision: 223436
URL: http://svn.freebsd.org/changeset/base/223436

Log:
  Fix the new NFSv4 client so that it uses the same uid as
  was used for doing a mount when performing system operations
  on AUTH_SYS mounts.  This resolved an issue when mounting
  a Linux server. Found during testing at the recent
  NFSv4 interoperability Bakeathon.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==
--- head/sys/fs/nfs/nfs_commonkrpc.cWed Jun 22 19:42:32 2011
(r223435)
+++ head/sys/fs/nfs/nfs_commonkrpc.cWed Jun 22 19:47:45 2011
(r223436)
@@ -526,6 +526,20 @@ newnfs_request(struct nfsrv_descript *nd
else
secflavour = RPCSEC_GSS_KRB5;
srv_principal = NFSMNT_SRVKRBNAME(nmp);
+   } else if (nmp != NULL  !NFSHASKERB(nmp) 
+   nd-nd_procnum != NFSPROC_NULL 
+   (nd-nd_flag  ND_USEGSSNAME) != 0) {
+   /*
+* Use the uid that did the mount when the RPC is doing
+* NFSv4 system operations, as indicated by the
+* ND_USEGSSNAME flag, for the AUTH_SYS case.
+*/
+   saved_uid = cred-cr_uid;
+   if (nmp-nm_uid != (uid_t)-1)
+   cred-cr_uid = nmp-nm_uid;
+   else
+   cred-cr_uid = 0;
+   set_uid = 1;
}
 
if (nmp != NULL) {
___
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: r223429 - head/sbin/growfs

2011-06-22 Thread Bruce Evans

On Wed, 22 Jun 2011, Edward Tomasz Napierala wrote:


Log:
 Cosmetic fixes; mostly s/file system/filesystem/g and removing weird indent
 from messages.


The first part seems backwards.  It undoes the 2002 change that does
s/filesystem/file system/g, except the 2002 change was not restricted
to growfs.

'file system' seems best English in most contexts, but not all, so
such changes should not be done mechanically.  'filesystem' might be
best German or Danish.  I like to use 'file system' for individual
file systems, but `filesystem' for things like the handler of a file
system.  But I don't like renaming things and wouldn't touch this :-).


Modified: head/sbin/growfs/growfs.8
==
--- head/sbin/growfs/growfs.8   Wed Jun 22 17:55:16 2011(r223428)
+++ head/sbin/growfs/growfs.8   Wed Jun 22 17:59:53 2011(r223429)
@@ -37,12 +37,12 @@
.\ $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $
.\ $FreeBSD$
.\
-.Dd May 8, 2011
+.Dd June 22, 2011
.Dt GROWFS 8
.Os
.Sh NAME
.Nm growfs
-.Nd grow size of an existing UFS file system
+.Nd expand an existing UFS filesystem


Also, UFS doesn't exist.  See ffs(7), the fastfs paper in /usr/share/doc,
and ufs(nonexistent).

I would use 'file system' here since it is an individual file system
being expanded, and 'filesystem' for the ffs filesystem implementation.

Bruce
___
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: r223437 - head/sys/netinet/libalias

2011-06-22 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jun 22 20:00:27 2011
New Revision: 223437
URL: http://svn.freebsd.org/changeset/base/223437

Log:
  Export AddLink() function from libalias.  It can be used when custom
  alias address needs to be specified.
  Add inbound handler to the alias_ftp module. It helps handle active
  FTP transfer mode for the case with external clients and FTP server behind
  NAT. Fix passive FTP transfer case for server behind NAT using redirect with
  external IP address different from NAT ip address.
  
  PR:   kern/157957
  Submitted by: Alexander V. Chernikov

Modified:
  head/sys/netinet/libalias/alias_db.c
  head/sys/netinet/libalias/alias_ftp.c
  head/sys/netinet/libalias/alias_local.h
  head/sys/netinet/libalias/libalias.3

Modified: head/sys/netinet/libalias/alias_db.c
==
--- head/sys/netinet/libalias/alias_db.cWed Jun 22 19:47:45 2011
(r223436)
+++ head/sys/netinet/libalias/alias_db.cWed Jun 22 20:00:27 2011
(r223437)
@@ -552,10 +552,6 @@ static voidIncrementalCleanup(struct li
 static voidDeleteLink(struct alias_link *);
 
 static struct alias_link *
-AddLink(struct libalias *, struct in_addr, struct in_addr, struct in_addr,
-u_short, u_short, int, int);
-
-static struct alias_link *
 ReLink(struct alias_link *,
 struct in_addr, struct in_addr, struct in_addr,
 u_short, u_short, int, int);
@@ -572,9 +568,6 @@ static struct alias_link *
 #define ALIAS_PORT_MASK_EVEN   0x07ffe
 #define GET_NEW_PORT_MAX_ATTEMPTS   20
 
-#define GET_ALIAS_PORT  -1
-#define GET_ALIAS_IDGET_ALIAS_PORT
-
 #define FIND_EVEN_ALIAS_BASE 1
 
 /* GetNewPort() allocates port numbers.  Note that if a port number
@@ -937,17 +930,12 @@ DeleteLink(struct alias_link *lnk)
 }
 
 
-static struct alias_link *
-AddLink(struct libalias *la, struct in_addr src_addr,
-struct in_addr dst_addr,
-struct in_addr alias_addr,
-u_short src_port,
-u_short dst_port,
-int alias_port_param,  /* if less than zero, alias   */
-int link_type)
-{  /* port will be automatically *//* chosen.
-* If greater than*/
-   u_int start_point;  /* zero, equal to alias port  */
+struct alias_link *
+AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr,
+struct in_addr alias_addr, u_short src_port, u_short dst_port,
+int alias_port_param, int link_type)
+{
+   u_int start_point;
struct alias_link *lnk;
 
LIBALIAS_LOCK_ASSERT(la);

Modified: head/sys/netinet/libalias/alias_ftp.c
==
--- head/sys/netinet/libalias/alias_ftp.c   Wed Jun 22 19:47:45 2011
(r223436)
+++ head/sys/netinet/libalias/alias_ftp.c   Wed Jun 22 20:00:27 2011
(r223437)
@@ -100,38 +100,68 @@ __FBSDID($FreeBSD$);
 #define FTP_CONTROL_PORT_NUMBER 21
 
 static void
-AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, 
- int maxpacketsize);
+AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *,
+int maxpacketsize);
+static void
+AliasHandleFtpIn(struct libalias *, struct ip *, struct alias_link *);
 
-static int 
-fingerprint(struct libalias *la, struct alias_data *ah)
+static int
+fingerprint_out(struct libalias *la, struct alias_data *ah)
 {
 
-   if (ah-dport == NULL || ah-sport == NULL || ah-lnk == NULL || 
-   ah-maxpktsize == 0)
+   if (ah-dport == NULL || ah-sport == NULL || ah-lnk == NULL ||
+   ah-maxpktsize == 0)
return (-1);
-   if (ntohs(*ah-dport) == FTP_CONTROL_PORT_NUMBER
-   || ntohs(*ah-sport) == FTP_CONTROL_PORT_NUMBER)
+   if (ntohs(*ah-dport) == FTP_CONTROL_PORT_NUMBER ||
+   ntohs(*ah-sport) == FTP_CONTROL_PORT_NUMBER)
return (0);
return (-1);
 }
 
-static int 
-protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
+static int
+fingerprint_in(struct libalias *la, struct alias_data *ah)
+{
+
+   if (ah-dport == NULL || ah-sport == NULL || ah-lnk == NULL)
+   return (-1);
+   if (ntohs(*ah-dport) == FTP_CONTROL_PORT_NUMBER ||
+   ntohs(*ah-sport) == FTP_CONTROL_PORT_NUMBER)
+   return (0);
+   return (-1);
+}
+
+static int
+protohandler_out(struct libalias *la, struct ip *pip, struct alias_data *ah)
 {
-   
+
AliasHandleFtpOut(la, pip, ah-lnk, ah-maxpktsize);
return (0);
 }
 
+
+static int
+protohandler_in(struct libalias *la, struct ip *pip, struct alias_data *ah)
+{
+
+   AliasHandleFtpIn(la, pip, ah-lnk);
+   return (0);
+}
+
 struct proto_handler handlers[] = {
-   { 
- .pri = 80, 
- .dir = OUT, 
- .proto = TCP, 
- .fingerprint = fingerprint, 
- .protohandler = 

svn commit: r223440 - in head/sys: amd64/include amd64/pci conf i386/include i386/pci x86/include x86/pci

2011-06-22 Thread John Baldwin
Author: jhb
Date: Wed Jun 22 21:04:13 2011
New Revision: 223440
URL: http://svn.freebsd.org/changeset/base/223440

Log:
  Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to
  the x86 tree.  The $PIR code is still only enabled on i386 and not amd64.
  While here, make the qpi(4) driver on conditional on 'device pci'.

Added:
  head/sys/x86/include/pci_cfgreg.h
 - copied, changed from r223433, head/sys/i386/include/pci_cfgreg.h
  head/sys/x86/pci/pci_bus.c
 - copied, changed from r223428, head/sys/i386/pci/pci_bus.c
Deleted:
  head/sys/amd64/pci/pci_bus.c
  head/sys/i386/pci/pci_bus.c
Modified:
  head/sys/amd64/include/pci_cfgreg.h
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/files.pc98
  head/sys/i386/include/param.h
  head/sys/i386/include/pci_cfgreg.h

Modified: head/sys/amd64/include/pci_cfgreg.h
==
--- head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 20:20:49 2011
(r223439)
+++ head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011
(r223440)
@@ -1,44 +1,6 @@
 /*-
- * Copyright (c) 1997, Stefan Esser s...@freebsd.org
- * 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$
- *
+ * This file is in the public domain.
  */
+/* $FreeBSD$ */
 
-#define CONF1_ADDR_PORT0x0cf8
-#define CONF1_DATA_PORT0x0cfc
-
-#define CONF1_ENABLE   0x8000ul
-#define CONF1_ENABLE_CHK   0x8000ul
-#define CONF1_ENABLE_MSK   0x7f00ul
-#define CONF1_ENABLE_CHK1  0xff01ul
-#define CONF1_ENABLE_MSK1  0x8001ul
-#define CONF1_ENABLE_RES1  0x8000ul
-
-u_long hostb_alloc_start(int type, u_long start, u_long end, u_long 
count);
-intpcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus);
-intpci_cfgregopen(void);
-u_int32_t  pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
-void   pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t 
data, int bytes);
+#include x86/pci_cfgreg.h

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Jun 22 20:20:49 2011(r223439)
+++ head/sys/conf/files.amd64   Wed Jun 22 21:04:13 2011(r223440)
@@ -128,7 +128,6 @@ amd64/amd64/trap.c  standard
 amd64/amd64/uio_machdep.c  standard
 amd64/amd64/uma_machdep.c  standard
 amd64/amd64/vm_machdep.c   standard
-amd64/pci/pci_bus.coptionalpci
 amd64/pci/pci_cfgreg.c optionalpci
 crypto/aesni/aesencdec_amd64.S optional aesni
 crypto/aesni/aeskeys_amd64.S   optional aesni
@@ -315,7 +314,8 @@ x86/isa/isa.c   standard
 x86/isa/isa_dma.c  standard
 x86/isa/nmi.c  standard
 x86/isa/orm.c  optionalisa
-x86/pci/qpi.c  standard
+x86/pci/pci_bus.c  optionalpci
+x86/pci/qpi.c  optionalpci
 x86/x86/busdma_machdep.c   standard
 x86/x86/dump_machdep.c standard
 x86/x86/io_apic.c  standard

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Wed Jun 22 20:20:49 2011(r223439)
+++ head/sys/conf/files.i386Wed Jun 22 21:04:13 2011(r223440)
@@ -352,7 +352,6 @@ i386/linux/linux_support.s  optional comp
dependency  linux_assym.h
 i386/linux/linux_sysent.c  optional compat_linux
 i386/linux/linux_sysvec.c  optional compat_linux
-i386/pci/pci_bus.c optional pci
 i386/pci/pci_cfgreg.c  optional pci
 

svn commit: r223441 - head/sys/fs/nfs

2011-06-22 Thread Rick Macklem
Author: rmacklem
Date: Wed Jun 22 21:10:12 2011
New Revision: 223441
URL: http://svn.freebsd.org/changeset/base/223441

Log:
  Plug an mbuf leak in the new NFS client that occurred when a
  server replied NFS3ERR_JUKEBOX/NFS4ERR_DELAY to an rpc.
  This affected both NFSv3 and NFSv4. Found during testing
  at the recent NFSv4 interoperability Bakeathon.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==
--- head/sys/fs/nfs/nfs_commonkrpc.cWed Jun 22 21:04:13 2011
(r223440)
+++ head/sys/fs/nfs/nfs_commonkrpc.cWed Jun 22 21:10:12 2011
(r223441)
@@ -733,6 +733,8 @@ tryagain:
while (NFSD_MONOSEC  waituntil)
(void) nfs_catnap(PZERO, 0, nfstry);
trylater_delay *= 2;
+   m_freem(nd-nd_mrep);
+   nd-nd_mrep = NULL;
goto tryagain;
}
 
___
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: r223443 - head/sys/cam/ata

2011-06-22 Thread Will Andrews
Author: will
Date: Wed Jun 22 21:43:10 2011
New Revision: 223443
URL: http://svn.freebsd.org/changeset/base/223443

Log:
  Plumb support for the device advanced information CCB in the ATA XPT.
  
  This was previously done only for SCSI XPT in r223081, on which the change
  in r223089 depended in order to respond to serial number requests.  As a
  result of r223089, da(4) and ada(4) devices register a d_getattr for geom to
  use to obtain the information.
  
  Reported by:  ache
  Reviewed by:  ken

Modified:
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==
--- head/sys/cam/ata/ata_xpt.c  Wed Jun 22 21:18:37 2011(r223442)
+++ head/sys/cam/ata/ata_xpt.c  Wed Jun 22 21:43:10 2011(r223443)
@@ -1601,6 +1601,34 @@ ata_device_transport(struct cam_path *pa
 }
 
 static void
+ata_dev_advinfo(union ccb *start_ccb)
+{
+   struct cam_ed *device;
+   struct ccb_dev_advinfo *cdai;
+   off_t amt; 
+
+   start_ccb-ccb_h.status = CAM_REQ_INVALID;
+   device = start_ccb-ccb_h.path-device;
+   cdai = start_ccb-cdai;
+   switch(cdai-buftype) {
+   case CDAI_TYPE_SERIAL_NUM:
+   if (cdai-flags  CDAI_FLAG_STORE)
+   break;
+   start_ccb-ccb_h.status = CAM_REQ_CMP;
+   cdai-provsiz = device-serial_num_len;
+   if (device-serial_num_len == 0)
+   break;
+   amt = device-serial_num_len;
+   if (cdai-provsiz  cdai-bufsiz)
+   amt = cdai-bufsiz;
+   memcpy(cdai-buf, device-serial_num, amt);
+   break;
+   default:
+   break;
+   }
+}
+
+static void
 ata_action(union ccb *start_ccb)
 {
 
@@ -1652,6 +1680,11 @@ ata_action(union ccb *start_ccb)
}
/* FALLTHROUGH */
}
+   case XPT_DEV_ADVINFO:
+   {
+   ata_dev_advinfo(start_ccb);
+   break;
+   }
default:
xpt_action_default(start_ccb);
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: r223445 - head/libexec/tftpd

2011-06-22 Thread Craig Rodrigues
Author: rodrigc
Date: Wed Jun 22 22:05:37 2011
New Revision: 223445
URL: http://svn.freebsd.org/changeset/base/223445

Log:
  Fix typo.
  
  Reported by: Nick Mann njm at njm dot me dot uk

Modified:
  head/libexec/tftpd/tftpd.8

Modified: head/libexec/tftpd/tftpd.8
==
--- head/libexec/tftpd/tftpd.8  Wed Jun 22 21:53:45 2011(r223444)
+++ head/libexec/tftpd/tftpd.8  Wed Jun 22 22:05:37 2011(r223445)
@@ -273,7 +273,7 @@ was introduced in
 .Fx 7.4 .
 .Sh NOTES
 Files larger than 33488896 octets (65535 blocks) cannot be transferred
-without client and server supporting the the TFTP blocksize option (RFC2348),
+without client and server supporting the TFTP blocksize option (RFC2348),
 or the non-standard TFTP rollover option.
 .Pp
 Many tftp clients will not transfer files over 1678 octets (32767 blocks).
___
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: r223446 - head/sys/dev/usb/wlan

2011-06-22 Thread Gavin Atkinson
Author: gavin
Date: Wed Jun 22 22:08:55 2011
New Revision: 223446
URL: http://svn.freebsd.org/changeset/base/223446

Log:
  Use USB_VENDOR_OVISLINK define rather than the vendor ID.
  
  PR:   usb/158142
  Submitted by: Robert Millan rmh debian.org
  MFC after:1 week

Modified:
  head/sys/dev/usb/wlan/if_urtw.c

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Wed Jun 22 22:05:37 2011
(r223445)
+++ head/sys/dev/usb/wlan/if_urtw.c Wed Jun 22 22:08:55 2011
(r223446)
@@ -115,7 +115,7 @@ static const struct usb_device_id urtw_d
URTW_DEV_L(REALTEK, RTL8187),
URTW_DEV_L(SITECOMEU, WL168V1),
URTW_DEV_L(SURECOM, EP9001G2A),
-   { USB_VPI(0x1b75, 0x8187, URTW_REV_RTL8187L) },
+   { USB_VPI(USB_VENDOR_OVISLINK, 0x8187, URTW_REV_RTL8187L) },
{ USB_VPI(USB_VENDOR_DICKSMITH, 0x9401, URTW_REV_RTL8187L) },
{ USB_VPI(USB_VENDOR_HP, 0xca02, URTW_REV_RTL8187L) },
{ USB_VPI(USB_VENDOR_LOGITEC, 0x010c, URTW_REV_RTL8187L) },
___
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: r223447 - head/usr.bin/tftp

2011-06-22 Thread Craig Rodrigues
Author: rodrigc
Date: Wed Jun 22 22:55:51 2011
New Revision: 223447
URL: http://svn.freebsd.org/changeset/base/223447

Log:
  Bump date.
  Document the following commands which were added in the new TFTP 
implementation:
  blocksize, blocksize2, packetdrop, options, rollover

Modified:
  head/usr.bin/tftp/tftp.1

Modified: head/usr.bin/tftp/tftp.1
==
--- head/usr.bin/tftp/tftp.1Wed Jun 22 22:08:55 2011(r223446)
+++ head/usr.bin/tftp/tftp.1Wed Jun 22 22:55:51 2011(r223447)
@@ -28,7 +28,7 @@
 .\ @(#)tftp.1 8.2 (Berkeley) 4/18/94
 .\ $FreeBSD$
 .\
-.Dd October 1, 2003
+.Dd June 22, 2011
 .Dt TFTP 1
 .Os
 .Sh NAME
@@ -70,6 +70,21 @@ Shorthand for mode ascii
 .It Cm binary
 Shorthand for mode binary
 .Pp
+.It Cm blocksize Ar [size]
+Sets the TFTP blksize option in TFTP Read Request or Write Request packets
+to
+.Ar [size]
+as specified in RFC 2348.  Valid values are between 8 and 65464.
+If no blocksize is specified, then by default a blocksize of 512 bytes
+will be used.
+.Pp
+.It Cm blocksize2 Ar [size]
+Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets
+to
+.Ar [size] .
+Values are restricted to powers of 2 between 8 and 32768.  This is a
+non-standard TFTP option. 
+.Pp
 .It Cm connect Ar host Op Ar port
 Set the
 .Ar host
@@ -93,6 +108,14 @@ or
 .Cm put
 commands.
 .Pp
+.It Cm debug Ar level
+Enable or disable debugging levels during verbose output.  The value of 
+.Ar level
+can be one of
+.Cm packet, simple, options,
+or
+.Cm access.
+.Pp
 .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname
 .It Cm get Xo
 .Oo Ar host1 : Oc Ns Ar file1
@@ -130,6 +153,11 @@ or
 The default is
 .Em ascii .
 .Pp
+.It Cm packetdrop [arg]
+Randomly drop
+.Ar arg
+out of 100 packets during a transfer.  This is a debugging feature.
+.Pp
 .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename
 .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory
 Put a file or set of files to the remote host.
@@ -149,6 +177,17 @@ see the example under the
 .Cm get
 command.
 .Pp
+.It Cm options Ar [arg]
+Enable or disable support for TFTP options.  The valid values of
+.Ar arg
+are
+.Cm on
+(enable RFC 2347 options),
+.Cm off
+(disable RFC 2347 options), and
+.Cm extra
+(toggle support for non-RFC defined options).   
+.Pp
 .It Cm quit
 Exit
 .Nm .
@@ -157,6 +196,15 @@ An end of file also exits.
 .It Cm rexmt Ar retransmission-timeout
 Set the per-packet retransmission timeout, in seconds.
 .Pp
+.It Cm rollover [arg]
+Specify the rollover option in TFTP Read Request or Write
+Request packets.  After 65535 packets have been transmitted, set the block
+counter to
+.Ar arg .
+Valid values of
+.Ar arg
+are 0 and 1.  This is a non-standard TFTP option.
+.Pp
 .It Cm status
 Show current status.
 .Pp
___
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: r223449 - head/sys/dev/acpica

2011-06-22 Thread Jung-uk Kim
Author: jkim
Date: Wed Jun 22 22:56:42 2011
New Revision: 223449
URL: http://svn.freebsd.org/changeset/base/223449

Log:
  Fix build on ia64 after r223426.

Modified:
  head/sys/dev/acpica/acpi_cpu.c

Modified: head/sys/dev/acpica/acpi_cpu.c
==
--- head/sys/dev/acpica/acpi_cpu.c  Wed Jun 22 22:55:51 2011
(r223448)
+++ head/sys/dev/acpica/acpi_cpu.c  Wed Jun 22 22:56:42 2011
(r223449)
@@ -856,8 +856,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc *
sbuf_printf(sb, C%d/%d , i + 1, sc-cpu_cx_states[i].trans_lat);
if (sc-cpu_cx_states[i].type  ACPI_STATE_C3)
sc-cpu_non_c3 = i;
+#ifndef __ia64__
else
cpu_can_deep_sleep = 1;
+#endif
 }
 sbuf_trim(sb);
 sbuf_finish(sb);
___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Jung-uk Kim
On Wednesday 22 June 2011 02:55 pm, Jung-uk Kim wrote:
 On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote:
  on 22/06/2011 19:40 Jung-uk Kim said the following:
   Author: jkim
   Date: Wed Jun 22 16:40:45 2011
   New Revision: 223426
   URL: http://svn.freebsd.org/changeset/base/223426
  
   Log:
 Set negative quality to TSC timecounter when C3 state is
   enabled for Intel processors unless the invariant TSC bit of
   CPUID is set.  Intel processors may stop incrementing TSC when
   DPSLP# pin is asserted, according to Intel processor manuals,
   i. e., TSC timecounter is useless if the processor can enter
   deep sleep state (C3/C4).  This problem was accidentally
   uncovered by r222869, which increased timecounter quality of
   P-state invariant TSC, e.g., for Core2 Duo T5870 (Family 6,
   Model f) and Atom N270 (Family 6, Model 1c).
  
 Reported by:Fabian Keil (freebsd-listen at fabiankeil dot
   de) Ian FREISLICH (ianf at clue dot co dot za)
 Tested by:  Fabian Keil (freebsd-listen at fabiankeil dot de)
 - Core2 Duo T5870 (C3 state available/enabled)
 jkim - Xeon X5150 (C3 state unavailable)
 
  I think that this change should have a counterpart similar to
  what was done for event timers.  That is, if a user forces use of
  TSC as a timecounter vis sysctl and it is known that TSC stops in
  the deep C-state, then the deep C-states should not be entered. 
  This is what cpu_disable_deep_sleep does for LAPIC timers.

 Can you please review/test the attached patch?  Also available from
 here:

 http://people.freebsd.org/~jkim/tc_c3stop.diff

I just realized kern_clocksource.c was excluded for arm and ia64.  
Here is updated patch.  Please ignore the previous one.

Thanks,

Jung-uk Kim
Index: sys/kern/kern_tc.c
===
--- sys/kern/kern_tc.c  (revision 223446)
+++ sys/kern/kern_tc.c  (working copy)
@@ -492,6 +492,12 @@ tc_windup(void)
 
/* Now is a good time to change timecounters. */
if (th-th_counter != timecounter) {
+#if !defined(__arm__)  !defined(__ia64__)
+   if ((timecounter-tc_flags  TC_FLAGS_C3STOP) != 0)
+   cpu_disable_deep_sleep++;
+   if ((th-th_counter-tc_flags  TC_FLAGS_C3STOP) != 0)
+   cpu_disable_deep_sleep--;
+#endif
th-th_counter = timecounter;
th-th_offset_count = ncount;
tc_min_ticktock_freq = max(1, timecounter-tc_frequency /
Index: sys/sparc64/sparc64/counter.c
===
--- sys/sparc64/sparc64/counter.c   (revision 223446)
+++ sys/sparc64/sparc64/counter.c   (working copy)
@@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t
tc-tc_name = strdup(name, M_DEVBUF);
tc-tc_priv = sc;
tc-tc_quality = COUNTER_QUALITY;
+   tc-tc_flags = 0;
tc_init(tc);
 }
 
Index: sys/sys/timetc.h
===
--- sys/sys/timetc.h(revision 223446)
+++ sys/sys/timetc.h(working copy)
@@ -57,6 +57,8 @@ struct timecounter {
 * another timecounter higher means better.  Negative
 * means only use at explicit request.
 */
+   u_int   tc_flags;
+#defineTC_FLAGS_C3STOP 1   /* Timer dies in C3. */
 
void*tc_priv;
/* Pointer to the timecounter's private parts. */
Index: sys/x86/x86/tsc.c
===
--- sys/x86/x86/tsc.c   (revision 223446)
+++ sys/x86/x86/tsc.c   (working copy)
@@ -452,6 +452,7 @@ init_TSC_tc(void)
if (cpu_can_deep_sleep  cpu_vendor_id == CPU_VENDOR_INTEL 
(amd_pminfo  AMDPM_TSC_INVARIANT) == 0) {
tsc_timecounter.tc_quality = -1000;
+   tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP;
if (bootverbose)
printf(TSC timecounter disabled: C3 enabled.\n);
goto init;
___
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: r223450 - head/libexec/tftpd

2011-06-22 Thread Craig Rodrigues
Author: rodrigc
Date: Wed Jun 22 23:25:24 2011
New Revision: 223450
URL: http://svn.freebsd.org/changeset/base/223450

Log:
  Update references to RFC's that the newer TFTP implementation supports.

Modified:
  head/libexec/tftpd/tftpd.8

Modified: head/libexec/tftpd/tftpd.8
==
--- head/libexec/tftpd/tftpd.8  Wed Jun 22 22:56:42 2011(r223449)
+++ head/libexec/tftpd/tftpd.8  Wed Jun 22 23:25:24 2011(r223450)
@@ -235,12 +235,34 @@ option.
 .Xr services 5 ,
 .Xr syslog.conf 5 ,
 .Xr inetd 8
+.Pp
+The following RFC's are supported:
 .Rs
-.%A K. R. Sollins
+RFC 1350
 .%T The TFTP Protocol (Revision 2)
-.%D July 1992
-.%O RFC 1350, STD 33
 .Re
+.Rs
+RFC 2347
+.%T TFTP Option Extension
+.Re
+.Rs
+RFC 2348
+.%T TFTP Blocksize Option
+.Re
+.Rs
+RFC 2349
+.%T TFTP Timeout Interval and Transfer Size Options
+.Re
+.Pp
+The non-standard
+.Cm rollover
+and
+.Cm blksize2
+TFTP options are mentioned here:
+.Rs
+.%T Extending TFTP
+.%U http://www.compuphase.com/tftp.htm
+.Re 
 .Sh HISTORY
 The
 .Nm
___
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: r223451 - head/usr.bin/tftp

2011-06-22 Thread Craig Rodrigues
Author: rodrigc
Date: Wed Jun 22 23:26:04 2011
New Revision: 223451
URL: http://svn.freebsd.org/changeset/base/223451

Log:
  Update references to RFC's that the newer TFTP implementation supports.

Modified:
  head/usr.bin/tftp/tftp.1

Modified: head/usr.bin/tftp/tftp.1
==
--- head/usr.bin/tftp/tftp.1Wed Jun 22 23:25:24 2011(r223450)
+++ head/usr.bin/tftp/tftp.1Wed Jun 22 23:26:04 2011(r223451)
@@ -217,6 +217,40 @@ Toggle packet tracing.
 .It Cm verbose
 Toggle verbose mode.
 .El
+.Sh SEE ALSO
+.Xr tftp 1
+.Pp
+The following RFC's are supported:
+.Rs
+RFC 1350
+.%T The TFTP Protocol (Revision 2)
+.Re
+.Rs
+RFC 2347
+.%T TFTP Option Extension
+.Re
+.Rs
+RFC 2348
+.%T TFTP Blocksize Option
+.Re
+.Rs
+RFC 2349
+.%T TFTP Timeout Interval and Transfer Size Options
+.Re
+.Rs
+RFC 3617
+.%T Uniform Resource Identifier (URI) Scheme and Applicability Statement for 
the Trivial File Transfer Protocol (TFTP) 
+.Re
+.Pp
+The non-standard
+.Cm rollover
+and
+.Cm blksize2
+TFTP options are mentioned here:
+.Rs
+.%T Extending TFTP
+.%U http://www.compuphase.com/tftp.htm
+.Re
 .Sh HISTORY
 The
 .Nm
___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Marcel Moolenaar

On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote:
 
 I just realized kern_clocksource.c was excluded for arm and ia64.  
 Here is updated patch.  Please ignore the previous one.

Any reason why we're not adding kern_clocksource.c for them?

-- 
Marcel Moolenaar
mar...@xcllnt.net


___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Alexander Motin
Marcel Moolenaar wrote:
 On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote:
 I just realized kern_clocksource.c was excluded for arm and ia64.  
 Here is updated patch.  Please ignore the previous one.
 
 Any reason why we're not adding kern_clocksource.c for them?

Their event timers code still waits for refactoring. I have neither
documentation nor hardware for them. Help would be appreciated.

-- 
Alexander Motin
___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Marcel Moolenaar

On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote:

 Marcel Moolenaar wrote:
 On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote:
 I just realized kern_clocksource.c was excluded for arm and ia64.  
 Here is updated patch.  Please ignore the previous one.
 
 Any reason why we're not adding kern_clocksource.c for them?
 
 Their event timers code still waits for refactoring. I have neither
 documentation nor hardware for them. Help would be appreciated.

Can you give me a pointer to a document orpage that describes
what is being refactored, why and how?

Thanks,

-- 
Marcel Moolenaar
mar...@xcllnt.net


___
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: r223342 - head/contrib/top

2011-06-22 Thread Alexander Best
On Mon Jun 20 11, Xin LI wrote:
 Author: delphij
 Date: Mon Jun 20 16:48:00 2011
 New Revision: 223342
 URL: http://svn.freebsd.org/changeset/base/223342
 
 Log:
   Revert r214857 pursudant to 9.0-RELEASE cycle.

why does top(1) have so much problems with finding the applicable number of
available columns? ps(1) works great regarding this matter. for me it works
without the need for the -w or -ww switch under the console and under X and
always makes perfect use of the available columns.

i've never been able to make `top -a` display complete commands, although
there defenately are enough columns available.

cheers.
alex

   
   Requested by:   jh
 
 Modified:
   head/contrib/top/display.c
   head/contrib/top/top.h
 
 Modified: head/contrib/top/display.c
 ==
 --- head/contrib/top/display.cMon Jun 20 16:42:20 2011
 (r223341)
 +++ head/contrib/top/display.cMon Jun 20 16:48:00 2011
 (r223342)
 @@ -698,7 +698,7 @@ char *text;
   int width;
  
   s = NULL;
 - width = screen_width;
 + width = display_width;
   header_length = strlen(text);
   if (header_length = width) {
   s = malloc((width + 1) * sizeof(char));
 @@ -706,14 +706,6 @@ char *text;
   return (NULL);
   strncpy(s, text, width);
   s[width] = '\0';
 - } else {
 - s = malloc((width + 1) * sizeof(char));
 - if (s == NULL)
 - return (NULL);
 - strncpy(s, text, width);
 - while (screen_width  header_length)
 - s[header_length++] = ' ';
 - s[width] = '\0';
   }
   return (s);
  }
 @@ -738,7 +730,7 @@ char *text;
  if (header_status == ON)
  {
   putchar('\n');
 - standout(text, stdout);
 + fputs(text, stdout);
   lastline++;
  }
  else if (header_status == ERASE)
 
 Modified: head/contrib/top/top.h
 ==
 --- head/contrib/top/top.hMon Jun 20 16:42:20 2011(r223341)
 +++ head/contrib/top/top.hMon Jun 20 16:48:00 2011(r223342)
 @@ -14,7 +14,7 @@
  extern int Header_lines; /* 7 */
  
  /* Maximum number of columns allowed for display */
 -#define MAX_COLS 512
 +#define MAX_COLS 128
  
  /* Log base 2 of 1024 is 10 (2^10 == 1024) */
  #define LOG1024  10
___
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: r223426 - in head/sys: dev/acpica kern sys x86/x86

2011-06-22 Thread Alexander Motin
Marcel Moolenaar wrote:
 On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote:
 Marcel Moolenaar wrote:
 On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote:
 I just realized kern_clocksource.c was excluded for arm and ia64.  
 Here is updated patch.  Please ignore the previous one.
 Any reason why we're not adding kern_clocksource.c for them?
 Their event timers code still waits for refactoring. I have neither
 documentation nor hardware for them. Help would be appreciated.
 
 Can you give me a pointer to a document orpage that describes
 what is being refactored, why and how?

In short, timer management code was unified and formalized. Instead of
direct programming periodic timers from MD code and calling hard-/
stat-/ profclock() from there, timer hardware should be exposed to the
MI kernel using sys/timeet.h API to allow kern_clocksource.c manage it.
Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap()
callbacks from MD initialization code, and cpu_idleclock() and
cpu_activeclock() from MD cpu_idle().

Here is some references:
man 4 eventtimers
http://wiki.freebsd.org/201010DevSummit?action=AttachFiledo=viewtarget=timers.pdf
http://svnweb.freebsd.org/base?view=revisionrevision=209371
http://svnweb.freebsd.org/base?view=revisionrevision=212541

All architectures except ia64 and non-Marvell arm are already done, so
you may took any of them as reference. Ask me if you have any questions.

-- 
Alexander Motin
___
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: r223457 - head/release/doc/en_US.ISO8859-1/readme

2011-06-22 Thread Hiroki Sato
Author: hrs
Date: Thu Jun 23 02:35:55 2011
New Revision: 223457
URL: http://svn.freebsd.org/changeset/base/223457

Log:
  Remove links to mirrorlist.FreeBSD.org.
  
  Submitted by: ryusuke
  Reported by:  gavin, brucec

Modified:
  head/release/doc/en_US.ISO8859-1/readme/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml
==
--- head/release/doc/en_US.ISO8859-1/readme/article.sgmlThu Jun 23 
00:36:49 2011(r223456)
+++ head/release/doc/en_US.ISO8859-1/readme/article.sgmlThu Jun 23 
02:35:55 2011(r223457)
@@ -184,8 +184,7 @@
   paraLists of locations that mirror os; can be found in the
ulink
url=url.books.handbook;/mirrors-ftp.htmlFTP
-   Sites/ulink section of the Handbook, or on the ulink
-   url=http://mirrorlist.FreeBSD.org/;/ulink Web pages.
+   Sites/ulink section of the Handbook.
Finding a close (in networking terms) mirror from which to
download the distribution is highly recommended./para
 
___
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: r223307 - head/sys/vm

2011-06-22 Thread Adrian Chadd
Can this commit please be reverted whilst the kinks are worked out for MIPS?

I'm currently knee deep in MIPS related hackery and I'd rather stay on
an unpatched -HEAD so dogfood can be properly self-consumed.
Thanks,


Adrian

On 20 June 2011 03:13, Alan Cox a...@freebsd.org wrote:
 Author: alc
 Date: Sun Jun 19 19:13:24 2011
 New Revision: 223307
 URL: http://svn.freebsd.org/changeset/base/223307

 Log:
  Precisely document the synchronization rules for the page's dirty field.
  (Saying that the lock on the object that the page belongs to must be held
  only represents one aspect of the rules.)

  Eliminate the use of the page queues lock for atomically performing read-
  modify-write operations on the dirty field when the underlying architecture
  supports atomic operations on char and short types.

  Document the fact that 32KB pages aren't really supported.

  Reviewed by:  attilio, kib

 Modified:
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

 Modified: head/sys/vm/vm_fault.c
 ==
 --- head/sys/vm/vm_fault.c      Sun Jun 19 18:34:49 2011        (r223306)
 +++ head/sys/vm/vm_fault.c      Sun Jun 19 19:13:24 2011        (r223307)
 @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map,
                         * caller's changes may go unnoticed because they are
                         * performed through an unmanaged mapping or by a DMA
                         * operation.
 +                        *
 +                        * The object lock is not held here.  Therefore, like
 +                        * a pmap operation, the page queues lock may be
 +                        * required in order to call vm_page_dirty().  See
 +                        * vm_page_clear_dirty_mask().
                         */
 +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
 +    defined(__mips__)
 +                       vm_page_dirty(*mp);
 +#else
                        vm_page_lock_queues();
                        vm_page_dirty(*mp);
                        vm_page_unlock_queues();
 +#endif
                }
        }
        if (pmap_failed) {

 Modified: head/sys/vm/vm_page.c
 ==
 --- head/sys/vm/vm_page.c       Sun Jun 19 18:34:49 2011        (r223306)
 +++ head/sys/vm/vm_page.c       Sun Jun 19 19:13:24 2011        (r223307)
 @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m
  /*
  *     vm_page_dirty:
  *
 - *     make page all dirty
 + *     Set all bits in the page's dirty field.
 + *
 + *     The object containing the specified page must be locked if the call is
 + *     made from the machine-independent layer.  If, however, the call is
 + *     made from the pmap layer, then the page queues lock may be required.
 + *     See vm_page_clear_dirty_mask().
  */
  void
  vm_page_dirty(vm_page_t m)
 @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in
        /*
         * If the object is locked and the page is neither VPO_BUSY nor
         * PG_WRITEABLE, then the page's dirty field cannot possibly be
 -        * modified by a concurrent pmap operation.
 +        * set by a concurrent pmap operation.
         */
        VM_OBJECT_LOCK_ASSERT(m-object, MA_OWNED);
        if ((m-oflags  VPO_BUSY) == 0  (m-flags  PG_WRITEABLE) == 0)
                m-dirty = ~pagebits;
        else {
 +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
 +    defined(__mips__)
 +               /*
 +                * On the aforementioned architectures, the page queues lock
 +                * is not required by the following read-modify-write
 +                * operation.  The combination of the object's lock and an
 +                * atomic operation suffice.  Moreover, the pmap layer on
 +                * these architectures can call vm_page_dirty() without
 +                * holding the page queues lock.
 +                */
 +#if PAGE_SIZE == 4096
 +               atomic_clear_char(m-dirty, pagebits);
 +#elif PAGE_SIZE == 8192
 +               atomic_clear_short(m-dirty, pagebits);
 +#elif PAGE_SIZE == 16384
 +               atomic_clear_int(m-dirty, pagebits);
 +#else
 +#error PAGE_SIZE is not supported.
 +#endif
 +#else
 +               /*
 +                * Otherwise, the page queues lock is required to ensure that
 +                * a concurrent pmap operation does not set the page's dirty
 +                * field during the following read-modify-write operation.
 +                */
                vm_page_lock_queues();
                m-dirty = ~pagebits;
                vm_page_unlock_queues();
 +#endif
        }
  }


 Modified: head/sys/vm/vm_page.h
 ==
 --- head/sys/vm/vm_page.h       Sun Jun 19 18:34:49 2011        (r223306)
 +++ head/sys/vm/vm_page.h       Sun Jun 19 19:13:24 2011  

svn commit: r223458 - head/release/doc/share/sgml

2011-06-22 Thread Hiroki Sato
Author: hrs
Date: Thu Jun 23 02:38:06 2011
New Revision: 223458
URL: http://svn.freebsd.org/changeset/base/223458

Log:
  Bump release.manpath.*;.

Modified:
  head/release/doc/share/sgml/release.ent

Modified: head/release/doc/share/sgml/release.ent
==
--- head/release/doc/share/sgml/release.ent Thu Jun 23 02:35:55 2011
(r223457)
+++ head/release/doc/share/sgml/release.ent Thu Jun 23 02:38:06 2011
(r223458)
@@ -36,8 +36,8 @@
 
 !-- The manpaths for man page references --
 !ENTITY release.man.url http://www.FreeBSD.org/cgi/man.cgi;
-!ENTITY release.manpath.xorg  7.4
-!ENTITY release.manpath.netbsd5.0.1
+!ENTITY release.manpath.xorg  7.5.1
+!ENTITY release.manpath.netbsd5.1
 !ENTITY release.manpath.freebsd-ports Ports
 !ENTITY release.manpath.freebsd   9-current
 
___
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: r223459 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416

2011-06-22 Thread Adrian Chadd
Author: adrian
Date: Thu Jun 23 02:38:36 2011
New Revision: 223459
URL: http://svn.freebsd.org/changeset/base/223459

Log:
  Break out most of the HAL related tweaks into a per-HAL instance,
  rather than global variables.
  
  This specifically allows for debugging to be enabled per-NIC, rather
  than globally.
  
  Since the ath driver doesn't know about AH_DEBUG, and to keep the ABI
  consistent regardless of whether AH_DEBUG is enabled or not, enable the
  debug parameter always but only conditionally compile in the debug
  methods if needed.
  
  The ALQ support is currently still global pending some brainstorming.
  
  Submitted by: ssgriffonu...@gmail.com
  Reviewed by:  adrian, bschmidt

Modified:
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c
  head/sys/dev/ath/ath_hal/ar5416/ar2133.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_sysctl.c
  head/sys/dev/ath/if_ath_sysctl.h

Modified: head/sys/dev/ath/ah_osdep.c
==
--- head/sys/dev/ath/ah_osdep.c Thu Jun 23 02:38:06 2011(r223458)
+++ head/sys/dev/ath/ah_osdep.c Thu Jun 23 02:38:36 2011(r223459)
@@ -76,33 +76,6 @@ extern   void DO_HALDEBUG(struct ath_hal *
 
 /* NB: put this here instead of the driver to avoid circular references */
 SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, Atheros driver parameters);
-SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, Atheros HAL parameters);
-
-#ifdef AH_DEBUG
-int ath_hal_debug = 0;
-SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, ath_hal_debug,
-   0, Atheros HAL debugging printfs);
-TUNABLE_INT(hw.ath.hal.debug, ath_hal_debug);
-#endif /* AH_DEBUG */
-
-int ath_hal_ar5416_biasadj = 0;
-SYSCTL_INT(_hw_ath_hal, OID_AUTO, ar5416_biasadj, CTLFLAG_RW,
-   ath_hal_ar5416_biasadj, 0, Enable 2ghz AR5416 direction sensitivity
-bias adjust);
-
-/* NB: these are deprecated; they exist for now for compatibility */
-intath_hal_dma_beacon_response_time = 2;   /* in TU's */
-SYSCTL_INT(_hw_ath_hal, OID_AUTO, dma_brt, CTLFLAG_RW,
-  ath_hal_dma_beacon_response_time, 0,
-  Atheros HAL DMA beacon response time);
-intath_hal_sw_beacon_response_time = 10;   /* in TU's */
-SYSCTL_INT(_hw_ath_hal, OID_AUTO, sw_brt, CTLFLAG_RW,
-  ath_hal_sw_beacon_response_time, 0,
-  Atheros HAL software beacon response time);
-intath_hal_additional_swba_backoff = 0;/* in TU's */
-SYSCTL_INT(_hw_ath_hal, OID_AUTO, swba_backoff, CTLFLAG_RW,
-  ath_hal_additional_swba_backoff, 0,
-  Atheros HAL additional SWBA backoff time);
 
 MALLOC_DEFINE(M_ATH_HAL, ath_hal, ath hal data);
 
@@ -146,7 +119,7 @@ ath_hal_ether_sprintf(const u_int8_t *ma
 void
 DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
 {
-   if ((mask == HAL_DEBUG_UNMASKABLE) || (ath_hal_debug  mask)) {
+   if ((mask == HAL_DEBUG_UNMASKABLE) || (ah-ah_config.ah_debug  mask)) {
__va_list ap;
va_start(ap, fmt);
ath_hal_vprintf(ah, fmt, ap);
@@ -174,6 +147,8 @@ DO_HALDEBUG(struct ath_hal *ah, u_int ma
 #include sys/pcpu.h
 #include dev/ath/ath_hal/ah_decode.h
 
+SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, Atheros HAL parameters);
+
 static struct alq *ath_hal_alq;
 static int ath_hal_alq_emitdev;/* need to emit DEVICE record */
 static u_int ath_hal_alq_lost; /* count of lost records */

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Thu Jun 23 02:38:06 2011
(r223458)
+++ head/sys/dev/ath/ath_hal/ah.h   Thu Jun 23 02:38:36 2011
(r223459)
@@ -756,6 +756,17 @@ struct dfs_event {
 };
 typedef struct dfs_event HAL_DFS_EVENT;
 
+typedef struct
+{
+   int ah_debug;   /* only used if AH_DEBUG is defined */
+   int ah_ar5416_biasadj;  /* enable AR2133 radio specific bias 
fiddling */
+
+   /* NB: these are deprecated; they exist for now for compatibility */
+   int ah_dma_beacon_response_time;/* in TU's */
+   int ah_sw_beacon_response_time; /* in TU's */
+   int ah_additional_swba_backoff; /* in TU's */
+}HAL_OPS_CONFIG;
+
 /*
  * Hardware Access Layer (HAL) API.
  *
@@ -784,6 +795,7 @@ struct ath_hal {
 
uint16_t*ah_eepromdata; /* eeprom buffer, if needed */
 
+   HAL_OPS_CONFIG ah_config;
const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *,
 

svn commit: r223460 - head/sys/powerpc/ps3

2011-06-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Jun 23 03:20:11 2011
New Revision: 223460
URL: http://svn.freebsd.org/changeset/base/223460

Log:
  Add hypervisor call error codes.

Modified:
  head/sys/powerpc/ps3/ps3-hvcall.h
  head/sys/powerpc/ps3/ps3-hvcall.master

Modified: head/sys/powerpc/ps3/ps3-hvcall.h
==
--- head/sys/powerpc/ps3/ps3-hvcall.h   Thu Jun 23 02:38:36 2011
(r223459)
+++ head/sys/powerpc/ps3/ps3-hvcall.h   Thu Jun 23 03:20:11 2011
(r223460)
@@ -11,6 +11,34 @@ enum lpar_id {
PS3_LPAR_ID_PME = 0x01,
 };
 
+/* Return codes from hypercalls */
+#define LV1_SUCCESS0
+#define LV1_RESOURCE_SHORTAGE  -2
+#define LV1_NO_PRIVILEGE   -3
+#define LV1_DENIED_BY_POLICY   -4
+#define LV1_ACCESS_VIOLATION   -5
+#define LV1_NO_ENTRY   -6
+#define LV1_DUPLICATE_ENTRY-7
+#define LV1_TYPE_MISMATCH  -8
+#define LV1_BUSY   -9
+#define LV1_EMPTY  -10
+#define LV1_WRONG_STATE-11
+#define LV1_NO_MATCH   -13
+#define LV1_ALREADY_CONNECTED  -14
+#define LV1_UNSUPPORTED_PARAMETER_VALUE-15
+#define LV1_CONDITION_NOT_SATISFIED-16
+#define LV1_ILLEGAL_PARAMETER_VALUE-17
+#define LV1_BAD_OPTION -18
+#define LV1_IMPLEMENTATION_LIMITATION  -19
+#define LV1_NOT_IMPLEMENTED-20
+#define LV1_INVALID_CLASS_ID   -21
+#define LV1_CONSTRAINT_NOT_SATISFIED   -22
+#define LV1_ALIGNMENT_ERROR-23
+#define LV1_HARDWARE_ERROR -24
+#define LV1_INVALID_DATA_FORMAT-25
+#define LV1_INVALID_OPERATION  -26
+#define LV1_INTERNAL_ERROR -32768
+
 static inline uint64_t
 lv1_repository_string(const char *str)
 {

Modified: head/sys/powerpc/ps3/ps3-hvcall.master
==
--- head/sys/powerpc/ps3/ps3-hvcall.master  Thu Jun 23 02:38:36 2011
(r223459)
+++ head/sys/powerpc/ps3/ps3-hvcall.master  Thu Jun 23 03:20:11 2011
(r223460)
@@ -11,6 +11,34 @@ enum lpar_id {
PS3_LPAR_ID_PME = 0x01,
 };
 
+/* Return codes from hypercalls */
+#define LV1_SUCCESS0
+#define LV1_RESOURCE_SHORTAGE  -2
+#define LV1_NO_PRIVILEGE   -3
+#define LV1_DENIED_BY_POLICY   -4
+#define LV1_ACCESS_VIOLATION   -5
+#define LV1_NO_ENTRY   -6
+#define LV1_DUPLICATE_ENTRY-7
+#define LV1_TYPE_MISMATCH  -8
+#define LV1_BUSY   -9
+#define LV1_EMPTY  -10
+#define LV1_WRONG_STATE-11
+#define LV1_NO_MATCH   -13
+#define LV1_ALREADY_CONNECTED  -14
+#define LV1_UNSUPPORTED_PARAMETER_VALUE-15
+#define LV1_CONDITION_NOT_SATISFIED-16
+#define LV1_ILLEGAL_PARAMETER_VALUE-17
+#define LV1_BAD_OPTION -18
+#define LV1_IMPLEMENTATION_LIMITATION  -19
+#define LV1_NOT_IMPLEMENTED-20
+#define LV1_INVALID_CLASS_ID   -21
+#define LV1_CONSTRAINT_NOT_SATISFIED   -22
+#define LV1_ALIGNMENT_ERROR-23
+#define LV1_HARDWARE_ERROR -24
+#define LV1_INVALID_DATA_FORMAT-25
+#define LV1_INVALID_OPERATION  -26
+#define LV1_INTERNAL_ERROR -32768
+
 static inline uint64_t
 lv1_repository_string(const char *str)
 {
___
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: r223461 - head/sys/powerpc/ps3

2011-06-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Jun 23 03:37:25 2011
New Revision: 223461
URL: http://svn.freebsd.org/changeset/base/223461

Log:
  Rework the PS3 disk driver to support NCQ and do its DMA a little
  differently.

Modified:
  head/sys/powerpc/ps3/ps3disk.c

Modified: head/sys/powerpc/ps3/ps3disk.c
==
--- head/sys/powerpc/ps3/ps3disk.c  Thu Jun 23 03:20:11 2011
(r223460)
+++ head/sys/powerpc/ps3/ps3disk.c  Thu Jun 23 03:37:25 2011
(r223461)
@@ -116,39 +116,25 @@ struct ps3disk_softc {
struct disk **sc_disk;
 
struct bio_queue_head sc_bioq;
+   struct bio_queue_head sc_deferredq;
+   struct proc *sc_task;   
 
-   struct proc *sc_task;
-
-   int sc_bounce_maxblocks;
-   bus_dma_tag_t sc_bounce_dmatag;
-   bus_dmamap_t sc_bounce_dmamap;
-   bus_addr_t sc_bounce_dmaphys;
-   char *sc_bounce;
-   uint64_t sc_bounce_lpar;
-   int sc_bounce_busy;
-   uint64_t sc_bounce_tag;
-   uint64_t sc_bounce_status;
+   bus_dma_tag_t sc_dmatag;
 
int sc_running;
-
int sc_debug;
 };
 
 static int ps3disk_open(struct disk *dp);
 static int ps3disk_close(struct disk *dp);
 static void ps3disk_strategy(struct bio *bp);
-static void ps3disk_task(void *arg);
 
-static int ps3disk_intr_filter(void *arg);
+static void ps3disk_task(void *arg);
 static void ps3disk_intr(void *arg);
-static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int 
error);
 static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc);
 static int ps3disk_enum_regions(struct ps3disk_softc *sc);
-static int ps3disk_read(struct ps3disk_softc *sc, int regidx,
-   uint64_t start_sector, uint64_t sector_count, char *data);
-static int ps3disk_write(struct ps3disk_softc *sc, int regidx,
-   uint64_t start_sector, uint64_t sector_count, char *data);
-static int ps3disk_flush(struct ps3disk_softc *sc);
+static void ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs,
+int error);
 
 static void ps3disk_sysctlattach(struct ps3disk_softc *sc);
 
@@ -172,6 +158,7 @@ ps3disk_attach(device_t dev)
struct ps3disk_softc *sc;
struct disk *d;
intmax_t mb;
+   uint64_t junk;
char unit;
int i, err;
 
@@ -205,7 +192,6 @@ ps3disk_attach(device_t dev)
}
 
/* Setup interrupt handler */
-
sc-sc_irqid = 0;
sc-sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, sc-sc_irqid,
RF_ACTIVE);
@@ -217,52 +203,24 @@ ps3disk_attach(device_t dev)
 
err = bus_setup_intr(dev, sc-sc_irq,
INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY,
-   ps3disk_intr_filter, ps3disk_intr, sc, sc-sc_irqctx);
+   NULL, ps3disk_intr, sc, sc-sc_irqctx);
if (err) {
device_printf(dev, Could not setup IRQ\n);
err = ENXIO;
goto fail_release_intr;
}
 
-   /* Setup DMA bounce buffer */
-
-   sc-sc_bounce_maxblocks = DFLTPHYS / sc-sc_blksize;
-
+   /* Setup DMA */
err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0,
BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
-   sc-sc_bounce_maxblocks * sc-sc_blksize, 1,
-   sc-sc_bounce_maxblocks * sc-sc_blksize,
-   0, NULL, NULL, sc-sc_bounce_dmatag);
+   BUS_SPACE_UNRESTRICTED, 1, PAGE_SIZE, 0,
+   busdma_lock_mutex, sc-sc_mtx, sc-sc_dmatag);
if (err) {
-   device_printf(dev, Could not create DMA tag for bounce 
buffer\n);
+   device_printf(dev, Could not create DMA tag\n);
err = ENXIO;
goto fail_teardown_intr;
}
 
-   err = bus_dmamem_alloc(sc-sc_bounce_dmatag, (void **) sc-sc_bounce,
-   BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO,
-   sc-sc_bounce_dmamap);
-   if (err) {
-   device_printf(dev, Could not allocate DMA memory for bounce 
buffer\n);
-   err = ENXIO;
-   goto fail_destroy_dmatag;
-   }
-
-   err = bus_dmamap_load(sc-sc_bounce_dmatag, sc-sc_bounce_dmamap,
-   sc-sc_bounce, sc-sc_bounce_maxblocks * sc-sc_blksize,
-   ps3disk_getphys, sc-sc_bounce_dmaphys, 0);
-   if (err) {
-   device_printf(dev, Could not load DMA map for bounce 
buffer\n);
-   err = ENXIO;
-   goto fail_free_dmamem;
-   }
-
-   sc-sc_bounce_lpar = vtophys(sc-sc_bounce);
-
-   if (bootverbose)
-   device_printf(dev, bounce buffer lpar address 0x%016lx\n,
-   sc-sc_bounce_lpar);
-
/* Setup disks */
 
sc-sc_disk = malloc(sc-sc_nregs * sizeof(struct disk *),
@@ -270,7 +228,7 @@ ps3disk_attach(device_t dev)
if (!sc-sc_disk) {
device_printf(dev, Could not allocate disk(s)\n);
err = ENOMEM;
-   goto fail_unload_dmamem;
+  

svn commit: r223462 - head/sys/powerpc/ps3

2011-06-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Jun 23 04:06:33 2011
New Revision: 223462
URL: http://svn.freebsd.org/changeset/base/223462

Log:
  Use 4 KB pages for storage bus devices, which seems to be what the HV uses
  internally.

Modified:
  head/sys/powerpc/ps3/ps3bus.c

Modified: head/sys/powerpc/ps3/ps3bus.c
==
--- head/sys/powerpc/ps3/ps3bus.c   Thu Jun 23 03:37:25 2011
(r223461)
+++ head/sys/powerpc/ps3/ps3bus.c   Thu Jun 23 04:06:33 2011
(r223462)
@@ -629,7 +629,7 @@ ps3bus_get_dma_tag(device_t dev, device_
 {
struct ps3bus_devinfo *dinfo = device_get_ivars(child);
struct ps3bus_softc *sc = device_get_softc(dev);
-   int i, err, flags;
+   int i, err, flags, pagesize;
 
if (dinfo-bustype != PS3_BUSTYPE_SYSBUS 
dinfo-bustype != PS3_BUSTYPE_STORAGE)
@@ -646,9 +646,13 @@ ps3bus_get_dma_tag(device_t dev, device_
dinfo-devtype == PS3_DEVTYPE_USB)
flags = 2; /* 8-bit mode */
 
+   pagesize = 24; /* log_2(16 MB) */
+   if (dinfo-bustype == PS3_BUSTYPE_STORAGE)
+   pagesize = 12; /* 4 KB */
+
for (i = 0; i  sc-rcount; i++) {
err = lv1_allocate_device_dma_region(dinfo-bus, dinfo-dev,
-   sc-regions[i].mr_size, 24 /* log_2(16 MB) */, flags,
+   sc-regions[i].mr_size, pagesize, flags,
dinfo-dma_base[i]);
if (err != 0) {
device_printf(child,
___
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: r223463 - head/sys/powerpc/ps3

2011-06-22 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Jun 23 04:35:45 2011
New Revision: 223463
URL: http://svn.freebsd.org/changeset/base/223463

Log:
  Use atomic operations to mask and unmask IRQs. This prevents a problem
  (obvious in retrospect) in which interrupts on one CPU that are temporarily
  masked can end up permanently masked when a handler on another CPU clobbers
  the interrupt mask register with an old copy.

Modified:
  head/sys/powerpc/ps3/ps3pic.c

Modified: head/sys/powerpc/ps3/ps3pic.c
==
--- head/sys/powerpc/ps3/ps3pic.c   Thu Jun 23 04:06:33 2011
(r223462)
+++ head/sys/powerpc/ps3/ps3pic.c   Thu Jun 23 04:35:45 2011
(r223463)
@@ -56,10 +56,10 @@ static void ps3pic_mask(device_t, u_int)
 static voidps3pic_unmask(device_t, u_int);
 
 struct ps3pic_softc {
-   uint64_t*bitmap_thread0;
-   uint64_t*mask_thread0;
-   uint64_t*bitmap_thread1;
-   uint64_t*mask_thread1;
+   volatile uint64_t *bitmap_thread0;
+   volatile uint64_t *mask_thread0;
+   volatile uint64_t *bitmap_thread1;
+   volatile uint64_t *mask_thread1;
 
uint64_tsc_ipi_outlet[2];
int sc_vector[64];
@@ -219,8 +219,8 @@ ps3pic_mask(device_t dev, u_int irq)
if (irq == sc-sc_ipi_outlet[0])
return;
 
-   sc-mask_thread0[0] = ~(1UL  (63 - irq));
-   sc-mask_thread1[0] = ~(1UL  (63 - irq));
+   atomic_clear_64(sc-mask_thread0[0], 1UL  (63 - irq));
+   atomic_clear_64(sc-mask_thread1[0], 1UL  (63 - irq));
 
lv1_get_logical_ppe_id(ppe);
lv1_did_update_interrupt_mask(ppe, 0);
@@ -234,8 +234,8 @@ ps3pic_unmask(device_t dev, u_int irq)
uint64_t ppe;
 
sc = device_get_softc(dev);
-   sc-mask_thread0[0] |= (1UL  (63 - irq));
-   sc-mask_thread1[0] |= (1UL  (63 - irq));
+   atomic_set_64(sc-mask_thread0[0], 1UL  (63 - irq));
+   atomic_set_64(sc-mask_thread1[0], 1UL  (63 - irq));
 
lv1_get_logical_ppe_id(ppe);
lv1_did_update_interrupt_mask(ppe, 0);
___
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: r223464 - head/sys/vm

2011-06-22 Thread Alan Cox
Author: alc
Date: Thu Jun 23 05:23:59 2011
New Revision: 223464
URL: http://svn.freebsd.org/changeset/base/223464

Log:
  Revert to using the page queues lock in vm_page_clear_dirty_mask() on
  MIPS.  (At present, although atomic_clear_char() is defined by atomic.h
  on MIPS, it is not actually implemented by support.S.)

Modified:
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Thu Jun 23 04:35:45 2011(r223463)
+++ head/sys/vm/vm_fault.c  Thu Jun 23 05:23:59 2011(r223464)
@@ -1095,8 +1095,7 @@ vm_fault_quick_hold_pages(vm_map_t map, 
 * required in order to call vm_page_dirty().  See
 * vm_page_clear_dirty_mask().
 */
-#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
-defined(__mips__)
+#if defined(__amd64__) || defined(__i386__) || defined(__ia64__)
vm_page_dirty(*mp);
 #else
vm_page_lock_queues();

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Jun 23 04:35:45 2011(r223463)
+++ head/sys/vm/vm_page.c   Thu Jun 23 05:23:59 2011(r223464)
@@ -2336,8 +2336,7 @@ vm_page_clear_dirty_mask(vm_page_t m, in
if ((m-oflags  VPO_BUSY) == 0  (m-flags  PG_WRITEABLE) == 0)
m-dirty = ~pagebits;
else {
-#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
-defined(__mips__)
+#if defined(__amd64__) || defined(__i386__) || defined(__ia64__)
/*
 * On the aforementioned architectures, the page queues lock
 * is not required by the following read-modify-write
___
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: r223307 - head/sys/vm

2011-06-22 Thread Alan Cox

On 06/22/2011 21:36, Adrian Chadd wrote:

Can this commit please be reverted whilst the kinks are worked out for MIPS?


I've reverted the MIPS-specific code.

Alan

___
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