]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoRework how the ld link is handled in WORLDTMP from r322811.
Bryan Drewery [Wed, 20 Jun 2018 16:10:02 +0000 (16:10 +0000)]
Rework how the ld link is handled in WORLDTMP from r322811.

LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they
should not be based on each other.

This is related to upcoming WITH_SYSTEM_LINKER work.

Reviewed by: emaste
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15836

5 years agoAdd pmap_mapdev_attr for arm64
Emmanuel Vadot [Wed, 20 Jun 2018 16:07:35 +0000 (16:07 +0000)]
Add pmap_mapdev_attr for arm64

This is needed for efifb.
arm and ricv pmap (the two arch with arm64 that uses subr_devmap) have very
different implementation so for now only add this for arm64.

Tested with efifb on Pine64 with a few other patches.

Reviewed by: cognet
Differential Revision: https://reviews.freebsd.org/D15294

5 years agoif_rk_dwc: Disable setting delays for now
Emmanuel Vadot [Wed, 20 Jun 2018 15:27:09 +0000 (15:27 +0000)]
if_rk_dwc: Disable setting delays for now

The values for tx/rx delays differs accross the different DTS.
Mainline Linux set it to 0x24/0x18
Mostly-Vendor u-boot (the one maintained and developped) to 0x18/0x18
Mostly-Vendor linux (the one maintained and developped) to 0x26/0x11

By experience only 0x18/0x18 works so until the issue is resolved rely on
the bootloader settings.

5 years agork_gpio: Read the correct register for gpio read
Emmanuel Vadot [Wed, 20 Jun 2018 14:46:07 +0000 (14:46 +0000)]
rk_gpio: Read the correct register for gpio read

Reported by: jmcneill

5 years agoif_rk_dwc: Fix delays handling
Emmanuel Vadot [Wed, 20 Jun 2018 14:45:26 +0000 (14:45 +0000)]
if_rk_dwc: Fix delays handling

The property are named {t,r}x_delay and not {t,r}-delay.
The upper bits of the register are a mask of which bits is allowed
to be written, set it otherwise we write nothing.
OF_getencprop returns <0 = for an error.

Pointy Hat: myself
Reported by: jmcneill (delay and mask bits)

5 years agoAttach dev.cpu nodes on powerpc SMT cores, using only the first found thread
Justin Hibbits [Wed, 20 Jun 2018 13:30:35 +0000 (13:30 +0000)]
Attach dev.cpu nodes on powerpc SMT cores, using only the first found thread

Summary: In order to use cpufreq(4), a dev.cpu attachment must be created.  If
the IBM property is found denoting SMT, attach only to the first thread setup,
so that a cpufreq device can bind.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15921

5 years agoInstead of using hand-rolled loops where not needed switch them
Bjoern A. Zeeb [Wed, 20 Jun 2018 11:42:06 +0000 (11:42 +0000)]
Instead of using hand-rolled loops where not needed switch them
to FOREACH_PROC_IN_SYSTEM() to have a single pattern to look for.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D15916

5 years agoMove the SYSINIT to allow userspace access to the ARM generic timer later
Andrew Turner [Wed, 20 Jun 2018 11:13:10 +0000 (11:13 +0000)]
Move the SYSINIT to allow userspace access to the ARM generic timer later
in the boot. It doesn't need to be early, so move it to the SI_ORDER_ANY
stage of SI_SUB_SMP.

Sponsored by: DARPA, AFRL

5 years agoMove the SMCCC SYSINIT later in the boot so the psci driver has attached.
Andrew Turner [Wed, 20 Jun 2018 10:57:29 +0000 (10:57 +0000)]
Move the SMCCC SYSINIT later in the boot so the psci driver has attached.

Sponsored by: DARPA, AFRL

5 years agoFix the SMCCC signatures, they are all 32-bit calls. This fixes SMCCC
Andrew Turner [Wed, 20 Jun 2018 10:02:50 +0000 (10:02 +0000)]
Fix the SMCCC signatures, they are all 32-bit calls. This fixes SMCCC
version detection.

Sponsored by: DARPA, AFRL

5 years agoSometimes it is helpful to get the path for a vnode.
Bjoern A. Zeeb [Wed, 20 Jun 2018 08:34:29 +0000 (08:34 +0000)]
Sometimes it is helpful to get the path for a vnode.
Implement a ddb function walking the namecache to do this.

Reviewed by: jhb, mjg
Inspired by: gdb macro from jhb (old version)
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14898

5 years agoFix build breakage in veriexec for 32-bit architectures.
Stephen J. Kiernan [Wed, 20 Jun 2018 06:54:38 +0000 (06:54 +0000)]
Fix build breakage in veriexec for 32-bit architectures.

fsid_t and ino_t are 64-bit entities, use uintmax_t typecast to ensure we
can print it on 32-bit or 64-bit architectures by using the %ju format for
prints.

Obtained from: Juniper Networks, Inc.

