]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoRemove reference to gcc's non-standard -fwritable-strings, which
Eitan Adler [Sun, 4 Mar 2012 16:41:07 +0000 (16:41 +0000)]
Remove reference to gcc's non-standard -fwritable-strings, which
doesn't exist in recent releases (and is bad advice anyway)

PR: docs/163119
Submitted by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: cperciva
MFC after: 1 week

12 years agoPOSIX mandates that swab do nothing when len < 0
Eitan Adler [Sun, 4 Mar 2012 16:39:08 +0000 (16:39 +0000)]
POSIX mandates that swab do nothing when len < 0

PR: kern/140690
Submitted by: Jeremy Huddleston <jeremyhu@apple.com>
Approved by: cperciva
MFC after: 2 weeks

12 years agoFix a variety of grammar issues and style nits.
Eitan Adler [Sun, 4 Mar 2012 16:37:44 +0000 (16:37 +0000)]
Fix a variety of grammar issues and style nits.

PR: docs/165668
Submitted by: Robert Simmons <rsimmons0@gmail.com>
Reviewed by: kaduk@mit.edu
Approved by: cperciva
MFC after: 1 week

12 years agoehci tunables are only available when kernel is compiled with USB_DEBUG
Eitan Adler [Sun, 4 Mar 2012 16:26:49 +0000 (16:26 +0000)]
ehci tunables are only available when kernel is compiled with USB_DEBUG

PR: docs/163646
Reported by: Momchil Ivanov <momchil@xaxo.eu>
Submitted by: Benjamin Kaduk <kaduk@mit.edu>
Approved by: cperciva
MFC after: 1 week

12 years agoReapply 227753 (xlocale cleanup), plus some fixes so that it passes build
David Chisnall [Sun, 4 Mar 2012 15:31:13 +0000 (15:31 +0000)]
Reapply 227753 (xlocale cleanup), plus some fixes so that it passes build
universe with gcc.

Approved by: dim (mentor)

12 years agoAdd __aeabi_read_tp to the symbol list.
Olivier Houchard [Sun, 4 Mar 2012 15:25:11 +0000 (15:25 +0000)]
Add  __aeabi_read_tp to the symbol list.

12 years agoPR: docs/158813
Eitan Adler [Sun, 4 Mar 2012 15:22:03 +0000 (15:22 +0000)]
PR: docs/158813
Submitted by: Ben Kaduk <kaduk@mit.edu>
Approved by: bcr
MFC after: 1 week

12 years agopipe_read(): change the type of size to int, and remove signed clamp.
Konstantin Belousov [Sun, 4 Mar 2012 15:09:01 +0000 (15:09 +0000)]
pipe_read(): change the type of size to int, and remove signed clamp.
pipe_write(): change the type of desiredsize back to int, its value fits.

Requested by: bde
MFC after:    3 weeks

12 years agoInstead of incomplete handling of read(2)/write(2) return values that
Konstantin Belousov [Sun, 4 Mar 2012 14:55:37 +0000 (14:55 +0000)]
Instead of incomplete handling of read(2)/write(2) return values that
does not fit into registers, declare that we do not support this case
using CTASSERT(), and remove endianess-unsafe code to split return value
into td_retval.

While there, change the style of the sysctl debug.iosize_max_clamp
definition.

Requested by: bde
MFC after: 3 weeks

12 years agoRemove unneeded cast to u_int. The values as small enough to fit into
Konstantin Belousov [Sun, 4 Mar 2012 14:51:42 +0000 (14:51 +0000)]
Remove unneeded cast to u_int. The values as small enough to fit into
int, beside the use of MIN macro which performs type promotions.

Submitted by: bde
MFC after: 3 weeks

12 years agoCopy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs.
Tijl Coosemans [Sun, 4 Mar 2012 14:12:57 +0000 (14:12 +0000)]
Copy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs.

12 years agoCopy amd64 float.h to x86 and merge with i386 float.h. Replace
Tijl Coosemans [Sun, 4 Mar 2012 14:00:32 +0000 (14:00 +0000)]
Copy amd64 float.h to x86 and merge with i386 float.h. Replace
amd64/i386/pc98 float.h with stubs.

12 years agoRestore proper dot symbol creation for assembly files in the kernel build case.
Andreas Tobler [Sun, 4 Mar 2012 11:55:28 +0000 (11:55 +0000)]
Restore proper dot symbol creation for assembly files in the kernel build case.
Without this patch we were not able to see the assembly function.
Only the function descriptor was visible.

- Distinguish between user-land and kernel when creating the ENTRY() point of
  assembly source.
- Make the ENTRY() macro more readable, replace the .align directive with the
  gas platform independant .p2align directive.
- Create an END()macro for later use to provide traceback tables on powerpc64.

12 years agoProperly restore curvnet context when returning early from
Marko Zec [Sun, 4 Mar 2012 11:11:03 +0000 (11:11 +0000)]
Properly restore curvnet context when returning early from
ether_input_internal().

This change only affects options VIMAGE kernel builds.

PR: kern/165643
Submitted by: Vijay Singh
MFC after: 3 days

12 years agoRemove unnecessary casts
Kevin Lo [Sun, 4 Mar 2012 09:48:58 +0000 (09:48 +0000)]
Remove unnecessary casts

