Commit Graph

99660 Commits

Author SHA1 Message Date
avg
9446d15bf5 MFC r258634: MFV r258376: 3964 L2ARC should always compress metadata buffers 2014-01-16 16:07:59 +00:00
avg
926bf5d727 MFC r258633: MFV r255256: 3954 metaslabs continue to load even after
hitting zfs_mg_alloc_failure limit
2014-01-16 16:05:21 +00:00
avg
26096ba436 MFC r258632,258704: MFV r255255: 4045 zfs write throttle & i/o scheduler
performance work

Sponsored by:	HybridCluster [merge]
2014-01-16 15:57:39 +00:00
avg
81894fb568 MFC r258631: MFV r247578
3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
2014-01-16 14:47:29 +00:00
avg
df666f4c3e MFC r258743: drop ZUT_OBJ 2014-01-16 14:37:31 +00:00
avg
a4ee4e9fb0 MFC r258630: 734 taskq_dispatch_prealloc() desired 2014-01-16 14:34:53 +00:00
avg
16f4d5cb30 MFC r258628: opensolaris taskq: some cosmetic changes 2014-01-16 14:30:26 +00:00
avg
564d281d6a MFC r258648: use saner calculations in should_yield 2014-01-16 14:27:20 +00:00
avg
2a24dbf417 MFC r258638,258642: expose zfs_flags as debug.zfs_flags r/w tunable and sysctl
Sponsored by:	HybridCluster
2014-01-16 14:21:24 +00:00
avg
903d9c4e01 MFC r258354: taskqueue_cancel: garbage collect a write-only variable 2014-01-16 14:11:45 +00:00
ae
7c65e72b87 MFC r260481:
Add MRT6_DLOG() macro for debugging.
  Reduce number of MRT6DEBUG ifdefs and fix some broken format strings.
2014-01-16 13:21:32 +00:00
jhibbits
0920d1cd65 MFC r259284,r259287
Add PMU-based CPU frequency scalling.  This is used on most Titanium
PowerBooks.
2014-01-15 06:17:15 +00:00
jhibbits
876be05179 MFC r259082
Make some unsigned ints signed.

Found by:	clang (powerpc64)
2014-01-15 05:52:06 +00:00
jhibbits
18daeaf646 MFC r257941,r258119
Add the necessary bits for dumps on ppc64.
2014-01-15 05:41:28 +00:00
jhibbits
b1391adbae MFC r256543,r259245,r259421,r259668,r259674
r256543:

Add fasttrap for PowerPC.  This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.

r259245,r259421: (FBT)

FBT now does work fully on PowerPC.

Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return.  This caused it to panic on my ppc32 machine.

r259668,r259674:
Fix a typo in the FBT code.
2014-01-15 05:19:37 +00:00
jhibbits
44cab258a2 MFC r259394,r259395,r259699
r259394:
Rebase the PMC indices at 1, since PMC_SOFT is at 0.

r259395,r259699:
Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.
2014-01-15 04:44:52 +00:00
jhibbits
541949d319 MFC r256542,r256581
Move the PMC handling to the first level interrupt handler where it belongs.
Also add the pmc_hook use, to handle callchain tracing.
2014-01-15 04:16:45 +00:00
pfg
b405aa87ad MFC r260545:
ext2fs: fix inode flag conversion.

After r252890 we are naively attempting to pass through the
inode flags.  This is technically incorrect as the ext2
inode flags don't match the UFS/system values used in
FreeBSD and a clean conversion is needed.

Some filtering was left in place so the change didn't cause
significant changes in FreeBSD but some of the garbage passed
is likely to be the cause for warning messages in linux.

Fix the issue by resetting the flags before conversion as was
done previously. This also means we will not pass the EXT4_*
inode flags into FreeBSD's inode.

PR:		kern/185448
2014-01-14 15:20:33 +00:00
mav
204096a62c MFC r260541, r260547:
Take additional reference on SCSI probe periph to cover its freeze count.

Otherwise periph may be invalidated and freed before single-stepping freeze
is dropped, causing use after free panic.
2014-01-14 12:01:36 +00:00
delphij
139f0a076d MFC r259811:
MFV r258373:

4168 ztest assertion failure in dbuf_undirty

4169 verbatim import causes zdb to segfa
4170 zhack leaves pool in ACTIVE state

illumos/illumos-gate@7fdd916c47
2014-01-14 01:28:08 +00:00
delphij
d17709df94 MFC r260110:
Eliminate unused drbr_stats_update implementation in oce(4) driver.

Noticed by:	dim
2014-01-13 19:34:23 +00:00
dim
efe1ed4163 MFC r260494:
Fix a braino with r259730: we cannot currently use CFLAGS.gcc or
CFLAGS.clang in sys/conf/Makefile.arm, since the main kernel build does
not use <bsd.sys.mk>.  So revert that particular change for now.

Pointy hat to:	me
Noticed by:	zbb
2014-01-12 14:37:39 +00:00
hselasky
2d29b474fb MFC r260184:
Minor correction for the XHCI reset logic.
2014-01-11 08:21:13 +00:00
asomers
d1a85fc0d9 MFC 259240
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
        When a da or ada device dissappears, outstanding IOs fail with
        ENXIO, not EIO.  The check for EIO was probably copied from Illumos,
        where that is indeed the correct errno.

        Without this change, pulling a busy drive from a zpool would usually
        turn it into UNAVAIL, even though pulling an idle drive would turn
        it into REMOVED.  With this change, it is REMOVED every time.

        Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that
        results in devd getting two resource.fs.zfs.removed events.  The
        comment said that the event had to be sent directly instead of
        through the async removal thread because "the DE engine is using
        this information to discard prevoius I/O errors".  However, the fact
        that vdev_geom_io_intr was never actually sending the events until
        now, and that vdev_geom_orphan never sent them at all, and that
        vdev_geom_orphan usually gets called about 2 seconds after the
        actual removal, means that FreeBSD's userland can cope with a late
        event just fine.
2014-01-10 16:56:59 +00:00
ae
65169ca8a0 MFC r260151 (by adrian):
Use an RLOCK here instead of an RWLOCK - matching all the other calls
  to lla_lookup().

  This drastically reduces the very high lock contention when doing parallel
  TCP throughput tests (> 1024 sockets) with IPv6.

MFC r260187:
  lla_lookup() does modification only when LLE_CREATE is specified.
  Thus we can use IF_AFDATA_RLOCK() instead of IF_AFDATA_LOCK() when doing
  lla_lookup() without LLE_CREATE flag.

MFC r260217:
  Add IF_AFDATA_WLOCK_ASSERT() in case lla_lookup() is called with
  LLE_CREATE flag.
2014-01-10 09:45:28 +00:00
ae
2865f87f4a MFC r259634:
Prevent users from deactivating the last component of a mirror.

MFC r259929:
  Add an ability to stop gmirror and clear its metadata in one command.
  This fixes the problem, when gmirror starts again just after stop.

  The problem occurs when gmirror's component has geom label with equal size.
  E.g. gpt and gptid have the same size as partition, diskid has the same
  size as entire disk. When gmirror's geom has been destroyed, glabel
  creates its providers and this initiate retaste.

  Now "gmirror destroy" command is available. It destroys geom and also
  erases gmirror's metadata.

PR:		184985
2014-01-10 07:48:36 +00:00
ae
5308ec5802 MFC r258357:
Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
  Now it is easy to expand the size of the mirror when all its components
  are replaced. Also add g_resize method to geom_mirror class. It will write
  updated metadata to new last sector, when parent provider is resized.
2014-01-10 07:43:40 +00:00
dim
01c13c7d48 MFC r260334:
Split the last gcc-specific flags off into CFLAGS.gcc.  This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC r260369:

Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios.  Sorry about the breakage.
2014-01-09 23:08:56 +00:00
dim
999774a8ef MFC r260102:
Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile.  Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.

