]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoA few other common cases for encode-int decoding: OF_getencprop_alloc()
Nathan Whitehorn [Tue, 22 Oct 2013 21:20:05 +0000 (21:20 +0000)]
A few other common cases for encode-int decoding: OF_getencprop_alloc()
and OF_searchencprop(). I thought about using the element size parameter
to OF_getprop_alloc() to do endian-switching automatically, but it breaks
use with structs and a *lot* of FDT code (which can hopefully be moved to
these new APIs).

MFC after: 2 weeks

10 years agoMFP4:
Brooks Davis [Tue, 22 Oct 2013 21:16:57 +0000 (21:16 +0000)]
MFP4:
Change 231031 by brooks@brooks_zenith on 2013/07/11 16:22:08

        Turn the unused and uncompilable MIPS_DISABLE_L1_CACHE define in
        cache.c into an option and when set force I- and D-cache line
        sizes to 0 (the latter part might be better as a tunable).

        Fix some casts in an #if 0'd bit of code which attempts to
        disable L1 cache ops when the cache is coherent.

Sponsored by: DARPA/AFRL

10 years agoRemove a bit of debugging output that slipped into r256911.
Brooks Davis [Tue, 22 Oct 2013 21:13:02 +0000 (21:13 +0000)]
Remove a bit of debugging output that slipped into r256911.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoMFP4:
Brooks Davis [Tue, 22 Oct 2013 21:08:25 +0000 (21:08 +0000)]
MFP4:
Change 228019 by bz@bz_zenith on 2013/04/23 13:55:30

Add kernel side support for large TLB on BERI/CHERI.
Modelled similar to NLM

MFC after: 3 days
Sponsored by: DAPRA/AFRL

10 years agoMFP4:
Brooks Davis [Tue, 22 Oct 2013 21:06:27 +0000 (21:06 +0000)]
MFP4:
Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 16:05:30

        FreeBSD/mips stores page-table entries in a near-identical format
        to MIPS TLB entries -- only it overrides certain "reserved" bits
        in the MIPS-defined EntryLo register to hold software-defined bits
        (swbits) to avoid significantly increasing the page table memory
        footprint.  On n32 and n64, these bits were (a) colliding with
        MIPS64r2 physical memory extensions and (b) being improperly
        cleared.

        Attempt to fix both of these problems by pushing swbits further
        along 64-bit EntryLo registers into the reserved space, and
        improving consistency between C-based and assembly-based clearing
        of swbits -- in particular, to use the same definition.  This
        should stop swbits from leaking into TLB entries -- while ignored
        by most current MIPS hardware, this would cause a problem with
        (much) larger physical memory sizes, and also leads to confusing
        hardware-level tracing as physical addresses contain unexpected
        (and inconsistent) higher bits.

        Discussed with: imp, jmallett

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoAdd a new function (OF_getencprop()) that undoes the transformation applied
Nathan Whitehorn [Tue, 22 Oct 2013 20:57:24 +0000 (20:57 +0000)]
Add a new function (OF_getencprop()) that undoes the transformation applied
by encode-int. Specifically, it takes a set of 32-bit cell values and
changes them to host byte order. Most non-string instances of OF_getprop()
should be using this function, which is a no-op on big-endian platforms.

10 years agoEnable ATSE_CFI_HACK in BERI configs, stable MAC addresses are useful.
Brooks Davis [Tue, 22 Oct 2013 20:50:41 +0000 (20:50 +0000)]
Enable ATSE_CFI_HACK in BERI configs, stable MAC addresses are useful.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoAdd a manpage for the getenv() family of functions in the kernel.
John Baldwin [Tue, 22 Oct 2013 20:10:38 +0000 (20:10 +0000)]
Add a manpage for the getenv() family of functions in the kernel.

10 years agoFix AHCI ATAPI emulation when backed with /dev/cd0
Peter Grehan [Tue, 22 Oct 2013 19:55:04 +0000 (19:55 +0000)]
Fix AHCI ATAPI emulation when backed with /dev/cd0

- remove assumption that the backing file/device had
  512-byte sectors
- fix incorrect iovec size variable that would result
  in a buffer overrun when an o/s issued an i/o request
  with more s/g elements than the blockif api

Reviewed by: Zhixiang Yu (zxyu.core@gmail.com)
MFC after: 3 days

10 years agoAdd a dummy statement to the beginning of the pthread_cleanup_pop() macro
Tijl Coosemans [Tue, 22 Oct 2013 19:53:52 +0000 (19:53 +0000)]
Add a dummy statement to the beginning of the pthread_cleanup_pop() macro
to allow a call of the macro to be labelled as in:

label:
  pthread_cleanup_pop();

Reviewed by: imp
MFC after: 3 days

10 years agoRename the "alfred" command to "auto", and document it. Retain support
Gavin Atkinson [Tue, 22 Oct 2013 18:55:52 +0000 (18:55 +0000)]
Rename the "alfred" command to "auto", and document it.  Retain support
for "portsnap alfred" for now.

Discussed: many times, most recently on svn-src-all
MFC after: 1 week

