]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
12 years agoMFC r233711:
ambrisko [Wed, 18 Apr 2012 18:31:11 +0000 (18:31 +0000)]
MFC r233711:
Major update to driver to support for Drake Skinny and ThunderBolt cards.

MFC r233768:
Change typedef atomic_t to struct mfi_atomic to avoid name space
collision and some couple more style changes.

MFC r233805:
Move struct megasas_sge from mfi_ioctl.h to mfivar.h so we can
remove including machine/bus.h.  Add some more mfi_ prefixes to
avoid name space pollution.

MFC r233877:
- Do not include machine/atomic.h.  It is no longer necessary since r233768.
- Remove bogus "atomic" macros and a read-only variable from softc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234429 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234122:
ae [Wed, 18 Apr 2012 05:16:02 +0000 (05:16 +0000)]
MFC r234122:
  It seems that libdisk(3) incorrectly sets d_secperunit value.
  Automatically fix it like GEOM_PART_BSD does.

  PR: bin/165789

git-svn-id: svn://svn.freebsd.org/base/stable/9@234410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233179:
ae [Wed, 18 Apr 2012 05:11:52 +0000 (05:11 +0000)]
MFC r233179:
  Document GEOM_PART_LDM scheme and partition types.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233176:
ae [Wed, 18 Apr 2012 04:59:47 +0000 (04:59 +0000)]
MFC r233176:
  Add new GEOM_PART_LDM module that implements the Logical Disk Manager
  scheme. The LDM is a logical volume manager for MS Windows NT and it
  is also known as dynamic volumes. It supports about 2000 partitions
  and also provides the capability for software RAID implementations.

  This version implements only partitioning scheme capability and based
  on the linux-ntfs project documentation and several publications across
  the Web. NOTE: JBOD, RAID0 and RAID5 volumes aren't supported.

  An access to the LDM metadata is read-only. When LDM is on the disk
  partitioned with MBR we can also destroy metadata. For the GPT
  partitioned disks destroy action is not supported.

MFC r233177:
  Connect geom_part_ldm module to the build.

MFC r233178:
  Connect geom_part_ldm to the kernel build.

MFC r233181:
  Add CTLFLAG_TUN to sysctls.

MFC r233651:
  Do proper cleanup for the GPT case when an error occurs.

MFC r233652:
  VMDB offset should be greater than logical volume size only for MBR.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233175:
ae [Wed, 18 Apr 2012 04:39:12 +0000 (04:39 +0000)]
MFC r233175:
  Make kern.geom.part node not static. Also add CTLFLAG_TUN to the
  check_integrity sysctl.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 234059:
jhb [Tue, 17 Apr 2012 19:55:31 +0000 (19:55 +0000)]
MFC 234059:
Recognize the RDRAND instruction feature.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234391 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233296,233300:
pluknet [Tue, 17 Apr 2012 11:54:01 +0000 (11:54 +0000)]
MFC 233296,233300:
 Prevent fs_file NULL pointer dereference.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234378 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233939:
pluknet [Tue, 17 Apr 2012 11:01:17 +0000 (11:01 +0000)]
MFC r233939:
 Free ballooned pages with the corresponding malloc type.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 233103, 233912 from head:
davidxu [Tue, 17 Apr 2012 09:09:14 +0000 (09:09 +0000)]
Merge 233103, 233912 from head:

233103:
Some software think a mutex can be destroyed after it owned it, for
example, it uses a serialization point like following:
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&muetx);
They think a previous lock holder should have already left the mutex and
is no longer referencing it, so they destroy it. To be maximum compatible
with such code, we use IA64 version to unlock the mutex in kernel, remove
the two steps unlocking code.

233912:
umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
a mutex after a thread has unlocked it, it event writes data to the mutex
memory to clear contention bit, there is a race that other threads
can lock it and unlock it, then destroy it, so it should not write
data to the mutex memory if there isn't any waiter.
The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It
requires thread library to clear the lock word entirely, then
call the WAKE2 operation to check if there is any waiter in kernel,
and try to wake up a thread, if necessary, the contention bit is set again
by the operation. This also mitgates the chance that other threads find
the contention bit and try to enter kernel to compete with each other
to wake up sleeping thread, this is unnecessary. With this change, the
mutex owner is no longer holding the mutex until it reaches a point
where kernel umtx queue is locked, it releases the mutex as soon as
possible.
Performance is improved when the mutex is contensted heavily.  On Intel
i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds
to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is
deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c

Special code for stable/9:
And add code to detect if the UMTX_OP_MUTEX_WAKE2 is available.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234372 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233912:
davidxu [Tue, 17 Apr 2012 09:02:55 +0000 (09:02 +0000)]
MFC r233912:

mtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
a mutex after a thread has unlocked it, it event writes data to the mutex
memory to clear contention bit, there is a race that other threads
can lock it and unlock it, then destroy it, so it should not write
data to the mutex memory if there isn't any waiter.
The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It
requires thread library to clear the lock word entirely, then
call the WAKE2 operation to check if there is any waiter in kernel,
and try to wake up a thread, if necessary, the contention bit is set again
by the operation. This also mitgates the chance that other threads find
the contention bit and try to enter kernel to compete with each other
to wake up sleeping thread, this is unnecessary. With this change, the
mutex owner is no longer holding the mutex until it reaches a point
where kernel umtx queue is locked, it releases the mutex as soon as
possible.
Performance is improved when the mutex is contensted heavily.  On Intel
i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds
to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is
deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c

