]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoSome style changes. Fix a typo in comment.
kib [Wed, 3 Aug 2016 08:53:29 +0000 (08:53 +0000)]
Some style changes.  Fix a typo in comment.

Approved by: des (pseudofs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoExplain why swapgeom_close_ev() is delegated.
kib [Wed, 3 Aug 2016 07:11:19 +0000 (07:11 +0000)]
Explain why swapgeom_close_ev() is delegated.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove mention of the Giant from the fork_return() description.
kib [Wed, 3 Aug 2016 07:10:09 +0000 (07:10 +0000)]
Remove mention of the Giant from the fork_return() description.
Making emphasis on this lock in the core function comment is confusing
for the modern kernel.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoRegenerate system call tables for r303699 and r303700.
ed [Wed, 3 Aug 2016 06:36:45 +0000 (06:36 +0000)]
Regenerate system call tables for r303699 and r303700.

7 years agoRe-add traling slash that was removed in r303699.
ed [Wed, 3 Aug 2016 06:35:58 +0000 (06:35 +0000)]
Re-add traling slash that was removed in r303699.

I must have accidentally pressed some random key in vim.

7 years agomprotect(): Change prototype to comply to POSIX.
ed [Wed, 3 Aug 2016 06:33:04 +0000 (06:33 +0000)]
mprotect(): Change prototype to comply to POSIX.

Our mprotect() function seems to take a "const void *" address to the
pages whose permissions need to be adjusted. POSIX uses "void *". Simply
stick to the POSIX one to prevent us from writing unportable code.

PR: 211423 (exp-run)
Tested by: antoine@ (Thanks!)

7 years agoRemove a duplicate PMC CPU number
jhibbits [Wed, 3 Aug 2016 01:46:55 +0000 (01:46 +0000)]
Remove a duplicate PMC CPU number

CPU number for MPC85XX is a duplicate for E500.  Since we don't support MPC85XX
"uncore" registers right now, rather than renumbering it simply remove it, and
it will properly use the E500 CPU ID.

7 years agoMerge MPC85XX and QorIQ config options
jhibbits [Wed, 3 Aug 2016 01:22:11 +0000 (01:22 +0000)]
Merge MPC85XX and QorIQ config options

Summary:
MPC85XX and QorIQ are very similar.  When the DPAA dTSEC driver was
added, QORIQ_DPAA was brought in as a config option to support the differences
in hardware register settings between QorIQ (e500mc-, e5500- based) SoCs and
QUICC (e500v1/e500v2-based) SoCs, particularly in the Local Access Window (LAW)
target settings.

Unify these settings using macros to hide details and ease porting, and use a
new function (mpc85xx_is_qoriq()) to distinguish between QorIQ and QUICC SoCs at
runtime.

An alternative to using the function could be to use a variable initialized at
platform attach time, which may incur less overhead at runtime.  Since it's not
in the critical path once booted, this optimization doesn't seem necessary at
first pass.

Reviewed by: nwhitehorn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7294

7 years agocxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
np [Tue, 2 Aug 2016 23:54:21 +0000 (23:54 +0000)]
cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
per-adapter data structure.  This replaces a global array with hardcoded
page sizes.

Sponsored by: Chelsio Communications

7 years agoAdd link for getnetgrent_r(3).
bdrewery [Tue, 2 Aug 2016 23:46:32 +0000 (23:46 +0000)]
Add link for getnetgrent_r(3).

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agotruss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall
bapt [Tue, 2 Aug 2016 22:47:06 +0000 (22:47 +0000)]
truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall

trussinfo->curthread must be initialized before calling enter_syscall(),
it is used by t->proc->abi->fetch_args().
Without that truss is segfaulting and the attached program also crash.

Submitted by: Nikita Kozlov (nikita@gandi.net)
Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7399

7 years agotools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
imp [Tue, 2 Aug 2016 21:55:23 +0000 (21:55 +0000)]
tools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
we need to include it in -legacy or not. Since the ifdef was removed,
this broke building 10.x and older source trees on -current. Restore
just enough of _WITH_GETLINE to allow these older source trees to
still build and properly omit getline() from their -legacy library.

7 years agokgzip.8: note that it is deprecated and clarify BUGS section
emaste [Tue, 2 Aug 2016 21:48:26 +0000 (21:48 +0000)]
kgzip.8: note that it is deprecated and clarify BUGS section

kgzip is only useful on i386 and has a number of other limitations.
We're better served by officially deprecating it and encouraging users
to use loader(8) instead.

Reviewed by: dteske, wblock
Differential Revision: https://reviews.freebsd.org/D7098

7 years agopfctl: Use const where possible.
kp [Tue, 2 Aug 2016 20:32:02 +0000 (20:32 +0000)]
pfctl: Use const where possible.

This adds const qualifiers where it is possible.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agoMove/add ARM ELF PHDR types to elf_common.h
emaste [Tue, 2 Aug 2016 20:26:04 +0000 (20:26 +0000)]
Move/add ARM ELF PHDR types to elf_common.h

Accidentally missed in r303674

7 years agoFix a segfault in bsdgrep when parsing the invalid extended regexps "?"
dim [Tue, 2 Aug 2016 20:25:22 +0000 (20:25 +0000)]
Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Reported by: Steve Kargl
MFC after: 1 week

7 years agoreadelf: report ARM program and section header types
emaste [Tue, 2 Aug 2016 20:11:04 +0000 (20:11 +0000)]
readelf: report ARM program and section header types

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7390

7 years agopfctl: Match prototype of pfctl_load_hostid.
kp [Tue, 2 Aug 2016 19:54:40 +0000 (19:54 +0000)]
pfctl: Match prototype of pfctl_load_hostid.

The prototype and the implementation of the pfctl_load_hostid used a
different data type for one of the parameters.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agoAdd ELFOSABI_ARM_AEABI ELF OSABI constant
emaste [Tue, 2 Aug 2016 18:42:32 +0000 (18:42 +0000)]
Add ELFOSABI_ARM_AEABI ELF OSABI constant

Reported by: andrew
Sponsored by: The FreeBSD Foundation

7 years agoproc_init: Fix a few memory leaks of 'phdl'
cem [Tue, 2 Aug 2016 18:13:50 +0000 (18:13 +0000)]
proc_init: Fix a few memory leaks of 'phdl'

In the normal case and correct failure cases, the 'phdl' pointer is passed to
callers to use or clean up as needed.  However, some failure cases returned
early, failing to export the phdl pointer.

This was introduced in the restructuring of r303533.

Reported by: Coverity
CID: 1361070
Reviewed by: markj
Sponsored by: EMC / Isilon Storage Division

7 years agopfctl: Allow TOS bits to be cleared
kp [Tue, 2 Aug 2016 15:41:42 +0000 (15:41 +0000)]
pfctl: Allow TOS bits to be cleared

TOS value 0 is valid, so use 256 as an invalid value rather than zero.
This allows users to enforce TOS == 0 with pf.

Reported by: Radek KrejĨa <radek.krejca@starnet.cz>

7 years agosed(1): Revert r303047 "cleanup" and therefore r303572.
pfg [Tue, 2 Aug 2016 15:35:53 +0000 (15:35 +0000)]
sed(1): Revert r303047 "cleanup" and therefore r303572.

While big, the change was meant to have no effect on behavior and instead
so far we have found two regressions: one in the etcupdate tests and
another one in the games/openttd port[1].

Revert to a known working state. We will likely have to split the patch in
functional parts before bringing back the changes.

PR: 195929
Reported by: danfe, madpilot [1]

7 years agoRemove trailing whitespace from the arm64 pmap
andrew [Tue, 2 Aug 2016 15:26:46 +0000 (15:26 +0000)]
Remove trailing whitespace from the arm64 pmap

Obtained from: ABT Systems Ltd
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation

7 years agoUpdate RISC-V port to Privileged Architecture Version 1.9.
br [Tue, 2 Aug 2016 14:50:14 +0000 (14:50 +0000)]
Update RISC-V port to Privileged Architecture Version 1.9.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoFix NULL pointer dereference.
ae [Tue, 2 Aug 2016 12:18:06 +0000 (12:18 +0000)]
Fix NULL pointer dereference.
ro pointer can be NULL when IPSec consumes mbuf.

PR: 211486
MFC after: 3 days

7 years agotcp/lro: Implement hash table for LRO entries.
sephe [Tue, 2 Aug 2016 06:36:47 +0000 (06:36 +0000)]
tcp/lro: Implement hash table for LRO entries.

This significantly improves HTTP workload performance and reduces
HTTP workload latency.

Reviewed by: rrs, gallatin, hps
Obtained from: rrs, gallatin
Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe)
Differential Revision: https://reviews.freebsd.org/D6689

