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

6 years agoMFV r320905: Import upstream fix for CVE-2017-11103.
delphij [Wed, 12 Jul 2017 07:19:06 +0000 (07:19 +0000)]
MFV r320905: Import upstream fix for CVE-2017-11103.

In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Submitted by: hrs
Obtained from: Heimdal
Security: FreeBSD-SA-17:05.heimdal
Security: CVE-2017-11103

6 years agoSupport multiple realtime clocks, and remove locking/sleeping restrictions
ian [Wed, 12 Jul 2017 02:53:54 +0000 (02:53 +0000)]
Support multiple realtime clocks, and remove locking/sleeping restrictions
on clock drivers.

This tracks multiple concurrent realtime clock drivers in a list sorted by
clock resolution.  When system time changes (and periodically) the
clock_settime() methods of all registered clocks are invoked.

To initialize system time, each driver is tried in turn from best to worst
resolution, until one succesfully returns a valid time.

The code no longer holds a mutex while calling the clock_settime() and
clock_gettime() methods of the registered clocks. This allows clock drivers
to do whatever kind of locking or sleeping is necessary (this is especially
important for i2c clock chips since i2c drivers often need to sleep).

A new clock_register_flags() function allows the clock driver to pass
flags. The flags currently defined help support drivers that use their own
techniques to avoid roundoff errors (prevents the 4/5 rounding done by the
subr_rtc code). A driver which may need to wait for resources (such as bus
ownership) may pass a flag to indicate that it will obtain system time for
itself after waiting for resources; this is merely an optimization to avoid
the common code retrieving a timespec that will never get used.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11484

6 years agoProtect access to the AT realtime clock with its own mutex.
ian [Wed, 12 Jul 2017 02:42:57 +0000 (02:42 +0000)]
Protect access to the AT realtime clock with its own mutex.

The mutex protecting access to the registered realtime clock should not be
overloaded to protect access to the atrtc hardware, which might not even be
the registered rtc. More importantly, the resettodr mutex needs to be
eliminated to remove locking/sleeping restrictions on clock drivers, and
that can't happen if MD code for amd64 depends on it. This change moves the
protection into what's really being protected: access to the atrtc date and
time registers.

This change also adds protection when the clock is accessed from
xentimer_settime(), which bypasses the resettodr locking.

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

6 years agoConsistently use vop_stdpathconf() for default pathconf values.
jhb [Tue, 11 Jul 2017 21:55:20 +0000 (21:55 +0000)]
Consistently use vop_stdpathconf() for default pathconf values.

Update filesystems not currently using vop_stdpathconf() in pathconf
VOPs to use vop_stdpathconf() for any configuration variables that do
not have filesystem-specific values.  vop_stdpathconf() is used for
variables that have system-wide settings as well as providing default
values for some values based on system limits.  Filesystems can still
explicitly override individual settings.

PR: 219851
Reported by: cem
Reviewed by: cem, kib, ngie
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D11541

6 years agoAdd a subroutine for comparing kerneldump identifiers.
markj [Tue, 11 Jul 2017 18:24:05 +0000 (18:24 +0000)]
Add a subroutine for comparing kerneldump identifiers.

MFC after: 2 weeks

6 years agoDon't dlclose NSS modules from nss_atexit().
markj [Tue, 11 Jul 2017 17:59:15 +0000 (17:59 +0000)]
Don't dlclose NSS modules from nss_atexit().

As hinted in the commit log message for r259042, this is unnecessary.
Moreover, as a result of that change we may invoke a DSO's atexit handler
after it has been unmapped.

Reviewed by: bdrewery, cem
MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoAdd external PLATFORM access on arm, and use it in the pl310 driver.
andrew [Tue, 11 Jul 2017 16:30:16 +0000 (16:30 +0000)]
Add external PLATFORM access on arm, and use it in the pl310 driver.

This allows multiple instances of SoCs that use the pl310 driver to be
built within the same kernel:

 * Add access to the platform_t object from outside platform.c
 * Use this with the pl310 driver

There is a new platform_pl310 interface to replace the existing code. SoCs
need to implement the init method, and if they have special requirements to
write to the two registers we care about will also need to implement the
write_ctrl and write_debug methods.

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

6 years agoFix BIT_FLS().
kib [Tue, 11 Jul 2017 12:35:44 +0000 (12:35 +0000)]
Fix BIT_FLS().

The iteration index is unsigned, so testing for larger than or equal
to zero makes little sense.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 3 days

