kib [Mon, 3 Jun 2013 17:13:37 +0000 (17:13 +0000)]
MFC r251033:
When handling an exception from the attempt from loading the faulting
context on return from the trap handler, re-enable the interrupts on
i386 and amd64.
jhb [Mon, 3 Jun 2013 17:07:57 +0000 (17:07 +0000)]
MFC 248167:
Fix the 'C' field for a running thread to match the behavior described
in the manpage by having it display the current CPU (ki_oncpu) rather
than the previously used CPU (ki_lastcpu). ki_lastcpu is still used for
all other thread states.
jkim [Mon, 3 Jun 2013 16:47:46 +0000 (16:47 +0000)]
MFC: r251186
Fix a long standing logic bug introduced in r167814. The code was added to
get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code
and we always fell back to the previous method, i. e., sysctlbyname(3).
jhb [Thu, 30 May 2013 19:24:29 +0000 (19:24 +0000)]
MFC 246417,247116,248584:
Rework the handling of stop signals in the NFS client. The changes in
195702, 195703, and 195821 prevented a thread from suspending while holding
locks inside of NFS by forcing the thread to fail sleeps with EINTR or
ERESTART but defer the thread suspension to the user boundary. However,
this had the effect that stopping a process during an NFS request could
abort the request and trigger EINTR errors that were visible to userland
processes (previously the thread would have suspended and completed the
request once it was resumed).
This change instead effectively masks stop signals while in the NFS client.
It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot
be masked directly. Instead of setting PBDRY on individual sleeps, change
the VFS_*() and VOP_*() methods to defer stop signals for filesystems which
request this behavior via a new VFCF_SBDRY flag. Note that this has to be
a VFC flag rather than a MNTK flag so that it works properly with
VFS_MOUNT() when the mount is not yet fully constructed. For now, only the
NFS clients set this new flag in VFS_SET().
A few other related changes:
- Add an assertion to ensure that TDF_SBDRY doesn't leak to userland.
- When a lookup request uses VOP_READLINK() to follow a symlink, mark
the request as being on behalf of the thread performing the lookup
(cnp_thread) rather than using a NULL thread pointer. This causes
NFS to properly handle signals during this VOP on an interruptible
mount.
- Ignore thread suspend requests due to SIGSTOP if stop signals are
currently deferred. This can occur if a process is stopped via
SIGSTOP while a thread is running or runnable but before it has set
TDF_SBDRY.
markj [Wed, 29 May 2013 22:29:33 +0000 (22:29 +0000)]
Revert my previous merge. There's a variable name difference between head
and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I
did the MFC, even after I tested.
markj [Wed, 29 May 2013 21:08:23 +0000 (21:08 +0000)]
MFC r250545:
Some filesystems (NFS in particular) do not fill out the d_type field when
returning directory entries through readdir(3). In this case we need to
obtain the file type ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old log files and to
do interval-based rotations properly.
mav [Wed, 29 May 2013 04:18:02 +0000 (04:18 +0000)]
MFC r250508:
Disable sending Early R_OK on SiI3726/SiI3826 port multipliers.
With "cached read" HDD testing and multiple ports busy on a SATA
host controller, 3726/3826 PMP will very rarely drop a deferred
R_OK that was intended for the host. Symptom will be all 5 drives
under test will timeout, get reset, and recover.
mav [Wed, 29 May 2013 04:14:41 +0000 (04:14 +0000)]
MFC r250819:
Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.
In some cases it could cause kernel panic during failed drive replacement.
jhb [Tue, 28 May 2013 18:43:58 +0000 (18:43 +0000)]
MFC 247332:
Add a quirk to disable this driver for certain older laptops with an ICH2
southbridge and an Intel 82815_MC host bridge where the host bridge's
revision is less than 5
mckusick [Mon, 27 May 2013 22:41:43 +0000 (22:41 +0000)]
MFC of 250708:
Clean up trailing whitespace.
Submitted by: Andy Kosela
MFC of 250710: (delete addition of -k which does not exist in 8-stable)
When running the -m option to generate a newfs(8) command suitable for
recreating the filesystem, check for and output the -i, -k, and -l
options if appropriate.
Note the remaining deficiencies of the -m option in the dumpfs(8)
manual page. Specifically that newfs(8) options -E, -R, -S, and -T
options are not handled and that -p is not useful so is omitted.
Also document that newfs(8) options -n and -r are neither checked
for nor output but should be. The -r flag is needed if the filesystem
uses gjournal(8).
trociny [Sun, 26 May 2013 18:54:50 +0000 (18:54 +0000)]
MFC r250405:
Move snmp_hast manual to section 3, where all other manual pages for
bsnmp modules are located.
Section 3 (Library Functions) looks wrong for this manual page, which
contains only module description, that is why initially it was located
to section 8 (System Manager's Manual). On the other hand manual
pages for all other bsnmpd modules are already located in the section
3, and having all pages in one section looks more consistent. Also,
currently, similarly to manuals for other modules, snmp_hast manual
contains LIBRARY section, which is not good style for section 8.
jhb [Tue, 21 May 2013 19:25:19 +0000 (19:25 +0000)]
MFC 238450,250152-250153,250415:
- Add support for the XSAVEOPT instruction use.
- The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and
XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles
any bitmask which is subset of the enabled bits in %XCR0.
- Partially saved extended state must be handled always, i.e. for both
fpu-owned context, and for pcb-saved one.
- Correct the type for the literal used on the left side of the shift up
to 63 bit positions.
Do not fill the save area and do not set the saved bit in the xstate
bit vector for the state which is not marked as enabled in xsave_mask.
kib [Thu, 16 May 2013 10:32:01 +0000 (10:32 +0000)]
MFC r250193:
Do a sync of the devvp vnode for the mount, which buffers, among other
things, contain FAT blocks. This makes fsync(2) for msdosfs more correct
by syncing the metadata needed to read the synced data.
pluknet [Wed, 15 May 2013 21:05:25 +0000 (21:05 +0000)]
MFC r246711:
o Bring in sync decoding the first nfssvc(2) parameter (flags) with
the current definitions location.
o Respect numbers in NFSSVC_* (e.g. NFSSVC_V4ROOTEXPORT).
dim [Wed, 15 May 2013 20:59:00 +0000 (20:59 +0000)]
MFC r250393:
When gcc 4.2.0 was imported, the 3DNow intrinsics header <mm3dnow.h> was
not added to the list of intrinsics headers to install, so belatedly (5
years :) add it.
yongari [Wed, 15 May 2013 01:17:59 +0000 (01:17 +0000)]
MFC r248542:
For RTL8211B or later PHYs, enable crossover detection and
auto-correction. This change makes re(4) establish a link with
a system using non-crossover UTP cable.
yongari [Wed, 15 May 2013 01:06:24 +0000 (01:06 +0000)]
MFC r248456:
r119712 introduced SIS_TYPE_83816 but it was not actually set in
driver such that checking against the type was always false.
To detect NS DP83816, driver should have checked silicon revision
register for NS controllers. While here, remove SIS_TYPE_83816 to
not make the similar mistake again.
yongari [Wed, 15 May 2013 01:00:40 +0000 (01:00 +0000)]
MFC r248227:
Disable TX IP header checksum offloading on RL_HWREV_8168CP. The
controller generates wrong checksummed frame if the IP packet has
IP options.
mav [Sat, 11 May 2013 08:15:56 +0000 (08:15 +0000)]
MFC r249352:
Do not sent 120 TEST UNIT READY requests on generic NOT READY statuses.
Some failing disks tend to return vendor-specific ASC/ASCQ codes with
NOT READY sense key. It caused extremely long recovery attempts, repeating
these 120 TURs (it takes at least 1 minute) for every I/O request.
Instead of that use default error handling, doing just few retries.
mav [Sat, 11 May 2013 08:11:55 +0000 (08:11 +0000)]
MFC r250185:
Add IDs for HighPoint RocketRAID 640L/642L/644L -- new series of 4-port
6Gbps PCIe 2.0 x2 SATA controllers, based on Marvell 88SE9235 chips.
markj [Fri, 10 May 2013 21:11:18 +0000 (21:11 +0000)]
MFC r249257:
Add support for getting and setting BBU properties related to battery
relearning. Specifically, add subcommands to mfiutil(8) which allow the
user to set the BBU and autolearn modes when the firmware supports it,
and add a subcommand which kicks off a battery relearn.
markj [Fri, 10 May 2013 20:56:07 +0000 (20:56 +0000)]
MFC r248776:
Fix interval-based rotations when the -t flag is used. In this case, find
the most-recently archived logfile and use its mtime to determine whether
or not to rotate, as in the non-timestamped case.
Previously we would just try to use the mtime of <logfile>.0, which always
results in a rotation since it generally doesn't exist in the -t case.
sbruno [Wed, 8 May 2013 15:48:36 +0000 (15:48 +0000)]
MFC r249815
Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
command on a disk device. This quieseces some noise on the console that
recently appeared.
kib [Tue, 7 May 2013 09:48:42 +0000 (09:48 +0000)]
MFC r249811:
Literally follow POSIX:
If the bs= expr operand is specified and no conversions other than sync,
noerror, or notrunc are requested, the data returned from each input
block shall be written as a separate output block.
dim [Mon, 6 May 2013 19:59:13 +0000 (19:59 +0000)]
MFC r215137:
Revert r103230, which depended on ld preserving the __start_xxx and
__stop_xxx symbols for custom sections, even when these were not
referenced (at link time). This behaviour was changed again in binutils
commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221.
This time, put the __GLOBL macro definition in cdefs.h, so it can be
reused in a few other places where it will be needed.
Reviewed by: kib
MFC r215138:
Use the same treatment as in linker_set.h for the __start and __stop
symbols of the set_vnet and set_pcpu sections, so those symbols will
always be emitted in kernel modules, if they use vnet.h or pcpu.h.
Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and
associated macros invisible to userland, to prevent it picking up these
symbols.
dim [Wed, 1 May 2013 18:06:53 +0000 (18:06 +0000)]
MFC r249846:
When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.
Thanks to avg and jhb for a few hints in the right direction.
Noticed by: Jeremy Chadwick <jdc@koitsu.org> (and many others)
lstewart [Wed, 1 May 2013 08:57:45 +0000 (08:57 +0000)]
MFC r245783:
Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited"
logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could
therefore potentially corrupt the result (although under normal operation,
neither variable should legitmately exceed 32 bits).