]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMove the undefined instruction handler to identcpu.c so we have access
andrew [Thu, 27 Sep 2018 13:50:57 +0000 (13:50 +0000)]
Move the undefined instruction handler to identcpu.c so we have access
to the registers from boot.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D17301

5 years agoCross-reference style.Makefile(5) from make(1) and make.conf(5).
0mp [Thu, 27 Sep 2018 12:20:32 +0000 (12:20 +0000)]
Cross-reference style.Makefile(5) from make(1) and make.conf(5).

Reviewed by: krion, mat, sjg
Approved by: re (gjb), krion (mentor), mat (mentor)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17170

5 years agonewvers.sh: Unbreak building in Git repositories.
0mp [Thu, 27 Sep 2018 12:15:31 +0000 (12:15 +0000)]
newvers.sh: Unbreak building in Git repositories.

Building the kernel in Git repositories when git-svn is not available and
the "help.autocorrect" Git parameter is enabled results in Git trying to
replace the "svn" command (it does not know) with "serve". As a result the
output of the "git server" command is appended to the value of the
environmental variable VERINFO, which causes the auto generated vers.c
file to contain invalid C syntax (missing newline escapes):

    #define "@(#)FreeBSD 12.0-ALPHA7  r000eversion 2
    0015agent=git/2.19.0
    000cls-refs
    0012fetch=shallow
    0012server-option
    0000=5e2272613fa(splash-vt)"
    #define VERSTR "FreeBSD 12.0-ALPHA7  r000eversion 2
    0015agent=git/2.19.0
    000cls-refs
    0012fetch=shallow
    0012server-option
    0000=5e2272613fa(splash-vt)\n"

Using `-c help.autocorrect=0` seems to be a good solution as it does not
modify user's environment. I am not sure, however, if we should use
programs (or Git commands), which we are not sure exist (we never check if
git-svn is available on the host), as there may be more unexpected
behaviors like this one.

Reviewed by: eadler, emaste, krion
Approved by: re (gjb), krion (mentor)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17271

5 years agomsdosfs(5): Explain how to determine version of the FAT file system.
0mp [Thu, 27 Sep 2018 12:08:53 +0000 (12:08 +0000)]
msdosfs(5): Explain how to determine version of the FAT file system.

While here, remove deprecated Tn macros.

Reviewed by: bcr
Approved by: re (gjb), krion (mentor)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17237

5 years agoHandle a guest executing a vm instruction by trapping and raising an
andrew [Thu, 27 Sep 2018 11:16:19 +0000 (11:16 +0000)]
Handle a guest executing a vm instruction by trapping and raising an
undefined instruction exception. Previously we would exit the guest,
however an unprivileged user could execute these.

Found with: syzkaller
Reviewed by: araujo, tychon (previous version)
Approved by: re (kib)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17192

5 years agoProvide refobj context when doing libmap substitution inside
kib [Wed, 26 Sep 2018 21:28:14 +0000 (21:28 +0000)]
Provide refobj context when doing libmap substitution inside
search_library_path().

This corrects the scope of libmap matches.

Reported and tested by: Andreas Longwitz <longwitz@incore.de>
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

5 years agoWhen doing lm_add(), check for duplicates.
kib [Wed, 26 Sep 2018 21:27:08 +0000 (21:27 +0000)]
When doing lm_add(), check for duplicates.

This is useful when lm_find() moves the match to the global mapping,
since lm_find() could be called with a same path more than once.

Reported and tested by: Andreas Longwitz <longwitz@incore.de>
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

5 years agocxgbe(4): Enable support for per-connection rate limiting in the default
np [Wed, 26 Sep 2018 21:16:07 +0000 (21:16 +0000)]
cxgbe(4): Enable support for per-connection rate limiting in the default
firmware configuration files.

Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications

5 years agoAdd per-session locking to cryptosoft (swcr).
sef [Wed, 26 Sep 2018 20:23:12 +0000 (20:23 +0000)]
Add per-session locking to cryptosoft (swcr).

As part of ZFS Crypto, I started getting a series of panics when I did not
have AESNI loaded.  Adding locking fixed it, and I concluded that the
Reinit function altered the AES key schedule.  This locking is not as
fine-grained as it could be (AESNI uses per-cpu locking), but
it's minimally invasive.

Sponsored by: iXsystems Inc
Reviewed by: cem, mav
Approved by: re (gjb), mav (mentor)
Differential Revision: https://reviews.freebsd.org/D17307

5 years agoRelax syntax requirements of source string
imp [Wed, 26 Sep 2018 19:41:06 +0000 (19:41 +0000)]
Relax syntax requirements of source string

The original spec for the strings describing the PNP info didn't allow
spaces. Several times now people have broken the install by including
them. Relax the syntax to allow them after the ; which is where
people's muscle memory tends to put them.