MFC r260322:

In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk,
since kernel module builds do not use kern.pre.mk.
2014-01-09 22:40:51 +00:00
loos
837513035e MFC r257064:
Add an OFW SPI compatible bus.  Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by:	ray
Approved by:	adrian (mentor)
2014-01-09 18:28:58 +00:00
mav
263d261fe5 MFC r258683:
Escape special XML chars, returned by some devices, confusing XML parsers.
2014-01-09 11:13:03 +00:00
mav
3b6d8c3206 MFC r258220, r258251:
Implement automatic live resize support for GEOM MULTIPATH class.

In "manual" mode just automatically resize provider in any direction.
In "automatic" mode allow growth (with new metadata write); in case of
shrinking check if there is already valid metadata found at the new
location.  This should allow easy transparent recovery if first resize
was done by mistake.

While there, unify metadata write code and fix minor memory leak.
2014-01-09 11:11:47 +00:00
mav
f9a52747b5 MFC r257946:
Introduce seperate mutex lock to protect protect CTL I/O pools, slightly
reducing global CTL lock scope and congestion.

While there, simplify CTL I/O pools KPI, hiding implementation details.
2014-01-09 10:59:31 +00:00
mav
2886802896 MFC r256995:
Remove 128KB bzero() call done for every block I/O data buffer.
2014-01-09 10:50:20 +00:00
mav
2e2af5808b MFC r256547 (by smh):
Added 4K quirks for Corsair Neutron GTX SSD's
2014-01-09 10:49:14 +00:00
mav
211b1cf423 MFC r259197:
Do not DELAY() for P-state transition unless we want to see the result.

Intel manual says: "If a transition is already in progress, transition to
a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
the last targeted operating point."  So seems it should be fine to just
trigger wanted transition and go.  Linux does the same.
2014-01-09 10:44:27 +00:00
kib
dd0e0d7345 MFC r260205:
Update the description for pmap_remove_pages() to match the modern
times.  Assert that the pmap passed to pmap_remove_pages() is only
active on current CPU.
2014-01-09 03:32:03 +00:00
kib
a3d28139be MFC r260204:
Assert that accounting for the pmap resident pages does not underflow.
2014-01-09 03:24:36 +00:00
peter
aa3916c7c0 Revert MFC of r258821 - it was already handled by MFC of r239672.
Pointy hat to: peter
2014-01-08 03:16:21 +00:00
cperciva
5190528326 MFC r258893, r258956:
Add a new sysctl / loader tunable kern.panic_reboot_wait_time which
  defaults to PANIC_REBOOT_WAIT_TIME (a long-existing kernel config
  setting).  Use this now-variable value in place of the defined constant
  to control how long the system waits after a panic before rebooting.
2014-01-08 02:19:39 +00:00
tuexen
624cda0839 MFC r259943:
Address some warnings which showed up on the userland version.
2014-01-07 23:50:02 +00:00
peter
16f467cacd MFC r258821 - fix tcp simultaneous close
PR:		kern/99188
2014-01-07 23:00:58 +00:00
edavis
be72cc4373 Merged r260415 from head.
Approved by:	davidch
2014-01-07 22:59:33 +00:00
pjd
9a40d227b3 MFC r260290:
Bring back the old size of the kinfo_file structure to preserve ABI.
Keep only one uint64_t spare for further cap_rights_t expension.

Add a comment clarifying that if the size of this structure changes,
a new sysctl MIB has to be allocate for it and the old structure has
to be returned by the old sysctl MIB.

Requested by:   re
2014-01-07 19:46:17 +00:00
mjg
759bcf6814 MFC r260232:
Don't check for fd limits in fdgrowtable_exp.

Callers do that already and additional check races with process
decreasing limits and can result in not growing the table at all, which
is currently not handled.
2014-01-07 19:28:10 +00:00
scottl
cd4455d638 MFC Alexander Motin's direct dispatch, multi-queue, and finer-grained
locking support for CAM

r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.

r256836:
Remove hard limit on number of BIOs handled with one ATA TRIM request.

r256843:
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.

r256888:
Unconditionally acquire periph reference on CCB allocation failure.

r256895:
Fix memory and references leak due to unfreed path.

r256960:
Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
This fixes race condition with cam_periph_ccbwait(), causing use-after-free.

r256975:
Minor (mostly cosmetical) addition to r256960.

r257054:
Some microoptimizations for da and ada drivers:
 - Replace ordered_tag_count counter with single flag;
 - From da remove outstanding_cmds counter, duplicating pending_ccbs list;
 - From da_softc remove unused links field.

r257482:
Fix lock recursion, triggered by `smartctl -a /dev/adaX`.

r257501:
Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment.  getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.

r257914:
Some CAM locks polishing:
 - Fix LOR and possible lock recursion when handling high-power commands.
Introduce new lock to protect left power quota and list of frozen devices.
 - Correct locking around xpt periph creation.
 - Remove seems never used XPT_FLAG_OPEN xpt periph flag.

Again, Netflix assisted with testing the merge, but all of the credit goes
to Alexander and iX Systems.

Submitted by:	mav
Sponsored by:	iX Systems
2014-01-07 01:51:48 +00:00
scottl
0a34594b9c MFC Alexander Motin's GEOM direct dispatch work:
r256603:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time.  Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

r256607:
Fix passing uninitialized bio_resid argument to g_trace().

r256610:
Add unmapped I/O support to GEOM RAID.

r256830:
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).

r256880:
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.

r259247:
Fix bug introduced at r256607.  We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Testing of the stable/10 merge was done by Netflix, but all of the credit
goes to Alexander and iX Systems.

Submitted by:   mav
Sponsored by:   iX Systems
2014-01-07 01:32:23 +00:00
mav
1bce546983 MFC r256885:
Remove global device lock acquisition from dev_relthread(), replacing it
with atomics on per-device data.
2014-01-05 23:02:03 +00:00
mav
4fb4fef0e1 MFC r256614:
- Take BIO lock in biodone() only when there is no completion callback set
and so we should wake up thread waiting in biowait().
 - Remove msleep() timeout from biowait().  It was added 11 years ago, when
there was no locks used, and it should not be needed any more.
2014-01-05 23:00:38 +00:00
mav
3dd7b80d9a MFC r258173:
Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal.
2014-01-05 22:55:21 +00:00
mav
75eb8161f4 MFC r258169:
Add ID for Intel Avoton SMBus controller.
2014-01-05 22:53:55 +00:00
mav
2ab2b6ae11 MFC r258168, r258170:
Add some more Intel HDA controller and CODEC IDs.
2014-01-05 22:52:59 +00:00
mav
51a1cf7d15 MFC r258164:
Handle case when ACPI reports HPET device, but does not provide memory
resource for it.  In such case take the address range from the HPET table.

This fixes hpet(4) driver attach on Asrock C2750D4I board.
2014-01-05 22:51:09 +00:00
mav
59357c8a6d MFC r258162:
Add some more IDs for Intel ATA, AHCI and USB controllers.
2014-01-05 22:49:54 +00:00
mav
d0f66a4aef MFC r257932:
Use relaxed (write-only) memory barriers when writing some of queue index
registers (for now on ISP2400+).  We never read those registers back and
AFAIK their semantics does not require any immediate reaction on write.
2014-01-05 22:48:12 +00:00
mav
67d4b65ac1 MFC r257930:
Some more registers access optimizations:
 - Process ATIO queue only if interrupt status tells so;
 - Do not update queue out pointers after each processed command, do it
only once at the end of the loop.
2014-01-05 22:47:12 +00:00
mav
116abbfd1f MFC r257916:
Save one more register read per command by not reading rqstoutrp register
every time.  The purpose of that register is unlikely output queue overflow
detection, so read it only when its last known (and probably stale now)
value signals overflow.
2014-01-05 22:45:46 +00:00
mav
2ef8e6e39b MFC r256893:
Fix memory and references leak due to unfreed path.

