]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoImport Illumos revision 13736:9f1d48e1681f
Martin Matuska [Fri, 22 Jun 2012 20:42:11 +0000 (20:42 +0000)]
Import Illumos revision 13736:9f1d48e1681f
2901 ZFS receive fails for exabyte sparse files

References:
https://www.illumos.org/issues/2901

Obtained from: illumos (issue #2901)
MFC after: 1 week

12 years agoChange 'camcontrol defects' to first probe a drive to find out how much
Kenneth D. Merry [Fri, 22 Jun 2012 18:57:06 +0000 (18:57 +0000)]
Change 'camcontrol defects' to first probe a drive to find out how much
defect information it has before grabbing the full defect list.

This works around a bug with some Hitachi drives that generate data overrun
errors when they are asked for more defect data than they have.

The change is done in a spec-compliant way, so it should have no negative
impact on drives that don't have this issue.

This is based on work originally done at Sandvine.

scsi_da.h: Add a define for the maximum amount of data that can be
contained in a defect list.

camcontrol.c: Update the readdefects() function to issue an initial
command to determine the length of the defect list, and
then use that length in the request for the full defect
list.

camcontrol.8: Add a note that some drives will report 0 defects available
if you don't request either the PLIST or GLIST.

Submitted by: Mark Johnston <markjdb@gmail.com> (original version)
MFC after: 3 days

12 years ago- Add a comment explaining the locking of the cached pages pool held
Attilio Rao [Fri, 22 Jun 2012 18:34:11 +0000 (18:34 +0000)]
- Add a comment explaining the locking of the cached pages pool held
  by vm_objects.
- Add flags for the per-object lock and free pages queue mutex lock.
  Use the newly added flags to mark the cache root within the vm_object
  structure.

Please note that other vm_object members should be marked with correct
locking but they are left for other commits.

In collabouration with: alc

MFC after: 3 days3 days3 days

12 years agoMerge changes from upstream libedit.
Pedro F. Giffuni [Fri, 22 Jun 2012 18:01:22 +0000 (18:01 +0000)]
Merge changes from upstream libedit.

Our libedit has been diverging from the mainstream version
maintained in NetBSD. As a consequence it has been difficult
to do an appropriate MFV and we have been bringing only
partial updates.

Here we update most of the files to at least match the
version available in NetBSD's snapshot of 20091228. This
version was chosen because it still doesn't include wide
character support (UTF-8), which involves many changes and
new files.

From NetBSD's logs:

Dec 15 22:13:33 2006 - editline.3 el.c el.h histedit.h
add EL_GETFP, and EL_SETFP.

Apr 5 15:53:28 2008 - editline.3 el.c histedit.h readline.c
add EL_REFRESH for the benefit of readline

Sep 10 15:45:37 2008 - common.c el.c read.c refresh.c sig.c term.c term.h tty.c
Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects.

Jan 18 12:17:24 2009 - el.c read.c readline.c
fix -Wsign-compare issues

Feb 6 14:40:32 2009 - history.c
Plug memory leak, from MySQL.

Feb 5 19:15:44 2009 - histedit.h read.c
match documentation in el_push

Feb 6 13:14:37 2009 - vi.c
Portability fix.

Feb 12 13:39:49 2009 - readline.c term.c
More fixes for existing portability stuff.

Feb 15 21:24:13 2009 - el.h read.c
don't restart on EINTR, instead return NULL immediately. From Anon Ymous

Feb 15 21:25:01 2009 - sig.c sig.h
in order for read() to return EINTR we need to use sigaction, not signal,
otherwise SA_RESTART is set.

Feb 15 21:55:23 2009 - chared.c chared.h common.c emacs.c filecomplete.c
filecomplete.h key.c key.h read.c readline.c refresh.c search.c
term.c tokenizer.c tty.c vi.c
pass lint on _LP64.

Feb 17 21:34:26 2009 - el.c histedit.h prompt.c prompt.h
allow for a prompt argument.

Feb 18 15:04:40 2009 - sig.c
SA_RESTART for all signals but SIGINT. From Anon Ymous.

Feb 19 15:20:22 2009 - read.c sig.c sig.h
reset and redraw on sigcont. From Anon Ymous.

Feb 21 23:31:56 2009 - key.c key.h readline.c vi.c
more size_t stuff.

Mar 10 20:46:15 2009 - editline.3 read.c
make el_gets set the count to -1 on error to distinguish between EOF and
error.

Mar 31 17:38:27 2009 - editline.3 el.c histedit.h prompt.c prompt.h
refresh.c term.c term.h
Implement literal prompt sequences. Now someone can implement
RL_PROMPT_START_LITERAL/RL_PROMPT_END_LITERAL :-)

Mar 31 21:33:17 2009 - term.c
cast to size_t to avoid sign / unsigned comparison warning.

