]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoARM64: Add quirk mechanism to pci_host_generic_acpi
wma [Mon, 9 Jul 2018 09:00:16 +0000 (09:00 +0000)]
ARM64: Add quirk mechanism to pci_host_generic_acpi

Add few quirks which are necessary to use AHCI on ThX2

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

5 years agoARM64: Add support for ThunderX2 PCIe
wma [Mon, 9 Jul 2018 08:55:07 +0000 (08:55 +0000)]
ARM64: Add support for ThunderX2 PCIe

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

5 years agoARM64: Add ThunderX2 CPU revision macro. Add ThunderX2 name in identcpu.c
wma [Mon, 9 Jul 2018 08:41:54 +0000 (08:41 +0000)]
ARM64: Add ThunderX2 CPU revision macro. Add ThunderX2 name in identcpu.c

Submitted by:          Patryk Duda <pdk@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium

5 years agogzip(1): Don't shadow global 'err'
cem [Mon, 9 Jul 2018 08:37:55 +0000 (08:37 +0000)]
gzip(1): Don't shadow global 'err'

Unbreak work build on ppc due to -Werror=shadow.  Introduced in r336121.

X-MFC-With: r336121

5 years agoIntegrate SHA2-224 with userspace components
cem [Mon, 9 Jul 2018 08:19:04 +0000 (08:19 +0000)]
Integrate SHA2-224 with userspace components

The double compilation of the kernel sources in libmd and libcrypt is
baffling, but add yet another define hack to prevent duplicate symbols.

Add documentation and SHA2-224 test cases to libmd.

Integrate with the md5(1) command, document, and add more test cases;
self-tests pass.

5 years agoOCF: Add plain hash modes
cem [Mon, 9 Jul 2018 07:28:13 +0000 (07:28 +0000)]
OCF: Add plain hash modes

In part, to support OpenSSL's use of cryptodev, which puts the HMAC pieces
in software and only offloads the raw hash primitive.

The following cryptodev identifiers are added:

 * CRYPTO_RIPEMD160 (not hooked up)
 * CRYPTO_SHA2_224
 * CRYPTO_SHA2_256
 * CRYPTO_SHA2_384
 * CRYPTO_SHA2_512

The plain SHA1 and 2 hashes are plumbed through cryptodev (feels like there
is a lot of redundancy here...) and cryptosoft.

This adds new auth_hash implementations for the plain hashes, as well as
SHA1 (which had a cryptodev.h identifier, but no implementation).

Add plain SHA 1 and 2 hash tests to the cryptocheck tool.

Motivation stems from John Baldwin's earlier OCF email,
https://lists.freebsd.org/pipermail/freebsd-arch/2018-January/018835.html .

5 years agoOCF: Add CRYPTO_SHA2_224_HMAC mode
cem [Mon, 9 Jul 2018 07:26:12 +0000 (07:26 +0000)]
OCF: Add CRYPTO_SHA2_224_HMAC mode

Round out the complete set of basic SHA2 HMAC modes with SHA2-224.

Support is added to the cryptocheck test tool.

5 years agoImplement SHA2-224 submode of SHA2-256
cem [Mon, 9 Jul 2018 07:24:05 +0000 (07:24 +0000)]
Implement SHA2-224 submode of SHA2-256

Like SHA2-384:SHA2-512, SHA2-224 is simply a truncated SHA2-256 with a
different initial vector.  Add to round out the complete basic SHA2 family.

5 years agoRemove "HMAC" from <HASH>_HMAC_BLOCK_LEN macro names
cem [Mon, 9 Jul 2018 07:21:37 +0000 (07:21 +0000)]
Remove "HMAC" from <HASH>_HMAC_BLOCK_LEN macro names

The block size is a property of the underlying hash algorithm, and has
nothing to do with the HMAC construction.

No functional change.

5 years agoDon't delete outfile unconditionally.
delphij [Mon, 9 Jul 2018 06:19:33 +0000 (06:19 +0000)]
Don't delete outfile unconditionally.

MFC after: 1 month

5 years agoRemove dirs that git svn should have removed but didn't.
imp [Mon, 9 Jul 2018 03:57:23 +0000 (03:57 +0000)]
Remove dirs that git svn should have removed but didn't.

5 years agolibiconv: correct undefined behavior.
pfg [Sun, 8 Jul 2018 23:22:04 +0000 (23:22 +0000)]
libiconv: correct undefined behavior.

Detected on NetBSD:
# nm /usr/lib/libc.so|grep sanit
    /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8:
runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Obtained from: NetBSD (CVS Rev. 1.11)
MFC after: 1 week

5 years agoRemove stray space from PNP string.
imp [Sun, 8 Jul 2018 23:12:27 +0000 (23:12 +0000)]
Remove stray space from PNP string.

5 years agogzip: fix for undefined behavior.
pfg [Sun, 8 Jul 2018 22:39:33 +0000 (22:39 +0000)]
gzip: fix for undefined behavior.