5 years agosort(1): Fix -m when only implicit stdin is used for input
Kyle Evans [Wed, 20 Jun 2018 03:31:19 +0000 (03:31 +0000)]
sort(1): Fix -m when only implicit stdin is used for input

Observe:

printf "a\nb\nc\n" > /tmp/foo
# Next command results in no output
cat /tmp/foo | sort -m
# Next command results in proper output
cat /tmp/foo | sort -m -
# Also works:
sort -m /tmp/foo

Some const'ification was done to simplify the actual solution of adding "-"
explicitly to the file list if we didn't have any file arguments left over.

PR: 190099
MFC after: 1 week

5 years agosort(1): Add bits to allow easy checking against NetBSD tests
Kyle Evans [Wed, 20 Jun 2018 03:10:49 +0000 (03:10 +0000)]
sort(1): Add bits to allow easy checking against NetBSD tests

I'm looking at sort(1) failures, for better or worse.

5 years agoThis application (veriexecctl) handles reading a fingerprints file
Stephen J. Kiernan [Wed, 20 Jun 2018 01:08:54 +0000 (01:08 +0000)]
This application (veriexecctl) handles reading a fingerprints file
containing paths, fingerprints, and optional option flags which in turn
get pushed into the MAC/veriexec meta-data store via the veriexec device.

The format of the fingerprints file is as follows:
path type fingerprint options

The type of fingerprint supported depends on what MAC/veriexec fingerprint
modules have been loaded into the system. The veriexecctl application is
able to determine which ones are available by consulting the
security.mac.veriexec.algorithms sysctl.

The following options are currently supported in MAC/veriexec and by the
veriexecctl application:

indirect
  If this option is set then the executable cannot be invoked directly, it
  can only be used as an interpreter in shell scripts.
file
  Indicates that the fingerprint is associated with a file, not an
  executable. Files have their fingerprints verified during open(2) and are
  automatically made read only. This option may be used to verify shared
  libraries have not been tampered with.
no_ptrace
  If this option is set then the executable cannot be traced with the
  ptrace(2) process tracing and debugging call.
trusted
  If this option is set then the executable is allowed to write to the
  mem(4) devices. By default, when verified execution is enforced, no
  process is allowed to write to the mem(4) devices.

The options are not case sensitive.

Reviewed by: jtl, wblock
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8575

5 years agoThis library allows for user space applications to check file descriptors
Stephen J. Kiernan [Wed, 20 Jun 2018 00:55:18 +0000 (00:55 +0000)]
This library allows for user space applications to check file descriptors
or paths to see if they can be verified by MAC/veriexec.

Reviewed by: jtl, wblock
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8562

5 years agoDevice for user space to interface with MAC/veriexec.
Stephen J. Kiernan [Wed, 20 Jun 2018 00:48:46 +0000 (00:48 +0000)]
Device for user space to interface with MAC/veriexec.

The veriexec device features the following ioctl commands:

VERIEXEC_ACTIVE
  Activate veriexec functionality
VERIEXEC_DEBUG_ON
  Enable debugging mode and increment or set the debug level
VERIEXEC_DEBUG_OFF
  Disable debugging mode
VERIEXEC_ENFORCE
  Enforce veriexec fingerprinting (and acitvate if not already)
VERIEXEC_GETSTATE
  Get current veriexec state
VERIEXEC_LOCK
  Lock changes to veriexec meta-data store
VERIEXEC_LOAD
  Load veriexec fingerprint if secure level is not raised (and passes the
  checks for VERIEXEC_SIGNED_LOAD)
VERIEXEC_SIGNED_LOAD
  Load veriexec fingerprints from loader that supports signed manifest
  (and thus we can be more lenient about secure level being raised.)
  Fingerprints can be loaded if the meta-data store is not locked. Also
  securelevel must not have been raised or some fingerprints must have
  already been loaded, otherwise it would be dangerous to allow loading.
  (Note: this assumes that the fingerprints in the meta-data store at
         least cover the fingerprint loader.)

Reviewed by: jtl
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8561

5 years agoMAC/veriexec implements a verified execution environment using the MAC
Stephen J. Kiernan [Wed, 20 Jun 2018 00:41:30 +0000 (00:41 +0000)]
MAC/veriexec implements a verified execution environment using the MAC
framework.

The code is organized into a few distinct pieces:

* The meta-data store (in veriexec_metadata.c) which maps a file system
  identifier, file identifier, and generation key tuple to veriexec
  meta-data record.

* Fingerprint management (in veriexec_fingerprint.c) which deals with
  calculating the cryptographic hash for a file and verifying it. It also
  manages the loadable fingerprint modules.

* MAC policy implementation (in mac_veriexec.c) which implements the
  following MAC methods:

mpo_init
  Initializes the veriexec state, meta-data store, fingerprint modules,
  and registers mount and unmount EVENTHANDLERs