10 years agoThou shalt not leak build host state into the system being compiled.
Colin Percival [Tue, 22 Oct 2013 18:36:39 +0000 (18:36 +0000)]
Thou shalt not leak build host state into the system being compiled.

The VERSION variable is encoded into the SUNW_ctf sections of the kernel
and every kernel module when dtrace is enabled; starting with 9.2-RELEASE
(when dtrace was turned on in GENERIC) this means that different host kernels
will result in very different kernel binaries being generated.  This tripped
up freebsd-update builds after the build boxes were updated from 9.x to 10.x.

MFC after: 3 days (stable/9)
X-MFC after: 0 days (stable/10)
Security: Rendered two members of so@ temporarily insane

10 years agoThe TCP delayed ACK logic isn't aware of LRO passing up large aggregated
Andre Oppermann [Tue, 22 Oct 2013 18:24:34 +0000 (18:24 +0000)]
The TCP delayed ACK logic isn't aware of LRO passing up large aggregated
segments thinking it received only one segment. This causes it to enable
the delay the ACK for 100ms to wait for another segment which may never
come because all the data was received already.

Doing delayed ACK for LRO segments is bogus for two reasons: a) it pushes
us further away from acking every other packet; b) it introduces additional
delay in responding to the sender.  The latter is especially bad because it
is in the nature of LRO to aggregated all segments of a burst with no more
coming until an ACK is sent back.

Change the delayed ACK logic to detect LRO segments by being larger than
the MSS for this connection and issuing an immediate ACK for them to keep
the ACK clock ticking without interruption.

Reported by: julian, cperciva
Tested by: cperciva
Reviewed by: lstewart
MFC after: 3 days

10 years agoMask out non-address bits in the mac address register, for proper
Ian Lepore [Tue, 22 Oct 2013 18:14:06 +0000 (18:14 +0000)]
Mask out non-address bits in the mac address register, for proper
detection of an all-zeroes address.  Also remove a misplaced return.

Reviewed by: br@

10 years agoStop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC. This allows
Brooks Davis [Tue, 22 Oct 2013 15:53:29 +0000 (15:53 +0000)]
Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC.  This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups.  It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

MFC after: 1 week
Sponsored by: DARPA/AFRL

10 years agoIgnore registers on devices where the reg property is malformed. Issue a
Nathan Whitehorn [Tue, 22 Oct 2013 15:47:13 +0000 (15:47 +0000)]
Ignore registers on devices where the reg property is malformed. Issue a
warning if this happens under bootverbose. This prevents some
strange-looking entries in dmesg for SMU devices on Apple G5 systems.

10 years agoSync BERI kernel configs with P4:
Brooks Davis [Tue, 22 Oct 2013 15:45:31 +0000 (15:45 +0000)]
Sync BERI kernel configs with P4:

Switch the majority of device configuration to FDT from hints.

Add BERI_*_BASE configs to reduce duplication in the MDROOT and SDROOT
kernels.

Add NFS and GSSAPI support by default.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoMFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
Brooks Davis [Tue, 22 Oct 2013 15:29:59 +0000 (15:29 +0000)]
MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
230523, 1123614

Implement a driver for Robert Norton's PIC as an FDT interrupt
controller. Devices whose interrupt-parent property points to a beripic
device will have their interrupt allocation, activation , and setup
operations routed through the IC rather than down the traditional bus
hierarchy.

This driver largely abstracts the underlying CPU away allowing the
PIC to be implemented on CPU's other than BERI. Due to insufficient
abstractions a small amount of MIPS specific code is currently required
in fdt_mips.c and to implement counters.

MFC after: 3 days
Sponsored by: DARPA/AFRL

10 years agoCatch up on 6 years of improvements in Open Firmware nexus devices by
Nathan Whitehorn [Tue, 22 Oct 2013 14:11:16 +0000 (14:11 +0000)]
Catch up on 6 years of improvements in Open Firmware nexus devices by
importing the sparc64 one. At least 90% of this code is MI and will be
moved into /sys/dev/ofw at some point in the future.

10 years agoSet BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionally
Nathan Whitehorn [Tue, 22 Oct 2013 14:10:00 +0000 (14:10 +0000)]
Set BUS_PROBE_NOWILDCARD on this attachment as a stopgap. Unconditionally
poking at registers in unknown devices is not the best probe mechanism.
This should be reverted and a better solution found later.

10 years agoAllow lots of interrupts (useful on multi-domain platforms) and do not
Nathan Whitehorn [Tue, 22 Oct 2013 14:08:57 +0000 (14:08 +0000)]
Allow lots of interrupts (useful on multi-domain platforms) and do not
set device_quiet() on all devices attached under nexus(4).

10 years agoStandards-conformance and code deduplication:
Nathan Whitehorn [Tue, 22 Oct 2013 14:07:57 +0000 (14:07 +0000)]
Standards-conformance and code deduplication:
- Use bus reference phandles in place of FDT offsets as IRQ domain keys
- Unify the identical macio/fdt/mambo OpenPIC drivers into one
- Be more forgiving (following ePAPR) about what we need from the device
  tree to identify an OpenPIC