7 years agolocks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case
mjg [Tue, 2 Aug 2016 03:05:59 +0000 (03:05 +0000)]
locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case

Reported by: Michael Butler <imb protected-networks.net>

7 years agolocks: fix up ifdef guards introduced in r303643
mjg [Tue, 2 Aug 2016 00:15:08 +0000 (00:15 +0000)]
locks: fix up ifdef guards introduced in r303643

Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the correct
define.

MFC after: 1 week

7 years agortentry: Initialize rt_mtx with MTX_NEW
cem [Mon, 1 Aug 2016 23:07:31 +0000 (23:07 +0000)]
rtentry: Initialize rt_mtx with MTX_NEW

The "rtentry" zone does not use UMA_ZONE_ZINIT, so it is invalid to assume the
mutex's memory will be zero.  Without MTX_NEW, garbage backing memory may
trigger the "re-initializing a mutex" assertion.

PR: 200991
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>

7 years agoopencrypto AES-ICM: Fix heap corruption typo
cem [Mon, 1 Aug 2016 22:57:03 +0000 (22:57 +0000)]
opencrypto AES-ICM: Fix heap corruption typo

This error looks like it was a simple copy-paste typo in the original commit
for this code (r275732).

PR: 204009
Reported by: Chang-Hsien Tsai <luke.tw AT gmail.com>
Sponsored by: EMC / Isilon Storage Division

7 years agoFix ddb "show proc" to show full arguments
cem [Mon, 1 Aug 2016 22:41:50 +0000 (22:41 +0000)]
Fix ddb "show proc" to show full arguments

PR: 200052
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>