Apr 23 02:03 2009 - term.c
Apply patch (requested by msaitoh in ticket #2007):
Coverity CID 1668: Plug memory leak when malloc() failed.:55 2009

May 11 18:33:30 2009 - editline.3 el.c histedit.h
restore binary compatibility by providing new prompt functions that take
an extra literal character.

May 19 21:45:14 2009 - refresh.c
always scroll when we advance past bottom. From Caleb Welton
cwelton at greenplum dot com.

Jul 17 12:27:57 2009 - term.c
- off by one in the term.h case.
- make code more similar to tcsh (if we want to handle wide chars, this is
  needed; for now it is a no-op)

Jul 22 15:56:29 2009 - el.c
Move filename to the scope it is being used.
From Michael Cook mcook at bbn dot com

Jul 22 15:57:00 2009 - read.c
Always initialize nread since it is an out param.
From Michael Cook mcook at bbn dot com

Jul 22 18:25:26 2009 - el.c
Only need path if we have issetugid... From Anon Ymous

Jul 25 21:19:23 2009 - el.c
Ignore comment lines in .editrc from Jess Thrysoee

Sep 7 21:24:33 2009
histedit.h history.c readline.c
apply apple patches from:
http://opensource.apple.com/source/libedit/libedit-11/patches/

Dec 28 21:52:43 2009 - refresh.c
Fix bug where tab completion on the second or > line that caused listing
ended up corrupting the display by an extra space in the beginning. Reported
by Mac Chan.

Dec 28 22:15:36 2009 - refresh.c term.c
reduce diff with tcsh

Obtained from: NetBSD
Tested by: bapt, jilles and current@
MFC after: 1 week

12 years agoDon't print SCSI Queue Full and CAM_REQUEUE_REQ statuses as errors if they
Alexander Motin [Fri, 22 Jun 2012 16:20:13 +0000 (16:20 +0000)]
Don't print SCSI Queue Full and CAM_REQUEUE_REQ statuses as errors if they
were handled and retried. They are part of normal operation for SCSI TCQ.

MFC after: 3 days

12 years agoCommit changes missed from r237435. Properly calculate the signal
Konstantin Belousov [Fri, 22 Jun 2012 16:05:56 +0000 (16:05 +0000)]
Commit changes missed from r237435.  Properly calculate the signal
trampoline addresses after the shared page is enabled.  Handle FreeBSD
ABIs without shared page support too.

Reported and tested by: David Wolfskill <david catwhisker org>
 (previous version)
Pointy hat to: kib
MFC after:   1 month

12 years agoDo not read registers with read side effects while performing a register
Navdeep Parhar [Fri, 22 Jun 2012 08:37:33 +0000 (08:37 +0000)]
Do not read registers with read side effects while performing a register
dump for cxgbetool.

12 years agocxgbe(4): update to firmware interface 1.5.2.0; updates to shared code.
Navdeep Parhar [Fri, 22 Jun 2012 07:51:15 +0000 (07:51 +0000)]
cxgbe(4): update to firmware interface 1.5.2.0; updates to shared code.

12 years agoEnable shared page on i386, now it has a use for vdso_timehands.
Konstantin Belousov [Fri, 22 Jun 2012 07:16:29 +0000 (07:16 +0000)]
Enable shared page on i386, now it has a use for vdso_timehands.

MFC after: 1 month

12 years agoUse struct vdso_timehands data to implement fast gettimeofday(2) and
Konstantin Belousov [Fri, 22 Jun 2012 07:13:30 +0000 (07:13 +0000)]
Use struct vdso_timehands data to implement fast gettimeofday(2) and
clock_gettime(2) functions if supported. The speedup seen in
microbenchmarks is in range 4x-7x depending on the hardware.

Only amd64 and i386 architectures are supported. Libc uses rdtsc and
kernel data to calculate current time, if enabled by kernel.

Hopefully, this code is going to migrate into vdso in some future.

Discussed with: bde
Reviewed by: jhb
Tested by: flo
MFC after: 1 month

12 years agoImplement mechanism to export some kernel timekeeping data to
Konstantin Belousov [Fri, 22 Jun 2012 07:06:40 +0000 (07:06 +0000)]
Implement mechanism to export some kernel timekeeping data to
usermode, using shared page.  The structures and functions have vdso
prefix, to indicate the intended location of the code in some future.

The versioned per-algorithm data is exported in the format of struct
vdso_timehands, which mostly repeats the content of in-kernel struct
timehands. Usermode reading of the structure can be lockless.
Compatibility export for 32bit processes on 64bit host is also
provided. Kernel also provides usermode with indication about
currently used timecounter, so that libc can fall back to syscall if
configured timecounter is unknown to usermode code.

The shared data updates are initiated both from the tc_windup(), where
a fast task is queued to do the update, and from sysctl handlers which
change timecounter. A manual override switch
kern.timecounter.fast_gettime allows to turn off the mechanism.

Only x86 architectures export the real algorithm data, and there, only
for tsc timecounter. HPET counters page could be exported as well, but
I prefer to not further glue the kernel and libc ABI there until
proper vdso-based solution is developed.

Minimal stubs neccessary for non-x86 architectures to still compile
are provided.

Discussed with: bde
Reviewed by: jhb
Tested by: flo
MFC after: 1 month

12 years agoFix a stray debug that I committed accidentally years ago...
Warner Losh [Fri, 22 Jun 2012 06:44:22 +0000 (06:44 +0000)]
Fix a stray debug that I committed accidentally years ago...

12 years agoEnchance the shared page chunk allocator.
Konstantin Belousov [Fri, 22 Jun 2012 06:39:28 +0000 (06:39 +0000)]
Enchance the shared page chunk allocator.

Do not rely on the busy state of the page from which we allocate the
chunk, to protect allocator state. Use statically allocated sx lock
instead.

Provide more flexible KPI. In particular, allow to allocate chunk
without providing initial data, and allow writes into existing
allocation. Allow to get an sf buf which temporary maps the chunk, to
allow sequential updates to shared page content without unmapping in
between.

Reviewed by: jhb
Tested by: flo
MFC after: 1 month

12 years agoReserve AT_TIMEKEEP auxv entry for providing usermode the pointer to
Konstantin Belousov [Fri, 22 Jun 2012 06:38:31 +0000 (06:38 +0000)]
Reserve AT_TIMEKEEP auxv entry for providing usermode the pointer to
timekeeping information.

MFC after:  1 week

12 years agoMove these #defines to at91reg.h (where I should have put them in the
Warner Losh [Fri, 22 Jun 2012 05:54:34 +0000 (05:54 +0000)]
Move these #defines to at91reg.h (where I should have put them in the
first place).

12 years agoIntroduce CHANGE_PV_LIST_LOCK_TO_{PHYS,VM_PAGE}() to avoid duplication of
Alan Cox [Fri, 22 Jun 2012 05:01:36 +0000 (05:01 +0000)]
Introduce CHANGE_PV_LIST_LOCK_TO_{PHYS,VM_PAGE}() to avoid duplication of
code.