Coverity CID:   1109815
2014-01-05 22:43:40 +00:00
mav
97d7cc4f54 MFC r256887:
Fix memory and references leak due to unfreed path.

Coverity CID:   1109817
2014-01-05 22:42:42 +00:00
mav
a5ea679e93 MFC r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.
2014-01-05 22:40:28 +00:00
mav
eb69a5b0d1 MFC r256705:
Optimize isp(4) to reduce CPU usage, especially in target mode:
 - Remove two excessive and slow register reads from isp_intr().  Instead
of rereading value every time, assume that registers contain what we have
written there.
 - Avoid sequential search through 4096 array elements when looking for
command tag.  Use hash of lists to store active tags separately from free
ones and so greatly speedup the searches.
2014-01-05 22:38:44 +00:00
mav
cebac06b67 MFC r259168:
Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE
(64MB).  Even if we would find one somehow, ZFS kernel code rejects such
devices.  It is funny to look on attempts to read 4 256K vdev labels from
1.44MB floppy, though it is not very practical and quite slow.
2014-01-05 22:14:12 +00:00
mav
0e037d0ee8 MFC r258342:
Reenable vfs.zfs.zio.use_uma for amd64, disabled at r209261.

On machines with seveal CPUs and enough RAM this can easily twice improve
ZFS performance or twice reduce CPU usage.  It was disabled three years
ago due to memory and KVA exhaustion reports, but our VM subsystem got
improved a lot since that time, hopefully enough to make another try.
2014-01-05 22:12:45 +00:00
mav
fe82b61321 MFC r258137:
Introduce allocation cache to store LZ4 compression contexts without kicking
VM subsystem twice for every written record.

Tests on 24-core system show double reduction of CPU time spent on copying
single large well-compressed file.

This patch is not really needed on illumos (while not harm either) since
their memory allocator by default uses caching for all requests up to 128K.
2014-01-05 22:09:18 +00:00
dim
dafd81e458 Revert MFC of r260102 for now, until I can merge the required fix from
head.  This should fix building modules which require -fms-extensions to
compile them with gcc.
2014-01-05 15:39:37 +00:00
glebius
e3ce8ac51c Merge r260188 from head:
Fix regression from r249894. Now we pass "gw" as argument to if_output
  method, thus for multicast case we need it to point at "dst".

PR:		185395
2014-01-05 13:55:33 +00:00
mav
b8172b7691 MFC r258716:
- Add bucket size column to `show uma` DDB command.
 - Add `show umacache` command to show alike stats for cache-only UMA zones.
2014-01-04 23:43:18 +00:00
mav
00fb1dac34 MFC r258693:
Make UMA to not blindly force offpage slab header allocation for large
(> PAGE_SIZE) zones.  If zone is not multiple to PAGE_SIZE, there may
be enough space for the header at the last page, so we may avoid extra
header memory allocation and hash table update/lookup.

ZFS creates bunch of odd-sized UMA zones (5120, 6144, 7168, 10240, 14336).
This change gives good use to at least some of otherwise lost memory there.
2014-01-04 23:42:24 +00:00
mav
91cfd3a7cc MFC r258691:
Don't count bucket allocation failures for UMA zones as their own failures.
There are good reasons for this to happen, such as recursion prevention, etc.
and they are not fatal since buckets are just an optimization mechanism.
Real bucket allocation failures are any way counted by the bucket zones
themselves, and we don't need double accounting there.
2014-01-04 23:40:47 +00:00
mav
3ff6064c46 MFC r258340, r258497:
Implement mechanism to safely but slowly purge UMA per-CPU caches.

This is a last resort for very low memory condition in case other measures
to free memory were ineffective.  Sequentially cycle through all CPUs and
extract per-CPU cache buckets into zone cache from where they can be freed.
2014-01-04 23:39:39 +00:00
mav
4f2347ab59 MFC r258338:
Grow UMA zone bucket size also on lock congestion during item free.

Lock congestion is the same, whether it happens on alloc or free, so
handle it equally.  Now that we have back pressure, there is no problem
to grow buckets a bit faster.  Any way growth is much slower then in 9.x.
2014-01-04 23:38:06 +00:00
mav
363e273d8f MFC r258337:
Add two new UMA bucket zones to store 3 and 9 items per bucket.

These new buckets make bucket size self-tuning more soft and precise.
Without them there are buckets for 1, 5, 13, 29, ... items.  While at
bigger sizes difference about 2x is fine, at smallest ones it is 5x and
2.6x respectively.  New buckets make that line look like 1, 3, 5, 9, 13,
29, reducing jumps between steps, making algorithm work softer, allocating
and freeing memory in better fitting chunks.  Otherwise there is quite a
big gap between allocating 128K and 5x128K of RAM at once.
2014-01-04 23:37:01 +00:00
mav
a5fd15da70 MFC r258336:
Implement soft pressure on UMA cache bucket sizes.

Every time system detects low memory condition decrease bucket sizes for
each zone by one item.  As result, higher memory pressure will push to
smaller bucket sizes and so smaller per-CPU caches and so more efficient
memory use.

Before this change there was no force to oppose buckets growth as result
of practically inevitable zone lock conflicts, and after some run time
per-CPU caches could consume enough RAM to kill the system.
2014-01-04 23:35:34 +00:00
mav
afcf784d4c MFC r259232:
Create own free list for each of the first 32 possible allocation sizes.
In case of 4K allocation quantum that means for allocations up to 128K.

With growth of memory fragmentation these lists may grow to quite a large
sizes (tenths and hundreds of thousands items).  Having in one list items
of different sizes in worst case may require full linear list traversal,
that may be very expensive.  Having lists for items of single size means
that unless user specify some alignment or border requirements (that are
very rare cases) first item found on the list should satisfy the request.

While running SPEC NFS benchmark on top of ZFS on 24-core machine with
84GB RAM this change reduces CPU time spent in vmem_xalloc() from 8%
and lock congestion spinning around it from 20% to invisible levels.
And that all is by the cost of just 26 more pointers per vmem instance.

If at some point our kernel will start to actively use KVA allocations
with odd sizes above 128K, something may need to be done to bigger lists
also.
2014-01-04 23:31:34 +00:00
dim
04ce9320a8 MFC r260112:
In sys/dev/sound/pci/maestro.c, #if 0 two unused static functions.
2014-01-04 23:12:01 +00:00
dim
df316577ae MFC r260111:
For sys/ofed/drivers/infiniband/hw/mlx4/mcg.c, disable warning about
unused variables for now.
2014-01-04 23:00:56 +00:00
dim
1740bd87f0 MFC r260104:
For sys/ofed/drivers/infiniband/core/cm.c, disable warning about unused
functions for now.
2014-01-04 22:13:16 +00:00
dim
385c846a94 MFC r260095:
For sys/boot/i386 and sys/boot/pc98, separate flags to be passed
directly to the linker (LD_FLAGS) from flags passed indirectly, via the
compiler driver (LDFLAGS).

This is because several Makefiles under sys/boot/i386 and sys/boot/pc98
use ${LD} directly to link, and the normal LDFLAGS value should not be
used in these cases.
2014-01-04 22:00:07 +00:00
dim
3a06a5ceae MFC r260103:
In sys/amd64/amd64/pmap.c, remove static function pmap_is_current(),
which has been unused since r189415.

Reviewed by:	alc
2014-01-04 21:45:52 +00:00
dim
6f23e4f462 MFC r260057:
In sys/dev/scc, remove unused static function scc_setmreg().  While
here, invoke scc_getmreg() in two more places where it can be used.