7 years agoStore the offset of the KDOORBELL and GTS registers in the softc.
jhb [Mon, 1 Aug 2016 22:39:51 +0000 (22:39 +0000)]
Store the offset of the KDOORBELL and GTS registers in the softc.

VF devices use a different register layout than PF devices.  Storing
the offset in a value in the softc allows code to be shared between the
PF and VF drivers.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7389

7 years agoipoib: Bound the number of egress mbufs buffered during pathrec lookups.
markj [Mon, 1 Aug 2016 22:22:11 +0000 (22:22 +0000)]
ipoib: Bound the number of egress mbufs buffered during pathrec lookups.

In pathological situations where the master subnet manager becomes
unresponsive for an extended period, we may otherwise end up queuing all
of the system's mbufs while waiting for a response to a path record lookup.

This addresses the same issue as commit 1e85b806f9 in Linux.

Reviewed by: cem, ngie
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoDisable PCI hotplug support for slots with power controllers.
jhb [Mon, 1 Aug 2016 22:19:23 +0000 (22:19 +0000)]
Disable PCI hotplug support for slots with power controllers.

After further review of the spec, I do not think the current HotPlug
code handles slots with power controllers correctly.  In particular,
the power state of the slot is to be inferred from other events, not
from examining the state of the power control bit in SLOT_CTL.  For now,
disable PCI hotplug support on such slots.

PR: 211081
Tested by: Jeffrey E Pieper <jeffrey.e.pieper@intel.com>
MFC after: 3 days

7 years agoImplement trivial backoff for locking primitives.
mjg [Mon, 1 Aug 2016 21:48:37 +0000 (21:48 +0000)]
Implement trivial backoff for locking primitives.

All current spinning loops retry an atomic op the first chance they get,
which leads to performance degradation under load.

One classic solution to the problem consists of delaying the test to an
extent. This implementation has a trivial linear increment and a random
factor for each attempt.

For simplicity, this first thouch implementation only modifies spinning
loops where the lock owner is running. spin mutexes and thread lock were
not modified.

Current parameters are autotuned on boot based on mp_cpus.

Autotune factors are very conservative and are subject to change later.

Reviewed by: kib, jhb
Tested by: pho
MFC after: 1 week

7 years agor293331 mistakingly failed to add an assignment of paddr to the rxbuf
sbruno [Mon, 1 Aug 2016 21:19:51 +0000 (21:19 +0000)]
r293331 mistakingly failed to add an assignment of paddr to the rxbuf
but only in the NETMAP code.  This lead to the NETMAP code paths
passing nothing up to userland.

Submitted by: Ad Schellevis <ad@opnsense.org>
Reported by: Franco Fichtner <franco@opnsense.org>
MFC after: 1 day

7 years agoDo not invoke resize event if initial disk size is zero. Some disks
ae [Mon, 1 Aug 2016 20:54:54 +0000 (20:54 +0000)]
Do not invoke resize event if initial disk size is zero. Some disks
report the size only after first opening.  And due to the events are
asynchronous, some consumers can receive this event too late and
this confuses them. This partially restores previous behaviour, and
at the same time this should fix the problem, when already opened
provider loses resize event.

PR: 211028
MFC after: 3 weeks

7 years agoMFV be9130cc9: "IB/cma: Check for GID on listening devices first"
markj [Mon, 1 Aug 2016 20:29:09 +0000 (20:29 +0000)]
MFV be9130cc9: "IB/cma: Check for GID on listening devices first"

This is an optimization that improves IB connection setup times.

Discussed with: hselasky
Obtained from: Linux
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoMFV 29f27e847: "IB/cma: Use cached gids"
markj [Mon, 1 Aug 2016 20:27:11 +0000 (20:27 +0000)]
MFV 29f27e847: "IB/cma: Use cached gids"

This addresses a regression from an earlier upstream change which caused
cma_acquire_dev() to bypass the port GID cache and instead query the HCA
for each entry in its GID table. These queries can become extremely slow on
multiport devices, which has a negative impact on connection setup times.

Discussed with: hselasky
Obtained from: Linux
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoFix non-functional bsdinstall services dialog.
dim [Mon, 1 Aug 2016 19:49:42 +0000 (19:49 +0000)]
Fix non-functional bsdinstall services dialog.

The most recent version of bsdinstall does not seem to respect any of
the checkboxes in the "Choose the services you would like to be started
at boot" dialog.  None of the chosen services end up in the rc.conf file
that is installed onto the target system.

This is caused by the bsdinstall/scripts/hardening script, which
implements the new hardening options dialog.  The script starts by
overwriting the previously written rc.conf.services file:

    echo -n > $BSDINSTALL_TMPETC/rc.conf.services

which is obviously incorrect.  It should clear out rc.conf.hardening
instead.

Reviewed by: allanjude
PR: 211506
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7387

7 years agoMake boot code and loader check for unsupported ZFS feature flags
allanjude [Mon, 1 Aug 2016 19:37:43 +0000 (19:37 +0000)]
Make boot code and loader check for unsupported ZFS feature flags

OpenZFS uses feature flags instead of a zpool version number to track
features since the split from Oracle. In addition to avoiding confusion
on ZFS vs OpenZFS version numbers, this also allows features to be added
to different operating systems that use OpenZFS in different order.