- Correctly map all IRQs into an interrupt domain
- Set IRQ_*_CONFORM for interrupts on an unknown PIC type instead of
  failing attachment for that device.

10 years agoFix memory and references leak due to unfreed path.
Alexander Motin [Tue, 22 Oct 2013 13:56:30 +0000 (13:56 +0000)]
Fix memory and references leak due to unfreed path.

Coverity CID: 1054773

10 years agoFix memory and references leak due to unfreed path.
Alexander Motin [Tue, 22 Oct 2013 13:52:20 +0000 (13:52 +0000)]
Fix memory and references leak due to unfreed path.

Coverity CID: 1109815

10 years agoUse the vdev's ashift to calculate the supported min block size passed to
Steven Hartland [Tue, 22 Oct 2013 13:31:36 +0000 (13:31 +0000)]
Use the vdev's ashift to calculate the supported min block size passed to
zio_compress_data(..) when compressing l2arc buffers.

This eliminates l2arc I/O errors, which resulted in very poor performance on
vdev's configured with block size greater than 512b due to compression
assuming a smaller min block size than the vdev supports.

MFC after: 2 days

10 years agoUnconditionally acquire periph reference on CCB allocation failure.
Alexander Motin [Tue, 22 Oct 2013 12:58:22 +0000 (12:58 +0000)]
Unconditionally acquire periph reference on CCB allocation failure.

cam_periph_acquire() can return error if periph already invalidated, but
that may be unacceptable and cause deadlock if the invalidated periph can't
be destroyed without "executing" the scheduled request.

Coverity CID: 1109822
MFC after: 2 months

10 years agoFix memory and references leak due to unfreed path.
Alexander Motin [Tue, 22 Oct 2013 12:42:49 +0000 (12:42 +0000)]
Fix memory and references leak due to unfreed path.

Coverity CID: 1109817

10 years agoUpdate ahci(4), respecting recent driver changes.
Alexander Motin [Tue, 22 Oct 2013 11:56:46 +0000 (11:56 +0000)]
Update ahci(4), respecting recent driver changes.

10 years agoRemove global device lock acquisition from dev_relthread(), replacing it
Alexander Motin [Tue, 22 Oct 2013 10:40:26 +0000 (10:40 +0000)]
Remove global device lock acquisition from dev_relthread(), replacing it
with atomics on per-device data.

10 years agoRemove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9).
Alexander Motin [Tue, 22 Oct 2013 10:21:20 +0000 (10:21 +0000)]
Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9).

Since at least FreeBSD 7 we had only four of them in the base tree, and
in head branch, thanks to jhb@, we have no any for more then a year.

10 years agoMerge GEOM direct dispatch changes from the projects/camlock branch.
Alexander Motin [Tue, 22 Oct 2013 08:22:19 +0000 (08:22 +0000)]
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
 - caller should not hold any locks and should be reenterable;
 - callee should not depend on GEOM dual-threaded concurency semantics;
 - on the way down, if request is unmapped while callee doesn't support it,
   the context should be sleepable;
 - kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
 - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
 - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
 - G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
 - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe.  If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION.  da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

Sponsored by: iXsystems, Inc.
MFC after: 2 months

10 years agoAdd a reload command.
Dag-Erling Smørgrav [Tue, 22 Oct 2013 07:44:26 +0000 (07:44 +0000)]
Add a reload command.

Reviewed by: hrs
MFC after: 3 days

10 years agoStart rtsold if necessary.
Dag-Erling Smørgrav [Tue, 22 Oct 2013 06:53:01 +0000 (06:53 +0000)]
Start rtsold if necessary.

Reviewed by: hrs
MFC after: 3 days

10 years agoMake watchdog function conform watchdog(9):
Oleksandr Tymoshenko [Tue, 22 Oct 2013 05:22:46 +0000 (05:22 +0000)]
Make watchdog function conform watchdog(9):
Set error to 0 when watchdog is armed and disable it when timeout
is too large to be set.

10 years ago- Implement watchdog function and register it with watchdog list
Oleksandr Tymoshenko [Tue, 22 Oct 2013 05:19:42 +0000 (05:19 +0000)]
- Implement watchdog function and register it with watchdog list

10 years agoReturn standards-compliant code from OF_nextprop() with FDT when no
Nathan Whitehorn [Tue, 22 Oct 2013 02:39:56 +0000 (02:39 +0000)]
Return standards-compliant code from OF_nextprop() with FDT when no
properties remain on this node.

10 years agoMake netback compile without INET support in the kernel.
Bjoern A. Zeeb [Tue, 22 Oct 2013 00:50:53 +0000 (00:50 +0000)]
Make netback compile without INET support in the kernel.

This shuld have been a problem since r230587.  Not exactly sure why it
was not detected the last weeks with the tinderbox.  I would assume
r255744 is what started to cause it.

MFC after: 1 week

10 years agoResolve clang warning about a use of syslog. By using a proper enforcement
Sean Bruno [Mon, 21 Oct 2013 22:55:56 +0000 (22:55 +0000)]
Resolve clang warning about a use of syslog. By using a proper enforcement
of string format in a call so syslog