Reviewed by:	marcel
2014-01-04 21:32:53 +00:00
dim
b5bbabfb5f MFC r260056:
In sys/dev/vxge/vxgehal/vxgehal-ring.c, #if 0 an unused static function.
2014-01-04 21:23:49 +00:00
dim
5e502f56a4 MFC r260055:
In sys/dev/usb/wlan/if_urtw.c, #if 0 a static const variable, which has
been unused since r198194.
2014-01-04 21:18:54 +00:00
glebius
a19f1f1902 Merge r258690 by mav from head:
Fix bug introduced at r252226, when udata argument passed to bucket_alloc()
  was used without making sure first that it was really passed for us.

  On some of my systems this bug made user argument passed by ZFS code to
  uma_zalloc_arg() unexpectedly block UMA per-CPU caches for those zones.
2014-01-04 19:51:57 +00:00
dim
d612a2323c MFC r260054:
In sys/dev/tpm/tpm.c, #if 0 an unused static function.
2014-01-04 19:13:25 +00:00
dim
641c7c0871 MFC r260048:
In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].
2014-01-04 19:04:53 +00:00
dim
a29e1060a5 MFC r260042:
Remove superfluous old-style rcsid[] from if_my.c.  There is already an
__FBSDID() at the top of the file.
2014-01-04 18:58:18 +00:00
dim
98319f939f MFC r260040:
In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.
2014-01-04 18:53:31 +00:00
dim
a0f0f71f55 MFC r260038:
In sys/dev/en/midway.c, #if 0 an unused static function.
2014-01-04 18:48:29 +00:00
dim
66ceef72b9 MFC r260039:
Turn off warnings about unused variables for a bunch of files under
contrib/ipfilter.
2014-01-04 18:33:28 +00:00
dim
d1cdc4fc9a MFC r260026:
Disable warning about unused functions for ieee80211_crypto.c and
ieee80211_mesh.c for now.
2014-01-04 18:24:45 +00:00
dim
83ddc49dd1 MFC r260025:
Disable warning about unused functions for ar9300_reset.c for now.
2014-01-04 18:19:53 +00:00
dim
d67626df70 MFC r260019:
For some files under sys/dev/drm2/i915, turn off warnings about unused
functions and variables, since they are contributed code.
2014-01-04 17:59:40 +00:00
dim
7a170f6d98 MFC r260020:
For sys/dev/drm2/radeon, only use -fms-extensions with gcc.  This flag
is only to stop gcc complaining about anonymous unions, which clang does
not do.  For clang 3.4 however, -fms-extensions enables the Microsoft
__wchar_t type, which clashes with our own types.h.

MFC r260102:

Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile.  Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.
2014-01-04 17:54:06 +00:00
dim
dfba73dcd1 MFC r260017:
Mark unused static inline functions defined by the PCTRIE_DEFINE() macro
as __unused, so warnings about them are avoided.
2014-01-04 17:36:13 +00:00
dim
110965f5ae MFC r260016:
Remove superfluous old-style rcsid[] from if_sk.c.  There is already an
__FBSDID() at the top of the file.
2014-01-04 17:33:05 +00:00
mav
31e9f724fc MFC r259464:
Fix periodic per-CPU timers startup on boot.
2014-01-03 20:47:51 +00:00
kib
cb147dc4e3 MFC r259953:
Fix accounting for the negative cache entries when reusing v_cache_dd.
2014-01-03 20:02:30 +00:00
glebius
b1d31e2810 Merge r259681 from head:
Changes:
  - Reinit uio_resid and flags before every call to soreceive().
  - Set maximum acceptable size of packet to IP_MAXPACKET. As for now the
    module doesn't support INET6.
  - Properly handle MSG_TRUNC return from soreceive().

PR:	184601
2014-01-03 12:28:33 +00:00
pluknet
ac5822de6e MFC r259906: Draft-ietf-tcpm-initcwnd-05 became RFC6928. 2014-01-02 16:48:08 +00:00
scottl
e03e146ca1 MFC r260070
Multi-queue NIC drivers and multi-port lagg tend to use the same lower
 bits of the flowid as each other, resulting in a poor distribution of
 packets among queues in certain cases.  Work around this by adding a
 set of sysctls for controlling a bit-shift on the flowid when doing
 multi-port aggrigation in lagg and lacp.  By default, lagg/lacp will
 now use bits 16 and higher instead of 0 and higher.

Obtained from:	Netflix
2014-01-02 01:51:54 +00:00
jilles
f948fdf9e9 MFC r258281: Fix siginfo_t.si_status for wait6/waitid/SIGCHLD.
Per POSIX, si_status should contain the value passed to exit() for
si_code==CLD_EXITED and the signal number for other si_code. This was
incorrect for CLD_EXITED and CLD_DUMPED.

This is still not fully POSIX-compliant (Austin group issue #594 says that
the full value passed to exit() shall be returned via si_status, not just
the low 8 bits) but is sufficient for a si_status-related test in libnih
(upstart, Debian/kFreeBSD).

PR:		kern/184002
2014-01-01 20:22:29 +00:00
rmacklem
e876d4736c MFC: r259854
The NFSv4 server would call VOP_SETATTR() with a shared locked vnode
when a Getattr for a file is done by a client other than the one that
holds the file's delegation. This would only happen when delegations
are enabled and the problem is fixed by this patch.
2014-01-01 02:49:45 +00:00
rmacklem
0b3ac62883 MFC: r259845
An intermittent problem with NFSv4 exporting of ZFS snapshots was
reported to the freebsd-fs mailing list. I believe the problem was
caused by the Readdir operation using VFS_VGET() for a snapshot file entry
instead of VOP_LOOKUP(). This would not occur for NFSv3, since it
will do a VFS_VGET() of "." which fails with ENOTSUPP at the beginning
of the directory, whereas NFSv4 does not check "." or "..". This
patch adds a call to VFS_VGET() for the directory being read to check
for ENOTSUPP.
I also observed that the mount_on_fileid and fsid attributes were
not correct at the snapshot's auto mountpoints when looking at packet
traces for the Readdir. This patch fixes the attributes by doing a check
for different v_mount structure, even if the vnode v_mountedhere is not
set.
2013-12-31 22:00:25 +00:00
rmacklem
0d5a6b8a1a MFC: r259801
The NFSv4 client was passing both the p and cred arguments to
nfsv4_fillattr() as NULLs for the Getattr callback. This caused
nfsv4_fillattr() to not fill in the Change attribute for the reply.
I believe this was a violation of the RFC, but had little effect on
server behaviour. This patch passes a non-NULL p argument to fix this.
2013-12-31 21:56:02 +00:00
peter
4adac037c3 Bump __FreeBSD_version for MFC of r259951 - don't coalesce map entries
for vm_map_stack().
2013-12-31 17:29:03 +00:00
gjb
f04c8fed88 MFC r260125:
Bump copyright year.
  Happy New Year 2014!

Sponsored by:	The FreeBSD Foundation
2013-12-31 12:24:38 +00:00
kevlo
e9174f71be MFC r256717:
Update firmware for run(4) to version 0.33.
2013-12-31 05:20:44 +00:00
edavis
3cffd808e4 Approved by: re@ (gjb)
Approved by:	davidch (mentor)
2013-12-30 23:46:35 +00:00
rmacklem
ed84ea692f MFC: r259771
The NFSv4.1 client didn't return NFSv4.1 specific error codes
for the Getattr and Recall callbacks. This patch fixes it.
Since the NFSv4.1 specific error codes would only happen for
abnormal circumstances, this patch has little effect, in practice.
2013-12-30 21:24:41 +00:00
rmacklem
72aa8bde0a MFC: r259084
For software builds, the NFS client does many small
synchronous (with FILE_SYNC) writes because non-contiguous
byte ranges in the same buffer cache block are being
written. This patch adds a new mount option "noncontigwr"
which allows the non-contiguous byte ranges to be combined,
with the dirty byte range becoming the superset of the bytes
that are dirty, if the file has not been file locked.
This reduces the number of writes significantly for software
builds. The only case where this change might break existing
applications is where an application is writing
non-overlapping byte ranges within the same buffer cache block
of a file from multiple clients concurrently.
Since such an application would normally do file locking on
the file, avoiding the byte range merge for files that have
been file locked should be sufficient for most (maybe all?) cases.
2013-12-30 21:17:20 +00:00
dim
955c58790e MFC r259928:
In sys/dev/bxe/bxe.c, remove static function bxe_has_tx_work_unload(),
which has never been used.

