]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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.

8 years agoWhen building multiple kernels use [2..-1] to extract !INSTALLKERNEL
glebius [Tue, 1 Sep 2015 11:46:13 +0000 (11:46 +0000)]
When building multiple kernels use [2..-1] to extract !INSTALLKERNEL
from BUILDKERNELS list.  This is more strict, since INSTALLKERNEL by
definition is the first word of BUILDKERNELS list.  The previous
code failed if INSTALLKERNEL is a substring of additional kernel name.

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

8 years agoRemove an variable we only ever write to, and stop assigning 0 to values
andrew [Tue, 1 Sep 2015 10:47:42 +0000 (10:47 +0000)]
Remove an variable we only ever write to, and stop assigning 0 to values
in the softc as it's the default value. The latter helps with subclassing
this driver.

Sponsored by: ABT Systems Ltd

8 years agoAdd new PCI ID.
hselasky [Tue, 1 Sep 2015 09:33:24 +0000 (09:33 +0000)]
Add new PCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 month
PR: 202807

8 years agocallout_reset: fix a reversed check for cc_exec_cancel
avg [Tue, 1 Sep 2015 09:27:14 +0000 (09:27 +0000)]
callout_reset: fix a reversed check for cc_exec_cancel

The typo was introduced in r278469 / 344ecf88af2dfb.

As a result of the bug there was a timing window where callout_reset()
would fail to cancel a concurrent execution of a callout that is about
to start and would schedule the callout again.
The callout would fire more times than it is scheduled.
That would happen even if the callout is initialized with a lock.

For example, the bug triggered the "Stray timeout" assertion in
taskqueue_timeout_func().

MFC after: 5 days

8 years agoUse unsigned variable.
rodrigc [Tue, 1 Sep 2015 09:22:24 +0000 (09:22 +0000)]
Use unsigned variable.

Eliminates gcc 4.9 compiler warning.

8 years ago- Add -W flag support for network column in intpr() (-i flag) and
hrs [Tue, 1 Sep 2015 08:42:04 +0000 (08:42 +0000)]
- Add -W flag support for network column in intpr() (-i flag) and
  routepr() (-r flag).  It is too narrow to show an IPv6 prefix
  in most cases.

- Accept "local" as a synonym of "unix" in protocol family name.

- Show a prefix length in CIDR notation when name resolution failed in
  netname().

- Make routename() and netname() AF-independent and remove
  unnecessary typecasting from struct sockaddr.

- Use getnameinfo(3) to format L2 addr in intpr().

- Fix a bug which showed "Address" when -A flag is specfied in pr_rthdr().

- Replace cryptic GETSA() macro with SA_SIZE().

- Fix declarations shadowing local variables with the same names.

- Add more static, remove unused header files and variables.

MFC after: 1 week

8 years agoUse ANSI C prototypes.
rodrigc [Tue, 1 Sep 2015 08:34:44 +0000 (08:34 +0000)]
Use ANSI C prototypes.

Eliminates gcc 4.9 warnings.

8 years agoPrint sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does.
hrs [Tue, 1 Sep 2015 08:29:39 +0000 (08:29 +0000)]
Print sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does.

MFC after: 1 week

8 years agoUse correct function prototype for signal handler.
rodrigc [Tue, 1 Sep 2015 07:33:36 +0000 (07:33 +0000)]
Use correct function prototype for signal handler.

Eliminates gcc 4.9 warning.

8 years agoUse ANSI C prototypes.
rodrigc [Tue, 1 Sep 2015 07:32:03 +0000 (07:32 +0000)]
Use ANSI C prototypes.

Eliminates gcc 4.9 warnings.

8 years agoCheck and fail if drop of privileges failed.
delphij [Tue, 1 Sep 2015 06:32:02 +0000 (06:32 +0000)]
Check and fail if drop of privileges failed.

MFC after: 2 weeks

8 years agoDrop group privileges after opening the kvm descriptor, otherwise, the code
delphij [Tue, 1 Sep 2015 06:28:16 +0000 (06:28 +0000)]
Drop group privileges after opening the kvm descriptor, otherwise, the code
would not drop privileges as expected.

While there also add checks for the drop and bail out immediately if we
failed.

MFC after: 3 days

8 years agoHandle held pages earlier in the inactive queue scan.
alc [Tue, 1 Sep 2015 06:21:12 +0000 (06:21 +0000)]
Handle held pages earlier in the inactive queue scan.

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

8 years agoFailure of dropping privilege should be fatal, so test and bail out
delphij [Tue, 1 Sep 2015 06:05:43 +0000 (06:05 +0000)]
Failure of dropping privilege should be fatal, so test and bail out
when setgid() fails.

Reported by: clang static analyzer
MFC after: 2 weeks

