jilles [Sat, 5 Feb 2011 21:00:35 +0000 (21:00 +0000)]
MFC r216168: sh(1): Clean up documentation of built-in commands.
Make sure all built-in commands are in the subsection named such, except
exp, let and wordexp which are deliberately undocumented. The text said only
built-ins that really need to be a built-in were documented there but in
fact almost all of them were already documented.
mav [Sat, 5 Feb 2011 20:57:01 +0000 (20:57 +0000)]
MFC r217875:
In addition to r217444, ignore also ATA status errors on DMA Auto-Activation
enabling request. Some HP disks reported to return ABORT error there while
declaring support for this feature.
mav [Sat, 5 Feb 2011 20:52:43 +0000 (20:52 +0000)]
MFC r217444:
Some old WD SATA disks report supported and enabled device-initiated
interface power management, but return ABORT error on attempt to disable
it. Make CAM SATA probe sequence ignore this error, as it is not fatal.
jilles [Sat, 5 Feb 2011 20:48:45 +0000 (20:48 +0000)]
MFC r208505: sh(1): Rework documentation of shell variables.
* Move the "environment variables" that do not need exporting to be
effective or that are set by the shell without exporting to a new section
"Special Variables".
* Add special variables LINENO and PPID.
* Add environment variables LANG, LC_* and PWD; also describe ENV under
environment variables.
jilles [Sat, 5 Feb 2011 20:25:17 +0000 (20:25 +0000)]
MFC r217557: sh: Fix signal messages being sent to the wrong file sometimes.
When a foreground job exits on a signal, a message is printed to stdout
about this. The buffer was not flushed after this which could result in the
message being written to the wrong file if the next command was a builtin
and had stdout redirected.
dougb [Sat, 5 Feb 2011 19:13:34 +0000 (19:13 +0000)]
Update to BIND 9.6.3, the latest from ISC on the 9.6 branch.
All 9.6 users with DNSSEC validation enabled should upgrade to this
version, or the latest version in the 9.7 branch, prior to 2011-03-31
in order to avoid validation failures for names in .COM as described
here:
In addition the fixes for this and other bugs, there are also the
following:
* Various fixes to kerberos support, including GSS-TSIG
* Various fixes to avoid leaking memory, and to problems that could
prevent a clean shutdown of named
jilles [Sat, 5 Feb 2011 15:09:55 +0000 (15:09 +0000)]
MFC r217847: sh: Clean up some old comments:
* There is no plan for an alternative to the command "set".
* Attempting to unset a readonly variable has not raised an error for quite
a while, so the order of unsetting a variable and a function with the same
name does not matter.
yongari [Fri, 4 Feb 2011 20:32:52 +0000 (20:32 +0000)]
MFC r216829,216833:
rr216829:
Add driver for DM&P Vortex86 RDC R6040 Fast Ethernet.
The controller is commonly found on DM&P Vortex86 x86 SoC. The
driver supports all hardware features except flow control. The
flow control was intentionally disabled due to silicon bug.
DM&P Electronics, Inc. provided all necessary information including
sample board to write driver and answered many questions I had.
Many thanks for their support of FreeBSD.
__assert() is called when an assertion fails. After printing an error
message, it will call abort(). abort() never returns, hence it has the
__dead2 attribute. Also add this attribute to __assert().
jhb [Fri, 4 Feb 2011 17:11:37 +0000 (17:11 +0000)]
MFC 217351:
Introduce two new helper macros to define the priority ranges used for
interactive timeshare threads (PRI_*_INTERACTIVE) and non-interactive
timeshare threads (PRI_*_BATCH) and use these instead of PRI_*_REALTIME
and PRI_*_TIMESHARE. No functional change.
jhb [Fri, 4 Feb 2011 16:30:13 +0000 (16:30 +0000)]
MFC 217292:
- Retire some unused ithread priorities: PI_TTYHIGH, PI_TAPE, and
PI_DISKLOW. While here, rename PI_TTYLOW to PI_TTY.
- Add a macro PI_SWI() that takes a SWI_* constant as an argument and
returns the suitable thread priority.
To preserve the KBI, I did not renumber priorities but simply removed
unused ones.
jhb [Fri, 4 Feb 2011 14:29:05 +0000 (14:29 +0000)]
MFC 218171:
Output an appropriate amount of padding to line up per-CPU state columns
rather than using a terminal sequence to move the cursor when drawing the
initial screen.
brucec [Fri, 4 Feb 2011 10:19:56 +0000 (10:19 +0000)]
MFC r216873:
There can be more than 0x20000000 swap meta blocks allocated if a swap-backed
md(4) device is used. Don't panic when deallocating such a device if swap
has been used.
kib [Fri, 4 Feb 2011 09:15:23 +0000 (09:15 +0000)]
MFC r218026:
If more than one thread allocated sf buffers for sendfile(2), and
each of the threads needs more while current pool of the buffers is
exhausted, then neither thread can make progress.
Switch to nowait allocations after we got first buffer already.
MFC r217924:
While inspecting the disklabel check that start offset of partition is
within provider's bounds. If not then reject this disklabel.
Mark bbarea as NULL to do not free it again in destroy method.
yongari [Wed, 2 Feb 2011 18:42:53 +0000 (18:42 +0000)]
MFC r216925,217331,217349,217542:
r216925:
Add a 'locked' variant of the foo_start() routine and call it directly
from interrupt handlers and watchdog routines instead of queueing a task
to call foo_start().
r217331:
Make sure to invoke unlocked foo_start since the taskqueue does not
hold a driver lock. This should fix a regression introduced in
r216925.
r217349:
Forgot to remove unlock of the driver lock from age_start_locked() when
converting it to a locked variant.
r217542:
Fix some bugs in my last set of changes to ale(4):
- Remove extra unlock from end of ale_start_locked().
- Expand scope of locking in interrupt handler.
- Move ether_ifdetach() earlier and retire now-unneeded DETACH flag.
kib [Wed, 2 Feb 2011 12:24:53 +0000 (12:24 +0000)]
MFC r217880:
Treat async buffer writes from the gjournal switcher thread the same as
from syncer. We shall not sleep on running buffer space when suspending.
kib [Tue, 1 Feb 2011 10:20:31 +0000 (10:20 +0000)]
MFC r217824:
When vtruncbuf() iterates over the vnode buffer list, lock buffer object
before checking the validity of the next buffer pointer. Otherwise, the
buffer might be reclaimed after the check, causing iteration to run into
wrong buffer.
MFC r217531:
Limit maximum number of GPT entries to 4k. It is most realistic value
and can prevent kernel memory exhausting when big value is specified
from command line.
Split reading and writing operation to several iterations to do not
trigger KASSERT when data length is greater than MAXPHYS.
nwhitehorn [Sun, 30 Jan 2011 02:17:47 +0000 (02:17 +0000)]
MFC r217756:
Disable ATAPI DMA unconditionally on Apple Kauai ATA controllers, like it
is on the MacIO ones. It appears to be unreliable on all DBDMA-based
controllers for unknown reasons, which should be figured out eventually.
jhb [Fri, 28 Jan 2011 20:06:39 +0000 (20:06 +0000)]
MFC 217416:
Add two more features to cpuset(1):
- Add a new -C flag to create a new cpuset and move an existing pid into
that set.
- Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all)
which maps to the list of all CPUs in the system.
jpaetzel [Fri, 28 Jan 2011 18:25:51 +0000 (18:25 +0000)]
MFC: r217755 r217822
This script parses output of userland tools. In the case of a faulted
zpool the output causes the script to bail out with syntax errors.
Since a scrub of a faulted zpool is pointless, just skip over any
pools marked as such.
marcel [Fri, 28 Jan 2011 00:22:03 +0000 (00:22 +0000)]
In uart_tty_outwakeup(), check CTS/RTS flow control settings and
prevent sending data when CTS is de-asserted.
In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal
changed, knowing that uart_tty_outwakeup() will do the right
thing for flow control. This avoids redundant conditionals.
PR: kern/148644
Submitted by: John Wehle <john@feith.com>
gavin [Thu, 27 Jan 2011 23:16:41 +0000 (23:16 +0000)]
Merge r217200 from head:
Sync the list of devices supported by uslcom(4) with Linux, bringing in
all new devices added between our r211022 and their git revision 93ad03d60b5b18897030038234aa2ebae8234748
gavin [Thu, 27 Jan 2011 23:07:03 +0000 (23:07 +0000)]
Merge r217264 from head:
Remove a bullet point that appears to have been accidentally inserted twice.
It has also been included within the feature lists to which it is relevant.
jhb [Thu, 27 Jan 2011 21:16:23 +0000 (21:16 +0000)]
MFC 217078,217079: Various priority fixes for creating new threads:
- Move sched_fork() later in fork() after the various sections of the new
thread and proc have been copied and zeroed from the old thread and
proc. Otherwise attempts to modify thread or process data in sched_fork()
could be undone.
- Don't copy td_{base,}_user_pri from the old thread to the new thread in
sched_fork_thread() in ULE. This is already done courtesy the bcopy()
of the thread copy region.
- Always initialize the real priority (td_priority) of new threads to the
new thread's base priority (td_base_pri) to avoid bogusly inheriting a
borrowed priority from the parent thread.
- Properly initialize the base priority (td_base_pri) of thread0 to PVM
to match the desired priority in td_priority. Otherwise the first time
thread0 used a borrowed priority it would drop down to PUSER instead of
PVM.
- Explicitly initialize the starting priority of new kprocs to PVM to
avoid inheriting some random priority from thread0.
jhb [Thu, 27 Jan 2011 20:12:18 +0000 (20:12 +0000)]
MFC 217077:
Only change the priority of timeshare threads to PRI_MAX_TIMESHARE
when yield() is called. Specifically, leave the priority of real time
and idle threads unchanged.
jhb [Thu, 27 Jan 2011 20:09:20 +0000 (20:09 +0000)]
MFC 217076:
- Restore dropping the priority of syncer down to PPAUSE when it is idle.
This was lost when it was converted to using a condition variable instead
of lbolt.
- Drop the priority of flowtable down to PPAUSE when it is idle as well
since it is a similar background task.
yongari [Thu, 27 Jan 2011 19:02:28 +0000 (19:02 +0000)]
MFC r216551:
Add support for JMicron JMC251/JMC261 Gigabit/Fast ethernet
controller with Card Read Host Controller. These controllers are
multi-function devices and have the same ethernet core of
JMC250/JMC260. Starting from REVFM 5(chip full mask revision)
controllers have the following features.
o eFuse support
o PCD(Packet Completion Deferring)
o More advanced PHY power saving
Because these controllers started to use eFuse, station address
modified by driver is permanent as if it was written to EEPROM. If
you have to change station address please save your controller
default address to safe place before reprogramming it. There is no
way to restore factory default station address.
Many thanks to JMicron for continuing to support FreeBSD.
mav [Thu, 27 Jan 2011 13:53:21 +0000 (13:53 +0000)]
MFC r217509:
Fix 32bit bit fields handling. This fixes card serial number fetching.
It was just a cosmetic issue, because that number is only reported in logs.
mav [Thu, 27 Jan 2011 13:37:45 +0000 (13:37 +0000)]
MFC r215449:
Some VIA SATA controllers provide access to non-standard SATA registers via
PCI config space. Use them to implement hot-plug and link speed reporting.
Tested on ASRock PV530 board with VX900 chipset.
kib [Thu, 27 Jan 2011 09:52:31 +0000 (09:52 +0000)]
MFC r217633:
In tmpfs_readdir(), normalize handling of the directory entries that
either overflow the supplied buffer, or cause uiomove fail.
Do not advance cached de when directory entry was not copied out.
Do not return EOF when no entries could be copied due to first entry
too large for supplied buffer, signal EINVAL instead.
jhb [Wed, 26 Jan 2011 20:14:03 +0000 (20:14 +0000)]
MFC 216334:
When reopening a stream backed by an open file descriptor, do not close
the existing file descriptor. Instead, let dup2() atomically close the
old file descriptor when assigning the newly opened file to the same
descriptor. This closes a race in a multithreaded application where a
concurrent open() could allocate the existing file descriptor in between
the calls to close() and dup2().
bschmidt [Wed, 26 Jan 2011 16:59:07 +0000 (16:59 +0000)]
MFC r217590:
Jump to the next element and not to an arbitrary point. frm[1] contains
the element's data length, frm[2] is the first byte of the element's data.
Submitted by: Monthadar Al Jaberi <monthadar at gmail.com>
scf [Tue, 25 Jan 2011 23:25:23 +0000 (23:25 +0000)]
Merge from head to stable/8:
r216813:
Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after the
information is set to FreeBSD. It had been falling through to the end
of linux_ioctl_sound() and returning ENOIOCTL. Noticed when running the
Linux ALSA amixer tool.
Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype
v2.1.0.81 binary.
jilles [Tue, 25 Jan 2011 23:02:25 +0000 (23:02 +0000)]
MFC r217133: sed: Try hard links to make -i target available continually.
When creating a backup file, sed renamed the original before renaming the
changed copy into place, leading to a short time when no file with the
original name was present (usually only visible on SMP systems). Try
creating the backup file using a hard link instead, avoiding this problem.
If creating the hard link fails for any reason, fall back to the old rename
method.
When not creating a backup file, sed already renamed the changed copy onto
the original. This remains unchanged.
PR: bin/153261
Submitted by: Pedro F. Giffuni
Reviewed by: dds (older version)
Obtained from: Illumos
jhb [Tue, 25 Jan 2011 20:48:48 +0000 (20:48 +0000)]
MFC 215540:
Set various POSIX capability sysctls to the version of the API that is
supported rather than 1. They are supposed to return a suitable value
for sysconf(3). While here, make the fsync sysctl match <unistd.h>.
jhb [Tue, 25 Jan 2011 20:44:11 +0000 (20:44 +0000)]
MFC 204329,210723,210933,214778,215526:
Sync mfiutil(8) with HEAD:
- Handle malloc() failures more gracefully by error'ing out rather than
segfaulting.
- Fixed dependencies (make checkdpadd).
- Fix typos and spelling mistakes.
jhb [Tue, 25 Jan 2011 20:33:12 +0000 (20:33 +0000)]
MFC 211514,214158:
- There isn't really a need to hold the ktrace mutex just to read the
value of p_traceflag that is stored in the kinfo_proc structure.
- When disabling ktracing on a process, free any pending requests that
may be left. This fixes a memory leak that can occur when tracing is
disabled on a process via disabling tracing of a specific file (or if
an I/O error occurs with the tracefile) if the process's next system
call is exit(). The trace disabling code clears p_traceflag, so exit1()
doesn't do any KTRACE-related cleanup leading to the leak. I chose to
make the free'ing of pending records synchronous rather than patching
exit1().
- Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into
kern_ktrace.c instead. Make ktrace_mtx private to kern_ktrace.c as a
result.
jhb [Tue, 25 Jan 2011 19:44:42 +0000 (19:44 +0000)]
MFC 214144:
- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
its value as a loop invariant. Currently this is a no-op because
'atomic_cmpset_int()' clobbers all memory on current architectures.
- Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop
a reference in vmspace_free().
kib [Tue, 25 Jan 2011 10:14:12 +0000 (10:14 +0000)]
MFC r217561:
For architectures not using direct map , and requiring real KVA page for
sf buf allocation, use wakeup() instead of wakeup_one() to notify sf
buffer waiters about free buffer.
sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given,
and for simultaneous wakeup and signal delivery, msleep() returns
EINTR/ERESTART despite the thread was selected for wakeup_one(). As
result, we loose a wakeup, and some other waiter will not be woken up.