12 years agoFix build w/o 'options IEEE80211_SUPPORT_MESH'.
Gleb Smirnoff [Sun, 4 Mar 2012 09:45:43 +0000 (09:45 +0000)]
Fix build w/o 'options IEEE80211_SUPPORT_MESH'.

12 years agoClean up style(9) nits
Kevin Lo [Sun, 4 Mar 2012 09:38:20 +0000 (09:38 +0000)]
Clean up style(9) nits

12 years agoAdd support for PWM controlled fans. I found these fans on my PowerMac9,1.
Andreas Tobler [Sun, 4 Mar 2012 08:43:33 +0000 (08:43 +0000)]
Add support for PWM controlled fans. I found these fans on my PowerMac9,1.
These fans are not located under the same node as the the RPM controlled ones,
So I had to adapt the current source to parse and fill the properties correctly.
To control the fans we can set the PWM ratio via sysctl between 20 and 100%.

Tested by: nwhitehorn
MFC after: 3 weeks

12 years ago* Introduce new flag for QoS control field;
Adrian Chadd [Sun, 4 Mar 2012 05:52:26 +0000 (05:52 +0000)]
* Introduce new flag for QoS control field;
* Change in mesh_input to validate that QoS is set and Mesh Control field
  is present, also both bytes of the QoS are read;
* Moved defragmentation in mesh_input before we try to forward packet as
  inferred from amendment spec, because Mesh Control field only present in first
  fragment;
* Changed in ieee80211_encap to set QoS subtype and Mesh Control field present,
  only first fragment have Mesh Control field present bit equal to 1;

Submitted by: monthadar@gmail.com

12 years ago* Added IEEE80211_ACTION_CAT_MESH in ieee80211.h as specified amendment spec;
Adrian Chadd [Sun, 4 Mar 2012 05:49:39 +0000 (05:49 +0000)]
* Added IEEE80211_ACTION_CAT_MESH in ieee80211.h as specified amendment spec;
* Moved old categories as specified by D4.0 to be action fields of MESH category
  as specified in amendment spec;
* Modified functions to use MESH category and its action fields:
  + ieee80211_send_action_register
  + ieee80211_send_action
  + ieee80211_recv_action_register
  +ieee80211_recv_action;
* Modified ieee80211_hwmp_init and hwmp_send_action so they uses correct
  action fields as specified in amendment spec;
* Modified ieee80211_parse_action so that it verifies MESH frames.
* Change Mesh Link Metric to use one information element as amendment spec.
  Draft 4.0 defined two different information elements for request and response.

Submitted by: monthadar@gmail.com

12 years agoFix tls base computation with COMPAT_FREEBSD32 on n64 kernels. The previous
Juli Mallett [Sun, 4 Mar 2012 05:19:55 +0000 (05:19 +0000)]
Fix tls base computation with COMPAT_FREEBSD32 on n64 kernels.  The previous
version was missing an else and would always use the n64 TP_OFFSET.  Eliminate
some duplication of logic here.

It may be worth getting rid of some of the ifdefs and introducing gratuitous
SV_ILP32 runtime checks on n64 kernels without COMPAT_FREEBSD32 and on o32
kernels, similarly to how PowerPC works.

12 years agoIn r232322, I forgot one case where a check for MK_CLANG_IS_CC was
Dimitry Andric [Sun, 4 Mar 2012 00:42:18 +0000 (00:42 +0000)]
In r232322, I forgot one case where a check for MK_CLANG_IS_CC was
needed, in sys/conf/kern.pre.mk.  Add it now.

MFC after: 2 weeks

12 years agoRevert r232473. I have been convinced by Doug Barton and Bjoern Zeeb
Dimitry Andric [Sat, 3 Mar 2012 23:49:53 +0000 (23:49 +0000)]
Revert r232473.  I have been convinced by Doug Barton and Bjoern Zeeb
that it is better to error out when people attempt to build using the
wrong bsd.*.mk files, than to silently ignore the problem.

This means, that after this commit, if you want to build kernel modules
by hand (or via a port) from a head source tree, you *must* make sure
the files in /usr/share/mk are in sync with that tree.  If that isn't
possible, for example when you are running on an older FreeBSD branch,
you can:

- Run "make buildenv" from your head source tree, to have the correct
  environment setup.  (It's advisable to have run "make buildworld", or
  at a minimum "make toolchain" first.)
- Alternatively, set MAKESYSPATH to the share/mk directory under your
  head source tree.  If your build tools are too old, other problems may
  still occur.
- Alternatively, use "make -m" and specify the share/mk directory under
  your head source tree.  Again, build tools that are too old may still
  result in trouble.

MFC after: 2 weeks

12 years agoOn MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries. This might
Juli Mallett [Sat, 3 Mar 2012 21:39:12 +0000 (21:39 +0000)]
On MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries.  This might
not be ideal, but is the ABI we've shipped so far.  Fix macros which reflect
the results of _ALIGN on 32-bit MIPS to use the right alignment.

This fixes sendmsg under COMPAT_FREEBSD32 on n64 MIPS kernels.

12 years agoAfter r232322, it turned out many people (and some ports) are building
Dimitry Andric [Sat, 3 Mar 2012 18:58:15 +0000 (18:58 +0000)]
After r232322, it turned out many people (and some ports) are building
kernel modules using their old installed /usr/share/mk/bsd.*.mk files,
instead of the updated ones in their source tree.  This leads to errors
like:

  "sys/conf/kmod.mk", line 111: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang")

