]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAllow matches of truncated version strings.
markj [Wed, 19 Jul 2017 18:41:16 +0000 (18:41 +0000)]
Allow matches of truncated version strings.

Long objdir paths make it easy to hit the version string length limit in
kernel dump headers. The build number and timestamp are unlikely to be
truncated and ought to be sufficient to protect against false positives.

Discussed with: jhb
MFC after: 1 week

6 years agoUse more flexible expression for replacing t_diff in
ngie [Wed, 19 Jul 2017 18:30:16 +0000 (18:30 +0000)]
Use more flexible expression for replacing t_diff in
contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via
`basename $0`.

This was a change I forgot to port over from
^/head/gnu/usr.bin/diff/tests/Makefile@r272787.

6 years agobsdinstall: improve checksum mismatch error for snapshots
emaste [Wed, 19 Jul 2017 18:25:52 +0000 (18:25 +0000)]
bsdinstall: improve checksum mismatch error for snapshots

The usual case of a mismatched checksum for installer snapshots
(e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
the old install sets have been replaced.  Provide a specific error
message for checksum mismatches there that suggests looking for a newer
snapshot.

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11641

6 years agozfs: Fix a typo in the delay_min_dirty_percent sysctl description
emaste [Wed, 19 Jul 2017 18:17:41 +0000 (18:17 +0000)]
zfs: Fix a typo in the delay_min_dirty_percent sysctl description

The description is FreeBSD-specific and was added in r266497
to fix PR189865.

PR: 220825
Submitted by: Fabian Keil
Obtained from: ElectroBSD
MFC after: 1 week

6 years agoRemove unused function swap_pager_isswapped().
kib [Wed, 19 Jul 2017 17:28:46 +0000 (17:28 +0000)]
Remove unused function swap_pager_isswapped().

Noted by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoUpdate targets/pseudo/tests/Makefile.depend after recent additions/subtractions
ngie [Wed, 19 Jul 2017 16:45:57 +0000 (16:45 +0000)]
Update targets/pseudo/tests/Makefile.depend after recent additions/subtractions
from the FreeBSD test suite.

MFC after: 3 days
MFC with: r316603

6 years agoClean up :coredump_phnum
ngie [Wed, 19 Jul 2017 16:23:02 +0000 (16:23 +0000)]
Clean up :coredump_phnum

- Use "atf_check -x 'cmd1 | cmd2'" instead of "cmd1 | atf_check cmd2". The
  two forms are idiomatically similar, but subtly different in the sense of
  what program invokes the other, and there could be unwanted side effects
  of the latter idiom dealing with forking, pipes, etc.
- Remove chmod and instead source coredump_phnum_restore_state.sh directly.
  This avoids the need to check the result of the chmod call.
- Fix indentation in an if-block (4 column space indentation -> hard tab).

6 years agoRemove expected failure for :coredump_phnum
ngie [Wed, 19 Jul 2017 16:08:08 +0000 (16:08 +0000)]
Remove expected failure for :coredump_phnum

The testcase no longer fails on ^/head because readelf has established parity
with binutils' copy of readelf.

This issue is not seen on Jenkins because
`test_suites.FreeBSD.allow_sysctl_side_effects` isn't set in kyua.conf on
the CI host, i.e., the test is skipped.

PR: 215019
Tested with: binutils (amd64-binutils-2.28,1); elftoolchain (r3561M)

6 years agoFix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.
ken [Wed, 19 Jul 2017 15:39:01 +0000 (15:39 +0000)]
Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.

mps_wait_command() and mpr_wait_command() were using getmicrotime() to
determine elapsed time when checking for a timeout in polled mode.
getmicrotime() isn't guaranteed to monotonically increase, and that
caused spurious timeouts occasionally.

Switch to using getmicrouptime(), which does increase monotonically.
This fixes the spurious timeouts in my test case.

Reviewed by: slm, scottl
MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoRemove dead code that was killed by r320975
asomers [Wed, 19 Jul 2017 15:22:10 +0000 (15:22 +0000)]
Remove dead code that was killed by r320975

Reported by: Coverity
CID: 1377977
MFC after: 15 days
X-MFC-With: 320975
Sponsored by: Spectra Logic Corp

6 years agoAvoid shadowed variables.
tuexen [Wed, 19 Jul 2017 15:12:23 +0000 (15:12 +0000)]
Avoid shadowed variables.

MFC after: 1 week

6 years agoUse memset/memcpy instead of bzero/bcopy.
tuexen [Wed, 19 Jul 2017 14:28:58 +0000 (14:28 +0000)]
Use memset/memcpy instead of bzero/bcopy.

Just use one variant instead of both. Use the memset/memcpy
ones since they cause less problems in crossplatform deployment.

MFC after: 1 week

6 years agoAdd HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.
ae [Wed, 19 Jul 2017 14:21:29 +0000 (14:21 +0000)]
Add HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.

Tested by: David Miguel Almas <dmalmas gmail com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11478

6 years agoenable pidfile tests on arm64
emaste [Wed, 19 Jul 2017 14:07:38 +0000 (14:07 +0000)]
enable pidfile tests on arm64

Pidfile tests were disabled on arm64 (in r286863) because they hung.
They have been fixed (r306098) and so can be enabled now.

PR: 202304
Sponsored by: The FreeBSD Foundation

6 years agoFix the accounting and add code to detect errors in accounting.
tuexen [Wed, 19 Jul 2017 12:27:40 +0000 (12:27 +0000)]
Fix the accounting and add code to detect errors in accounting.
Joint work with rrs@
MFC after: 1 week

6 years agoRename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
trasz [Wed, 19 Jul 2017 09:59:32 +0000 (09:59 +0000)]
Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
It applies to both NFS client and NFS server, and is useful for both.
This is different from vfs.nfsd.enable_stringtouid, which is specific
to server side.

Reviewed by: rmacklem@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agocxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the
np [Wed, 19 Jul 2017 01:49:01 +0000 (01:49 +0000)]
cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the
trace buffer.

MFC after: 3 days

6 years agobsdinstall: remove EOL whitespace
emaste [Tue, 18 Jul 2017 23:35:19 +0000 (23:35 +0000)]
bsdinstall: remove EOL whitespace

6 years agoRemove special handling for 'disk*.h'
jhb [Tue, 18 Jul 2017 21:09:29 +0000 (21:09 +0000)]
Remove special handling for 'disk*.h'

This was originally added so that only one of diskmbr.h or diskpc98.h
was chosen and is no longer needed after PC98's removal.  However, the
special handling was also broken as it effectively prevented the decoding
of ioctls declared in other headers such as <sys/disk.h> or
<sys/disklabel.h>.

6 years agoConvert assertion that only vmspace owner grows the stack, into a
kib [Tue, 18 Jul 2017 20:26:41 +0000 (20:26 +0000)]
Convert assertion that only vmspace owner grows the stack, into a
check blocking grow from other processes accesses.

Debugger may access stack grow area with ptrace(2).  In this case,
real state of the process is to not have the stack grown, which
provides more accurate inspection.  Technical reason to avoid the grow
is to avoid applying wrong process (debugger) stack limit.

This change also has a consequence of making aio workers accesses past
the bottom of stacks into EFAULT, arguably the situation is a
programmers mistake.

Reported by: jhb
Discussed with: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoAllwinner EHCI: Do not fail if we cannot get a phy
manu [Tue, 18 Jul 2017 19:50:02 +0000 (19:50 +0000)]
Allwinner EHCI: Do not fail if we cannot get a phy

If we cannot get a phy, do not detach the driver, some boards have phy
always enabled and not exposed.
While here do not release the clocks if we fails as we release them
in a10_ehci_detach.

Tested-on: OrangePi-One

6 years agosh: Remove broken #ifdef NOHACK code (related to sh -c).
jilles [Tue, 18 Jul 2017 19:00:15 +0000 (19:00 +0000)]
sh: Remove broken #ifdef NOHACK code (related to sh -c).

Apart from the fact that subtle syntactic changes make a poor compile-time
option, the NOHACK case has been obviously broken since it was added,
because it uses q uninitialized if (*p != '\0').

No functional change is intended.

6 years agoRemove unnecessary make logic added in r319339
ngie [Tue, 18 Jul 2017 17:29:12 +0000 (17:29 +0000)]
Remove unnecessary make logic added in r319339

This makes the change cleaner and easier to backport to ^/stable/10.

MFC after: now

6 years agoAdd support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This
andrew [Tue, 18 Jul 2017 16:36:32 +0000 (16:36 +0000)]
Add support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This
will be used to call into UEFI from the kernel.

Sponsored by: DARPA, AFRL

6 years agoipfw_netflow: Add support for FIB
manu [Tue, 18 Jul 2017 14:02:02 +0000 (14:02 +0000)]
ipfw_netflow: Add support for FIB

If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB.

While here correct some value in rc.conf(5) to be int and not str.

Sponsored by: Gandi.net

6 years agofix a regression in r320452, ZFS ABD import
avg [Tue, 18 Jul 2017 07:41:38 +0000 (07:41 +0000)]
fix a regression in r320452, ZFS ABD import

I overlooked the fact that vdev_op_io_done hook is called even if the
actual I/O is skipped, for example, in the case of a missing vdev.
Arguably, this could be considered an issue in the zio pipeline engine,
but for now I am adding defensive code to check for io_bp being NULL
along with assertions that that happens only when it can be really
expected.

PR: 220691
Reported by: peter, cy
Tested by: cy
MFC after: 1 week
X-MFC with: r320156, r320452

6 years agoFix whitespace regression accidentally checked in via ^/head@r280149
ngie [Tue, 18 Jul 2017 06:51:27 +0000 (06:51 +0000)]
Fix whitespace regression accidentally checked in via ^/head@r280149

MFC after: now

6 years agoqlnx: gcc build errors
rlibby [Tue, 18 Jul 2017 06:15:05 +0000 (06:15 +0000)]
qlnx: gcc build errors

Propagate warning flags from kern.opts.mk and then fix minor -Werror
issues when building with gcc from -Wredundant-decls, -Wnested-externs,
-Wuninitialized.

Reviewed by: davidcs
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11413

6 years agocxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
np [Tue, 18 Jul 2017 03:58:59 +0000 (03:58 +0000)]
cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
remove bootrom and boot config.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoMake ZFS not crash on mount on 32-bit systems
jhibbits [Tue, 18 Jul 2017 01:08:45 +0000 (01:08 +0000)]
Make ZFS not crash on mount on 32-bit systems

ZPL_VERSION is unsigned long long, not an int.  With this change, a zpool can be
created on a 32-bit system (tested on powerpcspe) and mounted correctly.

Reviewed by: allanjude

6 years agocxgbe(4): New ioctls to flash bootrom and boot config to the card.
np [Tue, 18 Jul 2017 00:50:58 +0000 (00:50 +0000)]
cxgbe(4): New ioctls to flash bootrom and boot config to the card.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoTidy up before making another round of functional changes: Remove end-
alc [Mon, 17 Jul 2017 23:16:33 +0000 (23:16 +0000)]
Tidy up before making another round of functional changes: Remove end-
of-line whitespace, remove excessive whitespace and blank lines, remove
dead code, follow our standard style for function definitions, and
correct grammatical and factual errors in some of the comments.

Submitted by: Doug Moore <dougm@rice.edu>
MFC after: 1 week

6 years ago[iwm] actually use the new rxon function now.
adrian [Mon, 17 Jul 2017 21:32:35 +0000 (21:32 +0000)]
[iwm] actually use the new rxon function now.

It turns out the /next/ dragonflybsd git actually uses the scan channel list,
so just kick this along to make the next commit easier.

Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432

6 years ago[iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.
adrian [Mon, 17 Jul 2017 21:29:18 +0000 (21:29 +0000)]
[iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.

From the original commit:

==

* Actually look at the first channel in the list. If it's a 2.4GHz channel,
  set IWM_PHY_BAND_24 flag. The IWM_PHY_BAND_5 flag is 0 anyway, so we
  don't need to look further.

* While there factor out the iwm_mvm_rrm_scan_needed() tlv capability check.

Taken-From: Linux iwlwifi
==

However, this only really does the latter.  The sc_ic channel list isn't the
scan channel list, it's the /whole list/ for the set of active channels,
so I don't know what the right thing to do is here.

So I'll commit this as an intermediary commit and we'll have to revisit whether
to finish the refactor as-is.

Tested:

* Intel 7260, STA mode

Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432

6 years agoAdd regression tests for bugs 220459 and 220398
asomers [Mon, 17 Jul 2017 18:33:30 +0000 (18:33 +0000)]
Add regression tests for bugs 220459 and 220398

Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0
Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD

PR: 220459
PR: 220398
Reviewed by: cem, jhb
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11470

6 years agoSort the tests alphabetically before adding them to the Kyuafiles
ngie [Mon, 17 Jul 2017 18:20:54 +0000 (18:20 +0000)]
Sort the tests alphabetically before adding them to the Kyuafiles

This is being done to aid in debugging test runs, in the event the
output shifts due to refactored Makefiles, added tests, etc.

MFC after: 1 month

6 years agoExpose the ILP32/LP64 programming environments based on
ngie [Mon, 17 Jul 2017 18:12:08 +0000 (18:12 +0000)]
Expose the ILP32/LP64 programming environments based on
__ILP32__/__LP64__ instead of by architecture.

The list was incomplete (previous commits purged invalid architectures,
like __alpha__, but failed to add new ones). It's best to base the symbol
presence on whether or not the architecture is ILP32 / LP64 capable, per
the compiler.

This fixes the ILP32/LP64 program environments on some architectures like
arm64, and by proxy fixes the tests on those architectures.

MFC after: 1 month
Reviewed by: no one (timed out on feedback from imp)
Differential Revision: D10787

6 years agoAdd tests that exercise -q, like -rq and add tests that test -q like -Nrq
ngie [Mon, 17 Jul 2017 18:07:53 +0000 (18:07 +0000)]
Add tests that exercise -q, like -rq and add tests that test -q like -Nrq

MFC after: 2 months
MFC with: r321076, r321077, r321078

6 years agoFix exit status with -rq when there is a file in one directory but not another,
ngie [Mon, 17 Jul 2017 18:06:42 +0000 (18:06 +0000)]
Fix exit status with -rq when there is a file in one directory but not another,
i.e., when print_only is called.

Prior to this change, -rq was always returning 0. After this change it will
return 1 if there is a difference between two directories.

This fixes compatibility with GNU diff and unbreaks backwards compatibility
expectations.

Found when trying to extend diff_test:brief_format_test.

MFC after: 2 months
MFC with: r321076, r321077

6 years agoAdd some tests for brief (--brief/-q) format
ngie [Mon, 17 Jul 2017 17:50:50 +0000 (17:50 +0000)]
Add some tests for brief (--brief/-q) format

MFC after: 2 months
MFC with: r321076

6 years agoDon't emit "diff: diff <options> arguments" when diffing files if
ngie [Mon, 17 Jul 2017 17:36:04 +0000 (17:36 +0000)]
Don't emit "diff: diff <options> arguments" when diffing files if
-q is specified.

This improves compatibility with GNU diff.

Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`.

MFC after: 2 months
Relnotes: yes

6 years agoSet the current vnet pointer in the socket buffer AIO handler.
jhb [Mon, 17 Jul 2017 16:59:22 +0000 (16:59 +0000)]
Set the current vnet pointer in the socket buffer AIO handler.

This fixes panics when using AIO under VIMAGE.

Reported by: kp
MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document
manu [Mon, 17 Jul 2017 08:53:51 +0000 (08:53 +0000)]
ipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document
usage in rc.conf(5)

Reported by: markj
Sponsored by: Gandi.net

6 years agocxgbe(4): Various link/media related improvements.
np [Mon, 17 Jul 2017 00:42:13 +0000 (00:42 +0000)]
cxgbe(4): Various link/media related improvements.

- Deal with changes to port_type, and not just port_mod when a
  transceiver is changed.  This fixes hot swapping of transceivers of
  different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or
  SFP28 in a SFP28 port, etc.).

- Always refresh media information for ifconfig if the port is down.
  The firmware does not generate tranceiver-change interrupts unless at
  least one VI is enabled on the physical port.  Before this change
  ifconfig diplayed potentially stale information for ports that were
  administratively down.

- Always recalculate and reapply L1 config on a transceiver change.

- Display PAUSE settings in ifconfig.  The driver sysctls for this
  continue to work as well.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoMinor optimization: instead of converting between days and years using loops
ian [Sun, 16 Jul 2017 16:54:03 +0000 (16:54 +0000)]
Minor optimization: instead of converting between days and years using loops
that start in 1970, assume most conversions are going to be for recent dates
and use a precomputed number of days through the end of 2016.

This is a do-over of r320997, hopefully this time with 100% more workiness.

The first attempt had an off-by-one error, but instead of just adding
another mysterious +1 adjustment, this rearranges the relationship between
recent_base_year and recent_base_days so that the latter is the number of
days that occurred before the start of the associated year (instead of the
count thru the end of that year).  This makes the recent_base stuff work
more like the original loop logic that didn't need any +1 adjustments.

6 years agoreadelf: correct printing of DT_FILTER and DT_AUXILIARY values
emaste [Sun, 16 Jul 2017 16:22:52 +0000 (16:22 +0000)]
readelf: correct printing of DT_FILTER and DT_AUXILIARY values

Previously these were shown only for MIPS objects.

Obtained from: ELF Tool Chain r3564
MFC after: 1 week
MFC with: r321045
Sponsored by: The FreeBSD Foundation

6 years agoreadelf: fix printing of DT_FILTER and some other DT_* values
emaste [Sun, 16 Jul 2017 12:30:39 +0000 (12:30 +0000)]
readelf: fix printing of DT_FILTER and some other DT_* values

Some non-processor-specific DT_* values overlap the range DT_LOPROC to
DT_HIPROC.  Handle common ones first, then the processor-specific ones.

Obtained from: ELF Tool Chain r3563
Sponsored by: The FreeBSD Foundation

6 years agoRemove write-only variable.
kib [Sun, 16 Jul 2017 07:12:04 +0000 (07:12 +0000)]
Remove write-only variable.

Tested by: pho
Sponsored by: The FreeBSD Foundation

6 years agoA followup to r320453, correct removal of the blocks from UFS snapshots.
kib [Sun, 16 Jul 2017 07:11:29 +0000 (07:11 +0000)]
A followup to r320453, correct removal of the blocks from UFS snapshots.

Tested by: pho
PR:    220693
Sponsored by: The FreeBSD Foundation

6 years agoImport bmake-20170711
sjg [Sat, 15 Jul 2017 21:19:27 +0000 (21:19 +0000)]
Import bmake-20170711

6 years agoRevert r320918 and have mkdumpheader() handle version string truncation.
markj [Sat, 15 Jul 2017 20:53:08 +0000 (20:53 +0000)]
Revert r320918 and have mkdumpheader() handle version string truncation.

Reported by: jhb
MFC after: 1 week

6 years agoFix the handling of Explicit EOR mode.
tuexen [Sat, 15 Jul 2017 19:54:03 +0000 (19:54 +0000)]
Fix the handling of Explicit EOR mode.

While there, appropriately handle the overhead depending on
the usage of DATA or I-DATA chunks. Take the overhead only
into account, when required.

Joint work with rrs@
MFC after: 1 week

6 years agopfctl parser tests
kp [Sat, 15 Jul 2017 19:22:01 +0000 (19:22 +0000)]
pfctl parser tests

Copy the most important test cases from OpenBSD's corresponding
src/regress/sbin/pfctl, those that run pfctl on a test input file and check
correctness of its output. We have also added some new tests using the same
format.

The tests consist of a collection of input files (pf*.in) and
corresponding output files (pf*.ok). We run pfctl -nv on the input
files and check that the output matches the output files. If any
discrepancy is discovered during future development in the source
tree, we know that a regression bug has been introduced into the tree.

Submitted by: paggas
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11322

6 years agoThe ctladm man page incorrectly duplicated the text for the
bcr [Sat, 15 Jul 2017 17:59:28 +0000 (17:59 +0000)]
The ctladm man page incorrectly duplicated the text for the
delete subcommand in the modify section. Rewrite the
modify description text in two places to say modify/modified
instead of remove/removed.

PR: 220710
Submitted by: sseekamp@risei.net
Reviewed by: mav@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11608

6 years agoStyle-only change: Consistently use the variable name "pdpg" throughout
alc [Sat, 15 Jul 2017 16:42:55 +0000 (16:42 +0000)]
Style-only change: Consistently use the variable name "pdpg" throughout
this file.  Previously, half of the pointers to a vm_page being used as
a page directory page were named "pdpg" and the rest were named "mpde".

Discussed with: kib
MFC after: 1 week

6 years agolibthr: check for possible overflow in the pthread_barrier_init() count.
pfg [Sat, 15 Jul 2017 15:00:13 +0000 (15:00 +0000)]
libthr: check for possible overflow in the pthread_barrier_init() count.

Following up on r320900, where the check for negative count values was
removed, add a check to prevent integer overflow. This is to account that
b_count, b_waiters but most importantly the total number of threads in
the system are signed values.

Discussed with: kib
MFC after: 2 weeks

6 years agoetc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined
manu [Sat, 15 Jul 2017 09:04:23 +0000 (09:04 +0000)]
etc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined

While here only install ipfw rc script if MK_IPFW is defined.

Reported by: ngie

6 years agoExtract the innermost loop of pmap_remove() out into its own function,
alc [Sat, 15 Jul 2017 01:49:54 +0000 (01:49 +0000)]
Extract the innermost loop of pmap_remove() out into its own function,
pmap_remove_ptes().  (This new function will also be used by an upcoming
change to pmap_enter() that adds support for psind == 1 mappings.)

Submitted by: Yufeng Zhou <yz70@rice.edu> (an earlier version)
Reviewed by: kib, markj
MFC after: 1 week

6 years agoRevert r320997. There are reports of it getting the wrong results, so
ian [Sat, 15 Jul 2017 00:45:22 +0000 (00:45 +0000)]
Revert r320997.  There are reports of it getting the wrong results, so
clearly my testing was insuffficent, and it's best to just revert it
until I get it straightened out.

6 years agoFix the build with GCC after r320975
asomers [Fri, 14 Jul 2017 21:50:04 +0000 (21:50 +0000)]
Fix the build with GCC after r320975

Reported by: pfg
MFC after: 20 days
X-MFC-With: 320975
Sponsored by: Spectra Logic Corp

6 years agoAdd 32-bit compat for kinfo_proc's ki_tdaddr.
brooks [Fri, 14 Jul 2017 21:13:05 +0000 (21:13 +0000)]
Add 32-bit compat for kinfo_proc's ki_tdaddr.

This appears to have been an oversight in r213536.

Reviewed by: markj
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11521

6 years agoMinor optimization: instead of converting between days and years using
ian [Fri, 14 Jul 2017 18:36:15 +0000 (18:36 +0000)]
Minor optimization: instead of converting between days and years using
loops that start in 1970, assume most conversions are going to be for recent
dates and use a precomputed number of days through the end of 2016.

6 years agoAllow setting debug.clocktime as a tunable. Print 64-bit time_t correctly
ian [Fri, 14 Jul 2017 18:13:54 +0000 (18:13 +0000)]
Allow setting debug.clocktime as a tunable.  Print 64-bit time_t correctly
on 32-bit systems.

6 years agoFollow up to r320992, properly escape the backslash so it renders properly.
brd [Fri, 14 Jul 2017 17:27:15 +0000 (17:27 +0000)]
Follow up to r320992, properly escape the backslash so it renders properly.

MFC after: 1 week
Forgotten by: brd
X-MFC-With: r320992

6 years agoAdd a complete example to tsearch(3)
brd [Fri, 14 Jul 2017 17:07:28 +0000 (17:07 +0000)]
Add a complete example to tsearch(3)

Reviewed by: wblock, sevan, bruffer
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11053

6 years agoAdd IBM TS1155 density codes to libmt and the mt(1) man page.
ken [Fri, 14 Jul 2017 16:45:46 +0000 (16:45 +0000)]
Add IBM TS1155 density codes to libmt and the mt(1) man page.

These are taken directly from the density report from a TS1155
tape drive.  (Using mt getdensity)

lib/libmt/mtlib.c:
Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi
values.  The bpmm/bpi values are the same as TS1150, but
there are 50% more tracks.

usr.bin/mt/mt.1:
Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
values and number of tracks.  Bump the man page date.

MFC after: 3 days
Sponsored by: Spectra Logic

6 years agolibthr: 'count' is unsigned so don't check for negative values.
pfg [Fri, 14 Jul 2017 16:05:54 +0000 (16:05 +0000)]
libthr: 'count' is unsigned so don't check for negative values.

Obtained from: DragonFlyBSD (git e7db8139)

6 years agoLanguage improvements.
kib [Fri, 14 Jul 2017 15:42:12 +0000 (15:42 +0000)]
Language improvements.

Submitted by: wblock
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D10826

6 years agoUpdate pci_vendors to 2017.07.13
bapt [Fri, 14 Jul 2017 14:58:10 +0000 (14:58 +0000)]
Update pci_vendors to 2017.07.13

MFC after: 2 days

6 years agoUpdate zstd to 1.3.0
bapt [Fri, 14 Jul 2017 14:55:34 +0000 (14:55 +0000)]
Update zstd to 1.3.0

6 years agoUpdate arcmsr(4) to 1.40.00.00 in order to add support of
delphij [Fri, 14 Jul 2017 14:53:13 +0000 (14:53 +0000)]
Update arcmsr(4) to 1.40.00.00 in order to add support of
ARC-1884 SATA RAID controllers.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>
MFC after: 3 days

6 years agoThis adds CAM pass(4) support for NVMe IO's. Applications indicate
imp [Fri, 14 Jul 2017 14:52:20 +0000 (14:52 +0000)]
This adds CAM pass(4) support for NVMe IO's. Applications indicate
the IO type (Admin or NVM) using XPT op-codes XPT_NVME_ADMIN or
XPT_NVME_IO.

Submitted by:   Chuck Tuffli <chuck@tuffli.net>
Differential Revision:  https://reviews.freebsd.org/D10247

6 years agoCorrect sysent flags for dynamically loaded syscalls.
kib [Fri, 14 Jul 2017 09:34:44 +0000 (09:34 +0000)]
Correct sysent flags for dynamically loaded syscalls.

Using the https://github.com/google/capsicum-test/ suite, the
PosixMqueue.CapModeForked test was failing due to an ECAPMODE after
calling kmq_notify(). On further inspection, the dynamically
loaded syscall entry was initialized with sy_flags zeroed out, since
SYSCALL_INIT_HELPER() left sysent.sy_flags with the default value.

Add a new helper SYSCALL{,32}_INIT_HELPER_F() which takes an
additional argument to specify the sy_flags value.

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11576

6 years agoGeneralize vm_page_ps_is_valid() to support testing other predicates on
alc [Fri, 14 Jul 2017 02:15:48 +0000 (02:15 +0000)]
Generalize vm_page_ps_is_valid() to support testing other predicates on
the (super)page, renaming the function to vm_page_ps_test().

Reviewed by: kib, markj
MFC after: 1 week

6 years agoixl: gcc build errors
rlibby [Fri, 14 Jul 2017 00:10:51 +0000 (00:10 +0000)]
ixl: gcc build errors

Fix minor -Werror issues when building with gcc from -Wredundant-decls,
-Wunused, -Wbool-operations.  Also ensure the M_IXL malloc type is only
defined once.

Reviewed by: efj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11414

6 years agoAdd tests for aio(4) completion notification via signals and threads
asomers [Thu, 13 Jul 2017 22:53:13 +0000 (22:53 +0000)]
Add tests for aio(4) completion notification via signals and threads

Reviewed by: jhb
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11468

6 years agoUse ATF cleanup routines in aio_test.c
asomers [Thu, 13 Jul 2017 22:49:55 +0000 (22:49 +0000)]
Use ATF cleanup routines in aio_test.c

Remove aio_test's legacy timeout handling and cleanup routines.  Instead,
use ATF's builtin capabilities.  ATF automatically cleans up newly created
files, too, so we don't have to explicitly unlink them.  The only tests than
need a cleanup routine are the md(4) tests, which must destroy their md
device.

Reviewed by: jhb
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11468

6 years agoFix kldload of if_ixl without PCI_IOV kernel option.
bdrewery [Thu, 13 Jul 2017 22:45:23 +0000 (22:45 +0000)]
Fix kldload of if_ixl without PCI_IOV kernel option.

This also avoids compiling in pci_iov support into the kernel if_ixoif
the PCI_IOV option is disabled.

Reviewed by: rstone
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11573

6 years agoixl(4)/ixlv(4): Stop leaking every busdma entry in receive path
erj [Thu, 13 Jul 2017 22:12:41 +0000 (22:12 +0000)]
ixl(4)/ixlv(4): Stop leaking every busdma entry in receive path

From Brett:

In short, busdma maps for received packets were not being unloaded in the
interrupt handler before the packets were passed up the network stack. The fix
was to add a busdma sync and unload for the two receive maps.

This bug is significant for certain busdma providers, for example IOMMUs,
where not unloading the maps means that 1) the IOMMU mappings that allow the
NIC to DMA the received packets into host memory stay open indefinitely,
potentially violating a desired security policy, and 2) resources such as
device address space addresses and host memory for bookkeeping are never freed.

Without an IOMMU or bounce buffering enabled for the ixl device, I don't think
adding these calls will have any significant performance impact. With the
IOMMU enabled, I have noticed a performance impact on the receive side, which
is expected.

Submitted by: Brett Gutstein <bgutstein@rice.edu>
Reviewed by: erj@
MFC after: 1 week

6 years agoFix a missing comment marker.
gjb [Thu, 13 Jul 2017 20:04:42 +0000 (20:04 +0000)]
Fix a missing comment marker.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoAdd some functions to jiffies.h.
markj [Thu, 13 Jul 2017 18:27:22 +0000 (18:27 +0000)]
Add some functions to jiffies.h.

Also add some checks for overflow to existing functions.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11533

6 years agoAdd 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.
sbruno [Thu, 13 Jul 2017 16:56:26 +0000 (16:56 +0000)]
Add 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.

Submitted by:  hannula@gmail.com
Differential Revision: https://reviews.freebsd.org/D7967

6 years agoAdd 4K quirks for Samsung 750 EVO SSD
sbruno [Thu, 13 Jul 2017 15:33:08 +0000 (15:33 +0000)]
Add 4K quirks for Samsung 750 EVO SSD

Submitted by: lev
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D9478

6 years agoAdd an rc.d script to setup a netflow export via ng_netflow
manu [Thu, 13 Jul 2017 13:40:18 +0000 (13:40 +0000)]
Add an rc.d script to setup a netflow export via ng_netflow
The default is to export netflow data on localhost on the netflow port.
ngtee is used to have the lowest overhead possible.
The ipfw ng hook is the netflow port (it can only be numeric)
Default is netflow version 5.

Sponsored-By: Gandi.net
Reviewed by: bapt (earlier version), olivier (earlier version)

6 years agoAdd ipfw_status command to etc/rc.d/ipfw
manu [Thu, 13 Jul 2017 13:32:23 +0000 (13:32 +0000)]
Add ipfw_status command to etc/rc.d/ipfw

This is helpful when using service/conf management tools.

Sonsored-By: Gandi.net

6 years agoFix GRE over IPv6 tunnels with IPFW
philip [Thu, 13 Jul 2017 09:01:22 +0000 (09:01 +0000)]
Fix GRE over IPv6 tunnels with IPFW

Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless
net.inet6.ip6.fw.deny_unknown_exthdrs was unset).

PR: 220640
Submitted by: Kun Xie <kxie@xiplink.com>
MFC after: 1 week

6 years agoFix size argument to vm_pager_allocate(), it is in bytes, not in pages.
kib [Thu, 13 Jul 2017 08:23:37 +0000 (08:23 +0000)]
Fix size argument to vm_pager_allocate(), it is in bytes, not in pages.
It is believed to be only cosmetic.

Noted by: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRevert r320936 to recommit with the correct log message.
kib [Thu, 13 Jul 2017 08:23:12 +0000 (08:23 +0000)]
Revert r320936 to recommit with the correct log message.

6 years agoIt is believed to be only cosmetic.
kib [Thu, 13 Jul 2017 08:19:50 +0000 (08:19 +0000)]
It is believed to be only cosmetic.

Noted by: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix libarchive mismerge of r320927 in libarchive_entry.h
mm [Thu, 13 Jul 2017 04:46:00 +0000 (04:46 +0000)]
Fix libarchive mismerge of r320927 in libarchive_entry.h

MFC after: 1 week
X-MFC-with: 320927
Reported by: Ngie Cooper <ngie@FreeBSD.org>

6 years agoFix libarchive mismerge of r320927
mm [Thu, 13 Jul 2017 04:42:29 +0000 (04:42 +0000)]
Fix libarchive mismerge of r320927

MFC after: 1 week
X-MFC-with: 320927
Reported by: Ngie Cooper <ngie@FreeBSD.org>

6 years agoAdd some basic tests for hexdump(1)'s various output flags. Formatting
kevans [Thu, 13 Jul 2017 03:52:54 +0000 (03:52 +0000)]
Add some basic tests for hexdump(1)'s various output flags. Formatting
tests are omitted for this initial run as there are still some bugs to work
out there.

This covers -s flag testing on devices and non-devices that would have
caught breakage found in PR 219173 as well as other subtle breakage caused
locally.

Reviewed by: cem, ngie
Approved by: cem (acting co-mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11279

6 years agoPut an #ifdef notyet wrapper around a function that's not being used yet,
ian [Thu, 13 Jul 2017 02:20:07 +0000 (02:20 +0000)]
Put an #ifdef notyet wrapper around a function that's not being used yet,
to avoid compile warnings.

6 years agoSupport the "disable-over-current" property for imx ehci controllers.
ian [Thu, 13 Jul 2017 02:16:15 +0000 (02:16 +0000)]
Support the "disable-over-current" property for imx ehci controllers.

It turns out that this is more than a power optization.  The OTG port
won't work on boards that have this property unless this setting is honored.

Also ensure that the usb phy device attaches before ehci.

6 years agoMFV r320924:
mm [Thu, 13 Jul 2017 00:28:36 +0000 (00:28 +0000)]
MFV r320924:
Bump libarchive to 3.3.2

Vendor changes:
  PR #901: don't depend on stdin in a testcase

MFC after: 1 week

6 years agoMETA_MODE: Fix not writing .meta files in the kernel build.
bdrewery [Wed, 12 Jul 2017 19:01:25 +0000 (19:01 +0000)]
META_MODE: Fix not writing .meta files in the kernel build.

This was a regression in r320220 due to improper porting of the
same logic from share/mk/bsd.dep.mk and having only tested with
-DNO_FILEMON at the time.

Pointyhat to: bdrewery
Reported by: Mark Millard, dhw, O. Hartmann
Sponsored by: Dell EMC Isilon

6 years agoAdd a newline after the version string.
markj [Wed, 12 Jul 2017 18:29:25 +0000 (18:29 +0000)]
Add a newline after the version string.

MFC after: 3 days

6 years agoReset unsupported SFP tuneable back to original entry name.
sbruno [Wed, 12 Jul 2017 17:35:32 +0000 (17:35 +0000)]
Reset unsupported SFP tuneable back to original entry name.

Reported by: olivier@

6 years agoRemove an extraneous strlen from t_setdomainname.c
asomers [Wed, 12 Jul 2017 14:51:32 +0000 (14:51 +0000)]
Remove an extraneous strlen from t_setdomainname.c

Reported by: Coverity
CID: 1377568
MFC after: 15 days
X-MFC-With: 320737
Sponsored by: Spectra Logic Corp

6 years agokvprintf %b enhancements
rlibby [Wed, 12 Jul 2017 07:30:14 +0000 (07:30 +0000)]
kvprintf %b enhancements

Make the %b formatter accept number formatting flags. It will now accept
alternate form, precision, and length modifiers. It also now partially
supports field width (but forces left justification).

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11284