The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly
tries to read the pool, and if failed provided only a vague error message.

With this change, both the boot code and loader check the MOS features
list in the ZFS label and compare it against the list of features that
the loader supports. If any unsupported feature is active, the pool is
not considered as a candidate for booting, and a helpful diagnostic
message is printed to the screen. Features that are merely enabled via
zpool upgrade, but not in use, do not block booting from the pool.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: delphij, mav
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6857

7 years agoindent: Avoid using values of pointers that refer to deallocated space.
pfg [Mon, 1 Aug 2016 19:24:01 +0000 (19:24 +0000)]
indent: Avoid using values of pointers that refer to deallocated space.

For now maintain the local style in this file.

Reviewed by: jilles

Reference:
https://github.com/pstef/freebsd_indent/commit/9099a9f17bc5f579514a4c11111f5cf3df6624c6

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoRestore the historical behavior of "sysctl vm.swap_idle_enabled=1". Prior
alc [Mon, 1 Aug 2016 17:25:07 +0000 (17:25 +0000)]
Restore the historical behavior of "sysctl vm.swap_idle_enabled=1".  Prior
to r254304, we had separate functions for reclamation and laundering
(vm_pageout_scan) versus updating usage information, i.e., "reference
bits", on active pages (vm_pageout_page_stats), and we only performed
vm_req_vmdaemon(VM_SWAP_IDLE) if vm_pages_needed was true.  However, since
r254303, if vm_swap_idle_enabled was "1", we have performed
vm_req_vmdaemon(VM_SWAP_IDLE) regardless of whether we are short of free
pages.  This was unintended and too aggressive, so I suspect no one uses
this feature.  With this change, we restore the historical behavior and
only perform vm_req_vmdaemon(VM_SWAP_IDLE) when we are short of free
pages.

Reviewed by: kib, markj

7 years agoRework IPV6 TCP path MTU discovery to match IPv4
gallatin [Mon, 1 Aug 2016 17:02:21 +0000 (17:02 +0000)]
Rework IPV6 TCP path MTU discovery to match IPv4

- Re-write tcp_ctlinput6() to closely mimic the IPv4 tcp_ctlinput()

- Now that tcp_ctlinput6() updates t_maxseg, we can allow ip6_output()
  to send TCP packets without looking at the tcp host cache for every
  single transmit.

- Make the icmp6 code mimic the IPv4 code & avoid returning
  PRC_HOSTDEAD because it is so expensive.

Without these changes in place, every TCP6 pmtu discovery or host
unreachable ICMP resulted in a call to in6_pcbnotify() which walks the
tcbinfo table with the write lock held.  Because the tcbinfo table is
shared between IPv4 and IPv6, this causes huge scalabilty issues on
servers with lots of (~100K) TCP connections, to the point where even
a small percent of IPv6 traffic had a disproportionate impact on
overall throughput.