Obviously, these errors will go away after a "make installworld", or
alternatively, by using "make buildenv" before attempting to manually
build modules.

However, since it is apparently an expected use case to build using old
.mk files, change the way we test for clang, so it also works when the
MK_CLANG_IS_CC macro doesn't exist.

Note the conditional expressions are becoming rather unreadable now, but
I will attempt to fix that on a followup commit.

MFC after: 2 weeks

12 years agoExpand the set of APIs available for locating PCI capabilities:
John Baldwin [Sat, 3 Mar 2012 18:08:57 +0000 (18:08 +0000)]
Expand the set of APIs available for locating PCI capabilities:
- pci_find_extcap() is repurposed to be used for fetching PCI-express
  extended capabilities (PCIZ_* constants in <dev/pci/pcireg.h>).
- pci_find_htcap() can be used to locate a specific HyperTransport
  capability (PCIM_HTCAP_* constants in <dev/pci/pcireg.h>).
- Cache the starting location of the PCI-express capability for PCI-express
  devices in PCI device ivars.

12 years agoDocument the [n]eei and [n]bacc options
Eitan Adler [Sat, 3 Mar 2012 18:07:53 +0000 (18:07 +0000)]
Document the [n]eei and [n]bacc options

PR: docs/165009
Submitted by: Jeremy Huddleston <jeremyhu@apple.com>
Approved by: bcr
MFC after: 1 week

12 years agoUse pci_find_cap() instead of pci_find_extcap() to locate PCI
John Baldwin [Sat, 3 Mar 2012 18:03:50 +0000 (18:03 +0000)]
Use pci_find_cap() instead of pci_find_extcap() to locate PCI
find capabilities as the latter API is deprecated for this purpose.

MFC after: 2 weeks

12 years agoBump date to today (since I modified it)
Eitan Adler [Sat, 3 Mar 2012 17:52:19 +0000 (17:52 +0000)]
Bump date to today (since I modified it)

PR: bin/165321
Approved by: gjb
MFC after: 3 days

12 years agoThe name caching changes of r230394 exposed an intermittent bug
Rick Macklem [Sat, 3 Mar 2012 16:13:20 +0000 (16:13 +0000)]
The name caching changes of r230394 exposed an intermittent bug
in the new NFS server for NFSv4, where it would report ENOENT
when the file actually existed on the server. This turned out
to be caused by not initializing ni_topdir before calling lookup()
and there was a rare case where the value on the stack location
assigned to ni_topdir happened to be a pointer to a ".." entry,
such that "dp == ndp->ni_topdir" succeeded in lookup().
This patch initializes ni_topdir to fix the problem.

MFC after: 5 days

12 years agoDirect users to swapinfo and pstat from df
Eitan Adler [Sat, 3 Mar 2012 15:38:01 +0000 (15:38 +0000)]
Direct users to swapinfo and pstat from df

PR: bin/165321
Submitted by: jhs
Approved by: bcr
MFC after: 3 days

12 years agoUpdate the pci_get_vpd_readonly() wrapper to use 'vptr' instead of
John Baldwin [Sat, 3 Mar 2012 14:25:36 +0000 (14:25 +0000)]
Update the pci_get_vpd_readonly() wrapper to use 'vptr' instead of
'identptr' for its last parameter to match the default implementation
as well as the method definition in pci_if.m.

12 years agoFix a typo.
John Baldwin [Sat, 3 Mar 2012 14:24:39 +0000 (14:24 +0000)]
Fix a typo.

12 years agoExpand and reorganize the pci(9) manpage a bit:
John Baldwin [Sat, 3 Mar 2012 14:23:54 +0000 (14:23 +0000)]
Expand and reorganize the pci(9) manpage a bit:
- Document the following routines: pci_alloc_msi(), pci_alloc_msix(),
  pci_find_cap(), pci_get_max_read_req(), pci_get_vpd_ident(),
  pci_get_vpd_readonly(), pci_msi_count(), pci_msix_count(),
  pci_pending_msix(), pci_release_msi(),  pci_remap_msix(), and
  pci_set_max_read_req().
- Group the functions into five sub-sections: raw configuration access,
  locating devices, device information, device configuration, and
  message signaled interrupts.
- Discourage use of pci_disable_io() and pci_enable_io() in device drivers.
  The PCI bus driver handles this automatically as resources are activated.

MFC after: 2 weeks

12 years agoMake kern.proc.umask sysctl readonly.
Mikolaj Golub [Sat, 3 Mar 2012 11:53:35 +0000 (11:53 +0000)]
Make kern.proc.umask sysctl readonly.

Requested by: src
MFC after: 1 week

12 years agoFix bug of r232207, when cpu_search() could prefer CPU group with best
Alexander Motin [Sat, 3 Mar 2012 11:50:48 +0000 (11:50 +0000)]
Fix bug of r232207, when cpu_search() could prefer CPU group with best
load, but with no CPU matching given limitations. It caused kernel panics
in some cases when thread was bound to specific CPUs with cpuset(1).