12 years agoMerge ACPICA 20120620.
Jung-uk Kim [Fri, 22 Jun 2012 00:40:44 +0000 (00:40 +0000)]
Merge ACPICA 20120620.

12 years agoAdd PCI IDs for Ivy Bridge
Ed Maste [Thu, 21 Jun 2012 22:06:57 +0000 (22:06 +0000)]
Add PCI IDs for Ivy Bridge

12 years agoMFV: Update zlib to 1.2.7.
Xin LI [Thu, 21 Jun 2012 21:47:08 +0000 (21:47 +0000)]
MFV: Update zlib to 1.2.7.

(x86 assembler optimization disabled for now because it
requires the new .cfi_* directives that is not supported
by base system binutils).

MFC after: 1 week

12 years agoAdd the functions documented in the man pages in commit 237393 to the
Isabell Long [Thu, 21 Jun 2012 18:28:48 +0000 (18:28 +0000)]
Add the functions documented in the man pages in commit 237393 to the
relevant Makefile.

Reminded by: gavin
Approved by: gabor (mentor)
MFC after: 5 days

12 years agoFix "comparison is always true due to limited range of data type" warning
Jung-uk Kim [Thu, 21 Jun 2012 18:22:50 +0000 (18:22 +0000)]
Fix "comparison is always true due to limited range of data type" warning
from GCC in the base system.  Note this patch was submitted upstream and it
will appear in the next ACPICA release.

Discussed with: Moore, Robert (robert dot moore at intel dot com)

12 years agoBring a couple of fixes for gcc optimizations.
Pedro F. Giffuni [Thu, 21 Jun 2012 16:49:20 +0000 (16:49 +0000)]
Bring a couple of fixes for gcc optimizations.

The GCC4.3 branch contains some optimization fixes
that were not considered regressions and therefore
were never backported. We are bringing a couple of
them that are under GPLv2 since they were made
before the license switch upstream.

While here, add the GCC revision numbers in the
log.

Discussed with: jkim
MFC after: 1 week

12 years agoUpdate the PV stats in free_pv_entry() using atomics. After which, it is
Alan Cox [Thu, 21 Jun 2012 16:37:36 +0000 (16:37 +0000)]
Update the PV stats in free_pv_entry() using atomics.  After which, it is
no longer necessary for free_pv_entry() to be serialized by the pvh global
lock.

Retire pmap_insert_entry() and pmap_remove_entry().  Once upon a time,
these functions were called from multiple places within the pmap.  Now,
each has only one caller.

12 years agoBe explicit about the dependency on nsparser.h.
David E. O'Brien [Thu, 21 Jun 2012 15:47:06 +0000 (15:47 +0000)]
Be explicit about the dependency on nsparser.h.

12 years agoMake cam_periph_hold() behavior consistent: drop taken reference and
Alexander Motin [Thu, 21 Jun 2012 15:14:51 +0000 (15:14 +0000)]
Make cam_periph_hold() behavior consistent: drop taken reference and
return ENXIO if periph was invalidated while we were waiting for it.

MFC after: 1 week

12 years agoIn camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM
Alexander Motin [Thu, 21 Jun 2012 14:35:46 +0000 (14:35 +0000)]
In camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM
done queue. Clearing it before caused extra SIM queueing in some cases.
It was invisible during normal operation, but during USB device unplug and
respective SIM destruction it could keep pointer on SIM without having
counted reference and as result crash the system by use afer free.

Reported by: hselasky
MFC after: 1 week

12 years agoAdd more locale-specific functions to the relevant man pages:
Isabell Long [Thu, 21 Jun 2012 12:52:15 +0000 (12:52 +0000)]
Add more locale-specific functions to the relevant man pages:
- libc/string/strcoll.3
- libc/string/strstr.3
- libc/string/strxfrm.3
- libc/string/strcasecmp.3

Reviewed by: theraven, gabor
Approved by: gabor (mentor)
MFC after: 5 days

12 years agoRemove redundant #ifdef. Reported by gnn@.
Michael Tuexen [Thu, 21 Jun 2012 12:51:24 +0000 (12:51 +0000)]
Remove redundant #ifdef. Reported by gnn@.

MFC after: 3 days

12 years agoEnable deadlock avoidance code for NFS client.
Konstantin Belousov [Thu, 21 Jun 2012 09:26:06 +0000 (09:26 +0000)]
Enable deadlock avoidance code for NFS client.

MFC after: 2 weeks

12 years agoFix unbounded-length malloc, controlled from usermode. The added check
Konstantin Belousov [Thu, 21 Jun 2012 09:20:07 +0000 (09:20 +0000)]
Fix unbounded-length malloc, controlled from usermode. The added check
is performed before exact size of the buffer is calculated, but the
buffer cannot have size greater then the total space allocated for
extended attributes. The existing check is executing with precise
size, but it is too late, since buffer needs to be allocated in
advance.

Also, adapt to uio_resid being of ssize_t type.  Use lblktosize instead of
multiplying by fs block size by hand as well.

Reported and tested by:   pho
MFC after:   1 week

12 years agoFix locking for f_offset, vn_read() and vn_write() cases only, for now.
Konstantin Belousov [Thu, 21 Jun 2012 09:19:41 +0000 (09:19 +0000)]
Fix locking for f_offset, vn_read() and vn_write() cases only, for now.

It seems that intended locking protocol for struct file f_offset field
was as follows: f_offset should always be changed under the vnode lock
(except fcntl(2) and lseek(2) did not followed the rules). Since
read(2) uses shared vnode lock, FOFFSET_LOCKED block is additionally
taken to serialize shared vnode lock owners.

This was broken first by enabling shared lock on writes, then by
fadvise changes, which moved f_offset assigned from under vnode lock,
and last by vn_io_fault() doing chunked i/o. More, due to uio_offset
not yet valid in vn_io_fault(), the range lock for reads was taken on
the wrong region.