Approved by: re@ (gjb)

5 years agoRemove bogus spaces.
imp [Wed, 26 Sep 2018 19:41:00 +0000 (19:41 +0000)]
Remove bogus spaces.

Spaces aren't allowed in these strings.

Approved by: re@ (glen)

5 years agoHandle overflow of uid or gid in arguments for chown
bdrewery [Wed, 26 Sep 2018 18:40:57 +0000 (18:40 +0000)]
Handle overflow of uid or gid in arguments for chown

chown incorrectly allows a uid or gid greater than UID_MAX/GID_MAX respectively.
Using such an argument rolls over to accounts such as root, operator, etc.

Approved by: re (gjb)
Relnotes: yes
Reviewed by: cem, kib
Submitted by: Don Morris <dgmorris@earthlink.net>
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15119

5 years agoAdd PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,
imp [Wed, 26 Sep 2018 17:12:30 +0000 (17:12 +0000)]
Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,
mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existing
pci device tables, and has no probe / attach code changes.

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Approved by: re (glen)

5 years agoReapply, with minor tweaks, r338025, from the original commit:
imp [Wed, 26 Sep 2018 17:12:14 +0000 (17:12 +0000)]
Reapply, with minor tweaks, r338025, from the original commit:

Remove unused and easy to misuse PNP macro parameter

Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely.  The 'table' parameter is now required to
have correct pointer (or array) type.  Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

  $ cat modpnpsize0.cocci
    @normaltables@
    identifier b,c;
    expression a,d,e;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,d,
    -sizeof(d[0]),
     e);

    @singletons@
    identifier b,c,d;
    expression a;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,&d,
    -sizeof(d),
     1);

  $ rg -l MODULE_PNP_INFO -- sys | \
    xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not.  So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).
Approved by: re (glen)

5 years agoAdd "src-ip" or "dst-ip" keyword to the output, when we are printing the
ae [Wed, 26 Sep 2018 15:37:48 +0000 (15:37 +0000)]
Add "src-ip" or "dst-ip" keyword to the output, when we are printing the
rest of rule options.

Reported by: lev
Approved by: re (gjb)
MFC after: 1 week

5 years agoadd REPRODUCIBLE_BUILD note to UPDATING
emaste [Wed, 26 Sep 2018 15:07:06 +0000 (15:07 +0000)]
add REPRODUCIBLE_BUILD note to UPDATING

Reported by: bz
Approved by: re (gjb)

5 years agoFix witness warning in xform_init().
ae [Wed, 26 Sep 2018 14:47:51 +0000 (14:47 +0000)]
Fix witness warning in xform_init().

Do not call crypto_newsession() while holding xforms_lock mutex.
Release mutex before invoking crypto_newsession(), and use
ipsec_kmod_enter()/ipsec_kmod_exit() functions to protect from doing
access to unloaded kernel module memory.

Move xform-releated functions into subr_ipsec.c to be able use
ipsec_kmod_* functions. Also unconditionally build ipsec_kmod_*
functions, since now they are always used by IPSec code.

Add xf_cntr field to struct xformsw, it is used by ipsec_kmod_*
functions. Also constify xf_name field, since it is not expected to be
modified.

Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17302

5 years agoClarify UPDATING entry about lld
emaste [Wed, 26 Sep 2018 14:32:36 +0000 (14:32 +0000)]
Clarify UPDATING entry about lld

The workaround described in the 20180530 entry is no longer required.
Amend that entry and add a new 20180530 entry noting lld is the
default amd64 linker.

Reviewed by: imp
Approved by: re (kib)

5 years agoAdd PCIV_INVALID definition
slavash [Wed, 26 Sep 2018 13:16:55 +0000 (13:16 +0000)]
Add PCIV_INVALID definition

From PCI Spec rev 2.2, 6.2.1. Device Identification:
Vendor ID This field identifies the manufacturer of the device. Valid
vendor identifiers are allocated by the PCI SIG to ensure uniqueness.
0FFFFh is an invalid value for Vendor ID.

MFC after:      3 days
Approved by:    re (Glen), hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoWhitespace changes and fixing a typo. No functional change.
tuexen [Wed, 26 Sep 2018 10:24:50 +0000 (10:24 +0000)]
Whitespace changes and fixing a typo. No functional change.

Approved by: re (kib@)
MFC after: 1 week

5 years agocxgbe(4): Treat base/end of firmware parameters as signed integers when
np [Wed, 26 Sep 2018 02:27:37 +0000 (02:27 +0000)]
cxgbe(4): Treat base/end of firmware parameters as signed integers when
figuring out whether the range is valid or not.