12 years agoUnbreak n64 build without COMPAT_FREEBSD32 by fixing mismatched preprocessor
Juli Mallett [Sat, 3 Mar 2012 10:22:49 +0000 (10:22 +0000)]
Unbreak n64 build without COMPAT_FREEBSD32 by fixing mismatched preprocessor
conditionals.

12 years agoUse snprintf(3) constantly when generating CAM error messages.
Jaakko Heinonen [Sat, 3 Mar 2012 09:19:20 +0000 (09:19 +0000)]
Use snprintf(3) constantly when generating CAM error messages.

PR: bin/57088
Submitted by: Rui Lopes, arundel
MFC after: 2 weeks

12 years agoo) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
Juli Mallett [Sat, 3 Mar 2012 08:19:18 +0000 (08:19 +0000)]
o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
   using the o32 ABI.  This mostly follows nwhitehorn's lead in implementing
   COMPAT_FREEBSD32 on powerpc64.
o) Add a new type to the freebsd32 compat layer, time32_t, which is time_t in the
   32-bit ABI being used.  Since the MIPS port is relatively-new, even the 32-bit
   ABIs use a 64-bit time_t.
o) Because time{spec,val}32 has the same size and layout as time{spec,val} on MIPS
   with 32-bit compatibility, then, disable some code which assumes otherwise
   wrongly when built for MIPS.  A more general macro to check in this case would
   seem like a good idea eventually.  If someone adds support for using n32
   userland with n64 kernels on MIPS, then they will have to add a variety of
   flags related to each piece of the ABI that can vary.  That's probably the
   right time to generalize further.
o) Add MIPS to the list of architectures which use PAD64_REQUIRED in the
   freebsd32 compat code.  Probably this should be generalized at some point.

Reviewed by: gonzo

12 years agoMake sure that the USB system suspend event is executed synchronously
Hans Petter Selasky [Sat, 3 Mar 2012 08:11:04 +0000 (08:11 +0000)]
Make sure that the USB system suspend event is executed synchronously
and not asynchronously. This fixes problems related to USB system
suspend and resume.  It is assumed that we are always allowed to sleep
from the device_suspend() method.

MFC after: 1 week
Submitted by: jkim

12 years agoAdd entry for packages-8.3-release directory.
Ken Smith [Sat, 3 Mar 2012 05:04:47 +0000 (05:04 +0000)]
Add entry for packages-8.3-release directory.

12 years agoPost r230394, the Lookup RPC counts for both NFS clients increased
Rick Macklem [Sat, 3 Mar 2012 01:06:54 +0000 (01:06 +0000)]
Post r230394, the Lookup RPC counts for both NFS clients increased
significantly. Upon investigation this was caused by name cache
misses for lookups of "..". For name cache entries for non-".."
directories, the cache entry serves double duty. It maps both the
named directory plus ".." for the parent of the directory. As such,
two ctime values (one for each of the directory and its parent) need
to be saved in the name cache entry.
This patch adds an entry for ctime of the parent directory to the
name cache. It also adds an additional uma zone for large entries
with this time value, in order to minimize memory wastage.
As well, it fixes a couple of cases where the mtime of the parent
directory was being saved instead of ctime for positive name cache
entries. With this patch, Lookup RPC counts return to values similar
to pre-r230394 kernels.

Reported by: bde
Discussed with: kib
Reviewed by: jhb
MFC after: 2 weeks

12 years agoAdd VESA option to GENERIC for amd64 and i386.
Jung-uk Kim [Sat, 3 Mar 2012 00:11:46 +0000 (00:11 +0000)]
Add VESA option to GENERIC for amd64 and i386.

MFC after: 1 month

12 years agoFix a problem that was causing the mpt(4) driver to attach to MegaRAID
Kenneth D. Merry [Fri, 2 Mar 2012 22:00:40 +0000 (22:00 +0000)]
Fix a problem that was causing the mpt(4) driver to attach to MegaRAID
cards that should be handled by the mfi(4) driver.

The root of the problem is that the mpt(4) driver was masking off the
bottom bit of the PCI device ID when deciding which cards to attach to.

It appears that a number of the mpt(4) Fibre Channel cards had a LAN
variant whose PCI device ID was just one bit off from the FC card's device
ID.  The FC cards were even and the LAN cards were odd.

The problem was that this pattern wasn't carried over on the SAS and
parallel SCSI mpt(4) cards.  Luckily the SAS and parallel SCSI PCI device
IDs were either even numbers, or they would get masked to a supported
adjacent PCI device ID, and everything worked well.

Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb
SAS device IDs for their new MegaRAID cards.  This is causing the mpt(4)
driver to attach to the RAID cards instead of the mfi(4) driver.

The solution is to stop masking off the bottom bit of the device ID, and
explicitly list the PCI device IDs of all supported cards.

This change should be a no-op for mpt(4) hardware.  The only intended
functional change is that for the 929X, the is_fc variable gets set.  It
wasn't being set previously, but needs to be because the 929X is a Fibre
Channel card.

Reported by: Kashyap Desai <Kashyap.Desai@lsi.com>
MFC After: 3 days

12 years agoWhen creating a handle for a subregion, be sure to actually math out the new
Juli Mallett [Fri, 2 Mar 2012 21:46:31 +0000 (21:46 +0000)]
When creating a handle for a subregion, be sure to actually math out the new
handle address, where we're using handles as raw addresses.