mpo_syscall
  Implements the following per-policy system calls:
  MAC_VERIEXEC_CHECK_FD_SYSCALL
    Check a file descriptor to see if the referenced file has a valid
    fingerprint.
  MAC_VERIEXEC_CHECK_PATH_SYSCALL
    Check a path to see if the referenced file has a valid fingerprint.

mpo_kld_check_load
  Check if loading a kld is allowed. This checks if the referenced vnode
  has a valid fingerprint.

mpo_mount_destroy_label
  Clears the veriexec slot data in a mount point label.

mpo_mount_init_label
  Initializes the veriexec slot data in a mount point label.
  The file system identifier is saved in the veriexec slot data.

mpo_priv_check
  Check if a process is allowed to write to /dev/kmem and /dev/mem
  devices.
  If a process is flagged as trusted, it is allowed to write.

mpo_proc_check_debug
  Check if a process is allowed to be debugged. If a process is not
  flagged with VERIEXEC_NOTRACE, then debugging is allowed.

mpo_vnode_check_exec
  Check is an exectuable is allowed to run. If veriexec is not enforcing
  or the executable has a valid fingerprint, then it is allowed to run.
  NOTE: veriexec will complain about mismatched fingerprints if it is
  active, regardless of the state of the enforcement.

mpo_vnode_check_open
  Check is a file is allowed to be opened. If verification was not
  requested, veriexec is not enforcing, or the file has a valid
  fingerprint, then veriexec will allow the file to be opened.

mpo_vnode_copy_label
  Copies the veriexec slot data from one label to another.

mpo_vnode_destroy_label
  Clears the veriexec slot data in a vnode label.

mpo_vnode_init_label
  Initializes the veriexec slot data in a vnode label.
  The fingerprint status for the file is stored in the veriexec slot data.

* Some sysctls, under security.mac.veriexec, for setting debug level,
  fetching the current state in a human-readable form, and dumping the
  fingerprint database are implemented.

* The MAC policy implementation source file also contains some utility
  functions.

* A set of fingerprint modules for the following cryptographic hash
  algorithms:
  RIPEMD-160, SHA1, SHA2-256, SHA2-384, SHA2-512

* Loadable module builds for MAC/veriexec and fingerprint modules.

 WARNING: Using veriexec with NFS (or other network-based) file systems is
          not recommended as one cannot guarantee the integrity of the files
          served, nor the uniqueness of file system identifiers which are
          used as key in the meta-data store.

Reviewed by: ian, jtl
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8554

5 years agoRevert r335276
Allan Jude [Wed, 20 Jun 2018 00:14:54 +0000 (00:14 +0000)]
Revert r335276

This was causing issues for people booting.
I will likely bring this back as an optional feature, similar to
boot0sio, like gptboot-serial or something.

PR: 221526
Reported by: O. Hartmann <ohartmann@walstatt.org>, Thomas Laus <lausts@acm.org>

5 years agoUse capsicum helpers to cache NLS data.
Mariusz Zaborski [Wed, 20 Jun 2018 00:13:09 +0000 (00:13 +0000)]
Use capsicum helpers to cache NLS data.

5 years agoTARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check.
Bryan Drewery [Tue, 19 Jun 2018 23:57:12 +0000 (23:57 +0000)]
TARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check.

This was missed in r335394 since the check became exists(/usr/local) in
my testing.

X-MFC-With: r335394
MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoConvert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.
Mariusz Zaborski [Tue, 19 Jun 2018 23:43:14 +0000 (23:43 +0000)]
Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.

No functional change intended.

5 years agoFix detection for binutils bootstrap package.
Bryan Drewery [Tue, 19 Jun 2018 23:40:42 +0000 (23:40 +0000)]
Fix detection for binutils bootstrap package.

The path was changed recently in the port to be the full target triple.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoLet CROSS_BINUTILS_PREFIX work without a trailing slash.
Bryan Drewery [Tue, 19 Jun 2018 23:40:39 +0000 (23:40 +0000)]
Let CROSS_BINUTILS_PREFIX work without a trailing slash.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoSYSTEM_COMPILER: Should use X_ vars for comparing wanted version.
Bryan Drewery [Tue, 19 Jun 2018 23:40:36 +0000 (23:40 +0000)]
SYSTEM_COMPILER: Should use X_ vars for comparing wanted version.

It is XCC used during the build of target binaries that replaces the
bootstrap compiler.

Also slightly tweak style.

MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agoFix X_COMPILER_* and X_LINKER_* not being passed to installworld environment.
Bryan Drewery [Tue, 19 Jun 2018 23:39:55 +0000 (23:39 +0000)]
Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment.

This could lead to 'sh: head: not found' warnings which were a symptom
of running 'ld --version' during installworld.  This was only happening
with XCC or XLD set.  It is intended that cc and ld do not run during
installworld.  The metadata for these are already stored in
compiler-metadata.mk added in r316794.

This also removes redundant CROSSENV additions that were for
WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN
which all don't have a cc or ld in their PATH during install.

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: Dell EMC