Approved by: re@ (rgrimes@)
MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoRemove MD dirdeps from Makefile.depend.
jkim [Tue, 25 Sep 2018 22:21:36 +0000 (22:21 +0000)]
Remove MD dirdeps from Makefile.depend.

It can't be right. :-(

5 years agoMake it more meta mode friendly.
jkim [Tue, 25 Sep 2018 22:15:47 +0000 (22:15 +0000)]
Make it more meta mode friendly.

5 years agoFix CLEANFILES.
jkim [Tue, 25 Sep 2018 22:14:52 +0000 (22:14 +0000)]
Fix CLEANFILES.

5 years agoRegen Makefile.depend.
jkim [Tue, 25 Sep 2018 21:12:36 +0000 (21:12 +0000)]
Regen Makefile.depend.

5 years agoFix some uses of dmaplimit.
kib [Tue, 25 Sep 2018 20:07:58 +0000 (20:07 +0000)]
Fix some uses of dmaplimit.

dmaplimit is the first byte after the end of DMAP.

Reported by: "Johnson, Archna" <Archna.Johnson@netapp.com>
Reviewed by: alc, markj
Approved by: re (gjb)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17318

5 years agoBring the 32-bit powerpc (PowerMac) back to live. The commit 338486 reworked
andreast [Tue, 25 Sep 2018 19:29:35 +0000 (19:29 +0000)]
Bring the 32-bit powerpc (PowerMac) back to live. The commit 338486 reworked
some TLS bits. This broke operation on the PowerMac. Namely one could not login.
At login the screen/shell was giving back lots of backslashes and the login
shell dumped core.

The fix to this issue is to revert the powerpc commit from 338486 and to
increase the TLS_TCB_SIZE to 16.
Reverting only did not help, login was possible but userland applications
aborted with strange messages.

I tested this patch with world/kernel builds and with port upgrades.
Additionally a full gcc8 bootstrap was successfully completed.

Reviewed by: jhibbits@
Approved by: re (Glen)

5 years agoDo not remove ld man page if lld is enabled and binutils is not
emaste [Tue, 25 Sep 2018 18:54:18 +0000 (18:54 +0000)]
Do not remove ld man page if lld is enabled and binutils is not

Reported by: Mark Millard
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoFix an issue in r338862.
kib [Tue, 25 Sep 2018 18:24:25 +0000 (18:24 +0000)]
Fix an issue in r338862.

For pmap_invalidate_all_pcid(), only reset pm_gen for non-kernel
pmaps, as it was done before the conversion to ifuncs.  The reset is
useless but innocent for kernel_pmap. Coverity reported that cpuid is
used uninitialized in this case.

Reported by: cem
Reviewed by: alc, cem, markj
CID:  1395807
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17314

5 years agozfs: depessimize zfs_root with rmlocks
mjg [Tue, 25 Sep 2018 17:58:06 +0000 (17:58 +0000)]
zfs: depessimize zfs_root with rmlocks

Currently vfs calls the root method on each absolute lookup and when
crossing mount points.

zfs_root ends up looking up the inode internally as if it was not
instantianted which results in significant lock contention on systems
like EPYC.

Store the vnode in the mount point and protect the access with rmlocks.
This is a temporary hack for 12.0.

Sample result:

before:
make -s -j 128 buildkernel 2778.09s user 3319.45s system 8370% cpu 1:12.85 total

after:
make -s -j 128 buildkernel 3199.57s user 1772.78s system 8232% cpu 1:00.40 total

Tested by: pho (zfs mount/unmount tests)
Reviewed by: kib, mav, sef (different parts)
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17233

5 years agolibevent: eliminate in-tree usage of arc4random_addrandom
emaste [Tue, 25 Sep 2018 17:41:48 +0000 (17:41 +0000)]
libevent: eliminate in-tree usage of arc4random_addrandom

Apply r338059 to newly-added libevent 2.1.18.

Sponsored by: The FreeBSD Foundation

5 years agoDon't override LDFLAGS set in bsd.cpu.mk.
brooks [Tue, 25 Sep 2018 15:25:42 +0000 (15:25 +0000)]
Don't override LDFLAGS set in bsd.cpu.mk.

This is a direct commit to a generated file.  Simon plans to fix this
upstream before the next import.

PR: 231557
Approved by: re (gjb)
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

5 years agocxgbe(4): Link related changes.
np [Tue, 25 Sep 2018 05:52:42 +0000 (05:52 +0000)]
cxgbe(4): Link related changes.

- Switch to using 32b port/link capabilities in the driver.  The 32b
  format is used internally by firmwares > 1.16.45.0 and the driver will
  now interact with the firmware in its native format, whether it's 16b
  or 32b.  Note that the 16b format doesn't have room for 50G, 200G, or
  400G speeds.