Reviewed by:	edavis
2013-12-30 20:32:27 +00:00
dim
b3248d4703 MFC r259902:
In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(),
which has never been used, even by upstream, since its initial upstream
commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d )
2013-12-30 20:27:58 +00:00
dim
5fce04bd49 MFC r257532 (by adrian):
Fix this build for clang.

MFC r259730:

To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:

CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc

In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.

MFC r259913:

For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.

MFC r259927:

Fix pc98 build, by also forcing COMPILER_TYPE in sys/boot/pc98/boot2's
Makefile.

Pointy hat to:	dim
2013-12-30 20:15:46 +00:00
kib
cc03f8b1e5 MFC r259951:
Do not coalesce stack entry. Pass MAP_STACK_GROWS_DOWN and
MAP_STACK_GROWS_UP flags to vm_map_insert() from vm_map_stack()
2013-12-30 08:57:54 +00:00
mckusick
fc0cf40027 MFC of 256801, 256803, 256808, 256812, 256817, 256845, and 256860.
This set of changes puts in place the infrastructure to allow soft
updates to be multi-threaded. It introduces no functional changes
from its current operation.

MFC of 256860:

Allow kernels without options SOFTUPDATES to build.  This should fix the
embedded tinderboxes.

Reviewed by:    emaste

MFC of 256845:

Fix build problem on ARM (which defaults to building without soft updates).

Reported by:  Tinderbox
Sponsored by: Netflix

MFC of 256817:

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

MFC of 256812:

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

MFC of 256808:

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

MFC of 256803:

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

MFC of 256801:

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
2013-12-30 05:22:22 +00:00
scottl
db06903b84 Merge r256563:
In the flowtable scanner, restart the scan at the last found position,
not at position 0.  Changes the scanner from O(N^2) to O(N).

Reviewed by:    emax
Obtained from:  Netflix
2013-12-30 05:19:27 +00:00
mckusick
9a9f8d23f5 MFC of 258789:
We needlessly panic when trying to flush MKDIR_PARENT dependencies.
We had previously tried to flush all MKDIR_PARENT dependencies (and
all the NEWBLOCK pagedeps) by calling ffs_update(). However this will
only resolve these dependencies in direct blocks. So very large
directories with MKDIR_PARENT dependencies in indirect blocks had
not yet gotten flushed. As the directory is in the midst of doing a
complete sync, we simply defer the checking of the MKDIR_PARENT
dependencies until the indirect blocks have been sync'ed.