5 years agotop(1): fix top -mio
Eitan Adler [Tue, 19 Jun 2018 23:30:55 +0000 (23:30 +0000)]
top(1): fix top -mio

5 years agoFix typo.
Mariusz Zaborski [Tue, 19 Jun 2018 22:19:42 +0000 (22:19 +0000)]
Fix typo.

5 years agoFix typo noticed by pstef@.
Warner Losh [Tue, 19 Jun 2018 21:58:04 +0000 (21:58 +0000)]
Fix typo noticed by pstef@.

5 years agolinuxulator: handle V3 capget/capset
Ed Maste [Tue, 19 Jun 2018 21:26:23 +0000 (21:26 +0000)]
linuxulator: handle V3 capget/capset

Linux 2.6.26 introduced 64-bit capability sets.  Extend our stub
implementation to handle both 32- and 64-bit.  (We still report no
capabilities in capget, and disallow any in capset.)

Reviewed by: chuck
Sponsored by: Turing Robotic Industries Inc.
Differential Revision: https://reviews.freebsd.org/D15887

5 years agoMK_EFI - Add uefisign and friends to this knob and ensure that we don't
Sean Bruno [Tue, 19 Jun 2018 21:07:25 +0000 (21:07 +0000)]
MK_EFI - Add uefisign and friends to this knob and ensure that we don't
try to build them if MK_OPENSSL is unset.

Reviewed by: emaste imp kevans
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15211

5 years agoFix setting RCA for MMC cards
Ilya Bakulin [Tue, 19 Jun 2018 20:02:03 +0000 (20:02 +0000)]
Fix setting RCA for MMC cards

Unlike SD cards, that publish RCA in response to CMD3,
MMC cards expect the host to set RCA itself.

Since we don't support multiple MMC cards on the bus,
just assign a static RCA of 2 to the attached MMC card.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D13063

5 years agoDocument the new ${name}_env_file feature
Mark Felder [Tue, 19 Jun 2018 19:27:37 +0000 (19:27 +0000)]
Document the new ${name}_env_file feature

Approved by: bcr
MFH: 3 days
Differential Revision: https://reviews.freebsd.org/D15578

5 years agoReally fix the style.
Li-Wen Hsu [Tue, 19 Jun 2018 18:43:02 +0000 (18:43 +0000)]
Really fix the style.

Approved by: oshogbo
Sponsored by: The FreeBSD Foundation

5 years agotop(1): Fix Coverity warning
Alan Somers [Tue, 19 Jun 2018 18:32:06 +0000 (18:32 +0000)]
top(1): Fix Coverity warning

Don't call strerror on negative errnos

Reported by: Coverity
CID: 976708
Reviewed by: eadler
Differential Revision: https://reviews.freebsd.org/D15909

5 years agostyle(9) fix, I was also going to silence gcc.
Li-Wen Hsu [Tue, 19 Jun 2018 18:25:43 +0000 (18:25 +0000)]
style(9) fix, I was also going to silence gcc.

Approved by: emaste, oshogbo
Sponsored by: The FreeBSD Foundation

5 years agoSet prev to NULL so its garaunteed to have a value of some kind and
Sean Bruno [Tue, 19 Jun 2018 18:09:15 +0000 (18:09 +0000)]
Set prev to NULL so its garaunteed to have a value of some kind and
gcc doesn't explode.  Feel free to fix this correctly or whatever for
gcc builds.

This *should* quiesce tinderbox after r335347 for the gcc builds.

5 years agoaudit(4): add tests for sendmsg, recvmsg, shutdown, and sendfile
Alan Somers [Tue, 19 Jun 2018 17:41:46 +0000 (17:41 +0000)]
audit(4): add tests for sendmsg, recvmsg, shutdown, and sendfile

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15895

5 years agousr.bin/ar: remove incorrect SPDX tags
Ed Maste [Tue, 19 Jun 2018 17:30:11 +0000 (17:30 +0000)]
usr.bin/ar: remove incorrect SPDX tags

Three ar files have a non-standard variation of the BSD license, so
remove their SPDX tags.

Sponsored by: The FreeBSD Foundation

5 years agousr.bin/ar: use standard 2-Clause FreeBSD license
Ed Maste [Tue, 19 Jun 2018 17:28:05 +0000 (17:28 +0000)]
usr.bin/ar: use standard 2-Clause FreeBSD license

Many licenses on ar files contained small variations from the standard
FreeBSD license text. To avoid license proliferation switch to the usual
standard 2-clause FreeBSD license for those files where I have obtained
permission from all of the listed copyright holders.

Approved by: jkoshy, kaiw
Differential Revision: https://reviews.freebsd.org/D14561

5 years agoaudit(4): add tests for utimes(2) and friends, mprotect, and undelete
Alan Somers [Tue, 19 Jun 2018 16:55:39 +0000 (16:55 +0000)]
audit(4): add tests for utimes(2) and friends, mprotect, and undelete