git-svn-id: svn://svn.freebsd.org/base/stable/9@234371 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge r232779 from head:
gavin [Mon, 16 Apr 2012 12:49:19 +0000 (12:49 +0000)]
Merge r232779 from head:
  Move determination of socket buffer sizes from startup to the first time
  a socket is used.  The previous code structure assumed that AF_INET
  sockets were always available, which is an invalid assumption on
  IPv6-only systems.

  This merges the fololowing revisions from NetBSD:
  src/usr.bin/ftp/main.c 1.120
  src/usr.bin/ftp/util.c 1.156

PR: bin/162661
Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@234340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234206:
kevlo [Mon, 16 Apr 2012 01:15:38 +0000 (01:15 +0000)]
MFC r234206:
Partially implement zipinfo (-Z) support.
This fixes some test failures seen with perl 5.12 and 5.14.

PR: bin/166895
Submitted by: swills

git-svn-id: svn://svn.freebsd.org/base/stable/9@234330 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoregen
netchild [Sun, 15 Apr 2012 16:53:44 +0000 (16:53 +0000)]
regen

git-svn-id: svn://svn.freebsd.org/base/stable/9@234317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232799:
netchild [Sun, 15 Apr 2012 16:52:48 +0000 (16:52 +0000)]
MFC r232799:
  - add comments to syscalls.master and linux(32)_dummy about which linux
    kernel version introduced the sysctl (based upon a linux man-page)
  - add comments to syscalls.master regarding some names of sysctls which are
    different than the linux-names (based upon the linux unistd.h)
  - add some dummy sysctls
  - name an unimplemented sysctl

git-svn-id: svn://svn.freebsd.org/base/stable/9@234316 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233392, r233679:
trociny [Sat, 14 Apr 2012 17:33:47 +0000 (17:33 +0000)]
MFC r233392, r233679:

r233392:

Fix typo.

r233679:

If hastd is invoked with "-P pidfile" option always create pidfile
regardless of whether -F (foreground) option is set or not.

Also, if -P option is specified, ignore pidfile setting from configuration
not only on start but on reload too. This fixes the issue when for hastd
run with -P option reload caused the pidfile change.

Reviewed by: pjd

git-svn-id: svn://svn.freebsd.org/base/stable/9@234294 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 233272:
glebius [Sat, 14 Apr 2012 10:36:43 +0000 (10:36 +0000)]
Merge 233272:
  in6_pcblookup_local() still can return a pcb with NULL
  inp_socket. To avoid panic, do not dereference inp_socket,
  but obtain reuse port option from inp_flags2, like this
  is done after next call to in_pcblookup_local() a few lines
  down below.

  Submitted by: rwatson

git-svn-id: svn://svn.freebsd.org/base/stable/9@234279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 231076,231078:
glebius [Sat, 14 Apr 2012 10:20:34 +0000 (10:20 +0000)]
Merge 231076,231078:
  Make the 'tcpwin' option of ipfw(8) accept ranges and lists.

  Submitted by: sem

git-svn-id: svn://svn.freebsd.org/base/stable/9@234278 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 231831:
glebius [Sat, 14 Apr 2012 10:13:36 +0000 (10:13 +0000)]
Merge 231831:
  Refactor the name hash and the ID hash, that are used to address nodes:

  - Make hash sizes growable, to satisfy users running large mpd
    installations, having thousands of nodes.
  - NG_NAMEHASH() proved to give a very bad distribution in real life
    name sets, while generic hash32_str(name, HASHINIT) proved to give
    an even one, so use the latter for name hash.
  - Do not store unnamed nodes in slot 0 of name hash, no reason for that.
  - Use the ID hash in cases when we need to run through all nodes: the
    NGM_LISTNODES command and in the vnet_netgraph_uninit().
  - Implement NGM_LISTNODES and NGM_LISTNAMES as separate code, the former
    iterates through the ID hash, and the latter through the name hash.
  - Keep count of all nodes and of named nodes, so that we don't need
    to count nodes in NGM_LISTNODES and NGM_LISTNAMES. The counters are
    also used to estimate whether we need to grow hashes.
  - Close a race between two threads running ng_name_node() assigning same
    name to different nodes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 231760,231761,231764,231765,231766,231823,231830 from head:
glebius [Sat, 14 Apr 2012 10:08:07 +0000 (10:08 +0000)]
Merge 231760,231761,231764,231765,231766,231823,231830 from head:

  231760,231766:
style(9): sort includes
  231761:
In ng_bypass() add more protection against potential race
with ng_rmnode() and its followers.
  231764:
Remove testing stuff, reducing kernel memory footprint by 1 Kb.
  231765:
Trim double empty lines.
  231823:
In ng_getsockaddr() allocate memory prior to obtaining lock.
  231830:
Specify correct loading order for core of netgraph(4).

git-svn-id: svn://svn.freebsd.org/base/stable/9@234276 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 233269:
glebius [Sat, 14 Apr 2012 09:48:52 +0000 (09:48 +0000)]
Merge 233269:
  Add multibyte char support.

  PR:           165429
  Submitted by: amdmi3