This fixes devices with subregions on Octeon PCI specifically, and likely also on
MIPS more generally, where there isn't another bus_space in use that was doing the
math already.

12 years agoIf an Atheros device is attached to an Octeon, it's going to be by PCI.
Juli Mallett [Fri, 2 Mar 2012 21:44:39 +0000 (21:44 +0000)]
If an Atheros device is attached to an Octeon, it's going to be by PCI.

12 years ago- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
John Baldwin [Fri, 2 Mar 2012 20:38:04 +0000 (20:38 +0000)]
- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
  The tag enforces a single restriction that all DMA transactions must not
  cross a 4GB boundary.  Note that while this restriction technically only
  applies to PCI-express, this change applies it to all PCI devices as it
  is simpler to implement that way and errs on the side of caution.
- Add a softc structure for PCI bus devices to hold the bus_dma tag and
  a new pci_attach_common() routine that performs actions common to the
  attach phase of all PCI bus drivers.  Right now this only consists of
  a bootverbose printf and the allocate of a bus_dma tag if necessary.
- Adjust all PCI bus drivers to allocate a PCI bus softc and to call
  pci_attach_common() from their attach routines.

MFC after: 2 weeks

12 years agoUnbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
Juli Mallett [Fri, 2 Mar 2012 20:34:15 +0000 (20:34 +0000)]
Unbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
sysinfo.  This should have been done as part of replacing bootinfo with sysinfo.

12 years agoSimilar to the fixes in 226967 and 226987, purge any name cache entries
John Baldwin [Fri, 2 Mar 2012 18:55:19 +0000 (18:55 +0000)]
Similar to the fixes in 226967 and 226987, purge any name cache entries
associated with the previous vnode (if any) associated with the target of
a rename().  Otherwise, a lookup of the target pathname concurrent with a
rename() could re-add a name cache entry after the namei(RENAME) lookup
in kern_renameat() had purged the target pathname.

MFC after: 2 weeks

12 years agoFix typo.
Andreas Tobler [Fri, 2 Mar 2012 18:18:14 +0000 (18:18 +0000)]
Fix typo.

12 years agoEliminate stale incorrect ARGSUSED comments.
Alan Cox [Fri, 2 Mar 2012 17:33:51 +0000 (17:33 +0000)]
Eliminate stale incorrect ARGSUSED comments.

Submitted by: bde

12 years agoRemoved excessive _seekdir() call in closedir(). This saves one lseek()
Ruslan Ermilov [Fri, 2 Mar 2012 14:05:50 +0000 (14:05 +0000)]
Removed excessive _seekdir() call in closedir().  This saves one lseek()
syscall.  Before r5958, seekdir() was called for its side effect of
freeing memory allocated by opendir() for rewinddir(), but that revision
added _reclaim_telldir() that frees all memory allocated by telldir()
calls, making this call redundant.

This introduces a slight change.  If an application duplicated the descriptor
obtained through dirfd(), it can no longer rely on file position to be
reset to the start of file after a call to closedir().  It's believed to
be safe because neither POSIX, nor any other OS I've tested (NetBSD, Linux,
OS X) rewind the file offset pointer on closedir().

Reported by: Igor Sysoev

12 years agoBelatedly add dl_iterate_phdr(3) to the list of installed manpages.
Konstantin Belousov [Fri, 2 Mar 2012 13:19:56 +0000 (13:19 +0000)]
Belatedly add dl_iterate_phdr(3) to the list of installed manpages.

MFC after: 3 days

12 years agoFinally removed the stat() and fstat() calls from the opendir() code.
Ruslan Ermilov [Fri, 2 Mar 2012 10:03:38 +0000 (10:03 +0000)]
Finally removed the stat() and fstat() calls from the opendir() code.
They were made excessive in r205424 by opening with O_DIRECTORY.
Also eliminated the fcntl() call used to set FD_CLOEXEC by opening
with O_CLOEXEC.

(fdopendir() still checks that the passed descriptor is a directory,
and sets FD_CLOEXEC on it.)

Reviewed by: ed

12 years agoReflect the renaming of ifmaof_ifpforaddr() to if_findmulti() in r148652.
Sergey Kandaurov [Fri, 2 Mar 2012 09:52:42 +0000 (09:52 +0000)]
Reflect the renaming of ifmaof_ifpforaddr() to if_findmulti() in r148652.

MFC after: 1 week

12 years agoDo not expose unlocked unconstructed nullfs vnode on mount list.
Konstantin Belousov [Fri, 2 Mar 2012 09:48:46 +0000 (09:48 +0000)]
Do not expose unlocked unconstructed nullfs vnode on mount list.
Lock the native nullfs vnode lock before switching the locks.

Tested by: pho
MFC after: 1 week

12 years agoifp->if_ioctl() has moved to u_long cmd in r36735.
Sergey Kandaurov [Fri, 2 Mar 2012 09:30:54 +0000 (09:30 +0000)]
ifp->if_ioctl() has moved to u_long cmd in r36735.
Somehow that change had not reached here together with ifioctl().

MFC after: 1 week

12 years agoFix names of some Marvell SATA chips. It looks like chips with proprietary
Alexander Motin [Fri, 2 Mar 2012 08:49:07 +0000 (08:49 +0000)]
Fix names of some Marvell SATA chips. It looks like chips with proprietary
interface supported by mvs(4) are 88SX, while AHCI-like chips are 88SE.