Reviewed by: bz, rrs, ae (all earlier versions), lstewart (in Netflix's tree)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D7272

7 years agoindent(1): Use a dash in the license headers.
pfg [Mon, 1 Aug 2016 16:40:42 +0000 (16:40 +0000)]
indent(1): Use a dash in the license headers.

Use of the canonical dash avoids indent(1) from reformatting the
license headers.

7 years ago[mips/broadcom] Fetch UART console configuration from CFE.
landonf [Mon, 1 Aug 2016 16:29:32 +0000 (16:29 +0000)]
[mips/broadcom] Fetch UART console configuration from CFE.

Relying on the boot loader console configuration allows us to use a
common set of device hints for all SENTRY5 devices.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7376

7 years agoSplit out the FDT parts of the GICv2 interrupt controller driver. This will
andrew [Mon, 1 Aug 2016 16:29:04 +0000 (16:29 +0000)]
Split out the FDT parts of the GICv2 interrupt controller driver. This will
allow us to add an ACPI attachment for arm64.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7307

7 years agoSync CFE interface with upstream cfe-1.4.2 release.
landonf [Mon, 1 Aug 2016 16:26:08 +0000 (16:26 +0000)]
Sync CFE interface with upstream cfe-1.4.2 release.

Approved by: adrian (mentor)
Obtained from: https://www.broadcom.com/support/communications-processors
Differential Revision: https://reviews.freebsd.org/D7375

7 years agoAn old tables implementation had all tables preallocated,
ae [Mon, 1 Aug 2016 13:38:48 +0000 (13:38 +0000)]
An old tables implementation had all tables preallocated,
so when user did `ipfw table N flush` it always worked, but now
when table N doesn't exist the kernel returns ESRCH error.
This isn't fatal error for flush and destroy commands. Do not
call err(3) when errno is equal to ESRCH. Also warn only when
quiet mode isn't enabled. This fixes a regression in behavior,
when old rules are loaded from file.
Also use correct value for switch in the table_swap().

Reported by: Kevin Oberman
MFC after: 3 days

7 years agoAdd a kernel variable to let the user to select their preferred order
andrew [Mon, 1 Aug 2016 12:17:44 +0000 (12:17 +0000)]
Add a kernel variable to let the user to select their preferred order
between ACPI and FDT. This will be needed on machines with both, e.g. the
SoftIron Overdrive 3000. The kernel will accept one or more comma separated
values of either 'acpi' or 'fdt'. Any other values are skipped.

To set it the user can either set it on the loader command line, or
in loader.conf e.g. in loader.conf:
kern.cfg.order=acpi,fdt

This will try using ACPI then FDT. If none of the selected options work the
kernel tries to use one to get the serial console, then panics.

Reviewed by: emaste (earlier version)
Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7274

7 years agoMan page for the new checksum netgraph module.
julian [Mon, 1 Aug 2016 12:14:21 +0000 (12:14 +0000)]
Man page for the new checksum netgraph module.

PR: 206186
Submitted by: Dmitry Vagin <daemon.hammer@ya.ru>
MFC after:  1 month

7 years agonetgraph module for reconstructing checksums
julian [Mon, 1 Aug 2016 12:09:04 +0000 (12:09 +0000)]
netgraph module for reconstructing checksums

PR: 206108
Submitted by: Dmitry Vagin  daemon.hammer@ya.ru
MFC after: 1 month

7 years agoslite style changes. There is an incoming patch that rewrites a
julian [Mon, 1 Aug 2016 11:34:12 +0000 (11:34 +0000)]
slite style changes. There is an incoming patch that rewrites a
lot of this module and I want to get the style and whitespace changes in
a separate commit (or maybe more).

PR: 206185
Submitted by: Dmitry Vagin
MFC after: 1 month

7 years agoAdd the fields for the PAR_EL1 register. This is used when performing an
andrew [Mon, 1 Aug 2016 10:36:58 +0000 (10:36 +0000)]
Add the fields for the PAR_EL1 register. This is used when performing an
address lookup with the AT instructions.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agohyperv/storvsc: Stringent PRP list assertions
sephe [Mon, 1 Aug 2016 05:09:11 +0000 (05:09 +0000)]
hyperv/storvsc: Stringent PRP list assertions

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7361

7 years agohyperv/storvsc: Set maxio to 128KB.
sephe [Mon, 1 Aug 2016 04:51:31 +0000 (04:51 +0000)]
hyperv/storvsc: Set maxio to 128KB.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7360

7 years agohyperv/vmbus: Remove the artificial entry limit of SG and PRP list.
sephe [Mon, 1 Aug 2016 04:26:24 +0000 (04:26 +0000)]
hyperv/vmbus: Remove the artificial entry limit of SG and PRP list.

Just make sure that the total channel packet size does not exceed 1/2
data size of the TX bufring.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7359

7 years ago[ath] update comments.
adrian [Mon, 1 Aug 2016 00:36:29 +0000 (00:36 +0000)]
[ath] update comments.

7 years agoindent(1): Rearrange option parsing code to squelch clang's static analyzer.
pfg [Sun, 31 Jul 2016 21:43:43 +0000 (21:43 +0000)]
indent(1): Rearrange option parsing code to squelch clang's static analyzer.

clang-analyzer complained that eqin() sets file-scoped pointer param_start
to point into char buffer defined in scan_profile(), and once
scan_profile() exits, param_start is a "dangling reference". param_start
was never used afterwards, but it's cleaner to move it to set_option()
which is the only branch where param_start is needed.

Reference:
https://github.com/pstef/freebsd_indent/commit/ab0e44e5da3ff0fa4b62e451e4bbc3ea1ec7f365

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): replace function call to bzero with memset.
pfg [Sun, 31 Jul 2016 21:36:40 +0000 (21:36 +0000)]
indent(1): replace function call to bzero with memset.

Reference:
https://github.com/pstef/freebsd_indent/commit/7422f42f80099c69d34833d7106035dc09230235

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Don't newline on cpp lines like #endif unless -bacc is on.
pfg [Sun, 31 Jul 2016 21:29:10 +0000 (21:29 +0000)]
indent(1): Don't newline on cpp lines like #endif unless -bacc is on.

Reference:
https://github.com/pstef/freebsd_indent/commit/01f36f4141c71754b3a73a91886fb425bab0df3e

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Untangle the connection between pr_comment.c and io.c.
pfg [Sun, 31 Jul 2016 21:09:22 +0000 (21:09 +0000)]
indent(1): Untangle the connection between pr_comment.c and io.c.

It's pr_comment.c that should decide whether to put a "star comment
continuation" or not. This duplicates code a bit, but it simplifies
pr_comment() at the same time since pr_comment() no longer has to "signal"
whether a star continuation is needed or not.

This change requires indent(1) to not wrap comment lines that lack a blank
character, but I think it's for the better if you look at cases when that
happens (mostly long URIs and file system paths, which arguably shouldn't
be wrapped).

It also fixes two bugs:

1. Cases where asterisk is a part of the comment's content (like in "*we*
are the champions") and happens to appear at the beginning of the line,
misleading dump_line() into thinking that this is part of the star comment
continuation, leading to misalignment.

2. Cases where blank starred lines had three too many characters on the
line when wrapped.

Reference:
https://github.com/pstef/freebsd_indent/commit/3b41ee78aafafc7c3e662b794835e3253218dbb3

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Fix wrapping of some lines in comments.
pfg [Sun, 31 Jul 2016 20:13:00 +0000 (20:13 +0000)]
indent(1): Fix wrapping of some lines in comments.

