jhb [Tue, 28 Aug 2012 18:45:20 +0000 (18:45 +0000)]
MFC 230782,237274:
Refine the implementation of POSIX_FADV_NOREUSE to perform
POSIX_FADV_DONTNEED requests on the currently accessed portion of the
file on each read(2) or write(2) rather than using direct I/O. This
gives much better performance including read-ahead and write clustering
similar to normal read(2) and write(2) calls.
If subsequent read(2) and write(2) calls are sequential, then the
POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed
range.
kib [Tue, 28 Aug 2012 10:15:30 +0000 (10:15 +0000)]
MFC r239588:
Provide some compat32 shims for sysctl vfs.conflist. It is required
for getvfsbyname(3) operation when called from 32bit process, and
getvfsbyname(3) is used by recent bsdtar import.
jhb [Mon, 27 Aug 2012 19:55:31 +0000 (19:55 +0000)]
MFC 237646,237656,238020:
- Add a new line to top that provides a brief summary of the ZFS ARC memory
usage on hosts using ZFS. The new line displays the total amount of RAM
used by the ARC along with the size of MFU, MRU, anonymous (in flight),
headers, and other (miscellaneous) sub-categories. The line is not
displayed on systems that are not using ZFS.
- Clarify that the cached file data pages included in the "Wired" count
in top are the BIO-level cached data (i.e. "Buf"), since the previous
phrase was a bit ambiguous with the "Cache" count.
jimharris [Mon, 27 Aug 2012 15:52:09 +0000 (15:52 +0000)]
MFC r239545, r239665:
Fix/add support for SCSI UNMAP to ATA DSM translation.
(Note: scsi_da does not support BIO_DELETE->SCSI_UNMAP on this
stable branch, but I am MFC'ing the changes to keep a
consistent driver across all stable releases.)
This addresses kernel panic observed when sending SCSI UNMAP
commands to SATA disks attached to isci(4).
1) Flesh out callback routines to allocate/free buffers needed for
translating SCSI UNMAP data to ATA DSM data.
2) Add controller-level pool for storing buffers previously allocated
for UNMAP translation, to lessen chance of no buffer available
under memory pressure.
3) Ensure driver properly handles case where buffer pool is empty
and contigmalloc returns NULL.
4) Clear freeze bit in isci_remote_device_release_lun_queue() before
calling xpt_release_devq to ensure that any ccbs which immediately
start during the call to xpt_release_devq() see an accurate picture
of the frozen_lun_mask. This code path is extensively exercised
when tagged read/write commands mix with non-tagged DSM commands.
gavin [Mon, 27 Aug 2012 13:50:01 +0000 (13:50 +0000)]
Merge r238778 from head:
The baud rate on CP1201/2/3 devices can be set in one of two ways:
- The USLCOM_SET_BAUD_DIV command (0x01)
- The USLCOM_SET_BAUD_RATE command (0x13)
Devices based on the CP1204 will only accept the latter command, and ignore
the former. As the latter command works on all chips that this driver
supports, switch to always using it.
A slight confusion here is that the previously used command was incorrectly
named USLCOM_BAUD_RATE - even though we no longer use it, rename it to
USLCOM_SET_BAUD_DIV to closer match the name used in the datasheet.
This change reflects a similar change made in the Linux driver, which was
submitted by preston.fick at silabs.com, and has been tested on all of the
uslcom(4) devices I have to hand.
gavin [Mon, 27 Aug 2012 12:45:41 +0000 (12:45 +0000)]
Merge r238766, r238774 from head:
Update the list of devices supported by uplcom. Although this only adds
one device (support for Motorola cables), this syncronises us with:
OpenBSD src/sys/dev/usb/uplcom.c 1.56
NetBSD src/sys/dev/usb/uplcom.c 1.73
Linux kernel.org HEAD
bschmidt [Thu, 23 Aug 2012 17:09:58 +0000 (17:09 +0000)]
MFC r231187:
Update the 802.11s IE numbers to represent the latest 802.11 amendment
standard.
This update breaks compatibility with older mesh setups but is necessary as
the previous IDs are used by another amendment leading to unexpected results
when trying to associate with an accesspoint using the affected IDs.
Discussed with: re
Tested by: honestqiao at gmail dot com
kib [Wed, 22 Aug 2012 20:34:23 +0000 (20:34 +0000)]
MFC r239247:
Adjust the r205536, by allowing a non-zero offset for anonymous
mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD
1.1.5.1 can issue such requests.
pfg [Wed, 22 Aug 2012 20:07:10 +0000 (20:07 +0000)]
MFC r238178, 238624, 238810:
Re-merge a couple of changes from NetBSD libedit.
bin/sh has been taught about el_gets setting the count to -1
on error, so now we can partially revert r238173 to reduce
differences with NetBSD's implementation.
Also fix some warnings to be more in sync with NetBSD.
mdf [Wed, 22 Aug 2012 17:16:05 +0000 (17:16 +0000)]
MFC r238502:
Fix a bug with memguard(9) on 32-bit architectures without a
VM_KMEM_MAX_SIZE.
The code was not taking into account the size of the kernel_map, which
the kmem_map is allocated from, so it could produce a sub-map size too
large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely
and base the memguard map's size off the kernel_map's size, since this
is always relevant and always smaller.
add usr.sbin/pkg which is a bootstrap tool for pkgng.
it respects PACKAGESITE, PACKAGEROOT, and a new environment variable ABI (if a
user want to use a different API from the base one for its packages)
it has no man page on purpose to avoid hidding the pkg(8) man page from the
pkgng package.
for now uses pkgbeta.FreeBSD.org as default mirror to find its package
it respects MK_PKGTOOLS
kib [Wed, 22 Aug 2012 05:38:06 +0000 (05:38 +0000)]
MFC r239125:
Do not apply errata 721 workaround when under hypervisor, since
typical hypervisor does not implement access to the required MSR,
causing #GP on boot.
marius [Tue, 21 Aug 2012 10:30:57 +0000 (10:30 +0000)]
MFC: r239089
- Merge from NetBSD:
When issuing a non-DMA command, make sure to set the "remaining length of
command to be transferred via DMA" (sc_cmdlen) to zero up-front, otherwise
we might get confused on command competition interrupt (no DMA active but
still data left to transfer).
- Implement handling of MSG_IGN_WIDE_RESIDUE which some targets produce, as
just rejecting these leads to a resend and disconnect loop.
Reported and tested by: mjacob
lstewart [Tue, 21 Aug 2012 02:52:25 +0000 (02:52 +0000)]
MFC r239346:
The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP
timestamp related stack variables to reference ms directly instead of ticks.
The h_ertt(4) Khelp module relies on TCP timestamp information in order to
calculate its enhanced RTT estimates, but was not updated as part of r231767.
Consequently, h_ertt has not been calculating correct RTT estimates since
r231767 was comitted, which in turn broke all delay-based congestion control
algorithms because they rely on the h_ertt RTT estimates.
Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all
previous uses of the ticks variable. This ensures all timestamp related
variables in h_ertt use the same units as the TCP stack and therefore results in
meaningful comparisons and RTT estimate calculations.
emaste [Mon, 20 Aug 2012 19:26:43 +0000 (19:26 +0000)]
MFC r232844: Remove extraneous log message
When ntp switched between PLL and FLL mode it produced a log message
"kernel time sync status change %04x". This issue is reported in ntp
bug 452[1] which claims that this behaviour is normal and the log
message isn't necessary. I'm not sure exactly when it was removed, but
it's gone in the latest ntp release (4.2.6p5).
delphij [Mon, 20 Aug 2012 18:26:16 +0000 (18:26 +0000)]
MFC r239169:
RFC 2289 requires all hashes be stored in little endian format before
folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32
is required before using the value.
Without this change, the implementation does not conform to test vector
found in RFC 2289.
emaste [Mon, 20 Aug 2012 14:14:19 +0000 (14:14 +0000)]
MFC r238718: Quirk MS keyboard so that function keys work
The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been
repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is
required to return them to their normal purpose.
This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000
keyboard to get the keys working again. More extensive changes to the USB
keyboard infrastructure would be needed to fully support the "F Lock" mode
and the extended keys on this keyboard.
obrien [Thu, 16 Aug 2012 23:52:08 +0000 (23:52 +0000)]
MF9: r237134
MFC r226342, r226343, r226347, r226348, r226349, r226353, r226388
When building for amd64 or ia64, add the "kern.elf32.read_exec" sysctl
to enable PROT_EXECUTE for elf32 binaries when reading is allowed.
The JDK 1.4.x requires the ability to execute in the heap.
tuexen [Wed, 8 Aug 2012 20:05:25 +0000 (20:05 +0000)]
MFC r239041:
Fix a bug reported by Simon L. B. Nielsen:
If an SCTP endpoint receives an ASCONF with a wildcard
lookup address and incorrect verification tag, the system
crashes.
This bug was found by Shaun Colley.
fjoe [Fri, 3 Aug 2012 11:22:09 +0000 (11:22 +0000)]
MFC: r238933
- Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg"
- Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f
marius [Mon, 30 Jul 2012 11:29:05 +0000 (11:29 +0000)]
Pull the tier-2 card and change the sparc64 ZFS loader to no longer probe
all diskN aliases for providers (which more or less corresponds to how the
x86 version behaves) but instead probe only those listed in the boot-device
OFW environment variable. This has the following advantages:
- avoids otherwise unavoidable OFW warnings about failures to open disks
for which aliases exist but no actual hardware is connected
- avoids issues due to different diskN naming schemes
- aligns us with Solaris
Heavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure
in BIND9
High numbers of queries with DNSSEC validation enabled can cause an
assertion failure in named, caused by using a "bad cache" data structure
before it has been initialized.
Use provided name when allocating ksid domain. It isn't really used on FreeBSD, but should fix a panic when pool is imported from another OS that is using this.
Requested by: nox
No objections: pjd
Approved by: cperciva (implicit)
When allocation of labels on files is implicitly disabled due to MAC
policy configuration, avoid leaking resources following failed calls
to get and set MAC labels by file descriptor.
Reported by: Mateusz Guzik <mjguzik at gmail.com> + clang scan-build
marius [Sun, 22 Jul 2012 14:33:04 +0000 (14:33 +0000)]
MFC: r238621
Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user
data introduced in r236061 (MFC'ed to stable/8 in r237187). Using that
flag doesn't make that much sense on this case as the DMA maps using
it are also created during sym_pci_attach(). Moreover, due to the
maxsegsz parameter used, doing so may exhaust the bounce pages pool
on architectures requiring bounce pages. [1]
While at it, use a slightly more appropriate maxsegsz parameter.
Merge a local fix to OpenBSM's libauditd to avoid a directory descriptor
leak when iterating over possible audit trail directories. This fix will
be merged upstream in an identical form, but hasn't yet appeared in an
OpenBSM release.
MFC r238063:
- Make ipfw's sched rules case insensitive, for user-friendliness.
- Add a note to the ipfw(8) man page about the rules no longer being
case sensitive.
- Fix some typos in the man page.
MFC r238617:
Fix several reads beyond the mapped first page of the binary in the
ELF parser. Specifically, do not allow note reader and interpreter
path comparision in the brandelf code to read past end of the page.
This may happen if specially crafter ELF image is activated.
Partially MFC r212541:
Refactor cpu_idle() on x86.
Use MONITOR/MWAIT instrunctions (if supported) under high sleep/wakeup rate,
as fast alternative to other methods. It allows SMP scheduler to wake up
sleeping CPUs much faster without using IPI, significantly increasing
performance on some highly task-switching loads. Also on such loads it
hides two ACPI timer reads, otherwise done by acpi_cpu_idle(), that are
reported to be slow on some systems.
MFC r225936 (by attilio):
Add some improvements in the idle table callbacks:
- Replace instances of manual assembly instruction "hlt" call
with halt() function calling.
- In cpu_idle_mwait() avoid races in check to sched_runnable() using
the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
- Add comments explaining the logic behind the pattern used in
cpu_idle_hlt() and other idle callbacks.
r223788 - Rewrite the flowctl utility to add it support for displaying both IPv4 and IPv4 flows.
r223790 - Update manual page. Mention IPv6 support, ..
r223824 - Conditionally compile in the IPv4/IPv6 address family support.
r236808 - Add "human" option to print IPv4/IPv6 flows in human-readable format.
Additionally, implement compatibility code for syntax changes introduced in r223788.
Flowctl supports specifying node both as absolute path (new style) and as node
name without colon (old style).
No objection from: glebius
Approved by: ae(mentor)
r219182 - Add support for NetFlow version 9 into ng_netflow(4) node.
r219229 - Unbreak the build for no options INET6.
r220769 - ng_netflow_cache_init() can be void.
r223706 - Fix double free.
r223787 - Eliminate flow6_hash_entry in favor of flow_hash_entry
r223822 - Add missing unlocks.
r232921 - Use rt_numfibs variable instead of compile-time RT_NUMFIBS.
r237162 - Fix improper L4 header handling for IPv6 packets passed via DLT_RAW.
r237163 - Set netflow v9 observation domain value to fib number instead of node id
r237164 - Use time_uptime instead of getnanotime for accouting integer number of seconds.
r237226 - Simplify IP pointer recovery in case of mbuf reallocation.
r237227 - Make radix lookup on src and dst flow addresses optional
No objection from: glebius
Approved by: ae(mentor)
Implement handling of "atomic fragements" as outlined in
draft-gont-6man-ipv6-atomic-fragments to mitigate one class of
possible fragmentation-based attacks.
As mentioned in the commit message of r237571 (copied from a prototype
patch of mine) also check if the 2nd in6_setscope() failed and return
the error in that case.
MFC r238022:
Remove 14 not very useful characters " HDA CODEC PCM" from HDA pcm
device names to shorten them. PulseAudio reported to have problems with
names longer then 63 chars and at least in XMMS long names are inconvinient.
MFC r238011:
Restore GPIO config quirks handling, lost during last big refactoring.
This fixes sound from speakers on some laptops, including MacBook Pro.