]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC 313020: Fix a couple of issues with t4iov probe and attach.
jhb [Fri, 3 Feb 2017 21:37:27 +0000 (21:37 +0000)]
MFC 313020: Fix a couple of issues with t4iov probe and attach.

- Check for Chelsio vendor ID in probe routines.
- Fail attach instead of faulting if pci_find_dbsf() doesn't find a
  device.

PR: 216539
Sponsored by: Chelsio Communications

7 years agoMFC r312993:
dim [Fri, 3 Feb 2017 19:15:53 +0000 (19:15 +0000)]
MFC r312993:

Pull in r279454 from upstream llvm trunk (by James Molloy):

  [SROA] Remove incorrect assertion

  Confirmed with aprantl, this assertion is incorrect - code can get
  here (for example 80-bit FP types) and if it does it's benign. This
  is exposed by a completely unrelated patch of mine, so stop the
  compiler falling over.

  Original differential: http://reviews.llvm.org/D16187
  aprantl's advice to remove assertion:
  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160815/382129.html

This should fix assertions when building the math/opensolaris-libm port.

Reported by: marino

7 years agoMFC r312832:
dim [Fri, 3 Feb 2017 19:12:54 +0000 (19:12 +0000)]
MFC r312832:

Pull in r278160 from upstream llvm trunk (by Wei Mi):

  Recommit "Use ValueOffsetPair to enhance value reuse during SCEV
  expansion".

  The fix for PR28705 will be committed consecutively.

  In D12090, the ExprValueMap was added to reuse existing value during
  SCEV expansion. However, const folding and sext/zext distribution can
  make the reuse still difficult.

  A simplified case is: suppose we know S1 expands to V1 in
  ExprValueMap, and
    S1 = S2 + C_a
    S3 = S2 + C_b
  where C_a and C_b are different SCEVConstants. Then we'd like to
  expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
  helpful when S2 is a complex SCEV expr and S2 has no entry in
  ExprValueMap, which is usually caused by the fact that S3 is
  generated from S1 after const folding.

  In order to do that, we represent ExprValueMap as a mapping from SCEV
  to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
  into the ExprValueMap when we create SCEV for V1. When S3 is
  expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
  C_a} in the map, then expand S3 to V1 - C_a + C_b.

  Differential Revision: https://reviews.llvm.org/D21313

Pull in r278161 from upstream llvm trunk (by Wei Mi):

  Fix the runtime error caused by "Use ValueOffsetPair to enhance value
  reuse during SCEV expansion".

  The patch is to fix the bug in PR28705. It was caused by setting
  wrong return value for SCEVExpander::findExistingExpansion. The
  return values of findExistingExpansion have different meanings when
  the function is used in different ways so it is easy to make mistake.
  The fix creates two new interfaces to replace
  SCEVExpander::findExistingExpansion, and specifies where each
  interface is expected to be used.

  Differential Revision: https://reviews.llvm.org/D22942

Pull in r281439 from upstream llvm trunk (by Wei Mi):

  Create a getelementptr instead of sub expr for ValueOffsetPair if the
  value is a pointer.

  This patch is to fix PR30213. When expanding an expr based on
  ValueOffsetPair, if the value is of pointer type, we can only create
  a getelementptr instead of sub expr.

  Differential Revision: https://reviews.llvm.org/D24088

This should fix assertion failures when building OpenCV >= 3.1, and also
allow building lang/spidermonkey24 without any further assertions.

PR: 215649

7 years agoAdd history section for dd(1)
sevan [Fri, 3 Feb 2017 16:57:14 +0000 (16:57 +0000)]
Add history section for dd(1)
First version of UNIX to include dd found using TUHS
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c

PR: 211777
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8104

7 years agoMFC r312001:
pfg [Fri, 3 Feb 2017 16:35:10 +0000 (16:35 +0000)]
MFC r312001:
Remove __nonnull() attributes from x86 machine check architecture.

In this case the attributes serve little purpose as they just don't
enforce run time checks, If anything the attributes would cause NULL pointer
checks to be ignored but there are no such checks so the only effect is
cosmetic.

Reviewed by: jhb, avg

7 years agoRevert previous merge as it contained incorrect commit message.
sevan [Fri, 3 Feb 2017 12:47:24 +0000 (12:47 +0000)]
Revert previous merge as it contained incorrect commit message.

7 years agoMFC r312555:
kib [Fri, 3 Feb 2017 12:03:10 +0000 (12:03 +0000)]
MFC r312555:
Use SFENCE for ordering CLFLUSHOPT.

7 years agoIn v3 UNIX, the kill utility is documented in category 8, not 1.
sevan [Fri, 3 Feb 2017 11:17:44 +0000 (11:17 +0000)]
In v3 UNIX, the kill utility is documented in category 8, not 1.
Add a note of it.
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man8/kill.8