After a blank line was printed (to separate paragraphs in comments), the
next line was sometimes wrapped to the column at which the previous
non-empty line ended. The fix is to reset the last blank pointer (last_bl)
on newline.

References:
https://github.com/pstef/freebsd_indent/commit/345663c07af0758fd10433bde14722dfd900f85c

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Simplify pr_comment().
pfg [Sun, 31 Jul 2016 20:04:18 +0000 (20:04 +0000)]
indent(1): Simplify pr_comment().

Modify count_spaces() to take a third parameter "end" that will make the
function return when the end is reached. This lets the caller pass a
pointer to non nul-terminated sequence of characters. Rename
count_spaces() to count_spaces_until() and reinstate count_spaces(), this
time based on count_spaces_until().

Use count_spaces_until() to recalculate current column when going through
a comment just before the fragment which decides if current line of the
comment should be wrapped. This move simplifies this code by eliminating
the need for keeping the column counter up to date every time e_com is
advanced and also reduces spread of code that has to know how many columns
a tab will produce.

Deduplicate code that decided if a comment needs a blank line at the top.

References:
https://github.com/pstef/freebsd_indent/commit/d9fa3b481532a448095f8ddd14fd0797ce59230c
https://github.com/pstef/freebsd_indent/commit/27185b4b336b0e2108a3d96aee6df80cced94192

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoRemove another occurence of _WITH_GETLINE
bapt [Sun, 31 Jul 2016 19:02:19 +0000 (19:02 +0000)]
Remove another occurence of _WITH_GETLINE

7 years agoAdd the Data Fault Status Code values to the ESR_ELx registers for when the
andrew [Sun, 31 Jul 2016 18:58:20 +0000 (18:58 +0000)]
Add the Data Fault Status Code values to the ESR_ELx registers for when the
fault code is a Data Abort.

Obtained from: AT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoresolvconf(8) now needs an additional @RESTARTCMD@ replacement when installing.
pfg [Sun, 31 Jul 2016 18:14:42 +0000 (18:14 +0000)]
resolvconf(8) now needs an additional @RESTARTCMD@ replacement when installing.

After r303062, which brought openresolv 3.8.1, we need to replace an
additional @RESTARTCMD@ in resolvconf.
Apply a read fix this time.

Submitted by: Guy Yur
X-MFC with: r303062

7 years agoExtract the common parts of pmap_kenter_device to a new function. This will
andrew [Sun, 31 Jul 2016 17:53:09 +0000 (17:53 +0000)]
Extract the common parts of pmap_kenter_device to a new function. This will
be used when superpage support is added.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoindent(1): Remove dead code relating to unix-style comments.
pfg [Sun, 31 Jul 2016 15:02:53 +0000 (15:02 +0000)]
indent(1): Remove dead code relating to unix-style comments.

The original indent(1) described unix-style comments as similar to box
comments, except the first non-blank character on each line is lined up
with the '*' of the "/*" which appears on a line by itself.

The code has been turned off for ages and -sc/-nsc make it even
less relevant.

Reference:
https://github.com/pstef/freebsd_indent/commit/89c5fe2c56742d96975bb3ea6b99f28baf9d82f6

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)

Submitted by: Piotr Stefaniak

7 years agoFix the comment above pmap_invalidate_page. tlbi will invalidate the tlb
andrew [Sun, 31 Jul 2016 14:59:44 +0000 (14:59 +0000)]
Fix the comment above pmap_invalidate_page. tlbi will invalidate the tlb
on all CPUs.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agosh: Fix a clang warning.
jilles [Sun, 31 Jul 2016 13:11:34 +0000 (13:11 +0000)]
sh: Fix a clang warning.

Submitted by: bdrewery

7 years agoRelax the barriers around a TLB invalidation to only wait on
andrew [Sun, 31 Jul 2016 12:59:10 +0000 (12:59 +0000)]
Relax the barriers around a TLB invalidation to only wait on
inner-shareable memory accesses. There is no need for full system barriers.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agolocks: change sleep_cnt and spin_cnt types to u_int
mjg [Sun, 31 Jul 2016 12:11:55 +0000 (12:11 +0000)]
locks: change sleep_cnt and spin_cnt types to u_int

Both variables are uint64_t, but they only count spins or sleeps.
All reasonable values which we can get here comfortably hit in 32-bit range.

Suggested by: kib
MFC after: 1 week

7 years agoamd64: implement pagezero using rep stos
mjg [Sun, 31 Jul 2016 11:34:08 +0000 (11:34 +0000)]
amd64: implement pagezero using rep stos

The current implementation uses non-temporal writes. This turns out to
be detrimental to performance if the page is used shortly after, which
is the typical case with page faults.

Switch to rep stos.

Reviewed by: kib
MFC after: 1 week

7 years agoFix date
ache [Sun, 31 Jul 2016 10:15:04 +0000 (10:15 +0000)]
Fix date

7 years agoFix up setgrent(3) to have a POSIX-compliant prototype.
ed [Sun, 31 Jul 2016 08:05:15 +0000 (08:05 +0000)]
Fix up setgrent(3) to have a POSIX-compliant prototype.