Change the locking for f_offset to always use FOFFSET_LOCKED block,
which is placed before rangelocks in the lock order.

Extract foffset_lock() and foffset_unlock() functions which implements
FOFFSET_LOCKED lock, and consistently lock f_offset with it in the
vn_io_fault() both for reads and writes, even if MNTK_NO_IOPF flag is
not set for the vnode mount. Indicate that f_offset is already valid
for vn_read() and vn_write() calls from vn_io_fault() with FOF_OFFSET
flag, and assert that all callers of vn_read() and vn_write() follow
this protocol.

Extract get_advice() function to calculate the POSIX_FADV_XXX value
for the i/o region, and use it were appropriate.

Reviewed by: jhb
Tested by: pho
MFC after: 2 weeks

12 years agoRemove Moxa CP-132EL definition (RS422/485-only board).
Max Khon [Thu, 21 Jun 2012 04:57:59 +0000 (04:57 +0000)]
Remove Moxa CP-132EL definition (RS422/485-only board).

12 years agoAdd support for the following Moxa PCIe multiport serial boards:
Max Khon [Thu, 21 Jun 2012 03:10:48 +0000 (03:10 +0000)]
Add support for the following Moxa PCIe multiport serial boards:
- CP102E
- CP102EL
- CP132EL
- CP114EL
- CP118EL-A
- CP168EL-A

MFC after: 1 week

12 years agoCurrently the code uses gzFile * for a zlib file descriptor, which
Xin LI [Wed, 20 Jun 2012 23:53:36 +0000 (23:53 +0000)]
Currently the code uses gzFile * for a zlib file descriptor, which
is not correct.  The code works by accident because gzFile is
currently defined as void *, and internally it would be casted from
or to its real type.

A newer version of zlib will instead define it as a pointer to a
specific type pointer (namely, struct gzFile_s *).  This therefore
would cause stricter checks and compiler would catch this type
mismatch.

This change does not cause any changes to the resulting binary,
as validated with md5(1).

MFC after: 3 days

12 years agoSelectively inline vm_page_dirty().
Alan Cox [Wed, 20 Jun 2012 23:25:47 +0000 (23:25 +0000)]
Selectively inline vm_page_dirty().

12 years agoProvide a mechanism to not clear out the work and output dirs when
David E. O'Brien [Wed, 20 Jun 2012 21:38:16 +0000 (21:38 +0000)]
Provide a mechanism to not clear out the work and output dirs when
developing tests.

12 years agoPolish previous revision: if the fts_* routines have lstat()'ed the
Xin LI [Wed, 20 Jun 2012 21:10:38 +0000 (21:10 +0000)]
Polish previous revision: if the fts_* routines have lstat()'ed the
directory entry then use the struct stat from that instead of doing
it again, and skip the rm_overwrite() call if fts_read() indicated
that the entry couldn't be a regular file.

Obtained from: OpenBSD
MFC after: 1 week

12 years agoDon't return an error if a kld does not contain any modules (e.g. a
John Baldwin [Wed, 20 Jun 2012 21:06:51 +0000 (21:06 +0000)]
Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl).  The kernel linker allows such
modules, so the boot loader should not reject them.

MFC after: 2 weeks

12 years agoOnly output a list of file systems that need to be dumped if the system
John Baldwin [Wed, 20 Jun 2012 20:01:51 +0000 (20:01 +0000)]
Only output a list of file systems that need to be dumped if the system
has a non-empty dumpdates file.

Reviewed by: brooks
MFC after: 1 week

12 years agoRemove unused error variables in cdclose() and daclose().
Alexander Motin [Wed, 20 Jun 2012 18:35:36 +0000 (18:35 +0000)]
Remove unused error variables in cdclose() and daclose().

12 years agoCheck status of cam_periph_hold() inside cdclose(). If cd device was
Alexander Motin [Wed, 20 Jun 2012 18:25:51 +0000 (18:25 +0000)]
Check status of cam_periph_hold() inside cdclose().  If cd device was
invalidated while open, cam_periph_hold() will return error and won't
get the reference.  Following reference release will crash the system.

Sponsored by: iXsystems, Inc.
MFC after: 3 days

12 years agoMove the per-thread deferred user map entries list into a private list
John Baldwin [Wed, 20 Jun 2012 18:00:26 +0000 (18:00 +0000)]
Move the per-thread deferred user map entries list into a private list
in vm_map_process_deferred() which is then iterated to release map entries.
This avoids having a nested vm map unlock operation called from the loop
body attempt to recuse into vm_map_process_deferred().  This can happen if
the vm_map_remove() triggers the OOM killer.

Reviewed by: alc, kib
MFC after: 1 week

12 years agoImport ACPICA 20120620.
Jung-uk Kim [Wed, 20 Jun 2012 17:51:04 +0000 (17:51 +0000)]
Import ACPICA 20120620.

12 years agoNow that there is an est(4) man page, reference it here in cpufreq(4).
Sean Bruno [Wed, 20 Jun 2012 17:26:22 +0000 (17:26 +0000)]
Now that there is an est(4) man page, reference it here in cpufreq(4).

12 years agoFix ARM compilation issue.
Matt Jacob [Wed, 20 Jun 2012 17:20:25 +0000 (17:20 +0000)]
Fix ARM compilation issue.

X-MFC: 237260

12 years agoFix several reference counting and object lifetime issues between
Kenneth D. Merry [Wed, 20 Jun 2012 17:08:00 +0000 (17:08 +0000)]
Fix several reference counting and object lifetime issues between
the pass(4) and enc(4) drivers and devfs.

The pass(4) driver uses the destroy_dev_sched() routine to
schedule its device node for destruction in a separate thread
context.  It does this because the passcleanup() routine can get
called indirectly from the passclose() routine, and that would
cause a deadlock if the close routine tried to destroy its own
device node.

In any case, once a particular passthrough driver number, e.g.
pass3, is destroyed, CAM considers that unit number (3 in this
case) available for reuse.