8 years agoMark unused parameters to reduce gcc 4.9 warnings.
rodrigc [Tue, 1 Sep 2015 02:42:05 +0000 (02:42 +0000)]
Mark unused parameters to reduce gcc 4.9 warnings.

8 years agoUse ANSI C prototypes.
rodrigc [Tue, 1 Sep 2015 02:39:07 +0000 (02:39 +0000)]
Use ANSI C prototypes.

Eliminates gcc 4.9 warnings.

8 years agovtfontcvt: fix buffer overflow for non-default size .hex fonts
emaste [Tue, 1 Sep 2015 01:35:43 +0000 (01:35 +0000)]
vtfontcvt: fix buffer overflow for non-default size .hex fonts

Sponsored by: The FreeBSD Foundation

8 years agoApply the noline attribute to vdev_queue_max_async_writes
allanjude [Mon, 31 Aug 2015 23:10:42 +0000 (23:10 +0000)]
Apply the noline attribute to vdev_queue_max_async_writes

This makes it possible to analyze the performance of the new ZFS
write throttle with dtrace

PR: 200316
Submitted by: Lacey Powers <lacey.leanne@gmail.com>
Reviewed by: avg, smh, delphij (no objection)
Approved by: bapt (mentor)
MFC after: 1 month
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3472

8 years agovtfontcvt: introduce xmalloc to abort on out-of-memory
emaste [Mon, 31 Aug 2015 23:08:39 +0000 (23:08 +0000)]
vtfontcvt: introduce xmalloc to abort on out-of-memory

Sponsored by: The FreeBSD Foundation

8 years agoRemove duplicate defines introduced in initial ZFS import (r168404)
allanjude [Mon, 31 Aug 2015 22:36:17 +0000 (22:36 +0000)]
Remove duplicate defines introduced in initial ZFS import (r168404)

This change reduces compiler warnings by removing duplicate defines

Line numbers are from r168404 (and r284648)
#define lbolt: lines 384 and 459 (531 and 648) (original was renamed later)
#define lbolt64: lines 385 and 460 (532 and 649) (original was renamed later)
#define gethrestime_sec: lines 390 and 465 (540 and 653)
uint64_t physmem: lines 402 and 463 (561 and 651)