Just like with freelocale(3), I haven't been able to find any piece of
code that actually makes use of this function's return value, both in
base and in ports. The reason for this is that FreeBSD seems to be the
only operating system to have such a prototype. This is why I'm deciding
to not use symbol versioning for this.

It does seem that the pw(8) utility depends on the function's typing and
already had a switch in place to toggle between the FreeBSD and POSIX
variant of this function. Clean this up by always expecting the POSIX
variant.

There is also a single port that has a couple of local declarations of
setgrent(3) that need to be patched up. This is in the process of being
fixed.

PR: 211394 (exp-run)

7 years ago[gpioled] update manpage.
adrian [Sun, 31 Jul 2016 06:53:50 +0000 (06:53 +0000)]
[gpioled] update manpage.

Submitted by: Dan Nelson <dnelson_1901@yahoo.com>

7 years ago[wdr4300] invert the GPIO LED polarity.
adrian [Sun, 31 Jul 2016 06:52:19 +0000 (06:52 +0000)]
[wdr4300] invert the GPIO LED polarity.

This makes them behave correctly.

Submitted by: Dan Nelson <dnelson_1901@yahoo.com>

7 years ago[ar71xx_gpio] handle AR934x and QCA953x GPIO OE polarity.
adrian [Sun, 31 Jul 2016 06:51:34 +0000 (06:51 +0000)]
[ar71xx_gpio] handle AR934x and QCA953x GPIO OE polarity.

For reasons I won't comment on, the AR934x and QCA953x GPIO_OE register
value is inverted - bit set == input, bit clear == output.

So, fix this in the output setting, in reading the initial state from
the boot loader, and also setting any gpiofunc pins that are necessary.

7 years agoConditionalize code which defines sysctls per _KERNEL #ifdef guard
ngie [Sun, 31 Jul 2016 06:34:49 +0000 (06:34 +0000)]
Conditionalize code which defines sysctls per _KERNEL #ifdef guard

This resolves several issues when compiling libzpool (userspace library), i.e.
-Wimplicit-function-declaration and -Wmissing-declarations issues.

MFC after: 2 weeks
Reported by: clang
Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0
Sponsored by: EMC / Isilon Storage Division

7 years agoRemove calls to `die` added for associated bugs
ngie [Sun, 31 Jul 2016 06:28:40 +0000 (06:28 +0000)]
Remove calls to `die` added for associated bugs

Panics are no longer hit with ^/head@r303573 on amd64

PR:     194586, 194587, 194589
Sponsored by:   EMC / Isilon Storage Division

7 years ago[gpioled] add support for inverting the LED polarity.
adrian [Sun, 31 Jul 2016 06:24:26 +0000 (06:24 +0000)]
[gpioled] add support for inverting the LED polarity.

No, this isn't a star trek science joke - sometimes LEDs are wired
up to be active low, so this is needed.

Submitted by: Dan Nelson <dnelson_1901@yahoo.com>

7 years agoCast result from third parameter to int instead of promoting it to size_t
ngie [Sun, 31 Jul 2016 06:03:27 +0000 (06:03 +0000)]
Cast result from third parameter to int instead of promoting it to size_t

This resolves a -Wformat issue when the value is used as a format width
precision specifier, i.e. %*s

MFC after: 1 month
Reported by: clang
Sponsored by: EMC / Isilon Storage Division

7 years agoFix regression with /i caused by r303047
ngie [Sun, 31 Jul 2016 05:31:09 +0000 (05:31 +0000)]
Fix regression with /i caused by r303047

'\n' was specifically added to -e arguments prior to r303047. Restore
historical behavior which in turn fixes usr.sbin/etcupdate/preworld_test:main .

The fix is being committed to address the issue in the short term and may be
iterated upon as noted in bug 211399

Discussed with: mi, pfg
Differential Revision: https://reviews.freebsd.org/D7368
PR: 195929, 211399 [*]
MFC after: 18 days
X-MFC with: r303047
Reported by: Jenkins
Sponsored by: EMC / Isilon Storage Division

7 years agoindent(1): Bail out if there's no more space on the parser stack.
pfg [Sun, 31 Jul 2016 04:58:06 +0000 (04:58 +0000)]
indent(1): Bail out if there's no more space on the parser stack.

Also increase the stack size still keeping a conservative value of 256.
This is based on a similar changes done for PostgreSQL which instead
uses a stack size of 1000.

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak (with changes)

7 years agoindent(1): Consistently indent declarations.
pfg [Sun, 31 Jul 2016 04:14:20 +0000 (04:14 +0000)]
indent(1): Consistently indent declarations.

This fixes a very visible issue that may be hidden by some indent.pro
settings as in the example from FreeBSD's /usr/share.

From Piotr's log:
____
To prevent losing tabs from indentation in declarations, FreeBSD indent's
r125624 added code for the most common case when it's an identifier that
is indented, but didn't do anything with the original code that did the
same for any other cases. The other cases are: lparens (function pointer
declaration), asterisks (pointer declaration), stray semicolons, and
commas leading identifiers instead of trailing them.

