]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoAuto-detect the UGA frame buffer and stride on a MacBook. We're
marcel [Sat, 5 Sep 2015 18:24:51 +0000 (18:24 +0000)]
Auto-detect the UGA frame buffer and stride on a MacBook. We're
striking a delicate balance between exhaustive searching and
banking on assumptions. The environment variables can be used
as a fall-back anyway. With this change, all known and tested
Macs with only UGA should have a working console out of the
box... for now...

8 years agoEliminate pointless requeueing of pages from terminated objects. These
alc [Sat, 5 Sep 2015 17:34:49 +0000 (17:34 +0000)]
Eliminate pointless requeueing of pages from terminated objects.  These
pages will have left the inactive queue before the page daemon performs
its next scan.  Also, ignore references to pages from terminated objects.
This allows the clean pages to be freed a little sooner.

Move some comments to their proper place, i.e., next to the code that
they describe, and update other nearby comments.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd ddb show commands to print the special registers and to ask the
andrew [Sat, 5 Sep 2015 17:29:07 +0000 (17:29 +0000)]
Add ddb show commands to print the special registers and to ask the
hardware to perform address translation for us. These are useful to help
track down what caused us to enter the debugger.

Sponsored by: ABT Systems Ltd

8 years agoIntroduce libxo to procstat(1)
allanjude [Sat, 5 Sep 2015 17:02:01 +0000 (17:02 +0000)]
Introduce libxo to procstat(1)

Reviewed by: rodrigc, bapt
Approved by: marcel (mentor)
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2446

8 years agoFix build with gcc 4.2
bapt [Sat, 5 Sep 2015 16:59:30 +0000 (16:59 +0000)]
Fix build with gcc 4.2

Reported by: kib

8 years agoDo not pass lle to nd6_ns_output(). Use newly-added
melifaro [Sat, 5 Sep 2015 14:14:03 +0000 (14:14 +0000)]
Do not pass lle to nd6_ns_output().  Use newly-added
  nd6_llinfo_get_holdsrc() to extract desired IPv6 source
  from holdchain and pass it to the nd6_ns_output().

8 years agoDo not consume extra reference. This is a bug in r287479.
kib [Sat, 5 Sep 2015 12:28:18 +0000 (12:28 +0000)]
Do not consume extra reference.  This is a bug in r287479.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoCross reference sesutil(8) and ses(4)
bapt [Sat, 5 Sep 2015 10:29:47 +0000 (10:29 +0000)]
Cross reference sesutil(8) and ses(4)

Submitted by: trasz
MFC after: 1 month (with r287473)

8 years agoUse Jenkins hash for TCP syncache.
glebius [Sat, 5 Sep 2015 10:15:19 +0000 (10:15 +0000)]
Use Jenkins hash for TCP syncache.

o Unlike xor, in Jenkins hash every bit of input affects virtually
  every bit of output, thus salting the hash actually works. With
  xor salting only provides a false sense of security, since if
  hash(x) collides with hash(y), then of course, hash(x) ^ salt
  would also collide with hash(y) ^ salt. [1]
o Jenkins provides much better distribution than xor, very close to
  ideal.

TCP connection setup/teardown benchmark has shown a 10% increase
with default hash size, and with bigger hashes that still provide
possibility for collisions. With enormous hash size, when dataset is
by an order of magnitude smaller than hash size, the benchmark has
shown 4% decrease in performance decrease, which is expected and
acceptable.

Noticed by: Jeffrey Knockel <jeffk cs.unm.edu> [1]
Benchmarks by: jch
Reviewed by: jch, pkelsey, delphij
Security: strengthens protection against hash collision DoS
Sponsored by: Nginx, Inc.

8 years agoDeclare the writes around the call to VFS_SYNC() in
kib [Sat, 5 Sep 2015 08:48:24 +0000 (08:48 +0000)]
Declare the writes around the call to VFS_SYNC() in
softdep_ast_cleanup_proc().

Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDo not skip entries without LLE_VALID flag.
melifaro [Sat, 5 Sep 2015 06:24:00 +0000 (06:24 +0000)]
Do not skip entries without LLE_VALID flag.
This one fixes showing incomplete entries in ndp -an.

MFC after: 2 weeks

8 years agoMake in6ifa_ifpwithaddr() take const param.
melifaro [Sat, 5 Sep 2015 05:54:09 +0000 (05:54 +0000)]
Make in6ifa_ifpwithaddr() take const param.
Remove unneded DECONST from in6_lltable_rtcheck().

8 years agoConstantify lookup key in ifa_ifwith* functions.
melifaro [Sat, 5 Sep 2015 05:33:20 +0000 (05:33 +0000)]
Constantify lookup key in ifa_ifwith* functions.
Some places in our network stack already have const
arguments (like if_output() routines and LLE functions).