The problem is that devfs may not be done cleaning up the previous
instance of pass3, and will panic if isn't done cleaning up the
previous instance.

The solution is to get a callback from devfs when the device node
is removed, and make sure we hold a reference to the peripheral
until that happens.

Testing exposed some other cases where we have reference counting
issues, and those were also fixed in the pass(4) driver.

cam_periph.c: In camperiphfree(), reorder some of the operations.

The peripheral destructor needs to be called before
the peripheral is removed from the peripheral is
removed from the list.  This is because once we
remove the peripheral from the list, and drop the
topology lock, the peripheral number may be reused.
But if the destructor hasn't been called yet, there
may still be resources hanging around (like devfs
nodes) that haven't been fully cleaned up.

cam_xpt.c: Add an argument to xpt_remove_periph() to indicate
whether the topology lock is already held.

scsi_enc.c: Acquire an extra reference to the peripheral during
registration, and release it once we get a callback
from devfs indicating that the device node is gone.

Call destroy_dev_sched_cb() in enc_oninvalidate()
instead of calling destroy_dev() in the cleanup
routine.

scsi_pass.c: Add reference counting to handle peripheral and
devfs object lifetime issues.

Add a reference to the peripheral and the devfs
node in the peripheral registration.

Don't attempt to add a physical path alias if the
peripheral has been marked invalid.

Release the devfs reference once the initial
physical path alias taskqueue run has completed.

Schedule devfs node destruction in the
passoninvalidate(), and release our peripheral
reference in a new routine, passdevgonecb() once
the devfs node is gone.  This allows the peripheral
to fully go away, and the peripheral destructor,
passcleanup(), will get called.

MFC after: 3 days
Sponsored by: Spectra Logic

12 years agoAllow booting XENHVM kernel without Xen hypervisor.
Fabien Thomas [Wed, 20 Jun 2012 15:45:50 +0000 (15:45 +0000)]
Allow booting XENHVM kernel without Xen hypervisor.

MFC after: 3 days

12 years agoFix viawd(4) that was only working as a module.
Fabien Thomas [Wed, 20 Jun 2012 09:01:44 +0000 (09:01 +0000)]
Fix viawd(4) that was only working as a module.

Obtained from: jhb
MFC after: 3 days

12 years agoAdd PV list locking to pmap_copy(), pmap_enter_object(), and
Alan Cox [Wed, 20 Jun 2012 07:25:20 +0000 (07:25 +0000)]
Add PV list locking to pmap_copy(), pmap_enter_object(), and
pmap_enter_quick().  These functions are no longer serialized by the pvh
global lock.

There is no need to release the PV list lock before calling free_pv_chunk()
in pmap_remove_pages().

12 years agoDon't close an uninitialized descriptor. [1]
Eitan Adler [Wed, 20 Jun 2012 06:38:41 +0000 (06:38 +0000)]
Don't close an uninitialized descriptor. [1]
Add a sanity check for the validity of the passed fd.

PR: kern/139080 [1]
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> [1]
Reviewed by: pjd (briefly)
Approved by: cperciva
MFC after: 1 week

12 years agoAdd progress.c and progress.h, missed in the previous commit to camcontrol.
Scott Long [Wed, 20 Jun 2012 04:11:34 +0000 (04:11 +0000)]
Add progress.c and progress.h, missed in the previous commit to camcontrol.

Submitted by:   Garrett Cooper
Obtained from:  Netflix, Inc.

12 years agoFix potential symlink race condition in "rm -P" by adding a check
Kevin Lo [Wed, 20 Jun 2012 02:21:53 +0000 (02:21 +0000)]
Fix potential symlink race condition in "rm -P" by adding a check
that the file we have opened is the one we expected.  Also open in
non-blocking mode to avoid a potential hang with FIFOs.

Obtained from: NetBSD via OpenBSD

12 years agoCorrect typo in version.
David E. O'Brien [Wed, 20 Jun 2012 00:37:00 +0000 (00:37 +0000)]
Correct typo in version.

12 years agoUpdate the 'fwdownload' command to also flash disks connected over an
Scott Long [Wed, 20 Jun 2012 00:17:29 +0000 (00:17 +0000)]
Update the 'fwdownload' command to also flash disks connected over an
ATA/SATA transport.  The detection logic is automatic, so it should Just
Work.  While here, also improve the progress meter that is displayed
during firmware download.

Submitted by: Alistair Crooks
Obtained from: Netflix, Inc.
MFC after: 3 days

12 years agoInstall filemon.h into /usr/include for userland consumption.
David E. O'Brien [Wed, 20 Jun 2012 00:09:47 +0000 (00:09 +0000)]
Install filemon.h into /usr/include for userland consumption.

12 years agoCheck proper flag (PDF_DAEMON, not PD_DAEMON) when deciding if the process
Pawel Jakub Dawidek [Tue, 19 Jun 2012 22:23:59 +0000 (22:23 +0000)]
Check proper flag (PDF_DAEMON, not PD_DAEMON) when deciding if the process
should be killed or not.

This fixes killing pdfork(2)ed process on last close of the corresponding
process descriptor.

Reviewed by: rwatson
MFC after: 1 month

12 years agoThe falloc() function obtains two references to newly created 'fp'.
Pawel Jakub Dawidek [Tue, 19 Jun 2012 22:21:59 +0000 (22:21 +0000)]
The falloc() function obtains two references to newly created 'fp'.
On success we have to drop one after procdesc_finit() and on failure
we have to close allocated slot with fdclose(), which also drops one
reference for us and drop the remaining reference with fdrop().

Without this change closing process descriptor didn't result in killing
pdfork(2)ed child.

Reviewed by: rwatson
MFC after: 1 month

12 years agoFurther refine the implementation of POSIX_FADV_NOREUSE.
John Baldwin [Tue, 19 Jun 2012 18:42:24 +0000 (18:42 +0000)]
Further refine the implementation of POSIX_FADV_NOREUSE.