Use the code added in r125624 (and improved in later commits) to write a
new function indent_declaration() and use it in all places that meant to
indent declarations. In order to indent only once per line, reuse existing
ps.dumped_decl_indent variable that was only used when formatting for
troff (-troff) until now.
____

Reference:
https://github.com/pstef/freebsd_indent/commit/ddd263db2a59978f43468989eff65299cf3ce7e1

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoReflect CLDR timedef changes
ache [Sun, 31 Jul 2016 03:26:53 +0000 (03:26 +0000)]
Reflect CLDR timedef changes

7 years agoRemove another vestige of scripted conversion
ache [Sun, 31 Jul 2016 03:11:10 +0000 (03:11 +0000)]
Remove another vestige of scripted conversion

7 years agoresolvconf(8) now needs an additional @RESTARTCMD@ replacement when installing.
pfg [Sun, 31 Jul 2016 02:54:27 +0000 (02:54 +0000)]
resolvconf(8) now needs an additional @RESTARTCMD@ replacement when installing.

After r303062, which brought openresolv 3.8.1, we need to replace an
additional @RESTARTCMD@ in resolvconf.

Reported by: Guy Yur
X-MFC with: r303062

7 years agoRemove vestige of scripted conversion
ache [Sun, 31 Jul 2016 02:43:45 +0000 (02:43 +0000)]
Remove vestige of scripted conversion

7 years agoIn addition to prev. commit. Since potentially glob2() can return error
ache [Sun, 31 Jul 2016 02:28:50 +0000 (02:28 +0000)]
In addition to prev. commit. Since potentially glob2() can return error
without setting errno, restore errno before its call.

7 years agoBoth C99 and POSIX directly prohibits any standard function to set errno
ache [Sun, 31 Jul 2016 01:14:06 +0000 (01:14 +0000)]
Both C99 and POSIX directly prohibits any standard function to set errno
to 0. Breaking this rule in 2001 NetBSD hack was imported which attempts
to workaround very limited glob() return codes amount. Use POSIX-compatible
workaround now with E2BIG which can't comes from other functions used
instead of prohibited 0.

7 years agosx: increment spin_cnt before cpu_spinwait in xlock
mjg [Sat, 30 Jul 2016 22:23:31 +0000 (22:23 +0000)]
sx: increment spin_cnt before cpu_spinwait in xlock

The change is a no-op only done for consistency with the rest of the file.

7 years agorwlock: s/READER/WRITER/ in wlock lockstat annotation
mjg [Sat, 30 Jul 2016 22:21:48 +0000 (22:21 +0000)]
rwlock: s/READER/WRITER/ in wlock lockstat annotation

7 years agoWrap previous MSIX workaround into #ifndef EARLY_AP_STARTUP.
mav [Sat, 30 Jul 2016 21:06:59 +0000 (21:06 +0000)]
Wrap previous MSIX workaround into #ifndef EARLY_AP_STARTUP.

With EARLY_AP_STARTUP we can successfully negotiate MSIX earlier.

Requested by: jhb@

7 years agoRename devname to udevname after including stdlib.h in r303445
bz [Sat, 30 Jul 2016 20:39:39 +0000 (20:39 +0000)]
Rename devname to udevname after including stdlib.h in r303445
as gcc trips over the devname(3) and reports 'shadows a global declaration'.

This should unbreak gcc based world builds.

7 years agoTry to declare _hw_pci for all sysctl cases needed after r303497.
bz [Sat, 30 Jul 2016 20:31:12 +0000 (20:31 +0000)]
Try to declare _hw_pci for all sysctl cases needed after r303497.

MFC after: 5 days
X-MFC with: r303497

7 years ago[iwm] Fix iwm_poll_bit() usage in iwm_stop_device(), fixup r303418.
ivadasz [Sat, 30 Jul 2016 19:03:32 +0000 (19:03 +0000)]
[iwm] Fix iwm_poll_bit() usage in iwm_stop_device(), fixup r303418.

* iwm_poll_bit() returns 1 on success and 0 on failure, whereas
  iwl_poll_bit() in Linux's iwlwifi returns >= 0 on success and < 0 on
  failure.

* Because of the wrong iwm_poll_bit return code check, no warning was
  printed if tx DMA stopping failed.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7371

7 years agoImprove boot loader quote parsing
allanjude [Sat, 30 Jul 2016 17:53:37 +0000 (17:53 +0000)]
Improve boot loader quote parsing

parse() is the boot loader's interp_parse.c is too naive about quotes

both single and double quotes were allowed to be mixed, and single
quotes did not follow the usual semantics (re variable expansion).

The old code did not check for terminating quotes

This update implements:
 * distinguishing single and double quote
 * variable expansion will not be done inside single quote protected area
 * will preserve inner quote for values like "value 'some list'"
 * ending quote check.

this diff does not implement ending quote order check, it shouldn't
be too hard, needs some improvements on parser state machine.

PR: 204602
Submitted by: Toomas Soome <tsoome@me.com>
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6000

7 years agobcache should support reads shorter than sector size
allanjude [Sat, 30 Jul 2016 17:45:56 +0000 (17:45 +0000)]
bcache should support reads shorter than sector size

dosfs (fat file systems) can perform reads of partial sectors
bcache should support such reads.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D6475