/usr/src/gnu/lib/libssp/../../../contrib/gcclibs/libssp/ssp.c:137:23:
warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    syslog (LOG_CRIT, msg1);
                      ^~~~

Reviewed by: dim@

10 years agoRemove the isf(4) driver. It was created by accident and is subset of
Brooks Davis [Mon, 21 Oct 2013 22:43:38 +0000 (22:43 +0000)]
Remove the isf(4) driver.  It was created by accident and is subset of
the cfi(4) driver.  It remained in the tree longer than would be ideal
due to the time required to bring cfi(4) to feature parity.

Sponsored by: DARPA/AFRL
MFC after: 3 days

10 years agoMake hard-wired TLB allocations be at minimum one page. This is required by
Nathan Whitehorn [Mon, 21 Oct 2013 22:25:54 +0000 (22:25 +0000)]
Make hard-wired TLB allocations be at minimum one page. This is required by
some implementations, most notably (in my case) QEMU's e500 emulation.

10 years agoAdd comments that taskqueue_enqueue_locked() returns without the lock.
Alexander Motin [Mon, 21 Oct 2013 21:16:50 +0000 (21:16 +0000)]
Add comments that taskqueue_enqueue_locked() returns without the lock.

10 years agoMFP4: 223121 (FDT infrastructure portion)
Brooks Davis [Mon, 21 Oct 2013 21:13:01 +0000 (21:13 +0000)]
MFP4: 223121 (FDT infrastructure portion)

Implement support for interrupt-parent nodes in simplebus.  The current
implementation requires that device declarations have an interrupt-parent
node and that it point to a device that has registered itself as a
interrupt controller in fdt_ic_list_head and implements the fdt_ic
interface.

Sponsored by:   DARPA/AFRL

10 years agoAllow kernels without options SOFTUPDATES to build. This should fix the
Brooks Davis [Mon, 21 Oct 2013 20:51:08 +0000 (20:51 +0000)]
Allow kernels without options SOFTUPDATES to build.  This should fix the
embedded tinderboxes.

Reviewed by: emaste

10 years agoDon't force 64-bit DWARF2 on MIPS
Ed Maste [Mon, 21 Oct 2013 20:38:02 +0000 (20:38 +0000)]
Don't force 64-bit DWARF2 on MIPS

64-bit debug data is only necessary for objects with greater than 4GB of
debug data, and is not used on other 64-bit FreeBSD targets.

Sponsored by: DARPA, AFRL

10 years agoUse standard ofw_bus helpers instead of reinventing the wheel.
Nathan Whitehorn [Mon, 21 Oct 2013 18:47:02 +0000 (18:47 +0000)]
Use standard ofw_bus helpers instead of reinventing the wheel.

10 years agoAdd a resource limit for the total number of kqueues available to the
Konstantin Belousov [Mon, 21 Oct 2013 16:46:12 +0000 (16:46 +0000)]
Add a resource limit for the total number of kqueues available to the
user.  Kqueue now saves the ucred of the allocating thread, to
correctly decrement the counter on close.

Under some specific and not real-world use scenario for kqueue, it is
possible for the kqueues to consume memory proportional to the square
of the number of the filedescriptors available to the process.  Limit
allows administrator to prevent the abuse.

This is kernel-mode side of the change, with the user-mode enabling
commit following.

Reported and tested by: pho
Discussed with: jmg
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoAdd a resource limit for the total number of kqueues available to the
Konstantin Belousov [Mon, 21 Oct 2013 16:44:53 +0000 (16:44 +0000)]
Add a resource limit for the total number of kqueues available to the
user.  Kqueue now saves the ucred of the allocating thread, to
correctly decrement the counter on close.

Under some specific and not real-world use scenario for kqueue, it is
possible for the kqueues to consume memory proportional to the square
of the number of the filedescriptors available to the process.  Limit
allows administrator to prevent the abuse.

This is kernel-mode side of the change, with the user-mode enabling
commit following.

Reported and tested by: pho
Discussed with: jmg
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoReset function on SandyBridge holds the gt_lock for the whole duration
Konstantin Belousov [Mon, 21 Oct 2013 16:22:51 +0000 (16:22 +0000)]
Reset function on SandyBridge holds the gt_lock for the whole duration
already.  Also, according to the specs, GDRST register is not in the
power well, so the forcewake for reset status read is excessive for
this reason.

Use plain register read for waiting of the reset completion
notification, to avoid gt_lock recursion.  Linux upstream did the
similar change, but their code was already restructured.

Reported by: ray
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoPrint more useful information about the transfer that trigger the assertion.
Konstantin Belousov [Mon, 21 Oct 2013 16:17:46 +0000 (16:17 +0000)]
Print more useful information about the transfer that trigger the assertion.
Other data is available with ddb command 'show pginfo'.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoProvide an interface for PCI bus drivers that need some of ofw_pci's
Nathan Whitehorn [Mon, 21 Oct 2013 13:57:34 +0000 (13:57 +0000)]
Provide an interface for PCI bus drivers that need some of ofw_pci's
metadata during attach.