First, extend the changes in r230782 to better handle the common case
of using NOREUSE with sequential reads.  A NOREUSE file descriptor
will now track the last implicit DONTNEED request it made as a result
of a NOREUSE read.  If a subsequent NOREUSE read is adjacent to the
previous range, it will apply the DONTNEED request to the entire range
of both the previous read and the current read.  The effect is that
each read of a file accessed sequentially will apply the DONTNEED
request to the entire range that has been read.  This allows NOREUSE
to properly handle misaligned reads by flushing each buffer to cache
once it has been completely read.

Second, apply the same changes made to read(2) by r230782 and this
change to writes.  This provides much better performance in the
sequential write case as it allows writes to still be clustered.  It
also provides much better performance for misaligned writes.  It does
mean that NOREUSE will be generally ineffective for non-sequential
writes as the current implementation relies on a future NOREUSE
write's implicit DONTNEED request to flush the dirty buffer from the
current write.

MFC after: 2 weeks

12 years agoCorrect misunderstanding of hw.est.strict
Sean Bruno [Tue, 19 Jun 2012 17:13:14 +0000 (17:13 +0000)]
Correct misunderstanding of hw.est.strict

Setting strict causes a validation of the requested
value vs the value currently running after a frequency
change is requested.

Change applicability to be single core not i386.

Thanks to mav@ for reviewing and commenting on my
lack of understanding.

MFC after: 2 weeks

12 years agoAdd a 'wmask' variable to hold the expression '(1ul << w->step) - 1' in
John Baldwin [Tue, 19 Jun 2012 16:06:27 +0000 (16:06 +0000)]
Add a 'wmask' variable to hold the expression '(1ul << w->step) - 1' in
pcib_grow_window().  This makes the code slightly easier to read and
prevents the type of bug fixed in r237271.

MFC after: 3 days

12 years agoFix another off-by-one error in the previous fix so that the new start
John Baldwin [Tue, 19 Jun 2012 15:15:35 +0000 (15:15 +0000)]
Fix another off-by-one error in the previous fix so that the new start
address is properly aligned.  While here, use a simpler expression to
align the new end address that we use elsewhere for aligning the end.

12 years agoPassive mode is the default, and has been for a while.
Dag-Erling Smørgrav [Tue, 19 Jun 2012 14:47:07 +0000 (14:47 +0000)]
Passive mode is the default, and has been for a while.

MFC after: 1 week

12 years agoSwitch the default password hash from md5 to sha512.
Dag-Erling Smørgrav [Tue, 19 Jun 2012 14:46:18 +0000 (14:46 +0000)]
Switch the default password hash from md5 to sha512.

MFC after: 1 week