Includes utimes(2), futimes(2), lutimes(2), futimesat(2), mprotect(2), and
undelete(2).  undelete, for now, is tested only in failure mode.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15893

5 years agoMove common GIC interrupt numbers to the common header. These are the same
Andrew Turner [Tue, 19 Jun 2018 16:14:23 +0000 (16:14 +0000)]
Move common GIC interrupt numbers to the common header. These are the same
across the GICv2 and GICv3 drivers so we only need a single copy of them.

Sponsored by: Turing Robotic Industries

5 years agoRemove "diff" line indicator. Next to see if this code works or not.
Sean Bruno [Tue, 19 Jun 2018 15:55:21 +0000 (15:55 +0000)]
Remove "diff" line indicator.  Next to see if this code works or not.

Submitted by: mmacy
Sponsored by: Limelight Networks

5 years agolualoader: Correct kernel_options handling
Kyle Evans [Tue, 19 Jun 2018 15:05:31 +0000 (15:05 +0000)]
lualoader: Correct kernel_options handling

`kernel_options` were being passed as flags to load, rather than to the
kernel being loaded. This is the kernel_options counterpart to r335009.

5 years agoo Implement unw_getcontext()
Ruslan Bukin [Tue, 19 Jun 2018 14:46:59 +0000 (14:46 +0000)]
o Implement unw_getcontext()
o Restore floating-point registers in jumpto()

These are required to native cross build GCC and GDB
(both do require libc++ and libunwind).

These are not tested.

Sponsored by: DARPA, AFRL

5 years agoDon't use TARGET_ARCH in this file, use MACHINE_ARCH instead.
Ruslan Bukin [Tue, 19 Jun 2018 13:28:02 +0000 (13:28 +0000)]
Don't use TARGET_ARCH in this file, use MACHINE_ARCH instead.

TARGET_ARCH is not defined when building ports/packages.

Sponsored by: DARPA, AFRL

5 years agoshare/misc/organization.dot: updates
Kurt Jaeger [Tue, 19 Jun 2018 12:16:19 +0000 (12:16 +0000)]
share/misc/organization.dot: updates

- add krion, philip to postmaster@
- remove trhodes from donations@, email bounces

Approved by: remko

5 years agoDon't try to turn power down MMC bus if it is already down
Ilya Bakulin [Tue, 19 Jun 2018 11:28:50 +0000 (11:28 +0000)]
Don't try to turn power down MMC bus if it is already down

Regulator framework doens't like turning off already turned off
regulators, so we get panic on AllWinner boards.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15890

5 years agoCorrectly define rawscr so initializing it doesn't result in overwriting memory.
Ilya Bakulin [Tue, 19 Jun 2018 11:25:40 +0000 (11:25 +0000)]
Correctly define rawscr so initializing it doesn't result in overwriting memory.

We need 8 bytes of storage for rawscr.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15889

5 years agoSet MMC_DATA_MULTI flag when doing multi-block transfers
Ilya Bakulin [Tue, 19 Jun 2018 11:23:48 +0000 (11:23 +0000)]
Set MMC_DATA_MULTI flag when doing multi-block transfers

Lower layers (MMC / SDHCI controller drivers) may make certain decisions
based on the presence of this flag. The fact that sdhci.c doesn't
look at this flag is another problem that should be fixed separately.

Found when adding MMCCAM support to AllWinner MMC controller driver
where the presence of this flag actually matters.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D15888

5 years agoMake sure that the t_peakrate_thr is not compiled in
Randall Stewart [Tue, 19 Jun 2018 11:20:28 +0000 (11:20 +0000)]
Make sure that the t_peakrate_thr is not compiled in
by default until NF can upstream it.

Reviewed by: and suggested lstewart
Sponsored by: Netflix Inc.

5 years agoMove BPFIF_* macro definitions into .c file, where struct bpf_if is
Andrey V. Elsukov [Tue, 19 Jun 2018 10:34:45 +0000 (10:34 +0000)]
Move BPFIF_* macro definitions into .c file, where struct bpf_if is
declared.

They are only used in this file and there is no need to export them via
bpfdesc.h.

5 years agoMove the tp set back to where it was before
Randall Stewart [Tue, 19 Jun 2018 05:28:14 +0000 (05:28 +0000)]
Move the tp set back to where it was before
we started playing with the VNET sets. This
way we have verified the INP settings before
we go to the trouble of de-referencing it.

Reviewed by: and suggested by lstewart
Sponsored by: Netflix Inc.

5 years agotop(1): correct assertion
Eitan Adler [Tue, 19 Jun 2018 05:01:07 +0000 (05:01 +0000)]
top(1): correct assertion

5 years agotop(1): correct header in UP mode
Eitan Adler [Tue, 19 Jun 2018 04:18:23 +0000 (04:18 +0000)]
top(1): correct header in UP mode

Fix an oversight from r334869 which made the same change, but only for
SMP systems. This avoids a segfault while D15801 is being reviewed.

Reviewed by: kevans