Reviewed by: smh, delphij
Approved by: bapt (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2878

8 years agoEnable libproc symbol_lookup tests on arm64
emaste [Mon, 31 Aug 2015 20:30:06 +0000 (20:30 +0000)]
Enable libproc symbol_lookup tests on arm64

This reverts part of r286863, as the kernel support required by these
tests was added in r287105.

PR: 202305
Sponsored by: The FreeBSD Foundation

8 years agoInclude stdlib.h to get devname() prototype.
rodrigc [Mon, 31 Aug 2015 19:40:54 +0000 (19:40 +0000)]
Include stdlib.h to get devname() prototype.

Eliminates -Wmissing-prototypes warnings with gcc

8 years agoRestrict tso_max to IP_MAXPACKET to avoid the panic reported in:
sbruno [Mon, 31 Aug 2015 19:12:10 +0000 (19:12 +0000)]
Restrict tso_max to IP_MAXPACKET to avoid the panic reported in:
https://lists.freebsd.org/pipermail/freebsd-current/2015-August/057192.html

Submitted by: pyunyh@gmail.com
MFC after: 2 weeks

8 years agoar: Deobfuscate a while loop
emaste [Mon, 31 Aug 2015 18:07:17 +0000 (18:07 +0000)]
ar: Deobfuscate a while loop

8 years agoar: fix deterministic mode when running as ranlib
emaste [Mon, 31 Aug 2015 12:28:13 +0000 (12:28 +0000)]
ar: fix deterministic mode when running as ranlib

This was broken by r286024.

PR: 202741
Submitted by: fk@fabiankeil.de
Obtained from: ElectroBSD

8 years agoRemove now unneeded includes.
glebius [Mon, 31 Aug 2015 10:43:00 +0000 (10:43 +0000)]
Remove now unneeded includes.

8 years agoClean up the style of the LEAVE_HYP macro.
andrew [Mon, 31 Aug 2015 09:39:16 +0000 (09:39 +0000)]
Clean up the style of the LEAVE_HYP macro.

8 years agoAdd new USB quirk.
hselasky [Mon, 31 Aug 2015 07:18:13 +0000 (07:18 +0000)]
Add new USB quirk.

MFC after: 1 week
PR: 202783

8 years ago - uri is expected to be nul-terminated (strchr used later),
delphij [Mon, 31 Aug 2015 06:11:39 +0000 (06:11 +0000)]
 - uri is expected to be nul-terminated (strchr used later),
   so use strlcpy instead of strncpy.
 - unroll the other two cases of strncpy+\0 to strlcpy.

MFC after: 2 weeks

8 years agoConstify opt_f and opt_t and eliminate unneeded copying. This fixes
delphij [Mon, 31 Aug 2015 05:57:26 +0000 (05:57 +0000)]
Constify opt_f and opt_t and eliminate unneeded copying.  This fixes
memory leaks.

Reported by: clang static analyzer
MFC after: 2 weeks

8 years agoSimplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
melifaro [Mon, 31 Aug 2015 05:03:36 +0000 (05:03 +0000)]
Simplify lla_rt_output()/nd6_add_ifa_lle() by setting lle state in
  alloc handler, based on flags.

8 years agoAdd support for the UGA draw protocol. This includes adding a
marcel [Sun, 30 Aug 2015 23:58:53 +0000 (23:58 +0000)]
Add support for the UGA draw protocol. This includes adding a
command called 'uga' to show whether UGA is implemented by the
firmware and what the settings are. It also includes filling
the efi_fb structure from the UGA information when GOP isn't
implemented by the firmware.

Since UGA does not provide information about the stride, we
set the stride to the horizontal resolution. This is likely
not correct and we should determine the stride by trial and
error. For now, this should show something on the console
rather than nothing.

Refactor this file to maximize code reuse.

PR: 202730

8 years agoAdd the LED definitions from vendor's DTS.
loos [Sun, 30 Aug 2015 23:20:00 +0000 (23:20 +0000)]
Add the LED definitions from vendor's DTS.

Add gpioled support to A20 kernel.

While here rename the gpio phandle to match the one used in the vendor's
DTS.

8 years agoThe vendor's DTS for Allwinner A20 uses a different way to map the gpio
loos [Sun, 30 Aug 2015 22:38:06 +0000 (22:38 +0000)]
The vendor's DTS for Allwinner A20 uses a different way to map the gpio
pins, they specify the bank and the pin in two separated cells.

This allow the use of vendor's DTS definitions by adding a gpio map
routine that copes with that.

8 years agooops - mis-commit.
adrian [Sun, 30 Aug 2015 21:55:01 +0000 (21:55 +0000)]
oops - mis-commit.

8 years agoConvert this over to use the new cdev based ioctl path.
adrian [Sun, 30 Aug 2015 21:54:47 +0000 (21:54 +0000)]
Convert this over to use the new cdev based ioctl path.

8 years agoMigrate the stats API for iwn(4) into a cdev ioctl, rather than tying
adrian [Sun, 30 Aug 2015 21:54:33 +0000 (21:54 +0000)]
Migrate the stats API for iwn(4) into a cdev ioctl, rather than tying
into the vap.

This allows for possible hardware interaction without needing a vap
configured.

8 years agoA bibliography of FreeBSD and BSD related papers and books.
gnn [Sun, 30 Aug 2015 20:59:19 +0000 (20:59 +0000)]
A bibliography of FreeBSD and BSD related papers and books.
Keep this file in order by primary key which is the first author's
last name and the year of publication.

8 years agoUse P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
kib [Sun, 30 Aug 2015 18:02:57 +0000 (18:02 +0000)]
Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.  It was intended to be used there, compare with the
min value, and with the test for correctness in ksched_setscheduler().

Note that P1B_PRIO_MAX and RTP_PRIO_MAX do have the same numerical
values, the change is cosmetical.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoRemove single-use macros obfuscating malloc(9) and free(9) calls.
kib [Sun, 30 Aug 2015 17:58:11 +0000 (17:58 +0000)]
Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agosh: Fix read with escaped IFS characters at the end.
jilles [Sun, 30 Aug 2015 17:24:22 +0000 (17:24 +0000)]
sh: Fix read with escaped IFS characters at the end.

Characters escaped with a backslash must be treated as if they were not in
IFS. This includes stripping trailing IFS characters.

8 years agoReduce the difference to vendor DTS by using the vendor compat strings (at
loos [Sun, 30 Aug 2015 16:10:12 +0000 (16:10 +0000)]
Reduce the difference to vendor DTS by using the vendor compat strings (at
some point we have to use the complete vendor DTS files, but we're not
there yet).

8 years agoIn preparation to support other A20 based boards, rename the CUBIEBOARD2
loos [Sun, 30 Aug 2015 15:38:41 +0000 (15:38 +0000)]
In preparation to support other A20 based boards, rename the CUBIEBOARD2
kernel configuration to A20.

There are other boards (namely the banana pi) that use exactly the same
devices.

Additionally, we are moving from static FDT support (DTB compiled
in-kernel) to DTB passed to kernel by the boot loader (ubldr).  The u-boot
for these boards are already available on ports and as the crochet support
for these boards isn't committed yet, this should not bring any issues.

Discussed with: ian

8 years agoRevert r286880: If at first this change made sense, it turns out
jch [Sun, 30 Aug 2015 13:44:46 +0000 (13:44 +0000)]
Revert r286880:  If at first this change made sense, it turns out
it helps only the TCP timers callout(9) usage.  As the benefit for
others callout(9) usages did not reach a consensus the historical
usage should prevail.

Differential Revision:      https://reviews.freebsd.org/D3078

8 years agoPut r284245 back in place: If at first this fix was seen as a temporary
jch [Sun, 30 Aug 2015 13:44:39 +0000 (13:44 +0000)]
Put r284245 back in place:  If at first this fix was seen as a temporary
workaround for a callout(9) issue, it turns out it is instead the right
way to use callout in mpsafe mode without using callout_drain().

r284245 commit message:

Fix a callout race condition introduced in TCP timers callouts with r281599.
In TCP timer context, it is not enough to check callout_stop() return value
to decide if a callout is still running or not, previous callout_reset()
return values have also to be checked.

Differential Revision: https://reviews.freebsd.org/D2763

8 years agoRemove support for FreeBSD < 602110.
delphij [Sun, 30 Aug 2015 08:48:31 +0000 (08:48 +0000)]
Remove support for FreeBSD < 602110.

8 years agoFix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
adrian [Sun, 30 Aug 2015 08:46:50 +0000 (08:46 +0000)]
Fix compilation error on gcc-5.2.0 - it now warns on non-paranthen'ed
logical negation when used in this fashion.

Tested:

* compile only

8 years agoDon't assign 'ptr' without using it.
delphij [Sun, 30 Aug 2015 08:38:59 +0000 (08:38 +0000)]
Don't assign 'ptr' without using it.

Reported by: clang static analyzer
MFC after: 2 weeks

8 years agoFix a mistake in r287292. Despite correctly stating intent in the
kib [Sun, 30 Aug 2015 04:46:44 +0000 (04:46 +0000)]
Fix a mistake in r287292.  Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 6 days

8 years agoAdd a gop command to help diagnose VT efifb problems. The gop
marcel [Sun, 30 Aug 2015 01:39:59 +0000 (01:39 +0000)]
Add a gop command to help diagnose VT efifb problems. The gop
command has the following sub-commands:
  list - list all possible modes (paged)
  get - return the current mode
  set <mode> - set the current mode to <mode>

8 years ago- Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
rodrigc [Sat, 29 Aug 2015 19:47:20 +0000 (19:47 +0000)]
- Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
- Add missing <err.h> for err() and <sys/sysctl.h> for sysctlbyname()
- NULL -> 0 for 5th parameter of sysctlbyname()

Submitted by: Andriy Voskoboinyk <s3erios@gmail com>
Differential Revision: https://reviews.freebsd.org/D3442

8 years agosh: Add set -o nolog.
jilles [Sat, 29 Aug 2015 19:41:47 +0000 (19:41 +0000)]
sh: Add set -o nolog.

POSIX requires this to prevent entering function definitions in history but
this implementation does nothing except retain the option's value. In ksh88,
function definitions were usually entered in the history file, even when
they came from ~/.profile and the $ENV file, to allow displaying their
definitions.

This is also the first option that does not have a letter.

8 years agoSupport the ZTE MF112 HSUPA 3G USB stick.
gavin [Sat, 29 Aug 2015 18:37:09 +0000 (18:37 +0000)]
Support the ZTE MF112 HSUPA 3G USB stick.

MFC after: 1 week

8 years agoUse 5 times RTO.Max as the default for the shutdown guard timer
tuexen [Sat, 29 Aug 2015 17:26:29 +0000 (17:26 +0000)]
Use 5 times RTO.Max as the default for the shutdown guard timer
as required by RFC 4960. The sysctl variable can be used to
overwrite this.

Discussed with: rrs
MFC after: 1 week

8 years agoRemove 600 bytes of port_priv from struct ctl_io_hdr.
mav [Sat, 29 Aug 2015 15:33:31 +0000 (15:33 +0000)]
Remove 600 bytes of port_priv from struct ctl_io_hdr.

This field used only for camtgt frontend, and once it any way preallocates
all requests, let it preallocate this memory too, not bothering core code.

8 years agoSwitch libc from using _sig{procmask,action,suspend} symbols, which
kib [Sat, 29 Aug 2015 14:25:01 +0000 (14:25 +0000)]
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by: Pete French <petefrench@ingresso.co.uk>
Tested by: Michiel Boland <boland37@xs4all.nl>
Reviewed by: jilles (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoAttach pass driver to LUNs is OFFLINE state.
mav [Sat, 29 Aug 2015 11:21:20 +0000 (11:21 +0000)]
Attach pass driver to LUNs is OFFLINE state.

Previously such LUNs were silently ignored.  But while they indeed unable
to process most of SCSI commands, some, like RTPG, they still can.

MFC after: 1 month