PR: 211786
Approved by: bcr (mentor)
Obtained from: TUHS
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoFix the previous commit to the family tree file. It is too early
sevan [Fri, 3 Feb 2017 11:04:50 +0000 (11:04 +0000)]
Fix the previous commit to the family tree file.  It is too early
to list 11.0, and we do not list -CURRENT here.

Submitted by: maxim
Sponsored by: The FreeBSD Foundation

7 years agoMFC r310724:
markj [Fri, 3 Feb 2017 01:32:04 +0000 (01:32 +0000)]
MFC r310724:
Follow DW_AT_specification when looking up DW_AT_type attributes.

PR: 215350, 215395

7 years agoMFC r308773:
markj [Fri, 3 Feb 2017 01:30:51 +0000 (01:30 +0000)]
MFC r308773:
Define dependencies for some auto-generated source files in libdtrace.

7 years agoMFC r307400, r307401:
markj [Fri, 3 Feb 2017 01:28:57 +0000 (01:28 +0000)]
MFC r307400, r307401:
DTrace test fixes.

7 years agoMFC r305055:
markj [Fri, 3 Feb 2017 01:23:39 +0000 (01:23 +0000)]
MFC r305055:
Recursively enumerate anonymous structs and unions in ctf_member_info().

7 years agoMFC r302793:
markj [Fri, 3 Feb 2017 01:21:56 +0000 (01:21 +0000)]
MFC r302793:
Allow ACPI wakeup code and page tables to be stored in non-contiguous pages.

7 years agoMFC r307693:
markj [Fri, 3 Feb 2017 01:19:48 +0000 (01:19 +0000)]
MFC r307693:
Simplify keg_drain() a bit by using LIST_FOREACH_SAFE.

7 years agoMFC r309698, r309699, r309700:
markj [Fri, 3 Feb 2017 01:18:47 +0000 (01:18 +0000)]
MFC r309698, r309699, r309700:
DTrace test fixes.

7 years agoMFC r309200:
markj [Fri, 3 Feb 2017 01:16:54 +0000 (01:16 +0000)]
MFC r309200:
Launder VPO_NOSYNC pages upon vnode deactivation.

7 years agoMFC r310420, r310421, r310422:
markj [Fri, 3 Feb 2017 01:15:31 +0000 (01:15 +0000)]
MFC r310420, r310421, r310422:
Fix races and logic errors around dlclose().

7 years agoMFC r310316:
markj [Fri, 3 Feb 2017 01:10:38 +0000 (01:10 +0000)]
MFC r310316:
Consistently print D variable indices in decimal when disassembling.

7 years agoMFC r312209:
markj [Fri, 3 Feb 2017 01:04:22 +0000 (01:04 +0000)]
MFC r312209:
Suppress a warning about m_assertbuf being unused.

7 years agoMFC r311902:
markj [Fri, 3 Feb 2017 00:58:08 +0000 (00:58 +0000)]
MFC r311902:
Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.

7 years agoMFC r312893:
markj [Fri, 3 Feb 2017 00:55:31 +0000 (00:55 +0000)]
MFC r312893:
Fix an off-by-one in an assertion on fasttrap tracepoint sizes.

7 years agoMFC r312199:
markj [Fri, 3 Feb 2017 00:54:27 +0000 (00:54 +0000)]
MFC r312199:
Stop the scheduler upon panic even in non-SMP kernels.

7 years agoMFC r312307:
markj [Fri, 3 Feb 2017 00:53:33 +0000 (00:53 +0000)]
MFC r312307:
Improve some of the sysctl descriptions added in r299827.

7 years agoMFC r310332:
markj [Fri, 3 Feb 2017 00:50:41 +0000 (00:50 +0000)]
MFC r310332:
Avoid modifying the object string table when patching USDT probes.

7 years agoMFC r310180, r310327
asomers [Thu, 2 Feb 2017 21:05:55 +0000 (21:05 +0000)]
MFC r310180, r310327

r310180:
Fix panic during lagg destruction with simultaneous status check

If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a
page fault may result. The first process will destroy ifp->if_lagg in
lagg_clone_destroy (called by if_clone_destroy). Then the second process
will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and
goto fallback: where it will promptly dereference ifp->if_lagg anyway.

The solution is to repeat the NULL check for ifp->if_lagg

MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8512

r310327:
Remove stray debugging code from r310180

Reported by: rstone
Pointy hat to: asomers
MFC after: 3 weeks
X-MFC-with: 310180
Sponsored by: Spectra Logic Corp

7 years agoMFC r311160, r311210, r311288, r311292, r311298, r311340
asomers [Thu, 2 Feb 2017 18:27:20 +0000 (18:27 +0000)]
MFC r311160, r311210, r311288, r311292, r311298, r311340

r311160:
misc minor fixes in mpr(4)

sys/dev/mpr/mpr_sas.c
* Fix a potential null pointer dereference (CID 1305731)
* Check for overrun of the ccb_scsiio.cdb_io.cdb_bytes buffer (CID
  1211934)

sys/dev/mpr/mpr_sas_lsi.c
* Nullify a dangling pointer in mprsas_get_sata_identify
* Fix a memory leak in mprsas_SSU_to_SATA_devices (CID 1211935)

Reported by: Coverity (partially)
CID: 1305731 1211934 1211935
Reviewed by: slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8880

r311210:
Quell Coverity for diskinfo(8)

* CID 1198994: Don't run the speed disk on a disk with no sectors
* CID 1011442: Don't call close(2) if open(2) fails
* CID 1011161: Use snprintf instead of sprintf
* CID 1009825: Check the return value of lseek

Reported by: Coverity
CID: 1198994 1011442 1011161 1009825
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r311288:
Delete dead code in chat(8)

It's always been dead, ever since first import in 1994.  It's still dead in
OpenBSD's version, too.

Reported by: Coverity
CID: 270586
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r311292:
Remove dead code in rpc_parse.c

It's been dead ever since it was imported from TI-RPC in 1995.  The dead
code is still present in Illumos today, but was removed from NetBSD in 2006.

Reported by: Coverity
CID: 270097
Obtained from: NetBSD
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r311298:
Remove dead code in dhclient(8)

The offending code has been dead ever since the import from OpenBSD in
r195805.  OpenBSD later deleted that entire function.

Reported by: Coverity
CID: 500059
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r311340:
Misc Coverity fixes for tail(1)

CID 1006402: Initialize stack variable
CID 271580: Don't leak memory when ENOMEM.

Reported by: Coverity
CID: 271580 1006402
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoMFC r312649:
kib [Thu, 2 Feb 2017 01:21:55 +0000 (01:21 +0000)]
MFC r312649:
Document mount option "nonc" for tmpfs.

7 years agoMFC r312432:
kib [Thu, 2 Feb 2017 01:18:54 +0000 (01:18 +0000)]
MFC r312432:
Add a mount option for tmpfs(5) to not use namecache.

7 years agoMFC r312430:
kib [Thu, 2 Feb 2017 01:17:04 +0000 (01:17 +0000)]
MFC r312430:
Implement VOP_VPTOCNP() for tmpfs.

7 years agoMFC r312429:
kib [Thu, 2 Feb 2017 01:14:44 +0000 (01:14 +0000)]
MFC r312429:
VNON nodes cannot exist.

7 years agoMFC r312428:
kib [Thu, 2 Feb 2017 01:11:49 +0000 (01:11 +0000)]
MFC r312428:
Refcount tmpfs nodes and mount structures.

7 years agoMFC r312728
davidcs [Thu, 2 Feb 2017 00:12:24 +0000 (00:12 +0000)]
MFC r312728
  Added support for if_transmit and if_qflush
  Removed if_start
  updated version to 3.10.33

7 years agoMFC 312782
kp [Wed, 1 Feb 2017 20:27:38 +0000 (20:27 +0000)]
MFC 312782

bridge: Release the bridge lock when calling bridge_set_ifcap()

This calls ioctl() handlers for the different interfaces in the bridge.
These handlers expect to get called in an ioctl context where it's safe
for them to sleep. We may not sleep with the bridge lock held.

However, we still need to protect the interface list, to ensure it
doesn't get changed while we iterate over it.
Use BRIDGE_XLOCK(), which prevents bridge members from being removed.
Adding bridge members is safe, because it uses LIST_INSERT_HEAD().

This caused panics when adding xen interfaces to a bridge.

PR: 216304
Reviewed by: ae
Sponsored by: RootBSD
Differential Revision: https://reviews.freebsd.org/D9290

7 years agoMFC r312678: Eliminate misleading comments and dead code in
rpokala [Wed, 1 Feb 2017 04:53:52 +0000 (04:53 +0000)]
MFC r312678: Eliminate misleading comments and dead code in
lacp_port_create()

Variables "fast" and "active" are both constant in lacp_port_create(), but
comments mispleadingly suggest that "fast" can be changed via ioctl. The
constant values control the value of "lp->lp_state", so it too is constant,
and the code for assigning different value to it is essentially dead.

Remove both "fast" and "active", and set "lp->lp_state" unconditionally;
that gets rid of the dead code and misleading comments.

7 years agoMFC r312531: vmm_dev: work around a bogus error with gcc 6.3.0
avg [Mon, 30 Jan 2017 14:33:53 +0000 (14:33 +0000)]
MFC r312531: vmm_dev: work around a bogus error with gcc 6.3.0

7 years agoMFC r312228: Make `camcontrol cmd ... -i ...` return only valid bytes.
mav [Sun, 29 Jan 2017 14:28:29 +0000 (14:28 +0000)]
MFC r312228: Make `camcontrol cmd ... -i ...` return only valid bytes.

Previously code ignored resid field and returned extra zeroes in case of
data underflow.  Now it returns only real bytes received from target.

7 years agoMFC r312647:
kib [Sun, 29 Jan 2017 10:33:42 +0000 (10:33 +0000)]
MFC r312647:
Add comments explaining unobvious td_critnest adjustments in
critical_exit().

7 years agoMFC r312644, r312650
bapt [Sat, 28 Jan 2017 17:40:37 +0000 (17:40 +0000)]
MFC r312644, r312650

r312644:
Readd a feature lost in pw(8) refactoring

pw usermod foo -m

It used to be able to (re)create the home directory if it didn't exists

PR: 216224
Reported by: ae
MFC after: 3 days

r312650:
Really restore the old behaviour for pw usermod -m

It again reinstall missing skel files without overwriting changed one
Add a regression test about it

Reported by: ae
MFC after: 3 days

7 years agoMFC r311659:
bapt [Sat, 28 Jan 2017 17:37:51 +0000 (17:37 +0000)]
MFC r311659:

remove network mask calculation for Classful network

Nowadays it's not necessary to compute network mask from the IP address and
compare to given by DHCP.

Submitted by: kczekirda
Reviewed by: glebius, bapt
Sponsored by: Oktawave
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D8740

7 years agoMFC r312547: Mention sendfile(2) by popular demand.
wblock [Fri, 27 Jan 2017 17:54:24 +0000 (17:54 +0000)]
MFC r312547: Mention sendfile(2) by popular demand.

Sponsored by: iXsystems

7 years agoMFC r312699:
tijl [Fri, 27 Jan 2017 10:06:20 +0000 (10:06 +0000)]
MFC r312699:

Apply r210555 to 64 bit linux support:

The interpreter name should no longer be treated as a buffer that can be
overwritten.

PR: 216346

7 years agoMFH: r308671
julian [Fri, 27 Jan 2017 09:11:44 +0000 (09:11 +0000)]
MFH: r308671

When you select make OLDTIMEZONES=1 then you need a few added directories
to be made or the command fails

Sponsored by: panzura

MFH: r310426

If you are going to be run individually to make a new timezone set
then ensure the destination directories exist.
Especially if you define OLDTIMEZONES because the mtree pass
doesn't do it for you.

Sponsored by: Panzura

7 years agoMFC r312533: Report disk addition errors on `add` or `create` subcommand.
mav [Fri, 27 Jan 2017 05:58:53 +0000 (05:58 +0000)]
MFC r312533: Report disk addition errors on `add` or `create` subcommand.

7 years agoMFC r312538:
pfg [Fri, 27 Jan 2017 04:52:27 +0000 (04:52 +0000)]
MFC r312538:
Addition of clang nullability qualifiers.

For consistency with the qualifiers added in r310977, define a new
qualifier _Null_unspecified which is also defined in clang 3.7+.

Add two new macros:
__NULLABILITY_PRAGMA_PUSH
__NULLABILITY_PRAGMA_POP

These are for use in headers when we want avoid noisy warnings if
some pointers are left without nullability annotations.

These are added with way ahead of their first use to teach the GCC
ports headers of their existance before their first use.

7 years agoMFC r311993: Fix typo in r311971 and now in r312405 too.
kan [Fri, 27 Jan 2017 03:44:50 +0000 (03:44 +0000)]
MFC r311993: Fix typo in r311971 and now in r312405 too.

7 years agoMFC r310698:
araujo [Fri, 27 Jan 2017 02:35:05 +0000 (02:35 +0000)]
MFC r310698:

Print hostcache usage counts with TCP statistics.

PR: 196252
Submitted by: Anton Yuzhaninov <citrin+pr@citrin.ru>
MFC after: 3 weeks.

7 years agoMFC r312232: Add under-/overrun support to IOCTL and CAM SIM frontends.
mav [Thu, 26 Jan 2017 21:21:26 +0000 (21:21 +0000)]
MFC r312232: Add under-/overrun support to IOCTL and CAM SIM frontends.

7 years agoMFC r312231: When in kernel, map ctl_scsi_zero_io() to ctl_zero_io().
mav [Thu, 26 Jan 2017 21:08:27 +0000 (21:08 +0000)]
MFC r312231: When in kernel, map ctl_scsi_zero_io() to ctl_zero_io().

7 years agoMFC r312026: Improve CAM_CDB_POINTER support.
mav [Thu, 26 Jan 2017 21:06:59 +0000 (21:06 +0000)]
MFC r312026: Improve CAM_CDB_POINTER support.

7 years agoMFC r311873: Fix malloc(M_WAITOK) under mutex, introduced at r311787.
mav [Thu, 26 Jan 2017 21:01:38 +0000 (21:01 +0000)]
MFC r311873: Fix malloc(M_WAITOK) under mutex, introduced at r311787.

7 years agoMFC r311804: Rewrite CTL statistics in more simple and scalable way.
mav [Thu, 26 Jan 2017 20:59:36 +0000 (20:59 +0000)]
MFC r311804: Rewrite CTL statistics in more simple and scalable way.

Instead of collecting statistics for each combination of ports and logical
units, that consumed ~45KB per LU with present number of ports, collect
separate statistics for every port and every logical unit separately, that
consume only 176 bytes per each single LU/port.  This reduces struct
ctl_lun size down to just 6KB.

Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should
allow handling of very large quantities.

Old API is still enabled in stable branches for compatibility reasons.

7 years agoMFC r311787: Allocate memory for prevent flags only for removable LUs.
mav [Thu, 26 Jan 2017 20:57:19 +0000 (20:57 +0000)]
MFC r311787: Allocate memory for prevent flags only for removable LUs.

This array takes 64KB of RAM now, that was more then half of struct ctl_lun
size.  If at some point we support more ports, this may need another tune.

7 years agoMFC r311680: Make CTL_GETSTATS ioctl return partial data if buffer is small.
mav [Thu, 26 Jan 2017 20:51:18 +0000 (20:51 +0000)]
MFC r311680: Make CTL_GETSTATS ioctl return partial data if buffer is small.

7 years agoMFC r310778, r310782: Improve use of I/O's private area.
mav [Thu, 26 Jan 2017 20:49:19 +0000 (20:49 +0000)]
MFC r310778, r310782: Improve use of I/O's private area.

 - Since I/Os are allocates from per-port pools, make allocations store
pointer to CTL softc there, and use it where needed instead of global.
 - Created bunch of helper macros to access LUN, port and CTL softc.

7 years agoMFC r310786, r310803, r310985, r311894
asomers [Thu, 26 Jan 2017 20:15:14 +0000 (20:15 +0000)]
MFC r310786, r310803, r310985, r311894

r310786:
Reduce the runtime of the GELI tests

There is no reduction in test coverage.  On my system runtime is reduced
from 38m32s to 6m24s.

tests/sys/geom/class/eli/conf.sh
tests/sys/geom/class/eli/init_a_test.sh
tests/sys/geom/class/eli/init_test.sh
tests/sys/geom/class/eli/integrity_copy_test.sh
tests/sys/geom/class/eli/integrity_data_test.sh
tests/sys/geom/class/eli/integrity_hmac_test.sh
tests/sys/geom/class/eli/onetime_a_test.sh
tests/sys/geom/class/eli/onetime_test.sh
Move the looping code into common functions in conf.sh, and remove
alias ciphers from the list.

tests/sys/geom/class/eli/init_a_test.sh
tests/sys/geom/class/eli/init_test.sh
tests/sys/geom/class/eli/integrity_copy_test.sh
tests/sys/geom/class/eli/integrity_data_test.sh
tests/sys/geom/class/eli/integrity_hmac_test.sh
tests/sys/geom/class/eli/onetime_a_test.sh
Move a few commands that don't need to be in the inner loop out.

tests/sys/geom/class/eli/init_test.sh
tests/sys/geom/class/eli/onetime_a_test.sh
Reduce the sector count

tests/sys/geom/class/eli/Makefile
tests/sys/geom/class/eli/init_alias_test.sh
Add a test for initializing a GELI device using one of the cipher
aliases, and check that the alias is correctly interpreted.

MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8814

r310803:
ATFify the gnop tests

Also, add test cases for the -p, -P, and -s options to gnop create

Reviewed by: ngie
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D8892

r310985:
Update ObsoleteFiles.inc for r310803

MFC after: 26 days
X-MFC-with: 310803

r311894:
Fix typo from change 310985 in ObsoleteFiles.inc

MFC after: 16 days
X-MFC-With: 310803
Sponsored by: Spectra Logic Corp

7 years agoMFC: r312825
jkim [Thu, 26 Jan 2017 19:14:14 +0000 (19:14 +0000)]
MFC: r312825

Merge OpenSSL 1.0.2k.

7 years agoMFC r312423:
kib [Thu, 26 Jan 2017 11:06:39 +0000 (11:06 +0000)]
MFC r312423:
Refresh tmpfs(5) man page.

MFC r312648:
Editing and clarifications for tmpfs(5).

7 years agoMFC r312425:
kib [Thu, 26 Jan 2017 11:03:19 +0000 (11:03 +0000)]
MFC r312425:
Make tmpfs directory cursor available outside tmpfs_subr.c.

7 years agoMFC r312414:
kib [Thu, 26 Jan 2017 10:58:12 +0000 (10:58 +0000)]
MFC r312414:
Rename tmpfs_mount member allnode_lock to include namespace prefix.

7 years agoMFC r312410:
kib [Thu, 26 Jan 2017 10:53:05 +0000 (10:53 +0000)]
MFC r312410:
Rework some tmpfs lock assertions.

MFC r312412:
Protect macro argument.

7 years agoMFC r312409:
kib [Thu, 26 Jan 2017 10:47:05 +0000 (10:47 +0000)]
MFC r312409:
Style fixes and comment updates.

MFC r312435:
Remove mistakenly merged field.

7 years agoMFC r312407:
kib [Thu, 26 Jan 2017 10:41:56 +0000 (10:41 +0000)]
MFC r312407:
Remove unused union member, fifos on tmpfs are implemented in common code.

7 years agoMFC r312124 (by mjg):
kib [Thu, 26 Jan 2017 10:19:53 +0000 (10:19 +0000)]
MFC r312124 (by mjg):
tmpfs: manage tm_pages_used with atomics.