git-svn-id: svn://svn.freebsd.org/base/stable/9@234275 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 231586:
glebius [Sat, 14 Apr 2012 09:43:58 +0000 (09:43 +0000)]
Merge 231586:
  Fix write(1) to support wide characters.

  Submitted by: amdmi3
  PR:           bin/164317

git-svn-id: svn://svn.freebsd.org/base/stable/9@234274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge 232538:
glebius [Sat, 14 Apr 2012 09:21:06 +0000 (09:21 +0000)]
Merge 232538:
  Fix ng_ipfw(4) cookie number in example.

  Pointed out by: "Jacco van Buuren" <jaccovanbuuren gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/9@234273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r231813:
eadler [Sat, 14 Apr 2012 02:46:59 +0000 (02:46 +0000)]
MFC r231813:
Add err(3) to strerror(3) SEE ALSO section

Approved by: cperciva (implicit)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230347:
eadler [Sat, 14 Apr 2012 02:10:45 +0000 (02:10 +0000)]
MFC r230347:
Fix warning when compiling with gcc46:
error: variable 'addrs' set but not used

Approved by: cperciva (implicit)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234134:
eadler [Sat, 14 Apr 2012 02:06:53 +0000 (02:06 +0000)]
MFC r234134:
s/Free Memory Pages/Free Memory/ to avoid confusion, since we're
reporting a number of bytes rather than a number of pages

Approved by: cperciva (implicit)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234260 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233888
marius [Fri, 13 Apr 2012 22:04:26 +0000 (22:04 +0000)]
MFC: r233888

- Const'ify the device lookup-table.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Enable support for flow control.
  Tested by: yongari

git-svn-id: svn://svn.freebsd.org/base/stable/9@234240 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233710:
dim [Fri, 13 Apr 2012 21:50:14 +0000 (21:50 +0000)]
MFC r233710:

Fix the following compilation warning with clang trunk in isci(4):

  sys/dev/isci/isci_task_request.c:198:7: error: case value not in enumerated type 'SCI_TASK_STATUS' (aka 'enum _SCI_TASK_STATUS') [-Werror,-Wswitch]
    case SCI_FAILURE_TIMEOUT:
   ^

This is because the switch is done on a SCI_TASK_STATUS enum type, but
the SCI_FAILURE_TIMEOUT value belongs to SCI_STATUS instead.

Because the list of SCI_TASK_STATUS values cannot be modified at this
time, use the simplest way to get rid of this warning, which is to cast
the switch argument to int.  No functional change.

Reviewed by: jimharris

git-svn-id: svn://svn.freebsd.org/base/stable/9@234239 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233354:
dim [Fri, 13 Apr 2012 21:47:14 +0000 (21:47 +0000)]
MFC r233354:

Work around the following clang warning in mps(4):

  sys/dev/mps/mps_sas.c:861:1: error: function 'mpssas_discovery_timeout' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  mpssas_discovery_timeout(void *data)
  ^

Because the driver is obtained from upstream, we don't want to modify
it; just silence the warning instead, it is harmless.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233052:
dim [Fri, 13 Apr 2012 21:35:24 +0000 (21:35 +0000)]
MFC r233052:

Change the style of share/mk/bsd.sys.mk to that of the other bsd.*.mk
files, and style.Makefile(5), where applicable.  While here, update the
link to the gcc warning documentation.

No functional change.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234043: intpm: return only SMB bus error codes from SMB methods
avg [Fri, 13 Apr 2012 08:08:44 +0000 (08:08 +0000)]
MFC r234043: intpm: return only SMB bus error codes from SMB methods

git-svn-id: svn://svn.freebsd.org/base/stable/9@234215 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234040: intpm: reflect the fact that SB800 and later AMD chipsets
avg [Fri, 13 Apr 2012 08:01:34 +0000 (08:01 +0000)]
MFC r234040: intpm: reflect the fact that SB800 and later AMD chipsets
are not supported

git-svn-id: svn://svn.freebsd.org/base/stable/9@234213 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233918: zfs_ioctl: no need for ddi_copyin/out here because
avg [Fri, 13 Apr 2012 07:48:45 +0000 (07:48 +0000)]
MFC r233918: zfs_ioctl: no need for ddi_copyin/out here because
sys_ioctl handles that

git-svn-id: svn://svn.freebsd.org/base/stable/9@234211 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r231558: newvers.sh: unbreak git/git-svn support
avg [Fri, 13 Apr 2012 07:39:20 +0000 (07:39 +0000)]
MFC r231558: newvers.sh: unbreak git/git-svn support

git-svn-id: svn://svn.freebsd.org/base/stable/9@234209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233000:
ae [Fri, 13 Apr 2012 04:17:43 +0000 (04:17 +0000)]
MFC r233000:
  Add MODULE_DEPEND() to geom_part modules.

MFC r233342:
  Check that scheme is not already registered. This may happens when a
  KLD is preloaded with loader(8) and leads to infinity loop.

  Also do not return EEXIST error code from MOD_LOAD handler, because
  we have undocumented(?) ability replace kernel's module with preloaded one.
  And if we have so, then preloaded module will be initialized first.
  Thus error in MOD_LOAD handler will be triggered for the kernel.

  PR: kern/165573

git-svn-id: svn://svn.freebsd.org/base/stable/9@234198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233704
jkim [Thu, 12 Apr 2012 23:06:07 +0000 (23:06 +0000)]
MFC: r233704