Reported by: Shawn Wallbridge of imaginaryforces.com
Tested by:   John-Mark Gurney <jmg@funkthat.com>
PR:          183424
2013-12-29 07:26:48 +00:00
peter
db4a84c1c2 Catch up with r259980 and handle renamed deflate.c. 2013-12-28 15:19:47 +00:00
dim
0ea883f161 MFC r259897:
In sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c, remove static functions
mk_cpl_barrier_ulp(), mk_get_tcb_ulp() and mk_set_tcb_field_ulp(), which
are all unused since r237263.
2013-12-28 02:15:30 +00:00
dim
3473287ac7 MFC r259896:
In sys/dev/cxgb/common/cxgb_mc5.c, remove static function
dbgi_wr_addr3(), which is unused since r167514.
2013-12-28 02:11:17 +00:00
dim
ecbf461bca MFC r259893:
In sys/vm/vm_pageout.c, since vm_pageout_worker() takes a void * as
argument, cast the incoming 0 argument to void *, to silence a warning
from clang 3.4 ("expression which evaluates to zero treated as a null
pointer constant of type 'void *' [-Wnon-literal-null-conversion]").
2013-12-28 02:07:29 +00:00
dim
d0987645bf MFC r259892:
In sys/kern/vfs_mountroot.c, remove static function parse_isspace(),
which is unused since r214006.
2013-12-28 02:00:33 +00:00
dim
d517c0e1a4 MFC r259876:
In sys/kern/subr_witness.c, remove static function
witness_lock_order_key_empty(), which is unused since r181695.
2013-12-28 01:52:52 +00:00
dim
e1aa82b3d2 MFC r259880:
In sys/dev/sym/sym_hipd.c, remove static functions sym_que_first(),
sym_que_last() and sym_remque_tail(), which are all unused since r53790.
2013-12-28 01:47:19 +00:00
dim
03dc4a0e5e MFC r259875:
In sys/kern/sched_ule.c, remove static function sched_both(), which is
unused since r232207.
2013-12-28 01:42:20 +00:00
dim
d72ff8ac8e MFC r259869:
In sys/dev/mwl/if_mwl.c, put the static RD4() function under #ifdef
MWL_DEBUG guards, since it only used in DPRINTF statements.
2013-12-28 01:33:42 +00:00
dim
d66753f8cd MFC r259842:
Remove some unused static const strings under sys/rpc, which have never
been used since the initial commit (r177633).

MFC r259843:

Move a static const variable to the #if 0 part where it is only used.
(Note the #if 0 part has been inactive since the initial commit,
r177633, so maybe it should be removed altogether).
2013-12-28 01:26:26 +00:00
dim
5b742ab941 MFC r259840:
In sys/netinet6/in6_mcast.c, in6m_is_ifp_detached() is only used
whenever KTR is defined, so put it between #ifdef KTR guards.  This
avoids a warning about a unused function if KTR is not enabled.
2013-12-28 01:19:48 +00:00
dim
58bc1e001e MFC r259839:
In sys/netinet/in_mcast.c, inm_is_ifp_detached() is only used whenever
KTR is defined, so put it between #ifdef KTR guards.  This avoids a
warning about a unused function if KTR is not enabled.
2013-12-28 01:15:34 +00:00
dim
20a8dfaced MFC r259833:
Remove another unused static const variable num_chip_names, from
aic7xxx.c this time.

Noticed by:	pluknet
2013-12-28 01:08:40 +00:00
peter
cb16a1bd34 MFC r259109: allow ZFS to co-habitate with crypto / aesni 2013-12-28 01:03:30 +00:00
dim
9536e2a918 MFC r259827:
Remove unused static const variable num_chip_names from aic79xx.c.

Reviewed by:	gibbs
2013-12-28 00:53:20 +00:00
dim
8bd563e158 MFC r259825:
Remove unused static function adwccbstatus() from adw(4).

Reviewed by:	gibbs
2013-12-28 00:16:58 +00:00
adrian
899f5ffc89 Revert r252694 from stable/10 to fix instabilities seen with jemalloc + dhclient/sshd.
This is a direct commit to stable/10 as the VM code has changed
since the stable/10 branch.

PR:		kern/185046
2013-12-27 22:05:51 +00:00
jhb
285471a802 MFC 259014: There is no sysctl with the MIB { CTL_KERN, KERN_MAXID }. 2013-12-26 16:57:36 +00:00
pfg
a53893ff4d MFC r258904, r259780:
Small ext2fs updates.

Add two new reserved inodes.
Make the hashing algorithm match the linux code.

PR:		kern/183230
2013-12-26 01:12:35 +00:00
bz
5d40dd365f MFC r259267:
Add an FDT DTS and MDROOT kernel configuration for BERI on NetFPGA.

  At this point we only support one CPU, the PIC, and a UART console.

Sponsored by:	DARPA, AFRL
2013-12-25 23:57:01 +00:00
bz
3c552ab887 MFC r259265:
Use correct value pointing to previously selected FDT DTB.

Sponsored by:	DARPA, AFRL
2013-12-25 23:54:38 +00:00
mav
440a3e9f89 MFC r259222:
Destroy mtx lock when failed to allocate memory during attach.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-12-25 12:41:53 +00:00
ae
c0cbf2ad7b MFC r259520:
Fix copy/paste typo.
2013-12-24 23:23:44 +00:00
jhb
bf62f8539b MFC 259013:
Fix the processor table entry structure to use a fixed-width type for
32-bit fields so it is the correct size on amd64.  Remove a workaround
for the broken structure from bhyve(8).
2013-12-24 19:10:56 +00:00
jhb
4620ae454b MFC 258869:
Fix an off-by-one error in r228960.  The maximum priority delta provided
by SCHED_PRI_TICKS should be SCHED_PRI_RANGE - 1 so that the resulting
priority value (before nice adjustment) is between SCHED_PRI_MIN and
SCHED_PRI_MAX, inclusive.
2013-12-24 19:01:08 +00:00
jhb
af9076fcae MFC 258177:
Remove an incorrectly copied and pasted clause from these license
statements.
2013-12-24 18:48:29 +00:00
kib
7baf16ac14 MFC r259522:
If vn_open_vnode() succeeded in opening the vnode, but subsequent
advisory lock cannot be obtained, prevent double-close of the vnode in
vn_close() called from the fdrop(), by resetting file' f_ops methods.
2013-12-24 07:32:06 +00:00
kib
d30d9d8d87 MFC r259521:
Do not allow O_EXEC opens for fifo, return EINVAL.
2013-12-24 07:25:49 +00:00
np
30cdcf32e9 MFC r259527:
Do not create a hardware IPv6 server if the listen address is not
in6addr_any and is not in the CLIP table either.  This fixes a reported
TOE+IPv6 NULL-dereference panic in do_pass_open_rpl().

While here, stop creating hardware servers for any loopback address.
It's just a waste of server tids.
2013-12-24 02:10:12 +00:00
imp
8313ffe035 MFC r259685:
Plumb the cn_grab and cn_ungrab routines down into the uart
 clients. Mask RX interrupts while grabbed on the atmel serial
 driver. This UART interrupts every character. When interrupts are
 enabled at the mountroot> prompt, this means the ISR eats the
 characters. Rather than try to create a cooperative buffering system
 for the low level kernel console, instead just mask out the ISR. For
 NS8250 and decsendents this isn't needed, since interrupts only happen
 after 14 or more characters (depending on the fifo settings). Plumb
 such that these are optional so there's no change in behavior for all
 the other UART clients. ddb worked on this platform because all
 interrupts were disabled while it was running, so this problem wasn't
 noticed. The mountroot> issue has been around for a very very long
 time.

Approved by:	re@ (gjb@)
2013-12-23 01:24:32 +00:00
dumbbell
7ed70e99db MFC r259717:
drm: Lower priority of "EDID checksum is invalid" message

The priority goes from "error" to "debug".

Connectors are polled every 10 seconds. Reading EDID is part of this
polling. However, when an invalid EDID is returned, this error message
is logged. When using Newcons for instance, having a kernel message
every 10 seconds is getting annoying.

Now that it's a debug message, it'll be logged only if hw.dri.debug is
enabled. This fix console spamming for some users.

Tested by:	Larry Rosenman <ler@lerctr.org>
2013-12-22 21:53:08 +00:00
dumbbell
088efa66e6 MFC r259684:
drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...

... for msleep/cv_*wait() return values, where wait_event*() is used
on Linux. ERESTARTSYS is the return code expected by callers when the
operation was interrupted.

For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if
an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an
error.

Note that ERESTARTSYS is defined as ERESTART, but this keeps callers'
code close to Linux.

Submitted by:	avg@ (previous version)
2013-12-22 21:18:21 +00:00
dumbbell
d96320dc31 MFC r259679:
vga_pci: Improve boot display detection

The previous code was checking the "VGA Enable" bit on the video card's
parent PCI-to-PCI bridge only. This didn't work for the case where the
video card is attached to the root PCI bus (ie. the card has no parent
PCI-to-PCI bridge).

Now, the new code:
    1. checks the "VGA Enable" bit on the parent bridge only if it's a
       PCI-to-PCI bridge;
    2. always checks the "I/O" and "Memory address space decoding" bits
       on the video card itself.

However, vendor-specific bits are not used.

This fixes the use of many integrated Radeon cards: without this patch,
we fail to detect them as the boot display and, when radeonkms looks for
the Video BIOS, it skips the shadow copy made by the System BIOS. It
then fails to fully initialize the card, because the shadow copy is the
only way to read the Video BIOS in these situations. A workaround was to
force the boot display selection using the "hw.pci.default_vgapci_unit"
tunable.

A previous version of this patch added a new function doing the checks.
Now, the vga_pci_is_boot_display() function is used to perform the
checks (only until the boot display is found) and return if the given
device is the boot display or not.

Furthermore, vga_pci_attach() logs "Boot video device" if the card being
attached it the Chosen One:
    vgapci0: <VGA-compatible display> [...]
    vgapci0: Boot video device

Reviewed by:	kib@, jhb@ (both a previous version)
Tested by:	lunatic_ (#freebsd-xorg, integrated Radeon card,
		xmj (#freebsd-xorg, i915+NVIDIA cards)
2013-12-22 21:09:43 +00:00
pjd
9a484465f6 MFC r259576:
MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0

illumos/illumos-gate@bb411a08b0
2013-12-22 19:36:08 +00:00
mav
53624fa293 MFC r259108:
When comparing device IDs, make sure that they have the same type
(like NAA assigned) and identify the same entity (like device or port).
Otherwise there can be false positives since at least some models of
Seagate disks use same IDs for the whole device and one of its ports.
2013-12-22 13:02:34 +00:00
alfred
a0d88ab700 Defer start/stop port to workqueues.
MFC: 259411
2013-12-19 07:33:07 +00:00
hselasky
786890d4b7 MFC r259248 and r259462:
Set chain bit correctly. This will fix some problems sending and
receiving Zero Length Packets, ZLPs. See comment in code for more
information.
2013-12-19 07:20:37 +00:00
hselasky
bb0a5fd29c MFC r259023 and r259095:
Improve the XHCI command timeout recovery handling code.
Fix some typos while at it.
2013-12-19 07:13:59 +00:00
truckman
f4127526eb MFC r258363:
Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my
Virgin Mobile branded device.  It needs the U3GINIT_SCSIEJECT quirk.
2013-12-19 05:36:06 +00:00
glebius
a70f2adf57 Merge r256868,257276-257277,257515,257913 from head. These are fixes
required to make Xen buтldable w/o INET.

Sponsored by:	Nginx, Inc.
2013-12-18 05:20:53 +00:00
kib
2c4d831850 MFC DMAR busdma implementation.
MFC r257251:
Import the driver for VT-d DMAR hardware.  Implement the busdma(9) using DMARs.

MFC r257512:
Add support for queued invalidation.

MFC miscellaneous follow-ups to r257251.

MFC r257266:
Remove redundand assignment to error variable and check for its value.

MFC r257308:
Remove redundand declaration.

MFC r257511:
Return BUS_PROBE_NOWILDCARD from the DMAR probe method.

MFC r257860,r257896,r257900,r257902,r257903 (by dim):
Fixes for gcc compilation.
2013-12-17 13:49:35 +00:00
kib
3219a81518 MFC r257230:
Add a virtual table for the busdma methods on x86, to allow different
busdma implementations to coexist.
2013-12-17 13:39:50 +00:00
kib
5a15f697f5 MFC r257228:
Add bus_dmamap_load_ma() function to load map with the array of
vm_pages.
2013-12-17 13:38:21 +00:00
kib
3e0674d807 MFC r257541:
Fix several issues with the busdma(9) KPI use in the e1000 drivers.
2013-12-17 13:18:41 +00:00
kib
293c11687e MFC r258088:
Add check for buflen overflow by comparing the buflen with both offset
and resid.

MFC r258397:
Redo r258088 to avoid relying on signed arithmetic overflow.
2013-12-17 13:10:28 +00:00
kib
758e3a9934 MFC r258039:
Avoid overflow for the page counts.

MFC r258365:
Revert back to use int for the page counts.
Rearrange the checks to correctly handle overflowing address arithmetic.
2013-12-17 09:21:56 +00:00
asomers
34ade72d5f MFC r258311
opensolaris/uts/common/dtrace/fasttrap.c
        Fix several problems that can cause panics on kldload and kldunload.

        * kproc_create(fasttrap_pid_cleanup_cb, ...) gets called before
          fasttrap_provs.fth_table gets allocated.  This can lead to a panic
          on module load, because fasttrap_pid_cleanup_cb references
          fasttrap_provs.fth_table.  Move kproc_create down after the point
          that fasttrap_provs.fth_table gets allocated, and modify the error
          handling accordingly.

        * dtrace_fasttrap_{fork,exec,exit} weren't getting NULLed until
          after fasttrap_provs.fth_table got freed.  That caused panics on
          module unload because fasttrap_exec_exit calls
          fasttrap_provider_retire, which references
          fasttrap_provs.fth_table.  NULL those function pointers earlier.

        * There wasn't any code to destroy the
          fasttrap_{tpoints,provs,procs}.fth_table mutexes on module unload,
          leading to a resource leak when WITNESS is enabled.  Destroy those
          mutexes during fasttrap_unload().

Sponsored by:	Spectra Logic Corporation
2013-12-16 19:59:34 +00:00
nwhitehorn
d72da1522e MFC r258819,258928:
Add new sysctl, kern.supported_archs, containing the list of FreeBSD
MACHINE_ARCH values whose binaries this kernel can run. This patch provides
a feature requested for implementing pkgng ABI identifiers in a robust
way.

The list is designed to indicate whether, say, an i386 package can be run on
the current system. If kern.supported_abis contains "i386", then the answer
is yes. Otherwise, the answer is no.

At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we
gain support for more interesting combinations, this needs to become more
flexible, possibily through the sysent framework, along with the
hw.machine_arch emulation immediately preceding this code in kern_mib.c.

Reviewed by:	imp
2013-12-16 15:00:06 +00:00
hselasky
607fc1b0bd MFC r256718, r257410 and r257411:
- Fix RF registers for RT3070.
- Initialize BBP68 to improve RX sensitivity.
- Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to
match with the vendor driver. While here, remove unused RT2860_DEF_MAC
definition.
2013-12-16 09:48:08 +00:00
hselasky
4d2c5784a5 MFC r238274, r246752, r256720, r256721, r256722, r256955, r257409
r257429, r257435, r257712, r257732, r257743, r257748, r257955
 r257957, r257958, r258082, r258641, r258643, r258732, r258733,
 r258840, r258919, r258921, r259029, r259030, r259031, r259032 and r259046:

- Add support for the MediaTek/Ralink RT5370/RT5372 chipset.
- Various minor USB WLAN fixes and improvements.

PR:     usb/182936
2013-12-16 08:10:38 +00:00
delphij
a12532878e MFC r258950:
Enable Hyper-V support in i386 GENERIC.
2013-12-16 06:41:31 +00:00
bjk
638d19cdfc MFC r259286,259424,259425:
Apply patch from upstream Heimdal for encoding fix

  RFC 4402 specifies the implementation of the gss_pseudo_random()
  function for the krb5 mechanism (and the C bindings therein).
  The implementation uses a PRF+ function that concatenates the output
  of individual krb5 pseudo-random operations produced with a counter
  and seed.  The original implementation of this function in Heimdal
  incorrectly encoded the counter as a little-endian integer, but the
  RFC specifies the counter encoding as big-endian.  The implementation
  initializes the counter to zero, so the first block of output (16 octets,
  for the modern AES enctypes 17 and 18) is unchanged.  (RFC 4402 specifies
  that the counter should begin at 1, but both existing implementations
  begin with zero and it looks like the standard will be re-issued, with
  test vectors, to begin at zero.)

  This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6,
  from 13 October, 2013:
  % Fix krb5's gss_pseudo_random() (n is big-endian)
  %
  % The first enctype RFC3961 prf output length's bytes are correct because
  % the little- and big-endian representations of unsigned zero are the
  % same.  The second block of output was wrong because the counter was not
  % being encoded as big-endian.
  %
  % This change could break applications.  But those applications would not
  % have been interoperating with other implementations anyways (in
  % particular: MIT's).

Bump __FreeBSD_version accordingly and add a note in UPDATING.

Approved by:	hrs (mentor, src committer)
2013-12-16 02:04:28 +00:00
ae
1277739e09 MFC r257987:
Initialize prot variable.

  PR:		177417
2013-12-14 04:24:32 +00:00
ae
a210965c36 MFC r257965:
Add missing line breaks.

  PR:		181900
2013-12-14 04:16:27 +00:00
ian
38c5c4197f MFC r259212, r259220:
Fix one race and one fence post error. When the TX buffer was
  completely full, we'd not complete any of the mbufs due to the fence
  post error (this creates a large leak). When this is fixed, we still
  leak, but at a much smaller rate due to a race between ateintr and
  atestart_locked as well as an asymmetry where atestart_locked is
  called from elsewhere.  Ensure that we free in-flight packets that
  have completed there as well. Also remove needless check for NULL on
  mb, checked earlier in the loop and simplify a redundant if.
2013-12-14 01:35:57 +00:00
ian
6af39cbc39 MFC r259038, r259039:
Bump the maximum VM space from 3 * memory size to a fixed
  256MB. That's all we have room for since we map the hardware registers
  starting at 0xd0000000. This allows my 64MB AT91SAM9G20 to boot again
  after the unmmaped I/O changes were MFC'd at r251897. Other
  subplatforms may need similar treatment.

  Although not strictly required to boot a 64MB board, bump
  vm_max_virtual_address to be KERNVIRTADDR + 256MB. This allows some
  future shock protection since the KVA requirements have gone up since
  the unmapped changes have gone in, as well as preventing us from
  overlapping with the hardware devices, which we map at 0xd0000000,
  which we'd hit with anything more than 85MB...
2013-12-14 01:34:24 +00:00
ian
47bb9f823b MFC r258828:
Add a nand flash controller driver for Atmel at91 family.  Tested only
  on at91rm9200 so far.
2013-12-14 01:15:26 +00:00
ian
cbcef6d7b5 MFC r258820: Add definitions for the PIO pins found on recent AT91 SoCs. 2013-12-14 01:14:38 +00:00
ian
b37938a4e4 MFC r258392, r258412:
Call cpu_setup() immediately after the page tables are installed.  This
  enables data cache and other chip-specific features.  It was previously
  done via an early SYSINIT, but it was being done after pmap and vm setup,
  and those setups need to use mutexes.  On some modern ARM platforms,
  the ldrex/strex instructions that implement mutexes require the data cache
  to be enabled.

  Call cpu_setup() from the initarm() routine on platforms that don't use
  the common FDT-aware initarm() in arm/machdep.c.
2013-12-14 01:12:13 +00:00
ian
1185e66967 MFC r258393:
Add USB_HOST_ALIGN=64; the cache line size on the am335x is 64 bytes.
2013-12-14 00:59:40 +00:00
ian
c3017e9225 MFC r258356:
Bugfixes... the host capabilties from FDT data are stored in host.caps, not
  host.host_ocr, examine the correct field when setting up the hardware.  Also,
  the offset for the capabilties register should be 0x140, not 0x240.
2013-12-14 00:58:13 +00:00
ian
af5e386ba3 MFC r258240:
In the data abort handler, don't panic if kdb is available and says it
  handled the condition.
2013-12-14 00:57:05 +00:00
ian
c6dcd8817f MFC r258740:
Look up a nand chip by id in the static table before trying to obtain
  ONFI parameters.  This allows a static table entry to provide valid data
  for chips known to provide invalid ONFI data.
2013-12-14 00:55:34 +00:00
ian
8b635cded3 MFC r257892, r258196, r258197, r258199, r258200, r258201, r258202:
Add ONFI signature check.

  Add Micron chip found in Freescale Vybrid Family Phytec COSMIC board.

  The vendor specified field is 88 bytes, not 8 bytes.

  Update the onfi_params struct to ONFI revision 3.2 (06 12 2013).

  Search for and validate the ONFI params as specified in the standard.

  ONFI parameters are little-endian, hence we must take care to convert them
  to native endianness.  We must also pay attention to unaligned accesses.

  Rework the routine that returns a pointer to the table of software ECC
  byte positions within the OOB area to support chips with unusual OOB
  sizes such as 218 or 224 bytes.
2013-12-14 00:54:05 +00:00
ian
2c66a0246a MFC r257924:
Apparently with "const uint32_t foo = 0x60;" gcc doesn't consider 'foo'
  to be a constant integer suitable for use in a case label, so use #defines.
2013-12-14 00:23:43 +00:00
ian
f1d49f684d MFC r257669, r257672, r257673, r257676, r257678:
Call initarm_lastaddr() later in the init sequence, after establishing
  static device mappings, rather than as the first of the initializations
  that a platform can hook into.  This allows a platform to allocate KVA
  from the top of the address space downwards for things like static device
  mapping, and return the final "last usable address" result after that and
  other early init work is done.

  Because some platforms were doing work in initarm_lastaddr() that needs to
  be done early, add a new initarm_early_init() routine and move the early
  init code to that routine on those platforms.

  Make PTE_DEVICE a synonym for PTE_NOCACHE on armv4, to make it easier to
  share the same code on both architectures.

  Add new helper routines for arm static device mapping.  The new code
  allocates kva space from the top down for the device mappings and builds
  entries in an internal table which is automatically used later by
  arm_devmap_bootstrap().  The platform code just calls the new
  arm_devmap_add_entry() function as many times as it needs to (up to 32
  entries allowed; most platforms use 2 or 3 at most).

  Remove imx local devmap code and use the essentially identical common
  code that got moved from imx_machdep.c to arm/devmap.c.
2013-12-14 00:16:08 +00:00
ian
eae48ec05e MFC r257648, r257649, r257660:
Begin reducing code duplication in arm pmap.c and pmap-v6.c by factoring
  out common code related to mapping device memory into a new devmap.c file.

  Remove the growing duplication of code that used pmap_devmap_find_pa() and
  then did some math with the returned results to generate a virtual address,
  and likewise in reverse to get a physical address.  Now there are a pair
  of functions, arm_devmap_vtop() and arm_devmap_ptov(), to do that.  The
  bus_space_map() implementations are rewritten in terms of these.

  Move remaining code and data related to static device mapping into the
  new devmap.[ch] files.  Emphasize the MD nature of these things by using
  the prefix arm_devmap_ on the function and type names (already a few of
  these things found their way into MI code, hopefully it will be harder to
  do by accident in the future).
2013-12-13 23:56:53 +00:00
ian
689fd5c390 MFC r257639:
Remove the duplicated implementations of some bus_space functions and use
  the essentially identical generic implementations instead.  The generic
  implementations differ only in the spelling of a couple variable names
  and some formatting differences.
2013-12-13 23:07:22 +00:00
ian
55d93a867d MFC r257603, r257604:
Rename WANDBOARD-COMMON to WANDBOARD.common and adjust the configs that
  include it accordingly.  The build machinery for universe and tinderbox
  tries to build every kernel config whose name begins and ends with [A-Z0-9]
  and the common include file that has most of the options isn't buildable
  by itself, so the new lowercase .common will avoid building it.
2013-12-13 22:52:59 +00:00
ian
4c517a4890 MFC r257595: Comments and style(9) only, no functional changes. 2013-12-13 22:51:09 +00:00
ian
bf69534180 MFC r257561:
Bugfix:  the attach routine needs to use the same table of fdt compat
  strings that the probe routine used.
2013-12-13 22:50:12 +00:00
ian
a10cf699d1 MFC r257557: Add a missing register definition. 2013-12-13 22:49:18 +00:00
ian
cee3a0f503 MFC r257556:
Arrange for uart_cpu_fdt's probe() routine to use the same table of compat
  strings as uart_bus_fdt's probe().
2013-12-13 22:48:01 +00:00
ian
2b338fd3cf MFC r257518, r257519:
TI sdhci driver improvements, mostly related to fdt data...

  Use the published compatible strings (our own invention, "ti,mmchs" is
  still accepted as well, for now).

  Don't blindly turn on 8-bit bus mode, because even though the controller
  supports it, the board has to be wired appropriately as well.  Use the
  published property (bus-width=<n>) and honor all the valid values (1,4,8).

  The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts.

  The mmchs controller can inherently do both 1.8v and 3.0v on the first
  device and 1.8v only on other devices, unless an external transceiver is
  used.  Set the voltage automatically for the first device and honor
  the published fdt property (ti,dualvolt) for other devices.
2013-12-13 22:46:10 +00:00
ian
ec4b958426 MFC r257483, r257486, r257489:
Add the Soc- / machine-dependent parts of imx6 support.
  Add dts source for imx6 SoCs and for Wandboard boards.
  Add kernel config for Wandboard.
2013-12-13 22:41:57 +00:00
ian
c48d670c8a MFC r257476, r257478:
Revamp the SoC identity numbering scheme to be more in line with the way
  Freescale numbers the chips in the ID registers.

  Add definitions for the register and data that describes the SoC type.
2013-12-13 22:30:21 +00:00
ian
3a53055ae2 MFC r257454: Add sdhci driver glue for imx family SoCs. 2013-12-13 22:28:19 +00:00
ian
3e4a60e997 MFC r257453: Add stubbed-out imx6 support for clocks and power management. 2013-12-13 22:27:26 +00:00
ian
bbdd01b151 MFC r257452: Add support for the USB PHY on imx6 SoCs. 2013-12-13 22:26:10 +00:00
ian
59d4157d7f MFC r257419:
Do not EOI an interrupt until the point after the filter handlers / before
  threaded handlers.
2013-12-13 22:24:00 +00:00
ian
0c80ffaa7f MFC r257418:
Don't iterate through the bits of the pending interrupt register if the
  whole register is zero.  Most of the registers will be zero most of the time.
2013-12-13 22:22:54 +00:00
ian
806c36728f MFC r257413:
Reset the timer interrupt status register at the top rather than bottom of
  the interrupt handler.  If the event callback starts a new short timeout,
  the timer can fire before returning from the event callback, and clearing
  the interrupt status after that loses the interrupt and hangs until the
  counter wraps.  Fixing all of this removes the need for the do-nothing
  loop at the top of the handler which really just waited for the counter to
  roll over and reach the one-shot count again.

  Also add a missing return(0) in the periodic timer start case.
2013-12-13 22:21:49 +00:00
ian
26cb2d5903 MFC r257407:
Expand the list of compatible devices this driver works with.  Increase
  the target frequency from 1 to 10 MHz because these SoCs are plenty fast
  enough to benefit from the extra event timer resolution.
2013-12-13 22:21:04 +00:00