- Add a bit in the pause_settings knobs to allow negotiated PAUSE
  settings to override manual settings.

- Ensure that manual link settings persist across an administrative
  down/up as well as transceiver unplug/replug.

- Remove unused is_*G_port() functions.

Approved by: re@ (gjb@)
MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agopowerpc: Blacklist the top 64kB range of the lower 4GB PA space
jhibbits [Tue, 25 Sep 2018 02:34:28 +0000 (02:34 +0000)]
powerpc: Blacklist the top 64kB range of the lower 4GB PA space

The PHB4 host bridge used by the POWER9 uses a 64kB range in 32-bit
space at the address 0xffff0000-0xffffffff.  Reserve this range so that
DMA memory cannot be allocated within this range.  This fixes seemingly
random crashes on a POWER9 system.  Ideally this range will have been
reserved by the firmware, but as of now this is not the case.

Submitted by: git_bdragon.rtk0.net
Reviewed by: nwhitehorn
Approved by: re(kib)
Differential Revision: https://reviews.freebsd.org/D17183

5 years agoRecognize the Amazon PCI serial device found in i3.metal EC2 instances
cperciva [Mon, 24 Sep 2018 22:15:04 +0000 (22:15 +0000)]
Recognize the Amazon PCI serial device found in i3.metal EC2 instances
as an NS8250 UART.

Reviewed by: sbruno, imp
Approved by: re (delphij)
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D17250

5 years agosysctl(8): Add a standard exit status section.
0mp [Mon, 24 Sep 2018 20:46:45 +0000 (20:46 +0000)]
sysctl(8): Add a standard exit status section.

Reviewed by: bcr
Approved by: re (gjb), krion (mentor)
Differential Revision: https://reviews.freebsd.org/D17147

5 years agoAdd more NUMA-specific low memory predicates.
markj [Mon, 24 Sep 2018 19:24:17 +0000 (19:24 +0000)]
Add more NUMA-specific low memory predicates.

Use these predicates instead of inline references to vm_min_domains.
Also add a global all_domains set, akin to all_cpus.

Reviewed by: alc, jeff, kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17278

5 years agorestore pmccontrol -L behavior on x86
mmacy [Mon, 24 Sep 2018 19:06:09 +0000 (19:06 +0000)]
restore pmccontrol -L behavior on x86

When I updated counter definition handling for x86 I broke
'pmccontrol -L' listing counter names. This just changes
pmccontrol to call the library function on x86.

PR: 230984
Approved by: re (kib@)

5 years agoRestore the API of the kf_sa_local and kf_sa_peer members.
jhb [Mon, 24 Sep 2018 18:20:38 +0000 (18:20 +0000)]
Restore the API of the kf_sa_local and kf_sa_peer members.

In 11.x and earlier these were accessible as direct members of 'struct
kinfo_file'.  Existing code already knows about the new location of
these members as well, so wrapper macros did not work for these
fields.  Instead, define an anonymous struct containing the fields
from 'struct kinfo_file' in FreeBSD 11 that were not part of the
'kf_un' union.  This anonymous struct is then placed in an anonymous
union along with the new 'kf_un' union.  This preserves the API of
both structure layouts without requiring any wrapper macros.

PR: 231525
Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17262

5 years agoSwitch ntp's embedded libevent to 2.1.18
emaste [Mon, 24 Sep 2018 17:51:56 +0000 (17:51 +0000)]
Switch ntp's embedded libevent to 2.1.18

For OpenSSL 1.1.1 compatibility.

Sponsored by: The FreeBSD Foundation.

5 years agoImplement pmap_sync_icache().
jhb [Mon, 24 Sep 2018 17:41:29 +0000 (17:41 +0000)]
Implement pmap_sync_icache().

This invokes "fence" on the hart performing the write followed by an IPI
to execute "fence.i" on all harts.

This is required to support userland debuggers setting breakpoints in
user processes.

Reviewed by: br (earlier version), markj
Approved by: re (gjb)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17139

5 years agoFix use-after-free in RAID0 error reporting of GEOM_RAID.
mav [Mon, 24 Sep 2018 16:58:55 +0000 (16:58 +0000)]
Fix use-after-free in RAID0 error reporting of GEOM_RAID.

PR: 231510
Submitted by: yangx92@hotmail.com
Approved by: re (gjb)
MFC after: 1 week

5 years agoPassing UMA_ZONE_NOFREE to uma_zcreate() for swpctrie_zone and swblk_zone is
alc [Mon, 24 Sep 2018 16:49:02 +0000 (16:49 +0000)]
Passing UMA_ZONE_NOFREE to uma_zcreate() for swpctrie_zone and swblk_zone is
redundant, because uma_zone_reserve_kva() is performed on both zones and it
sets this same flag on the zone.  (Moreover, the implementation of the swap
pager does not itself require these zones to be UMA_ZONE_NOFREE.)