Code using ifa_ifwith (and similar functins) along with
LLE/_output functions is currently bound to use tricks
like __DECONST(). Provide a cleaner way by making sockaddr
lookup key really constant.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3464

8 years agoMy MacBook has UGA only, but we fail to detect any changes
marcel [Sat, 5 Sep 2015 03:27:23 +0000 (03:27 +0000)]
My MacBook has UGA only, but we fail to detect any changes
in the frame buffer when we flip pixels. Allow the detection
to be bypassed by setting the uga_framebuffer and uga_stride
variables. The kernel console works fine even when we can't
detect pixel changes in the frame buffer, which indicates
that the problem could be with reading from the frame buffer
and not writing to it.

8 years agojhg -> jgh
feld [Sat, 5 Sep 2015 01:00:02 +0000 (01:00 +0000)]
jhg -> jgh

Submitted by: junovitch
Approved by: delphij (implicit)

8 years agoAdd a new sesutil(8) utility
bapt [Sat, 5 Sep 2015 00:06:01 +0000 (00:06 +0000)]
Add a new sesutil(8) utility

This is an utility for managing SCSI Enclosure Services (SES) device.

For now only one command is supported "locate" which will change the test of the
external LED associated to a given disk.

Usage if the following:
sesutil locate disk [on|off]

Disk can be a device name: "da12" or a special keyword: "all".

Reviewed by: mav
MFC after: 1 month
Relnotes: yes
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D3544

8 years agoUpdate ports-secteam roster
feld [Fri, 4 Sep 2015 20:15:20 +0000 (20:15 +0000)]
Update ports-secteam roster

Approved by: delphij

8 years agoRemove rge driver from Broadcom XLR
sbruno [Fri, 4 Sep 2015 19:57:28 +0000 (19:57 +0000)]
Remove rge driver from Broadcom XLR

nlge(4) is supposed to deprecate rge(4) for Broadcom XLR when it was
introduced 5 years ago.

rge doesn't build on -CURRENT due to MII changes. All the XLR kernel confs
use nlge. Let's get rid of the old driver for FreeBSD 11. We can use
10-STABLE or SVN to go back and look at the old driver if needed.

Differential Revision: https://reviews.freebsd.org/D3339
Submitted by: kevin.bowling@kev009.com

8 years agoAdd more BCM gigabit PHYs
sbruno [Fri, 4 Sep 2015 17:48:19 +0000 (17:48 +0000)]
Add more BCM gigabit PHYs

Gleaned from a public header file. 5402 and 5404 look like they may be
used on embedded devices. 5478 and 5488 are switch PHYs. 5754 change is just
to note a product alias.

Differential Revision: https://reviews.freebsd.org/D3338
Submitted by: kevin.bowling@kev009.com

8 years agoem(4): Add Skylake/I219 support.
sbruno [Fri, 4 Sep 2015 17:21:55 +0000 (17:21 +0000)]
em(4): Add Skylake/I219 support.
- driver rev 7.5.2
- use new functions em_flush* for i219 devices

Differential Revision: https://reviews.freebsd.org/D3163
Submitted by: erj jfv
Reviewed by: jfv
MFC after: 1 month
Relnotes: Yes
Sponsored by: Intel Corporation

8 years agoTurn on RAWDCF by default.
cy [Fri, 4 Sep 2015 16:59:01 +0000 (16:59 +0000)]
Turn on RAWDCF by default.

Suggested by: ian
Approved by: roberto
MFC after: 1 week

8 years agoe1000: Shared code updates
sbruno [Fri, 4 Sep 2015 16:30:48 +0000 (16:30 +0000)]
e1000: Shared code updates
-    Fix compiler warning in 80003es2lan.c
-    Add return value handler for e1000_*_kmrn_reg_80003es2lan
-    Fix usage of DEBUGOUT
-    Remove unnecessary variable initializations.
-    Removed unused variables (complaints from gcc).
-    Edit defines in 82571.h.
-    Add workaround for igb hw errata.
-    Shared code changes for Skylake/I219 support.
-    Remove unused OBFF and LTR functions.

Differential Revision: https://reviews.freebsd.org/D3162
Submitted by: erj
MFC after: 1 month
Sponsored by: Intel Corporation

8 years agoRemove remnant from USEPRIVATELIB removal
bapt [Fri, 4 Sep 2015 16:13:25 +0000 (16:13 +0000)]
Remove remnant from USEPRIVATELIB removal

Sponsored by: gandi.net