PR: kern/165271
Submitted by: Jia-Shiun Li <jiashiun@gmail.com>
MFC after: 1 week

12 years agoAllow to configure net.inet6.ip6.{accept_rtadv,no_radr} by the loader tunables
Hiroki Sato [Fri, 2 Mar 2012 07:23:28 +0000 (07:23 +0000)]
Allow to configure net.inet6.ip6.{accept_rtadv,no_radr} by the loader tunables
as well because they have to be configured before interface initialization for
AF_INET6.

12 years agoRemove a redundant check.
Hiroki Sato [Fri, 2 Mar 2012 07:22:04 +0000 (07:22 +0000)]
Remove a redundant check.

12 years agoKill EoL whitespaces, and minor lint.
Sergey Kandaurov [Fri, 2 Mar 2012 05:55:45 +0000 (05:55 +0000)]
Kill EoL whitespaces, and minor lint.

12 years agoAdd ahci(4) and siis(4) to the hardware notes.
Alexander Motin [Fri, 2 Mar 2012 05:16:53 +0000 (05:16 +0000)]
Add ahci(4) and siis(4) to the hardware notes.

MFC after: 1 week

12 years agoWrap another ATH_LOCK around the scanning flag.
Adrian Chadd [Fri, 2 Mar 2012 03:11:53 +0000 (03:11 +0000)]
Wrap another ATH_LOCK around the scanning flag.

PR: kern/163318

12 years agoWrap the scan code state change stuff behind ATH_LOCK and the PCU fiddling
Adrian Chadd [Fri, 2 Mar 2012 02:57:10 +0000 (02:57 +0000)]
Wrap the scan code state change stuff behind ATH_LOCK and the PCU fiddling
behind the PCU lock.

sc_scanning is being checked without ATH_LOCK behind held and could
in theory run from multiple threads.

12 years agoAttempt to catch scan cancellations at exactly the wrong time from occuring.
Adrian Chadd [Fri, 2 Mar 2012 02:53:43 +0000 (02:53 +0000)]
Attempt to catch scan cancellations at exactly the wrong time from occuring.

The scan code unlocks the comlock and calls into the driver.  It then
assumes the state hasn't changed from underneath it.

Although I haven't seen this particular condition trigger, I'd like to
be informed if I or anyone else sees it.

What I'm thinking may occur:

* A cancellation comes in during the scan_end call;
* the cancel flag is set;
* but it's never checked, so scandone isn't updated;
* .. and the interface stays in the STA power save mode.

It's a subtle race, if it even exists.

PR: kern/163318

12 years agoProperly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
John Baldwin [Thu, 1 Mar 2012 22:13:10 +0000 (22:13 +0000)]
Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
allocation fails.

Reviewed by: jfv
MFC after: 2 weeks

