marius [Tue, 28 May 2013 20:58:57 +0000 (20:58 +0000)]
MFC: r247570, r247591
- Make tables, device ID strings etc const. This includes #ifdef'ing 0
aac_command_status_table, which is actually unused since r111532.
While at it, make aac_if a pointer to the now const interface tables
instead of copying them over to the softc (this alone already reduces the
size of aac.ko on amd64 by ~1 KiB).
- Remove redundant softc members.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Use pci_enable_busmaster(9) instead of duplicating it.
- Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will
just fail).
- Canonicalize the error messages in case of resource allocation failures.
- Add support for using MSI instead of INTx, controllable via the tunable
hw.aac.enable_msi (defaulting to on).
marius [Tue, 28 May 2013 20:53:26 +0000 (20:53 +0000)]
MFC: r245926, r245931
- Improve some comments.
- Make bge_lookup_{rev,vendor}() static.
- Factor out chip identification rather than duplicating the code.
- Sanitize bge_probe() a bit (don't hardcode buffer sizes, allow
bge_lookup_vendor() to return NULL so the excessive panic() can
be removed there, etc.) and return BUS_PROBE_DEFAULT rather than
hardcoding 0.
- According to the Linux tg3 driver, BCM57791 and BCM57795 aren't
capable of Gigabit Ethernet.
- Check the return value of taskqueue_start_threads().
- Mention NetLink controllers in the fallback description, too.
jhb [Tue, 28 May 2013 18:13:08 +0000 (18:13 +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
kib [Tue, 28 May 2013 05:51:00 +0000 (05:51 +0000)]
MFC r250853:
Fix the wait6(2) on 32bit architectures and for the compat32, by using
the right type for the argument in syscalls.master. Also fix the
posix_fallocate(2) and posix_fadvise(2) compat32 syscalls on the
architectures which require padding of the 64bit argument.
mckusick [Mon, 27 May 2013 22:18:04 +0000 (22:18 +0000)]
MFC of 250708:
Clean up trailing whitespace.
Submitted by: Andy Kosela
MFC of 250710:
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:05 +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.
jlh [Sun, 26 May 2013 14:40:23 +0000 (14:40 +0000)]
MFC r250992:
Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
The build system is really intricate and I had a hard time to remind the
whole picture even when reading my own words. This one will hopefully
be better.
The description explains why we should not configure "path",
"host.hostname", "command", "ip4.addr" and ip6.addr" parameters with
this, but rather use the historical rc.conf(5) options.
kib [Sat, 25 May 2013 11:05:00 +0000 (11:05 +0000)]
MFC r250505:
- Fix nullfs vnode reference leak in nullfs_reclaim_lowervp(). The
null_hashget() obtains the reference on the nullfs vnode, which must
be dropped.
- Fix a wart which existed from the introduction of the nullfs
caching, do not unlock lower vnode in the nullfs_reclaim_lowervp().
It should be innocent, but now it is also formally safe. Inform the
nullfs_reclaim() about this using the NULLV_NOUNLOCK flag set on
nullfs inode.
- Add a callback to the upper filesystems for the lower vnode
unlinking. When inactivating a nullfs vnode, check if the lower
vnode was unlinked, indicated by nullfs flag NULLV_DROP or VV_NOSYNC
on the lower vnode, and reclaim upper vnode if so. This allows
nullfs to purge cached vnodes for the unlinked lower vnode, avoiding
excessive caching.
MFC r250852:
Do not leak the NULLV_NOUNLOCK flag from the nullfs_unlink_lowervp(),
for the case when the nullfs vnode is not reclaimed. Otherwise, later
reclamation would not unlock the lower vnode.
pfg [Thu, 23 May 2013 16:39:42 +0000 (16:39 +0000)]
MFC r250823:
grep: change some int types.
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
jamie [Wed, 22 May 2013 18:26:12 +0000 (18:26 +0000)]
MFC r250804:
Refine the "nojail" rc keyword, adding "nojailvnet" for files that don't
apply to most jails but do apply to vnet jails. This includes adding
a new sysctl "security.jail.vnet" to identify vnet jails.
scottl [Wed, 22 May 2013 08:44:21 +0000 (08:44 +0000)]
MFC r250327
Add a sysctl vfs.read_min to complement the exiting vfs.read_max. It
defaults to 1, meaning that it's off.
When read-ahead is enabled on a file, the vfs cluster code deliberately
breaks a read into 2 I/O transactions; one to satisfy the actual read,
and one to perform read-ahead. This makes sense in low-latency
circumstances, but often produces unbalanced i/o transactions that
penalize disks. By setting vfs.read_min, we can tell the algorithm to
fetch a larger transaction that what we asked for, achieving the same
effect as the read-ahead but without the doubled, unbalanced transaction
and the slightly lower latency. This significantly helps our workloads
with video streaming.
delphij [Wed, 22 May 2013 00:31:33 +0000 (00:31 +0000)]
MFC r250374:
According to the documentation, on Linux, cancel_delayed_work() does not
do drain (flush_workqueue() in Linux terms) but instead returns true if
the work was removed before it is run, or false otherwise.
Simulate this by removing the taskqueue_drain() and return the value
derived from taskqueue_cancel()'s return value.
This would solve a witness warning caused by calling taskqueue_drain()
with a non-sleepable lock held, like:
taskqueue_drain with the following non-sleepable locks held:
exclusive rw lle (lle) r = 0 (0xfffffe001450b410) locked @
/usr/src/sys/netinet/in.c:1484
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffff848d4f7690
kdb_backtrace() at kdb_backtrace+0x39/frame 0xffffff848d4f7740
witness_warn() at witness_warn+0x4a8/frame 0xffffff848d4f7800
taskqueue_drain() at taskqueue_drain+0x3a/frame 0xffffff848d4f7840
set_timeout() at set_timeout+0x4a/frame 0xffffff848d4f7860
netevent_callback() at netevent_callback+0x16/frame 0xffffff848d4f7870
arpintr() at arpintr+0x9b5/frame 0xffffff848d4f7930
This do not affect kernel without OFED compiled in.
Reported by: Garrett Cooper <yaneurabeya gmail com>
Use procstat_getprocs(3) for retrieving thread information instead of
direct sysctl calls.
r249669:
Use more generic procstat_getvmmap(3) for retrieving VM layout of a process.
r249671:
Use procstat_getgroups(3) for retrieving groups information instead of
direct sysctl.
r249673:
Use procstat_getumask(3) for retrieving umaks information instead of
direct sysctl.
r249675:
Use procstat_getrlimit(3) for retrieving rlimit information instead of
direct sysctl calls.
r249678:
Use libprocstat(3) when retrieving binary information for a process.
r249680:
Use libprocstat(3) to retrieve process command line arguments and
environment variables.
r249683:
Use libprocstat(3) to retrieve ELF auxiliary vector.
r249685:
Use procstat_getkstack(3) for retrieving process kernel stacks
instead of direct sysctl calls.
r249686:
Make use of newly added libprocstat(3) ability to extract procstat
info from a process core file.
So now one can run procstat(1) on a process core e.g. to get a list of
files opened by a process when it crashed:
root@lisa:/ # procstat -f /root/vi.core
PID COMM FD T V FLAGS REF OFFSET PRO NAME
658 vi text v r r-------- - - - /usr/bin/vi
658 vi ctty v c rw------- - - - /dev/pts/0
658 vi cwd v d r-------- - - - /root
658 vi root v d r-------- - - - /
658 vi 0 v c rw------- 11 3208 - /dev/pts/0
658 vi 1 v c rw------- 11 3208 - /dev/pts/0
658 vi 2 v c rw------- 11 3208 - /dev/pts/0
658 vi 3 v r r----n-l- 1 0 - /tmp/vi.0AYKz3Lps7
658 vi 4 v r rw------- 1 0 - /var/tmp/vi.recover/vi.GaGYsz
658 vi 5 v r rw------- 1 0 - -
pfg [Mon, 20 May 2013 02:34:45 +0000 (02:34 +0000)]
grep: change some int types.
Change several int variables to size_t, ssize_t, or ptrdiff_t.
This should fix the bug described in CVE-2012-5667 when an input
line is so long that its length cannot be stored in an int
variable.
This is based on NetBSD's revision which says:
This change to NetBSD's version of GNU grep 2.5.1 (licenced under
GPLv2) was made without direct reference to any code licenced
under GPLv3.
nwhitehorn [Sun, 19 May 2013 01:52:39 +0000 (01:52 +0000)]
MFC r250290:
Only check fan type once. Not only is continuously rechecking pointless, a
single random failure can reprogram what control mechanism we try to use.
mav [Sat, 18 May 2013 13:19:31 +0000 (13:19 +0000)]
MFC r249625:
Introduce kern.timecounter.smp_tsc_adjust tunable (disabled by default) and
respective functionality, allowing to synchronize TSC on APs to match BSP's
during boot. It may be unsafe in general case due to theoretical chance of
later drift if CPUs are using different clock rate or source, but it allows
to use TSC in some cases when difference caused by some initialization bug,
while TSCs are known to increment synchronously.
melifaro [Sat, 18 May 2013 05:48:46 +0000 (05:48 +0000)]
MFC r248552, r248971
Add ipfw support for setting/matching DiffServ codepoints (DSCP).
Setting DSCP support is done via O_SETDSCP which works for both
IPv4 and IPv6 packets. Fast checksum recalculation (RFC 1624) is done for IPv4.
Dscp can be specified by name (AFXY, CSX, BE, EF), by value
(0..63) or via tablearg.
Matching DSCP is done via another opcode (O_DSCP) which accepts several
classes at once (af11,af22,be). Classes are stored in bitmask (2 u32 words).
Many people made their variants of this patch, the ones I'm aware of are
(in alphabetic order):
trociny [Fri, 17 May 2013 20:12:56 +0000 (20:12 +0000)]
MFC r249558, r250145:
r249558:
Add a new set of notes to a process core dump to store procstat data.
The notes format is a header of sizeof(int), which stores the size of
the corresponding data structure to provide some versioning, and data
in the format as it is returned by a related sysctl call.
The userland tools (procstat(1)) will be taught to extract this data,
providing additional info for postmortem analysis.
jilles [Thu, 16 May 2013 20:34:21 +0000 (20:34 +0000)]
MFC r250412: posix_spawn_file_actions_addopen(3): Correct error for bad file
descriptor.
As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file
descriptor is negative, not [EINVAL]. The bug was only in the manual page;
the code is correct.
kib [Thu, 16 May 2013 06:19:29 +0000 (06:19 +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.
rmacklem [Thu, 16 May 2013 00:56:41 +0000 (00:56 +0000)]
MFC: r250177
Fix the getpwnam_r() call in the pname_to_uid() kerberos library function so
that it handles the ERANGE error return case. Without this fix, authentication
of users for certain system setups could fail unexpectedly.
rmacklem [Thu, 16 May 2013 00:52:08 +0000 (00:52 +0000)]
MFC: r250176
Fix the getpwuid_r() call in the gssd daemon so that it handles
the ERANGE error return case. Without this fix, authentication
of users for certain system setups could fail unexpectedly.
pluknet [Wed, 15 May 2013 21:02:18 +0000 (21:02 +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.
rmacklem [Wed, 15 May 2013 01:44:01 +0000 (01:44 +0000)]
MFC: r250162
Document the fact that an NFSv4 mount against a volume on the same host
can result in a hung NFS server and is not recommended.
This is a content change.
rmacklem [Wed, 15 May 2013 01:36:59 +0000 (01:36 +0000)]
MFC: r250157
Isilon reported that sec=krb5p NFS mounts had a problem when m_len == 0
for the last mbuf of the list with an encrypted message. This patch replaces
the KASSERT() with code that handles this case.
yongari [Wed, 15 May 2013 01:16:41 +0000 (01:16 +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:05:16 +0000 (01:05 +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 00:58:45 +0000 (00:58 +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.
brooks [Tue, 14 May 2013 21:15:36 +0000 (21:15 +0000)]
MFC r245825,245890,246097,246127,246315:
Introduce a new option -DNO_ROOT that allows install and distribution
targets to be run without root privilege.
Information about ownership, group, flags, and suid bits are stored in
the file specified by METALOG which defaults to ${DESTDIR}/METALOG.
This file can be used in conjunction with bsdtar or makefs to generate
archives or file system images with correct permissions.
fabient [Mon, 13 May 2013 15:18:36 +0000 (15:18 +0000)]
MFC r247329, r247836:
Add support for good old 8192Hz profiling clock to software PMC.
Add a generic way to call per event allocate / release function.
hiren [Sun, 12 May 2013 22:01:22 +0000 (22:01 +0000)]
MFC: r240475
Remove all the checks on curthread != NULL with the exception of some MD
trap checks (eg. printtrap()).
Generally this check is not needed anymore, as there is not a legitimate
case where curthread != NULL, after pcpu 0 area has been properly
initialized.
jilles [Sun, 12 May 2013 16:26:19 +0000 (16:26 +0000)]
dup(2): Remove incorrect sentence about getdtablesize().
There are no getdtablesize() bounds on the file descriptor to be duplicated;
it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after
opening the file descriptor, it may be greater than or equal to
getdtablesize() but still valid.
jilles [Sun, 12 May 2013 16:11:23 +0000 (16:11 +0000)]
MFC r249566,r249644: EINTR in POSIX sem_*.
Document that sem_wait() can fail with [EINTR].
Programs often do not expect an [EINTR] return from sem_wait() and POSIX
only allows it if the signal was installed without SA_RESTART. The timeout
in sem_timedwait() is absolute so it can be restarted normally.
The old POSIX semaphore implementation did this correctly, unlike the new
umtx one.
Specific to 9-stable: UMTX_ABSTIME does not exist and therefore
sem_timedwait() is erroneously not restarted after a SA_RESTART signal
handler.
It may be desirable to avoid [EINTR] completely, which matches the pthread
functions and is explicitly permitted by POSIX. However, the kernel must
return [EINTR] at least for signals with SA_RESTART clear, otherwise pthread
cancellation will not abort a semaphore wait. In this commit, only restore
the 8.x behaviour which is also permitted by POSIX, as far as possible with
the ABI in 9-stable.