]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMFH
gjb [Wed, 20 Jan 2016 09:50:54 +0000 (09:50 +0000)]
MFH

Sponsored by: The FreeBSD Foundation

8 years agoMFV (r285035): fix props (no content changes)
des [Wed, 20 Jan 2016 09:14:37 +0000 (09:14 +0000)]
MFV (r285035): fix props (no content changes)

8 years agoDo not call callbacks for dl_iterate_phdr(3) with the rtld bind and
kib [Wed, 20 Jan 2016 07:21:33 +0000 (07:21 +0000)]
Do not call callbacks for dl_iterate_phdr(3) with the rtld bind and
phdr locks locked.  This allows to call rtld services from the
callback, which is only reasonable for dlopen(path, RTLD_NOLOAD) to
test existence of the library in the image, and for dlsym().  The
later might still be not quite safe, due to the lazy resolution of
filters.

To allow dropping the locks around iteration in dl_iterate_phdr(3), we
insert markers to track current position between relocks.  The global
objects list is converted to tailq and all iterators skip markers,
globallist_next() and globallist_curr() helpers are added.

Reported and tested by: davide
Reviewed by: kan
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agosfxge: refresh version to note matching version of out-of-tree driver
arybchik [Wed, 20 Jan 2016 06:56:18 +0000 (06:56 +0000)]
sfxge: refresh version to note matching version of out-of-tree driver

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: support __out_bcount_part[_opt] PREfast annotations
arybchik [Wed, 20 Jan 2016 06:50:30 +0000 (06:50 +0000)]
sfxge: cleanup: support __out_bcount_part[_opt] PREfast annotations

New annotation coming into use in the common code. Support its use by
adding null macro definitions for non-Windows platforms.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
X-MFC with:     r293901

8 years agomkdep: Fix -include not being added for .depend tracking.
bdrewery [Wed, 20 Jan 2016 01:40:18 +0000 (01:40 +0000)]
mkdep: Fix -include not being added for .depend tracking.

This fixes incremental build of OpenSSH after the recent upgrade.

For example, in secure/lib/libssh, -include ssh_namespace.h is used on
all files.  This is not tracked in the .depend file though due to
MKDEP_CFLAGS not including it.  The ssh example was broken in r291941
when not using FAST_DEPEND due to the .depend bug.  FAST_DEPEND was not
affected by this because it generates dependencies at compile time and
thus sees the -include.

This ugly make syntax could be simpler for bmake by using :tW but
fmake-compatible syntax is used since this needs to be MFC'd all the way
to stable/9.

Also add a temporary hack to workaround existing checkouts building
incrementally with a .depend file not having these headers.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate for API changes in OpenSSH 6.8p1.
jhb [Wed, 20 Jan 2016 00:26:50 +0000 (00:26 +0000)]
Update for API changes in OpenSSH 6.8p1.

First, the authfd API now uses a direct file descriptor for the control
socket instead of a more abstract AuthenticationConnection structure.
Second, the functions now consistently return an error value.

Reviewed by: bdrewery

8 years agoInitialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0.
jhb [Wed, 20 Jan 2016 00:14:34 +0000 (00:14 +0000)]
Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0.

If a driver's Linux mmap callback passed vm_page_prot through unchanged,
then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx
value 0 is to the mapping.  On x86, VM_MEMATTR_DEFAULT is the PAT value
for write-back (WB) which is 6, while 0 maps to the PAT value for
uncacheable (UC).  Thus, any mmap request that did not explicitly set
page_prot was tried to map memory as UC triggering the warning in
sg_pager_getpages().

Tested by: np
Reported by: Krishnamraju Eraparaju @ Chelsio
MFC after: 3 days
Sponsored by: Chelsio Communications

8 years agoList source files (foo.c) instead of object files in SRCS.
jhb [Wed, 20 Jan 2016 00:03:28 +0000 (00:03 +0000)]
List source files (foo.c) instead of object files in SRCS.

Reviewed by: bdrewery

8 years agoRevert a printf change from r294307.
jhibbits [Tue, 19 Jan 2016 23:35:12 +0000 (23:35 +0000)]
Revert a printf change from r294307.

Caused build failures with MPC85XX.

Pointy-hat to: jhibbits

8 years agoFix tty_drain() and, thus, TIOCDRAIN of the current tty(4) incarnation
marius [Tue, 19 Jan 2016 23:34:27 +0000 (23:34 +0000)]
Fix tty_drain() and, thus, TIOCDRAIN of the current tty(4) incarnation
to actually wait until the TX FIFOs of UARTs have be drained before
returning. This is done by bringing the equivalent of the TS_BUSY flag
found in the previous implementation back in an ABI-preserving way.
Reported and tested by: Patrick Powell

Most likely, drivers for USB-serial-adapters likewise incorporating
TX FIFOs as well as other terminal devices that buffer output in some
form should also provide implementations of tsw_busy.

MFC after: 3 days

8 years agoFAST_DEPEND: Fix improperly depending all .So objects on all headers.
bdrewery [Tue, 19 Jan 2016 23:28:18 +0000 (23:28 +0000)]
FAST_DEPEND: Fix improperly depending all .So objects on all headers.

This was a regression in r290629, which was revealed partly in r294360.
Once 'make depend' has ran it will generate all headers already.  Thus
even with FAST_DEPEND lacking proper dependencies before building, it
will not have any missing headers.  Once objects are compiled the depend
files will be generated with proper dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoRevert r294352.
bdrewery [Tue, 19 Jan 2016 23:25:25 +0000 (23:25 +0000)]
Revert r294352.

Further research showed it was the wrong fix and revealed a bigger
problem with the goal of skipping 'make depend'.

8 years agoQuell harmless CID about unchecked return value in nvlist_get_guids.
asomers [Tue, 19 Jan 2016 23:16:24 +0000 (23:16 +0000)]
Quell harmless CID about unchecked return value in nvlist_get_guids.

The return value doesn't need to be checked, because nvlist_get_guid's
callers check the returned values of the guids.

Coverity CID: 1341869
MFC after: 1 week
X-MFC-With: 292066
Sponsored by: Spectra Logic Corp

8 years agoAllow specifying an alternative LD_LIBRARY_PATH for the ldd(1) lookup.
bdrewery [Tue, 19 Jan 2016 22:42:16 +0000 (22:42 +0000)]
Allow specifying an alternative LD_LIBRARY_PATH for the ldd(1) lookup.

This is needed to be able to run check-links.sh against a "sysrooted"
binary while ensuring that the ldd(1) call done on the host uses the
host libc.  It is not possible to set LD_LIBRARY_PATH before calling
check-links.sh as then the "sysrooted" libc would be incorrectly used.

A LD_PRELOAD=libc.so is used to ldd(1) as it needs to use the host libc
to run.  ldd(1) is a simple wrapper around execve(2) and dlopen(2) with
env LD_TRACE_LOADED_OBJECTS set.  Due to the dlopen(2) restriction on
shared library tracing ldd(1) is still required for this lookup.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd some documentation.
bdrewery [Tue, 19 Jan 2016 22:42:13 +0000 (22:42 +0000)]
Add some documentation.

Sponsored by: EMC / Isilon Storage Division

8 years agoValidate that the file exists rather than obscure 'Not an elf file' error.
bdrewery [Tue, 19 Jan 2016 22:42:10 +0000 (22:42 +0000)]
Validate that the file exists rather than obscure 'Not an elf file' error.

Sponsored by: EMC / Isilon Storage Division

8 years agobsd.subdir.mk: Allow easier modification of [STANDALONE_]SUBDIR_TARGETS.
bdrewery [Tue, 19 Jan 2016 22:42:07 +0000 (22:42 +0000)]
bsd.subdir.mk: Allow easier modification of [STANDALONE_]SUBDIR_TARGETS.

This reworks r289254 and removes ALL_SUBDIR_TARGETS.

Because there is an include guard in this file there is no need for
LOCAL_ or ?= on SUBDIR_TARGETS or STANDALONE_SUBDIR_TARGETS.  These can
just be set via src.conf.  By the time bsd.subdir.mk is included it will
just append the values to the existing value and work fine.  This allows
a consistent way to append to these variables without introducing a
LOCAL_ var for STANDALONE_SUBDIR_TARGETS or renaming the historical
SUBDIR_TARGETS.

Sponsored by: EMC / Isilon Storage Division

8 years agoinstallconfig is PARALLEL_SUBDIR safe.
bdrewery [Tue, 19 Jan 2016 22:42:04 +0000 (22:42 +0000)]
installconfig is PARALLEL_SUBDIR safe.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Add header dependency missed in r290629.
bdrewery [Tue, 19 Jan 2016 22:42:01 +0000 (22:42 +0000)]
FAST_DEPEND: Add header dependency missed in r290629.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Still use if filemon is not used.
bdrewery [Tue, 19 Jan 2016 22:41:58 +0000 (22:41 +0000)]
FAST_DEPEND: Still use if filemon is not used.

If filemon is used then there is no need to generate dependency files during
compilation as the .meta files will achieve the same result.

This is a temporary solution until FAST_DEPEND is default.  Once that is
default there will be an option to disable dependency generation entirely
as it is only useful if an incremental build is planned, thus META_MODE+filemon
can enable that option to short-circuit all FAST_DEPEND-related logic.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Ensure bmake does not use filemon if it is not loaded.
bdrewery [Tue, 19 Jan 2016 22:41:55 +0000 (22:41 +0000)]
META_MODE: Ensure bmake does not use filemon if it is not loaded.

Sponsored by: EMC / Isilon Storage Division

8 years agoDefine .MAKE.MODE to normal to avoid the need for :U later.
bdrewery [Tue, 19 Jan 2016 22:41:44 +0000 (22:41 +0000)]
Define .MAKE.MODE to normal to avoid the need for :U later.

Sponsored by: EMC / Isilon Storage Division

8 years agosh: Simplify some code related to positional parameters.
jilles [Tue, 19 Jan 2016 22:41:26 +0000 (22:41 +0000)]
sh: Simplify some code related to positional parameters.

8 years agoFix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp.
asomers [Tue, 19 Jan 2016 22:07:39 +0000 (22:07 +0000)]
Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp.

The bad_truncate test sets the uimmutable flag to produce an error in
truncate, but that flag isn't supported by ZFS.  If /tmp is on a ZFS
filesystem, the test will fail.  Change it to use readonly permissions and
an unpriveleged user instead.

Reviewed by: jilles
MFC after: 1 week
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4862

8 years agoVarious cleanups to the main function for AIO kernel processes:
jhb [Tue, 19 Jan 2016 21:37:51 +0000 (21:37 +0000)]
Various cleanups to the main function for AIO kernel processes:

- Pull the vmspace logic out into helper functions and reduce duplication.
  Operations on the vmspace are all isolated to vm_map.c, but it now exports
  a new 'vmspace_switch_aio' for use by AIO kernel processes.
- When an AIO kernel process wants to exit, break out of the main loop and
  perform cleanup after the loop end.  This reduces a lot of indentation and
  allows cleanup to more closely mirror setup actions before the loop starts.
- Convert a DIAGNOSTIC to KASSERT().
- Replace mycp with more typical 'p'.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4990

8 years agoDon't create a dedicated session for each AIO kernel process.
jhb [Tue, 19 Jan 2016 20:46:30 +0000 (20:46 +0000)]
Don't create a dedicated session for each AIO kernel process.

This code dates back to the initial AIO support and the commit log does
not explain why it is needed.  However, I cannot find anything in the
AIO code or the various file methods (fo_read/fo_write) that would change
behavior due to using a private session instead of proc0's session.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4988

8 years agoUpgrade to OpenSSH 6.9p1.
des [Tue, 19 Jan 2016 18:55:44 +0000 (18:55 +0000)]
Upgrade to OpenSSH 6.9p1.

8 years agoRe-add HPN configuration options as deprecated options to avoid breaking
des [Tue, 19 Jan 2016 18:38:17 +0000 (18:38 +0000)]
Re-add HPN configuration options as deprecated options to avoid breaking
existing configurations that use them.  Note that there is no functional
difference between OpenSSH with HPN and OpenSSH without HPN.

8 years agobegone, foul autoprops!
des [Tue, 19 Jan 2016 18:32:51 +0000 (18:32 +0000)]
begone, foul autoprops!

8 years agoUpgrade to OpenSSH 6.8p1.
des [Tue, 19 Jan 2016 18:28:23 +0000 (18:28 +0000)]
Upgrade to OpenSSH 6.8p1.

8 years agoRemove local override for .cpp.o and .cpp.po rules
emaste [Tue, 19 Jan 2016 17:40:29 +0000 (17:40 +0000)]
Remove local override for .cpp.o and .cpp.po rules

The local build rule used to set -fvisibility=hidden and -fPIC, in
addition to -fexceptions and -D defines that had no effect.

With -fvisibility=hidden and -fPIC in STATIC_CXXFLAGS the standard
bsd.lib.mk rules are suitable for libgcc_s's C++ source.

PR: 206381
Sponsored by: The FreeBSD Foundation

8 years agoNow that we have local modifications in configure.ac and configure, run
des [Tue, 19 Jan 2016 17:20:07 +0000 (17:20 +0000)]
Now that we have local modifications in configure.ac and configure, run
autoheader and autoconf to avoid having to patch configure manually.

8 years agoDisallow zvol-backed ZFS pools
asomers [Tue, 19 Jan 2016 17:00:25 +0000 (17:00 +0000)]
Disallow zvol-backed ZFS pools

Using zvols as backing devices for ZFS pools is fraught with panics and
deadlocks. For example, attempting to online a missing device in the
presence of a zvol can cause a panic when vdev_geom tastes the zvol.  Better
to completely disable vdev_geom from ever opening a zvol. The solution
relies on setting a thread-local variable during vdev_geom_open, and
returning EOPNOTSUPP during zvol_open if that thread-local variable is set.

Remove the check for MUTEX_HELD(&zfsdev_state_lock) in zvol_open. Its intent
was to prevent a recursive mutex acquisition panic. However, the new check
for the thread-local variable also fixes that problem.

Also, fix a panic in vdev_geom_taste_orphan. For an unknown reason, this
function was set to panic. But it can occur that a device disappears during
tasting, and it causes no problems to ignore this departure.

Reviewed by: delphij
MFC after: 1 week
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4986

8 years agoUpgrade to OpenSSH 6.7p1, retaining libwrap support (which has been removed
des [Tue, 19 Jan 2016 16:18:26 +0000 (16:18 +0000)]
Upgrade to OpenSSH 6.7p1, retaining libwrap support (which has been removed
upstream) and a number of security fixes which we had already backported.

MFC after: 1 week

8 years agoAdd optimizing LRO wrapper:
hselasky [Tue, 19 Jan 2016 15:33:28 +0000 (15:33 +0000)]
Add optimizing LRO wrapper:

- Add optimizing LRO wrapper which pre-sorts all incoming packets
  according to the hash type and flowid. This prevents exhaustion of
  the LRO entries due to too many connections at the same time.
  Testing using a larger number of higher bandwidth TCP connections
  showed that the incoming ACK packet aggregation rate increased from
  ~1.3:1 to almost 3:1. Another test showed that for a number of TCP
  connections greater than 16 per hardware receive ring, where 8 TCP
  connections was the LRO active entry limit, there was a significant
  improvement in throughput due to being able to fully aggregate more
  than 8 TCP stream. For very few very high bandwidth TCP streams, the
  optimizing LRO wrapper will add CPU usage instead of reducing CPU
  usage. This is expected. Network drivers which want to use the
  optimizing LRO wrapper needs to call "tcp_lro_queue_mbuf()" instead
  of "tcp_lro_rx()" and "tcp_lro_flush_all()" instead of
  "tcp_lro_flush()". Further the LRO control structure must be
  initialized using "tcp_lro_init_args()" passing a non-zero number
  into the "lro_mbufs" argument.

- Make LRO statistics 64-bit. Previously 32-bit integers were used for
  statistics which can be prone to wrap-around. Fix this while at it
  and update all SYSCTL's which expose LRO statistics.

- Ensure all data is freed when destroying a LRO control structures,
  especially leftover LRO entries.

- Reduce number of memory allocations needed when setting up a LRO
  control structure by precomputing the total amount of memory needed.

- Add own memory allocation counter for LRO.

- Bump the FreeBSD version to force recompilation of all KLDs due to
  change of the LRO control structure size.

Sponsored by: Mellanox Technologies
Reviewed by: gallatin, sbruno, rrs, gnn, transport
Tested by: Netflix
Differential Revision: https://reviews.freebsd.org/D4914

8 years agoTest for /etc/ssl/cert.pem existence to avoid masking SSL_CA_CERT_PATH
bapt [Tue, 19 Jan 2016 15:02:37 +0000 (15:02 +0000)]
Test for /etc/ssl/cert.pem existence to avoid masking SSL_CA_CERT_PATH

Prior to this patch, unless SSL_CA_CERT_FILE is set in the environment,
libfetch will set the CA file to "/usr/local/etc/cert.pem" if it exists,
and to "/etc/ssl/cert.pem" otherwise. This has the consequence of
masking SSL_CA_CERT_PATH, because OpenSSL will ignore the CA path if a CA
file is set but fails to load (see X509_STORE_load_locations()).

While here, fall back to OpenSSL defaults if neither SSL_CA_CERT_FILE nor
SSL_CA_CERT_PATH are set in the environment, and if neither of the
libfetch default CA files exists.

PR: 193871
Submitted by: John W. O'Brien <john@saltant.com>
Approved by: des
MFC after: 1 week

8 years agoAs previously threatened, remove the HPN patch from OpenSSH.
des [Tue, 19 Jan 2016 14:38:20 +0000 (14:38 +0000)]
As previously threatened, remove the HPN patch from OpenSSH.

8 years agoUse 'svn list -R' instead of find, and recognize comments in shell scripts
des [Tue, 19 Jan 2016 14:25:22 +0000 (14:25 +0000)]
Use 'svn list -R' instead of find, and recognize comments in shell scripts
and {ssh,sshd}_config.

8 years agoRecognize *roff comments.
des [Tue, 19 Jan 2016 13:15:57 +0000 (13:15 +0000)]
Recognize *roff comments.

8 years agoAdd "vidcontrol -i active", to print out active vty number,
trasz [Tue, 19 Jan 2016 13:09:20 +0000 (13:09 +0000)]
Add "vidcontrol -i active", to print out active vty number,
to be used with eg "vidcontrol -s".

Reviewed by: emaste@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4968

8 years agoUpdate the pre- and post-merge scripts to work correctly after the recent
des [Tue, 19 Jan 2016 12:38:53 +0000 (12:38 +0000)]
Update the pre- and post-merge scripts to work correctly after the recent
cleanup.  A round-trip (./freebsd-pre-merge.sh ; ./freebsd-post-merge.sh)
now results in an unchanged working copy.

8 years agoFix an issue where the network adapter could be left in down state
hselasky [Tue, 19 Jan 2016 10:24:47 +0000 (10:24 +0000)]
Fix an issue where the network adapter could be left in down state
after changing the HW LRO sysctl when previously in up state.

Reviewed by: gnn
Sponsored by: Mellanox Technologies
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D4941

8 years agoAdd clarifying comment about CQE zipping.
hselasky [Tue, 19 Jan 2016 10:19:33 +0000 (10:19 +0000)]
Add clarifying comment about CQE zipping.

Reviewed by: gnn
Sponsored by: Mellanox Technologies
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D4940

8 years agoDeclare local variables at top of function.
hselasky [Tue, 19 Jan 2016 10:17:24 +0000 (10:17 +0000)]
Declare local variables at top of function.

Reviewed by: gnn
Sponsored by: Mellanox Technologies
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D4939

8 years agoAllow RX and TX pause frames to be set through ifconfig.
hselasky [Tue, 19 Jan 2016 10:10:02 +0000 (10:10 +0000)]
Allow RX and TX pause frames to be set through ifconfig.

Reviewed by: gnn
Sponsored by: Mellanox Technologies
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D4817

8 years agoAdjust i386 comment to match amd64 one after r294311.
kib [Tue, 19 Jan 2016 08:09:09 +0000 (08:09 +0000)]
Adjust i386 comment to match amd64 one after r294311.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoUse ANSI definitions. Wrap long line.
kib [Tue, 19 Jan 2016 08:08:08 +0000 (08:08 +0000)]
Use ANSI definitions.  Wrap long line.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoClear whole XMM register file instead of only XMM0. Also clear x87
kib [Tue, 19 Jan 2016 08:04:02 +0000 (08:04 +0000)]
Clear whole XMM register file instead of only XMM0.  Also clear x87
registers.  This brings amd64 on par with i386, providing consistent
initial FPU state.

Note that we do not clear any extended state, at least because kernel
does not understand extended state structure and consequences of zero
overwrite after fninit()/fpusave().

Submitted by: joss.upton@yahoo.com
PR: 206370
MFC after: 2 weeks

8 years agosfxge: improve error handling in ef10_ev_rx()
arybchik [Tue, 19 Jan 2016 06:07:39 +0000 (06:07 +0000)]
sfxge: improve error handling in ef10_ev_rx()

Ensure that checksum flags and L3/L4 fields are ignored
if lower level errors are reported in the event.

Remove checks for CRC0_ERR (bad iSCSI header CRC) and
CRC1_ERR (bad iSCSI payload or FCoE/FCoIP CRC) as they
are not used by any existing code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4975

8 years agosfxge: select whether to read current or backup partition in Medford A/B scheme
arybchik [Tue, 19 Jan 2016 06:03:44 +0000 (06:03 +0000)]
sfxge: select whether to read current or backup partition in Medford A/B scheme

The dynamic config on Medford is stored using two partitions in flash, and at
any time one is the 'current' partition, used to provide the active config,
and the other 'backup' partition is used for writes.  This means that there
are two potential partitions that can be used to service reads, and which is
required can depend on, for example, whether the read is to get the current
contents or to verify a write.

When the partition write lock is held, the default behaviour is to read from
the backup partition, which was wrong for most reads in the common code which
require the current partition. This change allows the current partition to be
read whilst the write lock is held.
There is one read in Manftest which needs the backup partition.

ef10_nvram_partn_read_mode() is created to avoid changing
ef10_nvram_partn_read() which shares a prototype with the equivalent Falcon
and Siena methods.

MC_CMD_NVRAM_READ_IN_V2 adds an extra field, but firmware which doesn't support
it just ignores it.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4974

8 years agoRemove local override for .cpp.So rule
emaste [Tue, 19 Jan 2016 03:54:38 +0000 (03:54 +0000)]
Remove local override for .cpp.So rule

The standard bsd.lib.mk rule is suitable for libgcc_s's C++ source.

The local rule had the following non-functional argument differences
or additions:

1. -DSHARED (rather than -DPIC from bsd.lib.mk)

   The C++ sources don't have an #ifdef for either one.

2. -fexceptions

   This is enabled by default for C++ so does not need to be set
   explicitly.

3. -D__GLIBC__=3

   Not used by LLVM libunwind.

4. -DElfW=__ElfN

   LLVM libunwind provides its own definition.

PR: 206381
Differential Revision: The FreeBSD Foundation

8 years agoHide most of the PTE initialization and management.
jhibbits [Tue, 19 Jan 2016 03:07:25 +0000 (03:07 +0000)]
Hide most of the PTE initialization and management.

By confining the page table management to a handful of functions it'll be
easier to modify the page table scheme without affecting other functions.
This will be necessary when 64-bit support is added, and page tables become
much larger.

8 years agoAdd vrefl(), a locked variant of vref(9).
markj [Mon, 18 Jan 2016 22:21:46 +0000 (22:21 +0000)]
Add vrefl(), a locked variant of vref(9).

This API has no in-tree consumers at the moment but is useful to at least
one out-of-tree consumer, and naturally complements existing vnode refcount
functions (vholdl(9), vdropl(9)).

Obtained from: kib (sys/ portion)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4947
Differential Revision: https://reviews.freebsd.org/D4953

8 years agoImport misc.c,v 1.46 from OpenBSD (by espie@)
bapt [Mon, 18 Jan 2016 22:12:07 +0000 (22:12 +0000)]
Import misc.c,v 1.46 from OpenBSD (by espie@)

Yet another missed ferror call

8 years agoUpdate elftc version to 3272M, imported in r292120
emaste [Mon, 18 Jan 2016 21:53:39 +0000 (21:53 +0000)]
Update elftc version to 3272M, imported in r292120

8 years agoRestore ABI variants now that ldconfig groks -soft. In addition, as a
imp [Mon, 18 Jan 2016 21:40:20 +0000 (21:40 +0000)]
Restore ABI variants now that ldconfig groks -soft. In addition, as a
transition mechanism, if we don't have /usr/libsoft, assume that soft
float ABI binaries are the default, so treat them as default binaries.
When we've fully transitioned, it will make no sense to do this stat,
and it will be removed.

8 years agoAdd ldconfig -soft to process the soft float abi libraries and put it
imp [Mon, 18 Jan 2016 21:40:18 +0000 (21:40 +0000)]
Add ldconfig -soft to process the soft float abi libraries and put it
into startup scripts for armv6. It acts much like ldconfig -32 does.

8 years agoFix printing multibyte printing when performing a networked finger(1) request
bapt [Mon, 18 Jan 2016 20:47:04 +0000 (20:47 +0000)]
Fix printing multibyte printing when performing a networked finger(1) request

MFC after: 1 week

8 years agoReset the filesystem cache before reading from a potentially new
andrew [Mon, 18 Jan 2016 20:22:51 +0000 (20:22 +0000)]
Reset the filesystem cache before reading from a potentially new
filesystem. Without this we only read from the first UFS filesystem we
find, caching the result.

X-MFC with: The recent boot1.efi changes

8 years agomdoc: sort Xr
joel [Mon, 18 Jan 2016 20:21:38 +0000 (20:21 +0000)]
mdoc: sort Xr

8 years agoboot1: correct typo in error message
emaste [Mon, 18 Jan 2016 18:41:09 +0000 (18:41 +0000)]
boot1: correct typo in error message

8 years agoCorrect RISC-V exception types.
br [Mon, 18 Jan 2016 17:49:32 +0000 (17:49 +0000)]
Correct RISC-V exception types.

8 years agoMove RTAS PCI-specific interpretation of the "reg" property of the PCI host
nwhitehorn [Mon, 18 Jan 2016 17:27:16 +0000 (17:27 +0000)]
Move RTAS PCI-specific interpretation of the "reg" property of the PCI host
device to the RTAS driver, where it belongs.

8 years agoUse OF_decode_addr() to create a bus_space tag and handle for the console
ian [Mon, 18 Jan 2016 17:03:12 +0000 (17:03 +0000)]
Use OF_decode_addr() to create a bus_space tag and handle for the console
on FDT/OFW platforms.

After the refactoring of the powerpc code so that OF_decode_addr() is usable
on all FDT/OFW platforms, this switches uart(4) to using it.

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

8 years agoAdd RISC-V relocation types.
br [Mon, 18 Jan 2016 16:54:26 +0000 (16:54 +0000)]
Add RISC-V relocation types.

Reviewed by: emaste

8 years agoEnable AIO interface on ARM64 platforms
zbb [Mon, 18 Jan 2016 14:11:34 +0000 (14:11 +0000)]
Enable AIO interface on ARM64 platforms

Add VFS_AIO to generic config to allow using of high-performance
asynchronous disk AIO operation.

Reviewed by:   imp
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D4979

8 years agoUpdate ThunderX PCIe driver to fit new DTS layout
zbb [Mon, 18 Jan 2016 13:31:29 +0000 (13:31 +0000)]
Update ThunderX PCIe driver to fit new DTS layout

In recent EFI the DTS entries changed for PCIe controller.
This commit fixes internal PCIe, external is yet TBD.

Submitted by:  Dominik Ermel <der@semihalf.com>
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D4976

8 years agoFix EFI_DEBUG option
smh [Mon, 18 Jan 2016 12:02:05 +0000 (12:02 +0000)]
Fix EFI_DEBUG option

Fix broken DPRINTF and wire up EFI_DEBUG so -DEFI_DEBUG to make works.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix compilation on MIPS (typo introduced in r294227).
br [Mon, 18 Jan 2016 09:36:10 +0000 (09:36 +0000)]
Fix compilation on MIPS (typo introduced in r294227).

8 years agoMFV r294260:
delphij [Mon, 18 Jan 2016 08:52:09 +0000 (08:52 +0000)]
MFV r294260:

Fix a wrong assertion in mandoc by applying OpenBSD
main.c,v 1.170 (florian):

Unbreak reading from stdin after recent parse() restructuring.
OK schwarze@

8 years agosfxge: regenerate EF10 registers definition for Medford
arybchik [Mon, 18 Jan 2016 06:59:00 +0000 (06:59 +0000)]
sfxge: regenerate EF10 registers definition for Medford

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: fix unused function warning
arybchik [Mon, 18 Jan 2016 06:54:15 +0000 (06:54 +0000)]
sfxge: fix unused function warning

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: regenerate siena_flash.h from FW sources
arybchik [Mon, 18 Jan 2016 06:45:45 +0000 (06:45 +0000)]
sfxge: regenerate siena_flash.h from FW sources

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: remove extra empty lines
arybchik [Mon, 18 Jan 2016 06:39:06 +0000 (06:39 +0000)]
sfxge: cleanup: remove extra empty lines

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: highlight that descriptor cache sizes are configured using TLV now
arybchik [Mon, 18 Jan 2016 06:38:21 +0000 (06:38 +0000)]
sfxge: highlight that descriptor cache sizes are configured using TLV now

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: support RFID-selectable segments of dynamic configuration
arybchik [Mon, 18 Jan 2016 06:33:15 +0000 (06:33 +0000)]
sfxge: support RFID-selectable segments of dynamic configuration

tlv_partition_header has field *preset* to support RFID-selectable
segments of dynamic configuration

Submitted by:   Mateusz Wrzesinski <mwrzesinski at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: if supported by firmware, use enhanced SET_MAC command to only configure the MTU
arybchik [Mon, 18 Jan 2016 06:19:28 +0000 (06:19 +0000)]
sfxge: if supported by firmware, use enhanced SET_MAC command to only configure the MTU

This allows an MTU change to be requested on unpriviliged functions
without also setting all the other parameters supported by MC_CMD_SET_MAC.

The enhanced SET_MAC command was introduced in v4_7 firmware.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4958

8 years agosfxge: convert nvram set_version method to use partition id
arybchik [Mon, 18 Jan 2016 06:18:01 +0000 (06:18 +0000)]
sfxge: convert nvram set_version method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: convert nvram get_version method to use partition id
arybchik [Mon, 18 Jan 2016 06:16:51 +0000 (06:16 +0000)]
sfxge: convert nvram get_version method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: convert nvram rw_finish method to use partition id
arybchik [Mon, 18 Jan 2016 06:14:43 +0000 (06:14 +0000)]
sfxge: convert nvram rw_finish method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: convert nvram write method to use partition id
arybchik [Mon, 18 Jan 2016 06:13:09 +0000 (06:13 +0000)]
sfxge: convert nvram write method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4961

8 years ago[iwm] fix up the rate control setup code to initialise rates in the order
adrian [Mon, 18 Jan 2016 05:43:34 +0000 (05:43 +0000)]
[iwm] fix up the rate control setup code to initialise rates in the order
we want to use it.

The rate table was being initialised in low->high, but the link quality
table was being initialised high->low. So, when we did a lookup, we
would get the indexes wrong.

This started by a patch from dragonflybsd which reversed how the ni->in_ridx[]
array is being used; I'd rather it all be consistent.  So, this is consistent.

Inspired by: what I did to iwn(4) a while ago
Inspired by: DragonflyBSD; <imre@vdsz.com>

8 years agoAdd extra checks to make sure the size is valid. We may get an integer
andrew [Mon, 18 Jan 2016 00:07:04 +0000 (00:07 +0000)]
Add extra checks to make sure the size is valid. We may get an integer
underflow when we have small blocks of memory at the start and end of the
32-bit address range.

While here, only insert mappings pointing at a non-zero amount of memory.

Sponsored by: ABT Systems Ltd

8 years agoQuick exit after setting the clock control register.
jhibbits [Sun, 17 Jan 2016 23:03:21 +0000 (23:03 +0000)]
Quick exit after setting the clock control register.

Discussed with: ian

8 years agoMake PPS ASSERT/CLEAR events match the RS-232 signal levels as per RFC 2783.
ian [Sun, 17 Jan 2016 21:19:45 +0000 (21:19 +0000)]
Make PPS ASSERT/CLEAR events match the RS-232 signal levels as per RFC 2783.
Previously the polarity was for TTL levels, which are the reverse of RS-232.

Also add handling of the UART_PPS_INVERT_PULSE option bit in the sysctl
value, the same as was recently added to uart(4), so that people using TTL
level connections can request a logical inverting of the signal.

Use the named constants from the new dev/uart/uart_ppstypes.h for the pps
capture modes and option bits.

8 years agoutimensat(2): Correct description of [EINVAL] error.
jilles [Sun, 17 Jan 2016 21:14:27 +0000 (21:14 +0000)]
utimensat(2): Correct description of [EINVAL] error.

MFC after: 4 days

8 years agoPrevent double free of control in common sendmsg path as sosend
dchagin [Sun, 17 Jan 2016 19:28:13 +0000 (19:28 +0000)]
Prevent double free of control in common sendmsg path as sosend
already freeing it.

8 years agoBring in initial libc and libstand support for RISC-V.
br [Sun, 17 Jan 2016 15:21:23 +0000 (15:21 +0000)]
Bring in initial libc and libstand support for RISC-V.

Reviewed by: andrew, emaste, kib
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4943

8 years agoWhen cleaning up from failed adv locking and checking for write, do
kib [Sun, 17 Jan 2016 08:40:51 +0000 (08:40 +0000)]
When cleaning up from failed adv locking and checking for write, do
not call VOP_CLOSE() manually.  Instead, delegate the close to
fo_close() performed as part of the fdrop() on the file failed to
open.  For this, finish constructing file on error, in particular, set
f_vnode and f_ops.

Forcibly resetting f_ops to badfileops disabled additional cleanups
performed by fo_close() for some file types, in this case it was noted
that cdevpriv data was corrupted.  Since fo_close() call must be
enabled for some file types, it makes more sense to enable it for all
files opened through vn_open_cred().

In collaboration with: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoAssert that the linkage between struct cdev_privdata and and struct
kib [Sun, 17 Jan 2016 08:34:35 +0000 (08:34 +0000)]
Assert that the linkage between struct cdev_privdata and and struct
file is consistent.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agosfxge: convert nvram erase method to use partition id
arybchik [Sun, 17 Jan 2016 05:12:37 +0000 (05:12 +0000)]
sfxge: convert nvram erase method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4957

8 years ago[PR 206224] bv_cnt is sometimes examined without holding the bufobj lock
rpokala [Sun, 17 Jan 2016 01:04:20 +0000 (01:04 +0000)]
[PR 206224] bv_cnt is sometimes examined without holding the bufobj lock

Add locking around access to bv_cnt which is currently being done unlocked

PR: 206224
Reviewed by: imp
Approved by: jhb
MFC after: 1 week
Sponsored by: Panasas, Inc.
Differential Revision: https://reviews.freebsd.org/D4931

8 years agoRemove leading slashes added to ObsoleteFiles.inc in r294113.
dim [Sun, 17 Jan 2016 00:52:28 +0000 (00:52 +0000)]
Remove leading slashes added to ObsoleteFiles.inc in r294113.

8 years agourtwn: add ROM structure for RTL8188EU
avos [Sun, 17 Jan 2016 00:52:21 +0000 (00:52 +0000)]
urtwn: add ROM structure for RTL8188EU

- Add the structure with already known fields offsets
  (some of them were taken from this driver,
  some (channel_plan, rf_* fields) - from TP-LINK official driver)
- Fix a typo / dehardcode a constant in RTL8192C ROM structure.

Tested with RTL8188EU, STA mode

Reviewed by: kevlo
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4274

8 years agoe5500 HWPMC is identical to e500mc, so add support check for it.
jhibbits [Sun, 17 Jan 2016 00:14:22 +0000 (00:14 +0000)]
e5500 HWPMC is identical to e500mc, so add support check for it.

8 years agoDon't bother checking an ip[46].addr netmask/prefixlen. This is already
jamie [Sat, 16 Jan 2016 22:32:57 +0000 (22:32 +0000)]
Don't bother checking an ip[46].addr netmask/prefixlen.  This is already
handled by ifconfig, and it was doing it wrong when the paramater included
extra ifconfig options.

PR: 205926
MFC after: 5 days

8 years agoPartially revert r294055.
jhibbits [Sat, 16 Jan 2016 21:24:12 +0000 (21:24 +0000)]
Partially revert r294055.

This part was a botched revert of a test change.

Spotted by: alc

8 years agoNever 4k align the MBR bootpool because zfsldr can not deal with a gap
allanjude [Sat, 16 Jan 2016 19:25:16 +0000 (19:25 +0000)]
Never 4k align the MBR bootpool because zfsldr can not deal with a gap

If the bootpool does not start at the first sector of the BSD partition
then zfsldr seeks to the wrong offset inside the ZFS vdev label, and is
unable to find zfsboot, so the system does not boot

If 4k alignment is requested, align the BSD partition in the MBR table,
and align the swap and data pool, but the bootpool must start at sector 1

While here, if 4k alignment is requested, disable MBR CHS alignment, as
this results in not-4k aligned partitions.

Reported by: Alex Wilkinson
MFC after: 5 days
Sponsored by: ScaleEngine Inc.

8 years agoClear errno before calling getpw*.
jamie [Sat, 16 Jan 2016 18:13:28 +0000 (18:13 +0000)]
Clear errno before calling getpw*.