Reviewed by: kib, markj
Approved by: re (gjb)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17296

5 years agoCopy libevent sources to contrib
emaste [Mon, 24 Sep 2018 16:48:54 +0000 (16:48 +0000)]
Copy libevent sources to contrib

To replace the libevent embedded in ntp, for OpenSSL 1.1.1 compat.

5 years agoImport libevent 2.1.18
emaste [Mon, 24 Sep 2018 16:32:10 +0000 (16:32 +0000)]
Import libevent 2.1.18

This will be used to replace the embedded libevent in ntp, for
OpenSSL 1.1.1 compatibility.

Sponsored by: The FreeBSD Foundation

5 years agoEnsure that "domain" is initialized when vm_ndomains == 1.
markj [Mon, 24 Sep 2018 15:32:46 +0000 (15:32 +0000)]
Ensure that "domain" is initialized when vm_ndomains == 1.

Reported by: alc
Approved by: re (gjb)

5 years agoMove libc linker ifunc test to build target only
emaste [Mon, 24 Sep 2018 13:42:46 +0000 (13:42 +0000)]
Move libc linker ifunc test to build target only

Targets like 'cleandir' must not depend on toolchain capabilities.

Reported by: delphij, Shawn Webb
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoEliminate false sharing in malloc due to statistic collection
mjg [Sun, 23 Sep 2018 19:00:06 +0000 (19:00 +0000)]
Eliminate false sharing in malloc due to statistic collection

Currently stats are collected in a MAXCPU-sized array which is not
aligned and suffers enormous false-sharing. Fix the problem by
utilizing per-cpu allocation.

The counter(9) API is not used here as it is too incomplete and does
not provide a win over per-cpu zone sized for malloc stats struct. In
particular stats are being reported for each cpu separately by just
copying what is supposed to be an array element for given cpu.

This eliminates significant false-sharing during malloc-heavy tests
e.g. on Skylake. See the review for details.

Reviewed by: markj
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17289

5 years agoRemove the unused parameter 'locked' from the function
tuexen [Sun, 23 Sep 2018 16:37:32 +0000 (16:37 +0000)]
Remove the unused parameter 'locked' from the function
syncache_respond(). There is no functional change. The
parameter became unused in r313330, but wasn't removed.

Approved by: re (kib@)
MFC after: 1 month
Sponsored by: Netflix, Inc.

5 years agoAdd a hack to build on ARMv4 and ARMv5.
jkim [Sun, 23 Sep 2018 02:51:54 +0000 (02:51 +0000)]
Add a hack to build on ARMv4 and ARMv5.

5 years agoConnect an assembly file for aarch64 to build.
jkim [Sat, 22 Sep 2018 23:02:45 +0000 (23:02 +0000)]
Connect an assembly file for aarch64 to build.

5 years agoSet the default loader for powerpc(32- and 64-bit) back to to forth.
andreast [Sat, 22 Sep 2018 20:58:43 +0000 (20:58 +0000)]
Set the default loader for powerpc(32- and 64-bit) back to to forth.
There are some issues with the lua-loader. To be on the safe side, use a well
known and working loader.

Approved by: re (glen)

5 years agoCorrect panic messages.
kib [Sat, 22 Sep 2018 17:05:49 +0000 (17:05 +0000)]
Correct panic messages.

Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)
MFC after: 1 week

5 years agoFurther reorganize pmap_invalidate TLB code.
kib [Sat, 22 Sep 2018 17:04:39 +0000 (17:04 +0000)]
Further reorganize pmap_invalidate TLB code.

Split calculation of mask for shootdown IPI and local
invalidation. Reorder IPI before local.

Suggested by: alc
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D17277

5 years agoUpdate ifr_name before invoking IPSECSREQID ioctl, this fixes the case,
ae [Sat, 22 Sep 2018 16:30:48 +0000 (16:30 +0000)]
Update ifr_name before invoking IPSECSREQID ioctl, this fixes the case,
when `ifconfig ipsec create reqid N` command invoked without interface
unit number. The "name" global variable is updated after interface
cloning in the ifclonecreate() and contains actual interface name.

Reported by: lev
Approved by: re (kib)
MFC after: 1 week

5 years agoWe don't need shell protection for when we're expanding matches.
imp [Sat, 22 Sep 2018 15:32:53 +0000 (15:32 +0000)]
We don't need shell protection for when we're expanding matches.
Don't add it. This should fix when we do regepx matches against
variables we've set and fix wifi bring up.

PR: 231441
Approved by: re@ (kib)
Differential Revision: https://reviews.freebsd.org/D17267