12 years agoRevert user comparison back to user names as some user can share uids (root/toor
Baptiste Daroussin [Tue, 19 Jun 2012 11:39:56 +0000 (11:39 +0000)]
Revert user comparison back to user names as some user can share uids (root/toor
for example)

get the username information from old_pw structures to still allow renaming of a
user.

Reported by: Claude Buisson <clbuisson@orange.fr>
Approved by: des (mentor)
MFC after: 3 weeks

12 years agoCondition the implementation of pv_entry_count on PV_STATS. On amd64,
Alan Cox [Tue, 19 Jun 2012 08:12:44 +0000 (08:12 +0000)]
Condition the implementation of pv_entry_count on PV_STATS.  On amd64,
pv_entry_count is purely informational.  It does not serve any functional
purpose.

Add PV chunk locking to get_pv_entry().

12 years ago- Updated TOE support in the kernel.
Navdeep Parhar [Tue, 19 Jun 2012 07:34:13 +0000 (07:34 +0000)]
- Updated TOE support in the kernel.

- Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs.
  These are available as t3_tom and t4_tom modules that augment cxgb(4)
  and cxgbe(4) respectively.  The cxgb/cxgbe drivers continue to work as
  usual with or without these extra features.

- iWARP driver for Terminator 3 ASIC (kernel verbs).  T4 iWARP in the
  works and will follow soon.

Build-tested with make universe.

30s overview
============
What interfaces support TCP offload?  Look for TOE4 and/or TOE6 in the
capabilities of an interface:
# ifconfig -m | grep TOE

Enable/disable TCP offload on an interface (just like any other ifnet
capability):
# ifconfig cxgbe0 toe
# ifconfig cxgbe0 -toe

Which connections are offloaded?  Look for toe4 and/or toe6 in the
output of netstat and sockstat:
# netstat -np tcp | grep toe
# sockstat -46c | grep toe

Reviewed by: bz, gnn
Sponsored by: Chelsio communications.
MFC after: ~3 months (after 9.1, and after ensuring MFC is feasible)

12 years agoAdd __unused macros to appropriate places in order to allow building
Eitan Adler [Tue, 19 Jun 2012 06:18:42 +0000 (06:18 +0000)]
Add __unused macros to appropriate places in order to allow building
with WARNS=6 on base gcc, gcc46, and clang

Approved by: cperciva
MFC after: 1 week

12 years agoAllow users with RO privilege to the device to read the RO attributes.
Eitan Adler [Tue, 19 Jun 2012 06:18:37 +0000 (06:18 +0000)]
Allow users with RO privilege to the device to read the RO attributes.

PR: bin/167302
Submitted by: markham breitbach <markham@ssimicro.com>
Discussed with: pjd (briefly)
Approved by: cperciva
MFC after: 1 week

12 years agoRemove variables which are initialized but never used thereafter reported by gcc46...
Eitan Adler [Tue, 19 Jun 2012 06:10:34 +0000 (06:10 +0000)]
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by: cperciva
MFC After: 3 days

12 years agoRemove variables which are initialized but never used thereafter reported by gcc46...
Eitan Adler [Tue, 19 Jun 2012 06:10:31 +0000 (06:10 +0000)]
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by: cperciva
MFC After: 3 days

12 years agoRemove variables which are initialized but never used thereafter reported by gcc46...
Eitan Adler [Tue, 19 Jun 2012 06:10:27 +0000 (06:10 +0000)]
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by: cperciva
MFC After: 3 days

12 years agoRemove variables which are initialized but never used thereafter reported by gcc46...
Eitan Adler [Tue, 19 Jun 2012 06:10:24 +0000 (06:10 +0000)]
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by: cperciva
MFC After: 3 days

12 years agoRemove variables which are initialized but never used thereafter reported by gcc46...
Eitan Adler [Tue, 19 Jun 2012 06:09:58 +0000 (06:09 +0000)]
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by: cperciva
MFC After: 3 days

12 years agoRemove variables which are initialized but never used thereafter reported by gcc46...
Eitan Adler [Tue, 19 Jun 2012 06:09:47 +0000 (06:09 +0000)]
Remove variables which are initialized but never used thereafter reported by gcc46 warning

Approved by: cperciva
MFC After: 3 days

12 years agoRemove end of line whitespace.
Joel Dahl [Tue, 19 Jun 2012 05:55:14 +0000 (05:55 +0000)]
Remove end of line whitespace.

12 years agoMinor mdoc fixes.
Joel Dahl [Tue, 19 Jun 2012 05:53:47 +0000 (05:53 +0000)]
Minor mdoc fixes.

12 years agoVendor import of zlib 1.2.7.
Xin LI [Tue, 19 Jun 2012 05:48:36 +0000 (05:48 +0000)]
Vendor import of zlib 1.2.7.

12 years agoDocument support for Intel Enhanced Speedstep Tech interface
Sean Bruno [Mon, 18 Jun 2012 23:18:49 +0000 (23:18 +0000)]
Document support for Intel Enhanced Speedstep Tech interface
of cpufreq(4) via a new man page est(4)

Document the two exposed tuneables of est(4).

I'd appreciate more reviews of content if possible.  I gleaned
the information contained herein from sys/x86/cpufreq/est.c and
the Intel reference documentation

Reviewed by:    wblock hrs gjb
MFC after:      2 weeks

12 years agoFix the NFSv4 client for the case where mmap'd files are
Rick Macklem [Mon, 18 Jun 2012 22:17:28 +0000 (22:17 +0000)]
Fix the NFSv4 client for the case where mmap'd files are
written, but not msync'd by a process. A VOP_PUTPAGES()
called when VOP_RECLAIM() happens will usually fail, since
the NFSv4 Open has already been closed by VOP_INACTIVE().
Add a vm_object_page_clean() call to the NFSv4 client's
VOP_INACTIVE(), so that the write happens before the NFSv4
Open is closed. kib@ suggested using vgone() instead and
I will explore this, but this patch fixes things in the
meantime. For some reason, the VOP_PUTPAGES() is still
attaempted in VOP_RECLAIM(), but having this fail doesn't
cause any problems except a "stateid0 in write" being logged.

Reviewed by: kib
MFC after: 1 week

12 years agoAdjust the fix in r236953, by not generating the signal manually, but
Konstantin Belousov [Mon, 18 Jun 2012 21:08:48 +0000 (21:08 +0000)]
Adjust the fix in r236953, by not generating the signal manually, but
performing the return to usermode using full return path.  This
consolidates the handling of exceptional situations in less number of
places, and is less code as well.

Reviewed by:   jhb
MFC after:     1 week

12 years agoRevert r236529, re-enabling verification of the flashed content as
Marius Strobl [Mon, 18 Jun 2012 20:19:07 +0000 (20:19 +0000)]
Revert r236529, re-enabling verification of the flashed content as
the underlying problem was dealt with in r237239 (in fact, disabling
verification also actually only made the problem less likely to occur).

12 years agoRevert the part of r236495 that introduced checking of SPI_SR_TXEMPTY
Marius Strobl [Mon, 18 Jun 2012 20:14:42 +0000 (20:14 +0000)]
Revert the part of r236495 that introduced checking of SPI_SR_TXEMPTY
for TX transfer completion as for reasons unknown this occasionally
causes SPI_SR_RXBUFF and SPI_SR_ENDRX to not rise.
In any case, once the RX part of the transfer is done it's obvious
that the preceding TX part had finished and checking of SPI_SR_TXEMPTY
was introduced to rule out a possible cause for the data corruption
mentioned in r236495 but which didn't turn out to be the problem
anyway.

MFC after: 3 days

12 years agoTry to bring this file closer to style(9).
Marius Strobl [Mon, 18 Jun 2012 19:47:25 +0000 (19:47 +0000)]
Try to bring this file closer to style(9).

12 years agoUnbreak after r236658 by comparing the right things.
Marius Strobl [Mon, 18 Jun 2012 19:22:10 +0000 (19:22 +0000)]
Unbreak after r236658 by comparing the right things.

12 years agoRefine r237102 a bit:
Marius Strobl [Mon, 18 Jun 2012 19:18:31 +0000 (19:18 +0000)]
Refine r237102 a bit:
- Anounce JTAG interfaces deliberately skipped.
- Bring back empty lines too eagerly removed.

MFC after: 3 days

12 years agoDocument the hw.ahci.force tunable here, too, as it's also used by
Marius Strobl [Mon, 18 Jun 2012 19:14:06 +0000 (19:14 +0000)]
Document the hw.ahci.force tunable here, too, as it's also used by
ataahci(4) and atanvidia(4).

MFC after: 3 days

12 years agoAvoid hard sentence break.
Marius Strobl [Mon, 18 Jun 2012 19:11:07 +0000 (19:11 +0000)]
Avoid hard sentence break.

MFC after: 3 days

12 years agoAdd rate limitation for SCTP OOTB responses.
Michael Tuexen [Mon, 18 Jun 2012 17:11:24 +0000 (17:11 +0000)]
Add rate limitation for SCTP OOTB responses.

MFC after: 3 days

12 years agoCleanup the UDP decapsulation code.
Michael Tuexen [Mon, 18 Jun 2012 17:09:39 +0000 (17:09 +0000)]
Cleanup the UDP decapsulation code.

MFC after: 3 days

12 years agoAdd PV chunk and list locking to pmap_page_exists_quick(),
Alan Cox [Mon, 18 Jun 2012 16:21:59 +0000 (16:21 +0000)]
Add PV chunk and list locking to pmap_page_exists_quick(),
pmap_page_is_mapped(), and pmap_remove_pages().  These functions
are no longer serialized by the pvh global lock.

12 years agoMake radix lookup on src and dst flow addresses optional
Alexander V. Chernikov [Mon, 18 Jun 2012 13:56:36 +0000 (13:56 +0000)]
Make radix lookup on src and dst flow addresses optional
and configurable on per-interface basis.
Remove __inline__ for several functions being called once per
flow (e.g once per 10-20 packets on common traffic flows).
Update manual page to simplify search for BPF data link types.

Sponsored by Yandex LLC

Reviewed by:      glebius
Approved by:      ae(mentor)
MFC after:        2 weeks

12 years agoSimplify IP pointer recovery in case of mbuf reallocation.
Alexander V. Chernikov [Mon, 18 Jun 2012 13:50:41 +0000 (13:50 +0000)]
Simplify IP pointer recovery in case of mbuf reallocation.

Reviewed by:     glebius (previous version)
Approved by:     ae(mentor)
MFC after:       2 weeks

12 years agoRemove never used CD/DA_FLAG_TAGGED_QUEUING flags.
Alexander Motin [Mon, 18 Jun 2012 12:45:35 +0000 (12:45 +0000)]
Remove never used CD/DA_FLAG_TAGGED_QUEUING flags.

MFC after: 1 week

12 years agoFix the previous commit to only copy the data we were asked to and not
Poul-Henning Kamp [Mon, 18 Jun 2012 07:54:10 +0000 (07:54 +0000)]
Fix the previous commit to only copy the data we were asked to and not
twice as much.

Spotted by: Taku YAMAMOTO

12 years agoIn tty_makedev() the following construction:
Peter Holm [Mon, 18 Jun 2012 07:34:38 +0000 (07:34 +0000)]
In tty_makedev() the following construction:

dev = make_dev_cred();
dev->si_drv1 = tp;

leaves a small window where the newly created device may be opened
and si_drv1 is NULL.

As this is a vary rare situation, using a lock to close the window
seems overkill. Instead just wait for the assignment of si_drv1.

Suggested by: kib
MFC after: 1 week

12 years agoExtend the radiotap code to be aware of the size of any extra vendor
Adrian Chadd [Mon, 18 Jun 2012 02:08:04 +0000 (02:08 +0000)]
Extend the radiotap code to be aware of the size of any extra vendor
bitmaps that may occur.

The way this works is:

* the beginning of the radiotap frame has a 32 bit "radiotap" namespace
  bitmap;
* if the vendor bitmap bit is set, then the next bitmap will be interpreted
  as a vendor bitmap;
* this can keep going on and on (ie, more vendor and radiotap namespace
  bitmaps can be added) until the last bitmap with no "more bitmaps" set.

Now, the radiotap code gets its grubby fingers into the supplied
radiotap rx/tx buffer and replaces the channel configuration
for each frame.  I don't know why it's not up to the drivers themselves
to do this, but I digress.  So, if a vendor bitmap (or two, etc) exists,
the offset calculations will be all completely wrong.

This particular patch introduces ieee80211_radiotap_attachv(), which
includes the number of vendor bitmaps (well, any other bitmaps, vendor
or otherwise) between the end of the bitmap/header and the start of the
actual radiotap field entries.  This makes the radiotap calculations
"right", so it correctly calculates where to overwrite the channel
configuration.

The long term fix is to go through and make each driver update the channel
configuration, as some of the fields are already being updated.

That, however, is a longer term fix that will need each driver fixed.

I leave that as an exercise to someone in the future.

12 years agoRoll to the latest 2400/2500 firmware available from the public QLogic
Matt Jacob [Sun, 17 Jun 2012 21:47:24 +0000 (21:47 +0000)]
Roll to the latest 2400/2500 firmware available from the public QLogic
website.

Sponsored by: Spectralogic
MFC after: 1 week

12 years agolibc: Reduce relative relocations in strftime().
Jilles Tjoelker [Sun, 17 Jun 2012 21:40:13 +0000 (21:40 +0000)]
libc: Reduce relative relocations in strftime().

12 years agoPrepare for FC-Tape support. This involved doing a lot of little cleanups
Matt Jacob [Sun, 17 Jun 2012 21:39:40 +0000 (21:39 +0000)]
Prepare for FC-Tape support. This involved doing a lot of little cleanups
and crosschecks against firmware documentation. We now check and report
FC firmware attributes and at least are now prepared for the upper 48 bits
of f/w attributes (which are probably for the 8100 or later cards). This
involed changing how inbits and outbits are calculated for varios commands,
hopefully clearer and cleaner. This also caused me to clean up the actual
mailbox register usage. Finally, we are now unconditionally using a CRN
for initiator mode.

A longstanding issue with the 2400/2500 is that they do *not* support
a "Prefer PTP followed by loop", which explains why enabling that
caused the f/w to crash.

A slightly more invasive change is to let the firmware load entirely
drive whether multi_id support is enabled or not.

Sponsored by: Spectralogic
MFC after: 1 week

12 years agoDon't check for race with close on advisory unlock (there is nothing smart we
Pawel Jakub Dawidek [Sun, 17 Jun 2012 21:04:22 +0000 (21:04 +0000)]
Don't check for race with close on advisory unlock (there is nothing smart we
can do when such a race occurs). This saves lock/unlock cycle for the filedesc
lock for every advisory unlock operation.

MFC after: 1 month