10 years agoFix build problem on ARM (which defaults to building without soft updates).
Kirk McKusick [Mon, 21 Oct 2013 13:09:09 +0000 (13:09 +0000)]
Fix build problem on ARM (which defaults to building without soft updates).

Reported by:  Tinderbox
Sponsored by: Netflix

10 years agoMerge CAM locking changes from the projects/camlock branch to radically
Alexander Motin [Mon, 21 Oct 2013 12:00:26 +0000 (12:00 +0000)]
Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

Replace big per-SIM locks with bunch of smaller ones:
 - per-LUN locks to protect device and peripheral drivers state;
 - per-target locks to protect list of LUNs on target;
 - per-bus locks to protect reference counting;
 - per-send queue locks to protect queue of CCBs to be sent;
 - per-done queue locks to protect queue of completed CCBs;
 - remaining per-SIM locks now protect only HBA driver internals.

While holding LUN lock it is allowed (while not recommended for performance
reasons) to take SIM lock.  The opposite acquisition order is forbidden.
All the other locks are leaf locks, that can be taken anywhere, but should
not be cascaded.  Many functions, such as: xpt_action(), xpt_done(),
xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM
lock to be held.

To keep compatibility and solve cases where SIM lock can't be dropped, all
xpt_async() calls in addition to xpt_done() calls are queued to completion
threads for async processing in clean environment without SIM lock held.

Instead of single CAM SWI thread, used for commands completion processing
before, use multiple (depending on number of CPUs) threads.  Load balanced
between them using "hash" of the device B:T:L address.

HBA drivers that can drop SIM lock during completion processing and have
sufficient number of completion threads to efficiently scale to multiple
CPUs can use new function xpt_done_direct() to avoid extra context switch.
Make ahci(4) driver to use this mechanism depending on hardware setup.

Sponsored by: iXsystems, Inc.
MFC after: 2 months

10 years agoFix 'make delete-old-libs' and 'make check-libs' to delete .debug
Bryan Drewery [Mon, 21 Oct 2013 10:09:48 +0000 (10:09 +0000)]
Fix 'make delete-old-libs' and 'make check-libs' to delete .debug
files created by WITH_DEBUG_FILES. Also cleanup .symbols files from
the period between r244236 when .symbols were supported and r251512
when they were renamed to .debug.

Only propose to delete a .debug file if the corresponding library
itself was deleted already.

Reported by: des
Reviewed by: emaste (earlier version)
Approved by: bapt
MFC after: 3 days

10 years agoMove and rename dwc otg driver to more
Ganbold Tsagaankhuu [Mon, 21 Oct 2013 09:34:04 +0000 (09:34 +0000)]
Move and rename dwc otg driver to more
generic one as it appears to work
for rk3188 SoC based board too.

No objections from: hselasky@
Reviewed by: ray@

10 years agoDon't test arrays for being NULL.
Edward Tomasz Napierala [Mon, 21 Oct 2013 09:12:04 +0000 (09:12 +0000)]
Don't test arrays for being NULL.

MFC after: 1 month

10 years agoMFprojects/camlock:
Alexander Motin [Mon, 21 Oct 2013 08:57:27 +0000 (08:57 +0000)]
MFprojects/camlock:
Remove hard limit on number of BIOs handled with one ATA TRIM request.

10 years ago- Fix jail_parallel_start="YES".
Hiroki Sato [Mon, 21 Oct 2013 08:49:46 +0000 (08:49 +0000)]
- Fix jail_parallel_start="YES".
- Fix ip[46].addr when interface parameter is not defined.

Spotted by: rpaulo

10 years agoDrop cm_lock before calling mapper_close, which in turn could call
Xin LI [Mon, 21 Oct 2013 07:58:37 +0000 (07:58 +0000)]
Drop cm_lock before calling mapper_close, which in turn could call
_citrus_mapper_close again and result in a deadlock otherwise.

This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file).

PR: bin/182994
Submitted by: Fabian Keil <fk fabiankeil de>
MFC after: 3 days

10 years agoAdd a note that lacp_compose_key() should be updated, when new media
Andrey V. Elsukov [Mon, 21 Oct 2013 07:49:36 +0000 (07:49 +0000)]
Add a note that lacp_compose_key() should be updated, when new media
types will be added.

Submitted by: melifaro
X-MFC after: r256689

10 years agoMFprojects/camlock r256619:
Alexander Motin [Mon, 21 Oct 2013 06:44:55 +0000 (06:44 +0000)]
MFprojects/camlock r256619:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer.  That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

Move mapping removal before calling bio_done() method.  I believe that it is
very wrong to do anything to BIO after reporting completion.  kib@ thinks
it was done for some forgotten now case when bio_done() method needed mapped
buffer. But 1) if BIO was sent as unmapped, then IMO done() should be called
in the same way; 2) IMO there is no guatantee that buffer will be mapped at
this point at all, for example, if all underlying stack supports unmapped
I/O, so bio_done() handler can not expect that.

10 years agoAdd preliminary support for RTL8106E PCIe FastEthernet.
Pyun YongHyeon [Mon, 21 Oct 2013 06:27:20 +0000 (06:27 +0000)]
Add preliminary support for RTL8106E PCIe FastEthernet.