5 years agoMove hosts.allow to lib/libwrap/
brd [Sat, 22 Sep 2018 13:17:30 +0000 (13:17 +0000)]
Move hosts.allow to lib/libwrap/

This leverages CONFS to handle the install.

Approved by: re (blanket, pkgbase), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17240

5 years agoImprove loader passwords:
trasz [Sat, 22 Sep 2018 13:14:44 +0000 (13:14 +0000)]
Improve loader passwords:

1. Be clear about which password is being requested
2. Remove extraneous whitespace between the prompt and the cursor
3. Move the twiddle to where the prompt is, instead of two characters to the right
4. Fix erasing the 'incorrect password' message when retrying; previously it was erased partially
5. Remove the unneeded exclamation mark

Reviewed by: kevans
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17236

5 years agovfs: __predict common case in VFS_EPILOGUE/PROLOGUE
mjg [Sat, 22 Sep 2018 11:39:30 +0000 (11:39 +0000)]
vfs: __predict common case in VFS_EPILOGUE/PROLOGUE

NFS is the only in-tree filesystem using the feature, but all ops test
for it.

Currently the resulting sigdefer calls have to be jumped over in the
common case.

This is a bandaid, longer term fix will move this feature away.

Approved by: re (kib)

5 years agoAdd missing ACFLAGS for aarch64.
jkim [Sat, 22 Sep 2018 06:50:56 +0000 (06:50 +0000)]
Add missing ACFLAGS for aarch64.

5 years agoFix typos in the previous commit.
jkim [Sat, 22 Sep 2018 05:59:43 +0000 (05:59 +0000)]
Fix typos in the previous commit.

5 years agoAdd a missing source file for SHA.
jkim [Sat, 22 Sep 2018 05:30:55 +0000 (05:30 +0000)]
Add a missing source file for SHA.

5 years agoAdd CFLAGS for aarch64/arm assembly files.
jkim [Sat, 22 Sep 2018 05:16:06 +0000 (05:16 +0000)]
Add CFLAGS for aarch64/arm assembly files.

5 years agoAdd another include directory for aarch64 and arm.
jkim [Sat, 22 Sep 2018 04:32:44 +0000 (04:32 +0000)]
Add another include directory for aarch64 and arm.

5 years agoRegen cpuid assembly files for aarch64 and arm.
jkim [Sat, 22 Sep 2018 03:54:40 +0000 (03:54 +0000)]
Regen cpuid assembly files for aarch64 and arm.

5 years agoConnect assembly files for arm to build.
jkim [Sat, 22 Sep 2018 02:43:24 +0000 (02:43 +0000)]
Connect assembly files for arm to build.

5 years agoRegen assembly files for arm.
jkim [Sat, 22 Sep 2018 02:42:51 +0000 (02:42 +0000)]
Regen assembly files for arm.

5 years agoConnect assembly files for aarch64 to build.
jkim [Sat, 22 Sep 2018 02:23:42 +0000 (02:23 +0000)]
Connect assembly files for aarch64 to build.

5 years agoRegen assemply files for aarch64.
jkim [Sat, 22 Sep 2018 02:23:03 +0000 (02:23 +0000)]
Regen assemply files for aarch64.

5 years agocxgbe(4): Reuse existing "switching" L2T entries when possible.
np [Sat, 22 Sep 2018 01:24:30 +0000 (01:24 +0000)]
cxgbe(4): Reuse existing "switching" L2T entries when possible.

Approved by: re@ (rgrimes@)
Sponsored by: Chelsio Communications

5 years agocxgbetool(8): The VLAN tag provided in the action for a filter must be prefixed
np [Fri, 21 Sep 2018 23:48:40 +0000 (23:48 +0000)]
cxgbetool(8): The VLAN tag provided in the action for a filter must be prefixed
with either '=' or '+'.  Fix the description of the parameter in the man page
while here.

Approved by: re@ (kib@)
Sponsored by: Chelsio Communications

5 years agoUnify opensslconf.h templates.
jkim [Fri, 21 Sep 2018 22:26:00 +0000 (22:26 +0000)]
Unify opensslconf.h templates.

There is no MD macro in this file any more.

5 years agoMFV r338866: 9700 ZFS resilvered mirror does not balance reads
mav [Fri, 21 Sep 2018 21:56:00 +0000 (21:56 +0000)]
MFV r338866: 9700 ZFS resilvered mirror does not balance reads

illumos/illumos-gate@82f63c3c2bf5e4378706e8dcfccf717d67371be9

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author:     Jerry Jelinek <jerry.jelinek@joyent.com>

Approved by: re (delphij)

5 years agoUse the GNU as-compatible .endm instead of .endmacro.
markj [Fri, 21 Sep 2018 20:20:03 +0000 (20:20 +0000)]
Use the GNU as-compatible .endm instead of .endmacro.