8 years agoigb(4): Update and fix HW errata
sbruno [Fri, 4 Sep 2015 16:07:27 +0000 (16:07 +0000)]
igb(4): Update and fix HW errata
- HW errata workaround for IPv6 offload w/ extension headers
- Edited start of if_igb.c (Device IDs / #includes) to match ixgbe/ixl

Differential Revision: https://reviews.freebsd.org/D3165
Submitted by: erj
MFC after: 1 month
Sponsored by: Intel Corporation

8 years agoMake tcp_mtudisc() static and void. No functional changes.
glebius [Fri, 4 Sep 2015 12:02:12 +0000 (12:02 +0000)]
Make tcp_mtudisc() static and void. No functional changes.

Sponsored by: Nginx, Inc.

8 years agoAnother addition to r287455.
mav [Fri, 4 Sep 2015 10:16:21 +0000 (10:16 +0000)]
Another addition to r287455.

8 years agoAddition to r287455.
mav [Fri, 4 Sep 2015 10:14:58 +0000 (10:14 +0000)]
Addition to r287455.

8 years agoDon't leak memory in an error case.
tuexen [Fri, 4 Sep 2015 09:24:07 +0000 (09:24 +0000)]
Don't leak memory in an error case.

MFC after: 1 week

8 years agoAdd a NULL pointer check to silence the clang code analyzer.
tuexen [Fri, 4 Sep 2015 09:22:16 +0000 (09:22 +0000)]
Add a NULL pointer check to silence the clang code analyzer.

MFC after: 1 week

8 years agoRemove some dead code.
mav [Fri, 4 Sep 2015 09:19:01 +0000 (09:19 +0000)]
Remove some dead code.

8 years agoFix build.
delphij [Fri, 4 Sep 2015 08:04:12 +0000 (08:04 +0000)]
Fix build.

8 years agoMFV r287451 + 287452: file 5.24 + fix for bin/181436.
delphij [Fri, 4 Sep 2015 05:56:14 +0000 (05:56 +0000)]
MFV r287451 + 287452: file 5.24 + fix for bin/181436.

PR: 181436
MFC after: 2 weeks

8 years agoAdd more mmap tests related to character devices.
jhb [Fri, 4 Sep 2015 01:02:21 +0000 (01:02 +0000)]
Add more mmap tests related to character devices.
- Add cdev-related tests for bad args.
- Add two simple tests cases for mapping /dev/zero that test for
  MAP_ANON-like behavior.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3323

8 years agoExpose an interface to determine if an ACE is inherited.
delphij [Fri, 4 Sep 2015 00:14:20 +0000 (00:14 +0000)]
Expose an interface to determine if an ACE is inherited.

Submitted by: sef
Reviewed by: trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3540

8 years agoFix a bug where two SHUTDOWN_ACK chunks were sent if a SHUTDOWN chunk was
tuexen [Thu, 3 Sep 2015 22:15:56 +0000 (22:15 +0000)]
Fix a bug where two SHUTDOWN_ACK chunks were sent if a SHUTDOWN chunk was
received acking all outstanding data.

8 years agoDetect badly behaved coredump note helpers
cem [Thu, 3 Sep 2015 20:32:10 +0000 (20:32 +0000)]
Detect badly behaved coredump note helpers

Coredump notes depend on being able to invoke dump routines twice; once
in a dry-run mode to get the size of the note, and another to actually
emit the note to the corefile.

When a note helper emits a different length section the second time
around than the length it requested the first time, the kernel produces
a corrupt coredump.

NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to
the length of filenames corresponding to vnodes in the process' fd table
via vn_fullpath.  As vnodes may move around during dump, this is racy.

So:

 - Detect badly behaved notes in putnote() and pad underfilled notes.

 - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to
   exercise the NT_PROCSTAT_FILES corruption.  It simply picks random
   lengths to expand or truncate paths to in fo_fill_kinfo_vnode().

 - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to
   disable kinfo packing for PROCSTAT_FILES notes.  This should avoid
   both FILES note corruption and truncation, even if filenames change,
   at the cost of about 1 kiB in padding bloat per open fd.  Document
   the new sysctl in core.5.

 - Fix note_procstat_files to self-limit in the 2nd pass.  Since
   sometimes this will result in a short write, pad up to our advertised
   size.  This addresses note corruption, at the risk of sometimes
   truncating the last several fd info entries.

 - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the
   zero padding.

With suggestions from: bjk, jhb, kib, wblock
Approved by: markj (mentor)
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3548

8 years agoCurrently the Linux character device mmap handling only supports mmap
jhb [Thu, 3 Sep 2015 18:27:39 +0000 (18:27 +0000)]
Currently the Linux character device mmap handling only supports mmap
operations that map a single page that has an associated vm_page_t.
This does not permit mapping larger regions (such as a PCI memory
BAR) and it does not permit mapping addresses beyond the top of RAM
(such as a 64-bit BAR located above the top of RAM).

Instead of using a single OBJT_DEVICE object and passing the physaddr via
the offset as a hack, create a new sglist and OBJT_SG object for each
mmap request. The requested memory attribute is applied to the object
thus affecting all pages mapped by the request.

Reviewed by: hselasky, np
MFC after: 1 week
Sponsored by: Chelsio
Differential Revision: https://reviews.freebsd.org/D3386

8 years agor249170 was just plain wrong. The effect of the change is to always
sbruno [Thu, 3 Sep 2015 17:46:57 +0000 (17:46 +0000)]
r249170 was just plain wrong.  The effect of the change is to always
delete a logic volume on status change which is NOT what we want here.

The original code is correct in that when the volume changes status
the driver will only delete the volume if the status is one of the
fatal errors.  A drive failure in a mirrored volume is NOT a situtation
where the volume should dissapear.

Reported on freebsd-scsi@:
https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html

MFC after: 3 days

8 years agoAvoid sub-shell for realpath(1) for bmake by using its built-in :tA.
bdrewery [Thu, 3 Sep 2015 17:01:58 +0000 (17:01 +0000)]
Avoid sub-shell for realpath(1) for bmake by using its built-in :tA.

MFC after: 2 weeks
Approved by: portmgr (implicit)

8 years agoSmall UA cleanup.
mav [Thu, 3 Sep 2015 12:56:57 +0000 (12:56 +0000)]
Small UA cleanup.

8 years agoFix copy-paste bug introduced in r275458.
mav [Thu, 3 Sep 2015 12:15:14 +0000 (12:15 +0000)]
Fix copy-paste bug introduced in r275458.

MFC after: 3 days

8 years agoUse proper term in the ctld(8) and iscsid(8) man pages.
trasz [Thu, 3 Sep 2015 11:43:56 +0000 (11:43 +0000)]
Use proper term in the ctld(8) and iscsid(8) man pages.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoSimplify the introductory example in ctl.conf(5) down to absolute
trasz [Thu, 3 Sep 2015 11:42:59 +0000 (11:42 +0000)]
Simplify the introductory example in ctl.conf(5) down to absolute
basics.  The more complicated cases - like how to use physical
ports - are explained later, in the "EXAMPLES" section.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoThe dumpfs(8) utility doesn't actually use disktab(5); remove it
trasz [Thu, 3 Sep 2015 11:40:47 +0000 (11:40 +0000)]
The dumpfs(8) utility doesn't actually use disktab(5); remove it
from "SEE ALSO".

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix acl_strip_np(3) breakage introduced in r279962.
trasz [Thu, 3 Sep 2015 11:31:34 +0000 (11:31 +0000)]
Fix acl_strip_np(3) breakage introduced in r279962.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix the way acl_init(3) uses posix_memalign(3) - the latter doesn't
trasz [Thu, 3 Sep 2015 11:30:39 +0000 (11:30 +0000)]
Fix the way acl_init(3) uses posix_memalign(3) - the latter doesn't
set errno.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRename YP to NIS in the manpages.
araujo [Thu, 3 Sep 2015 07:18:52 +0000 (07:18 +0000)]
Rename YP to NIS in the manpages.

Approved by: bapt (mentor)
Differential Revision: D3555

8 years agoSync with the latest code from OpenBSD.
araujo [Thu, 3 Sep 2015 07:12:40 +0000 (07:12 +0000)]
Sync with the latest code from OpenBSD.

Approved by: rodrigc (mentor)
Differential Revision: D3550

8 years agoLower the compiler warning: unused-but-set-variable.
araujo [Thu, 3 Sep 2015 06:53:17 +0000 (06:53 +0000)]
Lower the compiler warning: unused-but-set-variable.

Approved by: bapt (mentor)
Differential Revision: D3556

8 years agoFor UGA, the frame buffer address obtained by scanning the
marcel [Thu, 3 Sep 2015 04:35:17 +0000 (04:35 +0000)]
For UGA, the frame buffer address obtained by scanning the
PCI BARs does not necessarily correspond to the upper-left
most pixel. Scan the frame buffer for which byte changed
when changing the pixel at (0,0).

Use the same technique to determine the stride. Except for
changing the pixel at (0,0), we change the pixel at (0,1).

PR: 202730
Tested by: hartzell (at) alerce.com

8 years agoFix mandoc(1) "WARNING: end of line whitespace"
dteske [Thu, 3 Sep 2015 03:58:59 +0000 (03:58 +0000)]
Fix mandoc(1) "WARNING: end of line whitespace"

MFC after: 3 days
X-MFC-to: stable/10

8 years agoRemove non-functional examples.
dteske [Thu, 3 Sep 2015 03:29:44 +0000 (03:29 +0000)]
Remove non-functional examples.

MFC after: 3 days
X-MFC-to: stable/10

8 years agoEnable both i2c1 and i2c2. These devices are disabled in TI's DTS
gonzo [Thu, 3 Sep 2015 02:28:18 +0000 (02:28 +0000)]
Enable both i2c1 and i2c2. These devices are disabled in TI's DTS
so they were disabled during DTS transition. Though there are
no standard devices/drivers on them people might use iic(4) userland
interface to access these buses.

8 years agopmap_mapdev_attr() also takes a vm_paddr_t.
jhibbits [Thu, 3 Sep 2015 01:38:15 +0000 (01:38 +0000)]
pmap_mapdev_attr() also takes a vm_paddr_t.

This was missed in r235936.  With recent work for 36-bit paddr, this is now
needed.

8 years agoDon't leak 'var'.
delphij [Thu, 3 Sep 2015 01:15:23 +0000 (01:15 +0000)]
Don't leak 'var'.

Reported by: clang static analyzer

8 years agofd: remove UMA_ZONE_ZINIT argument from Files zone
mjg [Wed, 2 Sep 2015 23:14:39 +0000 (23:14 +0000)]
fd: remove UMA_ZONE_ZINIT argument from Files zone

Originally it was added in order to prevent trashing of objects with
INVARIANTS enabled. The same effect is now provided with mere UMA_ZONE_NOFREE.

This reverts r286921.

Discussed with: kib

8 years agoDon't trash memory from UMA_ZONE_NOFREE zones.
mjg [Wed, 2 Sep 2015 23:09:01 +0000 (23:09 +0000)]
Don't trash memory from UMA_ZONE_NOFREE zones.

Objects obtained from such zones are supposed to retain type stability,
which was violated by aforementioned trashing.

This is a follow-up to r284861.

Discussed with: kib

8 years agoioat(4): pci_save/restore_state to persist MSI-X registers over BDXDE reset
cem [Wed, 2 Sep 2015 22:48:41 +0000 (22:48 +0000)]
ioat(4): pci_save/restore_state to persist MSI-X registers over BDXDE reset

Also for BWD devices, per jimharris@.

Reviewed by: jhb
Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3552

8 years agoMinor code cleanups (no functional changes).
dteske [Wed, 2 Sep 2015 21:53:48 +0000 (21:53 +0000)]
Minor code cleanups (no functional changes).

MFC after: 3 days
X-MFC-to: stable/10

8 years agosh: Allow empty << EOF markers.
jilles [Wed, 2 Sep 2015 19:49:55 +0000 (19:49 +0000)]
sh: Allow empty << EOF markers.

8 years agoSimplify kvm symbol resolution and error handling. The symbol table
hrs [Wed, 2 Sep 2015 18:51:36 +0000 (18:51 +0000)]
Simplify kvm symbol resolution and error handling.  The symbol table
nl_symbols will eventually be organized into several modules depending
on MK_* variables.

8 years agoDivide statistics in the number of packets with 1000 instead of 1024
hrs [Wed, 2 Sep 2015 18:42:35 +0000 (18:42 +0000)]
Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR: 183598

8 years agoAfter the introduction of direct dispatch, the pacing code in g_down()
imp [Wed, 2 Sep 2015 17:29:30 +0000 (17:29 +0000)]
After the introduction of direct dispatch, the pacing code in g_down()
broke in two ways. One, the pacing variable was accessed in multiple
threads in an unsafe way. Two, since large numbers of I/O could come
down from the buf layer at one time, large numbers of allocation
failures could happen all at once, resulting in a huge pace value that
would limit I/Os to 10 IOPS for minutes (or even hours) at a
time. While a real solution to these problems requires substantial
work (to go to a no-allocation after the first model, or to have some
way to wait for more memory with some kind of reserve for pager and
swapper requests), it is relatively easy to make this simplistic
pacing less pathological.

Move to using a volatile variable with loads and stores. While this is
a little racy, losing the race is safe: either you get memory and
proceed, or you don't and queue. Second, sleep for 1ms (or one tick, whichever
is larger) instead of 100ms. This removes the artificial 10 IOPS limit
while still easing up on new I/Os during memory shortages. Remove
tying the amount of time we do this to the number of failed requests
and do it only as long as we keep failing requests.