H/W donated by: RealTek Semiconductor Corp.

10 years agoCorrect MAC revision bits. Previously it always cleared bit 20 and
Pyun YongHyeon [Mon, 21 Oct 2013 06:22:20 +0000 (06:22 +0000)]
Correct MAC revision bits. Previously it always cleared bit 20 and
bit 21.

10 years agoPartial MFproject/camlock r256671:
Alexander Motin [Mon, 21 Oct 2013 06:04:39 +0000 (06:04 +0000)]
Partial MFproject/camlock r256671:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.

10 years agoProvide a working example line for an interface with 1 address running
Gleb Smirnoff [Mon, 21 Oct 2013 05:14:00 +0000 (05:14 +0000)]
Provide a working example line for an interface with 1 address running
with CARP.

Currently, we've got a problem that interface isn't IFF_UP at the time
we assign it a redundant address, and the latter gets stuck in INIT state.
Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state.

A proper fix is kernel side and appeared to be non-trivial, not to be
checked in before 10.0-RELEASE.

Submitted by: Ole Myhre <ole.myhre dataoppdrag.no>

10 years agoUpdate jemalloc to version 3.4.1.
Jason Evans [Mon, 21 Oct 2013 05:10:46 +0000 (05:10 +0000)]
Update jemalloc to version 3.4.1.

10 years agoWhen fetching function arguments out of a frame on amd64, explicitly select
Mark Johnston [Mon, 21 Oct 2013 04:15:55 +0000 (04:15 +0000)]
When fetching function arguments out of a frame on amd64, explicitly select
the register based on the argument index rather than relying on the fields
in struct reg to be in the right order. This assumption is incorrect on
FreeBSD and generally led to bogus argument values for the sixth argument
of PID and USDT probes; the first five are passed directly to dtrace_probe()
via the fasttrap trap handler and so were correctly handled.

MFC after: 2 weeks

10 years agoFix 80-column line wrapping in a comment.
Nathan Whitehorn [Mon, 21 Oct 2013 00:58:35 +0000 (00:58 +0000)]
Fix 80-column line wrapping in a comment.

10 years agoRestructuring of the soft updates code to set it up so that the
Kirk McKusick [Mon, 21 Oct 2013 00:28:02 +0000 (00:28 +0000)]
Restructuring of the soft updates code to set it up so that the
single kernel-wide soft update lock can be replaced with a
per-filesystem soft-updates lock. This per-filesystem lock will
allow each filesystem to have its own soft-updates flushing thread
rather than being limited to a single soft-updates flushing thread
for the entire kernel.

Move soft update variables out of the ufsmount structure and into
their own mount_softdeps structure referenced by ufsmount field
um_softdep.  Eventually the per-filesystem lock will be in this
structure. For now there is simply a pointer to the kernel-wide
soft updates lock.

Change all instances of ACQUIRE_LOCK and FREE_LOCK to pass the lock
pointer in the mount_softdeps structure instead of a pointer to the
kernel-wide soft-updates lock.

Replace the five hash tables used by soft updates with per-filesystem
copies of these tables allocated in the mount_softdeps structure.

Several functions that flush dependencies when too many are allocated
in the kernel used to operate across all filesystems. They are now
parameterized to flush dependencies from a specified filesystem.
For now, we stick with the round-robin flushing strategy when the
kernel as a whole has too many dependencies allocated.

While there are many lines of changes, there should be no functional
change in the operation of soft updates.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

10 years agoAllow the OFW interrupt mapping code to work with PCI devices not enumerated
Nathan Whitehorn [Mon, 21 Oct 2013 00:04:26 +0000 (00:04 +0000)]
Allow the OFW interrupt mapping code to work with PCI devices not enumerated
by Open Firmware, as in the case of FDT.

10 years agoCalculate the baud rate divisor rather than using a hard-coded value.
Ian Lepore [Sun, 20 Oct 2013 23:40:16 +0000 (23:40 +0000)]
Calculate the baud rate divisor rather than using a hard-coded value.

Submitted by: Steven Lawrance <stl@koffein.net>

10 years agoAvoid sign overflow if there are more than 2 GB of RAM.
Nathan Whitehorn [Sun, 20 Oct 2013 23:02:16 +0000 (23:02 +0000)]
Avoid sign overflow if there are more than 2 GB of RAM.

10 years agoThe Xen userland event channel driver isn't complete. Disabled it
Justin T. Gibbs [Sun, 20 Oct 2013 22:50:57 +0000 (22:50 +0000)]
The Xen userland event channel driver isn't complete.  Disabled it
from the kernel build until it is ready.

sys/conf/files:
Remove the entry for xen/evtchn/evtchn_dev.c so it is not included
in any kernel builds.

Noticed by: smh

10 years agoFourth of several cleanups to soft dependency implementation.
Kirk McKusick [Sun, 20 Oct 2013 22:21:01 +0000 (22:21 +0000)]
Fourth of several cleanups to soft dependency implementation.
Add KASSERTS that soft dependency functions only get called
for filesystems running with soft dependencies. Calling these
functions when soft updates are not compiled into the system
become panic's.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