12 years ago- Add support for the Intel Sandy Bridge microarchitecture (both core and uncore...
Davide Italiano [Thu, 1 Mar 2012 21:23:26 +0000 (21:23 +0000)]
- Add support for the Intel Sandy Bridge microarchitecture (both core and uncore counting events)
- New manpages with event lists.
- Add MSRs for the Intel Sandy Bridge microarchitecture

Reviewed by: attilio, brueffer, fabient
Approved by: gnn (mentor)
MFC after: 3 weeks

12 years agoProvide pre/post transfer method callbacks for icbbb
Alexander Kabaev [Thu, 1 Mar 2012 20:58:20 +0000 (20:58 +0000)]
Provide pre/post transfer method callbacks for icbbb
clients.

These are helful when making certain drivers work on both Linux
and FreeBSD without changing the code flow too much.

Reviewed by: kib, wlosh
MFC after: 1 month

12 years agoAdd regression test for USB enumeration.
Hans Petter Selasky [Thu, 1 Mar 2012 20:45:17 +0000 (20:45 +0000)]
Add regression test for USB enumeration.

MFC after: 1 week

12 years agoUpdate the documentation on pci_get/set_powerstate(). These methods are
John Baldwin [Thu, 1 Mar 2012 20:36:50 +0000 (20:36 +0000)]
Update the documentation on pci_get/set_powerstate().  These methods are
not ACPI-specific at all, but deal with PCI power states.  Also,
pci_set_powerstate() fails with EOPNOTSUPP if a request is made that the
underlying device does not support rather than falling back to somehow
setting D0.

12 years agoSort function prototypes.
John Baldwin [Thu, 1 Mar 2012 20:32:02 +0000 (20:32 +0000)]
Sort function prototypes.

12 years agoStyle change: Expand redundant #if's. Remove a couple of empty lines.
Hans Petter Selasky [Thu, 1 Mar 2012 20:25:17 +0000 (20:25 +0000)]
Style change: Expand redundant #if's. Remove a couple of empty lines.

MFC after: 1 week

12 years agoAdd pci_save_state() and pci_restore_state() wrappers around
John Baldwin [Thu, 1 Mar 2012 20:20:55 +0000 (20:20 +0000)]
Add pci_save_state() and pci_restore_state() wrappers around
pci_cfg_save() and pci_cfg_restore() for device drivers to use when
saving and restoring state (e.g. to handle device-specific resets).

Reviewed by: imp
MFC after: 2 weeks

12 years agoUpdate for adjusted types for boundary arguments in 232356.
John Baldwin [Thu, 1 Mar 2012 20:19:21 +0000 (20:19 +0000)]
Update for adjusted types for boundary arguments in 232356.

12 years agoClose a detach race. Make sure all pending
Hans Petter Selasky [Thu, 1 Mar 2012 20:10:54 +0000 (20:10 +0000)]
Close a detach race. Make sure all pending
CCB's get canceled at device detach.

MFC after: 1 week

12 years agoAdd myself
Alex Kozlov [Thu, 1 Mar 2012 20:03:44 +0000 (20:03 +0000)]
Add myself

Approved by: itetcu (mentor)

12 years ago- Change contigmalloc() to use the vm_paddr_t type instead of an unsigned
John Baldwin [Thu, 1 Mar 2012 19:58:34 +0000 (19:58 +0000)]
- Change contigmalloc() to use the vm_paddr_t type instead of an unsigned
  long for specifying a boundary constraint.
- Change bus_dma tags to use bus_addr_t instead of bus_size_t for boundary
  constraints.

These allow boundary constraints to be fully expressed for cases where
sizeof(bus_addr_t) != sizeof(bus_size_t).  Specifically, it allows a
driver to properly specify a 4GB boundary in a PAE kernel.

Note that this cannot be safely MFC'd without a lot of compat shims due
to KBI changes, so I do not intend to merge it.

Reviewed by: scottl

12 years agoAdd snd_hdspe(4) to the hardware notes.
Christian Brueffer [Thu, 1 Mar 2012 19:54:35 +0000 (19:54 +0000)]
Add snd_hdspe(4) to the hardware notes.

12 years agoReplace the three spaces with one tag.
Davide Italiano [Thu, 1 Mar 2012 19:17:56 +0000 (19:17 +0000)]
Replace the three spaces with one tag.

Reported by: pjd
Approved by: gnn (mentor)

12 years agoThis change avoids a kernel deadlock on "snaplk" when using
Kirk McKusick [Thu, 1 Mar 2012 18:45:25 +0000 (18:45 +0000)]
This change avoids a kernel deadlock on "snaplk" when using
snapshots on UFS filesystems running with journaled soft updates.
This is the first of several bugs that need to be fixed before
removing the restriction added in -r230250 to prevent the use
of snapshots on filesystems running with journaled soft updates.

The deadlock occurs when holding the snapshot lock (snaplk)
and then trying to flush an inode via ffs_update(). We become
blocked by another process trying to flush a different inode
contained in the same inode block that we need. It holds the
inode block for which we are waiting locked. When it tries to
write the inode block, it gets blocked waiting for the our
snaplk when it calls ffs_copyonwrite() to see if the inode
block needs to be copied in our snapshot.

The most obvious place that this deadlock arises is in the
ffs_copyonwrite() routine when it updates critical metadata
in a snapshot and tries to write it out before proceeding.
The fix here is to write the data and indirect block pointer
for the snapshot, but to skip the call to ffs_update() to
write the snapshot inode. To ensure that we will never have
to update a pointer in the inode itself, the ffs_snapshot()
routine that creates the snapshot has to ensure that all the
direct blocks are allocated as part of the creation of the
snapshot.

A less obvious place that this deadlock occurs is when we hold
the snaplk because we are deleting a snapshot. In the course of
doing the deletion, we need to allocate various soft update
dependency structures and allocate some journal space. If we
hit a resource limit while doing this we decrease the resources
in use by flushing out an existing dirty file to get it to give
up the soft dependency resources that it holds. The flush can
cause an ffs_update() to be done on the inode for the file that
we have selected to flush resulting in the same deadlock as
described above when the inode that we have chosen to flush
resides in the same inode block as the snapshot inode that we hold.
The fix is to defer cleaning up any time that the inode on which
we are operating is a snapshot.

Help and review by:    Jeff Roberson
Tested by:             Peter Holm
MFC (to 9 only) after: 2 weeks

12 years agoSince r199137 namei() returns EINVAL for DELETE and RENAME operations if
Jaakko Heinonen [Thu, 1 Mar 2012 18:17:45 +0000 (18:17 +0000)]
Since r199137 namei() returns EINVAL for DELETE and RENAME operations if
the last component of the pathname is ".".

Reviewed by: kib
MFC after: 1 week

12 years agoremove some write-only variables.
Luigi Rizzo [Thu, 1 Mar 2012 17:35:16 +0000 (17:35 +0000)]
remove some write-only variables.
There is another block of code that is now useless as the computation
is done in the kernel.

12 years agoHandle the case where a boolean parameter is also a node.
Jamie Gritton [Thu, 1 Mar 2012 15:09:41 +0000 (15:09 +0000)]
Handle the case where a boolean parameter is also a node.

PR: bin/165515
MFC after: 2 weeks

12 years agoNote that memory should be freed after uuid_to_string(3) call.
Andrey V. Elsukov [Thu, 1 Mar 2012 14:39:01 +0000 (14:39 +0000)]
Note that memory should be freed after uuid_to_string(3) call.

MFC after: 1 week

12 years agoAdd driver for the RME HDSPe AIO/RayDAT sound cards -- snd_hdspe(4).
Alexander Motin [Thu, 1 Mar 2012 13:10:18 +0000 (13:10 +0000)]
Add driver for the RME HDSPe AIO/RayDAT sound cards -- snd_hdspe(4).
Cards are expensive and so rare, so leave the driver as module.

Submitted by: Ruslan Bukin <br@bsdpad.com>
MFC after: 2 weeks

12 years agoChanges in ifaddr refcounting: ifa_refcnt IFAREF/IFAFREE macros
Sergey Kandaurov [Thu, 1 Mar 2012 12:52:14 +0000 (12:52 +0000)]
Changes in ifaddr refcounting: ifa_refcnt IFAREF/IFAFREE macros
moved to ifa_ref()/ifa_free() refcounting functions.

MFC after: 1 week

12 years agoRefine r232333 [1] and put note about ifnet refcount caller responsibility.
Sergey Kandaurov [Thu, 1 Mar 2012 12:30:57 +0000 (12:30 +0000)]
Refine r232333 [1] and put note about ifnet refcount caller responsibility.

Spotted by: gavin [1]
MFC after: 1 week

12 years agoReflect that ifa_ifwithnet() gained ignore_ptp argument.
Sergey Kandaurov [Thu, 1 Mar 2012 12:16:00 +0000 (12:16 +0000)]
Reflect that ifa_ifwithnet() gained ignore_ptp argument.

MFC after: 1 week

12 years agoDocument ifunit_ref function.
Sergey Kandaurov [Thu, 1 Mar 2012 12:03:52 +0000 (12:03 +0000)]
Document ifunit_ref function.

MFC after: 1 week

12 years agoDocument ifnet refcount.
Sergey Kandaurov [Thu, 1 Mar 2012 11:03:39 +0000 (11:03 +0000)]
Document ifnet refcount.

MFC after: 1 week

12 years agoUse proper "maxproc" name, not "nproc".
Edward Tomasz Napierala [Thu, 1 Mar 2012 10:21:10 +0000 (10:21 +0000)]
Use proper "maxproc" name, not "nproc".

PR: docs/162172

12 years agoFix the NFS clients so that they use copyin() instead of bcopy(),
Rick Macklem [Thu, 1 Mar 2012 03:53:07 +0000 (03:53 +0000)]
Fix the NFS clients so that they use copyin() instead of bcopy(),
when doing direct I/O. This direct I/O code is not enabled by default.

Submitted by: kib (earlier version)
Reviewed by: kib
MFC after: 1 week

12 years agoRegenerate src.conf(5) after r232322.
Dimitry Andric [Wed, 29 Feb 2012 23:06:48 +0000 (23:06 +0000)]
Regenerate src.conf(5) after r232322.

MFC after: 2 weeks

12 years agoAdd a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
Dimitry Andric [Wed, 29 Feb 2012 22:58:51 +0000 (22:58 +0000)]
Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp.

Note this does *not* disable building and installing gcc, which will
still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp.  If
you want to disable gcc completely, you must use WITHOUT_GCC.

MFC after: 2 weeks

12 years agoCorrect the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
Andrew Thompson [Wed, 29 Feb 2012 22:41:40 +0000 (22:41 +0000)]
Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
system tunable has never been implemented. This flag is only used by sysctl(8)
to provide a helpful error message.

Discussed with: dwhite, kan

12 years agoUse srandom() to init the PRNG, not srand(), since we use random().
Olivier Houchard [Wed, 29 Feb 2012 22:35:09 +0000 (22:35 +0000)]
Use srandom() to init the PRNG, not srand(), since we use random().
This is harmless because srandom() is called somewhere else, with time(NULL)
as a seed, but this is more correct.

Obtained from: https://bitbucket.org/mux/csup
Pointyhat to: not mux, somebody else

MFC after: 1 week

12 years agoUse pci_printf() instead of a home-rolled version in the VPD parsing code.
John Baldwin [Wed, 29 Feb 2012 22:06:44 +0000 (22:06 +0000)]
Use pci_printf() instead of a home-rolled version in the VPD parsing code.

12 years agoIntroduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH()
Mikolaj Golub [Wed, 29 Feb 2012 21:38:31 +0000 (21:38 +0000)]
Introduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH()
operations for setting and accessing vnode's v_socket field.

The operations are necessary to implement proper unix socket handling
on layered file systems like nullfs(5).

This change fixes the long standing issue with nullfs(5) being in that
unix sockets did not work between lower and upper layers: if we bound
to a socket on the lower layer we could connect only to the lower
path; if we bound to the upper layer we could connect only to the
upper path. The new behavior is one can connect to both the lower and
the upper paths regardless what layer path one binds to.

PR: kern/51583, kern/159663
Suggested by: kib
Reviewed by: arch
MFC after: 2 weeks

12 years agoUpdate bridge(4) default values.
Christian Brueffer [Wed, 29 Feb 2012 21:11:02 +0000 (21:11 +0000)]
Update bridge(4) default values.

PR: 164564
Submitted by: "Rudy (bulk)" <crapsh@monkeybrains.net>
MFC after: 2 weeks

12 years agoUse a more appropriate default for the maximum number of addresses in the
Andrew Thompson [Wed, 29 Feb 2012 20:58:21 +0000 (20:58 +0000)]
Use a more appropriate default for the maximum number of addresses in the
bridge forwarding table.

PR: docs/164564
Discussed with: brueffer