Finally, to avoid needless recursion when memory is tight (start ->
g_io_deliver() -> g_io_request() -> start -> ... until we use 1/2 the
stack), don't do direct dispatch while pacing. This should be a rare
event (not steady state) so the performance hit here is worth the
extra safety of not starving g_down() with directly dispatched I/O.

Differential Review: https://reviews.freebsd.org/D3546

8 years ago- snprintf() returns at most size-1 of the chars printed into
hrs [Wed, 2 Sep 2015 16:50:49 +0000 (16:50 +0000)]
- snprintf() returns at most size-1 of the chars printed into
  the buffer.  (n == hostlen) also means the buffer length was
  too short.

- Use sdl->sdl_data only when (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0)
  to prevent redundant output.

8 years agoioat: re-initialize interrupts after resetting hw on BDXDE
cem [Wed, 2 Sep 2015 16:48:03 +0000 (16:48 +0000)]
ioat: re-initialize interrupts after resetting hw on BDXDE

Resetting some generations of the I/OAT hardware (just BDXDE for now)
resets the corresponding MSI-X registers.  So, teardown and
re-initialize interrupts after resetting the hardware.

Reviewed by: jimharris
Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3549

8 years agoFix a panic which was reproducible by an infinite loop of
hrs [Wed, 2 Sep 2015 16:30:45 +0000 (16:30 +0000)]
Fix a panic which was reproducible by an infinite loop of
"ifconfig epair0 create && ifconfig epair0a destroy".