10 years agoAdd configuration for the Freescale i.MX53 Quick Start Board.
Ian Lepore [Sun, 20 Oct 2013 21:21:07 +0000 (21:21 +0000)]
Add configuration for the Freescale i.MX53 Quick Start Board.

10 years agoThird of several cleanups to soft dependency implementation.
Kirk McKusick [Sun, 20 Oct 2013 21:11:40 +0000 (21:11 +0000)]
Third of several cleanups to soft dependency implementation.
Ensure that softdep_unmount() and softdep_setup_sbupdate()
only get called for filesystems running with soft dependencies.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

10 years agoAdd a driver for the Freescale Fast Ethernet Controller found on various
Ian Lepore [Sun, 20 Oct 2013 21:07:38 +0000 (21:07 +0000)]
Add a driver for the Freescale Fast Ethernet Controller found on various
Freescale SoCs including the i.MX series.  This also works for the newer
SoCs with the ENET gigabit controller, but doesn't use any of the new
hardware features other than enabling gigabit speed.

10 years agosyslog: Use SOCK_CLOEXEC instead of separate fcntl() call.
Jilles Tjoelker [Sun, 20 Oct 2013 21:04:44 +0000 (21:04 +0000)]
syslog: Use SOCK_CLOEXEC instead of separate fcntl() call.

10 years agoSwitch to using the standard uart console driver instead of the special
Ian Lepore [Sun, 20 Oct 2013 21:03:15 +0000 (21:03 +0000)]
Switch to using the standard uart console driver instead of the special
driver for early boot debugging.

10 years agoSecond of several cleanups to soft dependency implementation.
Kirk McKusick [Sun, 20 Oct 2013 20:52:07 +0000 (20:52 +0000)]
Second of several cleanups to soft dependency implementation.
Delete two unused functions in ffs_sofdep.c.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

10 years agopopen(): Try to prevent inappropriate fd passing even if 'e' is not used.
Jilles Tjoelker [Sun, 20 Oct 2013 20:50:17 +0000 (20:50 +0000)]
popen(): Try to prevent inappropriate fd passing even if 'e' is not used.

Even though not all race conditions can be fixed if the 'e' option is not
used, still fix some race conditions using pipe2():

* Prevent both ends of the pipe from leaking to a concurrent popen().

* Prevent the child process's end of the pipe from leaking to any concurrent
  fork and exec.

This change also simplifies the code.

10 years agoFirst of several cleanups to soft dependency implementation.
Kirk McKusick [Sun, 20 Oct 2013 20:41:38 +0000 (20:41 +0000)]
First of several cleanups to soft dependency implementation.
Convert three functions exported from ffs_softdep.c to static
functions as they are not used outside of ffs_softdep.c.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

10 years agopathchk: Ensure bytes >= 128 are considered non-portable characters.
Jilles Tjoelker [Sun, 20 Oct 2013 20:10:31 +0000 (20:10 +0000)]
pathchk: Ensure bytes >= 128 are considered non-portable characters.

This was not broken on architectures such as ARM where char is unsigned.

Also, remove the first non-portable character from the output. POSIX does
not require this, and printing the first byte may yield an invalid byte
sequence with UTF-8.

PR: bin/165988
Reported by: Nicolas Rachinsky

10 years agoSince the PS3 port was committed, the AIM nexus device works perfectly fine
Nathan Whitehorn [Sun, 20 Oct 2013 18:40:55 +0000 (18:40 +0000)]
Since the PS3 port was committed, the AIM nexus device works perfectly fine
on all PowerPC platforms, whether or not they have Open Firmware. Remove
some more duplication and have there be only one nexus driver.

10 years agoSome nexus devices add wildcard children. Since fdtbus_probe returned
Nathan Whitehorn [Sun, 20 Oct 2013 18:38:19 +0000 (18:38 +0000)]
Some nexus devices add wildcard children. Since fdtbus_probe returned
BUS_PROBE_DEFAULT, it would attach to them all, producing both many
fdtbus instances and preventing other devices from attaching. Instead
return BUS_PROBE_NOWILDCARD, which exists for exactly this purpose.

10 years agoReplace the two almost-exactly-identical AIM and Book-E clock.c
Nathan Whitehorn [Sun, 20 Oct 2013 16:37:03 +0000 (16:37 +0000)]
Replace the two almost-exactly-identical AIM and Book-E clock.c
implementations with a single one after the application of a very small
amount of #ifdef.

10 years agoUnify the AIM and Book-E vm_machdep.c implementations, which previously
Nathan Whitehorn [Sun, 20 Oct 2013 16:14:03 +0000 (16:14 +0000)]
Unify the AIM and Book-E vm_machdep.c implementations, which previously
differed only with respect to the AIM version not following style(9) and
some additional features for 64-bit systems and machines with direct maps
in the AIM implementation that are no-ops on Book-E (at least for now).

10 years agoMerge from projects/arm_eabi_vfp r255380:
Andrew Turner [Sun, 20 Oct 2013 15:13:32 +0000 (15:13 +0000)]
Merge from projects/arm_eabi_vfp r255380:

Fix the VCVT instruction. It must round towards zero when converting from
a floating-point to an integer value. This was not the case causing issues
when printing certain values.

There is a VCVTR instruction that will round depending on the current
rounding mode. We don't yet support this instruction, or setting the
rounding mode.

10 years agoAdd multicast filter control.
Nathan Whitehorn [Sun, 20 Oct 2013 14:01:09 +0000 (14:01 +0000)]
Add multicast filter control.

10 years agoAdd more obsolete files
Antoine Brodin [Sun, 20 Oct 2013 13:41:42 +0000 (13:41 +0000)]
Add more obsolete files

10 years agoAdd 26 new device IDs to uslcom(4). This brings us in sync with Linux
Gavin Atkinson [Sun, 20 Oct 2013 11:19:37 +0000 (11:19 +0000)]
Add 26 new device IDs to uslcom(4).  This brings us in sync with Linux
v3.12 rc5.

MFC after: 3 days

10 years agoClean up some debug code that snuck in. Add a block comment on future work.
Nathan Whitehorn [Sun, 20 Oct 2013 01:40:59 +0000 (01:40 +0000)]
Clean up some debug code that snuck in. Add a block comment on future work.

10 years agoAdd initial driver for POWER hypervisor interpartition ethernet. This is
Nathan Whitehorn [Sun, 20 Oct 2013 01:31:09 +0000 (01:31 +0000)]
Add initial driver for POWER hypervisor interpartition ethernet. This is
sufficient to pass traffic but needs some more work before merging to
STABLE.

10 years agoAllow hypervisor calls with more than 7 arguments.
Nathan Whitehorn [Sun, 20 Oct 2013 01:28:39 +0000 (01:28 +0000)]
Allow hypervisor calls with more than 7 arguments.

10 years agoBump __FreeBSD_version to 1100001 for addition of support for "first boot"
Colin Percival [Sat, 19 Oct 2013 21:55:42 +0000 (21:55 +0000)]
Bump __FreeBSD_version to 1100001 for addition of support for "first boot"
rc.d scripts, so that ports can make use of this.

10 years agoAdd support for "first boot" rc.d scripts. [1]
Colin Percival [Sat, 19 Oct 2013 21:37:06 +0000 (21:37 +0000)]
Add support for "first boot" rc.d scripts. [1]

These scripts, containing
# KEYWORD: firstboot
will only be run if a sentinel file (default: /firstboot, configurable
via the rc.conf ${firstboot_sentinel} variable) exists; this sentinel
file will be deleted at the end of the boot process.

Scripts can request that the system reboot after the first boot by
creating the file ${firstboot_sentinel}-reboot.

This functionality is expected to be useful for embedded systems and
virtual machine images, where it may be desirable to
(a) download and install updates which became available between when
the image was created and when it was "turned on";
(b) download and install packages which may be newer than those
which were available when the image was created;
(c) install packages which run binaries during their install process,
bypassing the problem of cross-architecture installs;
(d) resize filesystems to match the disk onto which a VM image was
installed;
(e) perform initialization tasks relevant to cloud systems (e.g.,
Amazon's Elastic Compute Cloud);
and likely to perform many other one-time initialization functions.

Document this new functionality in rc.conf(5) and rc(8). [2]

Reviewed by: freebsd-current, freebsd-rc [1]
Reviewed by: Warren Block [2]
MFC after: 3 days

10 years agoClock divisors 0-3 correspond to dividing by 1-4, so add 1 before dividing.
Ian Lepore [Sat, 19 Oct 2013 21:33:06 +0000 (21:33 +0000)]
Clock divisors 0-3 correspond to dividing by 1-4, so add 1 before dividing.

10 years agoEnable the automatic creation of a certificate (if one does not exists)
John-Mark Gurney [Sat, 19 Oct 2013 18:51:06 +0000 (18:51 +0000)]
Enable the automatic creation of a certificate (if one does not exists)
and enable the usage by sendmail if sendmail is enabled.  Include and
document knobs to disable this feature and also set the Common Name of
the certificate created.

As the certificate is signed w/ a discarded key, it only helps prevent
Eve, but not Malory from knowing the contents of the emails.

This means that new installs (and people that use the updated freebsd.mc
file) will automaticly have STARTTLS enabled allowing incoming email to
be encrypted in most cases.

Reviewed by: gshapiro
MFC after: 3 days
Security: Yes, please.

10 years ago- Add parentheses to all internet addresses
Kevin Lo [Sat, 19 Oct 2013 18:13:32 +0000 (18:13 +0000)]
- Add parentheses to all internet addresses
- All the casts to uint32_t should be to in_addr_t

Suggested by: bde
Reviewed by: bde

10 years agodrm/radeon: radeonkms depends on firmware(9)
Jean-Sébastien Pédron [Sat, 19 Oct 2013 17:11:58 +0000 (17:11 +0000)]
drm/radeon: radeonkms depends on firmware(9)

Submitted by: tijl@

10 years agoImprove bootstrapping message
Gavin Atkinson [Sat, 19 Oct 2013 15:36:21 +0000 (15:36 +0000)]
Improve bootstrapping message

MFC after: 3 days