6 years agoMake fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition
trasz [Tue, 11 Jul 2017 12:32:40 +0000 (12:32 +0000)]
Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition
to -y.  To me, fsck_y_enable means "try as hard as possible", and without
-R, it... well, doesn't.

Reviewed by: mckusick
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11490

6 years agoDIRDEPS_BUILD: Connect more libraries.
bdrewery [Tue, 11 Jul 2017 00:32:48 +0000 (00:32 +0000)]
DIRDEPS_BUILD: Connect more libraries.

Sponsored by: Dell EMC Isilon

6 years agoFix INSTALL_AS_USER after r319020.
bdrewery [Mon, 10 Jul 2017 23:52:07 +0000 (23:52 +0000)]
Fix INSTALL_AS_USER after r319020.

Reviewed by: vangyzen
MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Mon, 10 Jul 2017 23:52:04 +0000 (23:52 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon

6 years agoFollow-up r318881: Disconnect groff documents.
bdrewery [Mon, 10 Jul 2017 23:51:51 +0000 (23:51 +0000)]
Follow-up r318881: Disconnect groff documents.

6 years agoFix error check for Rx mbuf allocation in ENA driver
zbb [Mon, 10 Jul 2017 22:11:30 +0000 (22:11 +0000)]
Fix error check for Rx mbuf allocation in ENA driver

ena_alloc_rx_mbuf() will return positive error code
on failure. Act accordingly.

Submitted by: Krishna Yenduri <kyenduri at brkt.com>

6 years agoBump to FreeBSD_version to 1200038 for MMC CAM
imp [Mon, 10 Jul 2017 21:55:24 +0000 (21:55 +0000)]
Bump to FreeBSD_version to 1200038 for MMC CAM

6 years agoMove mmc_parmas to the end of the structure for better compatability.
imp [Mon, 10 Jul 2017 21:55:19 +0000 (21:55 +0000)]
Move mmc_parmas to the end of the structure for better compatability.

6 years agoKill some unnecessary noise.
imp [Mon, 10 Jul 2017 21:38:26 +0000 (21:38 +0000)]
Kill some unnecessary noise.

6 years agoMake sure the mlx4en RX DMA ring gets stamped with software ownership
hselasky [Mon, 10 Jul 2017 19:26:50 +0000 (19:26 +0000)]
Make sure the mlx4en RX DMA ring gets stamped with software ownership
in order to prevent the flow of QP to error in the firmware once
UPDATE_QP is called.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoStart to move the arm *_mp.h to be names *_machdep.h. These will be used
andrew [Mon, 10 Jul 2017 15:27:53 +0000 (15:27 +0000)]
Start to move the arm *_mp.h to be names *_machdep.h. These will be used
by the reworked pl310 driver interface in
https://reviews.freebsd.org/D11546

6 years agoProvide libdl.
kib [Mon, 10 Jul 2017 14:59:21 +0000 (14:59 +0000)]
Provide libdl.

Create libdl.so.1 as a filter for libc.so.7 which exports public dl*
functions. The functions are resolved from the rtld instead, the goal
of creating library is to avoid errors from the static linker due to
missed libdl. For static binaries, an empty .o is compiled into
libdl.a so that static binaries still get dl stubs from libc.a.

Right now lld cannot create filter objects, disable libdl on arm64
when binutils are not used.

Reviewed by: bdrewery, dim (previos version); emaste
Exp run: PR 220525, done by antoine
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D11504

6 years agoFix attribute flipping for cut marking in pixel mode. The text-mode
bde [Mon, 10 Jul 2017 09:00:35 +0000 (09:00 +0000)]
Fix attribute flipping for cut marking in pixel mode.  The text-mode
code was used, so the lightness bit was not flipped, so the flipping
was unnecessarily null in some cases.  E.g., the unusal color scheme
of lightwhite on white (white = lightgrey in kernelspeak) is not
completely unusable, except null flipping of it gave no visible marks
for cut marking.  Now flipping it works in pixel mode only.

Fix text cursor attribute adjustment over cut marking in text mode for
the usual cursor type (non-blinking full block).  Apply the flipping
for cut marking first and adjust that instead of vice versa.  This
gives a uniform color scheme for the usual text cursor type in text
mode: a white block background with no change to the character
foreground except for variations to avoid collisions.  The old order
gave a white character fg with no change in the bg in non-colliding
cases.  Versions before r316636 changed the bg to the non-cut-marked
one about half the time using a saveunder bug; this accidentally gave
something resembling a block cursor half the time.