Approved by: re (gjb)

5 years agoConvert x86 TLB top-level invalidation functions to ifuncs.
kib [Fri, 21 Sep 2018 17:53:06 +0000 (17:53 +0000)]
Convert x86 TLB top-level invalidation functions to ifuncs.

Note that shootdown IPI handlers are already per-mode.

Suggested by: alc
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17184

5 years agolibc: require ifunc-capable linker for amd64/i386
emaste [Fri, 21 Sep 2018 17:49:37 +0000 (17:49 +0000)]
libc: require ifunc-capable linker for amd64/i386

We expect to introduce optimized libc routines in the near future,
which requires use of a linker that supports ifuncs.

Approved by: re (gjb, kib)
Sponsored by:   The FreeBSD Foundation

5 years agoDisable sbrk() use in GNU tools.
brooks [Fri, 21 Sep 2018 17:44:05 +0000 (17:44 +0000)]
Disable sbrk() use in GNU tools.

We're studing the possibility of deprecating sbrk().  To make it easier
we're removing unnecessicary uses in the base system.  None of these
tools require sbrk(), but they agressively prefer it for no good reason.

Reviewed by:    andrew
Approved by: re (kib)
Sponsored by: DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D16141

5 years agoamd64: even up copyin/copyout with memcpy + other cleanup
mjg [Fri, 21 Sep 2018 15:00:46 +0000 (15:00 +0000)]
amd64: even up copyin/copyout with memcpy + other cleanup

- _fault handlers for both primitives are identical, provide just one
- change the copying scheme to match memcpy (in particular jump
avoidance for the most common case of multiply of 8)
- stop re-reading pcb address on exit, just store it locally (in r9)

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17265

5 years agoFix possible NULL pointer dereference in ffec_alloc_mbufcl().
ae [Fri, 21 Sep 2018 13:44:05 +0000 (13:44 +0000)]
Fix possible NULL pointer dereference in ffec_alloc_mbufcl().

PR: 231514
Approved by: re (kib)
MFC after: 1 week

5 years agoInclude kernel ident in uname
emaste [Fri, 21 Sep 2018 13:43:06 +0000 (13:43 +0000)]
Include kernel ident in uname

In non-reproducible mode we have the kernel ident as a side effect of
including the build directory.  Explicitly add it to the ident string in
reproducible mode.

Reported by: mjg
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoselect: stop doing zero-sized memsets
mjg [Fri, 21 Sep 2018 13:20:41 +0000 (13:20 +0000)]
select: stop doing zero-sized memsets

Approved by: re (kib)

5 years agoremove double space between branch and version in kernel ident
emaste [Fri, 21 Sep 2018 13:02:25 +0000 (13:02 +0000)]
remove double space between branch and version in kernel ident

Reported by: dim
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoamd64: check for small size in memmove, memcpy and memset
mjg [Fri, 21 Sep 2018 12:27:36 +0000 (12:27 +0000)]
amd64: check for small size in memmove, memcpy and memset

If the size is 15 bytes or less avoid spinning up rep just to copy the 8
bytes. In my tests on EPYC and old Intel microarchs without ERMS (like
Westmere) it provided a nice win over the current version (e.g. for EPYC
memset with 15 bytes of size goes from 59712651 ops/s to 70600095) all
while almost not pessimizing the other cases.

Data collected during package building shows that < 16 sizes are pretty
common.

Verified with the glibc test suite.

Approved by: re (kib)

5 years agoAdd an installer option to disable destructive dtrace.
des [Fri, 21 Sep 2018 09:27:32 +0000 (09:27 +0000)]
Add an installer option to disable destructive dtrace.

Submitted by: Jörg Pernfuß <code.jpe@gmail.com>
Approved by: re (kib)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12474

5 years agoMention setting $lines to 0 in ddb can disable paging
lwhsu [Fri, 21 Sep 2018 07:36:02 +0000 (07:36 +0000)]
Mention setting $lines to 0 in ddb can disable paging

Reviewed by: bcr (earlier version), markj
Approved by: re (kib), markj (mentor)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17068

5 years agofix vlan locking to permit sx acquisition in ioctl calls
mmacy [Fri, 21 Sep 2018 01:37:08 +0000 (01:37 +0000)]
fix vlan locking to permit sx acquisition in ioctl calls

- update vlan(9) to handle changes earlier this year in multicast locking

Tested by: np@, darkfiberu at gmail.com

PR: 230510
Reviewed by: mjoras@, shurd@, sbruno@
Approved by: re (gjb@)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16808