5 years agoixl(4): Remove ixlvc.c from files.amd64
Eric Joyner [Tue, 19 Jun 2018 03:11:09 +0000 (03:11 +0000)]
ixl(4): Remove ixlvc.c from files.amd64

ixlvc.c is only used by the VF driver (ixlv), and that driver currently doesn't work.

It will be re-added once the VF driver is finished being ported to iflib.

5 years agoremove ixl iwarp and ixlv from the build until they are in a working state
Matt Macy [Tue, 19 Jun 2018 02:48:53 +0000 (02:48 +0000)]
remove ixl iwarp and ixlv from the build until they are in a working state

5 years agoconvert inpcbinfo hash and info rwlocks to epoch + mutex
Matt Macy [Tue, 19 Jun 2018 01:54:00 +0000 (01:54 +0000)]
convert inpcbinfo hash and info rwlocks to epoch + mutex

- Convert inpcbinfo info & hash locks to epoch for read and mutex for write
- Garbage collect code that handled INP_INFO_TRY_RLOCK failures as
  INP_INFO_RLOCK which can no longer fail

When running 64 netperfs sending minimal sized packets on a 2x8x2 reduces
unhalted core cycles samples in rwlock rlock/runlock in udp_send from 51% to
3%.

Overall packet throughput rate limited by CPU affinity and NIC driver design
choices.

On the receiver unhalted core cycles samples in in_pcblookup_hash went from
13% to to 1.6%

Tested by LLNW and pho@

Reviewed by: jtl
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15686

5 years agoFix amq -i timestamp segmentation violation.
Cy Schubert [Tue, 19 Jun 2018 01:33:03 +0000 (01:33 +0000)]
Fix amq -i timestamp segmentation violation.

MFC after: 1 week

5 years agoaudit(4): add tests for ioctl(2)
Alan Somers [Tue, 19 Jun 2018 01:32:33 +0000 (01:32 +0000)]
audit(4): add tests for ioctl(2)

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15872

5 years agoDon't bootstrap lld if an external linker is used.
Bryan Drewery [Tue, 19 Jun 2018 01:00:27 +0000 (01:00 +0000)]
Don't bootstrap lld if an external linker is used.

Sponsored by: Dell EMC

5 years agocxgbe(4): Some mailbox commands require access to the Tx pipeline and
Navdeep Parhar [Tue, 19 Jun 2018 00:50:27 +0000 (00:50 +0000)]
cxgbe(4): Some mailbox commands require access to the Tx pipeline and
can time out if it's backed up due to a non-stop deluge of PAUSE frames
from a misbehaving peer.  Detect this situation and toggle MPS TxEn
to allow forward progress.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

5 years agortwn(4): decode some bit fields + merge duplicate code.
Andriy Voskoboinyk [Tue, 19 Jun 2018 00:38:28 +0000 (00:38 +0000)]
rtwn(4): decode some bit fields + merge duplicate code.