This was caused by an uninitialized function pointer in
softc->media.

8 years agoThe ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for
glebius [Wed, 2 Sep 2015 15:42:14 +0000 (15:42 +0000)]
The ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for
a one word variable, which is quite unexpected from documentation.
So, to avoid double installation of a single kernel, protect the extra
kernels loop with ${BUILDKERNELS:[#]} > 1 conditional.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoRemove the software queue, which is a remnant of ifnet ifqueue.
glebius [Wed, 2 Sep 2015 15:23:51 +0000 (15:23 +0000)]
Remove the software queue, which is a remnant of ifnet ifqueue.

Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

8 years agoAdd iwm(4), that was missing in r287394.
glebius [Wed, 2 Sep 2015 14:38:16 +0000 (14:38 +0000)]
Add iwm(4), that was missing in r287394.

Submitted by: Shawn Webb

8 years agoFix markup.
trasz [Wed, 2 Sep 2015 14:10:09 +0000 (14:10 +0000)]
Fix markup.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoIt's 2015, and some people are still trying to use fdisk and then
trasz [Wed, 2 Sep 2015 14:08:43 +0000 (14:08 +0000)]
It's 2015, and some people are still trying to use fdisk and then
go asking what debug flags to set for GEOM to make it work.  Advice
them to use gpart(8) instead.

Something similar should probably done with disklabel,
but I need to rewrite the disklabel examples first.

Reviewed by: wblock@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3315

8 years agoFixes a panic triggered by threaded Linux applications when running
trasz [Wed, 2 Sep 2015 14:04:13 +0000 (14:04 +0000)]
Fixes a panic triggered by threaded Linux applications when running
with RACCT/RCTL enabled.

Reviewed by: ngie@, ed@
Tested by: Larry Rosenman <ler@lerctr.org>
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3470

8 years agoFix dynamic attach/detach of 802.11 devices after r287197:
glebius [Wed, 2 Sep 2015 12:46:42 +0000 (12:46 +0000)]
Fix dynamic attach/detach of 802.11 devices after r287197:

o In pccard_ether add code to start children of a 802.11
  device, that are configured in rc.conf.
o In devd.conf provide a regex matching all 802.11 devices,
  and on match run pccard_ether to spawn children.

PR: 202784
Submitted by: <vidwer gmail.com>
In collaboration with: "Oleg V. Nauman" <oleg opentransfer.com>

8 years agoBump version for altered long-opts processing
dteske [Tue, 1 Sep 2015 22:39:09 +0000 (22:39 +0000)]
Bump version for altered long-opts processing

MFC after: 3 days
X-MFC-to: stable/10

8 years agoSimplify long-option processing
dteske [Tue, 1 Sep 2015 22:37:33 +0000 (22:37 +0000)]
Simplify long-option processing

MFC after: 3 days
X-MFC-to: stable/10

8 years agoThe 'sa' argument to syscallret() is not unused.
jhb [Tue, 1 Sep 2015 22:28:23 +0000 (22:28 +0000)]
The 'sa' argument to syscallret() is not unused.

8 years agoExport current system call code and argument count for system call entry
jhb [Tue, 1 Sep 2015 22:24:54 +0000 (22:24 +0000)]
Export current system call code and argument count for system call entry
and exit events. procfs stop events for system call tracing report these
values (argument count for system call entry and code for system call exit),
but ptrace() does not provide this information. (Note that while the system
call code can be determined in an ABI-specific manner during system call
entry, it is not generally available during system call exit.)

The values are exported via new fields at the end of struct ptrace_lwpinfo
available via PT_LWPINFO.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3536

8 years agoBump version for prior fix (SVN r287381)
dteske [Tue, 1 Sep 2015 21:52:56 +0000 (21:52 +0000)]
Bump version for prior fix (SVN r287381)

MFC after: 3 days
X-MFC-to: stable/10

8 years agoStyle: Remove whitespace around brackets from function syntax options
dteske [Tue, 1 Sep 2015 21:50:55 +0000 (21:50 +0000)]
Style: Remove whitespace around brackets from function syntax options

MFC after: 3 days
X-MFC-to: stable/10

8 years agoComment for escape() function.
dteske [Tue, 1 Sep 2015 21:48:22 +0000 (21:48 +0000)]
Comment for escape() function.

MFC after: 3 days
X-MFC-to: stable/10

8 years agoComment
dteske [Tue, 1 Sep 2015 21:42:00 +0000 (21:42 +0000)]
Comment

MFC after: 3 days
X-MFC-to: stable/10

8 years agoProperly escape arguments when moving into jail or chroot
dteske [Tue, 1 Sep 2015 21:40:04 +0000 (21:40 +0000)]
Properly escape arguments when moving into jail or chroot

MFC after: 3 days
X-MFC-to: stable/10

8 years agoStyle: comments
dteske [Tue, 1 Sep 2015 21:20:43 +0000 (21:20 +0000)]
Style: comments

MFC after: 3 days
X-MFC-to: stable/10

8 years agoStyle consistency: add single space before each `;;' case entry
dteske [Tue, 1 Sep 2015 21:19:45 +0000 (21:19 +0000)]
Style consistency: add single space before each `;;' case entry

MFC after: 3 days
X-MFC-to: stable/10

8 years agoRemove `SYSRC_' prefix from $SYSRC_VERBOSE (prefix unnecessary since
dteske [Tue, 1 Sep 2015 21:18:33 +0000 (21:18 +0000)]
Remove `SYSRC_' prefix from $SYSRC_VERBOSE (prefix unnecessary since
this is a non-inheritable attribute; was previously).

MFC after: 3 days
X-MFC-to: stable/10

8 years agopf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set
kp [Tue, 1 Sep 2015 19:04:04 +0000 (19:04 +0000)]
pf: Fix misdetection of forwarding when net.link.bridge.pfil_bridge is set

If net.link.bridge.pfil_bridge is set we can end up thinking we're forwarding in
pf_test6() because the rcvif and the ifp (output interface) are different.
In that case we're bridging though, and the rcvif the the bridge member on which
the packet was received and ifp is the bridge itself.
If we'd set dir to PF_FWD we'd end up calling ip6_forward() which is incorrect.

Instead check if the rcvif is a member of the ifp bridge. (In other words, the
if_bridge is the ifp's softc). If that's the case we're not forwarding but
bridging.

PR: 202351
Reviewed by: eri
Differential Revision: https://reviews.freebsd.org/D3534

8 years agoFix an off by one error in r283613: Like regular ffs(), CPU_FFS() returns
jhb [Tue, 1 Sep 2015 17:52:43 +0000 (17:52 +0000)]
Fix an off by one error in r283613:  Like regular ffs(), CPU_FFS() returns
1 for CPU 0, etc. so the return value must be decremented to obtain the
first valid CPU ID.

Submitted by: fabient
MFC after: 1 week

8 years agoAdd support for the dwc usb in the HiSilicon hi6220 in the HiKey board. For
andrew [Tue, 1 Sep 2015 17:13:04 +0000 (17:13 +0000)]
Add support for the dwc usb in the HiSilicon hi6220 in the HiKey board. For
this we need to force the driver into host mode, as without this the driver
fails to detect any devices.

Relnotes: yes
Sponsored by: ABT Systems Ltd

8 years agoMake most of port methods optional and remove bunch of dummies.
mav [Tue, 1 Sep 2015 16:28:06 +0000 (16:28 +0000)]
Make most of port methods optional and remove bunch of dummies.

8 years agoAdd support for the DesignWare MMC hardware in the HiSilicon hi6220. This
andrew [Tue, 1 Sep 2015 16:25:12 +0000 (16:25 +0000)]
Add support for the DesignWare MMC hardware in the HiSilicon hi6220. This
SoC is used in the HiKey board from 96boards.

Currently on the SD card is working on the HiKey, as such devices 0 and 2
will need to be disabled, for example by adding the following to
loader.conf:

hint.hisi_dwmmc.0.disabled=1
hint.hisi_dwmmc.2.disabled=1

Relnotes: yes (Hikey board booting)
Sponsored by: ABT Systems Ltd

8 years agoFix how we place each objects thread local data. The code used was based
andrew [Tue, 1 Sep 2015 15:57:03 +0000 (15:57 +0000)]
Fix how we place each objects thread local data. The code used was based
on the Variant II code, however arm64 uses Variant I. The former placed the
thread pointer after the data, pointing at the thread control block, while
the latter places these before said data.

Because of this we need to use the size of the previous entry to calculate
where to place the current entry. We also need to reserve 16 bytes at the
start for the thread control block.

This also fixes the value of TLS_TCB_SIZE to be correct. This is the size
of two unsigned longs, i.e. 2 * 8 bytes.

While here remove the bogus adjustment of the pointer in the
R_AARCH64_TLS_TPREL64 case. It should be the offset of the data relative
to the thread pointer, including the thread control block.

Sponsored by: ABT Systems Ltd

8 years agoEnsure we use calculate_first_tls_offset, even if the main program doesn't
andrew [Tue, 1 Sep 2015 15:43:56 +0000 (15:43 +0000)]
Ensure we use calculate_first_tls_offset, even if the main program doesn't
have TLS program header. This is needed on architectures with Variant I
tls, that is arm, arm64, mips, and powerpc. These place the thread control
block at the start of the buffer and, without this, this data may be
trashed.

This appears to not be an issue on mips or powerpc as they include a second
adjustment to move the thread local data, however this is on arm64 (with a
future change to fix placing this data), and should be on arm. I am unable
to trigger this on arm, even after changing the code to move the data
around to make it more likely to be hit. This is most likely because my
tests didn't use the variable in offset 0.

Reviewed by: kib
MFC after: 1 week
Sponsored by: ABT Systems Ltd

8 years agoRemove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant
gjb [Tue, 1 Sep 2015 15:28:35 +0000 (15:28 +0000)]
Remove '-' separating OSRELEASE and SNAPSHOT_DATE for vagrant
builds, and prepend it to SNAPSHOT_DATE to prevent a trailing '-'
in the final box name for a release build.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoFinish allowing the dwmmc driver to be subclassed, move the softc to a new
andrew [Tue, 1 Sep 2015 15:26:21 +0000 (15:26 +0000)]
Finish allowing the dwmmc driver to be subclassed, move the softc to a new
header, along with the hwtype enum, device attach prototype, and driver_t.

Sponsored by: ABT Systems Ltd

8 years agoExit notification for EVFILT_PROC removes knote from the knlist. In
kib [Tue, 1 Sep 2015 14:05:29 +0000 (14:05 +0000)]
Exit notification for EVFILT_PROC removes knote from the knlist.  In
particular, this invalidates the knote kn_link linkage, making the
SLIST_FOREACH() loop accessing undefined values (e.g. trashed by
QUEUE_MACRO_DEBUG).  If the knote is freed by other thread when kq
lock is released or when influx is cleared, e.g. by knote_scan() for
kqueue owning the knote, the iteration step would access freed memory.

Use SLIST_FOREACH_SAFE() to fix iteration.

Diagnosed by: avg
Tested by: avg, lstewart, pawel
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoInstall the forth bits on arm64. For now limit it to just arm64 as on x86
andrew [Tue, 1 Sep 2015 13:51:07 +0000 (13:51 +0000)]
Install the forth bits on arm64. For now limit it to just arm64 as on x86
these should have been installed as part of the regular loader.

8 years agoClean up the kqueue use of the uma KPI.
kib [Tue, 1 Sep 2015 13:21:32 +0000 (13:21 +0000)]
Clean up the kqueue use of the uma KPI.

Explain why it is fine to not check for M_NOWAIT failures in
kqueue_register().  Remove unneeded check for NULL result from
waitable allocation in kqueue_scan().  uma_free(9) handles NULL
argument correctly, remove checks for NULL.  Remove useless cast and
adjust style in knote_alloc().

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoBy doing file extension fast, it is possible to create excess supply
kib [Tue, 1 Sep 2015 13:07:27 +0000 (13:07 +0000)]
By doing file extension fast, it is possible to create excess supply
of the D_NEWBLK kinds of dependencies (i.e. D_ALLOCDIRECT and
D_ALLOCINDIR), which can exhaust kmem.

Handle excess of D_NEWBLK in the same way as excess of D_INODEDEP and
D_DIRREM, by scheduling ast to flush dependencies, after the thread,
which created new dep, left the VFS/FFS innards.  For D_NEWBLK, the
only way to get rid of them is to do full sync, since items are
attached to data blocks of arbitrary vnodes.  The check for D_NEWBLK
excess in softdep_ast_cleanup_proc() is unlocked.

For 32bit arches, reduce the total amount of allowed dependencies by
two.  It could be considered increasing the limit for 64 bit platforms
with direct maps.

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

8 years agoFix t_spawnattr test for attributes handling by posix_spawn(3).
kib [Tue, 1 Sep 2015 12:47:11 +0000 (12:47 +0000)]
Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.

The code assumed that SCHED_* constants form a contiguous set of
numbers, remove the assumption by using schedulers[] array in
get_different_scheduler().  This is no-op on FreeBSD, but improves
code portability.

The selection of different priority used the min/max priority range of
the current scheduler class, instead of the priority to be changed to.
The bug caused the test failure.

Remove duplication of POSIX_SPAWN_SETSIGDEF flag and now unused
duplications of MIN/MAX definitions.

Reviewed by: jilles, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3533

8 years agoNot only build with buildworld, but also install with installworld all
glebius [Tue, 1 Sep 2015 11:59:12 +0000 (11:59 +0000)]
Not only build with buildworld, but also install with installworld all
alternative kernels.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.