Re-initialize more model-specific registers when we resume CPUs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228730
melifaro [Thu, 12 Apr 2012 17:49:53 +0000 (17:49 +0000)]
MFC: r228730

Add binding support to libradius(3).
Submitted by:    Sergey Matveychuk <sem33@yandex-team.ru>

Approved by:     kib(mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234191 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233547:
jhb [Thu, 12 Apr 2012 13:53:10 +0000 (13:53 +0000)]
MFC 233547:
Use VM_MEMATTR_UNCACHEABLE instead of VM_MEMATTR_UNCACHED for UC mappings.
VM_MEMATTR_UNCACHED is actually the x86-specific UC- mode (where a WC
MTRR can override the PAT setting).

git-svn-id: svn://svn.freebsd.org/base/stable/9@234181 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233670,233671:
jhb [Thu, 12 Apr 2012 13:46:56 +0000 (13:46 +0000)]
MFC 233670,233671:
- Use VM_MEMATTR_UNCACHEABLE for the constant for UC memory rather than
  VM_MEMATTR_UNCACHED on mips.
- Rename VM_MEMATTR_UNCACHED to VM_MEMATTR_WEAK_UNCACHEABLE on x86 to
  be less ambiguous and more clearly identify what it means.  An alias
  from VM_MEMATTR_WEAK_UNCACHEABLE to VM_MEMATTR_WEAK_UNCACHED remains
  on x86 to preserve the KPI.
- Remove the VM_MEMATTR_UNCACHED alias from powerpc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 232919:
mav [Thu, 12 Apr 2012 06:29:02 +0000 (06:29 +0000)]
MFC 232919:
Add kern.eventtimer.activetick tunable/sysctl, specifying whether each
hardclock() tick should be run on every active CPU, or on only one.

On my tests, avoiding extra interrupts because of this on 8-CPU Core i7
system with HZ=10000 saves about 2% of performance. At this moment option
implemented only for global timers, as reprogramming per-CPU timers is
too expensive now to be compensated by this benefit, especially since we
still have to regularly run hardclock() on at least one active CPU to
update system uptime. For global timer it is quite trivial: timer runs
always, but we just skip IPIs to other CPUs when possible.

Option is enabled by default now, keeping previous behavior, as periodic
hardclock() calls are still used at least to implement setitimer(2) with
ITIMER_VIRTUAL and ITIMER_PROF arguments. But since default schedulers don't
depend on it since r232917, we are much more free to experiment with it.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232917:
mav [Thu, 12 Apr 2012 06:24:47 +0000 (06:24 +0000)]
MFC r232917:
Rewrite thread CPU usage percentage math to not depend on periodic calls
with HZ rate through the sched_tick() calls from hardclock().

Potentially it can be used to improve precision, but now it is just minus
one more reason to call hardclock() for every HZ tick on every active CPU.
SCHED_4BSD never used sched_tick(), but keep it in place for now, as at
least SCHED_FBFS existing in patches out of the tree depends on it.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234166 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233018:
nwhitehorn [Thu, 12 Apr 2012 00:38:34 +0000 (00:38 +0000)]
MFC r233018:
Make ofw_bus_get_node() consistently return -1 when there is no associated
OF node, instead of a random mixture of 0 and -1. Update all checks for 0
to check for -1 instead.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234160 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233676:
jhb [Wed, 11 Apr 2012 20:50:17 +0000 (20:50 +0000)]
MFC 233676:
Use a more proper fix for enabling HT MSI mapping windows on Host-PCI
bridges.  Rather than blindly enabling the windows on all of them, only
enable the window when an MSI interrupt is enabled for a device behind
the bridge, similar to what already happens for HT PCI-PCI bridges.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233893:
jhb [Wed, 11 Apr 2012 20:26:50 +0000 (20:26 +0000)]
MFC 233893:
Disable INET6 support in modules when building the LINT-NOINET6 kernel.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233305,233623:
jhb [Wed, 11 Apr 2012 20:25:01 +0000 (20:25 +0000)]
MFC 233305,233623:
- Mark the 'lapics' and 'ioapics' arrays here static since they are
  private to this file.  The 'lapics' array was actually shadowing a
  completely different 'lapics' array that is private to local_apic.c.
- Allocate the ioapics[] array dynamically since it is only needed for the
  duration of madt_setup_io().  This avoids having the array take up
  permanent space in the BSS.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234147 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 232228,233613:
jhb [Wed, 11 Apr 2012 20:19:07 +0000 (20:19 +0000)]
MFC 232228,233613:
Move the DTrace return IDT vector back up from 0x20 to 0x92.  The 0x20
vector is currently dedicated to servicing IRQ 0 from the 8259A's, so
it shouldn't be overloaded for DTrace.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234145 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 232744,232747,233031:
jhb [Wed, 11 Apr 2012 20:04:31 +0000 (20:04 +0000)]
MFC 232744,232747,233031:
- Allow a native i386 kernel to be built with 'nodevice atpic'.  Just as on
  amd64, if 'device isa' is present quiesce the 8259A's during boot and
  resume from suspend.
- Move i386's intr_machdep.c to the x86 tree and share it with amd64.
- Merge r232744 changes to pc98.
  (Allow a kernel to be built with 'nodevice atpic'.)
- Move ICU related defines from x86/isa/atpic.c to x86/isa/icu.h and
  use them in x86/x86/intr_machdep.c.

Note, I normally would have merged 232747 separately, but 233031 assumed
232747 was already merged and 232744 needs to be merged with 233031.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 232742:
jhb [Wed, 11 Apr 2012 19:37:08 +0000 (19:37 +0000)]
MFC 232742:
MFamd64:
- Return failure for a suspend attempt if we have no wake address.
- Use intr_disable()/intr_restore() instead of ACPI_DISABLE_IRQS().
- Invoke intr_suspend() earlier and call intr_resume() if suspend
  fails.
- Use pause in the loop waiting for CPU to suspend.
- Restore PAT MSR, switchtime, switchticks, and MTRRs on resume.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233688-233689:
yongari [Wed, 11 Apr 2012 07:18:41 +0000 (07:18 +0000)]
MFC r233688-233689:
r233688:
  Remove task queue based link state change handler. Driver no longer
  needs to defer link state handling.
  While I'm here, mark IFF_DRV_RUNNING before changing media.  If
  link is established without any delay, that link state change
  handling could be lost.

r233689:
  Do not report current link status if driver is not running.
  This change also workarounds dhclient's link state handling bug by
  not giving current link status.

  Unlike other controllers, ale(4)'s PHY hibernation perfectly works
  such that driver does not see a valid link if the controller is not
  brought up.  If dhclient(8) runs on ale(4) it will blindly waits
  until link UP and then gives up after 10 seconds.  Because
  dhclient(8) still thinks interface got a valid link when IFM_AVALID
  is not set for selected media,  this change makes dhclient initiate
  DHCP without waiting for link UP.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233585-233587:
yongari [Wed, 11 Apr 2012 07:08:41 +0000 (07:08 +0000)]
MFC r233585-233587:
r233585:
  Partially revert r223608 and selectively allow microcode loading
  for 82550C.  For 82550 controllers this change restores CPUSaver
  microcode loading.  Due to silicon bug on 82550 and 82550C with
  server extension, these controllers seem to require CPUSaver
  microcode to receive fragmented UDP datagrams.  However the
  microcode shouldn't be used on client featured 82550C as it locks
  up the controller.  In addition, client featured 82550C does not
  have the silicon bug.  Also clear temporary memory used for
  microcode loading since the same memory area is used for other
  commands.
  While I'm here use 82550C in probe message instead of generic
  82550.

  Reported by: Andreas Longwitz <longwitz <> incore de>
  Tested by: Andreas Longwitz <longwitz <> incore de>

r233586:
  Load entire EEPROM contents in device attach time and verify
  whether the checksum of EEPROM is valid or not.  Because driver
  heavily relies on EEPROM information when it selectively enables
  features/workarounds, it would be helpful to know whether driver
  sees valid EEPROM.
  While I'm here remove all other EEPROM accesses since the entire
  EEPROM is loaded at device attach time.

r233587:
  Remove unnecessary #if as the software workaround for PCI protocol
  violation should be activated unless the system is cold-booted
  after updating EEPROM.
  The PCI protocol violation happens only when established link is
  10Mbps so the workaround should be updated whenever link state
  change is detected.  Previously the workaround was activated only
  when user checks current media status with ifconfig(8).

git-svn-id: svn://svn.freebsd.org/base/stable/9@234123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233609, r233610:
kib [Wed, 11 Apr 2012 04:57:11 +0000 (04:57 +0000)]
MFC r233609, r233610:
Restore the writes of atimes, quotas and superblock from syncer vnode.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233948:
nwhitehorn [Wed, 11 Apr 2012 00:28:44 +0000 (00:28 +0000)]
MFC r233948:
Give the kernel pmap lock a different name than user pmap locks. It has
(slightly) different semantics and renaming it prevents a (harmless)
WITNESS warning during bootup for 32-bit kernels on 64-bit CPUs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234116 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r226294 / r226793 from HEAD - Only call fixup_filename() when printing.
adrian [Tue, 10 Apr 2012 21:23:28 +0000 (21:23 +0000)]
MFC r226294 / r226793 from HEAD - Only call fixup_filename() when printing.

This reduces CPU overhead on lock-happy workloads when using WITNESS.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234003:
nwhitehorn [Tue, 10 Apr 2012 13:37:43 +0000 (13:37 +0000)]
MFC r234003:

Properly resolve the _ctx_start function descriptor (the symbol _ctx_start
is a descriptor, not a code address), which prevents crashes when starting
a context. This fixes QEMU on powerpc64.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234097 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 231814 233135:
eadler [Tue, 10 Apr 2012 01:20:32 +0000 (01:20 +0000)]
MFC 231814 233135:
Add a timestamp to the msgbuf output in order to determine when when
messages were printed.

This can be enabled with the kern.msgbuf_show_timestamp sysctl

PR: kern/161553
Approved by: cperciva (implicit)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234075 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233516: libthr: In the atfork handlers for signals, do not skip the
jilles [Mon, 9 Apr 2012 22:01:43 +0000 (22:01 +0000)]
MFC r233516: libthr: In the atfork handlers for signals, do not skip the
last signal.

_SIG_MAXSIG works a bit unexpectedly: signals 1 till _SIG_MAXSIG are valid,
both bounds inclusive.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234073 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233783:
andreast [Mon, 9 Apr 2012 14:05:01 +0000 (14:05 +0000)]
MFC r233783:

  - Write the ISO9660 descriptor after the apm partition entries.
  - Fill the needed pmPartStatus flags. At least the OpenBIOS
    implementation relies on these flags.

  This commit fixes the panic seen on OS-X when inserting a FreeBSD/ppc disc.
  Additionally OpenBIOS recognizes the partition where the boot code is located.
  This lets us load a FreeBSD/ppc PowerMac kernel inside qemu.

PR: powerpc/16209

git-svn-id: svn://svn.freebsd.org/base/stable/9@234055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r232366
davide [Sun, 8 Apr 2012 21:29:48 +0000 (21:29 +0000)]
MFC: r232366

- 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

Approved by: gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234046 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r229470
davide [Sun, 8 Apr 2012 20:51:37 +0000 (20:51 +0000)]
MFC: r229470

Update PMC events from October 2011 Intel documentation.

Approved by: gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r229469
davide [Sun, 8 Apr 2012 20:40:26 +0000 (20:40 +0000)]
MFC: r229469

Add missing MSR programming for some events.

Submitted by: me
Approved by: gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234041 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r232860
pho [Sun, 8 Apr 2012 16:26:26 +0000 (16:26 +0000)]
MFC: r232860

Allways call fdrop().

git-svn-id: svn://svn.freebsd.org/base/stable/9@234037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233284:
bschmidt [Sun, 8 Apr 2012 09:33:22 +0000 (09:33 +0000)]
MFC r233284:
Update the firmware to version 0.236

Submitted by: PseudoCylon

git-svn-id: svn://svn.freebsd.org/base/stable/9@234028 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233923
pfg [Sun, 8 Apr 2012 05:36:40 +0000 (05:36 +0000)]
MFC: r233923

Fix a typo in GCC affecting calculations with -ffast-math.

The fix is similar to the one applied in GCC-4.3 in
GCCSVN-r117929 under the GPLv2.

Submitted by: Andrey Simonenko
Reviewed by: mm
Approved by: jhb (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234023 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233927:
kib [Sun, 8 Apr 2012 04:09:55 +0000 (04:09 +0000)]
MFC r233927:
Properly handle absent AT_CANARY aux entry.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234012 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233909:
dougb [Sun, 8 Apr 2012 01:43:41 +0000 (01:43 +0000)]
MFC r233909:

Add Bv9ARM.pdf to the list of docs to install.

MFV/MFC r233914:

Update to version 9.8.2, the latest from ISC, which contains numerous bug fixes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234010 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233827
marius [Sat, 7 Apr 2012 12:46:27 +0000 (12:46 +0000)]
MFC: r233827

Fix probing of SAS1068E with a device ID of 0x0059 after r232411 (MFC'ed
to stable/9 in r232562).
Reported by: infofarmer

MFC: r233886

Refine r233827; as it turns out, controllers with a device ID of 0x0059
can be upgraded to MegaRAID mode, in which case mfi(4) should attach to
these based on the sub-vendor and -device ID instead (not currently done).
Therefore, let mpt_pci_probe() return BUS_PROBE_LOW_PRIORITY.
While it, let mpt_pci_probe() return BUS_PROBE_DEFAULT instead of 0 in
the default case.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233995 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233431:
kib [Sat, 7 Apr 2012 05:43:50 +0000 (05:43 +0000)]
MFC r233431:
Remove libssp_nonshared from the rtld linking set. The only use for the
library was definition for the weak alias of __stack_chk_fail.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233987 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233430:
kib [Sat, 7 Apr 2012 05:42:37 +0000 (05:42 +0000)]
MFC r233430:
Provide short-circuit exit(3) implementation for rtld.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233986 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233390:
trociny [Fri, 6 Apr 2012 16:31:29 +0000 (16:31 +0000)]
MFC r233390:

When displaying binary information show also osreldate.

Suggested by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@233952 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233389:
trociny [Fri, 6 Apr 2012 16:28:43 +0000 (16:28 +0000)]
MFC r233389:

Add a sysctl to set and retrieve binary osreldate of another process.

Suggested by: kib
Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@233950 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232841:
ed [Fri, 6 Apr 2012 11:09:49 +0000 (11:09 +0000)]
MFC r232841:

  Fix whitespace.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233944 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232976:
ed [Fri, 6 Apr 2012 11:07:44 +0000 (11:07 +0000)]
MFC r232976:

  Hide stty(1) errors.

  If rc(8) is executed without using a TTY, this error appears at the
  beginning:

        stty: stdin isn't a terminal

  Because this is to be expected and of course not harmful, it is better
  to simply hide the error message.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233943 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233002, r233003 and r233012:
ed [Fri, 6 Apr 2012 11:06:47 +0000 (11:06 +0000)]
MFC r233002, r233003 and r233012:

  Remove impossible error condition from the man page.

  On FreeBSD, all processes have a process group, so it is impossible for
  kill(2) to fail this way.  POSIX also doesn't mention this error
  condition.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233361:
kib [Fri, 6 Apr 2012 04:32:04 +0000 (04:32 +0000)]
MFC r233361:
Remove superfluous extern keywords.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233935 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233360:
kib [Fri, 6 Apr 2012 04:30:22 +0000 (04:30 +0000)]
MFC r233360:
Centralize the calculation of the top source directory.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233934 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233357:
kib [Fri, 6 Apr 2012 04:29:17 +0000 (04:29 +0000)]
MFC r233357:
Implement xstrdup() using strlen()/xmalloc()/memcpy() already
presented in rtld, instead of pulling in libc strdup().

git-svn-id: svn://svn.freebsd.org/base/stable/9@233933 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232300 (pluknet):
trociny [Thu, 5 Apr 2012 19:32:39 +0000 (19:32 +0000)]
MFC r232300 (pluknet):

Update the description for -s flag after r232182.
When displaying security credential information show also process umask.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233675:
jhb [Thu, 5 Apr 2012 16:05:35 +0000 (16:05 +0000)]
MFC 233675:
Restore proper use of bounce buffers for ISA DMA.  When locking was
added, the call to pmap_kextract() was moved up, and as a result the
code never updated the physical address to use for DMA if a bounce
buffer was used.  Restore the earlier location of pmap_kextract() so
it takes bounce buffers into account.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233924 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233307:
kib [Thu, 5 Apr 2012 10:38:07 +0000 (10:38 +0000)]
MFC r233307:
Use xmalloc() instead of malloc() in the places where malloc() calls
are assumed to not fail.

Make the xcalloc() calling conventions follow the calloc(3) calling
conventions and replace unchecked calls to calloc() with calls to
xcalloc().

Remove redundand declarations from xmalloc.c, which are already
present in rtld.h.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233306:
kib [Thu, 5 Apr 2012 10:36:35 +0000 (10:36 +0000)]
MFC r233306:
Remove the fragments which are not needed on FreeBSD.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233921 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233809:
kib [Thu, 5 Apr 2012 10:33:39 +0000 (10:33 +0000)]
MFC r233809:
When process exists, not only the children shall be reparented to
init, but also the orphans shall be removed from the orphan list,
because the list header is destroyed.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233920 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233808:
kib [Thu, 5 Apr 2012 10:30:54 +0000 (10:30 +0000)]
MFC r233808:
Add helper function to remove the process from the orphans list and
use it instead of inlined code.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233919 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 232980,233011,233017,233117,233434,233436,233454,233529,233530,233618:
nwhitehorn [Thu, 5 Apr 2012 00:53:21 +0000 (00:53 +0000)]
MFC 232980,233011,233017,233117,233434,233436,233454,233529,233530,233618:

Major pmap performance, concurrency, and correctness improvements, mostly
for the 64-bit PMAP module (64-bit-capable CPUs with either a 32-bit or
64-bit kernel). Thanks to alc for his help and prodding.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233911 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233747, r233748
marius [Wed, 4 Apr 2012 21:19:19 +0000 (21:19 +0000)]
MFC: r233747, r233748

- Fix panic on kernel traps having a mapping in trap_sig b0rked in r206086.
  Reported by: David E. Cross
- Remove checks that are redundant due to tf_type being unsigned.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233889 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233692:
mav [Wed, 4 Apr 2012 17:27:13 +0000 (17:27 +0000)]
MFC r233692:
Reenable unsolicited responses on CODEC if hdaa_sense_init() called again.
This fixes jack connection events handling after suspend/resume.

PR: kern/166382

git-svn-id: svn://svn.freebsd.org/base/stable/9@233879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233606:
mav [Wed, 4 Apr 2012 17:24:53 +0000 (17:24 +0000)]
MFC r233606:
Stop HDA controller polling callout on suspend and reset it on resume.

PR: kern/166382

git-svn-id: svn://svn.freebsd.org/base/stable/9@233878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233608:
kib [Wed, 4 Apr 2012 05:29:21 +0000 (05:29 +0000)]
MFC r233608:
Microoptimize: in qsync loop over mount vnodes, only unlock mount
interlock after we committed to try to vget() the vnode.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233859 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: 229942, 231938
ghelmer [Tue, 3 Apr 2012 21:10:30 +0000 (21:10 +0000)]
MFC: 229942, 231938

229942: Style fixes courtesy of pjd.

231938: Set the O_CLOEXEC flag when opening the pidfile to avoid leaking the
file descriptor via exec(3).

Now that daemon(8) has been fixed to resolve the issue noted by trociny,
the consensus is that this change should be OK.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229951,229985-229986,229988,230011,230037,230233,230599-230601
ghelmer [Tue, 3 Apr 2012 20:49:26 +0000 (20:49 +0000)]
MFC r229951,229985-229986,229988,230011,230037,230233,230599-230601
libutil.h and pidfile.c cleanup:

229951: Constify arguments (pjd)

229985: Fix forward structure declaration and prototype disorder.

229986: Fix namespace issues with prototype parameter names.
Add missing prototype parameter names.

229988: Fix prototype formatting (indentation, long lines, and
continued lines).

230011: More prototype formatting fixes, struct member formatting fixes,
and namespace fix for property_find() prototype.

230037: Move struct pidfh definition into pidfile.c, and leave a forward
declaration for pidfh in libutil.h in its place.
This allows us to hide the contents of the pidfh structure, and also
allowed removal of the "#ifdef _SYS_PARAM_H" guard from around the
pidfile_* function prototypes.

230233: Fix more disorder in prototypes and constants.
Fix header comments for each section of constants.
Fix whitespace in #define lines.
Fix unnecessary parenthesis in constants.

230599: Restore the parenthesis that are necessary around the
constant values.

230600: Make the comments consistent (capitalization, punctuation, and
format).

230601: Consensus between bde and pjd seemed to be that if the function
names are lined up, then any * after a long type should appear after
the type instead of being in front of the function name on the
following line.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233855 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232959 and r232960:
gleb [Tue, 3 Apr 2012 19:34:00 +0000 (19:34 +0000)]
MFC r232959 and r232960:

Prevent tmpfs_rename() deadlock in a way similar to UFS. Unlock
vnodes and try to lock them one by one. Relookup fvp and tvp.

Don't enforce LK_RETRY to get existing vnode in tmpfs_alloc_vp().
Doomed vnode is hardly of any use here, besides all callers handle
error case. vfs_hash_get() does the same. Don't mess with vnode
holdcount, vget() takes care of it already.

Approved by: mdf (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@233851 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233571:
bschmidt [Tue, 3 Apr 2012 17:08:17 +0000 (17:08 +0000)]
MFC r233571:
strip (R) to match manpage and pci_vendors

git-svn-id: svn://svn.freebsd.org/base/stable/9@233842 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233568:
bschmidt [Tue, 3 Apr 2012 17:04:48 +0000 (17:04 +0000)]
MFC r233568:
Add a list of available devices which matches the names shown by pciconf.
While here add 2 missing firmware modules.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233840 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233567:
bschmidt [Tue, 3 Apr 2012 17:01:37 +0000 (17:01 +0000)]
MFC r233567:
Add support for 6150 series devices.

Tested by: Shane Riddle <sh4neriddle at yahoo dot com>

git-svn-id: svn://svn.freebsd.org/base/stable/9@233838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229937:
ghelmer [Tue, 3 Apr 2012 15:42:08 +0000 (15:42 +0000)]
MFC r229937:
Add pidfile_fileno() to obtain the file descriptor for an open
pidfile.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233837 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233655:
kib [Tue, 3 Apr 2012 09:02:19 +0000 (09:02 +0000)]
MFC r233655:
Add a special case in do_dlsym() for TLS stored symbols.

MFC r233674:
Fix ia64 build after r233655.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233833 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233546:
kib [Tue, 3 Apr 2012 08:56:29 +0000 (08:56 +0000)]
MFC r233546:
Prevent rtld_verify_object_versions() from being called several times
for the same object.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233231:
kib [Tue, 3 Apr 2012 08:54:35 +0000 (08:54 +0000)]
MFC r233231:
Fix several problems with our ELF filters implementation.

Do not relocate twice an object which happens to be needed by loaded
binary (or dso) and some filtee opened due to symbol resolution when
relocating need objects.  Record the state of the relocation
processing in Obj_Entry and short-circuit relocate_objects() if
current object already processed.

Do not call constructors for filtees loaded during the early
relocation processing before image is initialized enough to run
user-provided code.  Filtees are loaded using dlopen_object(), which
normally performs relocation and initialization.  If filtee is
lazy-loaded during the relocation of dso needed by the main object,
dlopen_object() runs too earlier, when most runtime services are not
yet ready.

Postpone the constructors call to the time when main binary and
depended libraries constructors are run, passing the new flag
RTLD_LO_EARLY to dlopen_object().  Symbol lookups callers inform
symlook_* functions about early stage of initialization with
SYMLOOK_EARLY.  Pass flags through all functions participating in
object relocation.

Use the opportunity and fix flags argument to find_symdef() in
arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of
true, which happen to have the same numeric value.

MFC r233777 (by kan):
Do not try to adjust stacks if dlopen_object is called too early.

MFC r233778 (by kan):
Remove extra blank line from revious commit.

MFC note: the ARM and MIPS TLS support is not merged back, so the chunks
from r233231 which fix misuse of flags in calls to find_symdef() in
the corresponding relocation type handlers were not applied. When TLS
support is merged, the rest of r233231 should be applied too.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233831 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233746:
mav [Tue, 3 Apr 2012 08:29:39 +0000 (08:29 +0000)]
MFC r233746:
Be more conservative in using READ CAPACITY(16) command. Previous code
checked PROTECT bit in INQUIRY data for all SPC devices, while it is defined
only since SPC-3. But there are some SPC-2 USB devices were reported, that
have PROTECT bit set, return no error for READ CAPACITY(16) command, but
return wrong sector count value in response.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233828 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233544:
fabient [Tue, 3 Apr 2012 07:15:42 +0000 (07:15 +0000)]
MFC r233544:
Fix random deadlock on pmcstat exit:
- Exit the thread when soft shutdown is requested
- Wakeup owner thread.

Reproduced/tested by looping pmcstat measurement:
pmcstat -S instructions -O/tmp/test ls

git-svn-id: svn://svn.freebsd.org/base/stable/9@233824 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 233236: Add sys/ofed to the 'make cscope' target.
jhb [Mon, 2 Apr 2012 20:36:35 +0000 (20:36 +0000)]
MFC 233236: Add sys/ofed to the 'make cscope' target.

git-svn-id: svn://svn.freebsd.org/base/stable/9@233816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 232700:
jhb [Mon, 2 Apr 2012 20:34:15 +0000 (20:34 +0000)]
MFC 232700:
Add a new sched_clear_name() method to the scheduler interface to clear
the cached name used for KTR_SCHED traces when a thread's name changes.
This way KTR_SCHED traces (and thus schedgraph) will notice when a thread's
name changes, most commonly via execve().

git-svn-id: svn://svn.freebsd.org/base/stable/9@233814 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f