Add macros for R12A_RXDMA_PRO register (descriptions were seen in the
RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies.

No functional change intended.

5 years agoAdd my script for coping with git-svn and the need to rebase
Warner Losh [Tue, 19 Jun 2018 00:27:30 +0000 (00:27 +0000)]
Add my script for coping with git-svn and the need to rebase
changes for different branches. It's a bit rough right now,
but should be good enough for most people to try to use. It's
definitely 'tools' tree quality.

5 years agoSwitch to creating UEFI ESPs using loader.efi instead of boot1.efi.
Warner Losh [Mon, 18 Jun 2018 23:16:47 +0000 (23:16 +0000)]
Switch to creating UEFI ESPs using loader.efi instead of boot1.efi.
Cope for the fact that laoder.efi, not being boot1, doesn't read
/boot.config by setting boot_serial and force the serial console.

Also add sysctl so we can display the boot method.

Provide a variable, do_boot1_efi, if you want to use boot1 for
testing. But since it's transient, it's just a variable and not
available on the command line.

5 years agolibnv: add note about nvlist_pack and nvlist_unpack
Mariusz Zaborski [Mon, 18 Jun 2018 23:00:15 +0000 (23:00 +0000)]
libnv: add note about nvlist_pack and nvlist_unpack

Fix small typo as well.

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

5 years agolibnv: Add nvlist_append_*_array() family of functions.
Mariusz Zaborski [Mon, 18 Jun 2018 22:57:32 +0000 (22:57 +0000)]
libnv: Add nvlist_append_*_array() family of functions.

The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions
allows to dynamically extend array stored in the nvlist.

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

5 years agoremove epoch_test from default build
Matt Macy [Mon, 18 Jun 2018 22:27:29 +0000 (22:27 +0000)]
remove epoch_test from default build

5 years agolibnv: add regression test for r335344.
Mariusz Zaborski [Mon, 18 Jun 2018 22:22:06 +0000 (22:22 +0000)]
libnv: add regression test for r335344.

5 years agolibnv: clean parent in nvlist_array when removing it.
Mariusz Zaborski [Mon, 18 Jun 2018 22:21:28 +0000 (22:21 +0000)]
libnv: clean parent in nvlist_array when removing it.

When we are removing element form the nvlist we should also clean parent,
because the array is not a part of the nvlist anymore.

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

5 years agolibnv: Remove nvlist argument from cnvlist_{take,free}_* functions.
Mariusz Zaborski [Mon, 18 Jun 2018 21:26:58 +0000 (21:26 +0000)]
libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.

All information which are need for those operations is already stored in
the cookie.

We decided not to bump libnv version because this API is not used yet in the
base system.

Reviewed by: pjd

5 years agolibnv: add const to cookies arguments
Mariusz Zaborski [Mon, 18 Jun 2018 21:23:40 +0000 (21:23 +0000)]
libnv: add const to cookies arguments

Pointed out by: pjd@

5 years agolibnv: change name of cookie from cookiep to cookie.
Mariusz Zaborski [Mon, 18 Jun 2018 21:18:20 +0000 (21:18 +0000)]
libnv: change name of cookie from cookiep to cookie.

The name was inconsistent with rest of the library.
No functional change intended.

Pointed out by: pjd@

5 years agoixl(4): Update version number to 2.0.0-k
Eric Joyner [Mon, 18 Jun 2018 20:32:53 +0000 (20:32 +0000)]
ixl(4): Update version number to 2.0.0-k

And update copyrights to current year.

MFC after: 1 month
Sponsored by: Intel Corporation

5 years agoixl(4): Update to use iflib
Eric Joyner [Mon, 18 Jun 2018 20:12:54 +0000 (20:12 +0000)]
ixl(4): Update to use iflib

Update the driver to use iflib in order to bring performance,
maintainability, and (hopefully) stability benefits to the driver.

The driver currently isn't completely ported; features that are missing:

- VF driver (ixlv)
- SR-IOV host support
- RDMA support

The plan is to have these re-added to the driver before the next FreeBSD release.

Reviewed by: gallatin@
Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com
Tested by: jeffrey.e.pieper@intel.com
MFC after: 1 month
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15577

5 years agoRemove stray debugging line.
Warner Losh [Mon, 18 Jun 2018 19:53:11 +0000 (19:53 +0000)]
Remove stray debugging line.

Noticed by: ian@

5 years agoRemove now-empty geli directory
Warner Losh [Mon, 18 Jun 2018 19:40:21 +0000 (19:40 +0000)]
Remove now-empty geli directory

5 years agoIntroduce arm64 linuxulator stubs
Ed Maste [Mon, 18 Jun 2018 19:34:34 +0000 (19:34 +0000)]
Introduce arm64 linuxulator stubs

This provides stub implementations of arm64 Linux vdso and machdep,
ptrace, and futex sufficient for executing an arm64 Linux 'hello world'
binary.

Reviewed by: andrew
Sponsored by: Turing Robotic Industries
Differential Revision: https://reviews.freebsd.org/D15832

5 years agolinuxulator: add debugging for invalid capget/capset version
Ed Maste [Mon, 18 Jun 2018 18:43:45 +0000 (18:43 +0000)]
linuxulator: add debugging for invalid capget/capset version

Sponsored by: Turing Robotic Industries Inc.

5 years agoThe IP, TCP, and UDP provider report IP addresses as strings.
Michael Tuexen [Mon, 18 Jun 2018 18:35:29 +0000 (18:35 +0000)]
The IP, TCP, and UDP provider report IP addresses as strings.
In some cases, the required information is not available and the
UDP provider reported an empty string in this case and the IP
and TCP provider reported a NULL pointer.

This patch changes the value provided in this case to the string
"<unknown>". This make the behaviour consistent and in-line with
the behaviour of Solaris.

Reviewed by: markj@, dteske@, gnn@
Differential Revision: https://reviews.freebsd.org/D15855

5 years agoRegen arm64 linuxulator sysent files after r335323
Ed Maste [Mon, 18 Jun 2018 18:10:11 +0000 (18:10 +0000)]
Regen arm64 linuxulator sysent files after r335323

5 years agoarm64 linuxulator: add dup syscall entry
Ed Maste [Mon, 18 Jun 2018 18:08:19 +0000 (18:08 +0000)]
arm64 linuxulator: add dup syscall entry

Missed in r333027

Sponsored by: Turing Robotic Industries Inc.

5 years agoiflib: Style fixes
Eric Joyner [Mon, 18 Jun 2018 17:27:43 +0000 (17:27 +0000)]
iflib: Style fixes

MFC after: 1 week

5 years agostand: move libgeliboot into libsa.
Warner Losh [Mon, 18 Jun 2018 16:24:42 +0000 (16:24 +0000)]
stand: move libgeliboot into libsa.

Reduce by 1 the number of crazy libraries we need in stand by moving
geli into libsa (where architecturally it belonged all along). This
just moves things around without any code changes.

5 years agoaudit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr
Alan Somers [Mon, 18 Jun 2018 15:37:43 +0000 (15:37 +0000)]
audit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15871

5 years agoaudit(4): add tests for send, recv, sendto, and recvfrom
Alan Somers [Mon, 18 Jun 2018 15:27:31 +0000 (15:27 +0000)]
audit(4): add tests for send, recv, sendto, and recvfrom

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15869

5 years agoaudit(4): add tests for extattr_set_file and friends
Alan Somers [Mon, 18 Jun 2018 15:07:10 +0000 (15:07 +0000)]
audit(4): add tests for extattr_set_file and friends

Includes extattr_{set_file, _set_fd, _set_link, _delete_file, _delete_fd,
_delete_link}

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15867

5 years agoMove to using the inp->vnet pointer has suggested by lstewart.
Randall Stewart [Mon, 18 Jun 2018 14:10:12 +0000 (14:10 +0000)]
Move to using the inp->vnet pointer has suggested by lstewart.
This is far better since the hpts system is using the inp
as its basis anyway. Unfortunately his comments came late.

Sponsored by: Netflix Inc.

5 years agoImprove spelling and capitalize "Kerberos".
Edward Tomasz Napierala [Mon, 18 Jun 2018 13:49:44 +0000 (13:49 +0000)]
Improve spelling and capitalize "Kerberos".

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agolinsysfs: depend on linux_common module on arm64, as on amd64
Ed Maste [Mon, 18 Jun 2018 13:26:45 +0000 (13:26 +0000)]
linsysfs: depend on linux_common module on arm64, as on amd64

Sponsored by: Turing Robotic Industries

5 years agoFix bad logic in iovlist_truncate().
Ed Schouten [Mon, 18 Jun 2018 06:01:28 +0000 (06:01 +0000)]
Fix bad logic in iovlist_truncate().

To conform to RFC 5426, this function is intended to truncate messages
if they exceed the message size limits. Unfortunately, the amount of
space was computed the wrong way around, causing messages to be
truncated entirely.

Reported by: Michael Grimm on stable@
MFC after: 3 days

5 years agolibcapsicum: adding missing man page links
Eitan Adler [Mon, 18 Jun 2018 04:58:48 +0000 (04:58 +0000)]
libcapsicum: adding missing man page links

5 years agodc: make use of caph_enter
Eitan Adler [Mon, 18 Jun 2018 04:54:09 +0000 (04:54 +0000)]
dc: make use of caph_enter

We already use caph library so this makes sense.

5 years agoFix 32-bit build after 335307
Alan Somers [Mon, 18 Jun 2018 04:12:58 +0000 (04:12 +0000)]
Fix 32-bit build after 335307

This was correct in the final version on Phabricator, but somehow I screwed
up applying the patch locally.

Reported by: linimon
Pointy-hat-to: asomers
MFC after: 2 weeks
X-MFC-With: 335307

5 years agotop(1): use more modern signal code
Eitan Adler [Mon, 18 Jun 2018 02:06:16 +0000 (02:06 +0000)]
top(1): use more modern signal code

Rather than manually build signal masks use functions designed for that
reason. Also use sigprocmask instead of sigblock.

5 years agoRevert r335263, since it can cause crashes in unusual circumstances.
Rick Macklem [Sun, 17 Jun 2018 23:08:54 +0000 (23:08 +0000)]
Revert r335263, since it can cause crashes in unusual circumstances.
This needs to be fixed in a different way.

5 years agobsdconfig: Fix a bug when editing users
Devin Teske [Sun, 17 Jun 2018 22:09:43 +0000 (22:09 +0000)]
bsdconfig: Fix a bug when editing users

The usermgmt API was stomping on a global ($user_gid to be specific)
so things would appear to work fine until you tried to make a second
pass into the API with the now-tainted variable contents.

Fixed by localizing menu-specific contents as to not leak outside API.

PR: bin/208774
Reported by: Martin Waschbuesch <martin@waschbuesch.de>
MFC after: 1 week
X-MFC-to: stable/11, stable/10
Sponsored by: Smule, Inc.

5 years agoaudit(4): add tests for Sys V shared memory syscalls
Alan Somers [Sun, 17 Jun 2018 21:29:35 +0000 (21:29 +0000)]
audit(4): add tests for Sys V shared memory syscalls

includes shmget, shmat, shmdt, and shmctl

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D15860

5 years agobsdconfig: Make examples optional
Devin Teske [Sun, 17 Jun 2018 21:09:21 +0000 (21:09 +0000)]
bsdconfig: Make examples optional

PR: bin/228485
Submitted by: Dmitry Wagin <dmitry.wagin@ya.ru>
Reported by: Dmitry Wagin <dmitry.wagin@ya.ru>
MFC after: 1 week
Sponsored by: Smule, Inc.

5 years agoUpdate VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers
Bryan Venteicher [Sun, 17 Jun 2018 20:45:48 +0000 (20:45 +0000)]
Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers