]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agogeom_virstor: Remove wholly unnecessary g_metadata_store copy
Conrad Meyer [Fri, 8 Sep 2017 15:38:02 +0000 (15:38 +0000)]
geom_virstor: Remove wholly unnecessary g_metadata_store copy

Just code cleanup.  No functional change.

Sponsored by: Dell EMC Isilon

6 years agoAudit userspace geom code for leaking memory to disk
Conrad Meyer [Fri, 8 Sep 2017 15:08:17 +0000 (15:08 +0000)]
Audit userspace geom code for leaking memory to disk

Any geom class using g_metadata_store, as well as geom_virstor which
duplicated g_metadata_store internally, would dump sectorsize - mdsize bytes
of userspace memory following the metadata block stored. This is most or all
geom classes (gcache, gconcat, geli, gjournal, glabel, gmirror, gmultipath,
graid3, gshsec, gstripe, and geom_virstor).

PR: 222077 (comment #3)
Reported by: Maxim Khitrov <max AT mxcrypt.com>
Reviewed by: des
Security: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12269

6 years agoFix malloc() uses in em_get_regs().
Konstantin Belousov [Fri, 8 Sep 2017 14:54:07 +0000 (14:54 +0000)]
Fix malloc() uses in em_get_regs().

Do not use malloc(M_NOWAIT), wait is possible there, and the malloc
failures where not checked.  Do not forget to free malloced memory.

Reported and tested by: pho
Approved by: sbruno
Sponsored by: The FreeBSD Foundation

6 years agoConsistently use tabs for indent.
Konstantin Belousov [Fri, 8 Sep 2017 10:39:28 +0000 (10:39 +0000)]
Consistently use tabs for indent.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoNot all CPUs handle reading ID_AA64MMFR2_EL1 (e.g. qemu), disable it for now.
Andrew Turner [Fri, 8 Sep 2017 08:02:06 +0000 (08:02 +0000)]
Not all CPUs handle reading ID_AA64MMFR2_EL1 (e.g. qemu), disable it for now.

Sponsored by: DARPA, AFRL

6 years agonamecache: fold the unlock label into the only consumer
Mateusz Guzik [Fri, 8 Sep 2017 06:57:11 +0000 (06:57 +0000)]
namecache: fold the unlock label into the only consumer

No functional changes.

MFC after: 1 week

6 years agonamecache: factor out dot lookup into a dedicated function
Mateusz Guzik [Fri, 8 Sep 2017 06:51:33 +0000 (06:51 +0000)]
namecache: factor out dot lookup into a dedicated function

The intent is to move uncommon cases out of the way.

MFC after: 1 week

6 years agoAnnotate Giant with __exclusive_cache_line
Mateusz Guzik [Fri, 8 Sep 2017 06:46:24 +0000 (06:46 +0000)]
Annotate Giant with __exclusive_cache_line

6 years agoAnnotate global process locks with __exclusive_cache_line
Mateusz Guzik [Fri, 8 Sep 2017 06:46:02 +0000 (06:46 +0000)]
Annotate global process locks with __exclusive_cache_line

MFC after: 1 week

6 years agomca: Fix printf types from r323289 on i386
Conrad Meyer [Fri, 8 Sep 2017 01:06:35 +0000 (01:06 +0000)]
mca: Fix printf types from r323289 on i386

Reported by: Michael Butler <imb AT protected-networks.net>
Sponsored by: Dell EMC Isilon

6 years agoSpeed up vm_page_array initialization.
Mark Johnston [Thu, 7 Sep 2017 21:43:39 +0000 (21:43 +0000)]
Speed up vm_page_array initialization.

We currently initialize the vm_page array in three passes: one to zero
the array, one to initialize the "order" field of each page (necessary
when inserting them into the vm_phys buddy allocator one-by-one), and
one to initialize the remaining non-zero fields and individually insert
each page into the allocator.

Merge the three passes into one following a suggestion from alc:
initialize vm_page fields in a single pass, and use vm_phys_free_contig()
to efficiently insert physical memory segments into the buddy allocator.
This reduces the initialization time to a third or a quarter of what it
was before on most systems that I tested.

Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D12248

6 years agox86 MCA: Helpfully, print why ECC thresholding is not enabled on AMD
Conrad Meyer [Thu, 7 Sep 2017 21:33:27 +0000 (21:33 +0000)]
x86 MCA: Helpfully, print why ECC thresholding is not enabled on AMD

Sponsored by: Dell EMC Isilon

6 years agox86 MCA: Enable AMD thresholding support on 17h
Conrad Meyer [Thu, 7 Sep 2017 21:31:07 +0000 (21:31 +0000)]
x86 MCA: Enable AMD thresholding support on 17h

17h supports MCA thresholding in the same way as 16h and earlier.
Supposedly a ScalableMca feature bit in CPUID 8000_0007:EBX must be set, but
that was not true for earlier models, so be careful about relying on it.

While here, document a missing bit in LS MCA MISC0.

Reviewed by: truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12237

6 years agoStore AMD RAS Capabilities cpuid value and name flags
Conrad Meyer [Thu, 7 Sep 2017 21:29:51 +0000 (21:29 +0000)]
Store AMD RAS Capabilities cpuid value and name flags

Reviewed by: truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12237

6 years agocpufreq(4) hwpstate: Yield CPU awaiting frequency change
Conrad Meyer [Thu, 7 Sep 2017 20:20:12 +0000 (20:20 +0000)]
cpufreq(4) hwpstate: Yield CPU awaiting frequency change

It doesn't seem necessary to busy the CPU while waiting to transition
into a different p-state.

PR: 221621 (related, but does not completely address)
Reviewed by: truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12260

6 years agoFix the SVE ID field shift.
Andrew Turner [Thu, 7 Sep 2017 19:52:04 +0000 (19:52 +0000)]
Fix the SVE ID field shift.

Sponsored by: DARPA, AFRL

6 years agoAdd the ATS1E1 case to the ID_AA64MMFR1_EL1 decoding.
Andrew Turner [Thu, 7 Sep 2017 19:51:17 +0000 (19:51 +0000)]
Add the ATS1E1 case to the ID_AA64MMFR1_EL1 decoding.

Sponsored by: DARPA, AFRL

6 years agoFix indentation.
Mark Johnston [Thu, 7 Sep 2017 19:15:31 +0000 (19:15 +0000)]
Fix indentation.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoUse the correct mask when printing undecoded fields from the
Andrew Turner [Thu, 7 Sep 2017 18:58:55 +0000 (18:58 +0000)]
Use the correct mask when printing undecoded fields from the
ID_AA64MMFR2_EL1 register.

Sponsored by: DARPA, AFRL

6 years agoFix an incorrectly used conditional causing a stack buffer overflow.
Gordon Tetlow [Thu, 7 Sep 2017 18:54:54 +0000 (18:54 +0000)]
Fix an incorrectly used conditional causing a stack buffer overflow.

Reported by: Thomas Jarosch of Intra2net AG
Reviewed by: emaste, jhb
Security: CVE-2017-1000249

6 years agoDocument some invariants for the XLC_ enum.
David Chisnall [Thu, 7 Sep 2017 17:51:35 +0000 (17:51 +0000)]
Document some invariants for the XLC_ enum.

These can't be reordered without breaking other code.  Document that and add
some static asserts to ensure that anyone who tries gets build failures.

6 years agocrunchgen: quiet -Wmissing-prototypes
Ryan Libby [Thu, 7 Sep 2017 17:20:47 +0000 (17:20 +0000)]
crunchgen: quiet -Wmissing-prototypes

Reviewed by: emaste (previous version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12107

6 years agoAdd basic tests for chflags, mkdir, rcp, and rmdir
Alan Somers [Thu, 7 Sep 2017 16:54:47 +0000 (16:54 +0000)]
Add basic tests for chflags, mkdir, rcp, and rmdir

Add basic command line parsing test coverage for these utilities.  The tests
were automatically generated based on their man pages.  These tests can be
expanded by hand for more thorough coverage.  The aim is to generate very
basic amount of test coverage for all the utilities in the base system.

Submitted by: shivansh
Reviewed by: asomers, brooks
MFC after: 3 weeks
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D12036

6 years agoFix a mismerge, make sure PRINT_ID_AA64_MMFR2 has a unique value.
Andrew Turner [Thu, 7 Sep 2017 16:43:12 +0000 (16:43 +0000)]
Fix a mismerge, make sure PRINT_ID_AA64_MMFR2 has a unique value.

Sponsored by: DARPA, AFRL

6 years agoFix the value of ID_AA64ISAR1_DPB_SHIFT, the field is bits 3:0.
Andrew Turner [Thu, 7 Sep 2017 16:12:56 +0000 (16:12 +0000)]
Fix the value of ID_AA64ISAR1_DPB_SHIFT, the field is bits 3:0.

Sponsored by: DARPA, AFRL

6 years agoBe consistent and do return (1);
Warner Losh [Thu, 7 Sep 2017 15:46:44 +0000 (15:46 +0000)]
Be consistent and do return (1);

Noticed by: tsoome@
Sponsored by: Netflix

6 years agoAdd the ARMv8.2 ID register additions and use them to decode the register
Andrew Turner [Thu, 7 Sep 2017 15:45:56 +0000 (15:45 +0000)]
Add the ARMv8.2 ID register additions and use them to decode the register
values. As not all assemblers understand the new ID_AA64MMFR2_EL1 register
add a macro to access it. This seems to be safe for older CPUs to read this
new register, with them returning zero.

Sponsored by: DARPA, AFRL

6 years agoUppercase the special register names in identcpu to be more consistent with
Andrew Turner [Thu, 7 Sep 2017 15:30:13 +0000 (15:30 +0000)]
Uppercase the special register names in identcpu to be more consistent with
the other source files.

Sponsored by: DARPA, AFRL

6 years agoMake the bit mask of ARMv8 ID registers to print sparse to keep values
Andrew Turner [Thu, 7 Sep 2017 15:24:47 +0000 (15:24 +0000)]
Make the bit mask of ARMv8 ID registers to print sparse to keep values
close, but without having to change all values when new registers are added.

Sponsored by: DARPA, AFRL

6 years agoAdd more ARM Ltd parts to the list of knows CPUs.
Andrew Turner [Thu, 7 Sep 2017 15:02:57 +0000 (15:02 +0000)]
Add more ARM Ltd parts to the list of knows CPUs.

Submitted by: Jon Brawn <jon@brawn.org>

6 years agoHint that the "-o emul" option for ps(1) shows the ABI.
Edward Tomasz Napierala [Thu, 7 Sep 2017 10:56:50 +0000 (10:56 +0000)]
Hint that the "-o emul" option for ps(1) shows the ABI.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoFix armv6 build
Warner Losh [Thu, 7 Sep 2017 07:30:24 +0000 (07:30 +0000)]
Fix armv6 build

We need to extend the -Wno-format hack to yet another Makefile to cope
with %S meaning (CHAR16 *) not (wchar_t *) in the context of the EFI
boot loaders.

Sponsored by: Netflix

6 years agoCreate efi utility printing routines
Warner Losh [Thu, 7 Sep 2017 07:30:19 +0000 (07:30 +0000)]
Create efi utility printing routines

Split out asciidump, utf8dump, bindump, and hexdump into a separate
file efiutil.c. Implement new efi_print_load_option for printing out
the EFI_LOADER_OPTION data structure used to specify different options
to the UEFI boot manager.

Sponsored by: Netflix

6 years agoImplement efidp_size
Warner Losh [Thu, 7 Sep 2017 07:30:14 +0000 (07:30 +0000)]
Implement efidp_size

efidp_size will return the size, in bytes, of a EFI device path
structure. This is a convenience wrapper in the same style as the
other linux routines. It's implemented by GetDevicePathSize from EDK2
we already needed for other things.

Sponsored by: Netflix

6 years agoucs2len
Warner Losh [Thu, 7 Sep 2017 07:30:05 +0000 (07:30 +0000)]
ucs2len

Rename boot1's wcslen to ucs2len, which we can't use in userland
because wchar in userland is unsigned, not short. Move it into
efichar.c. Also spell '* 2' as '* sizeof(efi_char)' and add 1 for the
trailing NUL to transition the FreeBSD boot env vars to being NUL
terminated on the same line...

Sponsored by: Netflix

6 years agocam(4): Fix some warnings
Conrad Meyer [Thu, 7 Sep 2017 07:24:22 +0000 (07:24 +0000)]
cam(4): Fix some warnings

When bcopy is treated as memcpy/memmove, Clang produces warnings that the
size argument doesn't match the type of the source.  This is true, it
doesn't match; we're aliasing the source.

Explicitly cast the source pointer to the expected type to remove the
warning.

No functional change.

Sponsored by: Dell EMC Isilon

6 years agoIn the recvmsg32() system call iterate over returned structure(s)
Maxim Sobolev [Thu, 7 Sep 2017 04:29:57 +0000 (04:29 +0000)]
In the recvmsg32() system call iterate over returned structure(s)
and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP,
SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit
representation. Otherwise we either run out of user-supplied
buffer to copy those out resulting in the MSG_CTRUNC or simply
return values that the userland 32-bit code is not going
to parse correctly. This fixes at least two regression tests
failing to function properly in 32-bit compat mode:

    tools/regression/sockets/udp_pingpong
    tools/regression/sockets/unix_cmsg

PR:             kern/222039
MFC after: 30 days

6 years agoAdd D definitions for the named values in socket.h
George V. Neville-Neil [Thu, 7 Sep 2017 03:05:16 +0000 (03:05 +0000)]
Add D definitions for the named values in socket.h

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12241

6 years agoAdd a new getty/gettytab capability to generate an initial message dynamically.
David Bright [Thu, 7 Sep 2017 00:20:17 +0000 (00:20 +0000)]
Add a new getty/gettytab capability to generate an initial message dynamically.

This modification adds a new gettytab(5) option (iM) to specify a
program to run that will generate the initial (banner) message that is
displayed before the login prompt. Such a capability is useful when
dynamic information is needed in the banner message that cannot be
supplied by the set of % substitution sequences available in the "im"
option.

Reviewed by: vangyzen, wblock, manpages
Approved by: vangyzen (mentor)
MFC after: 1 week
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D12108

6 years agobhnd: Remove unsupported USB core IDs from the bhnd_usb device table.
Landon J. Fuller [Wed, 6 Sep 2017 23:43:20 +0000 (23:43 +0000)]
bhnd: Remove unsupported USB core IDs from the bhnd_usb device table.

This resolves a SoC reset triggered by attempting to attach to the
BCM5365's USB 1.1 controller.

Approved by: adrian (mentor, implicit)

6 years agovxge: plug void casts from memcpy/memzero calls
Mateusz Guzik [Wed, 6 Sep 2017 21:38:07 +0000 (21:38 +0000)]
vxge: plug void casts from memcpy/memzero calls

Most of places using them did not have the cast in the first place.

No functional changes.

MFC after: 1 week

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
Dimitry Andric [Wed, 6 Sep 2017 21:21:13 +0000 (21:21 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
5.0.0 release (upstream r312559).

Release notes for llvm, clang and lld will be available here soon:
<http://releases.llvm.org/5.0.0/docs/ReleaseNotes.html>
<http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html>
<http://releases.llvm.org/5.0.0/tools/lld/docs/ReleaseNotes.html>

Relnotes: yes
MFC after: 1 month
X-MFC-with: r321369

6 years agoVendor import of clang 5.0.0 release r312559:
Dimitry Andric [Wed, 6 Sep 2017 20:55:03 +0000 (20:55 +0000)]
Vendor import of clang 5.0.0 release r312559:
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_500/final@312559

6 years agoVendor import of llvm 5.0.0 release r312559:
Dimitry Andric [Wed, 6 Sep 2017 20:52:23 +0000 (20:52 +0000)]
Vendor import of llvm 5.0.0 release r312559:
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_500/final@312559

6 years agoSprinkle __read_frequently on few obvious places.
Mateusz Guzik [Wed, 6 Sep 2017 20:33:33 +0000 (20:33 +0000)]
Sprinkle __read_frequently on few obvious places.

Note that some of annotated variables should probably change their types
to something smaller, preferably bit-sized.

6 years agoIntroduce __read_frequently
Mateusz Guzik [Wed, 6 Sep 2017 20:32:49 +0000 (20:32 +0000)]
Introduce __read_frequently

While __read_mostly groups variables together, their placement is not
specified. In particular 2 frequently used variables can end up in
different lines.

This annotation is only expected to be used for variables read all the time,
e.g. on each syscall entry.

MFC after: 1 week

6 years agoStart annotating global _padalign locks with __exclusive_cache_line
Mateusz Guzik [Wed, 6 Sep 2017 20:28:18 +0000 (20:28 +0000)]
Start annotating global _padalign locks with __exclusive_cache_line

While these locks are guarnteed to not share their respective cache lines,
their current placement leaves unnecessary holes in lines which preceeded them.

For instance the annotation of vm_page_queue_free_mtx allows 2 neighbour
cachelines (previously separate by the lock) to be collapsed into 1.

The annotation is only effective on architectures which have it implemented in
their linker script (currently only amd64). Thus locks are not converted to
their not-padaligned variants as to not affect the rest.

MFC after: 1 week

6 years agobnxt: Update firmware header file with the latest one
Stephen Hurd [Wed, 6 Sep 2017 20:19:30 +0000 (20:19 +0000)]
bnxt: Update firmware header file with the latest one

hsi_struct_def.h file contains all firmware (HWRM) data struct's, updated
that with the latest one which was released on 30'th Aug.

After this upgrade, HWRM version will be 1.8.1.5 (earlier it was 1.4.0).

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12203

6 years agobnxt: Use correct firmware call for number of queues supported
Stephen Hurd [Wed, 6 Sep 2017 20:14:34 +0000 (20:14 +0000)]
bnxt: Use correct firmware call for number of queues supported

1) Based on the suggestion from firmware team, derive
   scctx->isc_ntxqsets_max & scctx->isc_nrxqsets_max based on FUNC_QCFG
   (instead of FUNC_QCAPS).
2) Bump-up driver version to "1.0.0.2".

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12128

6 years agoSkylake server core PMC support for hwpmc(4).
Konstantin Belousov [Wed, 6 Sep 2017 17:19:48 +0000 (17:19 +0000)]
Skylake server core PMC support for hwpmc(4).

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Hardware provided by: Intel
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D12221

6 years agoMinor style changes to make forthcoming code stand out less.
Konstantin Belousov [Wed, 6 Sep 2017 17:14:23 +0000 (17:14 +0000)]
Minor style changes to make forthcoming code stand out less.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
X-Differential revision: https://reviews.freebsd.org/D12221

6 years agoMake ps(1) flag processes in capsicum(4) capability mode with "C".
Edward Tomasz Napierala [Wed, 6 Sep 2017 16:34:42 +0000 (16:34 +0000)]
Make ps(1) flag processes in capsicum(4) capability mode with "C".

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAvoid keeping a dangling pointer when the mappings array is resized.
Mark Johnston [Wed, 6 Sep 2017 16:24:34 +0000 (16:24 +0000)]
Avoid keeping a dangling pointer when the mappings array is resized.

Sponsored by: Dell EMC Isilon

6 years agoDo not leak empty swblk.
Konstantin Belousov [Wed, 6 Sep 2017 16:18:53 +0000 (16:18 +0000)]
Do not leak empty swblk.

In swp_pager_meta_build(), if the requested operation results in
freeing the last swap pointer in the swblk, free the trie node.  Other
swap pager code does not expect to find completely empty swblk.

Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoReflect realtime and idle priorities in ps(1) state flags, same like
Edward Tomasz Napierala [Wed, 6 Sep 2017 16:18:06 +0000 (16:18 +0000)]
Reflect realtime and idle priorities in ps(1) state flags, same like
we do for the usual nice values.  It could be argued that they should
use another set of indicators, since the underlying mechanism is
different, but they match the description in the manual page, and so
I think it's ok to not overcomplicate things.

PR: 81757
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoIn swp_pager_meta_build(), handle a race with other thread allocating
Konstantin Belousov [Wed, 6 Sep 2017 16:16:11 +0000 (16:16 +0000)]
In swp_pager_meta_build(), handle a race with other thread allocating
swapblk for our index while we dropped the object lock.

Noted by: jeff
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAdd myself and mentorship status to committers files
Stephen Hurd [Wed, 6 Sep 2017 15:07:53 +0000 (15:07 +0000)]
Add myself and mentorship status to committers files

I failed to do this when I got my ports bit, so do them both in one commit.

Reviewed by: sbruno (mentor)
Differential Revision: https://reviews.freebsd.org/D12226

6 years agoMake LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that
Navdeep Parhar [Wed, 6 Sep 2017 14:36:35 +0000 (14:36 +0000)]
Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that
report extended media types.

lacp_aggregator_bandwidth() uses the media to determine the speed of the
interface and returns 0 for IFM_OTHER without the bits in the extended
range.

Reported by: kbowling@
Reviewed by: eugen_grosbein.net, mjoras@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D12188

6 years agoAdd new USB quirk.
Hans Petter Selasky [Wed, 6 Sep 2017 13:59:57 +0000 (13:59 +0000)]
Add new USB quirk.

PR: 221775
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for generic backpressure indicator for ratelimited
Hans Petter Selasky [Wed, 6 Sep 2017 13:56:18 +0000 (13:56 +0000)]
Add support for generic backpressure indicator for ratelimited
transmit queues aswell as non-ratelimited ones.

Add the required structure bits in order to support a backpressure
indication with ratelimited connections aswell as non-ratelimited
ones. The backpressure indicator is a value between zero and 65535
inclusivly, indicating if the destination transmit queue is empty or
full respectivly. Applications can use this value as a decision point
for when to stop transmitting data to avoid endless ENOBUFS error
codes upon transmitting an mbuf. This indicator is also useful to
reduce the latency for ratelimited queues.

Reviewed by: gallatin, kib, gnn
Differential Revision: https://reviews.freebsd.org/D11518
Sponsored by: Mellanox Technologies

6 years agoFix typos. Stop claiming that two children are created.
Konstantin Belousov [Wed, 6 Sep 2017 11:47:59 +0000 (11:47 +0000)]
Fix typos.  Stop claiming that two children are created.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoCheckpoint the next phase in debug message cleanup, this time focusing on
Scott Long [Wed, 6 Sep 2017 09:19:54 +0000 (09:19 +0000)]
Checkpoint the next phase in debug message cleanup, this time focusing on
error recovery messages.

Sponsored by: Netflix

6 years agoEnable dtrace support for mips64 and the ERL kernel config
Kurt Lidl [Wed, 6 Sep 2017 03:19:52 +0000 (03:19 +0000)]
Enable dtrace support for mips64 and the ERL kernel config

Turn on the required options in the ERL config file, and ensure
that the fbt module is listed as a dependency for mips in
the modules/dtrace/dtraceall/dtraceall.c file.

PR:  220346
Reviewed by: gnn, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12227

6 years agoMakefile.inc1: bump elf tool chain version check after PR 215350 fix
Ryan Libby [Wed, 6 Sep 2017 01:55:40 +0000 (01:55 +0000)]
Makefile.inc1: bump elf tool chain version check after PR 215350 fix

This causes builds to use the in-tree libdwarf with the bug fix instead
of the host library.

Reviewed by: bdrewery, emaste, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12239

6 years agoBugfix: Don't treat NANO_IMAGES as a direcotory.
Nick Hibma [Tue, 5 Sep 2017 21:17:20 +0000 (21:17 +0000)]
Bugfix: Don't treat NANO_IMAGES as a direcotory.

This was probably accidentally broken in r295377 .

Submitted by: Igor Serikov
MFC after: 2 weeks

6 years agoamdsmn(4): Do not probe not matching hostbridges
Conrad Meyer [Tue, 5 Sep 2017 21:00:33 +0000 (21:00 +0000)]
amdsmn(4): Do not probe not matching hostbridges

Similar to r323195, but for amdsmn(4) driver (which borrowed some design).

Ignore hostbs that do not match our PCI device id criteria.

Sponsored by: Dell EMC Isilon

6 years agoamdtemp(4): Do not probe not matching hostbridges
Conrad Meyer [Tue, 5 Sep 2017 20:35:25 +0000 (20:35 +0000)]
amdtemp(4): Do not probe not matching hostbridges

Some systems have hostbs that do not match our PCI device id criteria.
Detect and ignore these devices in probe.

PR: 218264
Sponsored by: Dell EMC Isilon

6 years agoFix remounting ZFS filesystem with "zfs mount"
Alan Somers [Tue, 5 Sep 2017 19:40:04 +0000 (19:40 +0000)]
Fix remounting ZFS filesystem with "zfs mount"

"zfs mount -o" passes a list of mount options directly to nmount(2) after
sanity checking them. In particular, zfs(8) will refuse to mount an already
existing file system unless "remount" is specified in the option list.
However, the "remount" option only exists in Illumos. FreeBSD's equivalent is
"update".

PR: 221985
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12233

6 years agoHonor all options of "zfs mount -o"
Alan Somers [Tue, 5 Sep 2017 19:28:35 +0000 (19:28 +0000)]
Honor all options of "zfs mount -o"

The existing code in zmount incorrectly parses the comma-delimited option
string. The result is that nmount only honors the last option. AFAICT the
parsing has been broken ever since ZFS's initial import in change 168404.

PR: 222078
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12232

6 years agognu binutils: FSGSBASE assembly/disassembly
Ryan Libby [Tue, 5 Sep 2017 19:04:07 +0000 (19:04 +0000)]
gnu binutils: FSGSBASE assembly/disassembly

Enable the in-tree binutils to assemble and disassemble amd64 FSGSBASE
instructions (rdfsbase, rdgsbase, wrfsbase, wrgsbase), used in the base
system since r322763.

This gives one last gasp for in-tree gcc, and provides a small
enhancement for in-tree binutils objdump.

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

6 years agoamdtemp(4): Add support for Family 17h temperature sensor
Conrad Meyer [Tue, 5 Sep 2017 15:19:14 +0000 (15:19 +0000)]
amdtemp(4): Add support for Family 17h temperature sensor

The sensor value is formatted similarly to previous models (same
bitfield sizes, same units), but must be read off of the internal
System Management Network (SMN) from the System Management Unit (SMU)
co-processor.

PR: 218264
Reported and tested by: Nils Beyer <nbe AT renzel.net>
Reviewed by: avg (no +1), mjoras, truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12217

6 years agoAdd smn(4) driver for AMD System Management Network
Conrad Meyer [Tue, 5 Sep 2017 15:13:41 +0000 (15:13 +0000)]
Add smn(4) driver for AMD System Management Network

AMD Family 17h CPUs have an internal network used to communicate between
the host CPU and the PSP and SMU coprocessors.  It exposes a simple
32-bit register space.

Reviewed by: avg (no +1), mjoras, truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12217

6 years agoMake root_mount_rel(9) ignore NULL arguments, like it used to before r313351.
Edward Tomasz Napierala [Tue, 5 Sep 2017 14:32:56 +0000 (14:32 +0000)]
Make root_mount_rel(9) ignore NULL arguments, like it used to before r313351.
It would be better to fix API consumers to not pass NULL there - most of them,
such as gmirror, already contain the neccessary checks - but this is easier
and much less error-prone.

One known user-visible result is that it fixes panic on a failed "graid label".

PR: 221846
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agomake-memstick.sh: use 'set -e' to abort if any step fails
Ed Maste [Tue, 5 Sep 2017 12:57:45 +0000 (12:57 +0000)]
make-memstick.sh: use 'set -e' to abort if any step fails

Also remove the now-redundant error handling that was only for makefs.

This change applies arm64's r308171 to the other make-memstick.sh
versions.

Reviewed by: gjb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12195

6 years agoMerge pipes and socket pairs.
Ed Schouten [Tue, 5 Sep 2017 07:46:45 +0000 (07:46 +0000)]
Merge pipes and socket pairs.

Now that CloudABI's sockets API has been changed to be addressless and
only connected socket instances are used (e.g., socket pairs), they have
become fairly similar to pipes. The only differences on CloudABI is that
socket pairs additionally support shutdown(), send() and recv().

To simplify the ABI, we've therefore decided to remove pipes as a
separate file descriptor type and just let pipe() return a socket pair
of type SOCK_STREAM. S_ISFIFO() and S_ISSOCK() are now defined
identically.

6 years agohyperv/hn: Log RSS capabilities mask.
Sepherosa Ziehau [Tue, 5 Sep 2017 06:20:02 +0000 (06:20 +0000)]
hyperv/hn: Log RSS capabilities mask.

This helps to detect when UDP hash types can be supported.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12177

6 years agohyperv/hn: Implement SIOCGIFRSS{KEY,HASH}.
Sepherosa Ziehau [Tue, 5 Sep 2017 06:05:48 +0000 (06:05 +0000)]
hyperv/hn: Implement SIOCGIFRSS{KEY,HASH}.

The conditional compiling in the review request is removed, since
these IOCTLs will be available in stable/10 and stable/11.

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

6 years agoFix loader bug causing too many pages allocation when bootloader is U-Boot
Marcin Wojtas [Tue, 5 Sep 2017 05:53:43 +0000 (05:53 +0000)]
Fix loader bug causing too many pages allocation when bootloader is U-Boot

FreeBSD loader expects to have mmsz variable set by bootloader.
U-Boot behaviour is that if buffer size is not big enough to keep
whole memory map, assign the smallest correct buffer size to sz
and return error.

In other words U-Boot assumes that nobody will need mmsz value when buffer
is not filled with memory map, which is not true, so calculated pages value
was too big to allocate.

Solution: Simply assign default value to mmsz.

Submitted by: Patryk Duda <pdk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12194

6 years agoAdd Marvell RTC driver to arm64 GENERIC config
Marcin Wojtas [Tue, 5 Sep 2017 05:50:01 +0000 (05:50 +0000)]
Add Marvell RTC driver to arm64 GENERIC config

Marvell Armada 80x0/70x0 SoC family uses same RTC IP as
Armada 38x. This patch adds necessary files and enable driver in
GENERIC config.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12200

6 years agoAdd Armada 80x0/70x0 compatible to 38x RTC driver
Marcin Wojtas [Tue, 5 Sep 2017 05:45:57 +0000 (05:45 +0000)]
Add Armada 80x0/70x0 compatible to 38x RTC driver

Marvell Armada 80x0/70x0 SoC family uses same RTC IP as Armada 38x.
This patch adds Armada 8k compatible to Marvell RTC driver.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12186

6 years agoChange name of Marvell Armada38x RTC driver
Marcin Wojtas [Tue, 5 Sep 2017 05:42:37 +0000 (05:42 +0000)]
Change name of Marvell Armada38x RTC driver

Two modules with the same name cannot be loaded, so Marvell specific drivers
cannot have the same name as generic drivers.
Files with the same name, even in different folder overlaps their .o files.
Change armada38x/rtc.c to armada38x/armada38x_rtc.c fix it.
Preparation for adding this driver to GENERIC config for ARMv7
Marvell platforms.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12185

6 years agoif: Add ioctls to get RSS key and hash type/function.
Sepherosa Ziehau [Tue, 5 Sep 2017 05:28:52 +0000 (05:28 +0000)]
if: Add ioctls to get RSS key and hash type/function.

It will be needed by hn(4) to configure its RSS key and hash
type/function in the transparent VF mode in order to match VF's
RSS settings. The description of the transparent VF mode and
the RSS hash value issue are here:
https://svnweb.freebsd.org/base?view=revision&revision=322299
https://svnweb.freebsd.org/base?view=revision&revision=322485

These are generic enough to promise two independent IOCs instead
of abusing SIOCGDRVSPEC.

Setting RSS key and hash type/function is a different story,
which probably requires more discussion.

Comment about UDP_{IPV4,IPV6,IPV6_EX} were only in the patch
in the review request; these hash types are standardized now.

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

6 years agoUse O_CLOEXEC when opening persistent handles in libdtrace.
Mark Johnston [Tue, 5 Sep 2017 00:11:06 +0000 (00:11 +0000)]
Use O_CLOEXEC when opening persistent handles in libdtrace.

PR: 199810
Submitted by: jau@iki.fi
MFC after: 1 week

6 years agomkisoimages.sh: remove obsolete x$var convention
Ed Maste [Mon, 4 Sep 2017 22:37:28 +0000 (22:37 +0000)]
mkisoimages.sh: remove obsolete x$var convention

Ancient shells had trouble with empty variables but this has not been
relevant for FreeBSD for a very long time (decades?).

6 years agoCorrect the binmiscctl(8) man page for powerpc64
Justin Hibbits [Mon, 4 Sep 2017 20:57:38 +0000 (20:57 +0000)]
Correct the binmiscctl(8) man page for powerpc64

Magic for powerpc64 erroneously specified ELFCLASS32 instead of ELFCLASS64.

Submitted by: luca.pizzamiglio _AT_ gmail DOT com
MFC after: 3 days

6 years agoUpdate pci_vendors to 2017-09-01
Baptiste Daroussin [Mon, 4 Sep 2017 20:41:34 +0000 (20:41 +0000)]
Update pci_vendors to 2017-09-01

MFC after: 2 days

6 years agoThe new fsck recovery information to enable it to find backup
Kirk McKusick [Mon, 4 Sep 2017 20:19:36 +0000 (20:19 +0000)]
The new fsck recovery information to enable it to find backup
superblocks created in revision 322297 only works on disks
with sector sizes up to 4K. This update allows the recovery
information to be created by newfs and used by fsck on disks
with sector sizes up to 64K. Note that FFS currently limits
filesystem to be mounted from disks with up to 8K sectors.
Expanding this limitation will be the subject of another
commit.

Reported by: Peter Holm
Reviewed with: kib

6 years agoFix whitespace on "options" to be <space><tab>, no functional change
Kurt Lidl [Mon, 4 Sep 2017 20:10:34 +0000 (20:10 +0000)]
Fix whitespace on "options" to be <space><tab>, no functional change

6 years agolibefivar: -fno-strict-aliasing
Ryan Libby [Mon, 4 Sep 2017 18:59:44 +0000 (18:59 +0000)]
libefivar: -fno-strict-aliasing

Avoid dealing with some code that uses type-punned pointers.

See D12210 and D12211 for more background.

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

6 years agoacpi/srat: zero the SRAT cpu array
Roger Pau Monné [Mon, 4 Sep 2017 10:08:42 +0000 (10:08 +0000)]
acpi/srat: zero the SRAT cpu array

Fix from fallout introduced in r322348 that moved the cpus array to a
dynamic allocation without zeroing the area.

Reported by: mjg
MFC with: r322348
Reviewed by: mjg
Differential revision: https://reviews.freebsd.org/D12220

6 years agoDecode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.
John Baldwin [Mon, 4 Sep 2017 05:34:36 +0000 (05:34 +0000)]
Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.

Move tables that were previously in truss over to libsysdecode.  truss
output is unchanged, but kdump has been updated to decode these fields.
In addition, sysdecode_sysarch_number() should support all platforms
whereas the old table in truss only supported x86.

6 years agoDisable the ARM generic timers before interrupts are enabled. Some
Andrew Turner [Sun, 3 Sep 2017 09:41:40 +0000 (09:41 +0000)]
Disable the ARM generic timers before interrupts are enabled. Some
Raspberry Pi firmware images leave them enabled causing an interrupt storm.

Sponsored by: ABT Systems Ltd

6 years agoAdd ARM Cortex A72 to CPU list
Marcin Wojtas [Sun, 3 Sep 2017 08:32:33 +0000 (08:32 +0000)]
Add ARM Cortex A72 to CPU list

This change is required to properly detect CPUs
on Marvell Armada 80x0/70x0 SoC family.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: andrew, cognet (mentor)
Approved by: cognet (mentor)
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D12184

6 years agoSpelling.
Greg Lehey [Sat, 2 Sep 2017 23:17:35 +0000 (23:17 +0000)]
Spelling.

6 years agoChange leading spaces to tabs, no functional change.
Ian Lepore [Sat, 2 Sep 2017 19:22:16 +0000 (19:22 +0000)]
Change leading spaces to tabs, no functional change.

6 years agoThe latest RPi firmware leaves secondary cores in a wait-for-event (WFE)
Ian Lepore [Sat, 2 Sep 2017 19:20:11 +0000 (19:20 +0000)]
The latest RPi firmware leaves secondary cores in a wait-for-event (WFE)
state to save power, so after writing the entry point address for a core to
the mailbox, use a dsb() to synchronize the execution pipeline to the data
written, then use an sev() to wake up the core.

Submitted by: Sylvain Garrigues <sylgar@gmail.com>

6 years agoRevert r322941: Eliminate redundant device matching functions
Warner Losh [Sat, 2 Sep 2017 18:18:49 +0000 (18:18 +0000)]
Revert r322941: Eliminate redundant device matching functions

Turns out, they are subtly different. I'll refactor anew in the future
if it's worth it then.

Sponsored by: Netflix
Reported by: Tomoaki AOKI-san

6 years agoIncrease negotiation polling period from 10ms to 100ms.
Alexander Motin [Sat, 2 Sep 2017 13:28:45 +0000 (13:28 +0000)]
Increase negotiation polling period from 10ms to 100ms.

There is no big need to burn CPU if other side may be not there yet.  For
example, the PLX hardware by default enables the NTB link up on reset, not
dependig on driver to do it.  In case of Intel hardware this also reduces
race between MSI-X workaround negotiation and upper layers, using the same
scratchpad registers in different time.

MFC after: 12 days

6 years agoSome NTB man pages polishing.
Alexander Motin [Sat, 2 Sep 2017 11:57:08 +0000 (11:57 +0000)]
Some NTB man pages polishing.

MFC after: 12 days

6 years agoMake NTB drivers report more info via NewBus methods.
Alexander Motin [Sat, 2 Sep 2017 11:56:16 +0000 (11:56 +0000)]
Make NTB drivers report more info via NewBus methods.

MFC after: 12 days