7 years agoMFC r311526 (by mjg):
kib [Thu, 26 Jan 2017 10:18:00 +0000 (10:18 +0000)]
MFC r311526 (by mjg):
tmpfs: enable MNTK_EXTENDED_SHARED.

7 years agoMFC r311531 (by mjg):
kib [Thu, 26 Jan 2017 10:15:41 +0000 (10:15 +0000)]
MFC r311531 (by mjg):
Perform a lockless check in tmpfs_itimes.

7 years agoMFC r312532: don't abort writing of a core dump after EFAULT
avg [Thu, 26 Jan 2017 09:46:34 +0000 (09:46 +0000)]
MFC r312532: don't abort writing of a core dump after EFAULT

7 years agoMFC r312214: Enable IPv6 on EC2 AMIs.
cperciva [Thu, 26 Jan 2017 04:44:18 +0000 (04:44 +0000)]
MFC r312214: Enable IPv6 on EC2 AMIs.

7 years agoMFC r312288: rtld: do not rely on a populated GOT on amd64
emaste [Thu, 26 Jan 2017 03:05:27 +0000 (03:05 +0000)]
MFC r312288: rtld: do not rely on a populated GOT on amd64

On rela architectures GNU BFD ld and gold store the relocation addend
in GOT entries (in addition to the relocation's r_addend field).
rtld previously relied on this to access its own _DYNAMIC symbol in
order to apply its own relocations.

However, recording addends in the GOT is not specified by the ABI,
and some versions of LLVM's LLD linker leave the GOT uninitialized on
rela architectures.

BFD ld does not populate the GOT on sparc64, and sparc64 rtld has a
machine-dependent rtld_dynamic_addr() function that returns the
_DYNAMIC address. Use the same approach on amd64, obtaining the %rip-
relative _DYNAMIC address following a suggestion from Rafael EspĂ­ndola.

Architectures other than amd64 should be addressed in future work.

7 years agoFix a crash in netmap when using the emulated mode.
loos [Wed, 25 Jan 2017 21:35:15 +0000 (21:35 +0000)]
Fix a crash in netmap when using the emulated mode.

This is a direct commit to stable/11 as the -head version was already fixed
by a recent import of a new netmap version.

Submitted by: Vincenzo Maffione <v.maffione@gmail.com>
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r312560:
avos [Wed, 25 Jan 2017 20:44:57 +0000 (20:44 +0000)]
MFC r312560:
ifconfig(8): fix '-stbc' parameter name.

7 years agoMFC r311932:
dim [Wed, 25 Jan 2017 19:55:35 +0000 (19:55 +0000)]
MFC r311932:

Make EFI_RESERVED_SERVICE a proper prototype

With clang 4.0.0, the EFI API header causes the following warning:

In file included from sys/boot/efi/loader/bootinfo.c:43:
In file included from sys/boot/efi/loader/../include/efi.h:52:
sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
(EFIAPI *EFI_RESERVED_SERVICE) (
                               ^

Add VOID to make it into a real prototype.

Reviewed by: imp, emaste, tsoome
Differential Revision: https://reviews.freebsd.org/D9132

7 years agoMFC r311929:
dim [Wed, 25 Jan 2017 19:16:24 +0000 (19:16 +0000)]
MFC r311929:

Don't include <errno.h> in reloc_elf.c, as it includes <stand.h> just
after it, which has a conflicting definition of errno.  This leads to
the following warning with clang 4.0.0:

    In file included from sys/boot/common/reloc_elf32.c:6:
    In file included from sys/boot/common/reloc_elf.c:37:
    /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int errno;
               ^
    sys/sys/errno.h:46:26: note: expanded from macro 'errno'
    #define errno           (* __error())
                                      ^

7 years agoMFC r311933:
dim [Wed, 25 Jan 2017 18:31:51 +0000 (18:31 +0000)]
MFC r311933:

Use proper prototypes in struct boot_module_t

With clang 4.0.0, we are getting the following warnings about struct
boot_module_t in efi's boot_module.h:

In file included from sys/boot/efi/boot1/ufs_module.c:41:
sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        void (*init)();
                    ^
                     void
sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        void (*status)();
                      ^
                       void
sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        dev_info_t *(*devices)();
                              ^
                               void
3 errors generated.

Fix this by adding 'void' to the parameter lists.  No functional change.

Reviewed by: emaste, imp, smh
Differential Revision: https://reviews.freebsd.org/D9144

7 years agoMFC r311811:
dim [Wed, 25 Jan 2017 18:21:49 +0000 (18:21 +0000)]
MFC r311811:

Avoid taking the address of a packed struct member in mfiutil

Fix a clang 4.0.0 warning about taking the address of a packed member of
struct mfi_evt in mfiutil:

    usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
    member 'members' of class or structure 'mfi_evt' may result in an
    unaligned pointer value [-Werror,-Waddress-of-packed-member]
                            if (parse_locale(optarg, &filter.members.locale) < 0) {
                                                      ^~~~~~~~~~~~~~~~~~~~~

Use a local variable instead, and copy that into the struct.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D9069

7 years agoMFC r311807:
dim [Wed, 25 Jan 2017 18:07:27 +0000 (18:07 +0000)]
MFC r311807:

Add recently added libc++ headers to OptionalObsoleteFiles.inc.

7 years agoMFC r312604 and r312605:
loos [Wed, 25 Jan 2017 16:18:40 +0000 (16:18 +0000)]
MFC r312604 and r312605:

Simplify the handling of small packets padding in cpsw:
 - Pad small packets to 60 bytes and not 64 (exclude the CRC bytes);
 - Pad the packet using m_append(9), if the packet has enough space for
   padding, which is usually true, it will not be necessary append a newly
   allocated mbuf to the chain.

Suggested by: yongari

MFC r312608:

Handle the rx queue stall while reading the packets from NIC (when the
descriptor state will not change anymore).  This seems to eliminate the
race where we can miss a stalled queue under high load.

While here remove the unnecessary curly brackets.

Reported by: Konstantin Kormashev <konstantin@netgate.com>

MFC r312636:

Properly assemble an mbuf chain out of received fragments.

Remove the rx_batch hack, it makes no difference now that most of bugs have
been sorted out.

MFC r312637:

Be a little more pedantic here, the TRM says the hardware is supposed to
only clean the OWNER bit on SOP descriptors.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r312411:
loos [Wed, 25 Jan 2017 16:10:35 +0000 (16:10 +0000)]
MFC r312411:

Handle the set capabilities ioctl, letting the hardware checksum be
disabled (Hi netmap!).

Only remove the CRC bytes from packets when the hardware tell us to do so.

Fixes the 'discard frame w/o leading ethernet header' issues.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r312408:
loos [Wed, 25 Jan 2017 15:27:05 +0000 (15:27 +0000)]
MFC r312408:

The port number and the to_port_en flag are valid only on SOP descriptor.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308458, r311157 and r312347:
loos [Wed, 25 Jan 2017 14:49:42 +0000 (14:49 +0000)]
MFC r308458, r311157 and r312347:

Add the DTS for the Netgate SG-1000 (micro-Firewall).

Remove a GPL licensed DTS.

The micro-Firewall DTS is now a single BSD licensed file.

The write-protect is not wired on uFW, disable it to allow writes to SD
card.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r311935: Pretend we support some IOCTLs to not scary upper layers.
mav [Wed, 25 Jan 2017 07:51:19 +0000 (07:51 +0000)]
MFC r311935: Pretend we support some IOCTLs to not scary upper layers.

7 years agoRegen src.conf.5 after r312730 WITH_REPRODUCIBLE_BUILD
emaste [Wed, 25 Jan 2017 01:16:10 +0000 (01:16 +0000)]
Regen src.conf.5 after r312730 WITH_REPRODUCIBLE_BUILD

Also pick up r312019

7 years agoAdd WITH_REPRODUCIBLE_BUILD src.conf(5) knob
emaste [Wed, 25 Jan 2017 01:04:51 +0000 (01:04 +0000)]
Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob

MFC r310128: Add WITH_REPRODUCIBLE_BUILD src.conf(5) knob to disable kernel
  metadata

The kernel builds reproducibly, except for the time, date, user, and
hostname baked into the kernel (reported at startup and via the
kern.version sysctl for uname).  Add a build knob to disable the
inclusion of this metadata.

MFC r310268: Build loaders reproducibly when WITH_REPRODUCIBLE_BUILD

When WITH_REPRODUCIBLE_BUILD=yes is set in src.conf(5), eliminate the
time, user, and host from the loader's version information.  This allows
builds to produce bit-for-bit identical output.

7 years agoreadelf: add PPC64 relocation types
emaste [Wed, 25 Jan 2017 00:44:21 +0000 (00:44 +0000)]
readelf: add PPC64 relocation types

MFC of r311941, r311942

7 years agoMFC r310766,r310767,r310774,r310779:
mjg [Tue, 24 Jan 2017 19:45:33 +0000 (19:45 +0000)]
MFC r310766,r310767,r310774,r310779:

    cache: drop the NULL check from VP2VNODELOCK

    Now that negative entries are annotated with a dedicated flag, NULL vnodes
    are no longer passed.

==

    cache: depessimize hashing macros/inlines

    All hash sizes are power-of-2, but the compiler does not know that for sure
    and 'foo % size' forces doing a division.

    Store the size - 1 and use 'foo & hash' instead which allows mere shift.

==

    cache: move shrink lock init to nchinit

    This gets rid of unnecesary sysinit usage.

    While here also rename the lock to be consistent with the rest.

==

    cache: sprinkle __predict_false

7 years agoMFC r311004:
mjg [Tue, 24 Jan 2017 19:41:55 +0000 (19:41 +0000)]
MFC r311004:

    fd: access openfiles once in falloc_noinstall

    This is similar to what's done with nprocs.

    Note this is only a band aid.

7 years agoMFC r310983:
mjg [Tue, 24 Jan 2017 19:40:35 +0000 (19:40 +0000)]
MFC r310983:

    vfs: switch nodes_created, recycles_count and free_owe_inact to counter(9)

7 years agoMFC r310805:
mjg [Tue, 24 Jan 2017 19:39:24 +0000 (19:39 +0000)]
MFC r310805:

    Remove cpu_spinwait after seq_consistent.

    It does not add any benefit as the read routine will do it as necessary.

7 years agoMFC r310907:
mjg [Tue, 24 Jan 2017 19:38:10 +0000 (19:38 +0000)]
MFC r310907:

    Use vrefact in vnode_pager_alloc.

7 years agoMFC r311886:
kib [Tue, 24 Jan 2017 11:13:41 +0000 (11:13 +0000)]
MFC r311886:
Fix acquisition of nested write compat rtld locks.

PR: 215826

7 years agoMFC r312341:
ae [Tue, 24 Jan 2017 00:38:35 +0000 (00:38 +0000)]
MFC r312341:
  Initialize IPFW static rules rmlock with RM_RECURSE flag.

  This lock was replaced from rwlock in r272840. But unlike rwlock, rmlock
  doesn't allow recursion on rm_rlock(), so at this time fix this with
  RM_RECURSE flag. Later we need to change ipfw to avoid such recursions.

  PR: 216171

7 years agoMFC r309888:
ae [Tue, 24 Jan 2017 00:36:46 +0000 (00:36 +0000)]
MFC r309888:
  Modify IPv6 statistic accounting in ip6_input().

  Add rcvif local variable to keep inbound interface pointer. Count
  ifs6_in_discard errors in all "goto bad" cases. Now it will count
  errors even if mbuf was freed. Modify all places where m->m_pkthdr.rcvif
  is used to use local rcvif variable.

7 years agoMFC r311911, r311923
gonzo [Mon, 23 Jan 2017 20:51:29 +0000 (20:51 +0000)]
MFC r311911, r311923

r311911:
[sdhci] Add ACPI platform support for SDHCI driver

- Create ACPI version of SDHCI attach/detach/accessors logic. Some
    platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices
    via ACPI, not PCI
- Add sdchi_acpi kernel module

Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D9112

r311923:
Add acpi_if.h and opt_acpi.h to Makefile to unbreak "make depend" with
sys/modules/sdhci_acpi

X-MFC with: r311911
Reported by: Jenkins

7 years agoMFC r312426: fix a thread preemption regression in schedulers introduced
avg [Mon, 23 Jan 2017 08:34:41 +0000 (08:34 +0000)]
MFC r312426: fix a thread preemption regression in schedulers introduced
in r270423

7 years agoMFC r312443:
pfg [Mon, 23 Jan 2017 01:20:58 +0000 (01:20 +0000)]
MFC r312443:
mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION.

There were several places where reference to compression were left
unfinished. Furthermore, KASSERTs contained references to MPPC_INVALID
which is not defined in the tree and therefore were sure to break with
INVARIANTS: comment them out.

Reported by: Eugene Grosbein
PR: 216265

7 years agoMFC r312230: skel: Do not set -o emacs in .shrc.
jilles [Sun, 22 Jan 2017 21:31:32 +0000 (21:31 +0000)]
MFC r312230: skel: Do not set -o emacs in .shrc.

sh has defaulted to 'set -o emacs' since FreeBSD 9.0. Therefore, do not set
this again in .shrc, since that only serves to prevent invocations like
'sh -o vi' and 'sh +o emacs' to have the intended effect.

PR: 215958
Submitted by: Andras Farkas

7 years agoMFC r310854, r310972
jmcneill [Sun, 22 Jan 2017 13:21:19 +0000 (13:21 +0000)]
MFC r310854, r310972

r310854:
Add missing reg property to usbphy node.

r310972:
Fix a typo in the third address of the reg property for the usbphy node.

7 years agoMFC r311953 (by cem)
bapt [Sun, 22 Jan 2017 11:13:53 +0000 (11:13 +0000)]
MFC r311953 (by cem)

pciconf(8): Reallow trailing colon in selectors

Reallow device selectors to have a trailing colon, as documented in the
manual page.  This was broken along with some unrelated cleanups in
r295806.

PR: 215979
Reported by: David Boyd <David.Boyd49 at twc.com>
Sponsored by: Dell EMC Isilon

7 years agoMFC r311651:
kib [Sat, 21 Jan 2017 11:47:30 +0000 (11:47 +0000)]
MFC r311651:
Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit.

7 years agoMFC r311892: Do not wait for HA thread shutdown if scheduler is stopped.
mav [Sat, 21 Jan 2017 08:43:11 +0000 (08:43 +0000)]
MFC r311892: Do not wait for HA thread shutdown if scheduler is stopped.

This wait loop made system hang on panic instead of reboot.