Unportable left shift reported with MKSANITIZER=yes
USE_SANITIZER=undefined:

# progress -zf ./games.tgz  tar -xp -C "./" -f -
/public/src.git/usr.bin/gzip/gzip.c:2126:33: runtime error: left shift of
251 by 24 places cannot be represented in type 'int'
100%
|****************************************************************************************************************|
44500 KiB  119.69 MiB/s    00:00 ETA

Refactor the following code into something that is more clear
and fix signed integer shift, by casting all buf[] elements to
(unsigned int):

unsigned char buf[8];
uint32_t usize;
[...]
else {
    usize = buf[4] | buf[5] << 8 |
            buf[6] << 16 | buf[7] << 24;
[...]

New version:

    usize = buf[4];
    usize |= (unsigned int)buf[5] << 8;
    usize |= (unsigned int)buf[6] << 16;
    usize |= (unsigned int)buf[7] << 24;

Only the "<< 24" part needs explicit cast, but for consistency make the
integer promotion explicit and clear to a code reader.

Sponsored by <The NetBSD Foundation>

Obtained from: NetBSD (CVS rev. 1.113)
MFC after: 1 week

5 years agoOops, fix a typo: imx_snvs should be imx6_snvs.
ian [Sun, 8 Jul 2018 21:14:43 +0000 (21:14 +0000)]
Oops, fix a typo:  imx_snvs should be imx6_snvs.

5 years agoMove device statements out of std.imx* and into kernel config files.
ian [Sun, 8 Jul 2018 21:09:52 +0000 (21:09 +0000)]
Move device statements out of std.imx* and into kernel config files.

In the armv4/5 world device statements in these files were common, but in
the v6/7 world, other socs don't put device statements into those files, so
this just brings imx5 and imx6 into line with the current conventions.

5 years agoAdd PNP info to PCI attachment of et driver
imp [Sun, 8 Jul 2018 20:40:28 +0000 (20:40 +0000)]
Add PNP info to PCI attachment of et driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15979

5 years agoAdd PNP info to PCI attachment of ipw driver
imp [Sun, 8 Jul 2018 20:40:23 +0000 (20:40 +0000)]
Add PNP info to PCI attachment of ipw driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15979

5 years agoAdd PNP info to PCI attachment of ixv driver
imp [Sun, 8 Jul 2018 20:40:19 +0000 (20:40 +0000)]
Add PNP info to PCI attachment of ixv driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15979

5 years agoAdd PNP info to PCI attachment of ix driver
imp [Sun, 8 Jul 2018 20:40:14 +0000 (20:40 +0000)]
Add PNP info to PCI attachment of ix driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15979

5 years agoAdd PNP info to PCI attachments of ciss driver
imp [Sun, 8 Jul 2018 20:40:10 +0000 (20:40 +0000)]
Add PNP info to PCI attachments of ciss driver

Move the module declaration so that it's after the device table.
The PNP_INFO must come after the module declaration.

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15995

5 years agoAdd PNP info to PCI attachment of dc driver
imp [Sun, 8 Jul 2018 20:40:06 +0000 (20:40 +0000)]
Add PNP info to PCI attachment of dc driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15995

5 years agoAdd PNP info to PCI attachments of bge driver
imp [Sun, 8 Jul 2018 20:40:01 +0000 (20:40 +0000)]
Add PNP info to PCI attachments of bge driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15995

5 years agoAdd PNP info to PCI attachments of bfe driver
imp [Sun, 8 Jul 2018 20:39:57 +0000 (20:39 +0000)]
Add PNP info to PCI attachments of bfe driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15995

5 years agoAdd PNP info to PCI attachment of alc driver
imp [Sun, 8 Jul 2018 20:39:52 +0000 (20:39 +0000)]
Add PNP info to PCI attachment of alc driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request: https://github.com/bsdimp/freebsd/pull/4

5 years agoAdd PNP info to PCI attachment of gem driver
imp [Sun, 8 Jul 2018 20:39:48 +0000 (20:39 +0000)]
Add PNP info to PCI attachment of gem driver

Move device table earlier in the file so we can reference it in the
PNP_INFO macro.

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request: https://github.com/bsdimp/freebsd/pull/5

5 years agoAdd PNP info to PCI attachment of fxp driver
imp [Sun, 8 Jul 2018 20:39:43 +0000 (20:39 +0000)]
Add PNP info to PCI attachment of fxp driver

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request: https://github.com/bsdimp/freebsd/pull/5

5 years agoAdd PNP info to PCI attachment of ena driver
imp [Sun, 8 Jul 2018 20:39:38 +0000 (20:39 +0000)]
Add PNP info to PCI attachment of ena driver

Make unsigned values uint16_t for pnp table. They are properly
uint16_t befause they are 16-bit PCI IDs. The PNP_INFO language has no
type for bare unsigned.

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request: https://github.com/bsdimp/freebsd/pull/5

5 years agoAdd PNP info to PCI attachment of cas driver
imp [Sun, 8 Jul 2018 20:39:23 +0000 (20:39 +0000)]
Add PNP info to PCI attachment of cas driver

Move module delcaration to be after device table. The PNP_INFO must
follow the module declaration.

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Pull Request: https://github.com/bsdimp/freebsd/pull/5

5 years agoReuse the PV entry when updating a mapping in pmap_enter().
markj [Sun, 8 Jul 2018 20:38:46 +0000 (20:38 +0000)]
Reuse the PV entry when updating a mapping in pmap_enter().

This addresses a problem described in r335784, where memory
pressure forces reclamation of a PV chunk and in rare cases leads to a
use-after-free of a page table page.

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

5 years agoMake the imx6_snvs driver usable as a module, add pnp info. Add a manpage.
ian [Sun, 8 Jul 2018 19:35:41 +0000 (19:35 +0000)]
Make the imx6_snvs driver usable as a module, add pnp info.  Add a manpage.

5 years agocritical_{enter, exit}: add missing compiler barrier
mmacy [Sun, 8 Jul 2018 19:35:29 +0000 (19:35 +0000)]
critical_{enter, exit}: add missing compiler barrier

Reported by: markj

5 years agoCatch up with improvements in RTC handling... It's no longer necessary to
ian [Sun, 8 Jul 2018 18:44:42 +0000 (18:44 +0000)]
Catch up with improvements in RTC handling... It's no longer necessary to
ignore the timestamp passed in to settime() due to inaccuracy, the core
routines now pass in a nanosecond-accurate time freshly-obtained before
calling each driver's settime() method.  Also, add calls to the new
debugging output helpers.

5 years agoFix the kernel part of pnfsdscopymr() to handle holes in the file being copied.
rmacklem [Sun, 8 Jul 2018 18:15:55 +0000 (18:15 +0000)]
Fix the kernel part of pnfsdscopymr() to handle holes in the file being copied.

If a mirrored DS is being recovered that has a lot of large sparse files,
pnfsdscopymr(8) would use a lot of space on the recovered mirror since it
would write the "holes" in the file being mirrored.
This patch adds code to check for a "hole" and skip doing the write.
The check is done on a "per PNFSDS_COPYSIZ size block", which is currently 64K.
I think that most file server file systems will be using a blocksize at
least this large. If the file server is using a smaller blocksize and
smaller holes need to be preserved, PNFSDS_COPYSIZ could be decreased.
The block of 0s is malloc()d, since pnfsdcopymr(8) should be an infrequent
occurrence.

5 years agoInvalidate the mapping before updating its physical address.
alc [Sun, 8 Jul 2018 16:51:54 +0000 (16:51 +0000)]
Invalidate the mapping before updating its physical address.

Doing so ensures that all threads sharing the pmap have a consistent
view of the mapping.  This fixes the problem described in the commit
log messages for r329254 without the overhead of an extra fault in the
common case.  Once other pmap_enter() implementations are similarly
modified, the workaround added in r329254 can be removed, reducing the
overhead of CoW faults.

See also r335784 for amd64.  The i386 implementation of pmap_enter()
already reused the PV entry from the old mapping.

Reviewed by: kib, markj
Tested by: pho
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D16133

5 years agoReduce diff between msun/src/e_pow.c and msun/src/e_powf.c.
markj [Sun, 8 Jul 2018 16:33:58 +0000 (16:33 +0000)]
Reduce diff between msun/src/e_pow.c and msun/src/e_powf.c.

Remove unnecessary casts, use integer literal constants instead of
floating point constants where possible, and introduce three const
static variables to hold 0.5, 0.25, and 1/3.

PR: 229420
Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
MFC after: 1 week

5 years agoFix whitespace issues in bessel function routines.
markj [Sun, 8 Jul 2018 16:26:13 +0000 (16:26 +0000)]
Fix whitespace issues in bessel function routines.

PR: 229423
Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
MFC after: 3 days

5 years agoAdd a missed chunk r335939.
kib [Sun, 8 Jul 2018 15:48:47 +0000 (15:48 +0000)]
Add a missed chunk r335939.

Noted by: David Carlier
MFC after: 9 days
Differential revision: https://reviews.freebsd.org/D16178

5 years agoUse the FQDN in the newsyslog log message when RFC 5424 is enabled.
ed [Sun, 8 Jul 2018 10:08:24 +0000 (10:08 +0000)]
Use the FQDN in the newsyslog log message when RFC 5424 is enabled.

The RFC 5424 spec mentions that logging FQDNs over short hostnames is
preferred. Alter this code, so that the hostname doesn't get truncated
on startup. Keep track of the length of the short hostname, so that
fprintf() can do the truncation where necessary.

MFC after: 1 month

5 years agoStop using ../zfs/libzfs.h but instead use libzfs.h.
imp [Sun, 8 Jul 2018 07:42:58 +0000 (07:42 +0000)]
Stop using ../zfs/libzfs.h but instead use libzfs.h.

While ../zfs/libzfs.h mostly works, there are a few situations where
it does not. Eliminate the problem by using plain libzfs.h, like we do
for ufs support. This fixes the weird cases, and is easier to
understand. It also follows the general style convetion of avoiding
../ in #includes.

5 years agoMove ZFS files into libsa
imp [Sun, 8 Jul 2018 07:42:49 +0000 (07:42 +0000)]
Move ZFS files into libsa

Move the libzfs stuff into libsa. There's no need for it to be a
separate library. The separate library adds to the issues of build
ordering that we see from time to time. Move the filesystem support
into libsa, like all the other filesystem support rather than making
zfs the odd-duck out.

Discussed with: allanjude@

5 years agoCreate an aarch64 subdir under man4, now that we have aarch64 manpages.
ian [Sun, 8 Jul 2018 01:29:48 +0000 (01:29 +0000)]
Create an aarch64 subdir under man4, now that we have aarch64 manpages.

Reported by: Mark Millard

5 years agoAdd pnp info to imx6_ahci, and add a module makefile, and a manpage for it.
ian [Sun, 8 Jul 2018 00:27:28 +0000 (00:27 +0000)]
Add pnp info to imx6_ahci, and add a module makefile, and a manpage for it.

5 years agoMove armv8crypto.4 into the aarch64 dir; should have been part of r336077.
ian [Sun, 8 Jul 2018 00:02:14 +0000 (00:02 +0000)]
Move armv8crypto.4 into the aarch64 dir; should have been part of r336077.

Pointy hat: ian@
Reported by: rpokola@

5 years agoMove arm- and aarch64-specific manpages into arch-specific directories.
ian [Sat, 7 Jul 2018 21:49:30 +0000 (21:49 +0000)]
Move arm- and aarch64-specific manpages into arch-specific directories.

This removes a bit of the .if/.endif clutter from man4/Makefile by using
the existing machinery that supports per-arch manpages.

5 years agoAdd a manpage for the imx5/6 watchdog driver.
ian [Sat, 7 Jul 2018 20:43:01 +0000 (20:43 +0000)]
Add a manpage for the imx5/6 watchdog driver.

5 years agoFix handling of the hybrid DS case for a pNFS server.
rmacklem [Sat, 7 Jul 2018 19:27:49 +0000 (19:27 +0000)]
Fix handling of the hybrid DS case for a pNFS server.

After the addition of the "#mds_path" suffix for a DS specification on the
"-p" nfsd option, it is possible to have a mix of DSs assigned to an MDS
file system and DSs that store files for all DSs. This is what I referred
to as "hybrid" above.
At first, I didn't think this hybrid case would be useful, but I now believe
that some system administrators may fine it useful.
This patch modifies the file storage assignment algorithm so that it
makes the "#mds_path" DSs take priority and the all file systems DSs
are now only used for MDS file systems with no "#mds_path" DS servers.
This only affects the pNFS server for this "hybrid" case.

5 years agoImport commit from NetBSD with checkin message:
mckusick [Sat, 7 Jul 2018 19:11:43 +0000 (19:11 +0000)]
Import commit from NetBSD with checkin message:

    Avoid Undefined Behavior in ffs_clusteracct()

    Change the type of 'bit' variable from int to unsigned int and use unsigned
    values consistently.

    sys/ufs/ffs/ffs_subr.c:336:10, shift exponent -1 is negative

    Detected with Kernel Undefined Behavior Sanitizer.

    Reported by <Harry Pantazis>

Submitted by: Pedro Giffuni

5 years agoAdd support to the imx watchdog for the FDT "timeout-sec" property, by
ian [Sat, 7 Jul 2018 19:10:00 +0000 (19:10 +0000)]
Add support to the imx watchdog for the FDT "timeout-sec" property, by
automatically initializing the watchdog using the given value.  Also,
attach at BUS_PASS_TIMER to extend watchdog protection to more of the
kernel init process.

5 years agoCorrectly calculate the value to put in the imx wdog countdown register.
ian [Sat, 7 Jul 2018 19:03:38 +0000 (19:03 +0000)]
Correctly calculate the value to put in the imx wdog countdown register.

The correct value is seconds*2-1.  The code was using just seconds*2, which
led to being off by a half-second -- usually not a big deal, except when the
value was the max (128) it overflowed so zero would get written to the
countdown register, which equates to a timeout of a half second.

5 years agoAdd pnp info and a module makefile for the imx_wdog watchdog driver.
ian [Sat, 7 Jul 2018 17:25:09 +0000 (17:25 +0000)]
Add pnp info and a module makefile for the imx_wdog watchdog driver.

5 years agoFix PCI_SUBDEV call
imp [Sat, 7 Jul 2018 15:55:58 +0000 (15:55 +0000)]
Fix PCI_SUBDEV call

5 years agoUpdate AMDSMB to use PCI_MATCH
imp [Sat, 7 Jul 2018 15:55:52 +0000 (15:55 +0000)]
Update AMDSMB to use PCI_MATCH

Differential Review: https://reviews.freebsd.org/D16172

5 years agoSwitch to using new PCI_MATCH stuff.
imp [Sat, 7 Jul 2018 15:25:16 +0000 (15:25 +0000)]
Switch to using new PCI_MATCH stuff.

5 years agoCreate PCI_MATCH and pci_match_device
imp [Sat, 7 Jul 2018 15:25:11 +0000 (15:25 +0000)]
Create PCI_MATCH and pci_match_device

Create a covenience function to match PCI device IDs. It's about 15
years overdue.

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

5 years agoMention the need to update devmatch.conf
imp [Sat, 7 Jul 2018 15:25:06 +0000 (15:25 +0000)]
Mention the need to update devmatch.conf

5 years agoWrap the declaration and assignment of "stripe" with #ifdef NUMA declarations
sbruno [Sat, 7 Jul 2018 13:37:44 +0000 (13:37 +0000)]
Wrap the declaration and assignment of "stripe" with #ifdef NUMA declarations
as not all targets are NUMA aware.

Found with gcc.

Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16113

5 years agostruct ifmediareq *ifmrp is only used in the COMPAT_FREEBSD32 parts of
sbruno [Sat, 7 Jul 2018 13:35:06 +0000 (13:35 +0000)]
struct ifmediareq *ifmrp is only used in the COMPAT_FREEBSD32 parts of
ifioctl().  Move it inside the proper #ifdef.  This was throwing a valid
"Assigned but unused" warning with gcc.

Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16063

5 years agoAllow alternate TCP stack to populate the TCP FO client cookie
tuexen [Sat, 7 Jul 2018 12:28:16 +0000 (12:28 +0000)]
Allow alternate TCP stack to populate the TCP FO client cookie
cache.

Without this patch, TCP FO could be used when using alternate
TCP stack, but only existing entires in the TCP client cookie
cache could be used. This cache was not populated by connections
using alternate TCP stacks.

Sponsored by: Netflix, Inc.

5 years agoAllow the use of slashes in process names of RFC 3164 formatted messages.
ed [Sat, 7 Jul 2018 11:53:39 +0000 (11:53 +0000)]
Allow the use of slashes in process names of RFC 3164 formatted messages.

Tools such as Postfix use slashes in process names for hierarchy
(postfix/qmgr). By allowing these slashes, syslogd is able to extract
the process name and process ID nicely, so that they can be stored in
RFC 5424 message fields.

MFC after: 1 week

5 years agoWhen initializing the TCP FO client cookie cache, take into account
tuexen [Sat, 7 Jul 2018 11:18:26 +0000 (11:18 +0000)]
When initializing the TCP FO client cookie cache, take into account
whether the TCP FO support is enabled or not for the client side.

The code in tcp_fastopen_init() implicitly assumed that the sysctl
variable V_tcp_fastopen_client_enable was initialized to 0. This
was initially true, but was changed in r335610, which unmasked this
bug.

Thanks to Pieter de Goeje for reporting the issue on freebsd-net@

5 years agoLet ofw_iicbus work its magic on OPAL i2c buses.
jhibbits [Sat, 7 Jul 2018 01:58:40 +0000 (01:58 +0000)]
Let ofw_iicbus work its magic on OPAL i2c buses.

ofw_iicbus already has attachments on iichb.  Rather than adding an explicit
attachment onto opal_i2c, simply change the exposed name of the OPAL i2c bus
to 'iichb'.

5 years agoUse the ticks since the last update to reduce hysteresis in the partpopq and
jeff [Sat, 7 Jul 2018 01:54:45 +0000 (01:54 +0000)]
Use the ticks since the last update to reduce hysteresis in the partpopq and
contention on the vm_reserv_domain lock.

This gives a roughly 8x speedup on will-it-scale fault1 on a 16 core machine.

Reviewed by: alc, kib, markj

5 years agohyperv: Fix boot-up after malloc() returns memory of NX by default now
dexuan [Sat, 7 Jul 2018 00:41:04 +0000 (00:41 +0000)]
hyperv: Fix boot-up after malloc() returns memory of NX by default now

FreeBSD VM can't boot up on Hyper-V after the recent malloc change in
r335068: Make UMA and malloc(9) return non-executable memory in most cases.

The hypercall page here must be executable.
Fix the boot-up issue by adding M_EXEC.

PR: 229167
Sponsored by: Microsoft

5 years agoExport a breakpoint() function to userland for arm and arm64.
jhb [Fri, 6 Jul 2018 23:49:17 +0000 (23:49 +0000)]
Export a breakpoint() function to userland for arm and arm64.

Enable ptrace() tests using breakpoint() on these architectures.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D15191

5 years agoSet .PATH to dev/usb/serial so that these modules compile again.
ian [Fri, 6 Jul 2018 22:07:26 +0000 (22:07 +0000)]
Set .PATH to dev/usb/serial so that these modules compile again.

5 years agoig4(4): Fix Apollo lake entries platform identifier
gonzo [Fri, 6 Jul 2018 22:01:00 +0000 (22:01 +0000)]
ig4(4): Fix Apollo lake entries platform identifier

Identify Apollo Lake controllers as IG4_APL and not as a IG4_SKYLAKE

Reported by: rpokala@

5 years agoig4(4): add support for Apollo Lake I2C controllers
gonzo [Fri, 6 Jul 2018 21:22:50 +0000 (21:22 +0000)]
ig4(4): add support for Apollo Lake I2C controllers

Add PCI ids for I2C controllers on Apollo Lake platform. Also convert
switch/case probe logic into a table.

Reviewed by: avg
Differential Revision: https://reviews.freebsd.org/D16120

5 years agoExpand x86 struct pcpus to UMA_PCPU_ALLOC_SIZE AKA PAGE_SIZE.
kib [Fri, 6 Jul 2018 19:50:44 +0000 (19:50 +0000)]
Expand x86 struct pcpus to UMA_PCPU_ALLOC_SIZE AKA PAGE_SIZE.

This restores counters(9) operation.
Revert r336024. Improve assert of pcpu size on x86.

Reviewed by: mmacy
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D16163

5 years agoRevert to recommit with the proper message.
kib [Fri, 6 Jul 2018 19:50:25 +0000 (19:50 +0000)]
Revert to recommit with the proper message.

5 years agoSave a call to pmap_remove() if entry cannot have any pages mapped.
kib [Fri, 6 Jul 2018 19:48:47 +0000 (19:48 +0000)]
Save a call to pmap_remove() if entry cannot have any pages mapped.

Due to the way rtld creates mappings for the shared objects, each dso
causes unmap of at least three guard map entries.  For instance, in
the buildworld load, this change reduces the amount of pmap_remove()
calls by 1/5.

Profiled by: alc
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16148

5 years agoRegen arm64 linux sysent after r336043
emaste [Fri, 6 Jul 2018 19:47:09 +0000 (19:47 +0000)]
Regen arm64 linux sysent after r336043

5 years agoFix arm64 linuxulator clone() argument order
emaste [Fri, 6 Jul 2018 19:44:49 +0000 (19:44 +0000)]
Fix arm64 linuxulator clone() argument order

Linux/arm64 is CLONE_BACKWARDS - i.e., "Architecture has tls passed as
the 4th argument of clone(2), not the 5th one."

The linux clone() syscall has four different permutations of argument
order, depending on architecture - see the #ifdef CONFIG_CLONE_BACKWARDS
maze in Linux's kernel/fork.c.

Sponsored by: Turing Robotic Industries

5 years agocxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB
np [Fri, 6 Jul 2018 19:33:58 +0000 (19:33 +0000)]
cxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB
sectors, instead of refusing to attach to the card.

Submitted by: Casey Leedom @ Chelsio
MFC after: 3 days
Sponsored by: Chelsio Communications

5 years agoChange the pNFS server so that it does not disable a mirrored DS for
rmacklem [Fri, 6 Jul 2018 19:18:45 +0000 (19:18 +0000)]
Change the pNFS server so that it does not disable a mirrored DS for
an NFSERR_STALE error reported via a LayoutReturn.

The current FreeBSD client can generate these errors for an operational
DS while doing a recovery of a mirror after a mirrored DS has been repaired.
I am not sure why these errors occur, but my best current guess is a race
between the Layout Recall issued by the kernel code run from pnfsdscopymr(8)
and a Read operation on the DS for the file bing copied.
The errors are not fatal, since the client falls back on doing I/O through
the MDS, which can do the I/O successfully as a proxy. (The fact that the
MDS can do this indicates that the file does still exist on the functioning
DS.)
This change only affects the pNFS server and only when a client does a
LayoutReturn with the NFSERR_STALE error report.

5 years agoChange prison_add_vfs() to the more generic prison_add_allow(), which
jamie [Fri, 6 Jul 2018 18:50:22 +0000 (18:50 +0000)]
Change prison_add_vfs() to the more generic prison_add_allow(), which
can add any dynamic allow.* or allow.*.* parameter.  Also keep
prison_add_vfs() as a wrapper.

Differential Revision: D16146

5 years agopsci: Add \n at the end of printf
manu [Fri, 6 Jul 2018 17:39:48 +0000 (17:39 +0000)]
psci: Add \n at the end of printf

Add a \n at the end of the printf if no PSCI function was found otherwise
it mess up the console log.

5 years agokern_environment: Fix SYSINIT ordering
kevans [Fri, 6 Jul 2018 16:51:35 +0000 (16:51 +0000)]
kern_environment: Fix SYSINIT ordering

The dynamic environment was being initialized at SI_SUB_KMEM, SI_ORDER_ANY.
I added the hint-merging at SI_SUB_KMEM, SI_ORDER_ANY as well in r335998 -
this can only work by coincidence.

Re-do both to operate at SI_SUB_KMEM + 1, SI_ORDER_FIRST and SI_ORDER_SECOND
respectively to be safe. It's sufficiently obfuscated away as to when in
SU_SUB_KMEM malloc will be available, and the dynamic environment cannot be
relied upon there anyways since it's initialized at SI_ORDER_ANY.

Reported by: bde
Discussed with: bde
X-MFC-With: r335998

5 years agoMissed a bit of doc change from r335921.
jamie [Fri, 6 Jul 2018 16:23:30 +0000 (16:23 +0000)]
Missed a bit of doc change from r335921.

PR: 229266

5 years agoAdding myself to committers-src.dot and calendar.freebsd
bwidawsk [Fri, 6 Jul 2018 16:22:26 +0000 (16:22 +0000)]
Adding myself to committers-src.dot and calendar.freebsd

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D16154

5 years agoOne more 32-bit fix for r335979.
brooks [Fri, 6 Jul 2018 13:34:45 +0000 (13:34 +0000)]
One more 32-bit fix for r335979.

Reported by: tuexen

5 years agoRemove duplicate configuration values as they are already defined in
sbruno [Fri, 6 Jul 2018 13:31:06 +0000 (13:31 +0000)]
Remove duplicate configuration values as they are already defined in
std.AR_MIPS_BASE

5 years agor336028 changed next_msg to a char * from char [] of fixed size. Change
sbruno [Fri, 6 Jul 2018 13:22:44 +0000 (13:22 +0000)]
r336028 changed next_msg to a char * from char [] of fixed size.  Change
2nd argument of vsnprintf() to get the strlen of next_msg so that the
appropriate size is used.

Found with gcc.

/usr.bin/top/display.c: In function 'new_message':
/usr.bin/top/display.c:963:31: error:
argument to 'sizeof' in 'vsnprintf' call is the same expression as the
destination; did you mean to provide an explicit length?
[-Werror=sizeof-pointer-memaccess]
     vsnprintf(next_msg, sizeof(next_msg), msgfmt, args);

Reviewed by: daichi

5 years agoSave a call to pmap_remove() if entry cannot have any pages mapped.
kib [Fri, 6 Jul 2018 12:44:48 +0000 (12:44 +0000)]
Save a call to pmap_remove() if entry cannot have any pages mapped.

Due to the way rtld creates mappings for the shared objects, each dso
causes unmap of at least three guard map entries.  For instance, in
the buildworld load, this change reduces the amount of pmap_remove()
calls by 1/5.

Profiled by: alc
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16148

5 years agoStyle: no need for braces around single-line then clause.
kib [Fri, 6 Jul 2018 12:37:46 +0000 (12:37 +0000)]
Style: no need for braces around single-line then clause.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D16148

5 years agoChanged to eliminate the upper limit of command length displayed
daichi [Fri, 6 Jul 2018 12:07:06 +0000 (12:07 +0000)]
Changed to eliminate the upper limit of command length displayed
by "-a" and expand to match terminal width

Reviewed by: eadler
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16083

5 years agoTeach binutils that arm64 is a 64bit architecture. This is needed to cross
andrew [Fri, 6 Jul 2018 11:50:59 +0000 (11:50 +0000)]
Teach binutils that arm64 is a 64bit architecture. This is needed to cross
build from arm64 to other architectures that use binutils.

Sponsored by: ABT Systems Ltd

5 years agoconfig(8): Fix broken ABI
kevans [Fri, 6 Jul 2018 11:23:14 +0000 (11:23 +0000)]
config(8): Fix broken ABI

r336019 introduced ${SRCTOP}/sys to the include paths in order to pull in a
new sys/{c,}nv.h. This is wrong, because the build tree's ABI isn't
guaranteed to match what's running on the host system.

Fix instead by removing -I${SRCTOP}/sys and installing the libnv headers
with `make -C lib/libnv includes`... this may or may not get re-worked in
the future so that a userland lib isn't installing includes from sys/.

Reported by: bdrewery

5 years agoMake sure kernel modules built by default are portable between UP and
hselasky [Fri, 6 Jul 2018 10:13:42 +0000 (10:13 +0000)]
Make sure kernel modules built by default are portable between UP and
SMP systems by extending defined(SMP) to include defined(KLD_MODULE).

This is a regression issue after r335873 .

Discussed with: mmacy@
Sponsored by: Mellanox Technologies

5 years agocounter(9): unbreak amd64 following r336020
mmacy [Fri, 6 Jul 2018 10:10:00 +0000 (10:10 +0000)]
counter(9): unbreak amd64 following r336020

Apply temporary fix to counter until daylight hours.
The fact that the assembly for counter_u64_add relied on the sizeof(struct pcpu) was
the basis for the otherwise arbitrary offset never came up in D15933.
critical_{enter,exit} is now inline so the only real added overhead is the
added (mostly false) conditional branch in exit.

5 years agoCorrect breakage on 32-bit platforms from r335979.
brooks [Fri, 6 Jul 2018 10:03:33 +0000 (10:03 +0000)]
Correct breakage on 32-bit platforms from r335979.

5 years agohwpmc: remove hacks to work around incorrect pc_domain
mmacy [Fri, 6 Jul 2018 06:21:24 +0000 (06:21 +0000)]
hwpmc: remove hacks to work around incorrect pc_domain

5 years agoepoch(9): simplify initialization
mmacy [Fri, 6 Jul 2018 06:20:03 +0000 (06:20 +0000)]
epoch(9): simplify initialization

replace manual NUMA aware allocation with a pcpu zone

5 years agoBack pcpu zone with domain correct pages
mmacy [Fri, 6 Jul 2018 02:06:03 +0000 (02:06 +0000)]
Back pcpu zone with domain correct pages

- Change pcpu zone consumers to use a stride size of PAGE_SIZE.
  (defined as UMA_PCPU_ALLOC_SIZE to make future identification easier)

- Allocate page from the correct domain for a given cpu.

- Don't initialize pc_domain to non-zero value if NUMA is not defined
  There are some misconceptions surrounding this field. It is the
  _VM_ NUMA domain and should only ever correspond to valid domain
  values as understood by the VM.

The former slab size of sizeof(struct pcpu) was somewhat arbitrary.
The new value is PAGE_SIZE because that's the smallest granularity
which the VM can allocate a slab for a given domain. If you have
fewer than PAGE_SIZE/8 counters on your system there will be some
memory wasted, but this is obviously something where you want the
cache line to be coming from the correct domain.

Reviewed by: jeff
Sponsored by: Limelight Networks
Differential Revision:  https://reviews.freebsd.org/D15933

5 years agoconfig(8): De-dupe hint/env vars within a single file
kevans [Fri, 6 Jul 2018 01:11:06 +0000 (01:11 +0000)]
config(8): De-dupe hint/env vars within a single file

r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

libnv has been added to -legacy for the time being to support the build of
config(8) with the new cnvlist API.

Tested with: universe (11 host & 12 host)
MFC after: 1 month

5 years agoThis exposes ZFS user and group quotas via the normal
sef [Thu, 5 Jul 2018 22:56:13 +0000 (22:56 +0000)]
This exposes ZFS user and group quotas via the normal
quatactl(2) mechanism.  (Read-only at this point, however.)
In particular, this is to allow rpc.rquotad query quotas
for NFS mounts, allowing users to see their quotas on the
hosts using the datasets.

The changes specifically:

* Add new RPC entry points for querying quotas.
* Changes the library routines to allow non-UFS quotas.
* Changes rquotad to check for quotas on mounted filesystems,
rather than being limited to entries in /etc/fstab
* Lastly, adds a VFS entry-point for ZFS to query quotas.

Note that this makes one unavoidable behavioural change: if quotas
are enabled, then they can be queried, as opposed to the current
method of checking for quotas being specified in fstab.  (With
ZFS, if there are user or group quotas, they're used, always.)

Reviewed by: delphij, mav
Approved by: mav
Sponsored by: iXsystems Inc
Differential Revision: https://reviews.freebsd.org/D15886

5 years agoath(4): Fix typo in debugging code
cem [Thu, 5 Jul 2018 21:38:54 +0000 (21:38 +0000)]
ath(4): Fix typo in debugging code

PR: 229548
Submitted by: David Binderman <dcb314 AT hotmail.com>

5 years agoRevert r336011,r336012 until I can competently test
kevans [Thu, 5 Jul 2018 18:55:42 +0000 (18:55 +0000)]
Revert r336011,r336012 until I can competently test

5 years agoFix build after r336011
kevans [Thu, 5 Jul 2018 18:39:02 +0000 (18:39 +0000)]
Fix build after r336011

Add libnv to bootstrap-tools, use ${SRCTOP}/sys headers.

5 years agoconfig(8): De-dupe hint/env vars within a single file
kevans [Thu, 5 Jul 2018 17:53:51 +0000 (17:53 +0000)]
config(8): De-dupe hint/env vars within a single file

r335653 flipped the order in which hints/env files are concatenated to match
the order in which vars are processed by the kernel. This is the other
hammer to drop.

Use nv(9) to de-dupe entries within a single `hint` or `env` file, using the
latest value specified for a key. This leaves some duplicates if a variable
is specified in multiple hint/env files or via `envvar` in a kernel config,
but the reversed order of concatenation (from r335653) makes this a
non-issue as the latest-specified version will be seen first.

This change also silently rewrote hint bits to use the same sanitization
process that ian@ wrote for r335642. To the kernel, hints and env vars are
basically the same thing through early boot, then get merged into the
dynamic environment once kmem becomes available and the dynamic environment
is created. They should be subjected to the same restrictions.

MFC after: 1 month