5 years agoUpdate head from ALPHA6 to ALPHA7 as part of the 12.0-RELEASE
gjb [Thu, 20 Sep 2018 23:59:42 +0000 (23:59 +0000)]
Update head from ALPHA6 to ALPHA7 as part of the 12.0-RELEASE
cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoRemove pthread from LIBADD for openssl(1).
jkim [Thu, 20 Sep 2018 23:06:59 +0000 (23:06 +0000)]
Remove pthread from LIBADD for openssl(1).

libcrypto is linked with pthread since r338816.

5 years agoRegen assembly files for i386 after r338846.
jkim [Thu, 20 Sep 2018 22:48:34 +0000 (22:48 +0000)]
Regen assembly files for i386 after r338846.

5 years agoAdd CFLAGS for i386 assembly files.
jkim [Thu, 20 Sep 2018 22:47:55 +0000 (22:47 +0000)]
Add CFLAGS for i386 assembly files.

5 years agoSort assembly source files for i386.
jkim [Thu, 20 Sep 2018 22:45:42 +0000 (22:45 +0000)]
Sort assembly source files for i386.

5 years agoConnect engines to the build.
jkim [Thu, 20 Sep 2018 21:59:47 +0000 (21:59 +0000)]
Connect engines to the build.

5 years agoConnect i386 assembly files to build.
jkim [Thu, 20 Sep 2018 21:36:52 +0000 (21:36 +0000)]
Connect i386 assembly files to build.

5 years agoRegen assembly files for i386.
jkim [Thu, 20 Sep 2018 21:34:05 +0000 (21:34 +0000)]
Regen assembly files for i386.

5 years agoamd64: macroify copyin/copyout and provide erms variants, follow up
mjg [Thu, 20 Sep 2018 20:32:08 +0000 (20:32 +0000)]
amd64: macroify copyin/copyout and provide erms variants, follow up

Fix a fat-fingered typo with a "funny" side-effect: when doing copyin on a
cpu without ERMS and with size being a multiply of 8 a page fault would be
triggered resulting in EFAULT.

Pointy hat: mjg
Approved by: re (implicit)

5 years agoAdd IFCAP_TSO6 for igb
shurd [Thu, 20 Sep 2018 20:06:44 +0000 (20:06 +0000)]
Add IFCAP_TSO6 for igb

It seems igb supports TSO6, but the capability got lost in
the iflib update. Restore this capability.

PR: 231476
Reported by: lev
Reviewed by: erj
Approved by: re (gjb)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17242

5 years agoAdd new field max_hdrsize to struct encap_config.
ae [Thu, 20 Sep 2018 19:45:27 +0000 (19:45 +0000)]
Add new field max_hdrsize to struct encap_config.

It is currently unused and reserved for future use to keep KBI/KPI.
Also add several spare pointers to be able extend structure if it
will be needed.

Approved by: re (gjb)

5 years agoFix capabilities handling for iflib drivers
shurd [Thu, 20 Sep 2018 19:35:35 +0000 (19:35 +0000)]
Fix capabilities handling for iflib drivers

Various capabilities were not being handled correctly in the
SIOCSIFCAP handler. Specifically:

IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 could be set even if not supported

It was impossible to disable IFCAP_RXCSUM and/or IFCAP_RXCSUM_IPV6 via
ifconfig since it does ioctl() per command-line flag rather than combine
them into a single call.

IFCAP_VLAN_HWCSUM could not be modified via the ioctl()

Setting any combination of the three IFCAP_WOL flags would set only
IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC. For example, setting only
IFCAP_WOL_UCAST would result in both IFCAP_WOL_MCAST and IFCAP_WOL_MAGIC
being enabled, but IFCAP_WOL_UCAST would not be enabled.

Because if_vlancap() was called before if_togglecapenable(), vlan flags
were sometimes not applied correctly.

Interfaces were being unnecessarily stopped and restarted for WoL

PR: 231151
Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Reported by: Shirkdog <mshirk@daemon-security.com>
Reviewed by: galladin
Approved by: re (gjb)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D17158

5 years agoamd64: macroify copyin/copyout and provide erms variants
mjg [Thu, 20 Sep 2018 18:30:17 +0000 (18:30 +0000)]
amd64: macroify copyin/copyout and provide erms variants

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17257

5 years agoEnsure that imports into per-domain kmem arenas are KVA_QUANTUM-aligned.
markj [Thu, 20 Sep 2018 18:29:55 +0000 (18:29 +0000)]
Ensure that imports into per-domain kmem arenas are KVA_QUANTUM-aligned.

The old code appears to assume that vmem_alloc() would import
size-aligned KVA chunks from the parent kernel_arena, but vmem doesn't
provide this guarantee.

Also remove the unused global RWX arena and add comments explaining why
we have per-domain arenas.

Reported by: alc
Reviewed by: alc, kib (previous version)
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17249